Battle will soon be a Node.js Stream, which has an .on() function,
which Battle#on would conflict with.
PS events aren't Node events, so naming a PS event function .on()
was kind of misleading anyway.
So I've been working on a massive refactor to the choice system for,
like, over a week. It's still not done, but it's found some mistakes
in the tests that should be fixed.
Terrain seeds weren't activating correctly on the first Surge of two
Surge ability activations turn 1. This fixes it by allowing Update to
run on inactive Pokémon, allowing a Pokémon's item to activate onUpdate
before their own ability activation.
This makes gen 7 the default mod, updates the tests to match, and fixes
the corresponding build error.
Note that this only changes the default Tools mod, the default Formats
mod is now gen6. gen7 must be specified by name in a format, for that
format to be a gen 7 format.
Among the newly added rules, there are quite a few intended to enforce
compliance of CONTRIBUTING.md-blessed idioms, as well as ensure
safe usage of classes and constant bindings.
We are also now enforcing usage of early return in commands.js,
which has 100% compliance as of fd2c45c.
BattlePokemon#runImmunity is now two functions, runImmunity and
runStatusImmunity.
The split is helpful because: 1. NegateImmunity only applies to type
immunities, and 2. Immunity only applies to status immunities and
Ground immunities.
Ground immunities are now entirely handled hardcoded in isGrounded.
This overall doesn't have a noticeable impact on performance, but
it makes certain things behave more predictably, and correctly
shows the ability activation for Levitate, so I assume that means it's
a net positive. I hope I at least improved readability...
Listing the generation number imitates the style used in PS! format names,
and is clearer on which generation it is than listing games from that gen
(so GSC -> Gen 2, etc)
Some tests had incorrect program flow that was resulting in incorrect
expected behaviors.
Improved the wording on some test descriptions.
Gave some of the Pokemon Shell Armor to negate test failures due to
critical hit messages appearing before the type effectiveness messages.