fix getEggMoves() helper function

This commit is contained in:
ImperialSympathizer 2024-09-24 13:51:02 -04:00
parent a1d1de2c0d
commit 219215f54c
2 changed files with 4 additions and 1 deletions

View File

@ -260,6 +260,9 @@ export const GlobalTradeSystemEncounter: MysteryEncounter =
if (!tradePokemon.shiny && (!tradePokemon.species.abilityHidden || tradePokemon.abilityIndex < hiddenIndex)) { if (!tradePokemon.shiny && (!tradePokemon.species.abilityHidden || tradePokemon.abilityIndex < hiddenIndex)) {
const eggMoves: Moves[] = tradePokemon.getEggMoves(); const eggMoves: Moves[] = tradePokemon.getEggMoves();
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)) {

View File

@ -1800,7 +1800,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
* @returns list of egg moves * @returns list of egg moves
*/ */
getEggMoves() : Moves[] { getEggMoves() : Moves[] {
return speciesEggMoves[this.species.speciesId]; return speciesEggMoves[this.getSpeciesForm().getRootSpeciesId(true)];
} }
setMove(moveIndex: integer, moveId: Moves): void { setMove(moveIndex: integer, moveId: Moves): void {