diff --git a/build-tools/build-indexes b/build-tools/build-indexes index cef9a02ea2..b94450483a 100755 --- a/build-tools/build-indexes +++ b/build-tools/build-indexes @@ -322,7 +322,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.2, 8.6, 8.4, 8.2, 8.1, -8.4, -8.6, 7.1]; + const OTHER = [9.9, 9.2, 8.6, 8.4, 8.2, 8.1, -8.4, -8.6, 7.1]; // process.stdout.write("\n "); for (const genIdent of [...GENS, ...DOUBLES, ...VGC, ...NFE, ...STADIUM, ...OTHER, ...NATDEX, ...LC]) { @@ -336,6 +336,7 @@ process.stdout.write("Building `data/teambuilder-tables.js`... "); const isStadium = ('' + genIdent).endsWith('.04'); const isDoubles = (genIdent < 0); const isVGC = ('' + genIdent).endsWith('.5'); + const isGen9BH = genIdent === 9.9; const genNum = Math.floor(isDoubles ? -genIdent : genIdent); const gen = (() => { let genStr = 'gen' + genNum; @@ -418,6 +419,20 @@ process.stdout.write("Building `data/teambuilder-tables.js`... "); if (species.tier === 'LC') return 'LC'; return 'Regular'; } + if (isGen9BH) { + if ((species.natDexTier === 'Illegal' || species.forme.includes('Totem')) && + !['Floette-Eternal', 'Greninja-Ash', 'Xerneas-Neutral'].includes(species.name)) { + return 'Illegal'; + } + if ((species.name === 'Xerneas' || species.battleOnly || species.forme === 'Eternamax') && + !(species.isMega || species.isPrimal || ['Greninja-Ash', 'Necrozma-Ultra'].includes(species.name))) { + return 'Illegal'; + } + if (species.isNonstandard && ['LGPE', 'CAP', 'Future'].includes(species.isNonstandard)) return 'Illegal'; + return species.tags.includes('Mythical') ? 'Mythical' : + species.tags.includes('Restricted Legendary') ? 'Restricted Legendary' : + species.nfe ? (species.prevo ? 'NFE' : 'LC') : 'Regular'; + } if (species.tier === 'CAP' || species.tier === 'CAP NFE' || species.tier === 'CAP LC') { return species.tier; } @@ -511,6 +526,11 @@ process.stdout.write("Building `data/teambuilder-tables.js`... "); BattleTeambuilderTable[gen + 'doubles'].tiers = tiers; BattleTeambuilderTable[gen + 'doubles'].overrideTier = overrideTier; BattleTeambuilderTable[gen + 'doubles'].formatSlices = formatSlices; + } else if (isGen9BH) { + BattleTeambuilderTable['bh'] = {}; + BattleTeambuilderTable['bh'].tiers = tiers; + BattleTeambuilderTable['bh'].overrideTier = overrideTier; + BattleTeambuilderTable['bh'].formatSlices = formatSlices; } else if (gen === 'gen9') { BattleTeambuilderTable.tiers = tiers; BattleTeambuilderTable.items = items; @@ -535,7 +555,7 @@ process.stdout.write("Building `data/teambuilder-tables.js`... "); } const tierOrder = (() => { - if (isVGC) { + if (isVGC || isGen9BH) { return ["Mythical", "Restricted Legendary", "Regular", "NFE", "LC"]; } if (isDoubles && genNum > 4) { diff --git a/src/battle-dex-search.ts b/src/battle-dex-search.ts index 05a84869a2..367575c528 100644 --- a/src/battle-dex-search.ts +++ b/src/battle-dex-search.ts @@ -885,6 +885,7 @@ class BattlePokemonSearch extends BattleTypedSearch<'pokemon'> { const format = this.format; if (!format) return this.getDefaultResults(); const isVGCOrBS = format.startsWith('battlespot') || format.startsWith('battlestadium') || format.startsWith('vgc'); + const isHackmons = format.includes('hackmons') || format.endsWith('bh'); let isDoublesOrBS = isVGCOrBS || this.formatType?.includes('doubles'); const dex = this.dex; @@ -893,6 +894,8 @@ class BattlePokemonSearch extends BattleTypedSearch<'pokemon'> { table = table['gen' + dex.gen]; } else if (isVGCOrBS) { table = table['gen' + dex.gen + 'vgc']; + } else if (dex.gen === 9 && isHackmons && !this.formatType) { + table = table['bh']; } else if ( table['gen' + dex.gen + 'doubles'] && dex.gen > 4 && this.formatType !== 'letsgo' && this.formatType !== 'bdspdoubles' && this.formatType !== 'dlc1doubles' && @@ -911,7 +914,7 @@ class BattlePokemonSearch extends BattleTypedSearch<'pokemon'> { } else if (this.formatType === 'letsgo') { table = table['gen7letsgo']; } else if (this.formatType === 'natdex') { - table = table['gen' + this.dex.gen + 'natdex']; + table = table['gen' + dex.gen + 'natdex']; } else if (this.formatType === 'metronome') { table = table['gen' + dex.gen + 'metronome']; } else if (this.formatType === 'nfe') { @@ -938,8 +941,8 @@ class BattlePokemonSearch extends BattleTypedSearch<'pokemon'> { let tierSet: SearchRow[] = table.tierSet; let slices: {[k: string]: number} = table.formatSlices; if (format === 'ubers' || format === 'uber') tierSet = tierSet.slice(slices.Uber); - else if (isVGCOrBS) { - if (format.endsWith('series13')) { + else if (isVGCOrBS || (isHackmons && dex.gen === 9 && !this.formatType)) { + if (format.endsWith('series13') || isHackmons) { // Show Mythicals } else if ( format === 'vgc2010' || format === 'vgc2016' || format.startsWith('vgc2019') || @@ -961,8 +964,9 @@ class BattlePokemonSearch extends BattleTypedSearch<'pokemon'> { tierSet = tierSet.slice(slices['CAP LC'], slices.AG || slices.Uber).concat(tierSet.slice(slices.LC)); } else if (format === 'anythinggoes' || format.endsWith('ag') || format.startsWith('ag')) { tierSet = tierSet.slice(slices.AG); - } else if (format.includes('hackmons') || format.endsWith('bh')) tierSet = tierSet.slice(slices.AG || slices.Uber); - else if (format === 'monotype') tierSet = tierSet.slice(slices.Uber); + } else if (isHackmons && (dex.gen < 9 || this.formatType === 'natdex')) { + tierSet = tierSet.slice(slices.AG || slices.Uber); + } else if (format === 'monotype') tierSet = tierSet.slice(slices.Uber); else if (format === 'doublesubers') tierSet = tierSet.slice(slices.DUber); else if (format === 'doublesou' && dex.gen > 4) tierSet = tierSet.slice(slices.DOU); else if (format === 'doublesuu') tierSet = tierSet.slice(slices.DUU);