I could use some help with a damage formula. What I have is this:
((((a.atk/2)+P)-(b.def/4))*(((100-b.def)/100)+1)).to_i
Basically, the first half of the formula, (((a.atk/2)+P)-(b.def/4)) is supposed to calculate the base damage. Then, the second half, *(((100-b.def)/100)+1) is supposed to use the target's DEF as a % reduction for the base damage.
P is replaced by a power modifier that I assign to each skill. When I plug this in to my calculator I get a different result than what I am seeing when I test battle. For example:
((((a.atk/2)+5)-(b.def/4))*(((100-b.def)/100)+1)).to_i
((((6/2)+5)-(5/4))*(((100-5)/100)+1)).to_i
In my calculator this come out to be 13. In my test battles this is dealing 7 damage. I have double checked to make sure there aren't any states or elemental effective settings modifying the damage. Is there something really obvious I'm missing?
((((a.atk/2)+P)-(b.def/4))*(((100-b.def)/100)+1)).to_i
Basically, the first half of the formula, (((a.atk/2)+P)-(b.def/4)) is supposed to calculate the base damage. Then, the second half, *(((100-b.def)/100)+1) is supposed to use the target's DEF as a % reduction for the base damage.
P is replaced by a power modifier that I assign to each skill. When I plug this in to my calculator I get a different result than what I am seeing when I test battle. For example:
((((a.atk/2)+5)-(b.def/4))*(((100-b.def)/100)+1)).to_i
((((6/2)+5)-(5/4))*(((100-5)/100)+1)).to_i
In my calculator this come out to be 13. In my test battles this is dealing 7 damage. I have double checked to make sure there aren't any states or elemental effective settings modifying the damage. Is there something really obvious I'm missing?