mirror of
https://github.com/smogon/pokemon-showdown.git
synced 2026-04-25 15:40:31 -05:00
Support CAP and NatDex Inheritance (#10111)
* Support CAP and NatDex Inheritance * Update formats.ts --------- Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>
This commit is contained in:
parent
e1cbc2718d
commit
377bcdd3ea
|
|
@ -963,11 +963,10 @@ export const Formats: FormatList = [
|
|||
return species.id;
|
||||
},
|
||||
validateSet(set, teamHas) {
|
||||
const unreleased = (pokemon: Species) => pokemon.tier === "Unreleased" && pokemon.isNonstandard === "Unobtainable";
|
||||
if (!teamHas.abilityMap) {
|
||||
teamHas.abilityMap = Object.create(null);
|
||||
for (const pokemon of Dex.species.all()) {
|
||||
if (pokemon.isNonstandard || (unreleased(pokemon) && !this.ruleTable.has('+unobtainable'))) continue;
|
||||
if (pokemon.isNonstandard && !this.ruleTable.has(`+pokemontag:${this.toID(pokemon.isNonstandard)}`)) continue;
|
||||
if (pokemon.battleOnly) continue;
|
||||
if (this.ruleTable.isBannedSpecies(pokemon)) continue;
|
||||
|
||||
|
|
@ -987,7 +986,7 @@ export const Formats: FormatList = [
|
|||
|
||||
const species = this.dex.species.get(set.species);
|
||||
if (!species.exists || species.num < 1) return [`The Pok\u00e9mon "${set.species}" does not exist.`];
|
||||
if (species.isNonstandard || (unreleased(species) && !this.ruleTable.has('+unobtainable'))) {
|
||||
if (species.isNonstandard && !this.ruleTable.has(`+pokemontag:${this.toID(species.isNonstandard)}`)) {
|
||||
return [`${species.name} is not obtainable in Generation ${this.dex.gen}.`];
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user