mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-04 07:22:19 +02:00
Fix postsummonphases being shuffled (need to handle speed ties differently here)
This commit is contained in:
parent
78f0b5d853
commit
9b9cd3a522
@ -1,6 +1,7 @@
|
|||||||
import { PostSummonActivateAbilityPhase } from "#app/phases/post-summon-activate-ability-phase";
|
import { PostSummonActivateAbilityPhase } from "#app/phases/post-summon-activate-ability-phase";
|
||||||
import type { PostSummonPhase } from "#app/phases/post-summon-phase";
|
import type { PostSummonPhase } from "#app/phases/post-summon-phase";
|
||||||
import { PokemonPhasePriorityQueue } from "#app/queues/pokemon-phase-priority-queue";
|
import { PokemonPhasePriorityQueue } from "#app/queues/pokemon-phase-priority-queue";
|
||||||
|
import { sortInSpeedOrder } from "#app/utils/speed-order";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Priority Queue for {@linkcode PostSummonPhase} and {@linkcode PostSummonActivateAbilityPhase}
|
* Priority Queue for {@linkcode PostSummonPhase} and {@linkcode PostSummonActivateAbilityPhase}
|
||||||
@ -10,7 +11,7 @@ import { PokemonPhasePriorityQueue } from "#app/queues/pokemon-phase-priority-qu
|
|||||||
|
|
||||||
export class PostSummonPhasePriorityQueue extends PokemonPhasePriorityQueue<PostSummonPhase> {
|
export class PostSummonPhasePriorityQueue extends PokemonPhasePriorityQueue<PostSummonPhase> {
|
||||||
public override reorder(): void {
|
public override reorder(): void {
|
||||||
super.reorder();
|
this.queue = sortInSpeedOrder(this.queue, false);
|
||||||
this.queue.sort((phaseA: PostSummonPhase, phaseB: PostSummonPhase) => {
|
this.queue.sort((phaseA: PostSummonPhase, phaseB: PostSummonPhase) => {
|
||||||
return phaseB.getPriority() - phaseA.getPriority();
|
return phaseB.getPriority() - phaseA.getPriority();
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user