Closed UnderscorePoY closed 11 months ago
What does it look like when you remove the Klutz ability?
The Iron Ball speed drop is properly applied.
I suspect the issue comes from the fact that checkItem
gets rid of the item entirely if Klutz is the Ability. Since checkItem
is common to all generations, one might want to keep track of the old item near the start of calculateDPP
and compare with it on this line.
That line appears to deal with the grounding effect of Iron Ball, which according to Bulbapedia, gets ignored by Klutz. In other words, Klutz allows the speed to be halved still, but doesn't allow the Pokemon to be grounded. However, this line and this line might have something to do with how the damage calc handles the speed of the Pokemon.
You're right, i linked you to a completely wrong reference, sorry about this.
Your second link is the checkItem
function that is common to all generations. Probably not being modified, due to possible side effects in the other calculators split per generation.
Your first link is indeed where the speed drop is supposed to be applied, but since checkItem
was already called previously and discards the item even in the case of an Iron Ball, the item is gone. Thus the drop is not put inside speedMods
.
Bulbapedia and this code comment agree that when a Pokémon with Klutz holds an Iron Ball, the speed drop should still be applied. This is not the case with the current implementation, as shown in this image :