Hiya. I'm creating a simple community engine so that people can create Pokémon JRPGs in which you play as Pokémon instead of trainers. I've gotten most of the skills down, but for some reason I don't seem to do damage to enemies in testing.
Here is the damage formula according to Bulbapedia:
So, for example here is what I have for the move "Tacke":
The damage formula for "Tackle" is:
(((2 * level + 10)/250) * (a.atk/b.def) * 50 + 2) * a.element_rate(20) * (93/100)
"Level" is level 30. User's attack is 43. Enemy's defense was modified to be 1 (and I still can't do damage). The "50" is the move's base power. "a.element_rate(20)" is for the element "Normal STAB", which is 150% for the class the user is. This accounts for STAB (same-type attack bonus), meaning damage should be 150% of normal if applicable (but not for "Tackle" here). The last part is coupled with the move's Variance of 7% to account for "random ∈ [0.86, 1]", which is close enough to the official thing.
My user's class HIT is + 100%, too. And I thought we didn't have to list EVA for anyone.
The result is, every time I use any move, it always says "Enemy X took no damage!" What am I doing wrong?