Fix ForceLastAttr to properly respect speed order

This commit is contained in:
Dean 2024-12-27 14:35:48 -08:00
parent 2a05517010
commit c1f6303260
1 changed files with 1 additions and 1 deletions
src/data

View File

@ -7670,7 +7670,7 @@ export class ForceLastAttr extends MoveEffectAttr {
const targetMovePhase = target.scene.findPhase<MovePhase>((phase) => 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))
|| (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) {
target.scene.phaseQueue.splice(target.scene.phaseQueue.indexOf(prependPhase), 0, new MovePhase(target.scene, target, [ ...targetMovePhase.targets ], targetMovePhase.move, false, false, true));
}