mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-25 00:39:27 +02:00
fix Uncommon Breed ME crash
This commit is contained in:
parent
2723d11453
commit
a9645b80fc
@ -60,17 +60,18 @@ export const UncommonBreedEncounter: MysteryEncounter =
|
||||
const eggMoveIndex = randSeedInt(4);
|
||||
const randomEggMove: Moves = eggMoves[eggMoveIndex];
|
||||
encounter.misc = {
|
||||
eggMove: randomEggMove
|
||||
eggMove: randomEggMove,
|
||||
pokemon: pokemon
|
||||
};
|
||||
if (pokemon.moveset.length < 4) {
|
||||
pokemon.moveset.push(new PokemonMove(randomEggMove));
|
||||
} else {
|
||||
pokemon.moveset[0] = new PokemonMove(randomEggMove);
|
||||
}
|
||||
} else {
|
||||
encounter.misc.pokemon = pokemon;
|
||||
}
|
||||
|
||||
encounter.misc.pokemon = pokemon;
|
||||
|
||||
// Defense/Spd buffs below wave 50, +1 to all stats otherwise
|
||||
const statChangesForBattle: (Stat.ATK | Stat.DEF | Stat.SPATK | Stat.SPDEF | Stat.SPD | Stat.ACC | Stat.EVA)[] = scene.currentBattle.waveIndex < 50 ?
|
||||
[Stat.DEF, Stat.SPDEF, Stat.SPD] :
|
||||
|
@ -210,10 +210,10 @@ export function getRandomSpeciesByStarterTier(starterTiers: number | [number, nu
|
||||
.map(s => [parseInt(s) as Species, speciesStarters[s] as number])
|
||||
.filter(s => {
|
||||
const pokemonSpecies = getPokemonSpecies(s[0]);
|
||||
return pokemonSpecies && (!excludedSpecies || !excludedSpecies.includes(s[0])
|
||||
return pokemonSpecies && (!excludedSpecies || !excludedSpecies.includes(s[0]))
|
||||
&& (allowSubLegendary || !pokemonSpecies.subLegendary)
|
||||
&& (allowLegendary || !pokemonSpecies.legendary)
|
||||
&& (allowMythical || !pokemonSpecies.mythical));
|
||||
&& (allowMythical || !pokemonSpecies.mythical);
|
||||
})
|
||||
.map(s => [getPokemonSpecies(s[0]), s[1]]);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user