mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-05 16:02:20 +02:00
moves count to starterData, increments on win
This commit is contained in:
parent
2afa779276
commit
11f36c14de
@ -3499,6 +3499,10 @@ export class GameOverPhase extends BattlePhase {
|
||||
if (this.scene.gameMode.isClassic) {
|
||||
firstClear = this.scene.validateAchv(achvs.CLASSIC_VICTORY);
|
||||
this.scene.gameData.gameStats.sessionsWon++;
|
||||
for (let pokemon of this.scene.getParty()) {
|
||||
const speciesId = getPokemonSpecies(pokemon.species.speciesId)
|
||||
this.scene.gameData.incrementStarterWinCount(speciesId);
|
||||
}
|
||||
} else if (this.scene.gameMode.isDaily && success[1])
|
||||
this.scene.gameData.gameStats.dailyRunSessionsWon++;
|
||||
}
|
||||
|
@ -128,7 +128,6 @@ export interface DexEntry {
|
||||
seenCount: integer;
|
||||
caughtCount: integer;
|
||||
hatchedCount: integer;
|
||||
winCount: integer;
|
||||
ivs: integer[];
|
||||
}
|
||||
|
||||
@ -173,6 +172,7 @@ export interface StarterDataEntry {
|
||||
abilityAttr: integer;
|
||||
passiveAttr: integer;
|
||||
valueReduction: integer;
|
||||
winCount: integer;
|
||||
}
|
||||
|
||||
export interface StarterData {
|
||||
@ -952,7 +952,7 @@ export class GameData {
|
||||
|
||||
for (let species of allSpecies) {
|
||||
data[species.speciesId] = {
|
||||
seenAttr: 0n, caughtAttr: 0n, natureAttr: 0, seenCount: 0, caughtCount: 0, hatchedCount: 0, winCount: 0, ivs: [ 0, 0, 0, 0, 0, 0 ]
|
||||
seenAttr: 0n, caughtAttr: 0n, natureAttr: 0, seenCount: 0, caughtCount: 0, hatchedCount: 0, ivs: [ 0, 0, 0, 0, 0, 0 ]
|
||||
};
|
||||
}
|
||||
|
||||
@ -991,7 +991,8 @@ export class GameData {
|
||||
candyCount: 0,
|
||||
abilityAttr: defaultStarterSpecies.includes(speciesId) ? AbilityAttr.ABILITY_1 : 0,
|
||||
passiveAttr: 0,
|
||||
valueReduction: 0
|
||||
valueReduction: 0,
|
||||
winCount: 0
|
||||
};
|
||||
}
|
||||
|
||||
@ -1078,6 +1079,16 @@ export class GameData {
|
||||
});
|
||||
}
|
||||
|
||||
incrementStarterWinCount(species: PokemonSpecies):void {
|
||||
const speciesWinCount = this.starterData[species.speciesId].winCount;
|
||||
|
||||
if(Number.isNaN(speciesWinCount))
|
||||
this.starterData[species.speciesId].winCount = 0;
|
||||
|
||||
this.starterData[species.speciesId].winCount++;
|
||||
console.log(this.starterData[species.speciesId].winCount);
|
||||
}
|
||||
|
||||
addStarterCandy(species: PokemonSpecies, count: integer): void {
|
||||
this.scene.candyBar.showStarterSpeciesCandy(species.speciesId, count);
|
||||
this.starterData[species.speciesId].candyCount += count;
|
||||
|
@ -1188,7 +1188,7 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
|
||||
this.shinyIcons[s][v].setTint(getVariantTint(speciesVariants[v] === DexAttr.DEFAULT_VARIANT ? 0 : speciesVariants[v] === DexAttr.VARIANT_2 ? 1 : 2));
|
||||
}
|
||||
this.hiddenAbilityIcons[s].setVisible(slotVisible && !!this.scene.gameData.dexData[speciesId].caughtAttr && !!(this.scene.gameData.starterData[speciesId].abilityAttr & 4));
|
||||
this.classicWinIcons[s].setVisible(slotVisible && this.scene.gameData.dexData[speciesId].winCount > 0);
|
||||
this.classicWinIcons[s].setVisible(slotVisible && this.scene.gameData.starterData[speciesId].winCount > 0);
|
||||
}
|
||||
} else {
|
||||
changed = super.setCursor(cursor);
|
||||
|
Loading…
Reference in New Issue
Block a user