Commit Graph

4400 Commits

Author SHA1 Message Date
Guangcong Luo
c1f372b3a7 Add a default item activation message 2019-01-05 04:00:29 -05:00
Guangcong Luo
7e82afd2de Support <button name="login"> in HTML panels
This is a stopgap until the new client supports these properly.
2019-01-05 03:59:21 -05:00
urkerab
a8762abc3b Fix Attract message for Destiny Knot (#1204) 2019-01-04 22:31:53 -06:00
Guangcong Luo
e5dfba6797 Make classes for dex data
Template, Item, Move, and Ability are now classes. This guarantees that
`getTemplate`, `getItem` etc return objects that implement their
interfaces (they didn't before).

As of their current implementation, they require trusted resource
files. The plan is, whenever we support custom resource files, to pass
all their strings through `sanitizeName`. This won't prevent servers
from causing the client to behave unexpectedly, but it should prevent
any actual vulnerabilities.

In addition, pokemon forme icon index tables have been moved to
`battle-dex-data.ts`.
2019-01-04 00:34:10 -06:00
Kris Johnson
553cffa93e Fix teambuilder tables for formats not in formats-data (#1203) 2019-01-03 15:39:20 -06:00
Guangcong Luo
dcb3a6f769 Ugly hack to support tests in Node.js
Previously, we used the `eval` hack to "import" our code into test
files. The biggest problem with that approach is that we don't get
line numbers.

Now, we're assigning relevant variables to globals in Node.js for
tests. It's ugly, but it works. There's no simple way to import local
variables only if we're in Node.

Ideally, we'd build this in two different ways: A .mjs file for Node,
and a .js file for the browser. Or maybe use UMD. I'll figure it out
later, I guess.
2019-01-03 03:58:06 -06:00
Guangcong Luo
e186f57f41 Rename .mocha.js -> .test.js
This spec file is, incidentally, Jest-compatible. I benchmarked and
Jest is noticeably slower right now, so I'll stick with Mocha, but
if we ever need Jest features, it'll be useful to be able to easily
switch.
2019-01-03 03:42:13 -06:00
urkerab
246a235a59 Fix message for Jaboca and Rowap Berry (#1200) 2018-12-31 00:37:07 -08:00
asgdf
d129b84c13 Fix status data not resetting after getting phazed (#1198) 2018-12-31 00:35:55 -08:00
urkerab
cc934a8061 Fix Forewarn and Symbiosis (#1201) 2018-12-31 00:33:50 -08:00
Kris Johnson
0f3145b1ef Let's Go: Fix learnsets and happiness value (#1197) 2018-12-20 09:46:32 -08:00
Guangcong Luo
fa6d081f7d Fix confusion activation message grouping 2018-12-16 16:18:16 -06:00
Guangcong Luo
e45256d98b Pixelate trainersprites/types on Retina screens 2018-12-16 16:16:07 -06:00
Guangcong Luo
40cf444a26 Refactor animateMove
There's no longer a need for it to be hella-nested.
2018-12-16 11:37:19 -06:00
Guangcong Luo
432ccd64be Make Travis CI auto-run tslint
I'm reasonably confident that the tslint settings are where I want
them to be, at this point. Going over the line length limit is a
warning, not an error, so I don't have to worry about that being
too harsh.
2018-12-16 11:09:59 -06:00
urkerab
4978fe0b99 -anim should only animate (#1195) 2018-12-16 10:57:38 -06:00
urkerab
14bd90dd8c Fix target of future sight message (#1193) 2018-12-06 23:47:46 -06:00
Guangcong Luo
eff5359fb4 Rename Tools to Dex
This has already been done server-side, and there's no use delaying
client.
2018-12-05 21:11:47 -06:00
Guangcong Luo
3dcc7d2a65 Fix build error
I'm not sure why this only just started getting caught...
2018-12-05 21:11:47 -06:00
urkerab
cc9b346dfd Fix some messages for abilities blocking effects (#1192) 2018-12-05 19:21:51 -06:00
urkerab
2f55b6df28 Fix weather blocked by primal weather (#1191) 2018-12-04 19:06:01 -06:00
spixi
6cab958804 Fix teambuilder search by tier (#1190) 2018-12-04 16:56:00 -06:00
The Immortal
1ef228ebcb Let's Go: Remove UUBL classification 2018-12-04 17:16:49 +04:00
Kris Johnson
7b65496bed Let's Go: Update tiers (client-side) (#1189) 2018-12-04 01:22:20 -06:00
urkerab
c74c61ac7f Add Mind Blown recoil message (#1188) 2018-12-03 19:37:58 -06:00
urkerab
3fe9c944cd Ability activations have no default message (#1187) 2018-12-02 15:21:06 -06:00
Bär Halberkamp
1f24e93c90 Add a logo for groupchats by LifeisDANK (#1185) 2018-11-29 20:17:45 -06:00
urkerab
0807293619 No message for use of Rest (#1184) 2018-11-29 19:05:48 -06:00
Guangcong Luo
6840eac68f Fix cantNoMove in text parser
Fixes #1183
2018-11-29 19:45:52 -05:00
Guangcong Luo
7d649b8f12 Minor refactor to text parser
This just removes the slice on team IDs, which is no longer necessary
now that parser.team() does it automatically.
2018-11-29 19:45:52 -05:00
Guangcong Luo
ad3b39b673 Add build scripts
This mostly makes it easier to build in VS Code just by pressing
Cmd+Shift+B or whatever the equivalent is for your platform.
2018-11-29 18:40:31 -06:00
Guangcong Luo
9024ce99be Fix minidex building 2018-11-29 16:12:00 -05:00
Guangcong Luo
e7eb12e686 Fix Trace activation message
Fixes #1181
2018-11-28 21:56:40 -05:00
urkerab
01f764f2ec Fix Reflect Type copying types (#1182) 2018-11-28 20:47:43 -06:00
Ezaphs
67a87fb169 Correct rounding error in Lets Go stat calculation (#1180) 2018-11-26 17:34:25 -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
Kris Johnson
460ee1ad26 Add learnset support for Let's Go (#1177) 2018-11-25 15:56:50 -06:00
urkerab
1ed8c86b73 Fix Dry Skin healing (#1176) 2018-11-25 15:27:18 -06:00
urkerab
3540d9d1f4 Fix message when partial trapping ends (#1174) 2018-11-24 14:35:32 -06:00
urkerab
77758de466 Fix some specific failure text cases (#1175) 2018-11-24 14:34:43 -06:00
Guangcong Luo
aa6c94ac64 Fix immunity messages
Fixes #1173
2018-11-24 02:26:48 -05:00
Guangcong Luo
096f037a07 Put battle text in battledata.js
This makes it so a regular build will rebuild battle text, instead of
requiring a full build.

battle text is under active development, so this is pretty useful,
even if conceptually, text is purely a graphical thing and not actually
needed by headless battles.
2018-11-24 01:14:28 -06:00
Guangcong Luo
01bdf7808b Don't build minidex if no sprites folder
This prevents PS from disabling sprite animations if someone runs
`./build full` without having sprites.
2018-11-24 01:14:28 -06:00
Guangcong Luo
331b35de53 Sync data
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...
2018-11-24 02:12:50 -05:00
Guangcong Luo
3004f2f0b6 Add line breaks to spacers
Makes battle logs look nicer when copy/pasted as plaintext.
2018-11-23 01:40:15 -06:00
Guangcong Luo
5572fe6e80 Fix team/side messages 2018-11-22 22:05:19 -06:00
Guangcong Luo
84e76c4bba Stop tracking minidex in Git
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.)
2018-11-22 21:54:46 -06:00
Guangcong Luo
f62060c8ac Add data/text.js to eslint 2018-11-22 21:51:27 -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