Commit Graph

117 Commits

Author SHA1 Message Date
The Immortal
8bb09561e0 Add Protean tests 2020-11-21 11:14:34 +04:00
Leonard Craft III
920af21aac
Abilities: Add isPermanent flag (#7614) 2020-11-03 10:31:11 -05:00
The Immortal
42f491a092 Fix Ripen 2020-10-30 14:03:35 +04:00
Leonard Craft
b673ff3fe4 Add Berserk to the Berserk sim test 2020-10-30 03:05:46 +00:00
The Immortal
1a0e56a3ac Fix Neutralizing Gas interactions 2020-10-29 04:35:12 +04:00
Kris Johnson
b1e2331c7b
Fix Slow Start's interaction with Neutralizing Gas (#7580) 2020-10-28 12:51:33 -07:00
Leonard Craft
db2a55a1bb Clarify Neutralizing Gas + Imposter test 2020-10-22 11:53:11 -05:00
Leonard Craft
4e3c8bd3cc Consolidate Neutralizing Gas tests; add Gluttony/Slow Start NGas tests 2020-10-22 11:49:11 -05:00
Leonard Craft III
1081a4423f
Add various mechanics tests (#7506) 2020-10-16 21:07:05 -07:00
Guangcong Luo
a65faf263f
Stop using assert.strict.strictEqual (#7515)
It turns out that when I switched us from `assert` to `assert.strict`,
I didn't actually update any existing tests or tell anyone:

0df0d234f2

So apparently everyone else just kept on using `strictEqual`.

This will be a PR and also throw an error if people continue trying to
use it, which should make it much clearer what PS policy is on this.

A lot of the problem may be that TypeScript marks assert.strict.equal
as deprecated when it's not. This was fixed 4 days ago:

https://github.com/DefinitelyTyped/DefinitelyTyped/pull/48452

But this probably hasn't made it to a thing yet. Until then, you'll
have to deal with TS marking your tests as deprecated, but it shouldn't
be too long.

Accidentally using `assert` instead of `assert.strict` should now show
an error. This protects against the probably much worse mistake of
accidentally using `assert.equal` rather than `assert.strict.equal`.

`assert.ok` is also deprecated now.
2020-10-14 01:19:03 -07:00
Kris Johnson
8656d633ac
Format volatiles consistently (#7314) 2020-09-05 08:12:24 -07:00
The Immortal
6ef15d4a9b Fix Adrenaline Orb 2020-06-19 16:52:56 +04:00
urkerab
fc6e4b82ae
Disguise breaking prevents critical hits (#6766) 2020-05-29 18:57:39 -07:00
HoeenHero
148570ddb5 Fix Emergency Exit Bug
Fixes 0450e8cb65
2020-05-27 10:11:04 -04:00
Leonard Craft III
27efca0f32
Add EE tests for new bugged behavior (#6752) 2020-05-27 10:00:16 -04:00
fart
0450e8cb65
Fix Life Orb + Emergency Exit interaction (#6738) 2020-05-25 14:14:59 -07:00
Leonard Craft III
c249a8f0be
Add various mechanics tests (#6714) 2020-05-18 12:19:18 -07:00
Leonard Craft III
1dbb1a280b
Unskip passing tests (#6662) 2020-05-07 16:53:10 -07:00
Guangcong Luo
5aa5f53089 Fix Shields Down for cosmetic formes 2020-05-01 23:30:04 -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
urkerab
554cb570a7
Dancer should not activate if the holder fainted (#6613) 2020-04-25 09:55:13 -04: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
Marty-D
d9d345d8df Correct power modifier priorities
Thanks @dawoblefet!
2020-04-18 20:33:13 -04:00
Luc Moussiegt
4a749aff3e
Fix Technician interaction with Battery/Auras/PowerSpot (#6587) 2020-04-18 12:46:19 -04:00
Guangcong Luo
80634c6918 Fix Dazzling
I don't like using Bulbapedia as a source, but our researchers are all
asleep and TI said this was high-priority.
2020-04-16 03:12:40 -07:00
Kirk Scheibelhut
79ea998a93 Skip failing dazzling test 2020-04-15 16:17:37 -07:00
The Immortal
01aac3b491 Add Dazzling tests 2020-04-15 22:22:56 +04:00
urkerab
19be262793
Fix Pastel Veil mechanics (#6571)
Makes Pastel Veil pass the tests from #6568
2020-04-13 15:18:14 -07:00
Leonard Craft III
be3a396bf7
Add Pastel Veil, Emergency Exit, and Fell Stinger tests (#6568) 2020-04-12 23:06:36 -07:00
Guangcong Luo
40783b7dc6 Fix spread moves vs Unaware 2020-04-07 10:56:20 -07:00
Marty-D
ff3ca6783a Fix Imposter activation 2020-04-05 14:56:42 -04:00
Leonard Craft III
d8cf01bee1
Add Primal weather phazing test (#6525) 2020-04-05 08:50:17 +04: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
Leonard Craft III
dbf7d33e50
Add test for Unaware & spread moves (#6506) 2020-04-01 00:46:45 -07:00
The Immortal
2ad5525e8b Fix Parting Shot mechanics 2020-03-20 21:23:33 +04:00
The Immortal
a0c2d72fac Add another Emergency Exit test 2020-03-20 00:36:40 +04:00
Leonard Craft III
bce32d4613
Add Mirror Armor Parting Shot test (#6452) 2020-03-17 20:38:31 -07:00
The Immortal
5211e36778 Add another Emergency Exit test 2020-03-11 10:00:49 +04:00
Guangcong Luo
38e4af504c Fix Emergency Exit on switch-in 2020-03-08 20:16:53 -07:00
Guangcong Luo
fbc6d2a6d0 Fix Emergency Exit with residual damage
Fixes #6424
2020-03-07 15:47:44 -08:00
The Immortal
cecbf396cd Revert "Fix Moxie and Beast Boost in doubles"
This reverts commit d7af602017.
2020-02-23 13:46:18 +04:00
The Immortal
d7af602017 Fix Moxie and Beast Boost in doubles 2020-02-22 19:30:44 +04:00
The Immortal
79af87374a Fix Wandering Spirit 2020-02-21 18:18:51 +04: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
Guangcong Luo
e3c9cf22ab Fix Max move Lightningrod redirection
Max moves can be redirected to allies, even though they can't
normally hit allies.

Fixes #6375
2020-02-19 01:01:58 -08:00
Guangcong Luo
206b5c2b26 Fix multihit moves vs Emergency Exit 2020-02-18 01:13:10 -08:00
The Immortal
45e4e64f5f Add another Emergency Exit test 2020-02-16 04:45:57 +04:00
Guangcong Luo
09e563f9fc Fix some moves triggering abilities twice 2020-02-15 08:54:14 -08:00
The Immortal
62f3c0f4fd Change Aftermath test 2020-02-15 18:26:49 +04:00
Guangcong Luo
6a677e39e8 Fix Emergency Exit timing
This is a really hacky implementation of Emergency Exit, but Emergency
Exit itself is a huge mess on cart, too.

Our previous implementation:
- activated Emergency Exit at AfterMoveSecondary timing for move damage
- activated Emergency Exit immediately after dealing any other damage

This new one:
- activates Emergency Exit only in three situations:
- right after AfterMoveSecondary timing, for move damage
- right after DamagingHit timing, for DamagingHit residual damage
  (Rough Skin, Iron Barbs, Rocky Helmet)
- right after the switch update, for switch-hazard residual damage
  (Stealth Rock, Spikes)
- does not otherwise activate (so Substitute, Hail, Toxic, etc no
  longer activate Emergency Exit)

This should much accurately simulate Emergency Exit behavior, including
most famously timing it after healing berries after hazards, as
documented in:

https://www.smogon.com/forums/threads/pokemon-sun-moon-battle-mechanics-research.3586701/#post-7075354

Fixes #6309
2020-02-08 08:07:39 -08:00
Marty-D
47c8d6b52b Fix Pickpocket interaction with switches
U-turn is the only switch effect that occurs after Pickpocket resolves during an attack segment (even though the switch message and animation appear to happen before it)
2020-02-02 15:02:41 -05:00
CK Yong
f8d0f3fffd Fix Pickpocket applying when being switched out through Eject Button (#6254)
Also makes sure that dragging moves like Dragon Tail do activate Pickpocket.
2020-01-13 19:32:37 -05: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
The Immortal
1b0eb00ca4 Another Neutralizing Gas test 2019-12-05 17:55:10 +04:00
The Immortal
65df724480 Test Neutralizing Gas against Natural Cure 2019-12-04 23:19:35 +04:00
The Immortal
674c1a64a0 Add tests for Neutralizing Gas 2019-12-04 17:50:48 +04: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
The Immortal
eb905cbe92 Implement Disguise damage 2019-11-18 23:58:00 +04:00
Guangcong Luo
6de97db219 TypeScript event handler types 2019-11-18 07:02:32 +13:00
Guangcong Luo
2601450517 Fix Ice Face 2019-11-18 06:23:24 +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
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
jmclemo6
e4ad7d894b Moves: Fix Flower Veil + Yawn interaction when ally is already under effect of Yawn 2019-07-21 14:21:42 -05:00
Jacob McLemore
7e4ebe44aa Make moves called by Dancer target properly (#5616) 2019-07-16 21:15:05 -04:00
Slayer95
ffb3678b0f Test: Update folder structure to match source code (#5436) 2019-04-14 23:57:06 +09:30