https://github.com/pagefaultgames/pokerogue/pull/5857
* Add test for forecast
* Fix PostSummonFormChangeByWeatherAbAttr
* Fix overrides in forecast test
* Remove a test whose trigger conditions can no longer happen
* Update src/data/abilities/ability.ts
Co-authored-by: Dean <69436131+emdeann@users.noreply.github.com>
* Fix missing tsdoc param
* Apply kev's suggestions from code review
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
* Simplify PostSummonFormChangeByWeather's canApplyPostSummon
* Fix unused params that messed up after rebase
* Fix form change import
Messed up due to improper rebase
---------
Co-authored-by: Dean <69436131+emdeann@users.noreply.github.com>
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
* Added `MoveUseType` and refactored MEP
* Fixed Wimp out tests & ME code
finally i think all the booleans are gone
i hope
* Added version migration for last resort and co.
buh gumbug
* Fixed various bugs and added tests for previous bugfixes
* Reverted a couple doc changes
* WIP
* Update pokemon-species.ts
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
* Update pokemon-phase.ts
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
* Fixed remaining tests (I think)
* Reverted rollout test changes
* Fixed command phase bug causing metronome test timeout
* Revert early_bird.test.ts
* Fix biome.jsonc
* Made `MoveUseType` start at 1
As per @DayKev's request
* Fixed a thing
* Fixed bolt beak condition to be marginally less jank
* Applied some review suggestions
* Reverted move phase operations
* Added helper functions complete with markdown tables
* Fixed things
* Update battler-tags.ts
* Fixed random issues
* Fixed code
* Fixed comment
* Fixed import issues
* Fix disable.test.ts conflicts
* Update instruct.test.ts
* Update `biome.jsonc`
* Renamed `MoveUseType` to `MoveUseMode`; applied review comments
* Fixed space
* Fixed phasemanager bugs
* Fixed instruct test to not bork
* Fixed gorilla tactics bug
* Battler Tags doc fixes
* Fixed formatting and suttff
* Minor comment updates and remove unused imports in `move.ts`
* Re-add `public`, remove unnecessary default value in `battler-tags.ts`
* Restore `{}` in `turn-start-phase.ts`
Fixes `lint/correctness/noSwitchDeclarations`
* Remove extra space in TSDoc in `move-phase.ts`
* Use `game.field` instead of `game.scene` in `instruct.test.ts`
Also `game.toEndOfTurn()` instead of
`game.phaseInterceptor.to("BerryPhase")`
* Use `game.field` instead of `game.scene` in `metronome.test.ts`
* Use `toEndOfTurn()` instead of `to("BerryPhase")` in `powder.test.ts`
* Convert `MoveUseMode` enum to `const` object
* Update move-phase.ts
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
* Add `enumValueToKey` utility function
* Apply Biome
---------
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
* [Refactor] Create utility function `makeArray`
This replaces the `if(!Array.isArray(var)) { var = [var] }` pattern
* Replace `if` with ternary, rename to `coerceArray`
* Add TSDocs
* Improve type inferencing
* Replace missed `Array.isArray` checks
* Apply Biome
* Re-apply changes to phase manager
* Re-apply to `SpeciesFormChangeStatusEffectTrigger` constructor
Apply to new instances in test mocks
https://github.com/pagefaultgames/pokerogue/pull/5513
* Add prependToPhaseWithCondition and use it in SummonPhase to determine speed order
* Move logic to PostSummonPhase
* Add test base
* Pivot to using sort strategy instead
* Add and update tests
* Support priority ability activations
* Ensure priority abilities are still activated on switch in
* Add test for priority
* Update to use priority numbers instead of a boolean
* Add ability priorities to constructors
* Move sorting to BattleScene
* Rename phase file
* Update import
* Move application to applyPostSummonAbAttrs and stop assuming no other phases in queue
* Ensure all PostSummonPhases from encounters are added at the same time
* Switch to priority queue approach
* Ensure that zero/negative priority activations happen after postsummonphase
* Revert 07646fe (not needed due to stable sort)
* Always create separate ability phases for passive and use boolean instead of priority number when applying
* Add test for dynamic updates
* Add BattlerIndex import
* Clear queues for testing
* Benjie suggestion
* Split files
* Update import in battlescene
* Remove extra spaces added by VSCode
* Fix other conflicts
* Update PhaseManager
* Update to use PhaseManager
* Immediately start postsummons
* Fix test
* Fix BattlerIndex import
* Remove unused imports
* Fix postsummon application
* Make priority readonly
* Add abilityAttr.is methods
* [WIP] move modifier stuff around
* Untangle circular deps from modifiers
* Move unlockables to own file
* Untangle all circular deps outside of MEs
* Move constants in MEs to their own files
* Re-add missing import to battle.ts
* Add necessary overload for getTag
* Add missing type import in weather.ts
* Init modifier types and pools in loading-scene
* Remove stray commented code
* Apply kev's suggestions from code review
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
---------
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
* Move game-mode to its own file
Reduces circular imports to 325
* Move battler-index to own file
Reduces circular deps to 314
* Move trainer-variant to own file
Reduces circ deps to 313
* Move enums in pokemon to their own file
* Move arena-tag-type to its own file
* Move pokemon-moves to its own file
* Move command to own file
* Move learnMoveType to own file
* Move form change item to own file
* Move battlerTagLapseType to own file
* Move anim enums to own shared file
* Move enums out of challenges
* Move species form change triggers to own file
Reduces circ imports to 291
* Update test importing pokemon move
* Replace move attribute imports with string names
* Untangle circular deps from game data
* Fix missing string call in switch summon phase
* Apply kev's suggestions from code review
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
* Ensure ChargeMove's is method calls super
* Use InstanceType for proper narrowing
* Apply kev's suggestions from code review
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
---------
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
* Move phase types out of phase interceptor
* Create isXPhase method and add properties to each phase
* Replace instanceof phase with isXPhase
* Fix missing union types for phaseName
* Update doc comment in phase.ts
* Fix incomplete comment in encounter-phase
* Make phaseName as public and fix more uses
* Move phaseName property declaration before constructor in move anim phase
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
* Rename isXPhase to is
---------
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
* Rename `Abilities` to `AbilityId`
* Rename `abilities.ts` to `ability-id.ts`
* Rename `Moves` to `MoveId`
* Rename `moves.ts` to `move-id.ts`
* Rename `Species` to `SpeciesId`
* Rename `species.ts` to `species-id.ts`
* Rename `Biome` to `BiomeId`
* Rename `biome.ts` to `biome-id.ts`
* Replace `Abilities` with `AbilityId` in comments
* Replace `Biome` with `BiomeId` in comments
* Replace `Moves` with `MoveId` in comments
* Replace `Species` with `SpeciesId` in comments
* [Test] Add/update test utils
- Add `FieldHelper` which has methods to mock a pokemon's ability
or force a pokemon to be Terastallized
- Add `MoveHelper#use` which can be used to remove the need
for setting pokemon move overrides by modifying the
moveset of the pokemon
- Add `MoveHelper#selectEnemyMove` to make an enemy pokemon
select a specific move
- Add `MoveHelper#forceEnemyMove` which modifies
the pokemon's moveset and then uses `selectEnemyMove`
- Fix `GameManager#toNextTurn` to work correctly in double battles
- Add `GameManager#toEndOfTurn` which advances to the end of the turn
* Update some tests
- Disable broken Good As Gold test
and add `.edgeCase` to Good As Gold
- Fix Powder test
- Update some tests to demonstrate new methods
* Fixed IVs of trainers using the Battle Seed.
* Renamed the randSeedInt functions that use the Battle Seed to randBattleSeedInt functions
* Incorrectly used this in common
* Fixed tests that were still calling the old function name
---------
Co-authored-by: damocleas <damocleas25@gmail.com>
Co-authored-by: Bertie690 <136088738+Bertie690@users.noreply.github.com>
Co-authored-by: AJ Fontaine <36677462+Fontbane@users.noreply.github.com>
Co-authored-by: Dean <69436131+emdeann@users.noreply.github.com>
Co-authored-by: lxy-lxy-lxy <55084073+lxy-lxy-lxy@users.noreply.github.com>
Co-authored-by: Xavion3 <xavion333@gmail.com>
Co-authored-by: Sirz Benjie <142067137+SirzBenjie@users.noreply.github.com>
Co-authored-by: Lylian BALL <131535108+PyGaVS@users.noreply.github.com>
Co-authored-by: Jimmybald1 <147992650+IBBCalc@users.noreply.github.com>
* fix revelation dance using the type of the illusion instead of the actual type
* fix other move that might get the illusion type as well
* fix other move that might get the illusion type as well
* fix abilities that might get the illusion type as well
* fix illusion icon in party ui handler
* Fix TSDoc for `Pokemon#getTypes`
* Remove now-unnecessary changes to `.getTypes()` calls
Revert `overrides.ts` changes
* Replace `|| false` with `!!`
---------
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
* Make type changing moves change type after abilities but before ion deluge/electrify
* Create unified test file for galvanize, pixilate, and refrigerate
* Make type boost items like silk scarf affect the move after its type change
* Add tests for type boost item interaction
* Remove leftover log messages
* Update spies in type-change ability tests
* Add automated tests for normalize
* Fix test name injection for tera blast
* Add automated test for tera blast normalize interaction
* Restore pokemon as a type-only import in moves.ts
* Add aerilate to type changing tests
* Rename galvanize test file
* Fix utils import
* Apply suggestions from code review
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
* Remove unnecessary mockRestore
* Remove unnecessary nullish coalescing
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
* Update src/field/pokemon.ts
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
---------
Co-authored-by: Madmadness65 <59298170+Madmadness65@users.noreply.github.com>
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
* Moved SelectBiomePhase in front of NewBattlePhase
* disguise test now has to go to QuietFormChangePhase
---------
Co-authored-by: Jimmybald1 <147992650+IBBCalc@users.noreply.github.com>
* Extract Mode enum out of UI and into its own file
Reduces circular imports from 909 to 773
* Move around utility files
Reduces cyclical dependencies from 773 to 765
* Remove starterColors and bypassLogin from battle-scene
Reduces cyclical dependencies from 765 to 623
* Fix test runner error
* Update import for bypassLogin in test
* Update mocks for utils in tests
* Fix broken tests
* Update selectWithTera override
* Update path for utils in ab-attr.ts
* Update path for utils in ability-class.ts
* Fix utils import path in healer.test.ts
* Add isPartner method to trainer class
* Ensure force switches cannot pull pokemon from the wrong trainer
* Add override for battle type
* Fixup tests and broken assumptions
* Make move fail override semi-invuln check
Bandaid fix because move effect phase does not allow for the move to fail if all of its conditions fail
* Restore overrides
* Apply kev's suggestions from code review
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
* Fix illusion test battle type invocation
* Update struggle and healer tests to use battleStyle
---------
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
* Add test for beak blast applying after user faints
* Rewrite tags for contact protected and check moveFlags.doesFlagEffectApply
* Add test to beak blast ensuring a long reach user does not get burned
* Re-add DamageProtectedTag to relevant inheritance chains
* Move resetSummonData to faintPhase instead of pokemon.apply
* Remove passing of grudge and destiny bond tags to faint phase
* sheer force #, sheer force and burning jealousy test fix, and move chance fixes
* removed order up sheer force interaction mention and test - updated comments
* remove electro shot from changes
* Move ability.ts to subfolder
* Extract types out of ability.ts
* Update imports in ability.ts and friends
* Cleanup imports in ability.ts
* Re-add imports lost during sort
* Update imports forgotten during rebase
* Re-import proper type from enums
* Update biome.jsonc
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
* Add commit to force tests to rerun
---------
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>