* Added string utility package to replace util functions
* Changed string manipulation functions fully over to `change-case`
* Fixed missing comma in package.json
trailing commas when :(
* fixed lockfile
* Hopefully re-added all the string utils
* fixed package json
* Fixed remaining cases of regex + code dupliation
* Fixed more bugs and errors
* Moved around functions and hopefully fixed the regex issues
* Minor renaming
* Fixed incorrect casing on setting strings
pascal snake case 💀
* ran biome
* Added rudimentary test matchers for `toEqualArrayUnsorted` and `toHaveTypes`
Might port the rest at a later date
* Actually run the effing setup matchers file + fixed ls lint to not be angy
* added dev dep
* Update .ls-lint.yml
* Update .ls-lint.yml
---------
Co-authored-by: Sirz Benjie <142067137+SirzBenjie@users.noreply.github.com>
Co-authored-by: Amani H. <109637146+xsn34kzx@users.noreply.github.com>
https://github.com/pagefaultgames/pokerogue/pull/6134
* Removed `sanitizeOverrides`
* Moved initialization code to its own file
* Hopefully fixed test contamination
* Actually listened to people now
* fixed the thingy
* Run stub setup on init because
* Update testFileInitialization.ts
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
---------
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
* Standardize filenames to kebab-case
Co-authored-by: pymilkmaiden <cassiopeiamahler56@gmail.com>
* Move script outside of public folder
* Move update_exp_sprites to scripts
* Add ls-lint to lint file and directory names
* Update lefthook.yml to skip merge / rebase on all pre-commit commands
---------
Co-authored-by: pymilkmaiden <cassiopeiamahler56@gmail.com>
* [Test] Removed unnecessary calls to `PhaseInterceptor.to("CommandPhase")`
* minor cleanup to final_boss.test.ts
* Made run to final boss encounter actually go to command phase
* fix final_boss.test.ts select bug
* actually fixed test fr this time
* Fix magnet_rise.test.ts
* Fixed test
* Update test/moves/stockpile.test.ts
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
* Update stockpile.test.ts
---------
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
* Fixed tests for Magic Guard, Battle phase; fixed innards out stuff
* Fixde magic guard aftermath
* fixed tests
* Fixed innards out
* fixed using sizzly slide instead of will o wisp to inflict burn
* ran boime
* Readd simulated oopsie
* Fix HJK test to use protect + docs and such
* Apply Biome
---------
Co-authored-by: Sirz Benjie <142067137+SirzBenjie@users.noreply.github.com>
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
* [Balance] Add faint trigger to Battle Bond Greninja's form change
The form change functionality will now be slightly closer to Generation 7/8, as the Greninja will now revert from Ash form to Battle Bond form upon fainting.
* Change how the form change on faint is triggered
It is no longer directly handled by the faint phase, and is instead part of the abilities now, as more than Battle Bond Greninja revert via this method (Disguise Mimikyu, Power Construct Zygarde).
* Adjust Disguise test
* Updated enum utils to refuse non-enum values;
added strong typing on return values
* Moved Enum functions to own file; added type helpers for enums
* Cleaned up some code
* Fixed up tests
* Fix training-session-encounter.ts
* Fixed Transform and Imposter Bug
* Updated Comments
* Revised Comments
* Revised Changes on how tranformed pokemon are referenced to align with reviewer's suggestions
* Removed unused BattlerTag type for transform
* Removed addition of the transform tag to a pokemon in the PokemonTransformPhase
* Moved the check for whether Transform can be used within the TransformAttr class as suggested and removed uneccesary moveId check
* Consolidated if statement regarding isTransformed
* Removed overrides
* Added move condition to Transform + fixed up imposter target selection
* Condensed tests into 1 file + added more automated tests
This includes a couple regression tests for the fusion shenanigans
* Fixed comment
* Updated override typo for unimplemented methods
* Remove redundant parentheses
* Apply suggestions from code review
Co-authored-by: Bertie690 <136088738+Bertie690@users.noreply.github.com>
---------
Co-authored-by: Bertie690 <taylormw163@gmail.com>
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
Co-authored-by: Sirz Benjie <142067137+SirzBenjie@users.noreply.github.com>
Co-authored-by: Bertie690 <136088738+Bertie690@users.noreply.github.com>
https://github.com/pagefaultgames/pokerogue/pull/6067
* Fix anger point always procing on multi-hit
when first strike was a crit
* Fix comment spacing
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
* Rename PostDefendCritStatStageChangeAbAttr
---------
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
* Made `game.phaseInterceptor` fail if move not in moveset
also added a few assorted doc fixes
* Fixed fail comment
* added `map` statement
* Fixed tests
* Fixed test
* Fixed test and comment
* Fixed tests
* Fixed test v2
* Fixed various tests
* Update error msg to not use fullcaps
* Fixed remaining tests
* Fixed test 0.5
* Fixed up tetss
* Fixed test
* Fixed imposter tests
* Fixed imposter tests
* Fiexd remainig tests
* Marked test as TODO
wasn't as if it was doing anything beforehand but w/e
* Update moveHelper.ts
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
* Update moveHelper.ts
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
* Apply Biome
* Update comment in `spikes.test.ts`
* Add faint checks to Spikes test
---------
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
* Minor Attempt run phase rework to abstract logic to whole team
* Decoupled individual pokemon from run phase logic
* Formatting
* Completed run phase refactor implementation and updated tests
* Updated run phase to extend field phase instead of pokemon phase
* Removed unused phase decleration in tests
* Removed unecessary arg in turn start phase as refactor no longer needs it
* Cleaned up getPlayerField
* Made adjustments based on reviewer suggestions
* Reintrocuded calculateEscapeChance into AttemptRunPhase and removed run utils
* Resolve merge issues
* Minor TSDoc improvement to `BattleScene#getPlayerField`
* Moved early override check to top of calculateEscapeChance
---------
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
* Split up Pokemon data types to own files
* Moved `AttackMoveResult` and `TurnMove` to own files
* Moved `customPokemonData` into types folder + fixed comments
* Moved files around + fixed stuff
* Moved `DamageResult` into new file
* Fixed imports
* ran biome
* Fix merge issue
* [WIP] Refactor ability attribute apply args
* [WIP] update ability signatures
* Update callsites in pokemon.ts
* Update callsites in moves.ts
* Update abattr callsites in move-phase
* Update abattr callsites in battler-tags
Also removed stat drop ability application from cancelling ME stat boost effects
* format with biome and remove cancelled from weather lapse
* Update abattr callsites in MEP
* Update callsites in turn-start-phase
* Update abAttr callsites in misc phases
* Remove latent test functionality
* update ability attribute callsite in shield dust test
* update abattr callsite in winstrate challenge encounter
* Fix some tests to mock proper methods
* Remove improper condition in mimicry's ability application
* Fix improper simulated check in moody's apply method
* Pass source to postApplyDamage in pokemon.ts
* [wip] fix cud chew tests
* Make cud chew consumption not subclass postTurnAbAttr
* Fix regression in flower veil
* Update trySetStatus test in pokemon to respect new return value for undefined
* Remove empty, unused file
* Fix blockCrit method broken in merge
* Fix unnecessary attr type cast in move phase
* Address typing issue in safeguard test
* Improve documentation and get rid of ts-expect-error directive
* Minor comment/TSDoc updates and fixes
* Apply suggestions from code review
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
* Apply suggestions from code review
---------
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
* Cleanup evolution phase
* Update evolution phase and types
* Refactor form change phase
* Simplify game-speed.ts and update evo phase
* Move delay in formChangePhase to first element
* Fix mock video object return methods
* Fix tween chain mock
* Add todo comment to mock phaser's tween manager
* Remove jarring flash when evolution begins
* Fix missing method chaining in evo phase
* Apply biome formatting
https://github.com/pagefaultgames/pokerogue/pull/5932
* Fixed modifier code, removed instances of "0 ID = no mon"
* corrected casing + dejanked seed tag
* Added test file, added overload to `findModifier` if given type predicate
* fixed test
* Revert predicate stuff for now
going in separate PR
* Fix id check syrup bomb test
Wasn't running phase due to being a turn end effect
* [WIP] Changed test to use destiny bond as proper regression
* Removed `instant` and `ignoreUpdate` parameters from `tryTransferHeldItemModifier`; fixed post-battle loot code to _not_ break type safety
* Fixed up tests
* Reverted unneeded changes
* Removed outdated modifier test
* Fix import
* Apply Biome
* Update battler-tags.ts
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
* Update battler-tags.ts
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
* Update arena-tag.ts
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
* Update arena-tag.ts
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
---------
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
* Run `npm audit fix`
* Update Biome to 2.0.0
* Migrate `biome.jsonc` to 2.0
* Apply Biome and fix some suppression comments
* Fix some suppression comments and update config
* More config updates
Added at "error": `noUnusedLabels`, `noThisInStatic`
Changed `useDefaultParameterLast` from "off" to "warn"
Changed `noDocumentCookie` (from recommended) from "warn" to "off"
Changed `noExcessiveCognitiveComplexity` from "warn" to "info"
* Add a bunch of rules
* Apply Biome safe fixes
* Apply Biome unsafe fixes
* Remove irrelevant `useSelfClosingElements` rule
* Upgrade already followed rules to "error"
* Remove unnecessary type cast
* Disable fixer for `useDefaultParameterLast`
* Disable `useJsonImportAttribute` rule and revert changes
* Fix `mockImage.ts`
* ...there's a `@ts-nocheck` in this file
* Use whole-file lint suppression comment in `version_converter.ts`
* Add a couple comments to `biome.jsonc`
* Remove ESLint packages and GitHub workflow
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>
* 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>
https://github.com/pagefaultgames/pokerogue/pull/5926
* Condensed all overrides into 1 line where possible
I hope I got them all...
* Fixed tests 0.5
* Cleaned up safeguard test to not use outdated code; fixed rest of errors
* Fixed illusion test
* Revert safeguart etst
* Fixed battle tets
* Fixed stuff
* Fixed things2.0
* Fixed import issues
* Revert changes outside of the tests directory
* Revert changes outside of the tests directory
---------
Co-authored-by: Sirz Benjie <142067137+SirzBenjie@users.noreply.github.com>
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