optimize handleMysteryEncounterVictory
This commit is contained in:
parent
6451eb8049
commit
a862dabcd1
|
@ -522,10 +522,14 @@ export function leaveEncounterWithoutBattle(scene: BattleScene, addHealPhase: bo
|
||||||
|
|
||||||
export function handleMysteryEncounterVictory(scene: BattleScene, addHealPhase: boolean = false) {
|
export function handleMysteryEncounterVictory(scene: BattleScene, addHealPhase: boolean = false) {
|
||||||
const allowedPkm = scene.getParty().filter((pkm) => pkm.isAllowedInBattle());
|
const allowedPkm = scene.getParty().filter((pkm) => pkm.isAllowedInBattle());
|
||||||
|
|
||||||
if (allowedPkm.length === 0) {
|
if (allowedPkm.length === 0) {
|
||||||
scene.clearPhaseQueue();
|
scene.clearPhaseQueue();
|
||||||
scene.unshiftPhase(new GameOverPhase(scene));
|
scene.unshiftPhase(new GameOverPhase(scene));
|
||||||
} else if (scene.currentBattle.mysteryEncounter.encounterVariant === MysteryEncounterVariant.SAFARI_BATTLE) {
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (scene.currentBattle.mysteryEncounter.encounterVariant === MysteryEncounterVariant.SAFARI_BATTLE) {
|
||||||
scene.pushPhase(new MysteryEncounterRewardsPhase(scene, addHealPhase));
|
scene.pushPhase(new MysteryEncounterRewardsPhase(scene, addHealPhase));
|
||||||
} else if (scene.currentBattle.mysteryEncounter.encounterVariant === MysteryEncounterVariant.NO_BATTLE) {
|
} else if (scene.currentBattle.mysteryEncounter.encounterVariant === MysteryEncounterVariant.NO_BATTLE) {
|
||||||
scene.pushPhase(new EggLapsePhase(scene));
|
scene.pushPhase(new EggLapsePhase(scene));
|
||||||
|
|
Loading…
Reference in New Issue