Add teambuilder support for [Gen 3] ADV 200 (#2399)
Some checks failed
Node.js CI / build (22.x) (push) Has been cancelled

* Add teambuilder support for [Gen 3] ADV 200

* Fix tiering of Pokemon in ADV 200

* Satisfy linter
This commit is contained in:
shrianshChari 2025-05-01 09:44:33 -07:00 committed by GitHub
parent b0bf31074a
commit 3ceed77f49
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 45 additions and 4 deletions

View File

@ -327,7 +327,7 @@ process.stdout.write("Building `data/teambuilder-tables.js`... ");
const LC = GENS.map(num => num + 0.7);
const STADIUM = [2.04, 1.04];
const NATDEX = [9.1, 8.1];
const OTHER = [9.9, 9.6, 9.411, 9.41, 9.401, 9.4, 9.2, -9.4, -9.401, 8.6, 8.4, 8.2, 8.1, -8.4, -8.6, 7.1, 5.1];
const OTHER = [9.9, 9.6, 9.411, 9.41, 9.401, 9.4, 9.2, -9.4, -9.401, 8.6, 8.4, 8.2, 8.1, -8.4, -8.6, 7.1, 5.1, 3.1];
// process.stdout.write("\n ");
for (const genIdent of [...GENS, ...DOUBLES, ...VGC, ...NFE, ...STADIUM, ...OTHER, ...NATDEX, ...LC]) {
@ -347,6 +347,7 @@ process.stdout.write("Building `data/teambuilder-tables.js`... ");
const isSSB = genIdent === 9.6;
const genNum = Math.floor(isDoubles ? -genIdent : genIdent);
const isBW1 = genIdent === 5.1;
const isRS = genIdent === 3.1;
const gen = (() => {
let genStr = 'gen' + genNum;
if (isSSDLC1) genStr += 'dlc1';
@ -357,6 +358,7 @@ process.stdout.write("Building `data/teambuilder-tables.js`... ");
if (isStadium) genStr += 'stadium' + (genNum > 1 ? genNum : '');
if (isSSB) genStr += 'ssb';
if (isBW1) genStr += 'bw1';
if (isRS) genStr += 'rs';
return genStr;
})();
// process.stdout.write("" + gen + (isDoubles ? " doubles" : "") + "... ");
@ -436,6 +438,18 @@ process.stdout.write("Building `data/teambuilder-tables.js`... ");
if (species.tier === 'LC') return 'LC';
return 'Regular';
}
if (isRS) {
if (species.isNonstandard) {
if (species.isNonstandard === 'Unobtainable') return 'Unreleased';
return 'Illegal';
}
if (species.tier === 'Uber') return 'Uber';
if (species.nfe) {
if (species.prevo.length === 0) return "LC";
return "NFE";
}
return "Regular";
}
if (isGen9BH) {
if ((species.natDexTier === 'Illegal' || species.forme.includes('Totem')) &&
!['Floette-Eternal', 'Greninja-Ash', 'Xerneas-Neutral'].includes(species.name)) {
@ -581,7 +595,7 @@ process.stdout.write("Building `data/teambuilder-tables.js`... ");
BattleTeambuilderTable.ubersUUBans = ubersUUBans;
BattleTeambuilderTable.monotypeBans = monotypeBans;
BattleTeambuilderTable.formatSlices = formatSlices;
} else if (isBW1) {
} else if (isBW1 || isRS) {
BattleTeambuilderTable[gen] = {};
BattleTeambuilderTable[gen].overrideTier = overrideTier;
BattleTeambuilderTable[gen].tiers = tiers;
@ -611,6 +625,9 @@ process.stdout.write("Building `data/teambuilder-tables.js`... ");
if (isVGC || isGen9BH) {
return ["Mythical", "Restricted Legendary", "Regular", "NFE", "LC"];
}
if (isRS) {
return ["Regular", "NFE", "LC", "Uber"];
}
if (isDoubles && genNum > 4) {
return ["DUber", "(DUber)", "DOU", "DBL", "(DOU)", "DUU", "(DUU)", "New", "NFE", "LC"];
}
@ -988,6 +1005,16 @@ process.stdout.write("Building `data/teambuilder-tables.js`... ");
if (minGen === 1) learnsets[id][moveid] = '12' + learnsets[id][moveid];
}
}
const G3RSLearnsets = Dex.mod('gen3rs').data.Learnsets;
for (const id in G3RSLearnsets) {
const species = Dex.mod('gen3rs').species.get(id);
if (species.isNonstandard && !['Unobtainable', 'CAP'].includes(species.isNonstandard)) continue;
const learnset = G3RSLearnsets[id].learnset;
BattleTeambuilderTable['gen3rs'].learnsets[id] = {};
for (const moveid in learnset) {
BattleTeambuilderTable['gen3rs'].learnsets[id][moveid] = '3';
}
}
const G5BW1Learnsets = Dex.mod('gen5bw1').data.Learnsets;
for (const id in G5BW1Learnsets) {
const species = Dex.mod('gen5bw1').species.get(id);
@ -1253,7 +1280,7 @@ process.stdout.write("Building `data/teambuilder-tables.js`... ");
// Mods
//
for (const mod of ['gen5bw1', 'gen7letsgo', 'gen8bdsp', 'gen9ssb']) {
for (const mod of ['gen3rs', 'gen5bw1', 'gen7letsgo', 'gen8bdsp', 'gen9ssb']) {
const modDex = Dex.mod(mod);
const modData = modDex.data;
const parentDex = Dex.forGen(modDex.gen);

View File

@ -551,7 +551,7 @@ abstract class BattleTypedSearch<T extends SearchType> {
*/
set: Dex.PokemonSet | null = null;
protected formatType: 'doubles' | 'bdsp' | 'bdspdoubles' | 'bw1' | 'letsgo' | 'metronome' | 'natdex' | 'nfe' |
protected formatType: 'doubles' | 'bdsp' | 'bdspdoubles' | 'rs' | 'bw1' | 'letsgo' | 'metronome' | 'natdex' | 'nfe' |
'ssdlc1' | 'ssdlc1doubles' | 'predlc' | 'predlcdoubles' | 'predlcnatdex' | 'svdlc1' | 'svdlc1doubles' |
'svdlc1natdex' | 'stadium' | 'lc' | null = null;
@ -634,6 +634,10 @@ abstract class BattleTypedSearch<T extends SearchType> {
this.formatType = 'bw1';
this.dex = Dex.mod('gen5bw1' as ID);
}
if (format.includes('adv200')) {
this.formatType = 'rs';
this.dex = Dex.mod('gen3rs' as ID);
}
if (format === 'partnersincrime') this.formatType = 'doubles';
if (format.startsWith('ffa') || format === 'freeforall') this.formatType = 'doubles';
if (format.includes('letsgo')) {
@ -755,6 +759,7 @@ abstract class BattleTypedSearch<T extends SearchType> {
if (this.formatType?.startsWith('bdsp')) table = table['gen8bdsp'];
if (this.formatType === 'letsgo') table = table['gen7letsgo'];
if (this.formatType === 'bw1') table = table['gen5bw1'];
if (this.formatType === 'rs') table = table['gen3rs'];
if (speciesid in table.learnsets) return speciesid;
const species = this.dex.species.get(speciesid);
if (!species.exists) return '' as ID;
@ -823,6 +828,7 @@ abstract class BattleTypedSearch<T extends SearchType> {
if (this.formatType?.startsWith('bdsp')) table = table['gen8bdsp'];
if (this.formatType === 'letsgo') table = table['gen7letsgo'];
if (this.formatType === 'bw1') table = table['gen5bw1'];
if (this.formatType === 'rs') table = table['gen3rs'];
let learnset = table.learnsets[learnsetid];
const eggMovesOnly = this.eggMovesOnly(learnsetid, speciesid);
if (learnset && (moveid in learnset) && (!this.format.startsWith('tradebacks') ? learnset[moveid].includes(genChar) :
@ -846,6 +852,7 @@ abstract class BattleTypedSearch<T extends SearchType> {
this.formatType === 'bdsp' ? 'gen8bdsp' :
this.formatType === 'bdspdoubles' ? 'gen8bdspdoubles' :
this.formatType === 'bw1' ? 'gen5bw1' :
this.formatType === 'rs' ? 'gen3rs' :
this.formatType === 'nfe' ? `gen${gen}nfe` :
this.formatType === 'lc' ? `gen${gen}lc` :
this.formatType === 'ssdlc1' ? 'gen8dlc1' :
@ -981,6 +988,8 @@ class BattlePokemonSearch extends BattleTypedSearch<'pokemon'> {
table = table['gen7letsgo'];
} else if (this.formatType === 'bw1') {
table = table['gen5bw1'];
} else if (this.formatType === 'rs') {
table = table['gen3rs'];
} else if (this.formatType === 'natdex') {
table = table[`gen${dex.gen}natdex`];
} else if (this.formatType === 'metronome') {
@ -1072,6 +1081,8 @@ class BattlePokemonSearch extends BattleTypedSearch<'pokemon'> {
else if (format === 'doublesnu') tierSet = tierSet.slice(slices.DNU || slices.DUU);
else if (this.formatType?.startsWith('bdsp') || this.formatType === 'letsgo' || this.formatType === 'stadium') {
tierSet = tierSet.slice(slices.Uber);
} else if (this.formatType === 'rs') {
tierSet = tierSet.slice(slices.Regular);
} else if (!isDoublesOrBS) {
tierSet = [
...tierSet.slice(slices.OU, slices.UU),
@ -1283,6 +1294,8 @@ class BattleItemSearch extends BattleTypedSearch<'item'> {
table = table['gen8bdsp'];
} else if (this.formatType === 'bw1') {
table = table['gen5bw1'];
} else if (this.formatType === 'rs') {
table = table['gen3rs'];
} else if (this.formatType === 'natdex') {
table = table[`gen${this.dex.gen}natdex`];
} else if (this.formatType?.endsWith('doubles')) { // no natdex/bdsp doubles support
@ -1662,6 +1675,7 @@ class BattleMoveSearch extends BattleTypedSearch<'move'> {
if (this.formatType?.startsWith('bdsp')) lsetTable = lsetTable['gen8bdsp'];
if (this.formatType === 'letsgo') lsetTable = lsetTable['gen7letsgo'];
if (this.formatType === 'bw1') lsetTable = lsetTable['gen5bw1'];
if (this.formatType === 'rs') lsetTable = lsetTable['gen3rs'];
if (this.formatType?.startsWith('ssdlc1')) lsetTable = lsetTable['gen8dlc1'];
if (this.formatType?.startsWith('predlc')) lsetTable = lsetTable['gen9predlc'];
if (this.formatType?.startsWith('svdlc1')) lsetTable = lsetTable['gen9dlc1'];