mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-06-29 21:12:45 +02:00
Early return when simulated is true
This commit is contained in:
parent
377f596778
commit
92e45fba81
@ -2129,16 +2129,20 @@ export class PostIntimidateStatStageChangeAbAttr extends AbAttr {
|
||||
}
|
||||
|
||||
override apply(pokemon: Pokemon, passive: boolean, simulated:boolean, cancelled: BooleanHolder, args: any[]): void {
|
||||
if (!simulated) {
|
||||
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);
|
||||
}
|
||||
if (simulated) {
|
||||
cancelled.value = this.overwrites;
|
||||
return
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user