From 73ea84c0d0622fa032a7c32df46f65aea93eeff2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Bastos=20Dias?= <80102738+andrebastosdias@users.noreply.github.com> Date: Tue, 13 May 2025 22:45:16 +0100 Subject: [PATCH] Don't force Tera types because of Hackmons (#2324) --------- Co-authored-by: Guangcong Luo --- .../js/client-teambuilder.js | 23 ++++++++----------- play.pokemonshowdown.com/js/storage.js | 2 +- .../src/battle-dex-data.ts | 4 ++-- play.pokemonshowdown.com/src/battle-dex.ts | 2 +- .../src/battle-team-editor.tsx | 12 +++++----- 5 files changed, 19 insertions(+), 24 deletions(-) diff --git a/play.pokemonshowdown.com/js/client-teambuilder.js b/play.pokemonshowdown.com/js/client-teambuilder.js index 1f9cff093..a47e7b7f3 100644 --- a/play.pokemonshowdown.com/js/client-teambuilder.js +++ b/play.pokemonshowdown.com/js/client-teambuilder.js @@ -1345,7 +1345,7 @@ } } if (this.curTeam.gen === 9) { - buf += '' + (species.forceTeraType || set.teraType || species.types[0]) + ''; + buf += '' + (set.teraType || species.requiredTeraType || species.types[0]) + ''; } } buf += ''; @@ -1882,7 +1882,7 @@ // never preserve current set tera, even if smogon set used default if (this.curSet.gen === 9) { - curSet.teraType = species.forceTeraType || sampleSet.teraType || species.types[0]; + curSet.teraType = sampleSet.teraType || species.requiredTeraType || species.types[0]; } var text = Storage.exportTeam([curSet], this.curTeam.gen); @@ -2913,18 +2913,13 @@ if (this.curTeam.gen === 9) { buf += '
'; - if (species.forceTeraType) { - buf += species.forceTeraType; - } else { - buf += ''; + buf += '
'; } buf += ''; @@ -3035,7 +3030,7 @@ } } if (this.curTeam.gen === 9) { - buf += '' + (species.forceTeraType || set.teraType || species.types[0]) + ''; + buf += '' + (set.teraType || species.requiredTeraType || species.types[0]) + ''; } } this.$('button[name=details]').html(buf); diff --git a/play.pokemonshowdown.com/js/storage.js b/play.pokemonshowdown.com/js/storage.js index c07512a67..81053a139 100644 --- a/play.pokemonshowdown.com/js/storage.js +++ b/play.pokemonshowdown.com/js/storage.js @@ -1419,7 +1419,7 @@ Storage.exportTeam = function (team, gen, hidestats) { } if (gen === 9) { var species = Dex.species.get(curSet.species); - text += 'Tera Type: ' + (species.forceTeraType || curSet.teraType || species.types[0]) + " \n"; + text += 'Tera Type: ' + (curSet.teraType || species.requiredTeraType || species.types[0]) + " \n"; } if (!hidestats) { var first = true; diff --git a/play.pokemonshowdown.com/src/battle-dex-data.ts b/play.pokemonshowdown.com/src/battle-dex-data.ts index be2f089ca..61932d02c 100644 --- a/play.pokemonshowdown.com/src/battle-dex-data.ts +++ b/play.pokemonshowdown.com/src/battle-dex-data.ts @@ -1506,7 +1506,7 @@ export class Species implements Effect { readonly isPrimal: boolean; readonly canGigantamax: boolean; readonly cannotDynamax: boolean; - readonly forceTeraType: TypeName; + readonly requiredTeraType: TypeName; readonly battleOnly: string | string[] | undefined; readonly isNonstandard: string | null; readonly unreleasedHidden: boolean | 'Past'; @@ -1562,7 +1562,7 @@ export class Species implements Effect { this.isPrimal = !!(this.forme && this.formeid === '-primal'); this.canGigantamax = !!data.canGigantamax; this.cannotDynamax = !!data.cannotDynamax; - this.forceTeraType = data.forceTeraType || ''; + this.requiredTeraType = data.requiredTeraType || ''; this.battleOnly = data.battleOnly || (this.isMega ? this.baseSpecies : undefined); this.isNonstandard = data.isNonstandard || null; this.unreleasedHidden = data.unreleasedHidden || false; diff --git a/play.pokemonshowdown.com/src/battle-dex.ts b/play.pokemonshowdown.com/src/battle-dex.ts index 706cd0be5..23e8a5416 100644 --- a/play.pokemonshowdown.com/src/battle-dex.ts +++ b/play.pokemonshowdown.com/src/battle-dex.ts @@ -1344,7 +1344,7 @@ export const Teams = new class { } if (gen === 9) { const species = Dex.species.get(curSet.species); - text += `Tera Type: ${species.forceTeraType || curSet.teraType || species.types[0]} \n`; + text += `Tera Type: ${curSet.teraType || species.requiredTeraType || species.types[0]} \n`; } if (!hidestats) { let first = true; diff --git a/play.pokemonshowdown.com/src/battle-team-editor.tsx b/play.pokemonshowdown.com/src/battle-team-editor.tsx index 69b723ae7..6d851624b 100644 --- a/play.pokemonshowdown.com/src/battle-team-editor.tsx +++ b/play.pokemonshowdown.com/src/battle-team-editor.tsx @@ -1296,7 +1296,7 @@ class TeamTextbox extends preact.Component<{ editor: TeamEditorState, onChange?: {editor.gen === 9 ? ( - {TeamEditor.renderTypeIcon(set.teraType || species.forceTeraType || species.types[0])} + {TeamEditor.renderTypeIcon(set.teraType || species.requiredTeraType || species.types[0])} ) : editor.hpTypeMatters(set) ? ( @@ -1590,7 +1590,7 @@ class TeamWizard extends preact.Component<{ } {editor.gen === 9 && Tera {} - {TeamEditor.renderTypeIcon(set.teraType || species.forceTeraType || species.types[0])} + {TeamEditor.renderTypeIcon(set.teraType || species.requiredTeraType || species.types[0])} } {editor.hpTypeMatters(set) && H.P. {} @@ -2464,7 +2464,7 @@ class DetailsForm extends preact.Component<{ const target = ev.currentTarget as HTMLInputElement; const { editor, set } = this.props; const species = editor.dex.species.get(set.species); - if (!target.value || target.value === (species.forceTeraType || species.types[0])) { + if (!target.value || target.value === (species.requiredTeraType || species.types[0])) { delete set.teraType; } else { set.teraType = target.value.trim(); @@ -2638,12 +2638,12 @@ class DetailsForm extends preact.Component<{ {editor.gen === 9 &&