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>
* Update `.dependency-cruiser.cjs` config file
* Update GitHub workflow
* Have `depcruise` check `test/` as well
* Remove circular import between `battle-anims.ts` and `battler-tags.ts`
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
The Nuzlocke challenges that were implemented were the following:
- "No Free Heal" which consists in disabling the auto heal
that occurs every 10th wave, replacing it with a normal shop phase.
Changes made:
- Added a new challenge "NO_AUTO_HEAL" with a challenge type
"NO_HEAL_PHASE" and created a new function "applyNoHealPhase"
to determine whether the Pokémon can heal if the challenge
is active ("challenge.ts").
- Added a confirmation on the healing phase to check if the
challenge is active or not, and if it is, it should skip
the phase ("party-heal-phase.ts").
- Changed the logistic of when the shop should be displayed, so
when the challenge is active the shop appears every 10th wave
("modifier-type.ts") and actually push the shop phase
("victory-phase.ts").
- "Hardcore": Challenge divided into two modes, normal and hard,
where fainted Pokémon can't be revived, in addition, the hard mode
deletes the fainted Pokémon so the player can't switch it's items
after death.
Changes made:
- Added a new challenge "HARDCORE" with several challenge
types with the correspondent apply functions ("challenge.ts"),
each one is used as follows:
- RANDOM_ITEM_BLACKLIST: filter the reward items with only the valid
one's ("modifier-type.ts").
- SHOP_ITEM_BLACKLIST: filter the shop items with only the valid
one's ("modifier-select-ui-handler.ts").
- MOVE_BLACKLIST: checks if the move selected is allowed and if not
sends a message of no apply ("pokemon.ts").
- DELETE_POKEMON: if hard mode was selected, automatically delete
the fainted Pokémon from the party ("battle-end-pahse.ts").
- SHOULD_FUSE: changed the logic of should apply function to
prohibit the fusion with dead Pokémon ("modifier.ts").
- PREVENT_REVIVE: prevent the gain of hp of fainted Pokémon
("party-heal-phase.ts").
- "Limited Catch": Only the first wild Pokémon encounter of
every biome can be added to the player's current party.
Changes made:
- Added a new challenge LIMITED_CATCH with a challenge type
ADD_POKEMON_TO_PARTY and created a new function
"applyAddPokemonToParty" to determine whether the Pokémon can be
added to the party, which should
only occur every 11th wave if it isn't a catchable mystery encounter
or every 12th wave if the 11th wave was a catchable mystery encounter
("challenge.ts").
- Changed the logistic of adding a Pokémon where it can be
caught so that the "pokedex" is updated but the Pokémon isn't added
to the party of the player affecting specifically mystery encounters
("encounter-pokemon-utils.ts") and added the same logic to normal
encounters. ("attempt-capture-phase.ts")
The changes in the game AI were as follows ("pokemon.ts"):
- More accurately accounts for the Pokémon's actual moves and their
effectiveness against the player instead of only the pokemon type
- Introduced logic to decide when a Pokémon should be sacrificed or
switched based on its HP and speed.
Signed-off-by: Matilde Simões <matilde.simoes@tecnico.ulisboa.pt>
Co-authored-by: Fuad Ali <fuad.ali@tecnico.ulisboa.pt>
The Nuzlocke challenges that were implemented were the following:
- "No Free Heal" which consists in disabling the auto heal
that occurs every 10th wave, replacing it with a normal shop phase.
Changes made:
- Added a new challenge "NO_AUTO_HEAL" with a challenge type
"NO_HEAL_PHASE" and created a new function "applyNoHealPhase"
to determine whether the Pokémon can heal if the challenge
is active ("challenge.ts").
- Added a confirmation on the healing phase to check if the challenge
is active or not, and if it is, it should skip the phase
("party-heal-phase.ts").
- Changed the logistic of when the shop should be displayed, so
when the challenge is active the shop appears every 10th wave
("modifier-type.ts") and actually push the shop phase
("victory-phase.ts").
- "Hardcore": Challenge divided into two modes, normal and hard,
where fainted Pokémon can't be revived, in addition, the hard mode
deletes the fainted Pokémon so the player can't switch it's items
after death.
Changes made:
- Added a new challenge "HARDCORE" with several challenge types with the
correspondent apply functions ("challenge.ts"), each one
is used as follows:
- RANDOM_ITEM_BLACKLIST: filter the reward items with only the valid
one's ("modifier-type.ts").
- SHOP_ITEM_BLACKLIST: filter the shop items with only the valid
one's ("modifier-select-ui-handler.ts").
- MOVE_BLACKLIST: checks if the move selected is allowed and if not
sends a message of no apply ("pokemon.ts").
- DELETE_POKEMON: if hard mode was selected, automatically delete
the fainted Pokémon from the party ("battle-end-pahse.ts").
- SHOULD_FUSE: changed the logic of should apply function to
prohibit the fusion with dead Pokémon ("modifier.ts").
- PREVENT_REVIVE: prevent the gain of hp of fainted Pokémon
("party-heal-phase.ts").
- "Limited Catch": Only the first wild Pokémon encounter of
every biome can be added to the player's current party.
Changes made:
- Added a new challenge LIMITED_CATCH with a challenge type
ADD_POKEMON_TO_PARTY and created a new function
"applyAddPokemonToParty" to determine whether the Pokémon can be
added to the party, which should
only occur every 11th wave if it isn't a catchable mystery encounter
or every 12th wave if the 11th wave was a catchable mystery encounter
("challenge.ts").
- Changed the logistic of adding a Pokémon where it can be
caught so that the "pokedex" is updated but the Pokémon isn't added
to the party of the player affecting specifically mystery encounters
("encounter-pokemon-utils.ts") and added the same logic to normal
encounters. ("attempt-capture-phase.ts")
The changes in the game AI were as follows ("pokemon.ts"):
- More accurately accounts for the Pokémon's actual moves and their
effectiveness against the player instead of only the pokemon type
- Introduced logic to decide when a Pokémon should be sacrificed or
switched based on its HP and speed.
Signed-off-by: Matilde Simões <matilde.simoes@tecnico.ulisboa.pt>
Co-authored-by: Fuad Ali <fuad.ali@tecnico.ulisboa.pt>
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>
https://github.com/pagefaultgames/pokerogue/pull/5924
* [UI/UX] "Stop trying to teach move" Defaulting to "No"
* [Test] setCursor to 0, 'Yes' to end learning move
* Move confirmUIMode to its own file in enums, add docs
---------
Co-authored-by: Sirz Benjie <142067137+SirzBenjie@users.noreply.github.com>
* Updated both Spanish type icons
* Update Brazilian Portuguese type icons
* Update Catalan type icons
* Update Traditional Chinese type icons
* Update Turkish type icons
* Update Russian type icons
* Update Catalan type icons
* Delete error
* Update Russian type icon
* Update Russian type icons