Early return when simulated is true

This commit is contained in:
dobin 2025-06-06 14:58:26 +09:00
parent 377f596778
commit 92e45fba81

View File

@ -2129,16 +2129,20 @@ export class PostIntimidateStatStageChangeAbAttr extends AbAttr {
} }
override apply(pokemon: Pokemon, passive: boolean, simulated:boolean, cancelled: BooleanHolder, args: any[]): void { override apply(pokemon: Pokemon, passive: boolean, simulated:boolean, cancelled: BooleanHolder, args: any[]): void {
if (!simulated) { if (simulated) {
const newStatStageChangePhase = new StatStageChangePhase(pokemon.getBattlerIndex(), false, this.stats, this.stages) cancelled.value = this.overwrites;
if (globalScene.findPhase(m => m instanceof MovePhase)) { return
globalScene.prependToPhase(newStatStageChangePhase, MovePhase)
} else if (globalScene.findPhase(m => m instanceof SwitchSummonPhase)) {
globalScene.prependToPhase(newStatStageChangePhase, SwitchSummonPhase)
} else {
globalScene.pushPhase(newStatStageChangePhase);
}
} }
const newStatStageChangePhase = new StatStageChangePhase(pokemon.getBattlerIndex(), false, this.stats, this.stages)
if (globalScene.findPhase(m => m instanceof MovePhase)) {
globalScene.prependToPhase(newStatStageChangePhase, MovePhase)
} else if (globalScene.findPhase(m => m instanceof SwitchSummonPhase)) {
globalScene.prependToPhase(newStatStageChangePhase, SwitchSummonPhase)
} else {
globalScene.pushPhase(newStatStageChangePhase);
}
cancelled.value = this.overwrites; cancelled.value = this.overwrites;
} }
} }