Commit Graph

90 Commits

Author SHA1 Message Date
Kris Johnson
c3ad27289d Fix legality in STABmons and Alphabet Cup 2021-08-03 19:18:13 -06:00
Kris Johnson
cf7df087e6 Add August 2021 OMotM and RoA Spotlight 2021-07-31 22:46:25 -06:00
Karthik
b83e5088c2
Implement new STABmons policy (#8415)
* Implement new STABmons policy

* Use const

* Use push instead of concat

* Run generation loop for all the code

* Small changes

* Update data/rulesets.ts

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

* fix lint issues

Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>
2021-07-31 21:13:37 -06:00
Kris Johnson
598ac409e8 Rename Let's Go! mod to 'gen7letsgo' 2021-07-06 23:07:51 -06:00
Kris Johnson
9e217d34c2 Add July 2021 OMotM, LCotM, and RoA Spotlight 2021-07-01 10:47:55 -06:00
Kris Johnson
876c86d236 Change type declaration formatting for Maps/Sets 2021-06-29 22:47:28 -06:00
WeWuzNidokangz
0d96865c69
Fix crashes in Chimera 1v1 rule interactions (#8356) 2021-06-06 08:31:19 -07:00
Kris Johnson
790993c5d2 Add June 2021 OMotM, LCotM, and RoA Spotlight 2021-06-01 02:16:11 -06:00
Guangcong Luo
9c98ae5c87 Rules: Split "EV Limit" out from "Obtainable Misc"
"EV Limit = 510" is now its own rule which can be changed separately
from the rest of Obtainable Misc.

The rest of Obtainable Misc doesn't seem useful to break up, so I
haven't bothered.
2021-05-23 15:14:00 -07:00
Kris Johnson
77b7120b06
Update to Sw/Sh 1.3.2 mechanics (#8296) 2021-05-12 14:14:58 -04:00
Guangcong Luo
7e965b41a7 Revert timing for adding rules to field in #8274
It turns out rules need to be added before sides are initialized,
so that they can hook `ModifySpecies` during side initialization.

The proper way to fix this is pretty complex so this is just a hack.
2021-05-11 23:02:01 -07:00
Mia
f4c6e8f690 Formats: Fix undefined toID call 2021-05-11 08:23:40 -05:00
Guangcong Luo
638c1e3ae8 Add "Max Move Count" value rule
Also stop enforcing 4 moves limit and 6 pokemon limit in `-Nonstandard`,
for the same reason we stopped enforcing the level 100 limit; any format
that explicitly wants it higher should automatically override it.
2021-05-07 02:16:24 -07:00
Guangcong Luo
0adb8d1b00 Add Unova Dex rules 2021-05-07 00:37:22 -07:00
Karthik
367b4e7c2d
Implement Zacian/Zamazenta/Xerneas forme leak (#8261) 2021-05-06 19:24:59 -07:00
Guangcong Luo
36295dc27a
Simplify Team Preview events (#8274)
In format events:

`onFieldTeamPreview` has been renamed back to `onTeamPreview`. It's now
a custom event (like `onBegin`), rather than a field event.

Team Preview data has been entirely moved from `onBegin` into
`onTeamPreview`.

`onFieldStart` for formats/rules now happens after Team Preview, rather
than before. Use `onBegin` for things that happen before Team Preview.
2021-05-06 18:53:58 -07:00
Mia
34d6480837 Re-add Cancel Mod to Flat Rules 2021-05-06 09:28:56 -05:00
Guangcong Luo
55980d416c
Support value rules (#8267)
`teamLength`, `maxLevel`, `cupLevelLimit`, and `minSourceGen` no longer
exist as properties of `Format`. Instead, they're value rules that
become properties of `RuleTable`, and can be specified as custom rules
and inherited through rulesets like anything else.

See the PR for a full reckoning of changes:

https://github.com/smogon/pokemon-showdown/pull/8267
2021-05-06 01:16:16 -07:00
Distrib
cc2fb4a596
Add No Switch rule (#8241) 2021-05-03 16:09:09 -07:00
Marty-D
5b0391e91b
Fix build 2021-04-30 10:57:53 -04:00
Kris Johnson
5b8dfc7d8e [Gen 1] Japanese OU: Allow Japanese event moves 2021-04-30 01:55:06 -06:00
Kris Johnson
246b667c03 Add [Gen 1] Japanese OU 2021-04-27 20:48:48 -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
Kris Johnson
5cd1d060ab Rulesets: Add Nintendo Cup 2000 Move Legality 2021-04-24 01:11:45 -06:00
InAShellnut
9ab4c86fe3
Add Stadium 2, Nintendo Cup 1997, and Nintendo Cup 2000 (#8195)
An implementation of Nintendo Cup 1997, Nintendo Cup 2000, and Pokemon Stadium 2, for Pokemon Showdown. The only thing which has not been implemented was showing the exact health of both Pokemon in Pokemon Stadium 2, however implementing that requires changes to the showdown client. The Nintendo Cup 1997 code was done by Enigami, and the rest was by myself (Shellnuts).

This should fulfill the requirements asked by the following accepted suggestions:
https://www.smogon.com/forums/threads/please-add-a-pok%C3%A9mon-stadium-2-simulator-in-showdown.3679486/
https://www.smogon.com/forums/threads/add-nintendo-cup-1997-and-2000-as-challenge-only-formats.3653454/
2021-04-22 00:54:14 -07:00
Leonard Craft III
d858bbda30
Validator: Disallow duplicate moves (#8191) 2021-04-09 20:59:20 -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
Marty-D
6c07717703 Remove Spikemuth Cup 2021-04-05 13:25:47 -04:00
Spandan Punwatkar
b77d6cb20f
Add simulator support for multi battle (#7929)
This doesn't include matchmaking support (which had to be removed
for reworking), but it includes everything else.

Co-authored-by: Spandamn <spandan.punwatkar@gmail.com>
Co-authored-by: MacChaeger <msaimrkon@gmail.com>
Co-authored-by: Guangcong Luo <guangcongluo@gmail.com>
2021-03-31 22:22:25 -07:00
Guangcong Luo
3b5e8cbfc2
Refactor for multi battles (#8152) 2021-03-31 20:27:07 -07:00
urkerab
82b8b90038
Make Scalemons apply before Tier Shift when they are mashed up (#8051) 2021-03-23 23:17:08 -06:00
Kris Johnson
3f5ef2e510 Add more Retro OMs 2021-03-19 19:58:18 -06:00
LegoFigure11
3447c90744
Add Spikemuth Cup (#8094) 2021-03-13 10:35:19 -05:00
pyuk-bot
4e98f9db49
Actually show types at team preview in Gen 1 HC (#8084) 2021-03-03 21:13:03 -08:00
Kris Johnson
780a57b549 Add new clones to 2 Ability Clause 2021-02-18 19:04:41 -07:00
Instruct
e7695c4b78
Gen 3: Add Deoxys Forme Clause and Deoxys Camouflage Mod (#8024) 2021-02-15 01:37:58 -08:00
Leonard Craft III
e98ade77a6
Formats: Update VGC/BSS to Series 8 (#7940) 2021-01-26 16:55:22 +04:00
The Immortal
31e725757c Minimal GBU: Use restricted list for legends 2021-01-24 22:49:58 +04:00
Guangcong Luo
6b3a3070c9 Refactor team validator for readability
`checkLearnset` has been renamed `checkCanLearn`.

`reconcileLearnset` has been replaced with `validateMoves`, which
bundles the actual `checkCanLearn` calls with the old
`reconcileLearnset`, making for a better name.
2021-01-03 23:26:20 -08:00
Leonard Craft III
9b1e44bf30
Formats: Move legendary validation to Minimal GBU (#7774) 2020-12-08 09:57:05 +04:00
Kris Johnson
2b510d050d Alphabet Cup: Add prevolution support 2020-11-28 03:22:04 -07:00
May Evans
9b8e34bc48
Gen 1: Announce Desync Clause Mod, fix Stadium Sleep Clause (#7702) 2020-11-16 23:52:39 -08:00
The Immortal
48221525b5 Remove Dynamax Ubers Clause 2020-11-16 18:14:34 +04:00
Marty-D
c5b3f10f38
Same Type Clause: Fix Mega check 2020-11-12 16:12:21 -05:00
Kris Johnson
e1c96f8a74
Add Alphabet Cup Move Legality (#7628) 2020-11-03 02:42:34 +04:00
Kris Johnson
a641cfcce8
Fix Overflow Stat Clause and turn it into a mod (#7604) 2020-10-30 10:59:38 +04:00
The Immortal
4be8cc8355 Add Overflow Stat Clause 2020-10-27 00:35:51 +04:00
Kris Johnson
c3ea57f8cc
Fix typo 2020-10-25 18:15:01 -06:00
LegoFigure11
eea703eef9
Fix Crown Tundra Pokedex validation (#7573) 2020-10-25 15:59:10 +04:00
Kris Johnson
3e15896a0d Restrict Calyrex-Ice and Calyrex-Shadow correctly 2020-10-24 20:25:32 -06:00