mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-20 06:19:29 +02:00
Addressed PigeonBar's comments
This commit is contained in:
parent
10f3ff1ef8
commit
4b5cb44884
@ -291,7 +291,7 @@ export function applyDamageToPokemon(scene: BattleScene, pokemon: PlayerPokemon,
|
|||||||
console.warn("Healing pokemon with `applyDamageToPokemon` is not recommended! Please use `applyHealToPokemon` instead.");
|
console.warn("Healing pokemon with `applyDamageToPokemon` is not recommended! Please use `applyHealToPokemon` instead.");
|
||||||
}
|
}
|
||||||
// If a Pokemon would faint from the damage applied, its HP is instead set to 1.
|
// If a Pokemon would faint from the damage applied, its HP is instead set to 1.
|
||||||
if (pokemon.hp - damage <= 0) {
|
if (pokemon.isAllowedInBattle() && pokemon.hp - damage <= 0) {
|
||||||
damage = pokemon.hp - 1;
|
damage = pokemon.hp - 1;
|
||||||
}
|
}
|
||||||
applyHpChangeToPokemon(scene, pokemon, -damage);
|
applyHpChangeToPokemon(scene, pokemon, -damage);
|
||||||
|
@ -115,12 +115,8 @@ export class GameOverPhase extends BattlePhase {
|
|||||||
this.scene.gameData.gameStats.dailyRunSessionsWon++;
|
this.scene.gameData.gameStats.dailyRunSessionsWon++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.getRunHistoryEntry().then(runHistoryEntry => {
|
|
||||||
this.scene.gameData.saveRunHistory(this.scene, runHistoryEntry, this.victory);
|
|
||||||
});
|
|
||||||
const fadeDuration = this.victory ? 10000 : 5000;
|
|
||||||
this.scene.gameData.saveRunHistory(this.scene, this.scene.gameData.getSessionSaveData(this.scene), this.isVictory);
|
|
||||||
const fadeDuration = this.isVictory ? 10000 : 5000;
|
const fadeDuration = this.isVictory ? 10000 : 5000;
|
||||||
this.scene.fadeOutBgm(fadeDuration, true);
|
this.scene.fadeOutBgm(fadeDuration, true);
|
||||||
const activeBattlers = this.scene.getField().filter(p => p?.isActive(true));
|
const activeBattlers = this.scene.getField().filter(p => p?.isActive(true));
|
||||||
@ -146,8 +142,11 @@ export class GameOverPhase extends BattlePhase {
|
|||||||
this.scene.unshiftPhase(new GameOverModifierRewardPhase(this.scene, modifierTypes.VOUCHER_PREMIUM));
|
this.scene.unshiftPhase(new GameOverModifierRewardPhase(this.scene, modifierTypes.VOUCHER_PREMIUM));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.scene.pushPhase(new PostGameOverPhase(this.scene, endCardPhase));
|
this.getRunHistoryEntry().then(runHistoryEntry => {
|
||||||
this.end();
|
this.scene.gameData.saveRunHistory(this.scene, runHistoryEntry, this.isVictory);
|
||||||
|
this.scene.pushPhase(new PostGameOverPhase(this.scene, endCardPhase));
|
||||||
|
this.end();
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
if (this.isVictory && this.scene.gameMode.isClassic) {
|
if (this.isVictory && this.scene.gameMode.isClassic) {
|
||||||
|
Loading…
Reference in New Issue
Block a user