From 7eaa13c8d866f5b92d53f061a76ab3ffd384673b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Bastos=20Dias?= Date: Mon, 13 Jan 2025 07:29:07 +0000 Subject: [PATCH 1/2] Don't force Tera types --- .../js/client-teambuilder.js | 23 ++++++++----------- play.pokemonshowdown.com/js/storage.js | 2 +- play.pokemonshowdown.com/src/battle-dex.ts | 2 +- 3 files changed, 11 insertions(+), 16 deletions(-) diff --git a/play.pokemonshowdown.com/js/client-teambuilder.js b/play.pokemonshowdown.com/js/client-teambuilder.js index 1f0031d84a..0db8504120 100644 --- a/play.pokemonshowdown.com/js/client-teambuilder.js +++ b/play.pokemonshowdown.com/js/client-teambuilder.js @@ -1343,7 +1343,7 @@ } } if (this.curTeam.gen === 9) { - buf += '' + (species.forceTeraType || set.teraType || species.types[0]) + ''; + buf += '' + (set.teraType || species.forceTeraType || species.types[0]) + ''; } } buf += ''; @@ -1880,7 +1880,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.forceTeraType || species.types[0]; } var text = Storage.exportTeam([curSet], this.curTeam.gen); @@ -2911,18 +2911,13 @@ if (this.curTeam.gen === 9) { buf += '
'; - if (species.forceTeraType) { - buf += species.forceTeraType; - } else { - buf += ''; + buf += '
'; } buf += ''; @@ -3033,7 +3028,7 @@ } } if (this.curTeam.gen === 9) { - buf += '' + (species.forceTeraType || set.teraType || species.types[0]) + ''; + buf += '' + (set.teraType || species.forceTeraType || 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 3eeaa4e332..aed1802f31 100644 --- a/play.pokemonshowdown.com/js/storage.js +++ b/play.pokemonshowdown.com/js/storage.js @@ -1420,7 +1420,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.forceTeraType || species.types[0]) + " \n"; } if (!hidestats) { var first = true; diff --git a/play.pokemonshowdown.com/src/battle-dex.ts b/play.pokemonshowdown.com/src/battle-dex.ts index 33065186f6..9ac7a73b04 100644 --- a/play.pokemonshowdown.com/src/battle-dex.ts +++ b/play.pokemonshowdown.com/src/battle-dex.ts @@ -1200,7 +1200,7 @@ 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.forceTeraType || species.types[0]) + " \n"; } if (!hidestats) { let first = true; From dc86b1a404dcfb30cc427393660ea94fb1be1ebd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Bastos=20Dias?= Date: Mon, 13 Jan 2025 07:32:33 +0000 Subject: [PATCH 2/2] Rename similar to requiredAbility/Item/Move --- play.pokemonshowdown.com/js/client-teambuilder.js | 8 ++++---- play.pokemonshowdown.com/js/storage.js | 2 +- play.pokemonshowdown.com/src/battle-dex-data.ts | 4 ++-- play.pokemonshowdown.com/src/battle-dex.ts | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/play.pokemonshowdown.com/js/client-teambuilder.js b/play.pokemonshowdown.com/js/client-teambuilder.js index 0db8504120..80c612f6f9 100644 --- a/play.pokemonshowdown.com/js/client-teambuilder.js +++ b/play.pokemonshowdown.com/js/client-teambuilder.js @@ -1343,7 +1343,7 @@ } } if (this.curTeam.gen === 9) { - buf += '' + (set.teraType || species.forceTeraType || species.types[0]) + ''; + buf += '' + (set.teraType || species.requiredTeraType || species.types[0]) + ''; } } buf += ''; @@ -1880,7 +1880,7 @@ // never preserve current set tera, even if smogon set used default if (this.curSet.gen === 9) { - curSet.teraType = sampleSet.teraType || species.forceTeraType || species.types[0]; + curSet.teraType = sampleSet.teraType || species.requiredTeraType || species.types[0]; } var text = Storage.exportTeam([curSet], this.curTeam.gen); @@ -2913,7 +2913,7 @@ buf += '
'; buf += '