Commit Graph

50 Commits

Author SHA1 Message Date
Instruct
e7695c4b78
Gen 3: Add Deoxys Forme Clause and Deoxys Camouflage Mod (#8024) 2021-02-15 01:37:58 -08: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
Marty-D
826dd94eae Validator: Fix Ability attribution from Virtual Console 2020-11-13 11:28:10 -05:00
Marty-D
b098b54187 Validator: Fix Ability attribution from Dream World 2020-11-12 18:13:58 -05:00
The Immortal
fff0f6c806 Release Gigantamax Melmetal
Also added necessary validation for it as its event is a special case.
2020-11-12 05:41:24 +04:00
Guangcong Luo
8543fc291a Fix Gen 2 evo/tradeback validation 2020-11-09 04:12:59 +00:00
Guangcong Luo
5f8c36c616 Ban Gen 1 Japan-only event moves
Fixes #7516
2020-10-26 15:30:47 +00:00
The Immortal
381c8190c6 Fix Dragon Ascent Rayquaza validation 2020-10-24 04:58:05 +04:00
Leonard Craft III
4e6ff7e72c
Validator: Allow Hidden Ability Entei/Raikou/Suicune in Gen 8 natively (#7563) 2020-10-23 15:28:12 +04:00
Leonard Craft
993a5cc645 Unskip passing validator test 2020-10-20 21:36:28 -05:00
Leonard Craft III
1081a4423f
Add various mechanics tests (#7506) 2020-10-16 21:07:05 -07:00
Leonard Craft III
2ed8a97ff8
Add skipped failing event validator tests (#7472) 2020-10-06 16:06:05 -07:00
Kris Johnson
00b88b521d
Handle Gigantamaxing properly (#7001) 2020-07-23 13:27:42 -07:00
Guangcong Luo
4628575b17 Add regression test for Aerial Ace Kubfu in LC 2020-07-23 12:48:08 -07:00
The Immortal
e2d268747c Remove Gmax restrictions
Closes #6954
2020-07-18 21:04:09 +04:00
The Immortal
df8b99d244 Fix Kyurem learnset validation 2020-05-28 00:41:31 +04:00
Leonard Craft III
576e0c7d0f
Add forme-exclusive move validator tests (#6709) 2020-05-16 18:27:50 -07:00
Kris Johnson
56fbb0201a
Pikachu-Gmax is now available from raids (#6679)
* Pikachu-Gmax is now available from raids

* Volt Tackle is legal on Gmax Pikachu now
2020-05-12 06:14:57 +04:00
Kris Johnson
9f5d1bc681
Fix Dynamax Clause validation (#6674) 2020-05-10 14:42:53 -07:00
Kirk Scheibelhut
30defec706
Validate that SpA and SpD EVs match in Gen 2 (#6615)
Pointed out by FOMG in https://www.smogon.com/forums/threads/gen-2-ps-development-post-bugs-here.3524926/post-8439815
2020-04-25 13:01:02 -07:00
Guangcong Luo
f6f4467265 Turn on prefer-const for .js files
Not having prefer-const on the JS side makes JS -> TS refactors really
unreadable. This commit just auto-fixes it so we're using
`prefer-const` everywhere.
2020-04-23 11:37:47 -07:00
Leonard Craft III
2a07102281
Add G-Max move validator illegality test (#6580) 2020-04-15 21:27:16 -07:00
Guangcong Luo
900ad5a8c8
Prioritize -All Pokemon above +Past etc (#6574)
Previously, format bans/unbans were processed in order of "most specific
to least specific".

So `+Giratina-Origin` trumps `-Giratina` trumps `+Uber` trumps
`-All Pokemon`.

And nonstandard reasons (`Unobtainable`, `Past`, `CAP`, etc) were
slotted between `Uber` and `All Pokemon`.

This has the unfortunate effect that if a base ruleset allows a certain
normally-banned category of Pokémon, you can't use `-All Pokemon` to
whitelist a list of Pokémon.

Moving nonstandard reasons to lowest precedence once again allows
`-All Pokemon` to be used as intended.
2020-04-14 15:27:59 -07:00
Guangcong Luo
091f764681 Fix rule inheritance 2020-04-08 13:25:11 -07:00
Guangcong Luo
75bff1cbb7 Fix validation for event-only VC Pokémon
Previously, we had a weird carved-out exception for Celebi from
74143b652d

But it actually applies to all VC Pokémon (most importantly Suicune).
2020-03-30 07:09:12 -07:00
Guangcong Luo
60effa1838 Fix DW move validation 2020-03-30 02:29:13 -07:00
Marty-D
7a09037213 Validator: Fix Gen 2 event move tradebacks 2020-03-26 13:54:14 -04:00
Guangcong Luo
2534753325 Fix Hidden Ability validation 2020-03-24 23:55:54 -07:00
Guangcong Luo
8d140b4bca Fix Gmax validation
(Gmax Pokémon can't be from older gens.)
2020-03-06 10:41:33 -08:00
Guangcong Luo
229f5f809d Use assert in strict mode
This makes it so we can use `assert.equal` instead of
`assert.strictEqual`, which I think is more readable.
2020-02-20 00:39:31 -08:00
Guangcong Luo
267c815d7d Allow piecemeal repeal of inherited rules
Specifically, removing a subrule now correctly removes subsubrules.
2020-01-01 11:10:48 +09:00
Guangcong Luo
744f7732e8 Fix rulesets
- Remove "Standard Ubers"

- Rename "Standard ND" -> "Standard NatDex"
2019-12-30 12:23:51 +09:00
Guangcong Luo
a6dd6d7779 Add test for Ultra Necrozma validation 2019-12-25 16:10:16 +09:00
Guangcong Luo
b31b88a79b Add documentation for custom rules 2019-12-25 11:26:23 +09:00
Guangcong Luo
15cfd06795 Support whitelisting in custom rules
Custom rules can now use whitelists instead of blacklists.
Whitelist rules look like:

`- all moves, + Metronome`

(Metronome Battle does not use this ruleset currently, because its
scripted check displays a better error message than a whitelist rule,
which can't actually display the whitelist as of the current
implementation.)
2019-12-25 10:05:49 +09:00
Guangcong Luo
7a90fa7622 Fix DW and baby-only move compatibility checking
PS already tracks which evolution level an egg move or event pokemon
learns a move from, but apparently this was not tracked for DW moves.

This fixes a compatibility interaction between DW Marill and Azurill
moves.
2019-11-11 04:41:51 +13:00
Guangcong Luo
2ebe46bac5 Fix crash in tradeback validation 2019-11-09 05:50:52 +10:30
Guangcong Luo
52df674a7f Properly fix Nidoqueen egg move crash
It turns out Nidorina can't breed, either.
2019-10-23 14:08:19 +10:30
Guangcong Luo
78e4d3945b Fix Nidoqueen egg move validation 2019-10-23 13:58:50 +10:30
Guangcong Luo
77f7cb9fb0 Correctly validate Ash-Greninja 2019-10-18 14:37:23 +10:30
Guangcong Luo
6a32df9a81 Fix egg validation error in Gen 3 Weezing
This happened because the father checker was simplistic enough
that it didn't think to check Duskull for Pain Split, since
Dusclops learns it in future gens.
2019-10-16 12:34:00 +10:30
Guangcong Luo
92c0011b93 Fix HP Fighting Mega Latias validation 2019-10-15 21:00:40 +10:30
Guangcong Luo
d6752954ef Further improve validator
- Tyranitar egg moves are fixed

- Staravia egg moves are now properly supported
  (9742ecf62f was a hack that caused the Tyranitar problem)

- Some Pokemon evolve by having a move in their learnset (like Piloswine
  with Ancient Power). These can only carry three other moves from their
  prevo, because the fourth move must be the evo move. This restriction
  doesn't apply to gen 6+ eggs, which can get around the restriction with
  the relearner.

Fixes #2287

(Except Shiftry and friends, but those are already tracked in
`rulesets:obtainablemoves`.)
2019-10-10 06:33:33 +11: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
bb9bfb8fcd Make validator bans/unbans apply in order
(Fixes an issue with RU's unban of Drought overriding NU's ban of
Drought.)
2019-10-06 17:54:28 +11:00
Guangcong Luo
c1ecbc6522 Fix misc validator bugs
- Repealing rules now always works, regardless of rule order
  (Fixes AAA validation)
- Fix a check for egg move hidden ability validation
  (Fixes a Gen 4 Dragon Dance Charizard set)
- Always ban AG when banning Uber
  (Fixes allowing Rayquaza-Mega in lower tiers)
- Fix ability validation in Let's Go
- Fix valid-move-combo dexsearch
2019-10-06 17:21:01 +11:00
Guangcong Luo
555bd9cdb8 Fix mega evolution ability validation 2019-10-06 07:34:51 +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
Kirk Scheibelhut
df083d7528 Remove Object.assign(function) pattern from TeamValidator{Async} 2019-07-01 08:20:51 -07:00
Slayer95
ffb3678b0f Test: Update folder structure to match source code (#5436) 2019-04-14 23:57:06 +09:30