Commit Graph

262 Commits

Author SHA1 Message Date
The Immortal
c23a0c5d5b Obtainable Moves: Remove unnecessary ban 2019-12-10 19:17:05 +04:00
Kris Johnson
89002124b3 Change inheritsLearnsetFrom to inheritsFrom and fix Necrozma-Ultra's inheritance (#6168) 2019-12-10 08:03:49 +04:00
The Immortal
7dfc381e9b Leaf Blade + Sucker Punch Shiftry is legal 2019-12-09 05:16:46 +04:00
The Immortal
f1530288e5 Move Keldeo-R validation to Obtainable rule
Keldeo-R is not a battle forme and is possible to hack without Secret Sword, unlike most other formes. It should be restricted by the rule that prevents hacks and not the rule that validates battle formes. This is mostly relevant for Hackmons.
2019-12-05 22:36:20 +04:00
The Immortal
6724ce500a Move Kyurem/Necrozma forme legality to Obtainable
Obtaintable Formes is for in-battle forme changes. Obtainable makes sure a team is possible to obtain in-game without hacking. Multiple Kyurem/Necrozma formes are the latter case.
2019-12-05 18:00:01 +04:00
The Immortal
4266000df4 Update forme validation
- In gen 8, Silvally is able to enter battles in different types if it doesn't have RKS System (i.e. it doesn't require a Memory).
- In gen 8, formes that transform in battle are no longer able to start in that forme (relevant to BH).
2019-12-05 07:29:15 +04:00
The Immortal
1ee6a3933d STABmons: Use `isMax` in validator 2019-12-05 03:13:09 +04:00
The Immortal
d9c49a2861 Team Preview: Hide items in gen 8 2019-12-02 07:02:19 +04:00
The Immortal
4b5c65ac98 STABmons: Prevent Max moves 2019-12-02 04:14:12 +04:00
YaBoiJD
546065a10d Update National Dex Mechanics (#6108)
Pokemon that are holding an Item that enables Mega Evolution, Primal Revision, or the use of a Z-Move cannot Dynamax. A Rayquaza that can Mega Evolve also cannot Dynamax.

Also fixes an alias loop with the national dex format/ruleset.
2019-11-30 14:50:09 -05:00
Spandan Punwatkar
97e910a093 National Dex: Ban Unobtainables (#6105) 2019-11-29 23:34:10 +13:00
TheMezStrikes
b0dcf0d597 Fix NFE clause in battles (#6109) 2019-11-29 11:51:21 +04:00
The Immortal
224465f6f7 Remove Moody Clause from Standard ruleset 2019-11-28 02:52:39 +04:00
The Immortal
e020334a78 Fix NFE Clause 2019-11-27 02:51:01 +04:00
HoeenHero
44a7fa0946 Make Dynamax checks more dynamic
Specifically we now check the battle.canDynamax method when
notifying a player about their pokemon's eligibility to dynamax.

This enforces the fact that pokemon that are transformed into
dynamax ineligible pokemon cannot dynamax themselves.

As a result of this change the pokemon.canDynamax flag is unnessecary
and has been refactored to a side.canDynamax flag. All pokemon specific
dynamax checks should use the battle.canDynamax method.
2019-11-26 13:05:38 -05:00
HoeenHero
8792d7345f Most past gen items should still be illegal (#6066) 2019-11-25 22:00:12 +13:00
The Immortal
d9f3a24462 STABmons: Fix Galar Pokemon 2019-11-25 07:19:59 +04:00
The Immortal
7cccda3b18 Update Other Metagames 2019-11-25 06:53:08 +04:00
The Immortal
eff4d957e7 NatDex: Add ruleset & sort OU banlist 2019-11-25 03:06:31 +04:00
The Immortal
492f5ac7d5 Remove Moody Clause from Doubles ruleset 2019-11-22 22:38:57 +04:00
The Immortal
f46923173a Update OM clauses 2019-11-21 23:54:57 +04:00
The Immortal
97689e931a Add Dynamax Clause 2019-11-20 03:20:00 +04:00
The Immortal
a7f5ba92ca Update formats for gen 8 2019-11-19 08:05:42 +04:00
TheMezStrikes
0c7f04356d Generalize NFE bans into validator rule (#5942) 2019-11-11 17:42:30 +13:00
The Immortal
615f16c94d STABmons: Prevent unreleased moves 2019-11-03 05:36:53 +04:00
Guangcong Luo
2adc80efe4
Improve egg validator (#5854)
Previously, we split gen 2-5 egg move validation into two phases,
`checkLearnset` where we searched for a valid father, and
`reconcileLearnset` where we made sure the father could learn the move
combination.

Egg move validation has now been completely moved out of these
functions and into `validateSource`, which calls `findEggMoveFathers`.

The new algorithm no longer requires `C` moves to be hardcoded into
`learnsets.js`, now doing a more thorough check validation for the
father's move combination. This should be slower than before, but
net performance should be massively improved due to two other
optimizations in this refactor:

- We no longer do any father-searching if the moveset can be obtained
  any other way - in particular, this means no more father validation
  in gen 6+ where all egg move combinations are legal anyway.

- We only check fully-evolved pokemon as fathers (because anything a
  prevo can learn, its evos can learn, too - yes, we remember to make
  exceptions for Salazzle, Combee, and future-gen evos)

In addition, `/learn` should now provide significantly better
information for egg move breeding, since it uses a more thorough check
instead of the validator's short-circuiting the moment it finds a valid
father.

This also improves some baby-only move validation, specifically fixing
the issue with Seismic Toss Charm Chansey.
2019-10-09 00:59:24 +11:00
Guangcong Luo
7a023746ba
Refactor battle.dex out of battle (#5851)
In most other similar systems, like TeamValidator, we use `thing.dex` instead of having it extend `ModdedDex`. Battle has always extended `ModdedDex`, though. This changes Battle to match the others.

This should fix an issue with `Battle.data` not being cached.

This also frees up Battle to extend ObjectReadWriteStream<string> in a future update.
2019-10-06 07:38:08 +11:00
Guangcong Luo
3cd04c349e Fix missed conversions of validate -> obtainable 2019-10-06 04:32:23 +11:00
Guangcong Luo
71498d451d
New validator (#5840)
* Refactor validator

This is a major refactor intended to make the default rules easier to
understand, and also easier for OMs to bypass.

Removed rules:
- `Pokemon`: This is now `-Nonexistent`. Its previous name was intended
  to be interpreted as "simulate the Pokémon games exactly, and only
  allow what they allow". The new name should make it clearer that it
  mainly bans CAPs and other nonexistent Pokémon and functionality.
- `-Illegal`: This is now `Obtainable` (see below).
- `Allow CAP`: This is now `+CAP`. Instead of having a hardcoded rule,
  OMs can now be manually whitelist any pokemon/item/etc or group of
  them, overriding `-Nonexistent`.
- `Ignore Illegal Abilities`: This is now `!Obtainable Abilities` (see
  below).

`Obtainable` was previously `-Illegal`, and does the same thing: Makes
sure you have a regular Pokémon game with only Pokémon that can be
obtained without hacking.

But instead of being a ban, it's now a rule that does nothing by
itself, except contain more rules:
- `Obtainable Moves`
- `Obtainable Abilities`
- `Obtainable Formes`
- `Obtainable Misc`
- `-Nonexistent`
- `-Unreleased`

This allows OMs to piecemeal repeal and unban any of these individual
rules, instead of the previous approach of unbanning them all and
manually reimplementing every single validation you wanted to keep.

* Refactor PokemonSources into a class

This mostly just makes a lot of the weirder checks in the validator
substantially more readable.

This also renames `lsetData` to `setSources`, which should also help
readability.

* Validate Bottle Cap HP types

Fixes an issue reported here:

https://github.com/Zarel/Pokemon-Showdown/issues/5742#issuecomment-533850288

* Fix several move validation issues

Fixes #5742

We have a new MoveSource type: R for Restricted. R moves work like
level-up/tutor/TM moves, except you're limited to one R move.

- Shedinja move stolen from Ninjask in Gen 3-4 are now R moves instead
  of event moves. This allows them to coexist with Nincada egg moves.

- Necrozma-DW/DM now inherit moves/events from Necrozma (like Rotom,
  but with event validation). This allows them to be shiny.

- Pokemon can now get egg moves from their own evolutions. This fixes
  some Tyrogue, Charmander, and Treecko sets mentioned in #5742

- Some more C moves were added, fixing some Hitmontop and Chatot sets
  mentioned in #5742

* Improve ability/move compatibility validator
2019-10-06 04:21:30 +11:00
Marty-D
196983430f Gen 3 OU: Add 3 Baton Pass Clause and ban Baton Pass Smeargle
https://www.smogon.com/forums/posts/8212796/
2019-08-16 21:39:06 -04:00
Guangcong Luo
0cbb632521
Fix Blitz rule description 2019-08-07 10:54:52 -07:00
maxalexandderpi
e42cfac93e Update Blitz's description from 10s to 15s (#5681) 2019-08-07 09:22:21 +02:00
Kirk Scheibelhut
875b02c816 Make Blitz/VGC Timer 'Rule' instead of 'ValidatorRule' 2019-07-17 12:14:35 -07:00
Guangcong Luo
0cc534092a Support timer rules 2019-07-16 16:03:02 -05:00
Kirk Scheibelhut
9fb516a2a4 Update reference to EBC spec 2019-05-13 16:25:49 -07:00
Kirk Scheibelhut
3d24166cdf toId -> toID
Closes #5479
2019-05-12 17:53:01 -07:00
Kirk Scheibelhut
a0734bde6f Redo Endless Battle Clause with a new specification (#5472) 2019-05-07 11:18:06 +09:30
Kirk Scheibelhut
10c744f733 Introduce an ID type to sim (#5468) 2019-05-04 13:13:12 +12:00
Marty-D
78cae4c5f3
STABmons: Allow a normally illegal Shiftry move combo 2019-04-26 11:02:06 -04:00
Ivo Julca
ac4b94876b Sim: Refactor to use Battle#getAllPokemon() and Battle#getAllActive() 2019-03-26 23:18:19 -05:00
Kirk Scheibelhut
03b2c92cb1 Make isNonstandard specify reason for non-standardness (#5330) 2019-03-22 01:49:22 +09:00
Marty-D
b94b5038b5 Rulesets: Make Little Cup work for any gen 2019-03-20 08:25:57 -04:00
MacChaeger
cfb1cf1731 Add a notice to the Inverse Mod (#5249) 2019-03-05 03:35:58 -06:00
MacChaeger
d764c52887 Don't add inactive rules as pseudoweathers (#5206) 2019-02-25 01:11:46 -06:00
Guangcong Luo
b498bb222c Require object literal method shorthand 2019-02-11 18:14:09 -06:00
TheMezStrikes
763794a18a 2v2 Doubles: Update banlist (#5116) 2019-01-24 16:28:10 +04:00
Marty-D
4b0c3679de
Copy Chansey's illegal move combos to Blissey 2019-01-08 08:32:29 -05:00
Kris Johnson
5b2d76d75d Add Pokemon Let's Go! (#4967) 2018-11-19 16:19:19 -06:00
Quinton Lee
94016f6218 Update Typescript to 3.1 (#4879) 2018-10-05 04:02:54 -05:00
The Immortal
5df0a02fcb Revert "Implement Illusion Level Mod"
This reverts commit 60075830b6.
2018-09-24 15:54:33 +04:00