Code:
switch (diffSetting) {
case 0:
var total = 0;
for (var i = 0; i < this.enemy().params[paramId].length; i++) {
total = this.enemy().params[i] * easyParam[i];
}
console.log(total);
return this.enemy().params[total];
break;I'm thinking I either am setting up the loop wrong, or I'm using the wrong array.
EDIT:
Well I thought I found an easier way to do this (less code), but I keep getting an "unexpected '=>'" found. I'm not sure if this engine doesn;t support it, or I'm using it wrong (most likely case)
Code:
var enp = this.enemy().params[paramId];
var esp = easyParam;
var total = enp.map((a, i) => a + esp[i]).reduce((t, n) => t * n);
console.log(this.enemy().params[total])
return this.enemy().params[total];EDIT2:
I am an absolute idiot. Like really. I tried to make this more complicated then it really is LOL.
Code:
Man oh man... var easyDifficulty = Math.floor(this.enemy().params[paramId] * easyParam[paramId]);
return easyDifficulty;