mirror of
https://github.com/smogon/pokemon-showdown-client.git
synced 2026-03-21 17:50:29 -05:00
Fix teambuilder support for OMs (#2598)
Some checks failed
Node.js CI / build (22.x) (push) Has been cancelled
Some checks failed
Node.js CI / build (22.x) (push) Has been cancelled
* battle-dex-search.ts: Fix natdex OMs pulling from SV OMs * Fix Teambuilder Support For OMs * National Dex OMs merging the rulesets for their SV counterparts * Bans via required abilities and items never being checked * Bans via required abilities not being implemented properly * mega rayquaza clause being wastefully checked over and over again * Tables in natdex now omit the 'natdex' part of the format to be consistent with battle-dex-search.ts * Synced meta tables in build-indexes and battle-dex-search.ts * Apply suggestions from code review --------- Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>
This commit is contained in:
parent
d72c511186
commit
4428a1444c
|
|
@ -433,36 +433,41 @@ process.stdout.write("Building `data/teambuilder-tables.js`... ");
|
||||||
if (genNum >= 6) {
|
if (genNum >= 6) {
|
||||||
for (const meta of [
|
for (const meta of [
|
||||||
'1v1', '2v2doubles', 'lcuu', 'freeforall', 'ubersuu', 'almostanyability', 'balancedhackmons', 'godlygift', 'mixandmega', 'sharedpower', 'stabmons',
|
'1v1', '2v2doubles', 'lcuu', 'freeforall', 'ubersuu', 'almostanyability', 'balancedhackmons', 'godlygift', 'mixandmega', 'sharedpower', 'stabmons',
|
||||||
'12switch', '350cup', 'alphabetcup', 'badnboosted', 'battlefields', 'biomechmons', 'camomons', 'categoryswap',
|
'12switch', '350cup', 'alphabetcup', 'badnboosted', 'battlefields', 'biomechmons', 'camomons', 'categoryswap', 'categoryswap',
|
||||||
'convergence', 'crossevolution', 'ferventimpersonation', 'foresighters', 'formemons', 'fortemons', 'franticfusions',
|
'convergence', 'crossevolution', 'categoryswap', 'ferventimpersonation', 'foresighters', 'formemons', 'fortemons', 'franticfusions',
|
||||||
'fullpotential', 'inheritance', 'inverse', 'natureswap', 'partnersincrime', 'passiveaggressive', 'pokebilities',
|
'fullpotential', 'inheritance', 'inverse', 'natureswap', 'partnersincrime', 'passiveaggressive', 'pokebilities',
|
||||||
'pokemoves', 'relayrace', 'revelationmons', 'sharingiscaring', 'teradonation', 'teraoverride', 'thecardgame',
|
'pokemoves', 'relayrace', 'revelationmons', 'sharingiscaring', 'teradonation', 'teraoverride', 'thecardgame',
|
||||||
'thelosersgame', 'trademarked', 'triples', 'typesplit', 'voltturnmayhem', 'nationaldexubersuu', 'nationaldex1v1',
|
'thelosersgame', 'trademarked', 'triples', 'typesplit', 'voltturnmayhem',
|
||||||
'nationaldexaaa', 'nationaldexbh', 'nationaldexgodlygift', 'nationaldexstabmons', 'tiershift',
|
'aaa', 'bh', // natdex abbreviations
|
||||||
|
'tiershift',
|
||||||
]) {
|
]) {
|
||||||
const format = Dex.formats.get(gen + meta);
|
const format = Dex.formats.get(`${gen}${isNatDex ? 'nationaldex' : ''}${meta}`);
|
||||||
if (format.exists && Dex.formats.getRuleTable(format).isBannedSpecies(species)) {
|
if (!format.exists) continue;
|
||||||
if (!metagameBans[meta]) metagameBans[meta] = {};
|
const ruleTable = Dex.formats.getRuleTable(format);
|
||||||
if (Dex.formats.getRuleTable(format).has('megarayquazaclause')) {
|
let banned = ruleTable.isBannedSpecies(species);
|
||||||
metagameBans[meta]['megarayquazaclause'] = 1;
|
if (!banned) {
|
||||||
}
|
const requiredItems = species.requiredItems;
|
||||||
if (species.requiredItems && species.requiredItems.length) {
|
if (requiredItems && requiredItems.length) {
|
||||||
for (const itemName of species.requiredItems) {
|
for (const itemName of requiredItems) {
|
||||||
const item = Dex.items.get(itemName);
|
const item = Dex.items.get(itemName);
|
||||||
if (item.itemUser && item.itemUser.includes(species.name) &&
|
if (((item.itemUser && item.itemUser.includes(species.name)) ||
|
||||||
Dex.formats.getRuleTable(format).isBanned('item:' + item.id)) {
|
(item.megaStone && Object.values(item.megaStone).includes(species.name))
|
||||||
metagameBans[meta][species.id] = 1;
|
) && ruleTable.isBanned('item:' + item.id)) {
|
||||||
}
|
banned = true;
|
||||||
if (item.megaStone && Object.values(item.megaStone).includes(species.name) &&
|
break;
|
||||||
Dex.formats.getRuleTable(format).isBanned('item:' + item.id)) {
|
|
||||||
metagameBans[meta][species.id] = 1;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (species.requiredAbility) {
|
}
|
||||||
const ability = Dex.items.get(species.requiredAbility);
|
if (!banned && species.requiredAbility) {
|
||||||
if (Dex.formats.getRuleTable(format).isBanned('ability:' + ability.id)) {
|
const ability = Dex.abilities.get(species.requiredAbility);
|
||||||
metagameBans[meta][species.id] = 1;
|
banned = ruleTable.isBanned('ability:' + ability.id);
|
||||||
|
}
|
||||||
|
if (banned) {
|
||||||
|
if (!metagameBans[meta]) {
|
||||||
|
metagameBans[meta] = {};
|
||||||
|
if (ruleTable.has('megarayquazaclause')) {
|
||||||
|
metagameBans[meta]['megarayquazaclause'] = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
metagameBans[meta][species.id] = 1;
|
metagameBans[meta][species.id] = 1;
|
||||||
|
|
|
||||||
|
|
@ -1155,22 +1155,19 @@ class BattlePokemonSearch extends BattleTypedSearch<'pokemon'> {
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
const customBanlists = [
|
const customBanlists = [
|
||||||
'1v1', '2v2doubles', 'lcuu', 'freeforall', 'ubersuu', 'almostanyability', 'balancedhackmons', 'godlygift', 'mixandmega',
|
'1v1', '2v2doubles', 'lcuu', 'freeforall', 'ubersuu', 'almostanyability', 'balancedhackmons', 'godlygift', 'mixandmega', 'sharedpower', 'stabmons',
|
||||||
'sharedpower', 'stabmons', '12switch', '350cup', 'alphabetcup', 'badnboosted', 'battlefields', 'biomechmons', 'camomons',
|
'12switch', '350cup', 'alphabetcup', 'badnboosted', 'battlefields', 'biomechmons', 'camomons', 'categoryswap', 'categoryswap',
|
||||||
'categoryswap', 'convergence', 'crossevolution', 'fervetimpersonation', 'foresighters', 'formemons', 'fortemons',
|
'convergence', 'crossevolution', 'categoryswap', 'ferventimpersonation', 'foresighters', 'formemons', 'fortemons', 'franticfusions',
|
||||||
'franticfusions', 'fullpotential', 'inheritance', 'inverse', 'natureswap', 'partnersincrime', 'passiveaggressive',
|
'fullpotential', 'inheritance', 'inverse', 'natureswap', 'partnersincrime', 'passiveaggressive', 'pokebilities',
|
||||||
'pokebilities', 'pokemoves', 'relayrace', 'revelationmons', 'sharingiscaring', 'teradonation', 'teraoverride', 'thecardgame',
|
'pokemoves', 'relayrace', 'revelationmons', 'sharingiscaring', 'teradonation', 'teraoverride', 'thecardgame',
|
||||||
'thelosersgame', 'trademarked', 'triples', 'typesplit', 'voltturnmayhem', 'nationaldexubersuu', 'nationaldex1v1',
|
'thelosersgame', 'trademarked', 'triples', 'typesplit', 'voltturnmayhem',
|
||||||
'nationaldexaaa', 'nationaldexbh', 'nationaldexgodlygift', 'nationaldexstabmons', 'tiershift',
|
'aaa', 'bh', // natdex abbreviations
|
||||||
|
'tiershift',
|
||||||
];
|
];
|
||||||
if (dex.gen >= 6) {
|
if (dex.gen >= 6) {
|
||||||
if (
|
if (customBanlists.includes(format) && table.metagameBans?.[format]) {
|
||||||
(customBanlists.includes(format) && table.metagameBans?.[format]) ||
|
|
||||||
(this.formatType === 'natdex' && customBanlists.includes('nationaldex' + format) &&
|
|
||||||
table.metagameBans?.['nationaldex' + format])) {
|
|
||||||
tierSet = tierSet.filter(([type, id]) => {
|
tierSet = tierSet.filter(([type, id]) => {
|
||||||
if (id in table.metagameBans[format]) return false;
|
if (id in table.metagameBans[format]) return false;
|
||||||
if (this.formatType === 'natdex' && id in table.metagameBans['nationaldex' + format]) return false;
|
|
||||||
if (!this.formatType && dex.gen === 9 &&
|
if (!this.formatType && dex.gen === 9 &&
|
||||||
'miraidon' in table.metagameBans[format] &&
|
'miraidon' in table.metagameBans[format] &&
|
||||||
'calyrexshadow' in table.metagameBans[format] &&
|
'calyrexshadow' in table.metagameBans[format] &&
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user