Properly tier National Dex (#1990)

This commit is contained in:
Kris Johnson 2022-08-24 17:40:49 -06:00 committed by GitHub
parent 03e89bc122
commit d4e9642b29
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 31 deletions

View File

@ -20,7 +20,6 @@ child_process.execSync('npm run build', {cwd: 'data/pokemon-showdown'});
console.log("DONE");
const Dex = require('../data/pokemon-showdown/.sim-dist/dex').Dex;
const Tags = require('../data/pokemon-showdown/.data-dist/tags').Tags;
const toID = Dex.toID;
process.stdout.write("Loading gen 6 data... ");
Dex.includeData();
@ -356,35 +355,6 @@ process.stdout.write("Building `data/teambuilder-tables.js`... ");
const baseSpecies = Dex.mod(gen).species.get(species.baseSpecies);
if (species.gen > genNum) continue;
const tier = (() => {
if (isNatDex) {
const unobtainables = [
'Eevee-Starter', 'Floette-Eternal', 'Pichu-Spiky-eared', 'Pikachu-Belle', 'Pikachu-Cosplay', 'Pikachu-Libre', 'Pikachu-PhD', 'Pikachu-Pop-Star', 'Pikachu-Rock-Star', 'Pikachu-Starter', 'Eternatus-Eternamax',
].map(toID);
if (species.isNonstandard && !['Past', 'Gigantamax'].includes(species.isNonstandard)) return 'Illegal';
if (unobtainables.includes(species.id)) return 'Illegal';
const ou = Dex.formats.get('gen8nationaldex');
const uu = Dex.formats.get('gen8nationaldexuu');
const ru = Dex.formats.get('gen8nationaldexru');
if (Dex.formats.getRuleTable(ou).isBannedSpecies(species)) return 'Uber';
if (Dex.formats.getRuleTable(ou).has('dynamaxclause') && species.name.endsWith('Gmax')) return '(Uber)';
if (Dex.formats.getRuleTable(uu).isBannedSpecies(species)) {
if (Tags.nduubl.speciesFilter(species)) return 'UUBL';
return 'OU';
}
if (Dex.formats.getRuleTable(ru).isBannedSpecies(species)) {
if (Tags.ndrubl.speciesFilter(species)) return 'RUBL';
return 'UU';
} else {
if (species.nfe) {
if (species.prevo) {
return 'NFE';
} else {
return 'LC';
}
}
return 'RU';
}
}
if (isMetBattle) {
let tier = species.tier;
if (species.isNonstandard) {
@ -439,6 +409,9 @@ process.stdout.write("Building `data/teambuilder-tables.js`... ");
if (isDoubles && genNum > 4) {
return species.doublesTier;
}
if (isNatDex) {
return species.natDexTier;
}
return species.tier;
})();
overrideTier[species.id] = tier;
@ -494,6 +467,7 @@ process.stdout.write("Building `data/teambuilder-tables.js`... ");
if (isNatDex) {
BattleTeambuilderTable['natdex'] = {};
BattleTeambuilderTable['natdex'].tiers = tiers;
BattleTeambuilderTable['natdex'].overrideTier = overrideTier;
BattleTeambuilderTable['natdex'].items = items;
BattleTeambuilderTable['natdex'].monotypeBans = monotypeBans;
BattleTeambuilderTable['natdex'].formatSlices = formatSlices;

View File

@ -781,7 +781,7 @@ abstract class BattleTypedSearch<T extends SearchType> {
return false;
}
getTier(pokemon: Species) {
if (this.formatType === 'metronome' || this.formatType === 'natdex') {
if (this.formatType === 'metronome') {
return pokemon.num >= 0 ? String(pokemon.num) : pokemon.tier;
}
let table = window.BattleTeambuilderTable;
@ -793,6 +793,7 @@ abstract class BattleTypedSearch<T extends SearchType> {
this.formatType === 'nfe' ? `gen${gen}nfe` :
this.formatType === 'dlc1' ? 'gen8dlc1' :
this.formatType === 'dlc1doubles' ? 'gen8dlc1doubles' :
this.formatType === 'natdex' ? 'natdex' :
this.formatType === 'stadium' ? `gen${gen}stadium${gen > 1 ? gen : ''}` :
`gen${gen}`;
if (table && table[tableKey]) {