Commit Graph

21 Commits

Author SHA1 Message Date
urkerab
2f1002edde Restore missing Grudge activation message (#1214) 2019-01-16 15:51:11 -06:00
urkerab
00346db803 Fix crash damage message after server PR 5042 (#1210) 2019-01-13 13:28:47 -06:00
urkerab
320711ae6f Fix Fairy Lock for replays (#1212) 2019-01-13 13:22:16 -06:00
Guangcong Luo
adccb29971 Add Berry weaken message 2019-01-12 07:44:05 -06:00
Guangcong Luo
3c39a968c2 Fix Flash Fire message 2019-01-11 07:57:33 -05:00
Guangcong Luo
a05f23fd37 Use data/text.js for stats in text parser
We previously used BattleStats, but using `data/text.js` allows stat
names to be translated.
2019-01-05 05:36:50 -06:00
Guangcong Luo
c1f372b3a7 Add a default item activation message 2019-01-05 04:00:29 -05:00
urkerab
246a235a59 Fix message for Jaboca and Rowap Berry (#1200) 2018-12-31 00:37:07 -08:00
urkerab
cc9b346dfd Fix some messages for abilities blocking effects (#1192) 2018-12-05 19:21:51 -06:00
urkerab
c74c61ac7f Add Mind Blown recoil message (#1188) 2018-12-03 19:37:58 -06:00
urkerab
2494aca33b Fix Gen 1 partial trapping message (#1178) 2018-11-25 21:52:01 -06:00
urkerab
ddfb162b8a Fix magnitude activation (#1179) 2018-11-25 21:51:30 -06:00
Guangcong Luo
1e25db3224 Split 'activate' and 'upkeep' message types
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".
2018-11-22 21:46:26 -06:00
Guangcong Luo
8efa0048e7 Fix Magician/Pickpocket activation message 2018-11-22 17:16:50 -05:00
Guangcong Luo
e01c181307 Fix misc bugs in text-parser
- Magic Room
- Wide Guard
- Perish Song
- Leppa Berry
- Gen 1 Special boosting
2018-11-22 06:05:12 -05:00
Guangcong Luo
69aa657e1a Fix Mega evolution message in Let's Go 2018-11-20 15:02:46 -06:00
Guangcong Luo
27633540a1 Fix bugs in BattleTextParser update 2018-11-19 20:46:28 -05:00
Guangcong Luo
38b66272f2 Fix issues identified by LGTM
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...)
2018-11-15 18:52:53 -06:00
Guangcong Luo
3bd4ff0eb0 Add default start messages
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|`.)
2018-11-15 18:52:53 -06:00
Guangcong Luo
7d619fb8ea Remove weather ability-start messages
These _are_ real messages from Gen 3, but since it's not like we
otherwise accurately simulate Gen 3 messages, it's a bit weird to
keep these around.
2018-11-15 18:52:53 -06:00
Guangcong Luo
f6c03e0370 Implement new battle-text-parser
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()`.
2018-11-15 18:52:53 -06:00