Commit Graph

91 Commits

Author SHA1 Message Date
Bertie690
6660e33836 Merge remote-tracking branch 'upstream/beta' into modifier 2025-08-07 14:13:39 -04:00
thisPieonFire
4edcdc9192
[Bug] [Move] Court Change now swaps Safeguard and Pledge Effects (#6069)
* Add unit test for the "Court Change" move

* Update test/moves/court-change.test.ts

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

* Update test/moves/court-change.test.ts

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

* Add unit test for the "Court Change" move

* Improve formatting in the "Court Change" move unit test

* Update test/moves/court-change.test.ts

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

* Update test/moves/court-change.test.ts

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

* Update test/moves/court-change.test.ts

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

* Update test/moves/court-change.test.ts

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

* Update test/moves/court-change.test.ts

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

* Update test/moves/court-change.test.ts

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

* Update test/moves/court-change.test.ts

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

* Update test/moves/court-change.test.ts

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

* Added missing import

* Added missing import (ArenaTagSide)

* Update court-change.test.ts

---------

Co-authored-by: PieonFire <purpledream96@hotmail.com>
Co-authored-by: Bertie690 <136088738+Bertie690@users.noreply.github.com>
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
2025-08-06 08:48:11 -04:00
Jimmybald1
3b36ab17e4
[Bug] Protect now tracks success chance properly (#5869)
* Protect rng now resets on new waves and fixed to look at all turns in the same wave.

* Added per-wave move history object to fix issues

@Jimmybald1 I added a commented out `console.log` in the protect code (L5797) for you to use for testing

* Added many tests

* Wave move history has to be looped in reverse

* Update src/data/moves/move.ts

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

* Update src/data/moves/move.ts

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

* comments

* Fixed forceEnemyMove references after merge

* Removed console log

Co-authored-by: Amani H. <109637146+xsn34kzx@users.noreply.github.com>

* Fixed test message

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

* Apply Biome

* Fix merge issues

* Fix Crafty Shield test

* Remove protect chance reset on wave change

* Fix merge issue

---------

Co-authored-by: Jimmybald1 <147992650+IBBCalc@users.noreply.github.com>
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
Co-authored-by: Amani H. <109637146+xsn34kzx@users.noreply.github.com>
Co-authored-by: Bertie690 <136088738+Bertie690@users.noreply.github.com>
2025-08-05 07:35:14 +02:00
Bertie690
8da02bad50
[Test] Replace game.scene.getXPokemon()! with game.field.getXPokemon()
https://github.com/pagefaultgames/pokerogue/pull/6178

* Replaced all instances of `game.scene.getXXXPokemon()!`
inside tests with `game.field.getXXXPokemon()`

* Fixed tests

* Fixed oblivious test

* Fix Grudge test
2025-08-04 21:19:57 -07:00
Bertie690
e50296d14c
Merged upstream/beta into Modifier rework (#6206)
* [Dev] test:silent now passes --silent='passed-only' to Vitest (#6131)

* [Dev] test:silent now passes --silent='passed-only' to Vitest

* Update test shard to actually use `test-silent`

* Removed obselete `project` flag

* [Bug] Unblock priority spread under Psychic Terrain (#6136)

Unblock priority spread under Psychic Terrain

Co-authored-by: Acelynn Zhang <acelynnzhang@Acelynns-MacBook-Pro.local>

* [Dev] Remove `sanitizeOverrides`, consolidate initialization code into 1 file

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>

* [Misc] Sinistea and Poltchageist line alt forms now available (#4989)

* Sinistea and Poltchageist line alt forms now available

* Unmark Poltchageist line as unobtainable, fix sprite key of alt forms

* Correct forms not being marked as starter selectable

* Reduce wild chance for Antique/Masterpiece forms

Instead of being 1/2 chance to get the Antique or Masterpiece forms, it is now only a 1/16 chance to get them.

---------

Co-authored-by: damocleas <damocleas25@gmail.com>

* [Bug] Fix when variable move power is called (#6126)

* Apply variable power attribute before type boost

* Update test/abilities/normal-move-type-change.test.ts

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

* Minor test improvements

---------

Co-authored-by: Sirz Benjie <142067137+SirzBenjie@users.noreply.github.com>
Co-authored-by: Bertie690 <136088738+Bertie690@users.noreply.github.com>
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>

* [UI/UX] [Bug] Fix `ModifierSelectPhase` animation delay (#6121)

* Rework promise handling to ensure no races

* Add delay to ensure pokeball opening animation can be seen

* Remove leftover debug statements.

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

* Add tween bouncing pokeball to tweens that must complete for promise to resolve

* Fix typo in tsdoc

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

---------

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

* [Test] `MoveHelper#changeMoveset` disables moveset overrides (#5915)

Also fix Assist tests and add `expect` for max moveset length

* [Refactor] Minor cleanup of `initExpKeys` (#6127)

* [Bug] Fix Thrash continuing on caught Pokemon (#6144)

Fix Thrash continuing on caught Pokemon

* [UI/UX] Replace 'Neutral' in the Arena Flyout with 'Field' (#6139)

Update arena-flyout.ts for Field > Neutral

* [Dev] Added typedoc deployments for Beta (#6147)

* [Misc] Fix import in decrypt-save.js (#6149)

* [Refactor][Bug] Illusion no longer overwrites data of original Pokemon

https://github.com/pagefaultgames/pokerogue/pull/6140

* [UI/UX] Added "Hide Username" Setting (#6105)

* [UI/UX] Added "Hide Username" Setting

* Mask tid with asterisk instead of hiding completely

---------

Co-authored-by: Sirz Benjie <142067137+SirzBenjie@users.noreply.github.com>

* [Dev] Add `dist/` to `ls-lint` ignore list

* [i18n] Update Locales

* [Beta] [Bug] Fix shiny display issues (#6154)

Fix shininess check

* [Bug][Beta] Make bounce delay use fixed int (#6156)

Make bounce delay use fixed int

* [Refactor] Refactor UI text ts (#5946)

* Add destroy method to pokemon-sprite-sparkle-handler

* Move TextStyle to enums, convert into const object

* Cleanup text.ts file

* Add necessary explicit types for TextStyle let vars

* Fix locales submodule commit

* Fix merge issue

---------

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

* [Test] Added custom equality matchers (#6157)

* 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>

* [Misc] Fix import in `vitest.d.ts`

* [Dev] Turned on `checkJs` in TSConfig; fixed script type errors (#6115)

* [Misc] Moved + cleaned up string manipulation functions (#6112)

* 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

* [Refactor] Prevent serialization of full species in pokemon summon data

https://github.com/pagefaultgames/pokerogue/pull/6145

* Prevent serialization of entire species form in pokemon summon data

* Apply suggestions from code review

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

* Apply Kev's suggestions from code review

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

---------

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

* [Docs] Add `@module` modifier tag to `tsdoc.json`

* [Bug] Fix camel case bug in `strings.ts` (#6161)

* [Dev] Change `target` to `ES2023` in `tsconfig.json` (#6160)

* breakup fight and ball commands into their own methods

* Breakup run and pokemon commands

* Breakup commandPhase#start

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

* Minor touchups

* Add overload for handle command

* Fix improperly named computeMoveId method

* Improve `canUse` computation

* Explicitly check against Moves.NONE

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

* Update with Bertie's comments

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

* Fix imports

* Apply kev's suggestions from code review

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

* Improve documentation

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

* [Balance][Challenge] Added expanded Fresh Start options (#6162)

* [Dev] Add `workflow-dispatch` trigger to tests github workflow (#6152)

Add `workflow-dispatch` trigger to github workflow

Co-authored-by: damocleas <damocleas25@gmail.com>

* [Test] Add support for custom boilerplates to `create-test.js` (#6158)

* Added support for custom boilerplates to test:create script

* Added support for custom boilerplates to create-test.js

* Fixed syntax error

* Update create-test.js

Co-authored-by: Amani H. <109637146+xsn34kzx@users.noreply.github.com>

* Fix pluralization error in `create-test.js`

---------

Co-authored-by: Amani H. <109637146+xsn34kzx@users.noreply.github.com>

* [Refactor] Mark nickname in pokemon as optional (#6168)

Mark nickname in pokemon as optional

* [Dev] Update Vite from 6.3.5 to 7.0.6 (#6163)

* [ME] [Bug] Disable trades in GTS ME with only 1 valid party member

https://github.com/pagefaultgames/pokerogue/pull/6167

* [Refactor] Minor refactor of battler tags (#6129)

* Minor refactor battler tags

* Improve documentation

* Update type when loading in pokemon-data constructor for battler tags

* Fix issues in tsdoc comments with Wlowscha's suggestions

Co-authored-by: Wlowscha <54003515+Wlowscha@users.noreply.github.com>

* Apply bertie's suggestions from code review

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

* Remove unnecessary as const from tagType

* Remove missed `as const`

* Apply kev's suggestions from code review

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

* Update src/data/battler-tags.ts

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

* Update src/data/battler-tags.ts

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

---------

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

* [Docs] Adjust `@module` doc comment in `battler-tags.ts`

Note that currently Typedoc is not parsing `@module` docs,
but this comment adjustment would be required if and when
it gets fixed

* [Balance] End of turn triggers won't occur when you end a biome (#6169)

* [Balance] End of turn triggers won't occur when you end a biome

* Add tests

* Move phase manipulation logic into `PhaseManager`

* Rename "biome end" to "interlude"

* Rename `TurnEndPhase#endOfBiome` to `upcomingInterlude`

---------

Co-authored-by: Wlowscha <54003515+Wlowscha@users.noreply.github.com>

* [Test] Add missing single battle override to `CheckInterludePhase` test

* [UI/UX] Fix button and input field overlaps (#6013)

* [Fix] Fix button overlap

* [Fix] Fix input field overlaps

* use getWidth to determine if label should be shortened

---------

Co-authored-by: Sirz Benjie <142067137+SirzBenjie@users.noreply.github.com>
Co-authored-by: damocleas <damocleas25@gmail.com>

* [Dev] Moved type helpers to separate directory; (#6123)

* [Dev] Moved type helpers to separate directory; renamed `EnumValues` to `ObjectValues` and enforced usage

* Update tsconfig.json

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

* Fixed import issue

* Updated documentation slightly

---------

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

* [Misc] Improve type signatures of serialized arena/battler tags (#6180)

* Improve type signatures of serialized arena/battler tags

* Minor adjustments to tsdocs from code review

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

---------

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

* [Balance] Updated SF/Triage interactions for moves (#6179)

* Fixed move flags

* Disabled order up interactionn with sheer force

* Update src/data/moves/move.ts

* Removed order up test that no longer applies

shouldn't have been there in the first place

* [Move Bug] Fully implemented Future Sight, Doom Desire; fixed Wish Double battle oversight  (#5862)

* Mostly implemented Future Sight/Doom Desire

* Fixed a few docs

* Fixed com

* Update magic_guard.test.ts

* Update documentation

* Update documentation on arena-tag.ts

* Update arena-tag.ts docs

* Update arena-tag.ts

* Update turn-end-phase.ts

* Update move.ts documentation

* Fixed tpyo

* Update move.ts documentation

* Add assorted TODO test cases

* Refactored FS to use a positional tag manager

* Added strong typing to the manager, finished save load stufff

* Fixed locales + tests

* Fixed tests and documentation

* sh
Fixed tests for good

* Fixed MEP

* Reverted overrides changse

* Fixed issues with merging

* Fixed locales update & heal block test

* Fixed wish tests

* Fixed test typo

* Fixed wish test flaking out due to speed ties

* Fixed tests fr fr

* actually fixed tests bc i'm stupid

* Fixed tests for real

* Remove locales update

* Update arena-tag.ts

Co-authored-by: Dean <69436131+emdeann@users.noreply.github.com>

* Update move.ts

Co-authored-by: Dean <69436131+emdeann@users.noreply.github.com>

* Update arena-tag.ts

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

* Applied review suggestions and added a _wee_ bit more docs

* fixed wish condition

* Applied kev's reviews

* Minor nits

* Minor formatting change in `heal-block.test.ts`

---------

Co-authored-by: Sirz Benjie <142067137+SirzBenjie@users.noreply.github.com>
Co-authored-by: Dean <69436131+emdeann@users.noreply.github.com>
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>

* [Refactor] Added `PhaseManager.toTitleScreen` (#6114)

* Added `toTitlePhase`; documented phase manager

* Documented phase methods

* Fixed syntax errors + updated signature

* Reverted all the goodies

* Fixed missing shift phase call

GHAG

* Reverted change

* [UI/UX] Implement Discard Button (#5985)

* [feature]Implemented needed parts for discard function from issue #4780:
-TryDiscardFunction in battlescene;
-Created a party discard mode button;
-Updated Transfer button in modifier-select-ui-handler to Manage items;
-Created tests for the discard function in test/ui;
-Added images for the new discard and transfer buttons to loading-scene;
-Created placeholder messages for discard feature in party-ui-handler;

Co-authored-by: Tiago Rodrigues <tiago.n.rodrigues@tecnico.ulisboa.pt>

* [Fix] Updated icon for dynamic messaging

* [Fix] Corrected legacy mode icons and adjusted double-battle button location

* [Fix]Adjusted button positioning and mapping after review. Mapping requires debugging.

* [Fix] Fixed visible pokeball in legacy mode and key mapping

* [Fix] Background fixes,manage menu is the only one affected by changes now

* Implement i18n keys

* [Fix] implemented most code optimizations and callbacks to the modified locales folder

* [Fix] Implemented 3 suggestions

* [Fix]improved/corrected test structure

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

* [Fix] added functionality test for the discard button

* [Fix] added necessary comment

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

* [Fix] Implemented suggested changes in test/discard text prompt

* [Fix] Implemented UI suggestions and removed discard text confirmation

* [Fix] added missing imports

* Fix imports in test file

* [Fix] Implemented suggested cursor behavior and reworked test code

* [Fix] Corrected failed test

* [Fix] atempting to fix the test timeout issue

* [Fix] Undoing latest attempt

* [Fix] Implemented suggestions to fix broken tests

* Reviews

* [Fix] replaced icon images

* [Fix] Updated jsons to match new icons and removed pokeball icon from legacy mode

* Optimized new images

* [Fix] Fixed referenced bug and added similar confirmation box to release

* [Fix] Updated tests to handle the corfirmation box

* [Fix] Added back the accidentally removed changes

* [Fix]updated incorrect import path

* [fix] add description for the manageItemMode function

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

* Update src/ui/party-ui-handler.ts

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

* [Fix] corrected formating issue

---------

Co-authored-by: Mikhail Shueb <mikhail.shueb@tecnico.ulisboa.pt>
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
Co-authored-by: Bertie690 <136088738+Bertie690@users.noreply.github.com>
Co-authored-by: damocleas <damocleas25@gmail.com>
Co-authored-by: Bertie690 <taylormw163@gmail.com>
Co-authored-by: Adri1 <adrien.grivel@hotmail.fr>

* [Bug] Fix Truant behavior (#6171)

* Update locales

* [i18n] Add Tagalog language support (#6170)

* [Bug] [Beta] Fix serializable battler tags (#6183)

Fix serializable battler tags

* [Misc] [Beta] Fix serializable battler tags (#6184)

Fix serializable battler tags

* [Misc] Disallow using NonFunctionProperties in loadTag methods (#6185)

Disallow using NonFunctionProperties in loadTag methods

* [Dev] `pnpm biome` will now only display errors by default (#6187)

* [Sprite] Move Clauncher, Clawitzer, Skiddo, Fomantis, Lurantis animations to consistent (#6177)

* Move Clauncher, Clawitzer, Skiddo out of exp

* Move Fomantis, Lurantis out of exp

* [Misc] Fix missing types in battler tags and remove DragonCheerTag (#6188)

* Fix missing types in battler tags

* Fix issues with dragon cheer

* [Misc] Set default for crit stage battler tag (#6192)

Set default for crit stage

* [Bug] [Beta] Remove setting currentPhase to null in clearAllPhases (#6193)

Remove setting currentPhase to null in clearAllPhases

* [Test] `game.move.use` overrides summon data moveset if present (#6174)

* [Test] Update `game.move.use` to override summon data moveset if present

* ran biome & fixed errors

* [Beta] Remove non-Legend Fresh Start option, fix starting movesets

https://github.com/pagefaultgames/pokerogue/pull/6196

* Remove non-Legend fresh start option, fix starting movesets

* Move updateInfo call

* Fix relearns counting for starter moves

* Reduce array allocations and function calls

* [Misc] Move asset initialization from `preload` to `launchBattle`

https://github.com/pagefaultgames/pokerogue/pull/6109

* Move asset initialization into `preload` instead of `launchBattle`

* Fix init problems; remove unused `waitUntil` util function

* Fixed missing `clearAllPhases` call

* [Balance] Adjust Cosmog / Cosmoem Evolutions, Lower Buneary Friendship requirements (#6198)

* Lower Buneary Friendship Requirement and Change Cosmog method

* Update biomes.ts - Cosmog/Cosmoem wild evo levels

* fix ?

* fixed now

* Update Cosmog Evolution + Biome Levels

---------

Co-authored-by: damocleas <damocleas25@gmail.com>

* [Test] Port over + augment remaining test matchers from pkty (#6159)

* Partially ported over pkty matchers (WIP)

* Cleaned up some more matchers

* Fiexd up matchers

* Fixed up remaining matchers

* Removed the word "matcher" from the pkty matcher functions

If we want them back we can always undo this commit and convert the other custom ones

* Added wip spite test

* Added `toHaveUsedPP` matcher

* Fixed up docs and tests

* Fixed spite test

* Ran biome

* Apply Biome

* Reverted biome breaking i18next

* Update src/typings/i18next.d.ts comment

* Fixed log message to not be overly verbose

* Added option to check for all PP used in pp matcher + cleaned up grudge tests

* Fixed up tests

* Fixed tests and such

* Fix various TSDocs + missing TSDoc imports

* [Beta] Further Cosmog Evolution Readjustments (#6203)

Update pokemon-evolutions.ts

* [Dev] Move various functions out of `pokemon-species.ts` (#6155)

`initSpecies` moved to its own file,
other functions moved to `pokemon-utils.ts`

* [Balance] Prevent MEs on X1 Waves (#6204)

* [Balance] Prevent MEs on X1 Waves

* Fix Bug-Type Superfan Encounter Test

* Fix Unit Tests

* [Balance] Update and Change Breeder Trainer Class Teams (#6200)

* Update Breeder Trainer Class

* Update trainer-config.ts

* Update trainer-config.ts

* Update whirlwind.test.ts

* Update src/data/trainers/trainer-config.ts

Co-authored-by: AJ Fontaine <36677462+Fontbane@users.noreply.github.com>

* Adjust Party Templates and move Wynaut

* Update trainer-party-template.ts

---------

Co-authored-by: damocleas <damocleas25@gmail.com>
Co-authored-by: AJ Fontaine <36677462+Fontbane@users.noreply.github.com>

---------

Co-authored-by: Acelynn Zhang <102631387+acelynnzhang@users.noreply.github.com>
Co-authored-by: Acelynn Zhang <acelynnzhang@Acelynns-MacBook-Pro.local>
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
Co-authored-by: Madmadness65 <59298170+Madmadness65@users.noreply.github.com>
Co-authored-by: damocleas <damocleas25@gmail.com>
Co-authored-by: Sirz Benjie <142067137+SirzBenjie@users.noreply.github.com>
Co-authored-by: SmhMyHead <191356399+SmhMyHead@users.noreply.github.com>
Co-authored-by: Amani H. <109637146+xsn34kzx@users.noreply.github.com>
Co-authored-by: AJ Fontaine <36677462+Fontbane@users.noreply.github.com>
Co-authored-by: Wlowscha <54003515+Wlowscha@users.noreply.github.com>
Co-authored-by: fabske0 <192151969+fabske0@users.noreply.github.com>
Co-authored-by: Dean <69436131+emdeann@users.noreply.github.com>
Co-authored-by: Tiago Rodrigues <tiago.n.rodrigues@tecnico.ulisboa.pt>
Co-authored-by: Mikhail Shueb <mikhail.shueb@tecnico.ulisboa.pt>
Co-authored-by: Adri1 <adrien.grivel@hotmail.fr>
Co-authored-by: Blitzy <118096277+Blitz425@users.noreply.github.com>
2025-08-04 00:08:37 +02:00
Blitzy
8a2b888971
[Balance] Update and Change Breeder Trainer Class Teams (#6200)
* Update Breeder Trainer Class

* Update trainer-config.ts

* Update trainer-config.ts

* Update whirlwind.test.ts

* Update src/data/trainers/trainer-config.ts

Co-authored-by: AJ Fontaine <36677462+Fontbane@users.noreply.github.com>

* Adjust Party Templates and move Wynaut

* Update trainer-party-template.ts

---------

Co-authored-by: damocleas <damocleas25@gmail.com>
Co-authored-by: AJ Fontaine <36677462+Fontbane@users.noreply.github.com>
2025-08-03 16:53:10 -04:00
Bertie690
5ed9e152ab
[Test] Port over + augment remaining test matchers from pkty (#6159)
* Partially ported over pkty matchers (WIP)

* Cleaned up some more matchers

* Fiexd up matchers

* Fixed up remaining matchers

* Removed the word "matcher" from the pkty matcher functions

If we want them back we can always undo this commit and convert the other custom ones

* Added wip spite test

* Added `toHaveUsedPP` matcher

* Fixed up docs and tests

* Fixed spite test

* Ran biome

* Apply Biome

* Reverted biome breaking i18next

* Update src/typings/i18next.d.ts comment

* Fixed log message to not be overly verbose

* Added option to check for all PP used in pp matcher + cleaned up grudge tests

* Fixed up tests

* Fixed tests and such

* Fix various TSDocs + missing TSDoc imports
2025-08-02 15:35:06 -07:00
Bertie690
f7b87f3d1e
[Move Bug] Fully implemented Future Sight, Doom Desire; fixed Wish Double battle oversight (#5862)
* Mostly implemented Future Sight/Doom Desire

* Fixed a few docs

* Fixed com

* Update magic_guard.test.ts

* Update documentation

* Update documentation on arena-tag.ts

* Update arena-tag.ts docs

* Update arena-tag.ts

* Update turn-end-phase.ts

* Update move.ts documentation

* Fixed tpyo

* Update move.ts documentation

* Add assorted TODO test cases

* Refactored FS to use a positional tag manager

* Added strong typing to the manager, finished save load stufff

* Fixed locales + tests

* Fixed tests and documentation

* sh
Fixed tests for good

* Fixed MEP

* Reverted overrides changse

* Fixed issues with merging

* Fixed locales update & heal block test

* Fixed wish tests

* Fixed test typo

* Fixed wish test flaking out due to speed ties

* Fixed tests fr fr

* actually fixed tests bc i'm stupid

* Fixed tests for real

* Remove locales update

* Update arena-tag.ts

Co-authored-by: Dean <69436131+emdeann@users.noreply.github.com>

* Update move.ts

Co-authored-by: Dean <69436131+emdeann@users.noreply.github.com>

* Update arena-tag.ts

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

* Applied review suggestions and added a _wee_ bit more docs

* fixed wish condition

* Applied kev's reviews

* Minor nits

* Minor formatting change in `heal-block.test.ts`

---------

Co-authored-by: Sirz Benjie <142067137+SirzBenjie@users.noreply.github.com>
Co-authored-by: Dean <69436131+emdeann@users.noreply.github.com>
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
2025-07-30 22:43:06 -06:00
Bertie690
12acaa9590
[Balance] Updated SF/Triage interactions for moves (#6179)
* Fixed move flags

* Disabled order up interactionn with sheer force

* Update src/data/moves/move.ts

* Removed order up test that no longer applies

shouldn't have been there in the first place
2025-07-31 03:55:52 +00:00
NightKev
7b7edbb474
[Test] MoveHelper#changeMoveset disables moveset overrides (#5915)
Also fix Assist tests and add `expect` for max moveset length
2025-07-25 16:22:52 -07:00
Sirz Benjie
d3f2659cdf
Merge branch 'beta' into modifier-rework 2025-07-24 16:00:14 -06:00
Sirz Benjie
51d4c33de0
[Misc] Standardize-file-names (#6137)
* 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>
2025-07-24 16:38:31 -04:00
Wlowscha
ccd968d5b8
Merge branch 'beta' of https://github.com/pagefaultgames/pokerogue into new-modifier-rework 2025-07-24 20:36:27 +02:00
Bertie690
6aa5c03b75
[Test] Removed unnecessary calls to PhaseInterceptor.to("CommandPhase") (#6108)
* [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>
2025-07-21 17:44:39 +00:00
Wlowscha
e1edb87990
Merge https://github.com/pagefaultgames/pokerogue into new-modifier-rework 2025-07-19 16:30:48 +02:00
NightKev
fcdbf16bc3 [Test] Fix first-attack-double-power.test.ts tests
The trainer type overrides appear to be bugged currently
2025-07-15 23:40:27 -07:00
NightKev
2e06b10f40 [Test] Fix Bolt Beak/etc test 2025-07-15 00:34:03 -07:00
Sirz Benjie
de8491505b
[Test] Address flaky tests and add Metronome mock helper (#6093)
- Fix `copycat`, `first-attack-double-power` and `ability-ignore-moves`

* Add utility method for forcing metronome move

* Stop bolt beak / fiscious rend flakiness
2025-07-13 22:20:09 -07:00
NightKev
22e399be8b [Test] Disable flaky test 2025-07-13 21:23:34 -07:00
Wlowscha
e034d7e04e
Added test override for pokeballs 2025-07-13 13:04:46 +02:00
Wlowscha
d411702716
Cleaned up more files 2025-07-13 12:34:18 +02:00
NightKev
c697a47f5b Apply Biome 2025-07-13 02:34:03 -07:00
NightKev
cd2f0b8a6e Merge branch 'beta' into modifier-rework 2025-07-13 02:32:49 -07:00
NightKev
8cf1b9f766
[Dev] Enable Biome import sorting (#6052)
* [Dev] Enable Biome import sorting

Additional changes:

- Implement import aliases

- Convert default exports to named exports

- Remove relative imports

* Apply changes

* Misc fixes

* Merge cleanup
2025-07-13 00:21:25 -07:00
Jonathan Bankston
22c386ea9e
[BUG] Fix Transform and Imposter issues (#6008)
* 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>
2025-07-12 23:39:48 -07:00
Bertie690
12fbff71d2
[Test] Added tests for Intimidate, Fishious Rend/Bolt Beak, Payback and Moongeist Beam & co. (#5858)
* Added additional tests for intimidate & ability-ignoring moves

* Added a few basic tests for Fishious Rend and Bolt Beak

* Fixed comment

* Fixe test and added commetn

* Update first-attack-double-power.test.ts

* Fixed incorrect ignore-abilities.test.ts test suite description

* Update ignore-abilities.test.ts suite name

* Fix first-attack-double-power.test.ts

* Actually fixed import

* Update intimidate.test.ts

* Fix test imprts

* Added guard dog tests

* Fixed tests

* Renamed test file

* Added Payback tests

* Fixed accidental unusde class

* Fixed tests

* Fixed flaky test due to 1 length trainer thing

* dd

---------

Co-authored-by: Wlowscha <54003515+Wlowscha@users.noreply.github.com>
2025-07-13 05:55:05 +00:00
Wlowscha
414a6b10ea
Cleaned up more tests 2025-07-13 00:42:29 +02:00
Wlowscha
7e2418b957 Held item refactor (#5656)
* Introducing held items

* Pokemon class can add held items

* Example of applyHeldItemAttrs

* Introducing a PokemonItemManager class

* Moving away from HeldItemAttr

* Attempt at incorporating the new framework in modifier-type

* Changes

* More changes

* Splitting up methods in select-modifier-phase.ts

* Newrefactors of reward-pool-manager.ts

* New refactors of select-modifier-phase.ts

* Extracted logic from modifierSelectCallback

* Moved some files around, added many held item ids

* Introduced HeldItemReward class

* Introduced AttackBoosterReward

* Introduced AttackBoosterRewardGenerator

* Removed unused file

* Select modifier phase tentatively working with new held items

* Working leftovers in new style

* Moved modifier-bar to its own file

* Held items now show up in summary

* Added some suggestions

* Implemented more suggestions

* Splitting up held-item file

* Fixing various imports

* Created items folder

* Shell bell

* Converted White Herb

* HeldItem .apply() methods do not really need the stack as input, just the pokemon

* Made heldItems public in heldItemManager

* Update modifier bar is now called in the apply of consumable held items

* Refactored parameters passed to .apply() methods; introduced generic .applyHeldItems() function; all HeldItems classes specify an ITEM_EFFECT

* Lucky egg and Golden egg

* Converted wild pokemon pool to held item rewards

* Temporary stopgap on maxUpgradeCount to avoid game crashing on modifier select ui handler

* Changed held-items.ts to held-item-id.ts and renamed id object accoridngly

* Added reviver seed

* Simplified HeldItemReward

* Added effect of reviver seed (leveraging consumable logic)

* Remove InstantReviveModifier

* Added Stat Boost items; generic name and description in HeldItem class

* Added Crit Boost held items, King's Rock, Focus Band and Quick Claw

* Added Mystical Rock

* Added Shell Bell, Soul Dew

* Added multi lens and wide lens

* Added Baton and Golden Punch

* Baton switch logic in party ui handler now using held item

* Partial implementation of item steal items

* Using held items in some places

* Using phaseManager

* Tracking forms in held item manager

* Shuckle Juice and Old Gateau

* Using phaseManager

* Removed a bunch of modifiers

* Fixed shell bell in ability.ts (why is it here?)

* Changed BattleScene.removeModifier and pokemon.loseHeldItem

* Making some held items unstealable and unsuppressable

* Refactored most of battle-scene.ts with held items

* Added soundName to HeldItem (possibly useless)

* Reworked various effects that steal items

* Refactored Baton logic

* Reworked most entries in Modifier Types

* pokemon.getHeldItems now uses heldItemManager

* Added Evolution Tracker as held item

* MBE is always untransferable

* Improved item transfer

* Fixed types in held item manager

* Various fixes

* Fixed types in shuckle juice and old gateau

* MBE achievement now tracks held items

* Removed AttackTypeBoosterModifierRequirement for MEs

* Fixed Pickup

* Fixing (most) berry usage

* Using Berry held items in move.ts

* Split up vitamins from the rest of stat boosting items

* Fixed form change trigger after merge conflicts

* Added some utility functions to check if an item fits a list of items/categories, or to filter out which held items fit

* Fixed delibirdy encounter

* Various fixes

* Reworked EnemyPokemonConfig to include a HeldItemProperty object (to feed to the heldItemManager). Updated Dark Deal ME

* More various fixes; introduced isMaxStack(item) method to heldItemManager

* Updated modifier-bar.ts

* Converted Berries Abound encounter

* Converted The Strong Stuff encounter

* Fixed Slumbering Snorlax encounter, overrideItems of heldItemConfiguration can deal with items with 0 stack

* Preliminary changes to some MEs

* Changes to the summary ui handler

* Converting to held item pools

* Fixed evo tracker

* Moved many data types for held items to a dedicated file; introduced held item pools for item generation

* Fixed some MEs

* Added function to assign items from a given configuration

* Fixed held item evolution condition

* Fixed some ui handlers

* Fixed select-modifier-phase

* Some changes to modifier files

* Daily run items are generated within the new system

* Held item generation for enemies follows the new scheme

* Fixed init-modifier-pools.ts

* Held item overrides now use the new system

* Removed unused getOrInferTier function (was only used by thief and covet)

* Fixed shady vitamin ME and some HeldItem files

* Updated various MEs. HeldItemManager can now generate a configuration from its items.

* Converted most MEs, introduced some more utility functions and methods

* Replaced ModifierTier with RewardTier

* Fixed some rogue inputs

* Held item pools take a single pokemon as input, set weights to 0 for max stack items

* Restored various changes to held item pool generation; distinguishing target of the generation from the party

* Pools can now take a HaldItemConfigurationId without weights; set up table of item tiers; used custom pools in Clowning Around ME

* Fixing some phases

* Fixed several bugs related to accessing and visualizing held items

* Fixed position of enemy modifier bar

* Fixed berries, removed some debug messages

* Vitamins max stack temporarily set to 30

* Luck upgrades work correctly again (maybe)

* First steps to port tests to the new system

* Form change items work correctly when selected in battle

* Introducing helper functions for a modifier migrator; PokemonItemMap now uses pokemonId

* Renamed file with item migrator functions

* Restored missing strings

* Shuckle juic and Old gateau are not instance dependent

* Simplified HeldItemData

* Migrator utils include shuckle juice

* Introducing trainer items

* Enemy tokens are now also trainer items

* Converted most of modifierTypes

* Fixed various MEs; removed findModifier from battle-scene

* Removed most uses of globalScene.applyModifiers

* Removed more functions from globalScene; changed lure weight function

* Updated a variety of files

* Split out X_accuracy, fixed trainer-item-manager

* Fixed expert breeder ME

* Replaced updateModifiers with updateItems

* Removed modifiers from saveData

* Trainer item rewards are generating during runs, added properly to the scene

* Items (including held items) are saved and loaded correctly.

* Fixed several trainer item names and descriptions, plus various issues with item generation

* Restored override file

* Added icons to tokens

* Fixed Dire Hit starting stack

* Using Pokemon.getMoveType() in generation of attack type boosters

* Test for dire hit; ensuring that lapsing trainer items are added from config at full stack

* Eviolite does not apply to G-Max forms

* Changes to various item tests

* Some still broken tests

* More changes to tests but still failing

* Fixed evo tracker item

* Moved allHeldItems and allTrainerItems definitions to data-lists

* Renamed modifier-bar and moved to ui files

* Fixed held item when pokemon not passed

* Remove `package-lock.json` added by merge issue

* Add review comments as `TODO`s for now

---------

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
2025-07-10 01:05:25 -07:00
Bertie690
2fe50cb761
[Test] Made game.move.select fail if move not in moveset (#5998)
* 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>
2025-07-02 12:46:26 -07: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
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
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
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
Bertie690
4119dfbfec
[Test] Fix flaky gastro acid test (#5996) 2025-06-17 13:51:19 -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
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
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
NightKev
7cf51d48a7 [Test] Make sure items are removed from enemies in Last Respects test 2025-06-14 05:06:46 -07:00
Sirz Benjie
1029afcdbf
[Refactor] Remove circular dependencies (part 4) (#5964)
* 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>
2025-06-11 19:42:04 -07:00
Sirz Benjie
48e911e03c
[Refactor] Remove circular deps 3 (#5959)
* 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>
2025-06-09 16:24:13 -07:00
Sirz Benjie
93745f14b7
[Refactor] Decouple phase system from battle-scene (#5953)
* Move phase logic into its own class

* Move ts ignore comment
2025-06-07 17:59:30 -07:00
Bertie690
a818c2b33f
[Bug] Dancer no longer breaks "last hit only" moves, respects flinch + steadfast (#5945)
* WIP

* Fixed Dancer last hit, flinch move interaction

* Fixed steadfast interaction

* Fixed comment + flaky test

---------

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
2025-06-06 20:50:16 -07:00
NightKev
9dcb904649
[Misc] Improve enum naming (#5933)
* 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
2025-06-04 14:54:27 -07:00
NightKev
6586790768 [Test] Fix Last Respects test 2025-06-02 16:12:45 -07:00
NightKev
1b038c5a11 [Test] Fix flaky test logging 2025-06-02 14:16:06 -07:00
NightKev
88b8e05ee8 [Test] Add extra logging to flaky Last Respects test 2025-06-01 16:18:15 -07:00
Bertie690
cdda539ac5
[Test] Remove redundant entries and Array.fill() in moveset overrides (#5907)
* Removed unneeded duplicate entries from movesets

* Removed `array.fill` in moveset overrides

* Reverted accidental changes
2025-06-01 22:45:30 +00:00
Bertie690
a33638a7a3
[Test] Remove deprecated test funcs (#5906)
* Removed `game.startBattle`

* Removed `game.forceEnemyMove`

* Removed near-unused learn move macro
2025-05-30 16:50:25 -07:00