pokerogue/src
Dean 87e6095a00
[Misc/Feature] Add dynamic turn order (#6036)
* Add new priority queues

* Add dynamic queue manager

* Add timing modifier and fix post speed ordering

* Make `phaseQueue` private

* Fix `gameManager.setTurnOrder`

* Update `findPhase` to also check dynamic queues

* Modify existing phase manager methods to check dynamic queues

* Fix move order persisting through tests

* Fix magic coat/bounce

* Use append for magic coat/bounce

* Remove `getSpeedOrder` from `TurnStartPhase`, fix references to `getCommandOrder` in tests

* Fix round queuing last instead of next

* Add quick draw application

* Add quick claw activation

* Fix turn order tracking

* Add move header queue to fix ordering

* Fix abilities activating immediately on summon

* Fix `postsummonphases` being shuffled (need to handle speed ties differently here)

* Update speed order function

* Add `StaticSwitchSummonPhase`

* Fix magic coat/bounce error from conflict resolution

* Remove conditional queue

* Fix dancer and baton pass tests

* Automatically queue consecutive Pokémon phases as dynamic

* Move turn end phases queuing back to `TurnStartPhase`

* Fix `LearnMovePhase`

* Remove `PrependSplice`

* Move DQM to phase manager

* Fix various phases being pushed instead of unshifted

* Remove `StaticSwitchSummonPhase`

* Ensure the top queue is always at length - 1

* Fix encounter `PostSummonPhase`s and Revival Blessing

* Fix move headers

* Remove implicit ordering from DQM

* Fix `PostSummonPhase`s in encounters running too early

* Fix `tryRemovePhase` usages

* Add `MovePhase` after `MoveEndPhase` automatically

* Implement an `inSpeedOrder` function

* Merge fixes

* Fix encounter rewards

* Defer `FaintPhase`s where splice was used previously

* Separate speed order utils to avoid circular imports

* Temporarily disable lunar dance test

* Simplify deferral

* Remove move priority modifier

* Fix TS errors in code files

* Fix ts errors in tests

* Fix more test files

* Fix postsummon + checkswitch ability activations

* Fix `removeAll`

* Reposition `positionalTagPhase`

* Re-add `startCurrentPhase`

* Avoid overwriting `currentPhase` after `turnStart`

* Delete `switchSummonPhasePriorityQueue`

* Update `phase-manager.ts`

* Remove uses of `isNullOrUndefined`

* Rename deferral methods

* Update docs and use `getPlayerField(true)` in turn start phase

* Use `.getEnemyField(true)`

* Update docs for post summon phase priority queue (psppq)

* Update speed order utils

* Remove null from `nextPhase`

* Update move phase timing modifier docs

* Remove mention of phases from base priority queue class

* Remove and replace `applyInSpeedOrder`

* Don't sort weather effect phases

* Order priority queues before removing

- Add some `readonly` and `public` modifiers

- Remove unused `queuedPhases` field from `MoveEffectPhase`

* Fix linting in `phase-manager.ts`

* Remove unnecessary turn order modification in Rage Fist test

---------

Co-authored-by: Bertie690 <136088738+Bertie690@users.noreply.github.com>
Co-authored-by: Sirz Benjie <142067137+SirzBenjie@users.noreply.github.com>
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
2025-09-20 17:49:40 -05:00
..
@types [Misc/Feature] Add dynamic turn order (#6036) 2025-09-20 17:49:40 -05:00
ai [Tests][Bug][Beta] Fix ditto bug and add unit tests (#6559) 2025-09-15 23:26:57 -05:00
configs/inputs [Dev] Migrated to Biome 2.2.3, added more rules (#6259) 2025-09-08 10:35:18 -05:00
constants [Bug] [Docs] Fix @module tags (#6557) 2025-09-14 22:35:12 -05:00
data [Misc/Feature] Add dynamic turn order (#6036) 2025-09-20 17:49:40 -05:00
enums [Misc/Feature] Add dynamic turn order (#6036) 2025-09-20 17:49:40 -05:00
events [UI/UX] Show correct max duration in flyout (#6566) 2025-09-18 13:35:22 -07:00
field [Misc/Feature] Add dynamic turn order (#6036) 2025-09-20 17:49:40 -05:00
global-vars [Refactor] Merged interfaces/ into @types/; removed runtime orphan modules 2025-06-07 17:28:01 -07:00
init [Misc] Simplifying imports of UI files (#6542) 2025-09-11 00:30:17 -07:00
modifier [Misc/Feature] Add dynamic turn order (#6036) 2025-09-20 17:49:40 -05:00
phases [Misc/Feature] Add dynamic turn order (#6036) 2025-09-20 17:49:40 -05:00
pipelines [Dev] Migrated to Biome 2.2.3, added more rules (#6259) 2025-09-08 10:35:18 -05:00
plugins [Misc] Simplifying imports of UI files (#6542) 2025-09-11 00:30:17 -07:00
queues [Misc/Feature] Add dynamic turn order (#6036) 2025-09-20 17:49:40 -05:00
sprites [Refactor] Remove isNullOrUndefined in favor of loose check against null (#6549) 2025-09-12 14:53:27 -05:00
system [UI/UX] Show correct max duration in flyout (#6566) 2025-09-18 13:35:22 -07:00
typings [Test] Port over + augment remaining test matchers from pkty (#6159) 2025-08-02 15:35:06 -07:00
ui [Move] Fully implement Healing wish (/Lunar Dance) and remove nextCommandPhaseQueue (#6027) 2025-09-20 17:32:31 -05:00
utils [Misc/Feature] Add dynamic turn order (#6036) 2025-09-20 17:49:40 -05:00
account.ts [Bug] [Beta] Fix renaming runs (#6268) 2025-08-14 16:57:01 -05:00
battle-scene.ts [Misc/Feature] Add dynamic turn order (#6036) 2025-09-20 17:49:40 -05:00
battle.ts [Dev] Migrated to Biome 2.2.3, added more rules (#6259) 2025-09-08 10:35:18 -05:00
constants.ts [Misc] Fix circular dep (#6361) 2025-08-23 10:00:00 -05:00
dynamic-queue-manager.ts [Misc/Feature] Add dynamic turn order (#6036) 2025-09-20 17:49:40 -05:00
game-mode.ts [Refactor] Remove isNullOrUndefined in favor of loose check against null (#6549) 2025-09-12 14:53:27 -05:00
global-event-manager.ts [Dev] Enable Biome import sorting (#6052) 2025-07-13 00:21:25 -07:00
global-scene.ts [Dev] Enable Biome import sorting (#6052) 2025-07-13 00:21:25 -07:00
inputs-controller.ts [Dev] Migrated to Biome 2.2.3, added more rules (#6259) 2025-09-08 10:35:18 -05:00
loading-scene.ts [UI/UX] Add language selection to login screen (#6302) 2025-09-10 13:53:57 -05:00
main.ts [Dev] Migrated to Biome 2.2.3, added more rules (#6259) 2025-09-08 10:35:18 -05:00
messages.ts [Docs] Fixup typedoc warnings (#6540) 2025-09-10 13:35:55 -05:00
overrides.ts [Dev] Allow forcing all trainer variants in trainer override (#6391) 2025-09-16 10:48:19 -05:00
phase-manager.ts [Misc/Feature] Add dynamic turn order (#6036) 2025-09-20 17:49:40 -05:00
phase-tree.ts [Misc/Feature] Add dynamic turn order (#6036) 2025-09-20 17:49:40 -05:00
phase.ts [Test] Removed deprecated functions from phase interceptor (#6195) 2025-08-19 19:54:40 -05:00
polyfills.ts [Dev] Add support for manually rolling polyfills. Add polyfill for promise.withResolvers (#6103) 2025-07-19 09:06:32 -07:00
scene-base.ts [Dev] Enable Biome import sorting (#6052) 2025-07-13 00:21:25 -07:00
starting-wave.ts [Dev] Enable Biome import sorting (#6052) 2025-07-13 00:21:25 -07:00
timed-event-manager.ts [Refactor] Remove isNullOrUndefined in favor of loose check against null (#6549) 2025-09-12 14:53:27 -05:00
touch-controls.ts [Bug] Make touch events prevent pointer events (#6528) 2025-09-10 13:59:21 -05:00
tutorial.ts [Misc] Simplifying imports of UI files (#6542) 2025-09-11 00:30:17 -07:00
ui-inputs.ts [Misc] Simplifying imports of UI files (#6542) 2025-09-11 00:30:17 -07:00
vite.env.d.ts [Tests][Bug][Beta] Fix ditto bug and add unit tests (#6559) 2025-09-15 23:26:57 -05:00