This is a surprisingly minor refactor considering how many files it
touches, but most of this is only renames.
In terms of file renames:
- `tools.js` is now `sim/dex.js`
- `battle-engine.js` is now `sim/index.js` and its three classes are
in `sim/battle.js`, `sim/side.js`, and `sim/pokemon.js`
- `prng.js` is now `sim/prng.js`
In terms of variable renames:
- `Tools` is now `Dex`
- `BattleEngine` is now `Sim`
- `BattleEngine.Battle` is now `Sim.Battle`
- `BattleEngine.BattleSide` is now `Sim.Side`
- `BattleEngine.BattlePokemon` is now `Sim.Pokemon`
Previously, only CAP Pokemon were allowed to hold Crucibellite, even in CAP, and they've apparently been able to hold Berserk Gene and other Gen 2 items this whole time.
PS's choice system has now been majorly rewritten!
Battle#parseChoice has been eliminated, and Battle#choose is now a
very lightweight wrapper around the BattleSide#choose* functions, which
now handle validation.
Partial decisions have been mostly removed. You can manually construct
decisions partially with the side.choose* functions, but there's no
other support for them. Partial undo has been removed completely.
Choice tracking has been renamed from side.choiceData to side.choice.
side.choices has been removed and is now autogenerated from side.choice
when needed.
side.choiceData.decisions has been renamed side.choice.actions. In the
future, "decision" is a deprecated term and should be called "action"
wherever it shows up.
side.choiceData.waiting and side.getDecisionsFinished() have been
merged into side.isChoiceDone().
Other values in side.choiceData have either been rendered unnecessary
or renamed to something clearer.
The "skip" and "pass" choices have been merged together. Passes can
still be filled in automatically (so you can just use `/move 1` in
doubles when you have only one Pokémon left).
Because of the way fastUnpackTeam works, it's currently a reasonable
assumption that all the values in a `set` are IDs, and various parts
of the code have started to rely on that assumption.
Removing some old code to try to guarantee that the values in a `set`
are names allow us to work towards a new guarantee that `set` values
are IDs.
Closes#2553
The hack of manually checking availability is no longer necessary, and
I have a better idea of exactly which checks still are necessary.
Battle Spot is now implemented a lot more cleanly, and a lot more like
how it was implemented last gen.
Previous code had an Aegislash complex banned from Steel teams hard-coded into Same Type Clause. This hasn't been part of Monotype for half a year and was conflicting with attempts to use "/tour banlist !aegislash" to allow Aegislash in Monotype battles.