Commit Graph

5293 Commits

Author SHA1 Message Date
mati-soda
8f6cf35beb Fixed conflicts on file imports.
Signed-off-by: Matilde Simões <matilde.simoes@tecnico.ulisboa.pt>
Co-authored-by: Fuad Ali <fuad.ali@tecnico.ulisboa.pt>
2025-07-02 20:26:34 +01:00
Matilde Simões
289dffb8d0 Implement NuzLocke related challenges and AI changes
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>
2025-07-02 20:26:34 +01:00
Matilde Simões
66775f7cc9 Implement NuzLocke related challenges and AI changes
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>
2025-07-02 20:26:34 +01:00
Jonathan Bankston
12aaa31454
[Refactor] Minor run phase rework (#6017)
* 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>
2025-07-02 02:57:08 -07:00
Bertie690
a54cd953a6
[Bug] Fix Shields Down blocking status in Core Form, unnecessarily resetting before battle (#6044)
* Fix Minior Form Change issues

* Fix bug

* Update Power Construct conditionals to be less janky

* Fix syntax error

* Fix ability.ts
2025-06-30 00:19:59 -04:00
Bertie690
1bd152a738
[Refactor] Moved various classes/interfaces to own files (#5870)
* 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
2025-06-28 01:55:47 -07:00
Lugiad
40a92df190
[i18n] [Localization] Translatable Manaphy Egg Tier (#6038)
Translatable Manaphy Egg Tier
2025-06-26 19:04:14 -07:00
Bertie690
25757ca649
[Docs] Fix typo in CONTRIBUTING.md (#6034)
Fix typo in CONTRIBUTING.md
2025-06-27 00:38:31 +00:00
NightKev
07f5c3009c
[Dev] Add player and enemy Nature and IV overrides (#6032)
* [Dev] Add player and enemy Nature and IV overrides

* Fix broken tests
2025-06-26 12:01:54 -07:00
NightKev
c389b7acdb
[Dev] Mark the fixer for Biome's useBlockStatements as "safe" (#6031) 2025-06-25 18:16:30 -07:00
NightKev
ecdaac20fa [Test] Fix Gorilla Tactics tests 2025-06-24 18:40:15 -07:00
Bertie690
3b490e7ab4
[Bug] Status moves blocked by terrain now use correct message
https://github.com/pagefaultgames/pokerogue/pull/5931

* Moved terrain messages to `terrain.ts`, made status failures use correct text

* Revert overrides.ts

* Comment fix

* Fixed confusion message not appearing for misty terrain blockages

* Fixed bug

* re-added import

* Update battler-tags.ts

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>

* Added exhaustiveness checking

* ran boime

---------

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
2025-06-24 17:50:35 -07:00
NightKev
232f26a60d
[Dev] Migrate from npm to pnpm (#6018)
* Replace `package-lock.json` with `pnpm-lock.yaml`

* Update `package.json`

* Update `lefthook.yml`

* Update GitHub workflows

* Update references to `npm`/`npx`

* Update `CONTRIBUTING.md`

* Update `linting.md` and `comments.md`

* Update comment in `create-test.js`

* Add missing dependency `chalk` for `create-test.js`
2025-06-23 17:05:59 -07:00
Bertie690
6547e1d5ce
[Dev] Update depcruiser to enforce no non-type export in src/@types/
https://github.com/pagefaultgames/pokerogue/pull/5949

* Add depcruiser rule to enforce no non-type export in `src/@types`

* Add missing field in config

* Fixed type import inside `move.ts`
2025-06-22 18:34:06 -07:00
Sirz Benjie
8afedc33d7
[Refactor] [Ability] Ab attr apply type safety (#6002)
* [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>
2025-06-22 18:23:08 -07:00
Sirz Benjie
9fd79edcb2
[Refactor] Refactor evo phase (#5735)
* 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
2025-06-22 18:11:38 -07:00
Bertie690
36c79a9a69
[Bug] Reworked BattlerTag/ArenaTag code to prevent breakage on 0 PIDs
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>
2025-06-22 17:29:37 -07:00
Lugiad
7b95b41da3
[i18n] Large Numbers Abbreviations Translation (#6021)
* Large Number Abbreviations opended for transaltion

* Large Number Abbreviations opended for transaltion

* Apply Biome

---------

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
2025-06-22 17:11:16 -06:00
Lugiad
9c0c163257
[UI/UX] [Localization] Pokémon summary background update (#6019) 2025-06-21 12:22:07 -07:00
Dean
2de9aa83cd
[Misc] Add CONTRIBUTING.md and rewrite README.md (#5621)
* Add CONTRIBUTING.md

* Update CONTRIBUTING.md

* Update code tags

* Fix missing space

* Fix pokecorpus link

* Apply suggestions from code review

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Bertie690 <136088738+Bertie690@users.noreply.github.com>

* Update links

* Update node version

Co-authored-by: Bertie690 <136088738+Bertie690@users.noreply.github.com>

* Add Discord server link to `CONTRIBUTING.md`

---------

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
Co-authored-by: Bertie690 <136088738+Bertie690@users.noreply.github.com>
2025-06-20 23:59:28 -07:00
NightKev
4fc77e4de9
[Dev] Update Biome to 2.0.0 (#6004)
* 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
2025-06-20 23:24:11 -07:00
Matilde Simões
9f67e06279
[Balance] [AI] Trainer Pokémon will be less likely to switch out on low health (#5981)
* Implemented AI improvements:

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>

* Corrected grammar error in variable declaration in getMatchupScore
Signed-off-by: Fuad Ali <fuad.ali@tecnico.ulisboa.pt>
Co-authored-by: Matilde Simões <matilde.simoes@tecnico.ulisboa.pt>

---------

Signed-off-by: Matilde Simões <matilde.simoes@tecnico.ulisboa.pt>
Co-authored-by: Fuad Ali <fuad.ali@tecnico.ulisboa.pt>
Co-authored-by: Sirz Benjie <142067137+SirzBenjie@users.noreply.github.com>
Co-authored-by: damocleas <damocleas25@gmail.com>
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
2025-06-20 17:06:37 -04:00
AJ Fontaine
e00c9e02fb
[Balance] Change Kirlia and Snorunt evolutions to match mainline (#5994)
* Gallade and Froslass use the Dawn Stone

* Dawn Stone still shows up when Kirlia/Snorunt evo paused

* Fix lint
2025-06-20 20:51:19 +00:00
NightKev
4b70fab608
[Bug] Remove message for Rock Head activation (#6014) 2025-06-19 20:59:55 -07:00
lnuvy
1ff2701964
[Bug] Fix when using arrow keys in Pokédex after catching a Pokémon from mystery event (#6000)
fix: wrap setOverlayMode args in array to mystery-encounter

Co-authored-by: Sirz Benjie <142067137+SirzBenjie@users.noreply.github.com>
2025-06-19 20:45:54 -04:00
Bertie690
1e306e25b5
[Move] Fixed Chilly Reception displaying message when used virtually
https://github.com/pagefaultgames/pokerogue/pull/5843

* Fixed Chilly Reception displaying message when used virtually

* Fixed lack of message causing Chilly Reception to fail

* Fixed tests

* Reverted bool change + fixed test

* Fixed test
2025-06-19 17:14:05 -07:00
Madmadness65
43aa772603
[UI/UX] Add Pokémon category flavor text to Pokédex (#5957)
* Add Pokémon category flavor text to Pokédex

* Append `_category` to locale entry
2025-06-20 00:04:57 +00:00
damocleas
6873a89296
1.9.6 to Beta
1.9.6 to Beta
2025-06-18 23:29:29 -04:00
NightKev
0ba3e52f77 Fix merge issue 2025-06-18 18:30:22 -07:00
NightKev
560ebbaee2 Merge branch 'beta' into minor-1.9.6 2025-06-18 18:27:37 -07:00
AJ Fontaine
4de7858f00
[i18n] Update locales (#6010)
Update locales
2025-06-18 21:19:25 -04:00
NightKev
e3c8e3141e
Merge pull request #6009 from Fontbane/locafix
[i18n] Map "biome" namespace to the filename change to "biomes" (#6001)
2025-06-18 18:14:37 -07:00
NightKev
30b2f95a30 [i18n] Map "biome" namespace to the filename change to "biomes" (#6001)
* [i18n] Map "biome" to the filename "biomes"

* Update locales submodule to bring in file rename
2025-06-18 21:11:15 -04:00
AJ Fontaine
1d669719a0
Bump version name to 1.9.6 2025-06-18 19:53:13 -04:00
AJ Fontaine
663e047af8
[Event] W event (#6006)
W event
2025-06-18 19:52:40 -04:00
AJ Fontaine
80ae42d3ba
[Sprite] Minior and Ferrothorn variants (#6005)
* Minior variants

* Add Ferrothorn variants

* Fix shiny Minior front and icons
2025-06-18 19:49:21 -04:00
Sirz Benjie
182397411e
[Bug] Fix infinite memory mushrooms (#5993)
* Set cost to -1 for modifiers chosen as rewards

* Ensure apply modifier conditional retains original behavior
2025-06-18 17:23:16 -04:00
AJ Fontaine
59a00e0af3
[Sprite] Fix Appletun variants (#6003)
Fix Appletun variants
2025-06-17 23:54:58 -04:00
Bertie690
4119dfbfec
[Test] Fix flaky gastro acid test (#5996) 2025-06-17 13:51:19 -07:00
NightKev
28b6c7e50d
[i18n] Map "biome" namespace to the filename change to "biomes" (#6001)
* [i18n] Map "biome" to the filename "biomes"

* Update locales submodule to bring in file rename
2025-06-17 12:35:39 -07:00
AJ Fontaine
2065f4fd7f
[Bug] Fix incorrect form key being checked for evo items (#5995) 2025-06-17 10:08:20 -07:00
Sirz Benjie
6ff258fb37
[Bug] Fix weather form changes not changing with weather abilities
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>
2025-06-16 06:02:09 -07:00
AJ Fontaine
e3108603e3
[Refactor] Rework evolution conditions and descriptions (#5679)
* 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>
2025-06-16 05:57:51 -07:00
Bertie690
ccceaac877
[Test] Reworked crit override to allow for forced crits (#5738)
* Crit override stuff

* Update ability.ts

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>

* Update pokemon.ts

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>

* Update game-mode.ts

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>

---------

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
2025-06-16 05:36:09 -07:00
AJ Fontaine
ebc6ff2ed3
[Refactor] Clean up shiny/HA reroll methods (#5803) 2025-06-16 05:18:44 -07:00
Bertie690
5efdb0dc0b
[Refactor] Fix issues with "last move selected" vs "used" (#5810)
* 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>
2025-06-15 10:52:44 -07:00
NightKev
f8d8a3de84
[Dev] Enable dependency cruiser workflow (#5966)
* 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`
2025-06-15 00:51:21 -07:00
Bertie690
0918985a63
[Test] Remove unneeded mockRestore and testTimeout calls in tests
https://github.com/pagefaultgames/pokerogue/pull/5927/

* Removed unnecessary test timeout parameters from test files

We set it in vitest config anyways

* Removed unneeded `mockRestore` calls

We call `restoreAllMocks` after each test runs anyhow

* Removed accidentall forgotten-about timeout

* Revdrt magic bounce test file for now

* Fixed ting

* Fixed bug

* Fixed import

* Update test/data/status_effect.test.ts

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>

* Update battle.test.ts

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>

* Ran bim

---------

Co-authored-by: Sirz Benjie <142067137+SirzBenjie@users.noreply.github.com>
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
2025-06-15 00:48:16 -07:00
Bertie690
061c987265
[Test] Convert game.override calls into chained line where possible
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>
2025-06-15 00:40:41 -07:00
Dean
18ba33e6f0
[Bug] Fix zombie pokemon in Fun+Games ME (#5992) 2025-06-15 00:36:28 -07:00