Commit Graph

101 Commits

Author SHA1 Message Date
Jacob McLemore
30e420204a
Fix Fusion Bolt + Fusion Flare interaction when first move fails (#6991) 2020-07-10 16:29:53 -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
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
Kirk Scheibelhut
adfc77246b EBC: Entrainment/Skill Swap inflicts staleness 2020-05-28 12:05:16 -07:00
Leonard Craft III
c249a8f0be
Add various mechanics tests (#6714) 2020-05-18 12:19:18 -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
f6f4467265 Turn on prefer-const for .js files
Not having prefer-const on the JS side makes JS -> TS refactors really
unreadable. This commit just auto-fixes it so we're using
`prefer-const` everywhere.
2020-04-23 11:37:47 -07:00
Kris Johnson
28bf388b98
Typescript data (#6553) 2020-04-23 09:16:09 -07:00
Kirk Scheibelhut
2b8c03fe04 Increase test timeout in test/sim/misc/state.js
This is already marked as '(slow)' so could be timeout(0), but this
shouldn't be *that* slow, so increasing it from 2000 to 5000 seems
sufficient.
2020-04-11 12:04:17 -07:00
Guangcong Luo
33fa9d56ef Fix mega evolving into self
A hacked-in Megazard X can mega evolve into Megazard Y, but not into
Megazard X.
2020-04-07 10:56:19 -07:00
Marty-D
2aae13ff62 Fix Round and Pledge move interaction with Z- and Max Moves 2020-03-31 16:33:42 -04:00
Leonard Craft III
296c308e62
Add test for when Dynamax should revert (#6502) 2020-03-30 01:03:37 -07:00
Kris Johnson
994fc60aed
Rename Template to Species (#6478) 2020-03-25 23:29:27 -07:00
Leonard Craft III
380b4ac1cd
Add tests for Pledge moves modified by Z/Dynamax (#6489) 2020-03-25 19:14:48 -07:00
Guangcong Luo
ac50dc2a48 Fix Dynamax Liquid Voice 2020-03-07 14:57:54 -08:00
Guangcong Luo
185966f44d Fix G-Max Steelsurge damage against Eiscue 2020-03-07 14:52:45 -08:00
Guangcong Luo
1a447f7487 Add tests for Max Geyser Sand Spit 2020-02-23 22:10:49 -08:00
Guangcong Luo
f89f44f209 Max Guard is disabled by Assault Vest 2020-02-21 00:46:28 -08:00
Alexander B
88fa845350 Add Gen 8 unit tests
Closes #5952

(Bugs in PR fixed by Zarel)
2020-02-21 00:46:28 -08:00
Guangcong Luo
229f5f809d Use assert in strict mode
This makes it so we can use `assert.equal` instead of
`assert.strictEqual`, which I think is more readable.
2020-02-20 00:39:31 -08:00
Kirk Scheibelhut
e44a5683c3 Add EBC to Gens 1 and 2 (#6298)
Also add test for 1000 turn termination behavior.
2020-01-22 14:13:36 -08:00
Guangcong Luo
e6f53a7ad2 Implement smart target tracking
(Stalwart, Propeller Tail, Snipe Shot behavior.)
2020-01-18 15:43:33 -07:00
Guangcong Luo
49e65dc803 Refactor unit test battle formats again
It turns out not creating a format on-the-fly breaks deserialization.

We now just use the same custom-rule system that tournaments use.
Some hacks are currently necessary (many tests assume that we're
playing in Anything Goes rather than Custom Game) but we'll work them
out in time.
2019-12-11 16:26:45 +09:00
Guangcong Luo
b9fb3e3a0a Refactor test formats
`Dex.installFormat` has been deprecated and removed. Formats are now
directly created and cached by our unit test framework. This should
lead to fewer weird bugs.
2019-12-11 03:41:36 +09:00
Guangcong Luo
45e5b6cc7d Add more tests for mega evolution Speed changes 2019-12-04 13:36:40 +09:00
Guangcong Luo
eb614e627f Fix switch order
Fixes #6135
2019-12-04 13:36:39 +09:00
Guangcong Luo
fe0d044d2b Fix tests to run on Gen 8 instead of Gen 7 2019-12-04 13:36:37 +09:00
Guangcong Luo
d5b4b7964e Fix mega evolution priority move interaction 2019-12-01 20:08:25 +13:00
HoeenHero
7957e74b75
Dynamic speed updates for Gen 8 (#6100)
In Generation 8, a Pokemon's speed updates dynamically. Meaning that it can move sooner than expected if its speed is modified by something such as tailwind or swift swim. This is different from past generations where the Pokemon's updated speed would only take effect the next turn.
2019-11-28 17:08:58 -05:00
Guangcong Luo
a00d64a092 Fix some tests to be less RNG-dependent 2019-11-28 18:16:02 +13:00
The Immortal
7cccda3b18 Update Other Metagames 2019-11-25 06:53:08 +04:00
HoeenHero
c37b57e172 Update Random monotype team generator test to Gen 8 2019-11-18 23:35:03 -05:00
Guangcong Luo
84fb8d5bb4 Fix some build crashes 2019-11-16 10:13:27 +13:00
Guangcong Luo
801af59b98 Fix remaining build errors
- Centiskorch was misspelled in formats-data, causing a crash in the
  egg validator

- A few validation errors were due to Gen 6 not inheriting from Gen 7,
  Gen 7 not having a scripts file, and Gen 8 having a gen of 7

- Intimidate (Gen 7) wasn't inheriting from Intimidate (Gen 8), giving
  it no name, causing a few validation errors

  (Technically not a build error, but I also added Keen Eye to the list
  of Intimidate immunities, as reported by SadisticMystic.)

- A lot of tests relied on Teleport always failing; these have been
  switched to Gen 7 or swapped Teleport for Celebrate

- Inverse Mod suddenly stopped working; its implementation was a huge
  hack and I can't figure out what went wrong, so I've switched it to
	using the same system the other mod tests use. It's still a huge
	hack, but I don't have the free time to fix it right now.
2019-11-16 06:08:48 +13:00
Kirk Scheibelhut
691cf76de7 Fix EBC for external staleness via consumed Leppa 2019-10-05 15:41:18 -07:00
Guangcong Luo
7a023746ba
Refactor battle.dex out of battle (#5851)
In most other similar systems, like TeamValidator, we use `thing.dex` instead of having it extend `ModdedDex`. Battle has always extended `ModdedDex`, though. This changes Battle to match the others.

This should fix an issue with `Battle.data` not being cached.

This also frees up Battle to extend ObjectReadWriteStream<string> in a future update.
2019-10-06 07:38:08 +11:00
urkerab
948257cce7 Change weight units to hectograms (#5765) 2019-10-03 14:00:16 +10:00
Kirk Scheibelhut
4f70c022d6 Correct EBC switch condition to match the spec
"at least one team does not have the option of switching to a
non-stale Pokémon"
2019-09-01 16:17:36 -07:00
Jacob McLemore
3af1c771c2 Fix Encore + Pledge moves interaction (#5641) 2019-08-01 20:31:38 -04:00
Kirk Scheibelhut
df083d7528 Remove Object.assign(function) pattern from TeamValidator{Async} 2019-07-01 08:20:51 -07:00
Kirk Scheibelhut
8fe6d89d14 Make sure randomly generated monotype teams are actually all one type 2019-06-27 12:10:03 -07:00
Kirk Scheibelhut
d279a95829 Ensure random team generation always ends up with 6 Pokemon (#5556) 2019-06-27 10:23:25 -07:00
Kirk Scheibelhut
676b3b276c Actually correct assertions in EBC tests 2019-06-20 11:52:48 -07:00
Kirk Scheibelhut
01f56dbcea Fix asserts in EBC tests to actually check the winner 2019-06-19 21:04:50 -07:00
Jacob McLemore
0ae5f842d3 Fix Fusion Bolt and Fusion Flare's interaction with each other (#5493) 2019-05-14 15:49:51 -04:00
Kirk Scheibelhut
3d24166cdf toId -> toID
Closes #5479
2019-05-12 17:53:01 -07:00
Kirk Scheibelhut
297b7a951c Mark EBC, Random Team Generator and serialization tests as slow 2019-05-09 17:47:00 -07:00
Kirk Scheibelhut
a0734bde6f Redo Endless Battle Clause with a new specification (#5472) 2019-05-07 11:18:06 +09:30
Kirk Scheibelhut
df3d9b91ef Battle toJSON/fromJSON (#5427) 2019-04-30 14:48:27 +12:00
Kirk Scheibelhut
3a366d0499 Fix Gen 2 TOX -> PSN crash (#5463) 2019-04-26 09:21:11 -07:00
Slayer95
ffb3678b0f Test: Update folder structure to match source code (#5436) 2019-04-14 23:57:06 +09:30