lhearachel / plat-engine

MIT License
3 stars 2 forks source link

Moody #54

Open lhearachel opened 1 year ago

lhearachel commented 1 year ago

Documentation

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

At the end of each turn, Moody raises one of the stats of the Pokémon with this Ability by two stages (at random), then decreases another stat by one stage (at random).

Moody will not attempt to lower a stat that is already at -6 or attempt to increase a stat that is already at +6. Moody will not select the same stat to lower as it raised. If all stats are already at +6, Moody will only decrease one random stat; likewise, if all stats are already at -6, Moody will only increase one random stat.

Relevant Code Points

Function 0x022562E8 contains all of the checks for end-of-turn abilities (e.g., Speed Boost). We need the following:

  1. Add a check to this function for Moody which invokes a Moody subscript.
  2. A subscript for Moody which generates the stats to be affected and applies the resulting boosts.