This will probably be our last data sync, until I work out a new solution
for rebuilding learnsets-g6 without needing an old copy, so learnsets-g6
can be gitignored.
The reason an old copy is currently needed is because it was written back
when learnsets-g6 contained data on the order same-level moves were learned
(most pokemon have a lot of L1 moves, and the order is relevant for which
moves are kept and which moves are replaced if you catch the pokemon at
medium-low level.)
This information isn't present in learnsets.js, so learnsets-g6.js needs to
preserve that information from older copies of learnsets-g6.js.
This has of course been entirely irrelevant for years, because we never
encoded learnset order data in gen 7 in the first place. But the code for
doing so stayed around...
These files are now autogenerated by the build scripts, and depend
on files not even present on GitHub anyway.
(The minidex is a database of height/width for PS's animated GIF
sprites, for use by the animation engine. It also contains dex numbers
for use by pokemon icon spritesheets.)
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()`.
This is only a first step and doesn't pass strictNullChecks.
I'm committing now because skipping straight to refactoring will be
easier than trying to make it pass strictNullChecks as-is.
TypeScript found at least a few bugs here, which is nice.