lhearachel / plat-engine

MIT License
3 stars 2 forks source link

Contrary #44

Closed lhearachel closed 1 year ago

lhearachel commented 1 year ago

Documentation

https://bulbapedia.bulbagarden.net/wiki/Contrary_(Ability)

This Ability inverts all changes to the stat stages of a Pokémon with this Ability; if an effect would lower a stat, it is increased instead, and if an effect would increase a stat, it is decreased instead. Effects that change a Pokémon's stats without affecting stat stages, such as Guts and paralysis, are not affected by Contrary.

Mist (including from Guard Spec.) takes into account Contrary's inversion before determining whether to block the stat change. For example, if a Pokémon with Contrary is targeted by String Shot while protected by Mist, it will gain Speed; if a Pokémon with Contrary is targeted by Swagger while protected by Mist, its Attack will not be changed.

Relevant Code Points

Function 0x02242400 handles the code behind script command StatBoostChange; this function needs to be updated to check for Contrary and invert the number of stages accordingly.