Random team generation scripts are no longer in scripts.js, but instead
in a new file random-teams.js.
The scripts are now also no longer run from inside battles, but in a
new team generator object. This makes it easier for external scripts
to generate random teams by running Dex.generateTeam(format).
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.
This change is significant due to residual handling and self-destruct.
Explosion and Self-Destruct end the turn if the Pokémon is faster, just like on other past gens.
This is really relevant for turn order and residual order on gen 3.
Gen 3's getDamage is a clone of an older Gen 5's version.
Delete it for now, since it has no reason to exist until differences
in that function have to be added for gen 3.
During initialisation of Tools, each new mod no longer makes a copy
of every data object from the parent mod. Instead, a new object is
created when and only when the mod actually makes changes to a
particular object. In other words, this is a "copy-on-write" system.
Damage categories are now read using .getCategory, which gen 3 overrides.
move.category can still be read directly to check if something's a status
move, but it should never be used for reading damage categories.
This also fixes a crash in gen 3 and makes it playable again.