cleaned up to use getRootSpeciesId()

This commit is contained in:
shayebeadlingkl 2024-05-01 14:50:01 -04:00
parent ed6e53df3d
commit 3e6d877168

View File

@ -1080,18 +1080,13 @@ export class GameData {
}
incrementStarterWinCount(species: PokemonSpecies): void {
const hasPrevolution = pokemonPrevolutions.hasOwnProperty(species.speciesId);
const speciesIdToIncrement: Species = species.getRootSpeciesId();
if (hasPrevolution) {
this.incrementStarterWinCount(getPokemonSpecies(pokemonPrevolutions[species.speciesId]));
return;
if (!this.starterData[speciesIdToIncrement].winCount) {
this.starterData[speciesIdToIncrement].winCount = 0;
}
if (!this.starterData[species.speciesId].winCount) {
this.starterData[species.speciesId].winCount = 0;
}
this.starterData[species.speciesId].winCount++;
this.starterData[speciesIdToIncrement].winCount++;
}
addStarterCandy(species: PokemonSpecies, count: integer): void {