mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-03 23:12:20 +02:00
Fix move order persisting through tests
This commit is contained in:
parent
70edead47e
commit
1441cf9171
@ -55,15 +55,18 @@ export class DynamicQueueManager {
|
||||
}
|
||||
|
||||
public setMoveTimingModifier(condition: PhaseConditionFunc, modifier: MovePhaseTimingModifier) {
|
||||
const movePhaseQueue: MovePhasePriorityQueue = this.dynamicPhaseMap.get("MovePhase") as MovePhasePriorityQueue;
|
||||
movePhaseQueue.setTimingModifier(condition, modifier);
|
||||
this.getMovePhaseQueue().setTimingModifier(condition, modifier);
|
||||
}
|
||||
|
||||
public setMoveForPhase(condition: PhaseConditionFunc, move: PokemonMove) {
|
||||
(this.dynamicPhaseMap.get("MovePhase") as MovePhasePriorityQueue).setMoveForPhase(condition, move);
|
||||
this.getMovePhaseQueue().setMoveForPhase(condition, move);
|
||||
}
|
||||
|
||||
public setMoveOrder(order: BattlerIndex[]) {
|
||||
(this.dynamicPhaseMap.get("MovePhase") as MovePhasePriorityQueue).setMoveOrder(order);
|
||||
this.getMovePhaseQueue().setMoveOrder(order);
|
||||
}
|
||||
|
||||
private getMovePhaseQueue(): MovePhasePriorityQueue {
|
||||
return this.dynamicPhaseMap.get("MovePhase") as MovePhasePriorityQueue;
|
||||
}
|
||||
}
|
||||
|
@ -30,6 +30,11 @@ export class MovePhasePriorityQueue extends PokemonPhasePriorityQueue<MovePhase>
|
||||
this.setOrder = order;
|
||||
}
|
||||
|
||||
public override clear(): void {
|
||||
this.setOrder = undefined;
|
||||
super.clear();
|
||||
}
|
||||
|
||||
private sortPostSpeed(): void {
|
||||
this.queue.sort((a: MovePhase, b: MovePhase) => {
|
||||
const priority = [a, b].map(movePhase => {
|
||||
|
Loading…
Reference in New Issue
Block a user