Commit Graph

1124 Commits

Author SHA1 Message Date
Guangcong Luo
73c7d5e5d8 Fix bug in Sketch validation
Earlier today, I tried to remove the hardcode for Smeargle without
realizing what it was for (Smeargle gets Spore as an event move, which
shouldn't override its ability to Sketch Spore).

It turns out, 7 years ago when I added the Smeargle hardcode, I wrote
a TODO to fix it which I never got around to:

2e1ab04eb6

Anyway, this commit fixes it properly.
2021-01-03 23:52:33 -08:00
Guangcong Luo
6b3a3070c9 Refactor team validator for readability
`checkLearnset` has been renamed `checkCanLearn`.

`reconcileLearnset` has been replaced with `validateMoves`, which
bundles the actual `checkCanLearn` calls with the old
`reconcileLearnset`, making for a better name.
2021-01-03 23:26:20 -08:00
The Immortal
4ba7045bda Validator: Remove extra space from cantLearnReason 2021-01-04 00:58:04 +04:00
Guangcong Luo
91c134fcf3 Remove unused variable 2021-01-03 10:19:54 -08:00
Guangcong Luo
ad656f67e4 Keep track of why moves can't be learned
The validator will now always know and be able to report exactly why
a move can't be learned, instead of sometimes not being able to figure
it out.
2021-01-03 09:53:04 -08:00
The Immortal
d9c2ee8d39 Lum Berry activates after Synchronize
Thanks @DaWoblefet!
2020-12-31 21:58:36 +04:00
MacChaeger
bb8aca0905
Fix move-disabling mechanics for Dynamaxed Pokemon (#7853) 2020-12-30 18:08:53 -05:00
LegoFigure11
cad1d25c4d
Add Gen 8 BSS Factory (#7843) 2020-12-31 02:09:29 +04:00
Adam Tran
d6e05d0a98
Fix Metal Burst interaction with called moves (#7835) 2020-12-30 14:36:06 -05:00
Adam Tran
674eb1449f
Fix Conversion 2 interaction with called moves (#7813) 2020-12-30 11:50:04 -05:00
Adam Tran
2f5fbad4e7
Fix Pursuit interaction with pivot moves (#7819) 2020-12-30 11:48:26 -05:00
Instruct
5b441c2013
Super Staff Bros 4 (#7793)
Collaborative Project lead by @xInstruct with many contributors.

See the Special Thanks section of https://www.smogon.com/articles/super-staff-bros-4
2020-12-24 11:21:02 -05:00
Mia
e601a5eb1f
Suspect tests: Move functionality out of sim/ (#7769) 2020-12-21 13:32:19 +04:00
urkerab
74ae95a91c
Update accuracy calculation for latest Gen 7 research (#7806) 2020-12-15 18:37:24 -05:00
Marty-D
9110419113
Gen III-IV: Stop suppressing weather when fainted 2020-12-14 17:07:26 -05:00
MacChaeger
da64d93765 Runners: Support 4P (and max games) (#7700) 2020-12-13 20:26:39 +00:00
Guangcong Luo
465d28171e Refactor PRNG for readability
Closes #7787
2020-12-12 21:56:03 +00:00
MacChaeger
58ee2f2130
Activate Jaboca and Rowap Berry on KO (#7779) 2020-12-08 15:15:41 -05:00
urkerab
6daa05781b
Protean should affect the victim of Snatch rather than the user (#7768) 2020-12-07 09:43:55 +04:00
MacChaeger
ef4132edb8
Fix two-turn submoves + Ally Switch in Doubles (#7654) 2020-11-25 15:21:23 -05:00
MacChaeger
ffc632cbf1
Fix Burning Jealousy/Lash Out vs. "turn 0" effects (#7730) 2020-11-25 13:30:03 +04:00
MacChaeger
3dfa1bdd91
Fix Emergency Exit/Wimp Out false positives (#7719) 2020-11-24 05:42:55 -08:00
May Evans
94e9ca7aee
Gen 1: Fix Counter vs Hyper Beam (#7707)
Fixes this issue, which was brought to my attention by EB0LA: 

https://replay.pokemonshowdown.com/gen1ou-1226178707-boclvwycxq72syl17qt9a3729l1tprkpw
https://replay.pokemonshowdown.com/gen1randombattle-1224344866-9ha6ocg38ru2ontlnf0iak467r2nzu0pw

Thanks to Zarel for helping me figure out what to do ^^;
2020-11-18 05:55:18 -08:00
Guangcong Luo
3336decb79 Implement Desync Clause Mod for Gen 1 Counter 2020-11-15 02:18:37 +00:00
Marty-D
826dd94eae Validator: Fix Ability attribution from Virtual Console 2020-11-13 11:28:10 -05:00
Marty-D
b098b54187 Validator: Fix Ability attribution from Dream World 2020-11-12 18:13:58 -05:00
urkerab
ec8cd25d59
Properly update Diamond Storm boosts for Gen 7 (#7638) 2020-11-12 10:27:18 -05:00
The Immortal
cc27e0b2fc species.prevo is a name 2020-11-12 06:59:47 +04:00
The Immortal
fff0f6c806 Release Gigantamax Melmetal
Also added necessary validation for it as its event is a special case.
2020-11-12 05:41:24 +04:00
Kris Johnson
890b4d9f59
Refactor text files (#7680) 2020-11-11 14:40:55 -08:00
Guangcong Luo
8543fc291a Fix Gen 2 evo/tradeback validation 2020-11-09 04:12:59 +00:00
Guangcong Luo
1e39e19f00 Refactor chat to use Utils.splitFirst 2020-11-08 18:31:38 +00:00
Guangcong Luo
ca96d7bf49 Fix crash in tests
It turns out `sentLogPos` isn't incremented in unit tests (no actual
use-case was affected). This is the simplest fix, although at some point
we should revisit how battles send and receive data.
2020-11-08 02:14:30 +00:00
Guangcong Luo
1e9b506ee5 Add detector for infinite event loops
This has happened a few times in the past, so this helps prevent them
from spinlocking entire processes.
2020-11-07 22:56:37 +00:00
Guangcong Luo
9b5217ab70
Split up dex-data into more files (#7634)
* Split up dex-data over individual files

This commit introduces:
- `dex-abilities.ts`
- `dex-conditions.ts`
- `dex-formats.ts`
- `dex-items.ts`
- `dex-moves.ts`
- `dex-species.ts`

These files centralize definitions from `dex-data` and `global-types`.

* Inherit ItemData from Item etc

Previously, Condition inherited from ConditionData. Now, ConditionData
inherits from Condition. The advantage of the new approach is that now,
Condition and DataCondition no longer need to be separate types, and
there should be much less duplication of type definitions in general.

This has also been done for

- ItemData/Item/DataItem
- AbilityData/Ability/DataAbility
- FormatData/Format/DataFormat

Species and DataSpecies was already merged, but this also reverses
their inheritance (saving a lot of duplicated definitions in the
process!)

The only one left is MoveData, which is just super complicated and
will need its own commit.
2020-11-05 05:00:13 -08:00
Leonard Craft III
920af21aac
Abilities: Add isPermanent flag (#7614) 2020-11-03 10:31:11 -05:00
The Immortal
7d9eb43ef7 Remove unused definitions 2020-11-02 01:30:16 +04:00
Kris Johnson
909419ca27 Fix /randbats interaction with Gen 2 sets 2020-11-01 14:23:40 -07:00
Guangcong Luo
8b68cdd736 Fix Streams bug
It turns out 001f98b4f2 was wrong.

When urkerab asked why it `peek` wasn't awaited:

e91c4c5260 (commitcomment-41364837)

The answer was because clearing the buffer after peeking needed to
happen synchronous: if the buffer is written to after peeking but
before the buffer is cleared, that write is lost forever.

This just goes to show, if you do something subtle enough to require
type assertions, you should probably add a comment about what's going
on.

Fixes #7605

This also removes `BattleStream#start()` which is completely useless
API complication. A better implementation would properly forward
crashes between streams (maybe `pipeTo` should do this) but as it
stands, it's not doing anything.
2020-11-01 02:06:24 +00:00
The Immortal
42f491a092 Fix Ripen 2020-10-30 14:03:35 +04:00
Kris Johnson
a641cfcce8
Fix Overflow Stat Clause and turn it into a mod (#7604) 2020-10-30 10:59:38 +04:00
Guangcong Luo
e90658c038 Validate Natures in tests
(There's no need to validate natures somewhere that has an actual
performance impact.)
2020-10-29 16:19:07 +00:00
Kris Johnson
ab6e173e24
Move natures into their own file (#7601) 2020-10-29 08:38:03 -07:00
Guangcong Luo
e546236221 Improve error for Japan-only event moves
Thanks Plague Von Karma for help with wording!

Refs #7581
2020-10-29 12:06:36 +00:00
The Immortal
2e6ccdd738 Random Doubles: Fix Regieleki 2020-10-28 22:47:43 +04:00
Guangcong Luo
3b4a3ba7e0 Improve custom rule validation
Stray spaces are now consistently allowed in `/tour rules` and
`/challenge`, but are not allowed in `formats.ts`.

Improves #6811
2020-10-28 02:18:52 +00:00
PartMan
062e42402d
Fix Custom Rules Error (#6811)
`/challenge [Gen 8] OU @@@ +Reshiram` failed earlier, since the rule wasn't trimmed.
2020-10-27 19:00:05 -07:00
Guangcong Luo
a38f0597f8 Remove last vestiges of tslint 2020-10-27 22:49:00 +00:00
Guangcong Luo
c9759954b9 Remove sim/global-variables.d.ts
The sim no longer uses any global variables, so this can and should be
removed.

`server/global-variables` has also been cleaned up, since I'm working
on this.
2020-10-27 22:03:14 +00:00
Guangcong Luo
7eafea8ee1 Add client text data
This syncs data/text to exactly match the client's data/text, in
preparation for them to be merged. The server's data/text will be
canonical, moving forward:

Relevant changes:

- A new file `data/text/default` has been added, for battle messages
  not associated with a move/item/ability.

- As One (Glastrier) and As One (Spectrier) should not have a start
  message; only As One itself.

- Hidden Power's `realMove` property does not belong in data/text
  and has been removed (it's still in data/moves where it belongs).
2020-10-27 16:56:08 +00:00
Guangcong Luo
5f8c36c616 Ban Gen 1 Japan-only event moves
Fixes #7516
2020-10-26 15:30:47 +00:00
May Evans
e102416793
Ban Japanese Gen 1 Events in Int Formats: Part 2 (#7581)
Co-authored-by: Guangcong Luo <guangcongluo@gmail.com>
2020-10-26 06:00:35 -07:00
urkerab
b90f03b77e
Calculate natures with 16-bit truncation (#7540)
Also fixes Let's Go! which wanted to override these but couldn't.
2020-10-25 16:54:43 -07:00
Guangcong Luo
c96b2d6248 Improve sim readme 2020-10-24 22:09:52 +01:00
Kris Johnson
a1058ac29c
Convert VGC 2020's mod to a pre-DLC2 mod (#7564) 2020-10-24 06:00:29 +04:00
The Immortal
381c8190c6 Fix Dragon Ascent Rayquaza validation 2020-10-24 04:58:05 +04:00
Marty-D
0f17b39dd3 As One cannot be suppressed, acquired, or removed 2020-10-23 19:13:27 -04:00
The Immortal
498e38502a Implement As One correctly 2020-10-23 21:10:18 +04:00
The Immortal
e9c62cb86d Prevent As One from being copied or removed 2020-10-23 18:01:51 +04:00
Leonard Craft III
4e6ff7e72c
Validator: Allow Hidden Ability Entei/Raikou/Suicune in Gen 8 natively (#7563) 2020-10-23 15:28:12 +04:00
The Immortal
80d368d1cb Update hidden ability legality 2020-10-23 06:49:43 +04:00
HoeenHero
daa6010ddb Validator: Reject sets with the Gigantamax flag that cant Gmax 2020-10-21 13:50:38 -04:00
Guangcong Luo
ebd1ed11e4 Fix typo in sim/README.md 2020-10-21 17:32:10 +01:00
Guangcong Luo
2faa3d635d Publish 0.11.3 to npm
PS's sim engine is now available on npm!

sim/README.md describes how to use it:

https://github.com/smogon/pokemon-showdown/blob/master/sim/README.md
2020-10-21 17:24:58 +01:00
Guangcong Luo
a55d3cd530 Fix crashes from using moves with no target
Specifically, if you target your ally and your ally uses Ally Switch
(causing you to target yourself), certain moves (including Thunder,
Hurricane, and SSA) crash. This has been fixed.
2020-10-19 18:10:25 +01:00
Guangcong Luo
958d22fc7f Improve error propagation in debuggers
Running `./pokemon-showdown simulate-battle` no longer catches/rethrows
errors. This should make debugging with something like VS Code's
built-in debugger much easier.
2020-10-19 18:09:22 +01:00
Guangcong Luo
49743a6a93 Fix crash from bad changesFrom type
Fixes #7544
2020-10-19 17:40:38 +01:00
Guangcong Luo
d6c650d545 Properly fix HP type corruption crash 2020-10-19 17:18:28 +01:00
Guangcong Luo
9d87616176
Add more style linting rules (#7537)
* Lint arrow-body-style

* Lint prefer-object-spread

Object spread is faster _and_ more readable.

This also fixes a few unnecessary object clones.

* Enable no-parameter-properties

This isn't currently used, but this makes clear that it shouldn't be.

* Refactor more Promises to async/await

* Remove unnecessary code from getDataMoveHTML etc

* Lint prefer-string-starts-ends-with

* Stop using no-undef

According to the typescript-eslint FAQ, this is redundant with
TypeScript, and they're not wrong. This will save us from needing to
specify globals in two different places which will be nice.
2020-10-19 02:42:28 -07:00
Kris Johnson
7ebc4411e9
Fix Allowing Hidden Power with an undefined hpType (#7541) 2020-10-18 22:52:25 -04:00
Guangcong Luo
1c0c77ff6b
Update to TypeScript 4.0 (#7504) 2020-10-10 14:43:32 -07:00
Mia
fb23fc8733
/showteam: Properly handle nick/form names (#7489) 2020-10-08 13:31:29 -07:00
Kris Johnson
ee0e8828bf
Stop serializing the HIT_SUBSTITUTE const in state (#7485) 2020-10-06 22:43:21 -07:00
Mia
aba5dd1119
/showteam: Support nicknames (#7464) 2020-10-03 08:25:14 -07:00
Kris Johnson
9f0b6d64d0
Add new Pet Mods of the Season (#7455) 2020-10-02 21:08:29 +04:00
Kris Johnson
fa569c7a49
Add properties to see which Pokemon fainted last/this turn (#7452) 2020-10-01 16:31:45 -07:00
Guangcong Luo
3d68248efa Update to latest eslint
We're skipping two major typescript-eslint versions, so there are a
bunch of changes here, including:

- it's catching a lot of things it didn't catch in the past, for
  reasons unclear to me

- no-unused-vars has to be explicitly disabled in global-types now

- a lot of `ts-ignore`s were never necessary and have been fixed

- Crashlogger can now handle being thrown things that aren't errors.
  This has never been a problem in the past, but to satisfy TypeScript
	we might as well not die in a fire on the off chance someone tries to
	`throw null` or something.
2020-09-29 15:28:08 -07:00
Guangcong Luo
2bcea34447 Support ./pokemon-showdown simulate-battle -S
simulate-battle now has a new option: --spectate.

As a recap:

-D --debug: simulate in debug mode

-R --replay: output only the omniscient (debug) replay, rather than the
  full stream

-S --spectate: output only the spectator replay, rather than the full
  stream
2020-09-29 15:28:07 -07:00
The Immortal
b67701d8a4
Add suspect tests plugin (#7427) 2020-09-27 15:41:04 -07:00
Guangcong Luo
d429d58bc6 Fix suspect test ladders
We deployed a new suspect test system a few months ago, but we had to
back out of it when it didn't work as expected. This fixes the bug that
made it not work. In the future, setting `rated: "[Gen 8] Format Name"`
in `formats.ts` will cause ladder games in that format to actually
go in the specified format's ladder, instead of its own.
2020-09-27 08:43:08 -07:00
The Immortal
a5a238d9f8 Improve IVs validation
- Fixes #7302
- Removes unnecessary duplicated checks for legendaries having perfect IVs
2020-09-25 04:00:47 +04:00
The Immortal
0d71ec82c3 Random Battle improvements 2020-09-22 11:56:21 +04:00
urkerab
5d714fbb56
Replace @ts-ignore with type assertions or other less unsafe constructs (#7390) 2020-09-19 02:07:48 -07:00
Leonard Craft III
302d6ff6fb
Add hidestats arg to showteam and improve output (#7357) 2020-09-14 16:33:34 -07:00
EvGym
b57b527f1c
Support custom-formats file (#7240) 2020-09-07 23:31:01 -07:00
Strahm, Jeffrey S.(S&T-Student)
188426490b Rename FormatsData to FormatData
(The name FormatsData is inconsistent with how we name other things;
especially since it's supposed to be data for a single format. It was
probably originally a typo. -Zarel)
2020-09-07 19:35:14 -07:00
urkerab
1bf873018c
Remove outdated getAwakeningValues function (#7331) 2020-09-07 17:00:53 -07:00
Guangcong Luo
ea8f52ce97
Move descriptions to data/text/ files (#7036)
This adds some new `data/text/` files, which are the new home for
item/move/ability descriptions, as well as in-game messages, in one
place for ease of translation.
2020-09-06 22:00:11 -07:00
Kris Johnson
8656d633ac
Format volatiles consistently (#7314) 2020-09-05 08:12:24 -07:00
Kirk Scheibelhut
8744adaeca Consistently use this.dex in TeamValidator
Additionally allows Dex to optionally be provided as a constructor
arg for clients which do not rely on a global Dex object
2020-08-29 22:51:54 -07:00
Kirk Scheibelhut
c14a651523 Make sim compatible with TS 4.0
Operands of delete operators must be optional in TS 4.0, casting to
any in destroy is analogous to the null! hack
2020-08-28 11:21:00 -07:00
The Immortal
d98bf1b0ca Validator: Fix Gastrodon-East 2020-08-26 15:57:00 +04:00
urkerab
7be58f2425
Tweak team stringification (#7250) 2020-08-23 04:24:49 -07:00
Guangcong Luo
8d79bf9725 Rename Dex.deepClone to Utils.deepClone
`this.dex.deepClone` still exists as an alias to `Utils.deepClone` for
use in `data/`. I'll need to spend more time figuring out the correct
solution there.
2020-08-21 04:24:34 -07:00
Kirk Scheibelhut
39c14e0868 Remove EBC staleness from abilities upon switching 2020-08-17 12:59:10 -07:00
Guangcong Luo
c9a1339a0c Use for-await in more places 2020-08-15 16:31:46 -07:00
Guangcong Luo
18948c8c2c Refactor ObjectReadStreams to use for-await
Regular ReadStreams still can't; I now believe they shouldn't have a
"default" read method, and you should explicitly choose whether you
want to read "by chunks as they become available", "by chunks of a
specific line" or "by a delimiter".

So you would specifically use `stream.byLine()` or
`stream.byChunk([size])`, which would return an
`ObjectReadStream<string>`.

Inspired by #7195
2020-08-15 15:11:53 -07:00
Marty-D
7b3023c236 Fix Stuff Cheeks
Thanks EeveeTrainer and DaWoblefet
2020-08-15 15:46:19 -04:00
Mia
fa7a0025e5
/showteam: Fix bugs (#7206) 2020-08-12 16:12:45 -07:00
Kris Johnson
5e255012bc
Add a 'bst' property to Species (#7138) 2020-08-12 12:06:09 -07:00
The Immortal
d79ca8eae5 Don't show EVs warning for level 1 Pokemon 2020-08-12 15:22:37 +04:00
Marty-D
479ea5a72b Validator: Fix passing down level up moves
and finish implementing `canHatch`
2020-08-08 17:17:45 -04:00
Mia
deeed6c789
Remove sim/ and data/'s globals (#7091) 2020-08-07 06:44:15 -07:00
Marty-D
cc8e3723de
Validator: Fix event Pokemon with separate learnsets 2020-08-06 16:14:43 -04:00
Leonard Craft III
9e82f05ebb
Gen 3-4: Fix Camouflage to change to Normal-type (#7130) 2020-08-06 14:54:57 -04:00
Kris Johnson
f96ec4fb05
Add strict types to tiers (#7135) 2020-08-06 00:41:42 -07:00
Mia
fd0f83ff8d
Add a command to show the user's team in battles (#7068) 2020-08-06 00:36:43 -07:00
Guangcong Luo
54027d62bd
Support custom ladders (#6541)
This allows formats to specify a different ladder than their own, for
their rated battles to go on.
2020-08-06 00:28:53 -07:00
The Immortal
ca983630c1 Add Ripen activation for berries 2020-08-03 20:11:47 +04:00
Leonard Craft III
95243cdb00
Don't leak target of two-turn charge moves (#7104) 2020-07-31 17:55:28 -07:00
Annika
05a9f9a1e5
Minor code quality improvements based on LGTM (#7092) 2020-07-30 14:24:37 -07:00
Kris Johnson
70edfaa64c
Add support for more OMs (#7084) 2020-07-30 05:22:21 +04:00
Guangcong Luo
4d09f7acde Rename more instances of Effect to Condition 2020-07-26 11:26:23 -07:00
Kris Johnson
e042c81310
Fix Gigantamaxing (#7054) 2020-07-24 15:40:27 -07:00
Guangcong Luo
2f805c93a2
Remove "Battle" prefix from data exports (#7039)
`BattlePokedex` is now `Pokedex`, `BattleItems` is now `Items`, etc.

I also renamed `Movedex` to `Moves` and `Statuses` to `Conditions`.

`TypeChart` isn't `Types` yet, because unlike the others, it's not
indexed by ID. That should probably be fixed one day.
2020-07-24 12:42:26 -07:00
Kris Johnson
00b88b521d
Handle Gigantamaxing properly (#7001) 2020-07-23 13:27:42 -07:00
The Immortal
beb0ad1288 Fix validation for unbreedable Pokemon
Thanks @nineage.
2020-07-22 01:17:50 +04:00
Kirk Scheibelhut
d3b898ef7c Normal |t:| protocol message in Runner's DualStream 2020-07-21 13:35:53 -07:00
Marty-D
10e4ecdc84 Clean up event priorities 2020-07-21 10:43:12 -04:00
Kirk Scheibelhut
12f9edd729
Add |t:| to support real-time replays (#6998) 2020-07-20 05:26:04 -07:00
The Immortal
e2d268747c Remove Gmax restrictions
Closes #6954
2020-07-18 21:04:09 +04:00
Kirk Scheibelhut
47492210dc Fix battle serialization post 994fc60a
Thanks JXCoder for finding this!
2020-07-17 12:49:59 -07:00
Kris Johnson
b5ff34f862
Add OM Snake Draft formats (#7009) 2020-07-17 16:55:55 +04:00
Jacob McLemore
30e420204a
Fix Fusion Bolt + Fusion Flare interaction when first move fails (#6991) 2020-07-10 16:29:53 -07:00
urkerab
09350a01bf
Centralise the check for a restricted species (#6973) 2020-07-07 15:30:37 -07:00
ACakeWearingAHat
f9699c1be0
Random Doubles Updates (#6962) 2020-07-06 12:48:48 +04:00
urkerab
6fb5b4e90d
Allow custom formats (e.g. for tours) to modify format restrictions (#6958) 2020-07-05 14:32:30 -07:00
Guangcong Luo
8fd572f1f6 Refactor BattleQueue to wrap Array
The old decision to make it extend Array was wrong, as clearly
illustrated by the problems with slice/splice.
2020-07-01 16:37:36 -07:00
Kris Johnson
7010e0286f
Add OMotM and RoA Spotlight for July 2020 (#6936) 2020-07-01 12:59:10 +04:00
urkerab
17e4cb49a4
Adjust fractional priority for latest research (#6928) 2020-06-29 12:09:10 -07:00
The Immortal
393e2b10ff Ice Face isn't affected by Neutralizing Gas 2020-06-29 21:48:26 +04:00
The Immortal
5e7af36442 Fix Illusion interaction with Dynamax 2020-06-28 16:41:02 +04:00
Kris Johnson
28a4a9a91e
Fix STABmons Move Legality (#6918) 2020-06-25 16:12:57 -07:00
Guangcong Luo
ffecbc289b Fix infinite loop in Pumpkaboo validation 2020-06-25 16:05:04 -07:00
Marty-D
1516a56a93
Fix Burning Jealousy and Lash Out 2020-06-22 16:01:59 -04:00
The Immortal
4b4e7a57fc Implement "battle-ready" mechanic
This allows past-gen event Pokemon to be used in VGC. Closes #6881.
2020-06-21 04:23:52 +04:00
Guangcong Luo
dffd9dbff8 Fix stream destroying
`SubprocessStream` wasn't getting properly destroyed.
2020-06-18 21:47:03 -07:00
The Immortal
8817ca88c7 Move unreleasedHidden and maleOnlyHidden to Pokedex 2020-06-18 17:44:44 +04:00
Kris Johnson
4156eef05d
Fix various Isle of Armor DLC moves (#6862) 2020-06-18 00:25:26 -07:00
Kris Johnson
e20178d69d
Isle of Armor: Pokemon (#6839) 2020-06-17 23:37:14 +04:00
Kris Johnson
6b8826df58
Isle of Armor: Moves (#6841) 2020-06-17 22:02:25 +04:00
Enigami
21685eb661
Fix various Stadium issues (#6838) 2020-06-16 14:27:09 -07:00
Kris Johnson
b0675d7ff2
Add National Dex UU (#6836) 2020-06-15 18:22:45 +04:00
Enigami
8825960c9a
Fix event validator for RBY Tradebacks (#6832) 2020-06-14 11:08:58 -07:00
Guangcong Luo
1e5b5ab465 Update Streams API with pushEnd/writeEnd
Previously, ending a read stream was `stream.push(null)`, and ending a
write stream was `stream.end()`. This was often confusing, and so now,
these are consistently `stream.pushEnd()` and `stream.writeEnd()`.

This refactor already found a bug in which `stream.end()` was used
where `stream.push(null)` should have been.

Also in this refactor: By default, `pushError` ends the stream. You can
pass `true` as the second parameter if the error is recoverable (the
stream shouldn't end).
2020-06-10 16:07:24 -07:00
Mia
6839a1f4db
Add a library for utility functions (#6817) 2020-06-09 22:06:43 -07:00
urkerab
9c2690321c
Allow formats to reorder all six Pokémon again (#6813) 2020-06-07 06:45:43 -07:00
Kris Johnson
73a84a43ec
Fix remaining learnsets inconsistencies (#6795) 2020-06-02 21:31:48 -07:00
Guangcong Luo
4f790cf04f Validate learnset order 2020-06-02 01:02:01 -07:00
urkerab
29feb50376
Fix display of Gen 8 Nursery Mechanics in /learn (#6784) 2020-06-01 22:00:45 -07:00
Kirk Scheibelhut
a58f26d29c Fix EBC restorative berry-cycling win condition
ede3aaec correctly added restorative berries to the
staleness/termination calculation as per the adjusted specification
but failed to update the win condition.
2020-05-31 15:40:36 -07:00
Kris Johnson
5f724397fc
Make Species#nfe work for previous generations (#6776) 2020-05-30 21:36:47 -07:00
Kirk Scheibelhut
ede3aaec2b Include 1/4 HP restoring berries in EBC with Leppa
Thanks pigeons and thimo for coming up with edge cases!

https://replay.pokemonshowdown.com/gen8balancedhackmons-1124152144
2020-05-30 21:26:37 -07:00
Kirk Scheibelhut
54026a5cf7 Only check for EBC after 100 turns have passed
Per DaWoblefets suggestion to avoid interfering with regular play
2020-05-30 20:46:17 -07:00
Kris Johnson
a7948c7c9c
Typescript config/ (#6760) 2020-05-29 19:34:43 -07:00
urkerab
d3a3666e85
Fix bugs caused by not specifying effectiveness priority (#6765)
Inverse Mod needs to go first, to calculate the negated effectiveness.
Disguise goes second, to suppress effectiveness.
Delta Stream goes third, to weaken moves super-effective against Flying types.
Tar Shot goes last, to make its victim weak to Fire type moves.

This allows the existing test for Delta Stream with Tar Shot to pass.
Additionally a new test for Delta Stream with Inverse Mod now passes.
A test for Flying Press with Inverse Mod is also included.
2020-05-29 16:55:42 -07:00
urkerab
45c4bb42fc
Simplify handling of trunc for custom battles (#6767) 2020-05-29 16:46:04 -07:00
The Immortal
df8b99d244 Fix Kyurem learnset validation 2020-05-28 00:41:31 +04:00
Sigmatecture
18b8d019ed
Set Random Battle singles levels by species (#6706) 2020-05-27 00:31:41 +04:00
Guangcong Luo
381bd7508a Clarify species limit and requiredItem errors 2020-05-16 12:30:41 -04:00
The Immortal
8be031bb6d Gen 3 Random Battle: Overhaul set generation 2020-05-14 07:58:36 +04:00
Guangcong Luo
f186eb8e5b Prevent nicknames from getting cut off
Nicknames that are too long will now give an error message instead of
silently being truncated.
2020-05-12 03:14:56 -07:00
Kris Johnson
56fbb0201a
Pikachu-Gmax is now available from raids (#6679)
* Pikachu-Gmax is now available from raids

* Volt Tackle is legal on Gmax Pikachu now
2020-05-12 06:14:57 +04:00
Kris Johnson
d20f1fbb64
Typescript info (#6670) 2020-05-11 03:08:33 -07:00
Kirk Scheibelhut
fa65ed4979
Add alt form index data to dex (#6669)
AltForm index info obtained from kwsch/PKHeX's FormConverter.cs (thanks Kurt).
Thanks to @Lusamine (Anubis) for help with the peculiarities.
2020-05-10 12:20:40 -07:00
Guangcong Luo
3a1fe75b13 Remove isViable from moves
It's a judgment call that doesn't belong among the other factual
information in `moves.ts`.

The information is still around; in the client's `battle-dex-search.ts`
in `BattleMoveSearch#moveIsNotUseless`. But now it's all in one place.

fb18721e82
2020-05-08 19:25:51 -07:00
Kirk Scheibelhut
d621a4b670 Don't assign Struggle a zMove.basePower of 100
This check exists for maxMove.basePower but not zMove. Thank you
SadisticMystic for confirming that while "it has an entry of 1 in
the data table, [it]'s a meaningless entry which is impossible
to access"
2020-05-04 21:49:01 -07:00
Kirk Scheibelhut
2af7040270
Group zMove and maxMove attributes (#6652)
This mostly serves to provide cleaner and more consistent field
naming. maxMove currently doesn't have boosts or effects to group
together but who knows what will be thrown at us via DLC, and being
symmetrical with zMoves is a nice.
2020-05-04 20:21:27 -07:00
Kris Johnson
8faaa45eb8
Gen 8 CAP learnset updates (#6636) 2020-05-04 19:05:28 +04:00
urkerab
1eff20a530
Fix G-Max Chi Strike's effect on Crit Ratio (#6639) 2020-05-01 21:14:01 -07:00
Guangcong Luo
56f6ab5489 Fix Zygarde-Complete validation 2020-05-01 13:02:30 -07:00
urkerab
544417e31f
Gen6+ Transform should also remove Focus Energy if necessary (#6637) 2020-05-01 12:01:56 -07:00
Guangcong Luo
c4dd88ac96 Update Effect type signatures
- `affectsFainted` is a `PureEffect` property

- `infiltrates` shouldn't exist on moves outside of OMs
2020-05-01 11:56:54 -07:00
Guangcong Luo
517d02f016 Fix crash with validating pokemon without learnsets 2020-05-01 14:54:11 -04:00
Kirk Scheibelhut
b05e1941e2 Ensure explosion halves defense in Gen 3&4 2020-05-01 11:03:54 -07:00
Kirk Scheibelhut
74e1e3692f
Fix default Max/Z power for isMax/isZ moves (#6634) 2020-05-01 00:35:10 -07:00
Guangcong Luo
7aa42b1212 Remove Dex.getOutOfBattleSpecies
Literally every current use is a bug.
2020-04-30 23:29:20 -07:00
Guangcong Luo
e0f6453b60 Refactor data definitions
- `Modded[Effect]Data` are now correctly defined: they must either have
  `inherit: true` and be partial, or not have `inherit: true` and be a
	complete `[Effect]Data` entry

- `id` is no longer allowed; instead, it's calculated directly from
  `toID(name)`. The one exception, Hidden Power, gets a `realMove`
	property to track this (it's still used to set `.id`, though;
	TODO: really fix it properly).

- `num` is still required in `data/pokedex.ts` (dex number),
  `data/moves.ts` (move index number, for Metronome), and
	`data/items.ts` (minisprite sprite-sheet location). It's still not
	required for mod-only items and moves.

- `num` is no longer allowed for PureEffects (in `statuses.ts`) where
  it's always been meaningless.

- `color` and `heightm`, being completely flavor, are still not
  required for `pokedex.ts` in mods. They're still required in the base
	pokedex.
2020-04-30 21:39:29 -07:00
Guangcong Luo
826e544b65 Refactor random set generation
The whole `checkBattleForme` system, introduced in 4410843e5a
and currently used in Gen 6 and 7, seems to have always been bugged.

As TI mentions in #5970, we already use `getPokemonPool` for alternate
forme handling.

I've replaced it with a roll for cosmetic formes.
2020-04-30 17:52:04 -07:00
Marty-D
15e4d4f2bd
Gen I-IV: Correctly treat both players having no Pokemon left as a tie 2020-04-30 14:01:32 -04:00
Kirk Scheibelhut
edddcb5c38
Correct Self-Destruct and Explosion base power (#6630)
As confirmed by SadisticMystic, base power cannot be above 255, so
this move data is clearly incorrect and results in downstream users
of the data files such as the Smogon or PS dex or the tooltips
displaying misleading information.
2020-04-29 14:59:59 -07:00
Guangcong Luo
9319f68423 Remove Unown forme from locked users
Apparently our old hack was to prevent Unown formes completely, because
locked users would sometimes use them to spell bad words.

I don't like that approach, so now only locked users can't use Unown
formes.
2020-04-29 14:15:04 -07:00
Guangcong Luo
800d8bd8f3 Remove Dex.getForme etc
The server now uses the same approach as the client of treating
cosmetic formes as real formes, as documented in `FORMES.md`.

This eliminates the need for the `.forme` and `.speciesid` properties
of `Pokemon`.

`pokemon.id` has also been removed: useful, since it turns out half
of its uses were bugs that should have used `pokemon.species.id`.
2020-04-28 17:38:54 -07:00
Guangcong Luo
42f949a0ed Remove egg group info from Gen 1 Pokédex 2020-04-28 16:25:35 -07:00
Kris Johnson
1bb842e099
Convert evos/prevo/etc from IDs to names (#6625) 2020-04-28 16:02:50 -07:00
urkerab
1ede5508aa
Moxie and Beast Boost should have one combined boost for all fainted Pokémon. (#6557)
In addition, they should not activate for a spread move that ends the game.
(This contrasts with Soul-Heart, which will activate until the last target.)
2020-04-27 15:44:33 -07:00
Guangcong Luo
e8e3493c40 Fix Struggle activation conditions
PS wasn't correctly detecting `disabled: 'hidden'` moves as disabled
for the purposes of detecting Struggle activation. This has been fixed.

Thanks to DaWoblefet for unit tests!

Fixes #6620
2020-04-26 17:52:06 -07:00
Guangcong Luo
987eb08ad2 Fix gmaxPower location 2020-04-26 17:52:06 -07:00
Kris Johnson
979be98574
Refactor inheritsFrom to changesFrom (#6611) 2020-04-26 14:44:25 -07:00
urkerab
fce96d8a15
Pass the Transform or Imposter effect to onModifySpecies (#6623) 2020-04-26 14:12:10 -07:00
Kirk Scheibelhut
30defec706
Validate that SpA and SpD EVs match in Gen 2 (#6615)
Pointed out by FOMG in https://www.smogon.com/forums/threads/gen-2-ps-development-post-bugs-here.3524926/post-8439815
2020-04-25 13:01:02 -07:00
Guangcong Luo
c5faebd739 Remove extraneous properties from BasicEffect
BasicEffect always had a `status` property to support the pattern of
testing it to see if it's a move that sets status directly.

This is just a situation that TypeScript is bad at.

Another possibility would be to set `status: undefined` on PureEffect,
Ability, Item, and Species, but I think that's also ugly. Casting to
Move is probably the best approach, so that's what we do now.
2020-04-25 12:57:46 -07:00
Guangcong Luo
549ef7edb1 Fix MoveData interface definition
For historical reasons, move property definitions have been very blurry
across `EffectData`. Fortunately, recent refactors have made it
possible to put them all where they're supposed to be.
2020-04-25 12:57:46 -07:00
Guangcong Luo
5d63b16d4d Fix botched merge in data/.ts refactor
The data/.ts refactor left a few .js files in, which weren't deleted
between 13 and 3 days ago:

c85f5bccb0

Because of this, the corresponding `.ts` files were considered new,
rather than renamed, and changes to the `.js` files got deleted rather
than merged.

Fortunately, this only affected `moves.js`, which has now been manually
re-merged with the changes.
2020-04-23 11:22:21 -07:00
Kris Johnson
28bf388b98
Typescript data (#6553) 2020-04-23 09:16:09 -07:00
Guangcong Luo
ebbcbf06a8 Fix Gen 2 gender ratio calculation
(Apparently it was based on older incorrect gender ratio information
from Bulbapedia.)

New version confirmed by Marty.
2020-04-20 12:51:44 -07:00
The Immortal
f194d31aac Fix G-Max moves legality again 2020-04-16 04:47:15 +04:00
Kirk Scheibelhut
78151fad79 Fix 32e193b2 to rely on isMax instead of Nonstandard 2020-04-15 16:15:19 -07:00
Guangcong Luo
900ad5a8c8
Prioritize -All Pokemon above +Past etc (#6574)
Previously, format bans/unbans were processed in order of "most specific
to least specific".

So `+Giratina-Origin` trumps `-Giratina` trumps `+Uber` trumps
`-All Pokemon`.

And nonstandard reasons (`Unobtainable`, `Past`, `CAP`, etc) were
slotted between `Uber` and `All Pokemon`.

This has the unfortunate effect that if a base ruleset allows a certain
normally-banned category of Pokémon, you can't use `-All Pokemon` to
whitelist a list of Pokémon.

Moving nonstandard reasons to lowest precedence once again allows
`-All Pokemon` to be used as intended.
2020-04-14 15:27:59 -07:00
The Immortal
32e193b2b9 Prevent G-Max moves from being used in Hackmons 2020-04-13 19:41:54 +04:00
Guangcong Luo
13ddc8f908 Add Custom Game warning for 510 EV limit
Custom Game is intended to be a "choose your own rules" format. It's usually pretty easy to tell if a
rule is being followed or not (a level 500 Pokémon is rather conspicuous) but EVs are generally
considered a secret.

For this reason, I've added a message for a discrepancy in EV use: one player adhering to the 510 EV
limit, and the other player not adhering to it.

This message is specific to Debug Mode (which Custom Game is, by default), which already leaks some
minor information, anyway.

To avoid information leaks completely, use Custom Rules:

https://github.com/smogon/pokemon-showdown/blob/master/config/CUSTOM-RULES.md
2020-04-11 04:20:19 -04:00
Kirk Scheibelhut
1f8c6bc7b8 Fix illegal ActiveMove cast in battle.ts
Frankenstein checkJs-Typescript with globals derps out and lets this
kind of thing slide, but without `hit` (which is only assigned the
line below) you can't cast to ActiveMove.
2020-04-08 22:33:56 -07:00
Kris Johnson
c13a12cb65
Add mod support for Field (#6543) 2020-04-08 16:22:52 -07:00
Guangcong Luo
091f764681 Fix rule inheritance 2020-04-08 13:25:11 -07:00
Guangcong Luo
0fb601f7f2 Don't allow arrays in battle.add
A bug in Mimicry happened because someone put an array into
`battle.add`. This shouldn't happen.

(Also add a hint for Mimicry.)
2020-04-08 11:17:48 -07:00
Guangcong Luo
2a3b739644 Work around teambuilder nickname issue
Apparently the teambuilder still defaults nicknames to full species
names, instead of base names as you might expect. This will have to be
fixed later...
2020-04-08 10:36:37 -07:00
Guangcong Luo
5abdb88e55 Refactor EventListener
Renames:
- .status -> .effect
- .statusData -> .state
- .thing -> .effectHolder

`thing` was always a really weird "I don't know what to call this"
variable name, but it's been renamed `effectHolder`, which should be
much clearer. `status` -> `effect` is I think the last remnant of old
PS code which called all effects "statuses". `statusData` -> `state`,
on the other hand, is the very first step in an initiative to calling
less things "data".
2020-04-07 17:05:19 -07:00
Guangcong Luo
ff0b80f297 Fix triples shift priority 2020-04-07 10:56:20 -07:00
Guangcong Luo
9d3351f12d Nickname Clause: Enforce after format validation
This allows OMs like Cross Evolution to use nicknames of other species
in `onValidateSet`.

Enforcement also now generates an error message, instead of silently
changing the name.
2020-04-07 10:56:19 -07:00
The Immortal
879b117b27 Add OU suspect test
I also made it such that unbans are no longer inherited. This makes it simpler to follow Smogon's system of tier transitivity, and suspect tests without suspect ladders.
2020-04-06 23:32:09 +04:00
The Immortal
634658a5ba Refactor unreleased Pokemon
Pokemon that are not available in-game are now consolidated into `isNonstandard`. 'Past' indicates that the Pokemon no longer works in the current generation. 'Unobtainable' indicates that the Pokemon works but can only be obtained through hacking.
2020-04-06 20:53:03 +04:00
The Immortal
78fde78f19 Refactor unavailable moves
Moves that are not available in-game are now consolidated into `isNonstandard`. 'Past' indicates that the item no longer works in the current generation. 'Unobtainable' indicates that the item works but can only be obtained through hacking.
2020-04-06 20:26:10 +04:00
The Immortal
387dd7ce2d Refactor unavailable items
Items that are not available in-game are now consolidated into `isNonstandard`. 'Past' indicates that the item no longer works in the current generation. 'Unobtainable' indicates that the item works but can only be obtained through hacking.

Credit to @lusamine for testing many of these items in Sw/Sh.
2020-04-05 23:54:57 +04:00
Kirk Scheibelhut
d17a48cc47 Fix Dex#getForme for Flabebe 2020-04-04 21:36:58 -07:00
Kris Johnson
18dfc9ae30
Add Shared Power (#6522) 2020-04-05 00:01:02 +04:00
Guangcong Luo
20e7e604eb Unify more switch-in code
This removes the redundant 'SwitchOut' code, and continues to ensure
that switching and dragging share as much code as possible, which
should help avoid bugs where they previously were different for no
reason.
2020-04-03 19:08:54 -07:00
Waleed Hassan
855899b330
Fix Battle#switchIn (#6521)
Regression caused by: 47b55f96bc

`Battle#dragIn` used to run the `SwitchOut` event among other functions
but were accidentally left off in the refactor. This commit adds them back.

The main bug caused by this is Natural Cure not curing status aliments when
phased out by Roar.
2020-04-03 09:22:55 -07:00
Guangcong Luo
e10a6459d7 Refactor hasType
Closes #6501
2020-03-31 02:39:33 -07:00
Guangcong Luo
75bff1cbb7 Fix validation for event-only VC Pokémon
Previously, we had a weird carved-out exception for Celebi from
74143b652d

But it actually applies to all VC Pokémon (most importantly Suicune).
2020-03-30 07:09:12 -07:00
Guangcong Luo
ba4fab47d2 Implement pokemon.previouslySwitchedIn 2020-03-30 05:27:58 -07:00
Guangcong Luo
47b55f96bc Refactor dragIn to delegate to switchIn
dragIn and switchIn being two separate functions is a weird historical
quirk that leads to inconsistencies in implementation.

The only reason they need to be separated is a Mold Breaker quirk:
1da65efb12

(This is now done with an `if` statement.)

This should fix a lot of Roar/Whirlwind mechanics issues from `dragIn`
being on outdated mechanics compared to `switchIn`.
2020-03-30 05:25:20 -07:00
Guangcong Luo
2d78044604 Fix activeTurns/activeMoveActions bugs
`activeTurns` was previously a horrible hack, used for "first full turn
only" effects like Speed Boost as well as "first move action" effects
like Fake Out.

In addition to being a huge hazard for API users such as OMs, this also
means weird bugs such as Speed Boost not working if you get hit by
Sky Drop on your first turn.

This commit fixes them by splitting these counters into two - an
`activeTurns` counter for Speed Boost, and an `activeMoveActions`
counter for Fake Out.
2020-03-30 04:07:05 -07:00
Guangcong Luo
60effa1838 Fix DW move validation 2020-03-30 02:29:13 -07:00
Marty-D
7a09037213 Validator: Fix Gen 2 event move tradebacks 2020-03-26 13:54:14 -04:00
Kirk Scheibelhut
f4d6b7d19c Add Dex#forGen for symmetry with the client 2020-03-26 10:26:05 -07:00
The Immortal
81891546b9 Rename Missingno. to MissingNo. 2020-03-26 18:37:35 +04:00
Kris Johnson
ea1b028950
Rename cosmeticFormeName to forme (#6492) 2020-03-26 18:13:31 +04:00
Kris Johnson
994fc60aed
Rename Template to Species (#6478) 2020-03-25 23:29:27 -07:00
Guangcong Luo
2534753325 Fix Hidden Ability validation 2020-03-24 23:55:54 -07:00
Guangcong Luo
5108a62f5e Standardize on using + for move targeting
Move targets are now intended to be +1 +2 +3 for foes. The old syntax
of using 1 2 3 is still supported, but is not recommended.

(The old syntax will still be used in the old client, but the Preact
client will support the new syntax going forward.)

This makes the difference between move number and move target
clearer.

This also fixes the Conversion 2 ambiguity (although for backwards
compatibility, we do still need to special-case it).
2020-03-23 23:50:46 -07:00
Guangcong Luo
90c503724f Support and document /move max mindstorm
Dynamax and Z move decisions can now be input by naming the max move
or z-move involved.

Fix #6425
2020-03-21 23:38:04 -07:00
Kris Johnson
770f1a3f7c
Add support for (NU) (#6475) 2020-03-20 20:50:14 -07:00
The Immortal
1765d9fbfa Improve bbb4da013 2020-03-19 02:06:10 +04:00
The Immortal
c09044a777 Move gen property to Pokedex 2020-03-18 23:09:45 +04:00
The Immortal
bbb4da0131 Refactor forme data 2020-03-18 15:17:55 +04:00
Kris Johnson
3e26318758
Refactor learnsets.js (#6466) 2020-03-18 00:59:29 -07:00
Guangcong Luo
884e059529 Correctly crash for errors in data files
Four years ago, Slayer95 added an error for invalid data files.

c1e452ea59 (diff-498e7bc80cf67d246be8aa3f2bbbb653R88)

To bypass the try/catch, he returned the error, and then checked for
the result being `instanceof Error`.

Three years ago, I refactored `tryRequire` to `loadDataFile` and moved
the `MODULE_NOT_FOUND` check from outside the function to inside it.

2604780ec5

But I didn't notice the `return new Error` pattern, so I didn't update
that to the modern pattern, so error checking has been broken ever
since.
2020-03-17 23:21:47 -07:00
Guangcong Luo
40499b6cf6 Remove dependency of sim on Config 2020-03-17 21:06:40 -07:00
Guangcong Luo
f2357d167b Document EventInfo.shiny
It defaults to "never shiny" rather than "sometimes shiny" as might be
intuitively obvious, so it deserves documentation about this.
2020-03-17 19:44:50 -07:00
Kirk Scheibelhut
743173be57 Export Nature to allow TSC to compile Pokemon
"TS4053: Return type of public method from exported class has or is
using name 'Nature' from external module but cannot be named."

PS misses out on these errors because its TSC is dump in checkJS
mode, but if you ever try to emit with TSC it will type check things
properly.
2020-03-17 18:56:44 -07:00
Kirk Scheibelhut
508c2ed4aa Exported constant classes can't have private modifiers 2020-03-17 18:52:45 -07:00
Kirk Scheibelhut
17501fc001
Remove restrictions on concurrent battle searches (#6462)
https://www.smogon.com/forums/threads/improve-searching-for-concurrent-ladder-battles.3660989/
2020-03-16 21:17:34 -07:00
Kris Johnson
83ebdb27da
Add Dex#getOutOfBattleSpecies (#6463) 2020-03-16 20:31:38 +04:00
Kris Johnson
b077646808
Random Battles chat plugin: Fix various issues (#6448) 2020-03-12 12:37:10 +04:00
Guangcong Luo
64ff1da81f Refactor more things to use inheritsFrom 2020-03-10 09:59:36 -07:00
The Immortal
84253d40ee Fix getPokemonPool 2020-03-10 17:43:03 +04:00
Kris Johnson
82a3fc7b94
Refactor [Gen 2] Random Battle (#6435) 2020-03-09 11:56:15 +04:00
Kris Johnson
86761e3577
Add Random Battles chat plugin (#6433) 2020-03-09 09:55:43 +04:00
Kirk Scheibelhut
36b5b48d79 Add Gen 8 support for RandomPlayerAI and sim tools
- add support to the RandomPlayerAI for Dynamaxing
 - add support to ExhaustiveRunner for Gigantamax Pokemon
 - simplify range logic in RandomPlayerAPI
 - handle crash from toID (needed by data/scripts.js) and Config
	(needed if a Battle takes long enough to potentially allow for
	requesting ties) globals not being defined
 - mark Gen 8 formats as runnable by the runners
2020-03-08 20:56:59 -07:00
Guangcong Luo
38e4af504c Fix Emergency Exit on switch-in 2020-03-08 20:16:53 -07:00