Weather uses both 'activate':
The mysterious strong winds weakened the attack!
and 'upkeep':
The sandstorm is raging.
So keeping them on the same message type is complicated. PS already
uses `|upkeep|` to mark the beginning of the residual phase, so this is
a good name for this message type.
For now, only upkeep messages happening during the residual step are
here - Hail, Sandstorm, and Uproar. Messages that happen at other
times, such as Attract's "[POKEMON] is in love with [TARGET]!" remain
as "activate".
Out of 12 issues found:
3 bugs:
- duplicate property - caught a bug in Gen 1 Light Screen
- duplicate property - caught a bug in Gen 1 Reflect
- unused variable - caught a bug in type animations
7 harmless but good for code quality:
- unused variable - harmless but good for code quality
- unused variable - harmless but good for code quality
- unused variable - harmless but good for code quality
- unused variable - harmless but good for code quality
- duplicate case - harmless but important for code quality
- unused variable - harmless but good for code quality
- unused variable - harmless but important for code quality
2 not-bugs that had to be worked around:
- unused variable - used for an `eval` trick, had to use a workaround
- unused variable - used for readable destructuring
I think on balance, LGTM does more good than bad. Catching bugs early
is worth some amount of hassle.
(Also like half these problems are problems tslint could catch if I
actually bothered to set it up...)
Default start messages do two things:
1. Remind us that we don't have a real message coded for an effect.
2. Support showing any kind of start message by default for custom
modded games. (It's of course still an option to pass `[silent]` and
then add a custom message with `|-message|`.)
All battle text messages have been moved out of `src/battle.ts` and
into its own file `data/text.js`.
Code for handling this is in the new files `src/battle-log.ts` and
`src/battle-text-parser.ts`.
`data/text.js` is now extremely self-contained, and nearly ready for
translation support!
This is a significant modernization of battle.ts. In addition to moving
messages out:
Functions for getting names (`pokemon.getLowerName()` etc) have been
removed.
`battle.minorQueue` has been removed. Minor lines are now processed
directly on the main queue, with a new `battle.waitForAnimations`
flag to decide whether or not the main queue should wait for animations
to finish before moving on to the next line.
`battle.waitForResult()` and `battle.endPrevAction()` have been
removed. These confusingly-named functions closed the messagebar (and
flush the minor queue). They've been replaced with
`scene.maybeCloseMessagebar()`.
`pokemon.markMove()` and `pokemon.markAbility()` have been renamed
`pokemon.rememberMove()` and `pokemon.rememberAbility()`.