mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-05 16:02:20 +02:00
cleaned up to use getRootSpeciesId()
This commit is contained in:
parent
ed6e53df3d
commit
3e6d877168
@ -1080,18 +1080,13 @@ export class GameData {
|
|||||||
}
|
}
|
||||||
|
|
||||||
incrementStarterWinCount(species: PokemonSpecies): void {
|
incrementStarterWinCount(species: PokemonSpecies): void {
|
||||||
const hasPrevolution = pokemonPrevolutions.hasOwnProperty(species.speciesId);
|
const speciesIdToIncrement: Species = species.getRootSpeciesId();
|
||||||
|
|
||||||
if (hasPrevolution) {
|
if (!this.starterData[speciesIdToIncrement].winCount) {
|
||||||
this.incrementStarterWinCount(getPokemonSpecies(pokemonPrevolutions[species.speciesId]));
|
this.starterData[speciesIdToIncrement].winCount = 0;
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.starterData[species.speciesId].winCount) {
|
this.starterData[speciesIdToIncrement].winCount++;
|
||||||
this.starterData[species.speciesId].winCount = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.starterData[species.speciesId].winCount++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
addStarterCandy(species: PokemonSpecies, count: integer): void {
|
addStarterCandy(species: PokemonSpecies, count: integer): void {
|
||||||
|
Loading…
Reference in New Issue
Block a user