Commit Graph

65 Commits

Author SHA1 Message Date
André Bastos Dias
f4889cac74
Implement Zacian and Zamazenta transformations as species conditions (#11748)
Some checks are pending
Node.js CI / build (18.x) (push) Waiting to run
* Implement Zacian and Zamazenta transformations as species conditions

* Remove custom transformation from gen8linked
2026-02-17 18:34:52 -07:00
André Bastos Dias
e27ae66ec6
Fix Burn Up thawing user when user does not have Fire type (#11304) 2025-07-28 18:56:51 -04:00
Kris Johnson
d97b176082 Revert "Simplify the implementation of locked moves (#11256)"
Some checks are pending
Node.js CI / build (18.x) (push) Waiting to run
This reverts commit 4d634394f5.
2025-07-22 03:38:29 -06:00
André Bastos Dias
4d634394f5
Simplify the implementation of locked moves (#11256) 2025-07-22 02:14:13 -07:00
André Bastos Dias
fd21559ba8
Refactor Gen 1 partial trapping (#11189) 2025-07-22 02:12:20 -07:00
André Bastos Dias
324966b811
CAP: Prevent Polar Flare from thawing targets (#11273) 2025-07-15 21:39:19 -04:00
André Bastos Dias
8158284427
Refactor fainted forme regression (#10878)
Some checks are pending
Node.js CI / build (18.x) (push) Waiting to run
2025-05-16 07:40:49 -07:00
Guangcong Luo
78439b4a02
Update to ESLint 9 (#10926)
ESLint has a whole new config format, so I figure it's a good time to
make the config system saner.

- First, we no longer have separate eslint-no-types configs. Lint
  performance shouldn't be enough of a problem to justify the
  relevant maintenance complexity.

- Second, our base config should work out-of-the-box now. `npx eslint`
  will work as expected, without any CLI flags. You should still use
  `npm run lint` which adds the `--cached` flag for performance.

- Third, whatever updates I did fixed style linting, which apparently
  has been bugged for quite some time, considering all the obvious
  mixed-tabs-and-spaces issues I found in the upgrade.

Also here are some changes to our style rules. In particular:

- Curly brackets (for objects etc) now have spaces inside them. Sorry
  for the huge change. ESLint doesn't support our old style, and most
  projects use Prettier style, so we might as well match them in this way.
  See https://github.com/eslint-stylistic/eslint-stylistic/issues/415

- String + number concatenation is no longer allowed. We now
  consistently use template strings for this.
2025-02-25 20:03:46 -08:00
Guangcong Luo
deda1db857
Snowscape was incorrectly named Snow (#10920)
Some checks are pending
Node.js CI / build (16.x) (push) Waiting to run
2025-02-19 21:34:55 -08:00
pyuk-bot
7bb2fd1869
Overhaul 'SwitchIn' event for more accurate effect resolution order (#10766) 2025-01-28 16:51:17 -06:00
André Bastos Dias
ce76114c12
Implement fainted forme regression (#10810) 2025-01-25 14:06:40 -06:00
Karthik Bandagonda
d59e57bc5d
Fix Future Sight slot targeting in doubles (#10760) 2024-12-16 22:08:03 -06:00
Leonard Craft III
a8cdef75c2
Implement turn counter overflow with Wish / Future moves (#10700)
* Implement turn overflow with Wish / Future moves

* Improve hints
2024-12-01 09:08:00 -07:00
Guangcong Luo
88be8d7b3c
Refactor types for Lowercase<string> (#10377)
TypeScript 4.8+ supports Lowercase for lowercase strings, which isn't
exactly what ID is, but can be used to type IDs in object keys and data
entries that previously required string. I'm calling it IDEntry in places
where it should be an ID but TypeScript doesn't support that.

Very conveniently, no additional casts will be needed when using ID
where IDEntry is expected.

It's caught at least a few bugs, which is also why I'm PRing: I didn't
write the code for the bugs it found, and don't know if it's the right
way to fix them.

This ballooned into several other type refactors.
2024-07-01 15:57:14 -07:00
Leonard Craft III
5d8be885c6 Fix paralysis Speed modifier timing 2024-03-14 21:40:07 -05:00
Karthik
8cbbf0e2b2
Fix Perish Song and Commander interaction (#10153) 2024-02-02 20:09:02 -07:00
Karthik
8344a1da71
Fix Commander invulnerability check (#10137) 2024-01-30 14:33:12 -06:00
Karthik
06d88748a5
Refactor STAB (again) (#10099) 2024-01-13 23:48:47 -06:00
Kris Johnson
a0f10ffa51
Add DLC2 data (#9963)
* DLC2 returning Pokemon

* Returning legendaries too

* Partially add Raging Bolt and Iron Crown (#10)

* Add remaining Pre-DLC2 event data

* Fix tests

* Last event before DLC + split learnset files

* Learnsets + secret returning pokemon

* Some DLC 2 stuff (#12)

* Add New Mons

* Add Electro Shot

* Give Dipplin Dex Evo

* Update data/moves.ts

---------

Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>

* More tweaks

* formats

* Revealed moves (#11)

* Add Hard Press

* Add Psychic Noise

* Add Upper Hand

* Apply suggestions from code review

---------

Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>

* more things

* Fix typo

* a lot of other things

* MOVES! kinda

* b

* fickle beam confirmed chance

* Evo Item Undexit + Metal Alloy + Move Fixes (#19)

* Update move data

* Update Item Data

* Apply suggestions from code review

---------

Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>

* Add message for Fickle Beam BP double (#18)

* Add some tests and implement Tera Shell (#15)

* add some tests and draft of tera shell

* add text

* .

* add improvements from feedback, change behavior of terashell

* use AfterMove instead of AfterMoveSecondary

* add confirmation to multi-hit interaction

* improve based on feedback and general cleanup

* Apply suggestions from code review

---------

Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>

* Add Tera Shift and Teraform Zero (#16)

* Add Tera Shift and Teraform Zero

* Add short descriptions

* fixes

* More move changes

* Update unSketchable moves

List from Anubis

* more move things

* oops

* Implement new Neutralizing Gas/Paradox ability interaction (#17)

* Implement new Neutralizing Gas/Paradox ability interaction

* add test

* revert in dlc

* ok

* Update pastgens for Sketch (#20)

* Implement Stellar type (#13)

* Implement Stellar type

* stuff from research

* pain

* add tests for Dragon Cheer (#22)

Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>

* Update move flags (#23)

* Fix flags for new moves

* update old moves

* remove sparkling aria changes

* update metronome description

* update other move descriptions

* more formatz stuff

* Add Poison Puppeteer (#24)

* Add Poison Puppeteer

* i'm bad

* still bad

* Fix build

* oops

* Update data/moves.ts

Co-authored-by: Marty-D <Marty-D@users.noreply.github.com>

* Update data/moves.ts

Co-authored-by: Marty-D <Marty-D@users.noreply.github.com>

* Update data/items.ts

Co-authored-by: Marty-D <Marty-D@users.noreply.github.com>

* Update data/moves.ts

Co-authored-by: Marty-D <Marty-D@users.noreply.github.com>

* Fix Terapagos dex entries (#25)

* Update data/pokedex.ts

Co-authored-by: Marty-D <Marty-D@users.noreply.github.com>

* Update data/pokedex.ts

Co-authored-by: Marty-D <Marty-D@users.noreply.github.com>

* Update data/pokedex.ts

Co-authored-by: Marty-D <Marty-D@users.noreply.github.com>

* FIX BUILD

* Fix Regulation E formats (#26)

* Fix Regulation E formats

* add move bans

* nevermind

* Add Regulation F formats (#27)

* Fix interaction between Adaptability and Tera Stellar (#28)

* reg f bo3 ladder

* Update config/formats.ts

Co-authored-by: Leonard Craft III <leonardcraft64@gmail.com>

---------

Co-authored-by: Smudge <smudgerox@users.noreply.github.com>
Co-authored-by: Leonard Craft III <leonardcraft64@gmail.com>
Co-authored-by: Karthik <32044378+Karthik99999@users.noreply.github.com>
Co-authored-by: tofa <79044321+im-tofa@users.noreply.github.com>
Co-authored-by: Marty-D <Marty-D@users.noreply.github.com>
2023-12-15 21:35:01 -07:00
Leonard Craft III
077d3e5f00
Add Commander activation text (#9473) 2023-03-23 15:41:56 -04:00
Karthik
94afe6da0d
Apply Hydro Steam boost in Sunny Day damage modifier (#9438) 2023-03-01 23:10:53 -05:00
pyuk-bot
07c2a22695
Update Hydro Stream/Utility Umbrella interaction (#9430) 2023-03-01 14:19:21 -05:00
Kris Johnson
5a24d69867
Add new Pokemon (#9420) 2023-02-27 16:53:57 -05:00
Mr. Sableye
250eea9670
Change Delta Stream's effectiveness activation to use -fieldactivate instead of -activate (#9277) 2023-01-02 21:29:56 -06:00
Marty-D
efaeef8c58
Implement Axe Kick's confusion duration 2022-12-17 19:48:59 -05:00
Karthik
e93bf2cb81
Prevent Dondozo from being phazed out when commanded (#9077) 2022-11-27 12:22:32 -06:00
Karthik
a262555017
Fix types sent when a Terastallized Pokemon switches in (#9059) 2022-11-25 17:13:20 -05:00
Kris Johnson
27fc61b58a
Add names to Commander volatiles 2022-11-18 20:40:21 -07:00
pyuk-bot
19a0ace57b
Fix typos in comments about Dondozo (#9002) 2022-11-18 08:35:18 -05:00
Kris Johnson
d50c8c249b
Add Gen 9 (#8997) 2022-11-17 20:46:29 -05:00
cooshaug
cc90bd224e
Add Rollout storage glitch (#8988) 2022-11-16 21:40:35 -06:00
pyuk-bot
83265782a5
Fix called Fly/Bounce + Ally Switch interaction (#8910) 2022-09-21 22:46:30 -05:00
Karthik
f588d4d846
Implement Dynamax levels (#8308) 2022-07-20 20:45:45 -07:00
Karthik
e4f510faaf
Fix Nightmare not getting removed after certain curing effects (#8791) 2022-07-14 16:01:06 -05:00
Karthik
70acfb1d0e
End Dynamax before start of 4th turn (#8719) 2022-04-18 12:15:31 -04:00
Karthik
97b2aace07
Stop sending -formechange for Gmax (#8685) 2022-03-26 21:26:43 -05:00
urkerab
3e3f7f95ce
Fix some ability interactions with OMs (#8695) 2022-03-20 14:04:12 -04:00
pyuk-bot
517e642fec
Fix interaction of Future attacks and Unaware (#8547) 2021-11-30 18:55:42 -06:00
Leonard Craft III
7cf60606c5
Fix paralysis modifier application (#8478) 2021-11-06 15:52:39 -04:00
Leonard Craft III
25910ed66d
Fix timing of freeze thaws (#8453) 2021-09-29 20:29:26 -04:00
Adam Tran
be2210f881
Fix Future Sight Life Orb interactions (#8357) 2021-06-08 11:48:10 -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
Marty-D
b0509ce39f Check for a winner after future moves 2021-05-15 10:31:30 -04:00
pyuk-bot
b17171a2cb
Store originally targeted slot for two-turn moves (#8280) 2021-05-12 08:51:58 -04:00
Leonard Craft III
771c60d4b9
Improve self-hit confusion damage (#8264) 2021-05-04 13:44:13 -04:00
Kris Johnson
7b81706c9e Dynamax: Remove Doubles OU hardcode 2021-04-28 14:04:31 -06: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
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
Guangcong Luo
3b5e8cbfc2
Refactor for multi battles (#8152) 2021-03-31 20:27:07 -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