Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Determine primalness before making the set #66

Open
wants to merge 2 commits into
base: patch-13
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 14 additions & 15 deletions data/random-teams.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,6 @@ class RandomTeams extends Dex.ModdedDex {
let index = this.random(length);
return this.fastPop(list, index);
}
checkBattleForme(template) {
// If the Pokémon has a Mega or Primal alt forme, that's its preferred battle forme.
// No randomization, no choice. We are just checking its existence.
// Returns a Pokémon template for further details.
if (!template.otherFormes) return null;
let firstForme = this.getTemplate(template.otherFormes[0]);
if (firstForme.isMega || firstForme.isPrimal) return firstForme;
return null;
}
// checkAbilities(selectedAbilities, defaultAbilities) {
// if (!selectedAbilities.length) return true;
// let selectedAbility = selectedAbilities.pop();
Expand Down Expand Up @@ -514,8 +505,8 @@ class RandomTeams extends Dex.ModdedDex {
// Only change the species. The template has custom moves, and may have different typing and requirements.
species = template.baseSpecies;
}
let battleForme = this.checkBattleForme(template);
if (battleForme && battleForme.randomBattleMoves && (battleForme.isMega ? !teamDetails.megaStone : this.random(2))) {
let battleForme = this.getTemplate(template.otherFormes[0]);
if (battleForme && battleForme.randomBattleMoves && battleForme.isMega && !teamDetails.megaStone) {
template = this.getTemplate(template.otherFormes.length >= 2 ? template.otherFormes[this.random(template.otherFormes.length)] : template.otherFormes[0]);
}

Expand Down Expand Up @@ -1527,7 +1518,7 @@ class RandomTeams extends Dex.ModdedDex {
if (template.battleOnly) types = this.getTemplate(template.baseSpecies).types;
if (types.indexOf(type) < 0) continue;
}
if (template.gen <= this.gen && !excludedTiers[template.tier] && !template.isMega && !template.isPrimal && !template.isNonstandard && template.randomBattleMoves) {
if (template.gen <= this.gen && !excludedTiers[template.tier] && !template.isMega && !template.isNonstandard && template.randomBattleMoves) {
pokemonPool.push(id);
}
}
Expand Down Expand Up @@ -1585,7 +1576,7 @@ class RandomTeams extends Dex.ModdedDex {
case 'Castform': case 'Gourgeist': case 'Oricorio':
if (this.random(4) >= 1) continue;
break;
case 'Basculin': case 'Cherrim': case 'Greninja': case 'Hoopa': case 'Meloetta': case 'Meowstic':
case 'Basculin': case 'Cherrim': case 'Greninja': case 'Groudon': case 'Hoopa': case 'Kyogre': case 'Meloetta': case 'Meowstic':
if (this.random(2) >= 1) continue;
break;
}
Expand Down Expand Up @@ -1714,8 +1705,8 @@ class RandomTeams extends Dex.ModdedDex {
// Only change the species. The template has custom moves, and may have different typing and requirements.
species = template.baseSpecies;
}
let battleForme = this.checkBattleForme(template);
if (battleForme && (battleForme.isMega ? !teamDetails.megaStone : this.random(2))) {
let battleForme = this.getTemplate(template.otherFormes[0]);
if (battleForme && battleForme.isMega && !teamDetails.megaStone) {
template = this.getTemplate(template.otherFormes.length >= 2 ? template.otherFormes[this.random(template.otherFormes.length)] : template.otherFormes[0]);
}

Expand Down Expand Up @@ -2265,6 +2256,14 @@ class RandomTeams extends Dex.ModdedDex {
// If it doesn't qualify for Technician, Skill Link is useless on it
// Might as well give it Pickup just in case
ability = 'Pickup';
} else if (template.id === 'aurorus' && ability === 'Snow Warning' && hasMove['hypervoice']) {
for (let i = 0; i < moves.length; i++) {
if (moves[i] === 'hypervoice') {
moves[i] = 'blizzard';
counter['Normal'] = 0;
break;
}
}
} else if (template.baseSpecies === 'Basculin') {
ability = 'Adaptability';
} else if (template.id === 'gligar') {
Expand Down