mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-21 06:49:35 +02:00
[balance] Training session ME does not update Seen/Defeated GameStats
This commit is contained in:
parent
9ac6033e4e
commit
37392d9466
@ -37,6 +37,7 @@ export const TrainingSessionEncounter: MysteryEncounter =
|
||||
.withScenePartySizeRequirement(2, 6, true) // Must have at least 2 unfainted pokemon in party
|
||||
.withFleeAllowed(false)
|
||||
.withHideWildIntroMessage(true)
|
||||
.withPreventGameStatsUpdates(true) // Do not count the Pokemon as seen or defeated since it is ours
|
||||
.withIntroSpriteConfigs([
|
||||
{
|
||||
spriteKey: "training_session_gear",
|
||||
|
@ -53,6 +53,7 @@ export interface IMysteryEncounter {
|
||||
hasBattleAnimationsWithoutTargets: boolean;
|
||||
skipEnemyBattleTurns: boolean;
|
||||
skipToFightInput: boolean;
|
||||
preventGameStatsUpdates: boolean;
|
||||
|
||||
onInit?: (scene: BattleScene) => boolean;
|
||||
onVisualsStart?: (scene: BattleScene) => boolean;
|
||||
@ -150,6 +151,10 @@ export default class MysteryEncounter implements IMysteryEncounter {
|
||||
* If true, will skip COMMAND input and go straight to FIGHT (move select) input menu
|
||||
*/
|
||||
skipToFightInput: boolean;
|
||||
/**
|
||||
* If true, will prevent updating {@linkcode GameStats} for encountering and/or defeating Pokemon
|
||||
*/
|
||||
preventGameStatsUpdates: boolean;
|
||||
|
||||
// #region Event callback functions
|
||||
|
||||
@ -548,6 +553,7 @@ export class MysteryEncounterBuilder implements Partial<IMysteryEncounter> {
|
||||
hasBattleAnimationsWithoutTargets: boolean = false;
|
||||
skipEnemyBattleTurns: boolean = false;
|
||||
skipToFightInput: boolean = false;
|
||||
preventGameStatsUpdates: boolean = false;
|
||||
maxAllowedEncounters: number = 3;
|
||||
expMultiplier: number = 1;
|
||||
|
||||
@ -735,6 +741,14 @@ export class MysteryEncounterBuilder implements Partial<IMysteryEncounter> {
|
||||
return Object.assign(this, { skipToFightInput });
|
||||
}
|
||||
|
||||
/**
|
||||
* If true, will prevent updating {@linkcode GameStats} for encountering and/or defeating Pokemon
|
||||
* Default `false`
|
||||
*/
|
||||
withPreventGameStatsUpdates(preventGameStatsUpdates: boolean): this & Required<Pick<IMysteryEncounter, "preventGameStatsUpdates">> {
|
||||
return Object.assign(this, { preventGameStatsUpdates });
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the maximum number of times that an encounter can spawn in a given Classic run
|
||||
* @param maxAllowedEncounters
|
||||
|
@ -25,12 +25,17 @@ export class VictoryPhase extends PokemonPhase {
|
||||
start() {
|
||||
super.start();
|
||||
|
||||
this.scene.gameData.gameStats.pokemonDefeated++;
|
||||
const isMysteryEncounter = this.scene.currentBattle.isBattleMysteryEncounter();
|
||||
|
||||
// update Pokemon defeated count except for MEs that disable it
|
||||
if (!isMysteryEncounter || !this.scene.currentBattle.mysteryEncounter?.preventGameStatsUpdates) {
|
||||
this.scene.gameData.gameStats.pokemonDefeated++;
|
||||
}
|
||||
|
||||
const expValue = this.getPokemon().getExpValue();
|
||||
this.scene.applyPartyExp(expValue, true);
|
||||
|
||||
if (this.scene.currentBattle.isBattleMysteryEncounter()) {
|
||||
if (isMysteryEncounter) {
|
||||
handleMysteryEncounterVictory(this.scene, false, this.isExpOnly);
|
||||
return this.end();
|
||||
}
|
||||
|
@ -1569,6 +1569,10 @@ export class GameData {
|
||||
}
|
||||
|
||||
setPokemonSeen(pokemon: Pokemon, incrementCount: boolean = true, trainer: boolean = false): void {
|
||||
// Some Mystery Encounters block updates to these stats
|
||||
if (this.scene.currentBattle?.isBattleMysteryEncounter() && this.scene.currentBattle.mysteryEncounter?.preventGameStatsUpdates) {
|
||||
return;
|
||||
}
|
||||
const dexEntry = this.dexData[pokemon.species.speciesId];
|
||||
dexEntry.seenAttr |= pokemon.getDexAttr();
|
||||
if (incrementCount) {
|
||||
|
Loading…
Reference in New Issue
Block a user