pokerogue/test/abilities
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
..
ability-activation-order.test.ts [Misc] Standardize-file-names (#6137) 2025-07-24 16:38:31 -04:00
ability-duplication.test.ts [Test] Updated more uses of game.scene.getEnemyField and game.scene.getPlayerField to use updated test utils (#6524) 2025-09-18 09:36:08 -05:00
ability-timing.test.ts [Misc] Standardize-file-names (#6137) 2025-07-24 16:38:31 -04:00
analytic.test.ts [Dev] Migrated to Biome 2.2.3, added more rules (#6259) 2025-09-08 10:35:18 -05:00
anger-point.test.ts [Test] Replace game.scene.getXPokemon()! with game.field.getXPokemon() 2025-08-04 21:19:57 -07:00
arena-trap.test.ts [Misc] Simplifying imports of UI files (#6542) 2025-09-11 00:30:17 -07:00
aroma-veil.test.ts [Misc] Standardize-file-names (#6137) 2025-07-24 16:38:31 -04:00
aura-break.test.ts [Misc] Standardize-file-names (#6137) 2025-07-24 16:38:31 -04:00
battery.test.ts [Misc] Standardize-file-names (#6137) 2025-07-24 16:38:31 -04:00
battle-bond.test.ts [Misc] Standardize-file-names (#6137) 2025-07-24 16:38:31 -04:00
beast-boost.test.ts [Test] Replace game.scene.getXPokemon()! with game.field.getXPokemon() 2025-08-04 21:19:57 -07:00
commander.test.ts [Test] Updated more uses of game.scene.getEnemyField and game.scene.getPlayerField to use updated test utils (#6524) 2025-09-18 09:36:08 -05:00
competitive.test.ts [Test] Replace game.scene.getXPokemon()! with game.field.getXPokemon() 2025-08-04 21:19:57 -07:00
contrary.test.ts [Test] Replace game.scene.getXPokemon()! with game.field.getXPokemon() 2025-08-04 21:19:57 -07:00
corrosion.test.ts [Bug] Refactored status code, fixed Rest/Sleep Talk status checks (#5872) 2025-08-20 08:45:09 -05:00
costar.test.ts [Misc] Standardize-file-names (#6137) 2025-07-24 16:38:31 -04:00
cud-chew.test.ts [Test] Added matcher to check message contents; added tests for Splash, Celebrate, Laser Focus (#6299) 2025-09-10 13:40:21 -05:00
dancer.test.ts [Misc/Feature] Add dynamic turn order (#6036) 2025-09-20 17:49:40 -05:00
defiant.test.ts [Test] Replace game.scene.getXPokemon()! with game.field.getXPokemon() 2025-08-04 21:19:57 -07:00
desolate-land.test.ts [Test] Replace game.scene.getXPokemon()! with game.field.getXPokemon() 2025-08-04 21:19:57 -07:00
disguise.test.ts [Refactor] Remove null from PhaseManager.currentPhase signature 2025-09-05 09:28:35 -07:00
dry-skin.test.ts [Test] Replace game.scene.getXPokemon()! with game.field.getXPokemon() 2025-08-04 21:19:57 -07:00
early-bird.test.ts [Test] Replace game.scene.getXPokemon()! with game.field.getXPokemon() 2025-08-04 21:19:57 -07:00
embody-aspect.test.ts [Ability] Embody Aspect now triggers on switch-in while Terastallized (#6294) 2025-08-20 20:10:54 -05:00
flash-fire.test.ts [Test] Replace game.scene.getXPokemon()! with game.field.getXPokemon() 2025-08-04 21:19:57 -07:00
flower-gift.test.ts [Test] Updated more uses of game.scene.getEnemyField and game.scene.getPlayerField to use updated test utils (#6524) 2025-09-18 09:36:08 -05:00
flower-veil.test.ts [Test] Updated more uses of game.scene.getEnemyField and game.scene.getPlayerField to use updated test utils (#6524) 2025-09-18 09:36:08 -05:00
forecast.test.ts [Test] Updated more uses of game.scene.getEnemyField and game.scene.getPlayerField to use updated test utils (#6524) 2025-09-18 09:36:08 -05:00
friend-guard.test.ts [Dev] Migrated to Biome 2.2.3, added more rules (#6259) 2025-09-08 10:35:18 -05:00
good-as-gold.test.ts [Test] Replace game.scene.getXPokemon()! with game.field.getXPokemon() 2025-08-04 21:19:57 -07:00
gorilla-tactics.test.ts [Test] Replace game.scene.getXPokemon()! with game.field.getXPokemon() 2025-08-04 21:19:57 -07:00
guard-dog.test.ts [Misc] Standardize-file-names (#6137) 2025-07-24 16:38:31 -04:00
gulp-missile.test.ts [Docs] Fixup typedoc warnings (#6540) 2025-09-10 13:35:55 -05:00
harvest.test.ts [Test] Replace game.scene.getXPokemon()! with game.field.getXPokemon() 2025-08-04 21:19:57 -07:00
healer.test.ts [Refactor] Remove isNullOrUndefined in favor of loose check against null (#6549) 2025-09-12 14:53:27 -05:00
heatproof.test.ts [Test] Replace game.scene.getXPokemon()! with game.field.getXPokemon() 2025-08-04 21:19:57 -07:00
honey-gather.test.ts [Test] Replace game.scene.getXPokemon()! with game.field.getXPokemon() 2025-08-04 21:19:57 -07:00
hustle.test.ts [Test] Replace game.scene.getXPokemon()! with game.field.getXPokemon() 2025-08-04 21:19:57 -07:00
hyper-cutter.test.ts [Test] Replace game.scene.getXPokemon()! with game.field.getXPokemon() 2025-08-04 21:19:57 -07:00
ice-face.test.ts [Test] Replace game.scene.getXPokemon()! with game.field.getXPokemon() 2025-08-04 21:19:57 -07:00
illuminate.test.ts [Test] Replace game.scene.getXPokemon()! with game.field.getXPokemon() 2025-08-04 21:19:57 -07:00
illusion.test.ts [Test] Replace game.scene.getXPokemon()! with game.field.getXPokemon() 2025-08-04 21:19:57 -07:00
infiltrator.test.ts [Bug] Refactored status code, fixed Rest/Sleep Talk status checks (#5872) 2025-08-20 08:45:09 -05:00
innards-out.test.ts [Misc] Standardize-file-names (#6137) 2025-07-24 16:38:31 -04:00
intimidate.test.ts [Bug/Ability] Fixed bugs with Intimidate triggers after reload/initial switch (#6212) 2025-08-24 14:09:16 -05:00
intrepid-sword.test.ts [Test] Replace game.scene.getXPokemon()! with game.field.getXPokemon() 2025-08-04 21:19:57 -07:00
lightningrod.test.ts [Misc] Standardize-file-names (#6137) 2025-07-24 16:38:31 -04:00
magic-bounce.test.ts [Test] Updated more uses of game.scene.getEnemyField and game.scene.getPlayerField to use updated test utils (#6524) 2025-09-18 09:36:08 -05:00
magic-guard.test.ts [Misc] Standardize-file-names (#6137) 2025-07-24 16:38:31 -04:00
mimicry.test.ts [Test] Replace game.scene.getXPokemon()! with game.field.getXPokemon() 2025-08-04 21:19:57 -07:00
mirror-armor.test.ts [Test] Updated more uses of game.scene.getEnemyField and game.scene.getPlayerField to use updated test utils (#6524) 2025-09-18 09:36:08 -05:00
mold-breaker.test.ts [Misc] Standardize-file-names (#6137) 2025-07-24 16:38:31 -04:00
moody.test.ts [Bug] Moody Can't Lower Stats at +6 (#6481) 2025-09-06 06:46:13 +00:00
moxie.test.ts [Test] Removed deprecated functions from phase interceptor (#6195) 2025-08-19 19:54:40 -05:00
mummy.test.ts [Test] Replace game.scene.getXPokemon()! with game.field.getXPokemon() 2025-08-04 21:19:57 -07:00
mycelium-might.test.ts [Misc/Feature] Add dynamic turn order (#6036) 2025-09-20 17:49:40 -05:00
neutralizing-gas.test.ts [Misc/Feature] Add dynamic turn order (#6036) 2025-09-20 17:49:40 -05:00
no-guard.test.ts [Test] Updated more uses of game.scene.getEnemyField and game.scene.getPlayerField to use updated test utils (#6524) 2025-09-18 09:36:08 -05:00
normal-move-type-change.test.ts [Test] Replace game.scene.getXPokemon()! with game.field.getXPokemon() 2025-08-04 21:19:57 -07:00
normalize.test.ts [Bug] Fix when variable move power is called (#6126) 2025-07-24 23:16:23 -07:00
oblivious.test.ts [Test] Replace game.scene.getXPokemon()! with game.field.getXPokemon() 2025-08-04 21:19:57 -07:00
own-tempo.test.ts [Misc] Standardize-file-names (#6137) 2025-07-24 16:38:31 -04:00
parental-bond.test.ts [Test] Replace game.scene.getXPokemon()! with game.field.getXPokemon() 2025-08-04 21:19:57 -07:00
pastel-veil.test.ts [Test] Added/cleaned up tests for Pastel/Sweet Veil (#6374) 2025-09-05 21:42:44 -05:00
perish-body.test.ts [Test] Replace game.scene.getXPokemon()! with game.field.getXPokemon() 2025-08-04 21:19:57 -07:00
power-construct.test.ts [Dev] Migrated to Biome 2.2.3, added more rules (#6259) 2025-09-08 10:35:18 -05:00
power-spot.test.ts [Misc] Standardize-file-names (#6137) 2025-07-24 16:38:31 -04:00
protean-libero.test.ts [Misc] Standardize-file-names (#6137) 2025-07-24 16:38:31 -04:00
protosynthesis.test.ts [Test] Replace game.scene.getXPokemon()! with game.field.getXPokemon() 2025-08-04 21:19:57 -07:00
quick-draw.test.ts [Misc/Feature] Add dynamic turn order (#6036) 2025-09-20 17:49:40 -05:00
sand-spit.test.ts [Misc] Standardize-file-names (#6137) 2025-07-24 16:38:31 -04:00
sand-veil.test.ts [Misc] Standardize-file-names (#6137) 2025-07-24 16:38:31 -04:00
sap-sipper.test.ts [Test] Replace game.scene.getXPokemon()! with game.field.getXPokemon() 2025-08-04 21:19:57 -07:00
schooling.test.ts [Dev] Migrated to Biome 2.2.3, added more rules (#6259) 2025-09-08 10:35:18 -05:00
screen-cleaner.test.ts [Misc] Standardize-file-names (#6137) 2025-07-24 16:38:31 -04:00
seed-sower.test.ts [Misc] Standardize-file-names (#6137) 2025-07-24 16:38:31 -04:00
serene-grace.test.ts [Misc] Standardize-file-names (#6137) 2025-07-24 16:38:31 -04:00
sheer-force.test.ts [Test] Cleaned up tests to use updated test utils; part 1 (#6176) 2025-08-19 19:21:40 -05:00
shell-armor.test.ts [Misc] Standardize-file-names (#6137) 2025-07-24 16:38:31 -04:00
shield-dust.test.ts [Test] Replace game.scene.getXPokemon()! with game.field.getXPokemon() 2025-08-04 21:19:57 -07:00
shields-down.test.ts [Test] Cleaned up shields down tests; added more tests (#6216) 2025-08-20 08:57:46 -05:00
simple.test.ts [Test] Replace game.scene.getXPokemon()! with game.field.getXPokemon() 2025-08-04 21:19:57 -07:00
speed-boost.test.ts [Test] Replace game.scene.getXPokemon()! with game.field.getXPokemon() 2025-08-04 21:19:57 -07:00
stakeout.test.ts [Misc] Standardize-file-names (#6137) 2025-07-24 16:38:31 -04:00
stall.test.ts [Misc/Feature] Add dynamic turn order (#6036) 2025-09-20 17:49:40 -05:00
status-immunity-ab-attrs.test.ts [Bug] Refactored status code, fixed Rest/Sleep Talk status checks (#5872) 2025-08-20 08:45:09 -05:00
steely-spirit.test.ts [Test] Replace game.scene.getXPokemon()! with game.field.getXPokemon() 2025-08-04 21:19:57 -07:00
storm-drain.test.ts [Test] Updated more uses of game.scene.getEnemyField and game.scene.getPlayerField to use updated test utils (#6524) 2025-09-18 09:36:08 -05:00
sturdy.test.ts [Test] Cleaned up tests to use updated test utils; part 1 (#6176) 2025-08-19 19:21:40 -05:00
super-luck.test.ts [Test] Replace game.scene.getXPokemon()! with game.field.getXPokemon() 2025-08-04 21:19:57 -07:00
supreme-overlord.test.ts [Bug] Apply Supreme Overlord only once on summon (#6575) 2025-09-19 23:08:02 -05:00
sweet-veil.test.ts [Test] Added/cleaned up tests for Pastel/Sweet Veil (#6374) 2025-09-05 21:42:44 -05:00
synchronize.test.ts [Test] Replace game.scene.getXPokemon()! with game.field.getXPokemon() 2025-08-04 21:19:57 -07:00
tera-shell.test.ts [Test] Replace game.scene.getXPokemon()! with game.field.getXPokemon() 2025-08-04 21:19:57 -07:00
trace.test.ts [Test] Replace game.scene.getXPokemon()! with game.field.getXPokemon() 2025-08-04 21:19:57 -07:00
truant.test.ts [Test] Added matcher to check message contents; added tests for Splash, Celebrate, Laser Focus (#6299) 2025-09-10 13:40:21 -05:00
unburden.test.ts [Test] Updated more uses of game.scene.getEnemyField and game.scene.getPlayerField to use updated test utils (#6524) 2025-09-18 09:36:08 -05:00
unseen-fist.test.ts [Test] Replace game.scene.getXPokemon()! with game.field.getXPokemon() 2025-08-04 21:19:57 -07:00
victory-star.test.ts [Misc] Standardize-file-names (#6137) 2025-07-24 16:38:31 -04:00
volt-absorb.test.ts [Test] Replace game.scene.getXPokemon()! with game.field.getXPokemon() 2025-08-04 21:19:57 -07:00
wandering-spirit.test.ts [Test] Replace game.scene.getXPokemon()! with game.field.getXPokemon() 2025-08-04 21:19:57 -07:00
wimp-out.test.ts [Test] Cleaned up tests to use updated test utils; part 1 (#6176) 2025-08-19 19:21:40 -05:00
wind-power.test.ts [Test] Replace game.scene.getXPokemon()! with game.field.getXPokemon() 2025-08-04 21:19:57 -07:00
wind-rider.test.ts [Test] Replace game.scene.getXPokemon()! with game.field.getXPokemon() 2025-08-04 21:19:57 -07:00
wonder-skin.test.ts [Misc] Standardize-file-names (#6137) 2025-07-24 16:38:31 -04:00
zen-mode.test.ts [Test] Replace game.scene.getXPokemon()! with game.field.getXPokemon() 2025-08-04 21:19:57 -07:00
zero-to-hero.test.ts [Test] Cleaned up tests to use updated test utils; part 1 (#6176) 2025-08-19 19:21:40 -05:00