From 219215f54c9e2e52a36e67685d1aa2b5f2a40587 Mon Sep 17 00:00:00 2001 From: ImperialSympathizer Date: Tue, 24 Sep 2024 13:51:02 -0400 Subject: [PATCH] fix getEggMoves() helper function --- .../encounters/global-trade-system-encounter.ts | 3 +++ src/field/pokemon.ts | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/data/mystery-encounters/encounters/global-trade-system-encounter.ts b/src/data/mystery-encounters/encounters/global-trade-system-encounter.ts index 9da54e60612..99be66b820f 100644 --- a/src/data/mystery-encounters/encounters/global-trade-system-encounter.ts +++ b/src/data/mystery-encounters/encounters/global-trade-system-encounter.ts @@ -260,6 +260,9 @@ export const GlobalTradeSystemEncounter: MysteryEncounter = if (!tradePokemon.shiny && (!tradePokemon.species.abilityHidden || tradePokemon.abilityIndex < hiddenIndex)) { const eggMoves: Moves[] = tradePokemon.getEggMoves(); + if (eggMoves) { + + } // Cannot gen the rare egg move, only 1 of the first 3 common moves const eggMove = eggMoves[randSeedInt(3)]; if (!tradePokemon.moveset.some(m => m?.moveId === eggMove)) { diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index bf2c123fa71..f1183fa579e 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -1800,7 +1800,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { * @returns list of egg moves */ getEggMoves() : Moves[] { - return speciesEggMoves[this.species.speciesId]; + return speciesEggMoves[this.getSpeciesForm().getRootSpeciesId(true)]; } setMove(moveIndex: integer, moveId: Moves): void {