From 507dcb8da2c4bc2db8bfdec0d5c5cad981d45bdb Mon Sep 17 00:00:00 2001 From: Hisuian Zoroark <96159984+HisuianZoroark@users.noreply.github.com> Date: Sat, 11 Mar 2023 18:34:04 -0500 Subject: [PATCH] Convergence: Allow custom validation (#9453) Adds some compatibility with NatDex and CAP formats --- data/rulesets.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/data/rulesets.ts b/data/rulesets.ts index 45a85e3690..a84b52d4b1 100644 --- a/data/rulesets.ts +++ b/data/rulesets.ts @@ -2400,7 +2400,8 @@ export const Rulesets: {[k: string]: FormatData} = { const obtainableAbilityPool = new Set(); const matchingSpecies = this.dex.species.all() .filter(species => ( - !species.isNonstandard && species.types.every(type => curSpecies.types.includes(type)) && + (!species.isNonstandard || this.ruleTable.has(`+pokemontag:${this.toID(species.isNonstandard)}`)) && + species.types.every(type => curSpecies.types.includes(type)) && species.types.length === curSpecies.types.length && !this.ruleTable.isBannedSpecies(species) )); for (const species of matchingSpecies) { @@ -2416,7 +2417,8 @@ export const Rulesets: {[k: string]: FormatData} = { checkCanLearn(move, species, setSources, set) { const matchingSpecies = this.dex.species.all() .filter(s => ( - !s.isNonstandard && s.types.every(type => species.types.includes(type)) && + (!s.isNonstandard || this.ruleTable.has(`+pokemontag:${this.toID(s.isNonstandard)}`)) && + s.types.every(type => species.types.includes(type)) && s.types.length === species.types.length && !this.ruleTable.isBannedSpecies(s) )); const someCanLearn = matchingSpecies.some(s => this.checkCanLearn(move, s, setSources, set) === null);