From 212b35816ccec2b41d6b6636badacb99397f7125 Mon Sep 17 00:00:00 2001 From: Shriansh Chari <30420527+shrianshChari@users.noreply.github.com> Date: Fri, 8 May 2026 00:24:30 -0700 Subject: [PATCH 1/5] Preact: Support Pokemon Champions --- .../src/battle-team-editor.tsx | 27 +++++++++++-------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/play.pokemonshowdown.com/src/battle-team-editor.tsx b/play.pokemonshowdown.com/src/battle-team-editor.tsx index 1c67d8e8b..ac1a21dea 100644 --- a/play.pokemonshowdown.com/src/battle-team-editor.tsx +++ b/play.pokemonshowdown.com/src/battle-team-editor.tsx @@ -66,6 +66,7 @@ export class TeamEditorState extends PSModel { isLetsGo = false; isNatDex = false; isBDSP = false; + isChampions = false; formeLegality: 'normal' | 'hackmons' | 'custom' = 'normal'; abilityLegality: 'normal' | 'hackmons' = 'normal'; defaultLevel = 100; @@ -98,6 +99,7 @@ export class TeamEditorState extends PSModel { this.isLetsGo = formatid.includes('letsgo'); this.isNatDex = formatid.includes('nationaldex') || formatid.includes('natdex'); this.isBDSP = formatid.includes('bdsp'); + this.isChampions = formatid.includes('champions'); if (formatid.includes('almostanyability') || formatid.includes('aaa')) { this.abilityLegality = 'hackmons'; } else { @@ -663,7 +665,8 @@ export class TeamEditorState extends PSModel { } } getStat(stat: StatName, set: Dex.PokemonSet, ivOverride: number, evOverride?: number, natureOverride?: number) { - const supportsEVs = !this.isLetsGo; + const usesStatPoints = this.isChampions; + const supportsEVs = !this.isLetsGo && !usesStatPoints; const supportsAVs = !supportsEVs; // do this after setting set.evs because it's assumed to exist @@ -1677,7 +1680,7 @@ class TeamTextbox extends preact.Component<{ {set.shiny ? 'Yes' : '\u2014'} - {editor.gen === 9 ? ( + {editor.gen === 9 && !editor.isChampions ? ( @@ -2001,7 +2004,7 @@ class TeamWizard extends preact.Component<{ Shiny {} {set.shiny ? Yes : '\u2014'} } - {editor.gen === 9 && + {editor.gen === 9 && !editor.isChampions && Tera {} } @@ -2481,7 +2484,7 @@ class StatForm extends preact.Component<{ const autoSpread = set.ivs && editor.defaultIVs(set, false); const autoSpreadValue = autoSpread && Object.values(autoSpread).join('/'); if (!hpIVdata) { - return {autoSpreadValue && } @@ -2836,8 +2839,9 @@ class StatForm extends preact.Component<{ }; maxEVs() { const editor = this.props.editor; - const useEVs = !editor.isLetsGo && editor.gen >= 3; - return useEVs ? 510 : Infinity; + const usesStatPoints = editor.isChampions; + const useEVs = !editor.isLetsGo && editor.gen >= 3 && !usesStatPoints; + return usesStatPoints ? 66 : useEVs ? 510 : Infinity; } override render() { const { editor, set } = this.props; @@ -2847,9 +2851,10 @@ class StatForm extends preact.Component<{ const nature = BattleNatures[set.nature || 'Serious']; - const useEVs = !editor.isLetsGo; + const usesStatPoints = editor.isChampions; + const useEVs = !editor.isLetsGo && !usesStatPoints; // const useAVs = !useEVs && team.format.endsWith('norestrictions'); - const maxEV = useEVs ? 252 : 200; + const maxEV = usesStatPoints ? 32 : useEVs ? 252 : 200; const stepEV = useEVs ? 4 : 1; const defaultEV = useEVs && editor.gen <= 2 && !set.evs ? maxEV : 0; const useIVs = editor.gen > 2; @@ -2893,7 +2898,7 @@ class StatForm extends preact.Component<{ {/* Stat name */} Base {/* Stat bar */} - {useEVs ? 'EVs' : 'AVs'} + {useEVs ? 'EVs' : usesStatPoints ? 'Points' : 'AVs'} {/* EV slider */} {useIVs ? 'IVs' : 'DVs'} {/* Final stat */} @@ -2914,7 +2919,7 @@ class StatForm extends preact.Component<{ /> {stat} )} @@ -3151,7 +3156,7 @@ class DetailsForm extends preact.Component<{ ))}

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

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

(You probably want to change the team's levels by changing the format, not here)

{editor.gen > 1 && (<>

Shiny:
From 305999fa2fb21bb5b4b69b3564702743d53b9bcd Mon Sep 17 00:00:00 2001 From: Shriansh Chari <30420527+shrianshChari@users.noreply.github.com> Date: Fri, 8 May 2026 09:29:57 -0700 Subject: [PATCH 4/5] Fix PP --- play.pokemonshowdown.com/src/battle-searchresults.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/play.pokemonshowdown.com/src/battle-searchresults.tsx b/play.pokemonshowdown.com/src/battle-searchresults.tsx index 38179a678..ca40c30b6 100644 --- a/play.pokemonshowdown.com/src/battle-searchresults.tsx +++ b/play.pokemonshowdown.com/src/battle-searchresults.tsx @@ -243,7 +243,7 @@ export class PSSearchResults extends preact.Component<{ let pp = (move.pp === 1 || move.noPPBoosts ? move.pp : move.pp * 8 / 5); if (search.dex.gen < 3) pp = Math.min(61, pp); if (search.dex.modid === 'champions') { - pp = move.pp > 20 ? 20 : pp; + pp = Math.min(move.pp, 20); if (!move.noPPBoosts) pp = (pp / 5 + 1) * 4; } return
  • Date: Fri, 8 May 2026 10:30:51 -0700 Subject: [PATCH 5/5] Just use dhelmise's code --- play.pokemonshowdown.com/src/battle-searchresults.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/play.pokemonshowdown.com/src/battle-searchresults.tsx b/play.pokemonshowdown.com/src/battle-searchresults.tsx index ca40c30b6..4d5de8b82 100644 --- a/play.pokemonshowdown.com/src/battle-searchresults.tsx +++ b/play.pokemonshowdown.com/src/battle-searchresults.tsx @@ -243,7 +243,7 @@ export class PSSearchResults extends preact.Component<{ let pp = (move.pp === 1 || move.noPPBoosts ? move.pp : move.pp * 8 / 5); if (search.dex.gen < 3) pp = Math.min(61, pp); if (search.dex.modid === 'champions') { - pp = Math.min(move.pp, 20); + pp = move.pp > 20 ? 20 : move.pp; if (!move.noPPBoosts) pp = (pp / 5 + 1) * 4; } return