Commit Graph

142 Commits

Author SHA1 Message Date
Karthik
42333b392b
Fix self-KO timing for Memento/Healing Wish/Lunar Dance (#8750) 2022-05-04 17:32:37 -04:00
Karthik
71cf44125e
Gen 4: Fix Knock Off interaction with Sticky Hold and Multitype (#8745) 2022-05-04 17:30:54 -04:00
Karthik
1e4f9d4284
Fix Pursuit activating on non-adjacent foes in Triples (#8738) 2022-04-29 20:29:28 -04:00
Karthik
0e692d4a9e
Gen 3-4: Fix Knock Off mechanics (#8569) 2022-04-25 18:03:35 -04:00
Karthik
cfff8b85aa
Fix Focus Punch/Beak Blast/Shell Trap charge timing (#8733) 2022-04-25 16:35:36 -04:00
Karthik
a442790709
Gen I: Fix Transform bugs (#8732) 2022-04-24 17:59:37 -05:00
Karthik
ab0e9b05e2
Fix failure checks for moves that fail with no switch-ins remaining (#8717) 2022-04-10 23:31:36 -05:00
Karthik
4291ccb51b
Fix interaction between Future attacks and Protean (#8718) 2022-04-08 18:31:00 -05:00
Leonard Craft III
c9dfdb847b Fix failing tests using regex on Windows 2022-03-09 20:23:52 -06:00
Karthik
2cbfac9b68
Fix Heal Bell/Aromatherapy in Multi Battles (#8671) 2022-02-21 14:22:52 -05:00
Leonard Craft III
eb93b88875
Fix healing moves to use healing failure messages (#8596) 2022-01-03 17:26:07 -06:00
Karthik
fa4944de5a
Gen 3-4: Fix Snatch when used by multiple pokemon (#8592) 2022-01-01 18:07:30 -05:00
Leonard Craft III
8750f8f8f4
Fix interaction of failed Z heal replacements (#8591) 2021-12-30 17:29:37 -06:00
pyuk-bot
517e642fec
Fix interaction of Future attacks and Unaware (#8547) 2021-11-30 18:55:42 -06:00
Leonard Craft III
ba07a7c75d
Add various mechanics tests (#8494) 2021-11-05 13:28:45 -05:00
pacmanboss256
c2a5848768
Prevent Sparkling Aria from curing burns if the user faints (#8381) 2021-08-10 11:02:12 -04:00
Jacob McLemore
9979d3e66b
Fix Sky Drop + Eject Button interaction (#8429) 2021-08-09 19:03:52 -05:00
Annika
c134195915
Use ts-node instead of Sucrase (#8369) 2021-07-09 19:59:22 -07:00
Marty-D
6a833db4f6 Gen III-IV: Fix Choice lock timing 2021-07-08 15:46:02 -04:00
Marty-D
43713804b9 Gen II-IV: Fix Destiny Bond handling during Pursuit
Thanks, xzern and SuperEpicAmpharos!

Also noticed the Pursuit switch accuracy check wasn't overridden in Gen 2 yet so I threw that in too.
2021-06-24 12:05:11 -04:00
Marty-D
a5929b3076 Gen III: Make Follow Me a slot condition
Thanks, xzern!
2021-06-23 11:32:43 -04:00
Adam Tran
be2210f881
Fix Future Sight Life Orb interactions (#8357) 2021-06-08 11:48:10 -04:00
Karthik
094623f18b
Sky Drop: Fix message when target is fainted (#8334) 2021-05-26 14:51:52 -07:00
Karthik
7988f15526
Gen 3: Always break the opponent's screens with Brick Break (#8325) 2021-05-25 15:39:40 -04:00
pacmanboss256
91f86530c5
Fix Gen 3 Weather Ball and Gen 4 Trick (#8314) 2021-05-24 15:07:37 -04:00
pacmanboss256
647ebd5fc6
Fix Counter redirecting Encored self-target moves (#8300) 2021-05-23 22:55:21 -07:00
Marty-D
008cfec4c3 Run events on future moves even while the user is not active
Fixes a regression in 16d078265b
2021-05-20 13:20:12 -04:00
Leonard Craft III
606576f453
Add various mechanics tests (#8313)
* Standardize Photon Geyser tests
* Add Gulp Missile tests
* Add Berserk Dragon Darts test
* Add Ring Target tests
* Add and improve Metronome tests
* Add Sparkling Aria tests
* Add additional Fling tests
* Standardize Mummy tests
* Add Rollout submove targeting test
* Improve Flower Veil tests
* Add Acupressure tests
* Improve Sky Drop tests
* Add Future Sight tests
* Improve Wandering Spirit tests
* Improve Rapid Spin tests
* Add Rocky Helmet victory test
* Improve Focus Punch tests
* Add a skipped Stomping Tantrum test
2021-05-20 08:43:08 -04:00
Leonard Craft III
d946308900
Fix the order of many end-turn resolution effects (#8307)
Co-authored-by: Marty-D <Marty-D@users.noreply.github.com>
2021-05-17 11:53:52 -04:00
Leonard Craft III
50054ef5ae
Fix Struggle to be unaffected by Disable (#8315) 2021-05-17 07:18:26 -07:00
Leonard Craft III
5a129fd1d7
Gen VII: Ignore user's Ability with Mold Breaker moves (#8306) 2021-05-15 14:38:21 -04:00
Leonard Craft III
aa5ca391c5 Tests: Add Life Orb, Protean Future Sight tests 2021-05-08 19:59:05 -05:00
Annika
1c3f6402f0
Tests: Use assert.equal and assert.notEqual more (#8276) 2021-05-07 23:51:18 -07:00
pacmanboss256
bb2d700883
Fix smart targeting with scripted moves (#8248) 2021-05-03 11:20:19 -04:00
pacmanboss256
c1996a3949
Fix Me First's interaction with recharge moves (#8258) 2021-05-01 20:53:13 -07:00
Guangcong Luo
7d235af30f Fix speed ties after mega evolution 2021-04-29 00:23:55 -07:00
Leonard Craft III
d49a40feb2 Tests: Improve G-Max Volcalith Sea of Fire test 2021-04-26 22:52:59 -05:00
Guangcong Luo
f9fdc73133
Support per-pokemon Residual handlers in Side/Field conditions (#8222)
For side conditions, `onStart`/`onRestart`/`onResidual`/`onEnd`
have been renamed `onSideStart`/`onSideRestart`/`onSideResidual`/`onSideEnd`,
with the `onResidualOrder` properties renamed `onSideResidualOrder`.

For field conditions, `onStart`/`onRestart`/`onResidual`/`onEnd`
have been renamed `onFieldStart`/`onFieldRestart`/`onFieldResidual`/`onFieldEnd`,
with the `onResidualOrder` properties renamed `onFieldResidualOrder`.

(The `onField` and `onSide` part helps make it clear to the type system
that the first argument is a Field or Side, not a Pokemon.)

Side and field conditions can now use `onResidual` to tick separately
on each pokemon in Speed order. `onResidualOrder` (the per-pokemon
tick) can be timed separate from `onSideResidualOrder` (the
per-condition tick), allowing conditions to end at a different priority
than they tick per-pokemon.

Relatedly, `onTeamPreview` and `onStart` in formats now need to be
`onFieldTeamPreview` and `onFieldStart`.

Unrelatedly, `effectData` has been renamed `effectState`, and the
corresponding state containers (`pokemon.statusData`,
`pokemon.speciesData`, `pokemon.itemData`, `pokemon.abilityData`,
`field.weatherData`, `field.terrainData`) have been similarly renamed. I
renamed the types a while ago, but I was holding off renaming the fields
because it would be a breaking change. But this is a breaking change
anyway, so we might as well do it now.

Note: `onResidual` will tick even on `onSideEnd` turns, although
`onSideResidual` won't. When refactoring weather, remember to
check `this.state.duration` so you don't deal weather damage on the
ending turn.

Intended as a better fix for #8216
2021-04-25 10:55:54 -07:00
urkerab
9a18ada1f9
Grassy Terrain should only weaken moves against grounded targets (#8224) 2021-04-24 18:04:31 -05:00
Leonard Craft III
7c89412d9a Remove accidental .only 2021-04-24 16:24:45 -05:00
Leonard Craft III
ab0cb0d29e Improve Grassy Terrain tests 2021-04-24 16:24:01 -05:00
Leonard Craft III
4818c50374
Fix Transform source Ability leak (#8204) 2021-04-17 15:06:40 -07:00
Guangcong Luo
5c3d0f5eae Fix deterministic speed ties
We have apparently been sorting everything by switch-in order this
entire time, not just move redirection. This appears to be a mistake
in #5216

The actual bug fix is just the single line in `comparePriority`,
everything else is just documentation, and a bit of optimization of
how speed ties are resolved.

Fixes #6319
2021-04-10 09:41:22 -07:00
Guangcong Luo
13189fdb02
Update Dex API (#8181)
This is the change that renames:

- `Dex.getMove` -> `Dex.moves.get`
- `Dex.getAbility` -> `Dex.abilities.get`
- `Dex.getItem` -> `Dex.items.get`
- `Dex.getSpecies` -> `Dex.species.get`
- `Dex.getEffect` -> `Dex.conditions.get`
- `Dex.getNature` -> `Dex.natures.get`
- `Dex.getType` -> `Dex.types.get`
- `Dex.getFormat` -> `Dex.formats.get`

In addition, some other APIs have been updated:

- `getByID` methods have also been added to every other table.
- `Dex.moves.all()` now gets an array of all moves
  - Plus equivalent methods for `abilities`, `items`, `species`, `formats`, `natures`, `types`
  - Note: there's no `Dex.conditions.all()`
- new API: `Dex.stats` for naming/iterating stats
- `Dex.getEffectByID` -> `Dex.conditions.getByID`
- `Dex.getType` -> `Dex.types.get`
- `Dex.data.Formats` -> `Dex.data.Rulesets`
- `Dex.formats` -> now an array `Dex.formats.all()`
- `Dex.getRuleTable` -> `Dex.formats.getRuleTable`
- `Dex.validateFormat` -> `Dex.formats.validate`

Team functions have been split off into a new `sim/teams` package:

- `Dex.packTeam` -> `Teams.pack`
- `Dex.fastUnpackTeam` -> `Teams.unpack`
- `Dex.generateTeam` -> `Teams.generate`
- `Dex.stringifyTeam` -> `Teams.export`

`Teams.export` has also been rewritten to better match how it works in client.

This implements #8178
2021-04-08 03:00:37 -07:00
Leonard Craft III
54ebad4d2f Improve Thousand Arrows tests 2021-04-05 22:49:32 -05:00
Guangcong Luo
77d231eee5 Fix Disguise vs Steelsurge 2021-04-03 18:30:19 -07:00
Leonard Craft III
897a798db6 Expand G-Max Steelsurge test 2021-04-03 19:02:50 -05:00
pyuk-bot
817addfd62
Fix Follow Me, etc. in FFA (#8173) 2021-04-03 15:16:27 -07:00
HoeenHero
47d8bd4d82
Fix hazards not applying if the target side is fainted (#8171)
Co-authored-by: pyuk-bot <msaimrkon@gmail.com>
2021-04-03 15:15:13 -07:00
pyuk-bot
956daf89b6
FFA: Properly set hazards against all foes' sides (#8165) 2021-04-02 23:15:19 -07:00