Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't force Tera types because of Hackmons #2324

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 9 additions & 14 deletions play.pokemonshowdown.com/js/client-teambuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -1343,7 +1343,7 @@
}
}
if (this.curTeam.gen === 9) {
buf += '<span class="detailcell"><label>Tera Type</label>' + (species.forceTeraType || set.teraType || species.types[0]) + '</span>';
buf += '<span class="detailcell"><label>Tera Type</label>' + (set.teraType || species.requiredTeraType || species.types[0]) + '</span>';
}
}
buf += '</button></div></div>';
Expand Down Expand Up @@ -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.requiredTeraType || species.types[0];
}

var text = Storage.exportTeam([curSet], this.curTeam.gen);
Expand Down Expand Up @@ -2911,18 +2911,13 @@

if (this.curTeam.gen === 9) {
buf += '<div class="formrow"><label class="formlabel" title="Tera Type">Tera Type:</label><div>';
if (species.forceTeraType) {
buf += species.forceTeraType;
} else {
buf += '<select name="teratype" class="button">';
var types = Dex.types.all();
var teraType = set.teraType || species.types[0];
for (var i = 0; i < types.length; i++) {
buf += '<option value="' + types[i].name + '"' + (teraType === types[i].name ? ' selected="selected"' : '') + '>' + types[i].name + '</option>';
}
buf += '</select>';
buf += '<select name="teratype" class="button">';
var types = Dex.types.all();
var teraType = set.teraType || species.requiredTeraType || species.types[0];
for (var i = 0; i < types.length; i++) {
buf += '<option value="' + types[i].name + '"' + (teraType === types[i].name ? ' selected="selected"' : '') + '>' + types[i].name + '</option>';
}
buf += '</div></div>';
buf += '</select></div></div>';
}

buf += '</form>';
Expand Down Expand Up @@ -3033,7 +3028,7 @@
}
}
if (this.curTeam.gen === 9) {
buf += '<span class="detailcell"><label>Tera Type</label>' + (species.forceTeraType || set.teraType || species.types[0]) + '</span>';
buf += '<span class="detailcell"><label>Tera Type</label>' + (set.teraType || species.requiredTeraType || species.types[0]) + '</span>';
}
}
this.$('button[name=details]').html(buf);
Expand Down
2 changes: 1 addition & 1 deletion play.pokemonshowdown.com/js/storage.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.requiredTeraType || species.types[0]) + " \n";
}
if (!hidestats) {
var first = true;
Expand Down
4 changes: 2 additions & 2 deletions play.pokemonshowdown.com/src/battle-dex-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1498,7 +1498,7 @@ 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';
Expand Down Expand Up @@ -1553,7 +1553,7 @@ 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;
Expand Down
2 changes: 1 addition & 1 deletion play.pokemonshowdown.com/src/battle-dex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.requiredTeraType || species.types[0]) + " \n";
}
if (!hidestats) {
let first = true;
Expand Down
Loading