mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-10 18:32:16 +02:00
ribbon correct, vouchers not. currently investigating
This commit is contained in:
parent
991ebba854
commit
a959abcdb8
@ -55,7 +55,7 @@ import { OptionSelectConfig, OptionSelectItem } from "./ui/abstact-option-select
|
|||||||
import { SaveSlotUiMode } from "./ui/save-slot-select-ui-handler";
|
import { SaveSlotUiMode } from "./ui/save-slot-select-ui-handler";
|
||||||
import { fetchDailyRunSeed, getDailyRunStarters } from "./data/daily-run";
|
import { fetchDailyRunSeed, getDailyRunStarters } from "./data/daily-run";
|
||||||
import { GameModes, gameModes } from "./game-mode";
|
import { GameModes, gameModes } from "./game-mode";
|
||||||
import { getPokemonSpecies, speciesStarters } from "./data/pokemon-species";
|
import PokemonSpecies, { getPokemonSpecies, speciesStarters } from "./data/pokemon-species";
|
||||||
import i18next from './plugins/i18n';
|
import i18next from './plugins/i18n';
|
||||||
import { STARTER_FORM_OVERRIDE, STARTER_SPECIES_OVERRIDE } from './overrides';
|
import { STARTER_FORM_OVERRIDE, STARTER_SPECIES_OVERRIDE } from './overrides';
|
||||||
|
|
||||||
@ -3500,8 +3500,11 @@ export class GameOverPhase extends BattlePhase {
|
|||||||
firstClear = this.scene.validateAchv(achvs.CLASSIC_VICTORY);
|
firstClear = this.scene.validateAchv(achvs.CLASSIC_VICTORY);
|
||||||
this.scene.gameData.gameStats.sessionsWon++;
|
this.scene.gameData.gameStats.sessionsWon++;
|
||||||
for (let pokemon of this.scene.getParty()) {
|
for (let pokemon of this.scene.getParty()) {
|
||||||
const speciesId = getPokemonSpecies(pokemon.species.speciesId)
|
this.awardRibbon(pokemon.species);
|
||||||
this.scene.gameData.incrementStarterWinCount(speciesId);
|
|
||||||
|
if (pokemon.species.getRootSpeciesId() != pokemon.species.getRootSpeciesId(true)) {
|
||||||
|
this.awardRibbon(pokemon.species, true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else if (this.scene.gameMode.isDaily && success[1])
|
} else if (this.scene.gameMode.isDaily && success[1])
|
||||||
this.scene.gameData.gameStats.dailyRunSessionsWon++;
|
this.scene.gameData.gameStats.dailyRunSessionsWon++;
|
||||||
@ -3534,6 +3537,16 @@ export class GameOverPhase extends BattlePhase {
|
|||||||
this.scene.unshiftPhase(new UnlockPhase(this.scene, Unlockables.MINI_BLACK_HOLE));
|
this.scene.unshiftPhase(new UnlockPhase(this.scene, Unlockables.MINI_BLACK_HOLE));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
awardRibbon(species: PokemonSpecies, forStarter: boolean = false): void {
|
||||||
|
const speciesId = getPokemonSpecies(species.speciesId)
|
||||||
|
const speciesRibbonCount = this.scene.gameData.incrementRibbonCount(speciesId, forStarter);
|
||||||
|
// first time classic win, award voucher
|
||||||
|
if (speciesRibbonCount === 1) {
|
||||||
|
const rootSpeciesId = species.getRootSpeciesId(true);
|
||||||
|
this.scene.pushPhase(new ModifierRewardPhase(this.scene, modifierTypes.VOUCHER_PLUS));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export class UnlockPhase extends Phase {
|
export class UnlockPhase extends Phase {
|
||||||
|
@ -1079,8 +1079,8 @@ export class GameData {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
incrementStarterWinCount(species: PokemonSpecies): void {
|
incrementRibbonCount(species: PokemonSpecies, forStarter: boolean = false): integer {
|
||||||
const speciesIdToIncrement: Species = species.getRootSpeciesId();
|
const speciesIdToIncrement: Species = species.getRootSpeciesId(forStarter);
|
||||||
|
|
||||||
if (!this.starterData[speciesIdToIncrement].winCount) {
|
if (!this.starterData[speciesIdToIncrement].winCount) {
|
||||||
this.starterData[speciesIdToIncrement].winCount = 0;
|
this.starterData[speciesIdToIncrement].winCount = 0;
|
||||||
@ -1102,8 +1102,7 @@ export class GameData {
|
|||||||
if(ribbonsInStats >= 10)
|
if(ribbonsInStats >= 10)
|
||||||
this.scene.validateAchv(achvs._10_RIBBONS);
|
this.scene.validateAchv(achvs._10_RIBBONS);
|
||||||
|
|
||||||
this.starterData[speciesIdToIncrement].winCount++;
|
return this.starterData[speciesIdToIncrement].winCount++;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
addStarterCandy(species: PokemonSpecies, count: integer): void {
|
addStarterCandy(species: PokemonSpecies, count: integer): void {
|
||||||
|
Loading…
Reference in New Issue
Block a user