From 35be5515f9fb1d97b4ac0263c3c9e43dc9f5722d Mon Sep 17 00:00:00 2001 From: Kris Johnson <11083252+KrisXV@users.noreply.github.com> Date: Mon, 2 Jun 2025 20:25:49 -0600 Subject: [PATCH] Remove banned Pokemon from DPP PU teambuilder --- build-tools/build-indexes | 10 ++++++++++ play.pokemonshowdown.com/src/battle-dex-search.ts | 6 ++++++ 2 files changed, 16 insertions(+) diff --git a/build-tools/build-indexes b/build-tools/build-indexes index 08077af94..bf90a27ff 100755 --- a/build-tools/build-indexes +++ b/build-tools/build-indexes @@ -302,6 +302,7 @@ process.stdout.write("Building `data/teambuilder-tables.js`... "); const monotypeBans = {}; const nonstandardMoves = []; const gen5zuBans = {}; + const gen4puBans = {}; for (const id of pokemon) { const species = Dex.mod(gen).species.get(id); const baseSpecies = Dex.mod(gen).species.get(species.baseSpecies); @@ -448,6 +449,12 @@ process.stdout.write("Building `data/teambuilder-tables.js`... "); monotypeBans[species.id] = 1; } } + if (genNum === 4) { + const gen4pu = Dex.formats.get(gen + 'pu'); + if (gen4pu.exists && Dex.formats.getRuleTable(gen4pu).isBannedSpecies(species)) { + gen4puBans[species.id] = 1; + } + } } nonstandardMoves.push(...Object.keys(Dex.data.Moves).filter(id => { @@ -540,6 +547,9 @@ process.stdout.write("Building `data/teambuilder-tables.js`... "); if (genNum === 5) { BattleTeambuilderTable[gen].gen5zuBans = gen5zuBans; } + if (genNum === 4) { + BattleTeambuilderTable[gen].gen4puBans = gen4puBans; + } BattleTeambuilderTable[gen].overrideTier = overrideTier; BattleTeambuilderTable[gen].tiers = tiers; BattleTeambuilderTable[gen].items = items; diff --git a/play.pokemonshowdown.com/src/battle-dex-search.ts b/play.pokemonshowdown.com/src/battle-dex-search.ts index 693aa5c68..f2c335ff0 100644 --- a/play.pokemonshowdown.com/src/battle-dex-search.ts +++ b/play.pokemonshowdown.com/src/battle-dex-search.ts @@ -1150,6 +1150,12 @@ class BattlePokemonSearch extends BattleTypedSearch<'pokemon'> { return true; }); } + if (format === 'pu' && dex.gen === 4 && table.gen4puBans) { + tierSet = tierSet.filter(([type, id]) => { + if (id in table.gen4puBans) return false; + return true; + }); + } // Filter out Gmax Pokemon from standard tier selection if (!(/^(battlestadium|vgc|doublesubers)/g.test(format) || (format === 'doubles' && this.formatType === 'natdex'))) {