pokemon-showdown/data/mods/gen5/rulesets.ts
Ivo Julca 29f778f233 Stricter typing for formats and rules
- Legacy effect type ``Ruleset`` removed
- New type ``RuleValueType`` for ``rule.hasValue``
- New interface ``RuleTableBuildContext`` for ``onValidateRule`` handlers
- New interface: ``RuleEventMethods`` extending ``EventMethods``
- ``data/rulesets.ts``: Different tag-discriminated types for
  ``effectType='Rule'`` vs ``effectType='ValidatorRule'``:
  ``RuleData`` vs ``ValidatorRuleData``.
- ``data/rulesets.ts``: Renamed ``FormatDataTable`` to ``RulesetTable``
- Distinguishes types for formats in ``config/formats.ts`` vs in ``Dex.data.Rulesets``:
  ``FormatData`` vs ``LoadedFormatData``.
- Union type for formats OR rulesets in ``Dex.data.Rulesets``: ``RulesetData``
- Implements ``DexFormats#find|some``, for searches excluding rules.
- Remove obsolete comment regarding former lack of support for format.onResidual
2026-04-16 12:02:45 -05:00

33 lines
1.1 KiB
TypeScript

export const Rulesets: import('../../../sim/dex-formats').ModdedRulesetTable = {
standard: {
inherit: true,
ruleset: [
'Standard AG',
'Species Clause', 'Nickname Clause', 'OHKO Clause', 'Evasion Items Clause', 'Evasion Moves Clause',
],
},
obtainablemoves: {
inherit: true,
banlist: [
// Shell Smash: Clamperl Gen 5+ level-up
// Sucker Punch: Huntail Gen 4 tutor
'Huntail + Shell Smash + Sucker Punch',
],
},
teampreview: {
inherit: true,
onTeamPreview() {
this.add('clearpoke');
for (const pokemon of this.getAllPokemon()) {
const details = pokemon.details.replace(', shiny', '')
.replace(/(Arceus|Genesect|Gourgeist|Pumpkaboo|Xerneas|Silvally|Urshifu|Dudunsparce)(-[a-zA-Z?-]+)?/g, '$1-*')
.replace(/(Zacian|Zamazenta)(?!-Crowned)/g, '$1-*') // Hacked-in Crowned formes will be revealed
.replace(/(Greninja)(?!-Ash)/g, '$1-*'); // Hacked-in Greninja-Ash will be revealed
const item = pokemon.item.includes('mail') ? 'mail' : pokemon.item ? 'item' : '';
this.add('poke', pokemon.side.id, details, item);
}
this.makeRequest('teampreview');
},
},
};