Previously, Berries would not activate after weather damage and before
other residual damage/healing.
According to: https://www.youtube.com/watch?v=FRI5PSekhR4
They should activate then. More research is needed to determine what
other situations Berries should activate but don't.
Rules for custom formats are once again sanitized and can be passed
around more easily by attaching them to the format's id.
Fixes:
- "Rule:" being required to add or remove a rule
- ruleset changes not being shown in battles
- the display of custom rules being affected by user input
- custom formats being broken by /hotpatch formats
Simulator instances still get their scripts included somewhat hackily,
but it's overall much less hacky than before. In particular, the
init code is now an actual constructor, allowing TypeScript to perhaps
validate it one future day.
I might regret supporting this syntax, but it's now possible to make
PS generate teams on the commandline using:
./pokemon-showdown generate-team [optional format name] [optional seed]
The output will be in packed team format (which can be pasted into
a teambuilder import box).
The seed-passing should make it significantly more straightforward to
debug team generation weirdness.
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).
PS's rule table has been renamed from banlistTable, and works a bit
differently now. It's a Map instead of an object now, and the keys
work a bit differently.
The original banlistTable was designed to store bans, and later
additions shoved rules and then unbans in there. The new table is
designed to support all of these.
- caused weather effects passed in through ``moreData`` to be marked as simply ``"Effect"``
- as a result, sandstorm and hail will damage Rock/Ground/Steel and Ice types respectively
- this fix makes ``Effect`` inherit the ``effectType`` from ``moreData`` if it doesn't exist in the primary ``data`` variable passed into the constructor
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`