I've been trying out different formulas lately but for some reason, it isn't working out for me.
I'm still new to damage formulas so I probably have made a mistake.
This is the formula I made;
damage = (Math.sqrt(a.atk * 2) / Math.sqrt(b.def * 4)) {
if (a.isStateAffected(17)) { damage *= 1.4 }
if (a.atk === 99) { damage *= >=2 && <=10 }
if (damage <= 0) { damage = 1 }
}
What I'm trying to do is √(attack stats of attacker * 2), then I divide it with √(defense stats of defender * 4)
This will be the base power for the skill represented by this
damage = (Math.sqrt(a.atk * 2) / Math.sqrt(b.def * 4))
Then the formula would consider whether or the attack stat for the attacker is doubled (that would be indicated by status number 17 which is Atk Up), if so then the base attack would be multiplied by 1.4, which is represented by this
if (a.isStateAffected(17)) { damage *= 1.4 }
Then if the formula would check if the attackers atk stats is 99 (which is the maximum in the game), if so then the attack would be multiplied between 2 up to 10.
if (a.atk === 99) { damage *= >=2 && <=10 }
And finally, the formula would check whether the total attack is 0, if so the damage becomes 1
if (damage <= 0) { damage = 1 }
This is what I had planned but then every time I tried it out, the damage total is 0
I feel like I'm doing something wrong but I can't figure out what exactly?
What do you think I should change?
I'm still new to damage formulas so I probably have made a mistake.
This is the formula I made;
damage = (Math.sqrt(a.atk * 2) / Math.sqrt(b.def * 4)) {
if (a.isStateAffected(17)) { damage *= 1.4 }
if (a.atk === 99) { damage *= >=2 && <=10 }
if (damage <= 0) { damage = 1 }
}
What I'm trying to do is √(attack stats of attacker * 2), then I divide it with √(defense stats of defender * 4)
This will be the base power for the skill represented by this
damage = (Math.sqrt(a.atk * 2) / Math.sqrt(b.def * 4))
Then the formula would consider whether or the attack stat for the attacker is doubled (that would be indicated by status number 17 which is Atk Up), if so then the base attack would be multiplied by 1.4, which is represented by this
if (a.isStateAffected(17)) { damage *= 1.4 }
Then if the formula would check if the attackers atk stats is 99 (which is the maximum in the game), if so then the attack would be multiplied between 2 up to 10.
if (a.atk === 99) { damage *= >=2 && <=10 }
And finally, the formula would check whether the total attack is 0, if so the damage becomes 1
if (damage <= 0) { damage = 1 }
This is what I had planned but then every time I tried it out, the damage total is 0
I feel like I'm doing something wrong but I can't figure out what exactly?
What do you think I should change?