Commit Graph

161 Commits

Author SHA1 Message Date
Marty-D
00fd9ec54a
Fix Splintered Stormshards/Steel Roller interaction with substitutes 2021-07-12 18:06:34 -04:00
Karthik
094623f18b
Sky Drop: Fix message when target is fainted (#8334) 2021-05-26 14:51:52 -07:00
pacmanboss256
647ebd5fc6
Fix Counter redirecting Encored self-target moves (#8300) 2021-05-23 22:55:21 -07: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
4f7f943282 Fix more regressions from residual factor 2021-05-14 23:10:52 -05:00
Karthik
126430168c
Support separate Shell Side Arm physical/special anims (#8301) 2021-05-13 20:22:00 -07:00
Kris Johnson
77b7120b06
Update to Sw/Sh 1.3.2 mechanics (#8296) 2021-05-12 14:14:58 -04:00
pyuk-bot
37df679e73
FFA: Update Court Change mechanics (#8259) 2021-05-03 11:23:03 -04:00
pacmanboss256
c1996a3949
Fix Me First's interaction with recharge moves (#8258) 2021-05-01 20:53:13 -07:00
Leonard Craft III
615ee48e25
Fix Shell Side Arm information leak (#8233) 2021-04-25 20:21:50 -07:00
Marty-D
3d9698953a
Fix other regressions from residual refactor 2021-04-25 18:32:04 -04:00
pyuk-bot
fa974427ef
Migrate terrains from onTerrain to onResidual (#8232) 2021-04-25 13:00:37 -07:00
Guangcong Luo
f513c619b0 Fix bugs from Residual refactor 2021-04-25 12:14:03 -07: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
pyuk-bot
3639079d1f
Protective Pads should not apply to Gulp Missile (#8207)
Co-authored-by: Leonard Craft III <leonardcraft64@gmail.com>
2021-04-19 12:39:33 -04:00
Karthik
1d9b713951
Add fail text for Corrosive Gas (#8209) 2021-04-17 20:19:01 -05:00
Leonard Craft III
3c7b7b96f4
Add Plasma Fists hint (#8206) 2021-04-17 15:04:17 -07:00
Marty-D
94840470c3 Make sure Bide actually ends 2021-04-12 10:52:46 -04:00
Guangcong Luo
5233559183 Refactor Dex types 2021-04-08 07:08:56 -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
pyuk-bot
636ebdd7f8
FFA: Apply GMax side conditions to all foes' sides (#8184)
Co-authored-by: Guangcong Luo <guangcongluo@gmail.com>
2021-04-06 20:55:43 -07:00
Guangcong Luo
3b5e8cbfc2
Refactor for multi battles (#8152) 2021-03-31 20:27:07 -07:00
Guangcong Luo
d18c0a4e1f Refactor more things to use pokemon.allies/foes
(This will make multi battles easier to implement.)
2021-03-28 20:06:18 -07:00
Guangcong Luo
ed454ef76a
Refactor scripts to battle-actions (#8138)
This introduces a new class, BattleActions, available as `battle.actions`,
moving all functions from `data/scripts.ts` to `sim/battle-actions.ts`.

This makes it so that "go to definition" will now work correctly for
functions previously in scripts; we no longer need UnimplementedError,
and there's now a clean conceptual separation between `battle` and
`battle-actions` (whereas the previous distinction between `battle` and
`scripts` was basically nonexistent).

This will be a difficult migration if you maintain a fork with custom
scripted mods. I'm sorry! Migration instructions are here:

https://github.com/smogon/pokemon-showdown/pull/8138
2021-03-28 12:01:38 -07:00
urkerab
d395d18591
End Uproar if the user is under the effect of Throat Chop (#8135)
SadisticMystic confirmed that the user of Uproar simply calms down at the end of the current turn.
2021-03-23 17:42:41 -04:00
Marty-D
b26b8f6da7 Fix G-Max One Blow / Rapid Flow interaction with protection 2021-03-20 18:04:55 -04:00
Marty-D
a620ee53d8
Fix Heat Crash and Heavy Slam 2021-03-07 17:24:48 -05:00
Annika
c2e97aaaed
Use optional chaining in more places (#8063) 2021-02-22 11:42:05 -08:00
Marty-D
dfb4f2cd90 Implement buggy Trick/Switcheroo behaviour with Kyogre/Groudon
Thanks Zaggyo!
To be reverted assuming it's patched someday.
2021-02-17 13:53:01 -05:00
urkerab
16fe1cbc27
Focus Punch can't be Flinched (#8031) 2021-02-15 01:34:47 -08:00
Leonard Craft III
220cac3aa7
Convert modifiers from hex to decimal (#8003) 2021-02-10 17:02:18 -05:00
Marty-D
a1baeddd19 Fix build 2021-01-30 15:14:09 -05:00
Marty-D
b214a7b05d Fix Serene Grace interaction with rainbow effect
Thanks SadisticMystic!
2021-01-30 15:01:07 -05:00
urkerab
d35ddfaf7b
Fix Brick Break against bypassed type immunity (#7916) 2021-01-18 12:13:17 -05:00
Dawnofares
e7f7260927
Show OHKO message if OHKO move breaks substitute (#7171) 2021-01-12 12:16:17 -05:00
Marty-D
b7d8802dd6 Correct move data
Fixes #7886
2021-01-08 13:52:48 -05:00
The Immortal
0c898aa209 Max Guard blocks Shadow Force 2021-01-08 15:54:17 +04:00
Adam Tran
2c65de1a16
Fix various Future Sight / Doom Desire issues (#7884) 2021-01-07 19:20:30 -05:00
urkerab
2c0bd53966
Grassy Terrain should heal before Leftovers (#7882) 2021-01-07 19:17:48 -05:00
urkerab
5123b6cc63 Revelation Dance should use Arceus's real type 2021-01-05 16:59:08 +00:00
urkerab
80d652d59b Sturdy should trigger before Focus Sash but after False Swipe 2021-01-05 16:58:03 +00:00
urkerab
845b4386c4 Pressure should not deduct additional PP from Sticky Web 2021-01-05 13:14:56 +00:00
urkerab
6ba98478a6 Cursed Body should be able to disable Z-moves 2021-01-05 13:06:40 +00:00
The Immortal
fa2698a3a0 Fix PP reduction moves 2021-01-04 16:27:09 +04:00
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
urkerab
fa78e2a31c
Make Unnerve activate after Skill Swap and Neutralizing Gas wearing off (#7866) 2021-01-02 14:39:54 -05:00
Marty-D
03d0c26c09
Fix Pursuit mechanics against switches 2020-12-31 15:22:11 -05:00
Adam Tran
d6e05d0a98
Fix Metal Burst interaction with called moves (#7835) 2020-12-30 14:36:06 -05:00