* Refactor evo conditions and descriptions
* Fix test
* Fix Shedinja
* Simplify Gimmighoul evolution
* Primeape and Stantler evolve by using their move 10 times
* Basculin white stripe evolves by taking 294 recoil damage
* Primeape and Stantler use modifiers for tracking
* Basculin uses modifier too
* Remove evo count from pokemon data
* No more evo counter data, Gallade/Froslass
* Fix allmoves import
* Clamperl
* Struggle shouldn't count for Basc recoil
* Change to nicer type
* Apply Benjie's suggestions
Co-authored-by: Sirz Benjie <142067137+SirzBenjie@users.noreply.github.com>
* Address formatting
* Undo new evolution changes
* Remove unused imports
* Fix speciesid
* Fixed up descriptions a little
* Change a key name
* Fix Gimmighoul
* Apply Biome
* Apply Biome unsafe fixes
* Review suggestions
- Convert `EvoCondKey` enum to `const` object
- Use early returns in `SpeciesEvolutionCondition#description`
and `SpeciesFormEvolution#description`
- Replace `!!x.find` with `x.some`
and `y.indexOf() > -1` with `y.includes()`
- Implement `coerceArray`
- Fix Shelmet evolution condition
checking for Shelmet and not Karrablast
- Remove unnecessary type casting in `battle-scene.ts`
* Remove leftover enforce func loop
* Fix circular imports issue
- `getPokemonSpecies` moved to `src/utils/pokemon-utils.ts`
- `allSpecies` moved to `src/data/data-lists.ts`
---------
Co-authored-by: Sirz Benjie <142067137+SirzBenjie@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
* Create battle-info directory and move battle-info.ts to it
* Move player and enemy battle info to their own files
* Move subclass specific parts of constructor to subclass constructor
* Fixup mock gameobject methods to match phaser gameobject returns
* Make statOrder specific to subclass
* Create getShinyDescriptor function in utils
* Move icon construction to its own function
* Cleanup enemybattleinfo constructor to use chaining
* Make flyout exclusive to EnemyBattleInfo
* Move EnemyPokemon specific init Logic to its class
* Break up initInfo into different methods
* Remove hp bar segment dividers from base battle info
* Move setMini to pokemoninfo
* Breakup updateInfo into smaller parts
* Remove hp info handling from base updateInfo
* Use phaser object chaining methods
* Add some docs
* Add missing chain usage
* Use getShinyDescriptor in pokemon-info-container
* Minor cleanup of updatePokemonExp
* Fixup setSizeToFrame mock
* Ensure pokemon hp numbers are not visible during stat display
* Update src/utils/common.ts
Co-authored-by: Wlowscha <54003515+Wlowscha@users.noreply.github.com>
* Make summary-ui-handler use new shinyDescriptor method
* Remove `undefined` parameter pass
Co-authored-by: Amani H. <109637146+xsn34kzx@users.noreply.github.com>
* Address kev's review comments
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
* Ensure hp number display fades in/out
* Ensure ribbon and caught indicator fade with stat display
* Update src/ui/battle-info/battle-info.ts
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
* Move construction of stats and type icons to their own methods
* Make setPositionRelative return this
* Improve doc comment on paddingX param
* Fix mock sprite's setPositionRelative
---------
Co-authored-by: Wlowscha <54003515+Wlowscha@users.noreply.github.com>
Co-authored-by: Amani H. <109637146+xsn34kzx@users.noreply.github.com>
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
* [Dev] Enable biome parsing of `pokemon.ts`
* Apply unsafe fixes
* Add + apply rule disallowing the use of the `integer` type alias
* Fix typo in comment; remove unnecessary `!!`
* Re-apply Biome after merge
* Re-apply Biome "unsafe" fixes after merge
* Fix import
* Add comment to `getFusionIconAtlasKey` too
* 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>
* Fix#5085 Moves dont play a No Effect Message Against Immune Type
When using non-volatile status move like: Will-O-Wisp, Thunder
Wave, Toxic, or Poison Gas against a Pokémon whose type is immune
to that Status condition, no "It doesn't affect" message plays.
My proposed fixes:
In move.ts:
Removed a redudant if statement in StatusEffectAttr class
In pokemon.ts:
Renamed the "messageIsImmune" function to "queueImmuneMessage"
* order of operations in creating boss battleInfo
fixed a bug where because of an order of operations error in this file it ignored the position update of the boss life value set in battle-info.ts (around line 562)
* Fix type hint after enemy disappears
* Add automated test for type hint bugfix
* Make onField default to true
* Replace reference to Mode with UiMode and battleType with BattleStyle
* 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