diff --git a/src/data/pokemon-species.ts b/src/data/pokemon-species.ts index deb3fdbc00e..3a64ab3afac 100644 --- a/src/data/pokemon-species.ts +++ b/src/data/pokemon-species.ts @@ -139,6 +139,13 @@ export abstract class PokemonSpeciesForm { this.genderDiffs = genderDiffs; } + /** + * Method to get the root species id of a Pokemon. + * Magmortar.getRootSpeciesId(true) => Magmar + * Magmortar.getRootSpeciesId(false) => Magby + * @param forStarter boolean to get the nonbaby form of a starter + * @returns The species + */ getRootSpeciesId(forStarter: boolean = false): Species { let ret = this.speciesId; while (pokemonPrevolutions.hasOwnProperty(ret) && (!forStarter || !speciesStarters.hasOwnProperty(ret))) diff --git a/src/ui/pokemon-info-container.ts b/src/ui/pokemon-info-container.ts index 14d7ec35d1b..15f4c567348 100644 --- a/src/ui/pokemon-info-container.ts +++ b/src/ui/pokemon-info-container.ts @@ -164,7 +164,7 @@ export default class PokemonInfoContainer extends Phaser.GameObjects.Container { if (isFusion) this.pokemonFusionShinyIcon.setTint(getVariantTint(pokemon.fusionVariant)); - const starterSpeciesId = pokemon.species.getRootSpeciesId(true); + const starterSpeciesId = pokemon.species.getRootSpeciesId(); const originalIvs: integer[] = this.scene.gameData.dexData[starterSpeciesId].caughtAttr ? this.scene.gameData.dexData[starterSpeciesId].ivs : null;