mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-12-15 06:15:20 +01:00
[Bug] Fix CheckSwitchPhase not appearing on new wave (#6591)
This commit is contained in:
parent
6766940fa1
commit
e5cc11dee7
@ -583,18 +583,22 @@ export class EncounterPhase extends BattlePhase {
|
||||
const phaseManager = globalScene.phaseManager;
|
||||
if (!availablePartyMembers[0].isOnField()) {
|
||||
phaseManager.pushNew("SummonPhase", 0, true, false, checkSwitch);
|
||||
} else if (checkSwitch) {
|
||||
globalScene.phaseManager.pushNew("CheckSwitchPhase", 0, globalScene.currentBattle.double);
|
||||
}
|
||||
|
||||
if (currentBattle.double) {
|
||||
if (availablePartyMembers.length > 1) {
|
||||
phaseManager.pushNew("ToggleDoublePositionPhase", true);
|
||||
if (!availablePartyMembers[1].isOnField()) {
|
||||
phaseManager.pushNew("SummonPhase", 1, true, false, checkSwitch);
|
||||
phaseManager.pushNew("SummonPhase", 1);
|
||||
} else if (checkSwitch) {
|
||||
globalScene.phaseManager.pushNew("CheckSwitchPhase", 1, globalScene.currentBattle.double);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (availablePartyMembers.length > 1 && availablePartyMembers[1].isOnField()) {
|
||||
globalScene.phaseManager.pushNew("ReturnPhase", 1);
|
||||
phaseManager.pushNew("ReturnPhase", 1);
|
||||
}
|
||||
phaseManager.pushNew("ToggleDoublePositionPhase", false);
|
||||
}
|
||||
|
||||
@ -417,6 +417,8 @@ export class MysteryEncounterBattlePhase extends Phase {
|
||||
|
||||
if (!availablePartyMembers[0].isOnField()) {
|
||||
globalScene.phaseManager.pushNew("SummonPhase", 0, true, false, checkSwitch);
|
||||
} else if (checkSwitch) {
|
||||
globalScene.phaseManager.pushNew("CheckSwitchPhase", 0, globalScene.currentBattle.double);
|
||||
}
|
||||
|
||||
if (globalScene.currentBattle.double) {
|
||||
@ -424,6 +426,8 @@ export class MysteryEncounterBattlePhase extends Phase {
|
||||
globalScene.phaseManager.pushNew("ToggleDoublePositionPhase", true);
|
||||
if (!availablePartyMembers[1].isOnField()) {
|
||||
globalScene.phaseManager.pushNew("SummonPhase", 1, true, false, checkSwitch);
|
||||
} else if (checkSwitch) {
|
||||
globalScene.phaseManager.pushNew("CheckSwitchPhase", 0, globalScene.currentBattle.double);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@ -434,6 +438,16 @@ export class MysteryEncounterBattlePhase extends Phase {
|
||||
globalScene.phaseManager.pushNew("ToggleDoublePositionPhase", false);
|
||||
}
|
||||
|
||||
if (encounterMode !== MysteryEncounterMode.TRAINER_BATTLE && !this.disableSwitch) {
|
||||
const minPartySize = globalScene.currentBattle.double ? 2 : 1;
|
||||
if (availablePartyMembers.length > minPartySize) {
|
||||
globalScene.phaseManager.pushNew("CheckSwitchPhase", 0, globalScene.currentBattle.double);
|
||||
if (globalScene.currentBattle.double) {
|
||||
globalScene.phaseManager.pushNew("CheckSwitchPhase", 1, globalScene.currentBattle.double);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.end();
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user