As gen 1, Stadium has its own stat modifying mechanics.
It's basically an extension of gen 1's, only it changes the approach and runs a recalculation on all changes only for the proper Pokémon.
Unlike battle-engine.js, old gens did not check if move.ignoreImmunity was
undefined/false in their getDamage functions, causing crashes when numbers
were passed in to the function.
While move.affectedByImmunities was always a Boolean value to denote if
the move was affected by immunities, move.ignoreImmunity can be a Boolean
value if it ignores or is affected by all type immunities, but also can
act as an object such that !!move.ignoreImmunity[type] means it ignores
immunities of that type.
This commit implements at its full the Stadium format.
Stadium is a half-generation between Gen 1 and Gen 2, widely regarded as a Gen 1 game without the major gen 1 bugs.
The main changes of this game are:
Sleep lasts between 1 and 3 turns.
Hyper Beam does recharge after a faint.
Critical hits happen way less.
Substitute now blocks all status ailments and draining.
It allows tradebacks.
Partial trapping moves miss and stop their duration upon target switch.
Focus Energy actually works.
Stat calculations are done properly, burn and para drop are lost if you lose status.