Re-implement switch out softlock with double rewards bug fixed

pull/16/head
Flashfyre 2024-03-07 08:42:04 -05:00
parent d18eba4df8
commit 64f6c9de09
1 changed files with 2 additions and 2 deletions

View File

@ -1774,7 +1774,7 @@ export class BattleEndPhase extends BattlePhase {
pokemon.resetBattleSummonData(); pokemon.resetBattleSummonData();
} }
for (let pokemon of this.scene.getParty()) for (let pokemon of this.scene.getParty().filter(p => !p.isFainted()))
applyPostBattleAbAttrs(PostBattleAbAttr, pokemon); applyPostBattleAbAttrs(PostBattleAbAttr, pokemon);
this.scene.clearEnemyHeldItemModifiers(); this.scene.clearEnemyHeldItemModifiers();
@ -2806,7 +2806,7 @@ export class VictoryPhase extends PokemonPhase {
} }
} }
if (!this.scene.getEnemyParty().filter(p => !p?.isFainted(true)).length) { if (!this.scene.getEnemyParty().find(p => this.scene.currentBattle.battleType ? !p?.isFainted(true) : p.isOnField())) {
this.scene.pushPhase(new BattleEndPhase(this.scene)); this.scene.pushPhase(new BattleEndPhase(this.scene));
if (this.scene.currentBattle.battleType === BattleType.TRAINER) if (this.scene.currentBattle.battleType === BattleType.TRAINER)
this.scene.pushPhase(new TrainerVictoryPhase(this.scene)); this.scene.pushPhase(new TrainerVictoryPhase(this.scene));