Commit Graph

108 Commits

Author SHA1 Message Date
Karthik
4291ccb51b
Fix interaction between Future attacks and Protean (#8718) 2022-04-08 18:31:00 -05:00
urkerab
3e3f7f95ce
Fix some ability interactions with OMs (#8695) 2022-03-20 14:04:12 -04:00
Leonard Craft III
26ef4d3746
Fix interaction of Transformed Neutralizing Gas (#8576) 2021-12-20 07:54:41 -06:00
Leonard Craft III
380417856e Fix interaction of Dynamax Cannon and Parental Bond
Thanks Anubis!
2021-12-17 21:30:58 -06:00
tofa
21182025ce
Fix Ice Face's interaction with Neutralizing Gas (#8479) 2021-09-23 20:50:03 -05:00
pacmanboss256
23b35498f6
Rename the "mystery" and "authentic" move flags (#8445)
* mystery -> allyanim
* authentic -> bypasssub
2021-08-30 23:07:50 -07:00
pacmanboss256
f63ee3d3b7
Fix Water Shuriken interaction with Pokemon transformed into Ash-Greninja (#8444) 2021-08-23 21:43:57 -05:00
Marty-D
cd89eacfff
Fix Dry Skin behaviour when taking damage from allies 2021-07-31 09:58:51 -04:00
Guangcong Luo
b9affef2a4 Fix comment for Imposter 2021-07-03 15:19:54 -05: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
ddd5d6ac15 Improve logic for multiple Neutralizing Gas check 2021-05-15 11:52:46 -05:00
Leonard Craft III
a2513173f3
Fix Neutralizing Gas ending if another is active (#8305) 2021-05-15 08:44:33 -07:00
pacmanboss256
4186ef5f4f
Refactor Mold Breaker effect (#8291) 2021-05-14 08:32:41 -04:00
Karthik
b6d5fff24b
Unfix interaction between Gluttony and Neutralizing Gas ending (#8273)
Reverts #8250, but will keep gluttony test file and add more tests to it. This is being done because indirect sources of damages are not causing gluttony to trigger (such as belly drum).
2021-05-05 13:44:59 -04:00
Marty-D
916c80b23d
Fix Mold Breaker interaction with Aura Break and Dark/Fairy Aura 2021-05-03 12:34:06 -04:00
Karthik
f453d37817
Fix interaction between Gluttony and Neutralizing Gas ending (#8250) 2021-05-03 11:25:47 -04:00
pacmanboss256
bb2d700883
Fix smart targeting with scripted moves (#8248) 2021-05-03 11:20:19 -04:00
Marty-D
a40f3388b6
Stop Ripen from reducing damage forever 2021-05-03 11:17:37 -04: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
pyuk-bot
66c547432b
Fix Parental Bond to modify damage, not base power (#8226) 2021-04-25 12:06:27 -04: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
adb164ad51
Fix Magician activation timing (#8202)
Use onAfterMoveSecondarySelf so Weakness Policy happens first
Fixes #8104
2021-04-17 12:26:29 -04:00
ACakeWearingAHat
5493420d9c
Random Battles Improvements (#8192) 2021-04-10 17:46:41 -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
Karthik
3b1d3844dd
Negate Unburden while Neutralizing Gas is active (#8182) 2021-04-06 12:13:05 -04:00
Guangcong Luo
77d231eee5 Fix Disguise vs Steelsurge 2021-04-03 18:30:19 -07:00
urkerab
d4e6fb227c
Fix Aromatherapy failing if the right slot has a Substitute (#8151) 2021-04-02 17:35:04 -04:00
Karthik
19ae4f693f
Check for Berserk before eating Berries (#8147) 2021-04-02 17:30:34 -04:00
Guangcong Luo
3b5e8cbfc2
Refactor for multi battles (#8152) 2021-03-31 20:27:07 -07:00
Karthik
258269348c
Allow Berries to be used between Unnerve switching to Unnerve (#8145) 2021-03-31 10:07:36 -04: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
Leonard Craft III
b707a4ad97 Correct Shed Skin odds 2021-03-27 22:44:28 -05:00
Annika
c2e97aaaed
Use optional chaining in more places (#8063) 2021-02-22 11:42:05 -08:00
pyuk-bot
747db93931
Fix Gulp Missile against inactive Pokemon (#8053) 2021-02-18 17:51:18 -05:00
Leonard Craft III
220cac3aa7
Convert modifiers from hex to decimal (#8003) 2021-02-10 17:02:18 -05:00
Kris Johnson
f101bb7575
Fix Aerilate and Parental Bond's index numbers (#7998) 2021-02-06 16:37:18 +04:00
The Immortal
9d68fc283a Fix Gulp Missile interaction with selfdestruct moves 2021-02-01 00:12:38 +04:00
urkerab
f0d3c85148
Fix Soundproof blocking self sound moves in Gen 8 (#7917) 2021-01-15 20:05:32 -06:00
urkerab
7bf3c9afd1
Cursed Body ignores Max Moves (#7891) 2021-01-08 16:21:00 -08:00
Marty-D
5c6cc7d256
Merge pull request #7879 from urkerab/various-mechanics-fixes
Various mechanics fixes
2021-01-06 15:20:55 -05:00
Leonard Craft III
6003cb0835
Fix Intimidate failure text (#7880) 2021-01-06 14:05:12 +04:00
Leonard Craft III
ddbed0dc81
Add Neutralizing Gas switchout message (#7484) 2021-01-06 14:04:06 +04:00
urkerab
80d652d59b Sturdy should trigger before Focus Sash but after False Swipe 2021-01-05 16:58:03 +00:00
The Immortal
d8a90a94f9 Protective Pads should negate Perish Body
Thanks @DaWoblefet!
2021-01-03 16:35:55 +04:00
urkerab
fa78e2a31c
Make Unnerve activate after Skill Swap and Neutralizing Gas wearing off (#7866) 2021-01-02 14:39:54 -05:00
Adam Tran
0f724acb03
Fix Neutralizing Gas ending issues (#7860) 2021-01-01 18:39:19 -05:00
urkerab
74ae95a91c
Update accuracy calculation for latest Gen 7 research (#7806) 2020-12-15 18:37:24 -05:00
Marty-D
b95adb3ae4
Fix Frisk and Neutralizing Gas interaction
Thanks, Zelda!
2020-12-07 16:53:41 -05:00