Fix ForceLastAttr to properly respect speed order
This commit is contained in:
parent
2a05517010
commit
c1f6303260
|
@ -7670,7 +7670,7 @@ export class ForceLastAttr extends MoveEffectAttr {
|
||||||
const targetMovePhase = target.scene.findPhase<MovePhase>((phase) => phase.pokemon === target);
|
const targetMovePhase = target.scene.findPhase<MovePhase>((phase) => phase.pokemon === target);
|
||||||
if (targetMovePhase && target.scene.tryRemovePhase((phase: MovePhase) => phase.pokemon === target)) {
|
if (targetMovePhase && target.scene.tryRemovePhase((phase: MovePhase) => phase.pokemon === target)) {
|
||||||
const prependPhase = target.scene.findPhase((phase) => [ MovePhase, MoveEndPhase ].every(cls => !(phase instanceof cls))
|
const prependPhase = target.scene.findPhase((phase) => [ MovePhase, MoveEndPhase ].every(cls => !(phase instanceof cls))
|
||||||
|| (phase instanceof MovePhase) && (phase.isForcedLast() && phase.pokemon.getEffectiveStat(Stat.SPD) < user.getEffectiveStat(Stat.SPD)));
|
|| (phase instanceof MovePhase) && (phase.isForcedLast() && phase.pokemon.getEffectiveStat(Stat.SPD) < target.getEffectiveStat(Stat.SPD)));
|
||||||
if (prependPhase) {
|
if (prependPhase) {
|
||||||
target.scene.phaseQueue.splice(target.scene.phaseQueue.indexOf(prependPhase), 0, new MovePhase(target.scene, target, [ ...targetMovePhase.targets ], targetMovePhase.move, false, false, true));
|
target.scene.phaseQueue.splice(target.scene.phaseQueue.indexOf(prependPhase), 0, new MovePhase(target.scene, target, [ ...targetMovePhase.targets ], targetMovePhase.move, false, false, true));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue