Skip to content

Commit

Permalink
Import: Support Groudon-Primal & Kyogre-Primal
Browse files Browse the repository at this point in the history
  • Loading branch information
thejetou committed Nov 15, 2023
1 parent b417cdd commit c62762f
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions import/src/set-import.ts
Original file line number Diff line number Diff line change
Expand Up @@ -296,9 +296,17 @@ function similarFormes(
}
}
if (pset.species === 'Rayquaza-Mega' && format &&
(!format.id.includes('balancedhackmons') || format.id.includes('bh'))) {
(!format.id.includes('balancedhackmons') && !format.id.includes('bh'))) {
return ['Rayquaza'] as SpeciesName[];
}
if ((pset.species === 'Groudon' || pset.species === 'Groudon-Primal') &&
pset.item === 'Red Orb') {
return [pset.species === 'Groudon' ? 'Groudon-Primal' : 'Groudon'] as SpeciesName[];
}
if ((pset.species === 'Kyogre' || pset.species === 'Kyogre-Primal') &&
pset.item === 'Blue Orb') {
return [pset.species === 'Kyogre' ? 'Kyogre-Primal' : 'Kyogre'] as SpeciesName[];
}
if (pset.ability === 'Power Construct') {
return ['Zygarde-Complete'] as SpeciesName[];
}
Expand Down Expand Up @@ -380,7 +388,10 @@ async function importGen(
if (!statsIgnore[forme]) statsIgnore[forme] = new Set();
statsIgnore[forme].add(formatID);
if (!calcSets[forme]) calcSets[forme] = {};
if (forme.includes('-Mega')) {
// TODO: Make this check smarter - maybe by return a `diffAbility` bool
// in `similarFormes`?
if (forme.endsWith('-Mega') || forme.startsWith('Groudon') ||
forme.startsWith('Kyogre')) {
const mega = getSpecie(gen, forme);
calcSets[forme][setName] = {...calcSet, ability: mega.abilities[0]};
} else {
Expand Down Expand Up @@ -428,7 +439,8 @@ async function importGen(
continue;
}
if (!calcSets[forme]) calcSets[forme] = {};
if (item.megaEvolves && item.megaStone) {
if (forme.endsWith('-Mega') || forme.startsWith('Groudon') ||
forme.startsWith('Kyogre')) {
const mega = getSpecie(gen, forme);
calcSets[forme][setName] = {...calcSet, ability: mega.abilities[0]};
} else {
Expand Down

0 comments on commit c62762f

Please sign in to comment.