From 60d6eed899a673ec25f2a4bc7ee3395e9bd17e7c Mon Sep 17 00:00:00 2001 From: Kris Johnson <11083252+KrisXV@users.noreply.github.com> Date: Mon, 1 Jun 2026 15:55:31 -0600 Subject: [PATCH] Update teambuilder for champions and remove Legends Z-A --- build-tools/build-indexes | 70 ++----------------- .../src/battle-dex-search.ts | 32 +++------ play.pokemonshowdown.com/src/battle-dex.ts | 3 - play.pokemonshowdown.com/src/battle.ts | 3 - .../src/oldclient/client-teambuilder.js | 9 --- 5 files changed, 16 insertions(+), 101 deletions(-) diff --git a/build-tools/build-indexes b/build-tools/build-indexes index 7594cbe66..a4d692508 100755 --- a/build-tools/build-indexes +++ b/build-tools/build-indexes @@ -279,7 +279,6 @@ process.stdout.write("Building `data/teambuilder-tables.js`... "); const isSSDLC1 = (genIdent === 8.4 || genIdent === -8.4); const isPreDLC = (genIdent === 9.4 || genIdent === 9.41 || genIdent === -9.4); const isSVDLC1 = (genIdent === 9.401 || genIdent === 9.411 || genIdent === -9.401); - const isLegendsZA = genIdent === 9.33; const isNatDex = ('' + genIdent).endsWith('.1') && genIdent > 8; const isStadium = ('' + genIdent).endsWith('.04'); const isDoubles = (genIdent < 0); @@ -298,7 +297,6 @@ process.stdout.write("Building `data/teambuilder-tables.js`... "); if (isBDSP) genStr += 'bdsp'; if (isPreDLC) genStr += 'predlc'; if (isSVDLC1) genStr += 'dlc1'; - if (isLegendsZA) genStr += 'legendsou'; if (isStadium) genStr += 'stadium' + (genNum > 1 ? genNum : ''); if (isSSB) genStr += 'ssb'; if (isBW1) genStr += 'bw1'; @@ -328,7 +326,7 @@ process.stdout.write("Building `data/teambuilder-tables.js`... "); tier = 'OU'; } } - if (species.isNonstandard === 'Gigantamax') tier = '(Uber)'; + if (species.isNonstandard === 'Gigantamax') tier = 'Uber'; if (species.tier === 'CAP LC') tier = 'LC'; if (species.tier === 'CAP NFE') tier = 'NFE'; if (species.tier === 'CAP') tier = 'OU'; @@ -433,7 +431,7 @@ process.stdout.write("Building `data/teambuilder-tables.js`... "); tierTable[speciesTier].push(id); if (genNum >= 5) { - for (const meta of (isVGC && genNum === 9 ? ['4v4doublesuu'] : [ + for (const meta of (isChampions ? ['4v4doublesuu'] : [ '1v1', '2v2doubles', 'lcuu', 'freeforall', 'ubersuu', 'almostanyability', 'balancedhackmons', 'godlygift', 'mixandmega', 'sharedpower', 'stabmons', '12switch', '350cup', 'alphabetcup', 'badnboosted', 'battlefields', 'biomechmons', 'camomons', 'categoryswap', 'categoryswap', 'convergence', 'crossevolution', 'categoryswap', 'ferventimpersonation', 'foresighters', 'formemons', 'fortemons', 'franticfusions', @@ -443,7 +441,7 @@ process.stdout.write("Building `data/teambuilder-tables.js`... "); 'aaa', 'bh', 'doubles', // natdex abbreviations 'tiershift', 'linked', 'pokebilitiesaaa', ])) { - const format = Dex.formats.get(`${gen}${isNatDex ? 'nationaldex' : ''}${meta}`); + const format = Dex.formats.get(`${gen}${isNatDex ? 'nationaldex' : isChampions ? 'champions' : ''}${meta}`); if (!format.exists) continue; const ruleTable = Dex.formats.getRuleTable(format); let banned = ruleTable.isBannedSpecies(species); @@ -535,6 +533,7 @@ process.stdout.write("Building `data/teambuilder-tables.js`... "); BattleTeambuilderTable['champions'].learnsets = {}; BattleTeambuilderTable['champions'].tiers = tiers; BattleTeambuilderTable['champions'].items = items; + BattleTeambuilderTable['champions'].metagameBans = metagameBans; BattleTeambuilderTable['champions'].overrideTier = overrideTier; BattleTeambuilderTable['champions'].formatSlices = formatSlices; } else if (isVGC) { @@ -560,13 +559,6 @@ process.stdout.write("Building `data/teambuilder-tables.js`... "); BattleTeambuilderTable['gen9ssb'].tiers = tiers; BattleTeambuilderTable['gen9ssb'].overrideTier = overrideTier; BattleTeambuilderTable['gen9ssb'].formatSlices = formatSlices; - } else if (isLegendsZA) { - BattleTeambuilderTable['gen9legendsou'] = {}; - BattleTeambuilderTable['gen9legendsou'].tiers = tiers; - BattleTeambuilderTable['gen9legendsou'].overrideTier = overrideTier; - BattleTeambuilderTable['gen9legendsou'].formatSlices = formatSlices; - BattleTeambuilderTable['gen9legendsou'].items = items; - BattleTeambuilderTable['gen9legendsou'].learnsets = {}; } else if (gen === 'gen9') { BattleTeambuilderTable.tiers = tiers; BattleTeambuilderTable.items = items; @@ -607,7 +599,7 @@ process.stdout.write("Building `data/teambuilder-tables.js`... "); return ["DUber", "(DUber)", "DOU", "DBL", "(DOU)", "DUU", "(DUU)", "New", "NFE", "LC"]; } return [ - "CAP", "CAP NFE", "CAP LC", "AG", "Uber", "(Uber)", "OU", "(OU)", "UUBL", "UU", "RUBL", "RU", "NUBL", "NU", "PUBL", "PU", "ZUBL", "ZU", "New", "NFE", "LC", "Unreleased", + "CAP", "CAP NFE", "CAP LC", "AG", "(AG)", "Uber", "OU", "(OU)", "UUBL", "UU", "RUBL", "RU", "NUBL", "NU", "PUBL", "PU", "ZUBL", "ZU", "New", "NFE", "LC", "Unreleased", ]; })(); @@ -621,9 +613,7 @@ process.stdout.write("Building `data/teambuilder-tables.js`... "); formatSlices[usedTier] = tiers.length; } if (!tierTable[tier]) continue; - if (tier === "(PU)") { - tiers.push(['header', "Below PU"]); - } else if (tier === "(DUU)") { + if (tier === "(DUU)") { tiers.push(['header', "Below DUU"]); } else if (tier.charAt(0) === '(') { tiers.push(['header', tier.slice(1, -1) + " by technicality"]); @@ -1181,52 +1171,6 @@ process.stdout.write("Building `data/teambuilder-tables.js`... "); } } } - const LegendsZALearnsets = Dex.mod('gen9legendsou').data.Learnsets; - for (const id in LegendsZALearnsets) { - const learnset = LegendsZALearnsets[id].learnset; - if (!learnset) continue; - BattleTeambuilderTable['gen9legendsou'].learnsets[id] = {}; - for (const moveid in learnset) { - const gens = learnset[moveid].map(x => Number(x[0])); - const minGen = Math.min(...gens); - - if (minGen <= 4 && (gen3HMs.has(moveid) || gen4HMs.has(moveid))) { - let legalGens = ''; - let available = false; - - if (minGen === 3) { - legalGens += '3'; - available = true; - } - if (available) available = !gen3HMs.has(moveid); - - if (available || gens.includes(4)) { - legalGens += '4'; - available = true; - } - if (available) available = !gen4HMs.has(moveid); - - const minUpperGen = available ? 5 : Math.min( - ...gens.filter(gen => gen > 4) - ); - legalGens += '0123456789'.slice(minUpperGen); - BattleTeambuilderTable['gen9legendsou'].learnsets[id][moveid] = legalGens; - } else { - BattleTeambuilderTable['gen9legendsou'].learnsets[id][moveid] = '0123456789'.slice(minGen); - } - - if (gens.indexOf(6) >= 0) BattleTeambuilderTable['gen9legendsou'].learnsets[id][moveid] += 'p'; - if (gens.indexOf(7) >= 0 && learnset[moveid].some(x => x[0] === '7' && x !== '7V')) { - BattleTeambuilderTable['gen9legendsou'].learnsets[id][moveid] += 'q'; - } - if (gens.indexOf(8) >= 0 && learnset[moveid].some(x => x[0] === '8' && x !== '8V')) { - BattleTeambuilderTable['gen9legendsou'].learnsets[id][moveid] += 'g'; - } - if (gens.indexOf(9) >= 0 && learnset[moveid].some(x => x[0] === '9' && x !== '9V')) { - BattleTeambuilderTable['gen9legendsou'].learnsets[id][moveid] += 'a'; - } - } - } // Client relevant data that should be overridden by past gens and mods const overrideSpeciesKeys = [ @@ -1326,7 +1270,7 @@ process.stdout.write("Building `data/teambuilder-tables.js`... "); // for (const mod of [ - 'gen3rs', 'gen3frlg', 'gen5bw1', 'gen7letsgo', 'gen8bdsp', 'gen9ssb', 'gen9legendsou', 'champions', + 'gen3rs', 'gen3frlg', 'gen5bw1', 'gen7letsgo', 'gen8bdsp', 'gen9ssb', 'champions', ]) { const modDex = Dex.mod(mod); const modData = modDex.data; diff --git a/play.pokemonshowdown.com/src/battle-dex-search.ts b/play.pokemonshowdown.com/src/battle-dex-search.ts index 0b05f0d05..18202f9a9 100644 --- a/play.pokemonshowdown.com/src/battle-dex-search.ts +++ b/play.pokemonshowdown.com/src/battle-dex-search.ts @@ -582,7 +582,7 @@ abstract class BattleTypedSearch { protected formatType: 'doubles' | 'bdsp' | 'bdspdoubles' | 'rs' | 'frlg' | 'bw1' | 'letsgo' | 'metronome' | 'natdex' | 'nfe' | 'ssdlc1' | 'ssdlc1doubles' | 'predlc' | 'predlcdoubles' | 'predlcnatdex' | 'svdlc1' | 'svdlc1doubles' | - 'svdlc1natdex' | 'stadium' | 'lc' | 'legendsza' | 'champions' | null = null; + 'svdlc1natdex' | 'stadium' | 'lc' | 'champions' | null = null; isDoubles = false; /** @@ -654,7 +654,7 @@ abstract class BattleTypedSearch { this.formatType = 'champions'; this.dex = Dex.mod('champions' as ID); format = format.slice(9) as ID; - if (format !== 'ou' && format.length > 2) format = 'ubers' as ID; + if (format.startsWith('vgc') || format.startsWith('bss')) format = 'ubers' as ID; } if (format.startsWith('vgc')) { this.formatType = 'doubles'; @@ -722,12 +722,6 @@ abstract class BattleTypedSearch { format = format.slice(0, -5) as ID; if (!format) format = 'anythinggoes' as ID; } - if (format.includes('legendsza')) { - this.formatType = 'legendsza'; - this.dex = Dex.mod('gen9legendsou' as ID); - format = format.slice(9) as ID; - if (!format) format = 'ou' as ID; - } this.format = format; this.species = '' as ID; @@ -824,7 +818,6 @@ abstract class BattleTypedSearch { if (this.formatType === 'bw1') table = table['gen5bw1']; if (this.formatType === 'rs') table = table['gen3rs']; if (this.formatType === 'frlg') table = table['gen3frlg']; - if (this.formatType === 'legendsza') table = table['gen9legendsou']; if (this.formatType === 'champions') table = table['champions']; if (speciesid in table.learnsets) return speciesid; const species = this.dex.species.get(speciesid); @@ -865,8 +858,7 @@ abstract class BattleTypedSearch { } protected canLearn(speciesid: ID, moveid: ID) { const move = this.dex.moves.get(moveid); - if ((this.formatType === 'natdex' || this.formatType === 'legendsza') && - move.isNonstandard && move.isNonstandard !== 'Past') { + if (this.formatType === 'natdex' && move.isNonstandard && move.isNonstandard !== 'Past') { return false; } const gen = this.dex.gen; @@ -877,7 +869,7 @@ abstract class BattleTypedSearch { this.format.startsWith('battlespot') || this.format.startsWith('battlestadium') || this.format.startsWith('battlefestival') || - (this.dex.gen === 9 && this.formatType !== 'natdex' && this.formatType !== 'legendsza') + (this.dex.gen === 9 && this.formatType !== 'natdex') ) { if (gen === 9) { genChar = 'a'; @@ -897,7 +889,6 @@ abstract class BattleTypedSearch { if (this.formatType === 'bw1') table = table['gen5bw1']; if (this.formatType === 'rs') table = table['gen3rs']; if (this.formatType === 'frlg') table = table['gen3frlg']; - if (this.formatType === 'legendsza') table = table['gen9legendsou']; if (this.formatType === 'champions') table = table['champions']; let learnset = table.learnsets[learnsetid]; const eggMovesOnly = this.eggMovesOnly(learnsetid, speciesid); @@ -936,7 +927,6 @@ abstract class BattleTypedSearch { this.formatType === 'svdlc1natdex' ? 'gen9dlc1natdex' : this.formatType === 'natdex' ? `gen${gen}natdex` : this.formatType === 'stadium' ? `gen${gen}stadium${gen > 1 ? gen : ''}` : - this.formatType === 'legendsza' ? `gen9legendsou` : this.formatType === 'champions' ? `champions` : `gen${gen}`; if (table?.[tableKey]) { @@ -1028,7 +1018,7 @@ class BattlePokemonSearch extends BattleTypedSearch<'pokemon'> { const format = this.format; if (!format) return this.getDefaultResults(); const isVGCOrBS = format.startsWith('battlespot') || format.startsWith('bss') || - format.startsWith('battlestadium') || format.startsWith('vgc') || format === '4v4doublesuu'; + format.startsWith('battlestadium') || format.startsWith('vgc'); const isHackmons = format.includes('hackmons') || format.endsWith('bh'); let isDoublesOrBS = isVGCOrBS || this.formatType?.includes('doubles'); const dex = this.dex; @@ -1099,8 +1089,6 @@ class BattlePokemonSearch extends BattleTypedSearch<'pokemon'> { } } else if (this.formatType === 'stadium') { table = table[`gen${dex.gen}stadium${dex.gen > 1 ? dex.gen : ''}`]; - } else if (this.formatType === 'legendsza') { - table = table[`gen9legendsou`]; } if (!table.tierSet) { @@ -1112,7 +1100,7 @@ class BattlePokemonSearch extends BattleTypedSearch<'pokemon'> { } let tierSet: SearchRow[] = table.tierSet; let slices: { [k: string]: number } = table.formatSlices; - if (format === 'ubers' || format === 'uber' || format === 'ubersuu' || format === 'nationaldexdoubles') { + if (format === 'ubers' || format === 'uber' || format === 'ubersuu' || format === '4v4doublesuu' || format === 'nationaldexdoubles') { tierSet = tierSet.slice(slices.Uber); } else if (isVGCOrBS || (isHackmons && dex.gen === 9 && !this.formatType)) { if (format.endsWith('series13') || format.endsWith('regj') || isHackmons) { @@ -1243,6 +1231,7 @@ class BattlePokemonSearch extends BattleTypedSearch<'pokemon'> { tierSet = tierSet.filter(([type, id]) => { if (type === 'header' && id === 'DUber by technicality') return false; if (type === 'header' && id === 'Uber by technicality') return false; + if (type === 'header' && id === 'AG by technicality') return false; if (type === 'pokemon') return !id.endsWith('gmax'); return true; }); @@ -1413,8 +1402,6 @@ class BattleItemSearch extends BattleTypedSearch<'item'> { table = table[`gen${this.dex.gen}doubles`]; } else if (this.formatType === 'metronome') { table = table[`gen${this.dex.gen}metronome`]; - } else if (this.formatType === 'legendsza') { - table = table[`gen9legendsou`]; } else if (this.formatType === 'champions') { table = table[`champions`]; } else if (this.dex.gen < 9) { @@ -1791,7 +1778,7 @@ class BattleMoveSearch extends BattleTypedSearch<'move'> { const isTradebacks = format.includes('tradebacks'); const regionBornLegality = dex.gen >= 6 && (/^battle(spot|stadium|festival)/.test(format) || format.startsWith('bss') || - format.startsWith('vgc') || (dex.gen === 9 && this.formatType !== 'natdex' && this.formatType !== 'legendsza')); + format.startsWith('vgc') || (dex.gen === 9 && this.formatType !== 'natdex')); let learnsetid = this.firstLearnsetid(species.id); let moves: string[] = []; @@ -1804,7 +1791,6 @@ class BattleMoveSearch extends BattleTypedSearch<'move'> { if (this.formatType === 'bw1') lsetTable = lsetTable['gen5bw1']; if (this.formatType === 'rs') lsetTable = lsetTable['gen3rs']; if (this.formatType === 'frlg') lsetTable = lsetTable['gen3frlg']; - if (this.formatType === 'legendsza') lsetTable = lsetTable['gen9legendsou']; if (this.formatType === 'champions') lsetTable = lsetTable['champions']; if (this.formatType?.startsWith('ssdlc1')) lsetTable = lsetTable['gen8dlc1']; if (this.formatType?.startsWith('predlc')) lsetTable = lsetTable['gen9predlc']; @@ -1831,7 +1817,7 @@ class BattleMoveSearch extends BattleTypedSearch<'move'> { ) { continue; } - if (this.formatType !== 'natdex' && this.formatType !== 'legendsza' && move.isNonstandard === "Past") { + if (this.formatType !== 'natdex' && move.isNonstandard === "Past") { continue; } if ( diff --git a/play.pokemonshowdown.com/src/battle-dex.ts b/play.pokemonshowdown.com/src/battle-dex.ts index b99f03ed8..c01374d3d 100644 --- a/play.pokemonshowdown.com/src/battle-dex.ts +++ b/play.pokemonshowdown.com/src/battle-dex.ts @@ -281,9 +281,6 @@ export const Dex = new class implements ModdedDex { if (dex.gen === 8 && formatid.includes('bdsp')) { dex = Dex.mod('gen8bdsp' as ID); } - if (dex.gen === 9 && formatid.includes('legends')) { - dex = Dex.mod('gen9legendsou' as ID); - } if (dex.gen === 9 && formatid.includes('champions')) { dex = Dex.mod('champions' as ID); } diff --git a/play.pokemonshowdown.com/src/battle.ts b/play.pokemonshowdown.com/src/battle.ts index 0b4864ca7..33985e6f2 100644 --- a/play.pokemonshowdown.com/src/battle.ts +++ b/play.pokemonshowdown.com/src/battle.ts @@ -3514,9 +3514,6 @@ export class Battle { if (this.tier.includes('Super Staff Bros')) { this.dex = Dex.mod('gen9ssb' as ID); } - if (this.tier.includes(`Legends`)) { - this.dex = Dex.mod('gen9legendsou' as ID); - } if (this.tier.includes(`Champions`)) { this.dex = Dex.mod('champions' as ID); } diff --git a/play.pokemonshowdown.com/src/oldclient/client-teambuilder.js b/play.pokemonshowdown.com/src/oldclient/client-teambuilder.js index 5e33f16a4..652ed39e1 100644 --- a/play.pokemonshowdown.com/src/oldclient/client-teambuilder.js +++ b/play.pokemonshowdown.com/src/oldclient/client-teambuilder.js @@ -30,9 +30,6 @@ if (this.curTeam.format.includes('bdsp')) { this.curTeam.dex = Dex.mod('gen8bdsp'); } - if (this.curTeam.format.includes('legends')) { - this.curTeam.dex = Dex.mod('gen9legendsou'); - } if (this.curTeam.format.includes('champions')) { this.curTeam.dex = Dex.mod('champions'); } @@ -761,9 +758,6 @@ if (this.curTeam.format.includes('bdsp')) { this.curTeam.dex = Dex.mod('gen8bdsp'); } - if (this.curTeam.format.includes('legends')) { - this.curTeam.dex = Dex.mod('gen9legendsou'); - } if (this.curTeam.format.includes('champions')) { this.curTeam.dex = Dex.mod('champions'); } @@ -1632,9 +1626,6 @@ if (this.curTeam.format.includes('bdsp')) { this.curTeam.dex = Dex.mod('gen8bdsp'); } - if (this.curTeam.format.includes('legends')) { - this.curTeam.dex = Dex.mod('gen9legendsou'); - } if (this.curTeam.format.includes('champions')) { this.curTeam.dex = Dex.mod('champions'); }