What is the actual pokémon damage formula?

1 minute read

Bulbapedia statesthat the pokémon damage formula isfloor(((2 * L + 10) / 250) * (A / D) * B + 2):

However, when I was reading thesource code of Pokémon ShowdownI found that the damage formula that they are using isfloor(floor(floor(2 * L / 5 + 2) * B * A / D) / 50) + 2before multiplying the modifier.

Do these two equationsalwaysproduce the same answer? If not then which one is the correct one?

Pleaselog inorregisterto add a comment.

Pleaselog inorregisterto add a comment.

They equal the same thing.If you care about how they are the same, you present the first +2 as +10/5, like so:

= (2 * L / 5 + 2) * B * A / D) / 50) + 2= ((2 * L + 10) / 5) * B * A / D) / 50) + 2

And then you can multiply the /5 and the /50 to make it /250 in the first bit, and then present theB * A * Dbit as(A * D) * B, like so:

= ((2 * L / 10) / 5) * B * A / D) / 50) + 2= ((2 * L + 10) / 250) * B * A / D) + 2= ((2 * L + 10) / 250) * (A / D) * B + 2

And now it’s exactly like Bulbapedia’s formula! You can substitute the same values into each formula to confirm that they both equal the same thing. Sorry if that was a bad explanation. It’s not easy explaining math in words. It’s not even important anyway.

Sometimes people like changing a formula to make it look neater. Bulbapedia’s equation format looks nice when it is presented how it is in that image, but Showdown’s equation format is good when you must keep your equation to one line, like in coding.

Hope I helped. :)