Due to a quirk of history (namely, programmers having a poor
understanding of the mod inheritance system), Gen 3 inherited from
Gen 5 for a long time, resulting in a lot of duplicate code.
This commit changes up the inheritance system and removes some
duplicate code (specifically, statuses.js and moves.js besides
Metronome and Mirror Move which need more investigation), the rest is
reserved for a future commit.
Corrects all of the following
Gen 2: lasts 2-3 turns
Gen 3: can't hit Ghosts
Gen 4: can hit Ghosts, stops immediately when the user falls asleep or
becomes frozen
Gens 2-6: Stops immediately when the user is prevented from moving
- No longer affected by weakness and resistance
- No longer affected by damage modifiers on attacker (Choice Band,
Huge Power, etc)
- Gen 2-3 now uses Gen 4 Beat Up system
This utilizes the new `eventOnly` and `eventOnlyHidden` flags.
`unobtainableShiny` is not necessary for event only Pokemon.
This also includes various fixes such as duplicate events and missing
data entries.
- Doom Desire/Future Sight now calculate accuracy when hit, not when
the move is used
- Doom Desire/Future Sight are now limit 1 per defender slot, not 1
per attacker slot
- Doom Desire/Future Sight in gen 4 and earlier now have their damage
calculated on use, rather than on hit
- Doom Desire/Future Sight in gen 4 and earlier now deal typeless
damage, and are not subject to STAB, weakness, resistance, or
immunity
- Doom Desire/Future Sight in gen 4 and earlier now can't critical
hit
- Doom Desire is now Physical in gen 3
Implemented a new priorityEvent function that is set to abort when any
event handler returns a non-undefined result, unlike runEvent which waits
until all event handlers have run. Set RedirectTarget to use this event.
Changed ability/move priorities for RedirectTarget handlers to fit under
this new paradigm.
Added new Lightning Rod and Storm Drain tests to ensure proper behavior.
- Basically, a counter separate from the sleep counter starts at 0, and
attempting to use Sleep Talk or Snore while asleep increments it by 1.
- If the Pokemon attempts to use any other move while asleep, this
counter is reset to 0.
- If the Pokemon switches out while asleep, the current value of the
counter is added to the sleep counter.