- Fix Micle Berry (and Custap Berry, in Gen 4) to properly trigger with Gluttony
- Make Micle Berry's volatile references consistent with the rest of the codebase
- Properly alphabetize Moon Ball
Life Orb uses now BattlePokemon.prototype.modify which does the correct calculator for damage modifiers and in the correct order thanks to the ModifyDamage event.
This doesn't yet handle modded formats that don't validate ability
selection in the ordinary manner. Those formats will continue to work
essentially in the same manner as before, rather than with the correct
mechanics.
Gems now boost all hits of a spread move.
This introduces a new event BasePowerMultiplier, so that gems actually
activate at the right time now.
The name is similar to basePowerModifier but they do the same thing
anyway. We should probably figure something out for their naming,
though.
Damage halving Berries were being used on Substitute being hit.
This was not correct, so if the user has a Substitue volatile
the berry will not be consumed.
- Stats are now cached and recalculated every clearVolatile (switchout)
- Power Trick, Power Split, Guard Split, Transform, forme changes now
modify the cached stat value
- This eliminates the need for pokemon.baseSet, so it's been removed
- pokemon.transformInto has been split into transformInto and formeChange
- pokemon.baseBoosts have also been eliminated, boost changes are now
calculated on-the-fly like stats themselves
- Overall, stat changes should be a lot more like the cartridge games now
- We're also one step closer to finally getting rid of the ModifyPokemon
event
Two-turn moves are now controlled by a volatile, twoturnmove, which determines whether a Pokemon executes the charge turn or the move turn of a two-turn move. This handles mechanics like Truant Pokemon being unable to use two-turn moves, as the execution turn is their truancy turn. It also handles various edge cases involving moves that call other moves (e.g. Metronome) and Encore.
These changes add a new event, onChargeMove, in which one can return false to "skip" the charging turn and execute the move in full immediately. For example, Solarbeam returns false in onChargeMove if the weather is sunny, and Power Herb returns false if the Pokemon uses its item successfully. (Actually, those are the only two examples at present.)
This implementation is complete except for one issue, an inversion of a previous problem: whereas before, moves like Assist calling two-turn moves would execute them immediately, now, only the charge turn will be executed, and the Pokemon will not be locked into the move. This is due to be fixed soon.