From b03d2696d92022bb492b27126f3f391f2f77434f Mon Sep 17 00:00:00 2001 From: ry Date: Wed, 24 Jun 2026 14:48:33 -0500 Subject: [PATCH] fix tera in builder --- play.pokemonshowdown.com/src/battle-dex-search.ts | 4 ++++ play.pokemonshowdown.com/src/battle-team-editor.tsx | 10 ++++++---- play.pokemonshowdown.com/src/panel-mainmenu.tsx | 3 +++ play.pokemonshowdown.com/src/panel-teamdropdown.tsx | 1 + 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/play.pokemonshowdown.com/src/battle-dex-search.ts b/play.pokemonshowdown.com/src/battle-dex-search.ts index cb33a3c479..76edda41c3 100644 --- a/play.pokemonshowdown.com/src/battle-dex-search.ts +++ b/play.pokemonshowdown.com/src/battle-dex-search.ts @@ -584,6 +584,7 @@ abstract class BattleTypedSearch { 'nfe' | 'ssdlc1' | 'ssdlc1doubles' | 'predlc' | 'predlcdoubles' | 'svdlc1' | 'svdlc1doubles' | 'stadium' | 'lc' | 'champions' | 'natdexchampions' | null = null; isDoubles = false; + terastalClause = false; /** * Cached copy of what the results list would be with only base filters @@ -605,6 +606,7 @@ abstract class BattleTypedSearch { this.baseResults = null; this.baseIllegalResults = null; + this.terastalClause = !!BattleFormats[format]?.terastalClause; if (format.startsWith('gen')) { const gen = (Number(format.charAt(3)) || 6); @@ -1720,6 +1722,8 @@ class BattleMoveSearch extends BattleTypedSearch<'move'> { case 'temperflare': return (!moves.includes('flareblitz') && !moves.includes('pyroball') && !moves.includes('sacredfire') && !moves.includes('bitterblade') && !moves.includes('firepunch')) || this.isDoubles; + case 'terablast': + return !this.terastalClause; case 'terrainpulse': case 'waterpulse': return ['megalauncher', 'technician'].includes(abilityid) && !moves.includes('originpulse'); case 'thief': diff --git a/play.pokemonshowdown.com/src/battle-team-editor.tsx b/play.pokemonshowdown.com/src/battle-team-editor.tsx index 6f7e220bc7..c90592e75c 100644 --- a/play.pokemonshowdown.com/src/battle-team-editor.tsx +++ b/play.pokemonshowdown.com/src/battle-team-editor.tsx @@ -67,6 +67,7 @@ export class TeamEditorState extends PSModel { isNatDex = false; isBDSP = false; isChampions = false; + terastalClause = false; formeLegality: 'normal' | 'hackmons' | 'custom' = 'normal'; abilityLegality: 'normal' | 'hackmons' = 'normal'; defaultLevel = 100; @@ -100,6 +101,7 @@ export class TeamEditorState extends PSModel { this.isNatDex = formatid.includes('nationaldex') || formatid.includes('natdex'); this.isBDSP = formatid.includes('bdsp'); this.isChampions = formatid.includes('champions'); + this.terastalClause = !!BattleFormats[formatid]?.terastalClause; if (formatid.includes('almostanyability') || formatid.includes('aaa')) { this.abilityLegality = 'hackmons'; } else { @@ -497,7 +499,7 @@ export class TeamEditorState extends PSModel { }; hpTypeMatters(set: Dex.PokemonSet): boolean { if (this.gen < 2) return false; - if (this.gen > 7) return false; + if (this.gen > 7 && !this.isNatDex) return false; for (const move of set.moves) { const moveid = toID(move); if (moveid.startsWith('hiddenpower')) return true; @@ -1681,7 +1683,7 @@ class TeamTextbox extends preact.Component<{ {set.shiny ? 'Yes' : '\u2014'} - {editor.gen === 9 && !editor.isChampions ? ( + {editor.gen === 9 && !editor.terastalClause && !editor.isChampions ? ( @@ -2011,7 +2013,7 @@ class TeamWizard extends preact.Component<{ Shiny {} {set.shiny ? Yes : '\u2014'} } - {editor.gen === 9 && !editor.isChampions && + {editor.gen === 9 && !editor.terastalClause && !editor.isChampions && Tera {} } @@ -3164,7 +3166,7 @@ class DetailsForm extends preact.Component<{ ))}

} - {editor.gen === 9 && !editor.isChampions &&

+ {editor.gen === 9 && !editor.terastalClause && !editor.isChampions &&