Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In Gen 4, the combination Klutz + Iron Ball is not properly handled #560

Closed
UnderscorePoY opened this issue Jul 12, 2023 · 5 comments · Fixed by #562
Closed

In Gen 4, the combination Klutz + Iron Ball is not properly handled #560

UnderscorePoY opened this issue Jul 12, 2023 · 5 comments · Fixed by #562

Comments

@UnderscorePoY
Copy link

UnderscorePoY commented Jul 12, 2023

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 :
2023-07-12 15_31_40-Pokémon Damage Calculator — Mozilla Firefox

@shrianshChari
Copy link
Contributor

What does it look like when you remove the Klutz ability?

@UnderscorePoY
Copy link
Author

The Iron Ball speed drop is properly applied.

2023-07-12 21_44_55-Pokémon Damage Calculator — Mozilla Firefox

@UnderscorePoY
Copy link
Author

UnderscorePoY commented Jul 12, 2023

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.

@shrianshChari
Copy link
Contributor

shrianshChari commented Jul 12, 2023

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.

@UnderscorePoY
Copy link
Author

UnderscorePoY commented Jul 13, 2023

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.

thejetou pushed a commit that referenced this issue Oct 7, 2023
In Generation 4, if a Pokemon with the ability Klutz holds
an Iron Ball it should still get its Speed dropped. However, Klutz
Pokemon holding an Iron Ball won't be grounded.

Fixes #560
ForwardFeed pushed a commit to ForwardFeed/damage-calc that referenced this issue Oct 28, 2023
In Generation 4, if a Pokemon with the ability Klutz holds
an Iron Ball it should still get its Speed dropped. However, Klutz
Pokemon holding an Iron Ball won't be grounded.

Fixes smogon#560
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants