mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-20 23:32:19 +02:00
Fix global-trade-system-encounter.ts
This commit is contained in:
parent
24614c0a61
commit
fd0b96c0ed
@ -300,19 +300,18 @@ export const GlobalTradeSystemEncounter: MysteryEncounter = MysteryEncounterBuil
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// If Pokemon is still not shiny or with HA, give the Pokemon a random Common egg move in its moveset
|
// If Pokemon is still not shiny or with HA, give the Pokemon a random Common egg move in its moveset
|
||||||
if (!tradePokemon.shiny && (!tradePokemon.species.abilityHidden || tradePokemon.abilityIndex < hiddenIndex)) {
|
if (!tradePokemon.shiny && (!tradePokemon.species.abilityHidden || tradePokemon.abilityIndex < hiddenIndex)) {
|
||||||
const eggMoves = tradePokemon.getEggMoves();
|
const eggMoves = tradePokemon.getEggMoves();
|
||||||
if (eggMoves) {
|
if (eggMoves) {
|
||||||
// Cannot gen the rare egg move, only 1 of the first 3 common moves
|
// Cannot gen the rare egg move, only 1 of the first 3 common moves
|
||||||
const eggMove = eggMoves[randSeedInt(3)];
|
const eggMove = eggMoves[randSeedInt(3)];
|
||||||
if (!tradePokemon.moveset.some(m => m.moveId === eggMove)) {
|
if (!tradePokemon.moveset.some(m => m.moveId === eggMove)) {
|
||||||
if (tradePokemon.moveset.length < 4) {
|
if (tradePokemon.moveset.length < 4) {
|
||||||
tradePokemon.moveset.push(new PokemonMove(eggMove));
|
tradePokemon.moveset.push(new PokemonMove(eggMove));
|
||||||
} else {
|
} else {
|
||||||
const eggMoveIndex = randSeedInt(4);
|
const eggMoveIndex = randSeedInt(4);
|
||||||
tradePokemon.moveset[eggMoveIndex] = new PokemonMove(eggMove);
|
tradePokemon.moveset[eggMoveIndex] = new PokemonMove(eggMove);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user