mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-04 07:22:19 +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) {
|
public setMoveTimingModifier(condition: PhaseConditionFunc, modifier: MovePhaseTimingModifier) {
|
||||||
const movePhaseQueue: MovePhasePriorityQueue = this.dynamicPhaseMap.get("MovePhase") as MovePhasePriorityQueue;
|
this.getMovePhaseQueue().setTimingModifier(condition, modifier);
|
||||||
movePhaseQueue.setTimingModifier(condition, modifier);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public setMoveForPhase(condition: PhaseConditionFunc, move: PokemonMove) {
|
public setMoveForPhase(condition: PhaseConditionFunc, move: PokemonMove) {
|
||||||
(this.dynamicPhaseMap.get("MovePhase") as MovePhasePriorityQueue).setMoveForPhase(condition, move);
|
this.getMovePhaseQueue().setMoveForPhase(condition, move);
|
||||||
}
|
}
|
||||||
|
|
||||||
public setMoveOrder(order: BattlerIndex[]) {
|
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;
|
this.setOrder = order;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override clear(): void {
|
||||||
|
this.setOrder = undefined;
|
||||||
|
super.clear();
|
||||||
|
}
|
||||||
|
|
||||||
private sortPostSpeed(): void {
|
private sortPostSpeed(): void {
|
||||||
this.queue.sort((a: MovePhase, b: MovePhase) => {
|
this.queue.sort((a: MovePhase, b: MovePhase) => {
|
||||||
const priority = [a, b].map(movePhase => {
|
const priority = [a, b].map(movePhase => {
|
||||||
|
Loading…
Reference in New Issue
Block a user