Commit Graph

240 Commits

Author SHA1 Message Date
Wlowscha e74c2fbaa7
Merge branch 'beta' of https://github.com/pagefaultgames/pokerogue into new-modifier-rework 2025-08-27 22:58:16 +02:00
Sirz Benjie 6745ce7839
Fix starterpref reset (#6430)
* Prevent an empty starterpreferences object from being saved

* Fix ssui nullish coalescing

* Update src/utils/data.ts

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

* Fix starter preferences clearing, add tests

---------

Co-authored-by: Wlowscha <54003515+Wlowscha@users.noreply.github.com>
Co-authored-by: Dean <69436131+emdeann@users.noreply.github.com>
2025-08-26 12:11:16 -05:00
Wlowscha 63c1c34746
[Hotfix] Fix tyrogue evo (#6414)
* Fixed tyrogue evo condition

* Added test for tyrogue evolution

* Update src/data/balance/pokemon-evolutions.ts

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

* Update src/data/balance/pokemon-evolutions.ts

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

* Update src/data/balance/pokemon-evolutions.ts

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

* Added missing typeof in suggestion

---------

Co-authored-by: Bertie690 <136088738+Bertie690@users.noreply.github.com>
2025-08-26 06:57:11 +00:00
Bertie690 0f8b1f63b5
[Bug/Ability] Fixed bugs with Intimidate triggers after reload/initial switch (#6212)
* Added TODO test case + documentation for failing intim test

* Fixed comment

* Fixed intimidate bugs fr fr

* Update src/data/phase-priority-queue.ts

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

* Update src/data/phase-priority-queue.ts

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

* Cleanup remove phase logic

* Do not add unnecessary activateAbilityPhases for pokemon that do not have their passive enabled

* Remove leftover log messages

* Add TODO comment

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

---------

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
Co-authored-by: Sirz Benjie <142067137+SirzBenjie@users.noreply.github.com>
2025-08-24 14:09:16 -05:00
Sirz Benjie 049932c001
[Bug] Fix status effects overwriting each other (#6392)
* Ensure status effects from same source interaction cannot override each other

* Update test/status-effects/general-status-effect.test.ts

Co-authored-by: Bertie690 <136088738+Bertie690@users.noreply.github.com>
2025-08-24 12:51:16 -05:00
Fabi 1b2c694084
[bug/i18n] Fix stealth rock message (#6377)
replace pokemonName with pokemonNameWithAffix
2025-08-23 17:26:12 -05:00
Sirz Benjie a8b54eba6d
[Test] Mark failing test/ui/manage-item-button.test.ts as TODO (#6375)
* Ensure hotfix runs tests

* Unnest promise

* ensure workflows run when pushed to hotfix

* Mark test todo
2025-08-23 16:56:58 -05:00
Dean d2eb3dba53
[Test] Fix leftovers test not running heal phase (#6370)
Fix leftovers test
2025-08-23 16:02:36 -05:00
Sirz Benjie 99bf639ea7
[Bug] [Move] Fix pollen puff (#6363)
* Ensure pollen puff does not heal enemy after damage

* Add test to ensure pollen puff does not heal enemy
2025-08-23 11:42:10 -05:00
Fabi 3b290ee9a2
[UI/UX][Bug] Prevent switch to discard mode while transferring item (#6358) 2025-08-23 10:05:48 -05:00
damocleas 254d34fd08
[Misc] [UX] Add Daily Run Achievement, Re-Arrange Achievements, Replace some Icon Sprites (#6292)
* wip achievement changes

* Adjust egg image sizes, re-export item atlas

* painful eggs

* Add egg to legacy UI, re-export item atlas

* run biome

* Update achievement.test.ts

* Fix achievement test file

* Fix tera stellar missing icon path

* Fix achievement test file

* egg s

* Optimize new images, re-export item atlas

* update pngs and locale

* add daily achv and other sorting

* Optimize ribbons, re-export item atlas

* Bump to version 1.11.0

* more changes, waiting on pngs

* Update package.json

* ribbon fixes

* images!

* Optimize images, re-export item atlas

* final fix

---------

Co-authored-by: Madmadness65 <blaze.the.fireman@gmail.com>
Co-authored-by: Sirz Benjie <142067137+SirzBenjie@users.noreply.github.com>
2025-08-22 19:21:17 -04:00
damocleas 5ee547a39a
[Balance] [ME] Trash to Treasure Option 1 Adjustment (#6341)
* Update trash-to-treasure-encounter.ts

* Update trash-to-treasure-encounter.test.ts tests
2025-08-22 17:37:16 -04:00
NightKev 8904cfc37b
Revert #6307 "Remove duplicate animation json for ... variants" (#6332)
Revert "[Refactor][Sprite] Remove duplicate animation json for shinies, sprite-based variants (#6307)"

This reverts commit 7bdb62ed1d.
2025-08-21 22:38:38 -07:00
Wlowscha c81440d466
Merge branch 'beta' of https://github.com/pagefaultgames/pokerogue into new-modifier-rework 2025-08-21 19:37:09 +02:00
Bertie690 0f94e97a2a
[Misc] Removed last vestiges of `/ 4096` from codebase (#6316) 2025-08-20 21:51:33 -04:00
Bertie690 c59a2013b9
[Move] Trick Room now reverses itself when added twice in a row (#6314) 2025-08-20 20:22:52 -05:00
Acelynn Zhang f34be91891
[Ability] Embody Aspect now triggers on switch-in while Terastallized (#6294)
* Fix Embody Aspect triggers

* Use selectWithTera

* apply suggestions

---------

Co-authored-by: Sirz Benjie <142067137+SirzBenjie@users.noreply.github.com>
2025-08-20 20:10:54 -05:00
AJ Fontaine 7bdb62ed1d
[Refactor][Sprite] Remove duplicate animation json for shinies, sprite-based variants (#6307)
* Remove duplicate animation json

* Remove duplicate json for sprite-based variants

* Fix sprite test

* Fix name of variable

---------

Co-authored-by: Sirz Benjie <142067137+SirzBenjie@users.noreply.github.com>
2025-08-20 18:27:08 -05:00
Wlowscha 14a0a23abc
[Balance][Challenge] Block master ball catching final boss in challenges (#6273)
* Block catching bosses in nuzlockes

* Changes to conditions to restrict master ball use

* Implemented new can't catch messages

* Fixed some bugs which prevented correct usage of balls

* Special casing full fresh start

* fix text Update command-phase.ts

* Added tests for failing catches

* Using `mockI18next`

* Shorten a couple of variable declarations

* Fixed bug that allowed catching trainer pokemon in end; showing double battle failure only if other failure messages do not apply

* Fixed order of error messages

* Changed description of tests with "in end biome" instead of "paradox mon(s)"

* Not override nature after selection

* Update test/field/catching.test.ts

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

---------

Co-authored-by: damocleas <damocleas25@gmail.com>
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
Co-authored-by: Sirz Benjie <142067137+SirzBenjie@users.noreply.github.com>
2025-08-20 19:24:55 -04:00
Bertie690 6bdfb7eb31
[Test] Cleaned up shields down tests; added more tests (#6216)
* Cleaned up shields down tests; added more tests

---------

Co-authored-by: Sirz Benjie <142067137+SirzBenjie@users.noreply.github.com>
2025-08-20 08:57:46 -05:00
Bertie690 6c03181621
[Bug] Refactored status code, fixed Rest/Sleep Talk status checks (#5872)
* Reworked status code, fixed bugs and added Rest tests

* Fixed rest bug

* Fixed bugs, split up status code, re-added required Rest parameter

* Cleaned up comments and such

* Added edge case to rest about locales

* Maybe did stuff

* Split up `trySetStatus` fully; fixed rest turn order display to match mainline

* Reverted healing changes to move to other PR

* Fixed message code a bit

* Condensed all status immunity tests under 1 roof

* Fixed the tests

* Added pollen puff tests back again

* Fixed swallow test

* Reverted swallow test

fixing in other prs

* Fixed pollen puff

* Fixed cirrc dep isuse

* fixed stockpile to no longer fail on stack full

* Fixed rest thing...?

* readded swallow conds

* Fixed tests

* wip

* Fixed tests

* Added pokemon heal phase to the turn queue

* ddddd

* Fixed the tests

* Fixed corrosion test

* Ran linting

* Fixed infiltrator bug

* Fix pokemon.ts

* Update move.ts

* Update corrosion.test.ts

* Update pokemon.ts documentation

* Remove missed line in TSDocs

* Update pokemon.ts

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

* Update modifier.ts

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

* Update modifier.ts

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

* Update obtain-status-effect-phase.ts

* Fix merge issues and apply Biome

* Revert pokemon-heal-phase.ts

* ddddd

* Fixed test file syntax err

* Update toxic spikes status set text to be quiet

* ran biome

* ran boime

* Prevent rest failure message from displaying outside of move phase

---------

Co-authored-by: Sirz Benjie <142067137+SirzBenjie@users.noreply.github.com>
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
2025-08-20 08:45:09 -05:00
Bertie690 2821728743
[Refactor] Cleaned up arena trap moves; prevented serialization of max layers (#6210)
* Grabbed matchers from other branch

* Cleaned up entry hazard arena tags; merged tests into 1 file

* Marked test as TODO because IDK how to make it pass

* Re-added test file + ran biome

* Sort imports in `vitest.d.ts`

* Fix Stealth Rocks test

* Renamed arena traps to entry hazards fr fr

* fixed matcher to have default value

* Fixed errors

* Update arena-tag.ts

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

---------

Co-authored-by: Sirz Benjie <142067137+SirzBenjie@users.noreply.github.com>
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
Co-authored-by: Wlowscha <54003515+Wlowscha@users.noreply.github.com>
2025-08-20 08:32:27 -05:00
Bertie690 cf5378905e
[Test] Removed deprecated functions from phase interceptor (#6195)
* Removed deprecated functions from phase interceptor

* Added minor docs to the phase manager + renamed `shift` to `shiftPhase`

* Added `selectStarterPhase` to the end by set mode collection

* Fixed issues and syntax errors

* somehow fixed reload bug by making things actively worse

* Perhaps fixed things?

* maybe fixed?

* Fixed tests

* fixed another dumb error bc me big dumb bozo

* dddddd

* Update phase-interceptor.ts

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

* Re-add `!` and add `TODO` comment instead

---------

Co-authored-by: Wlowscha <54003515+Wlowscha@users.noreply.github.com>
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
Co-authored-by: Sirz Benjie <142067137+SirzBenjie@users.noreply.github.com>
2025-08-19 19:54:40 -05:00
Bertie690 545d7349dc
[Test] Hopefully fixed salesman ME flaky test (#6298) 2025-08-19 17:43:39 -07:00
Bertie690 8734062401
[Test] Cleaned up tests to use updated test utils; part 1 (#6176)
* Removed bangs from `getEnemyParty` and `getPlayerParty`

* Replaced instances of consecutive `game.scene.getPlayerParty` with destructuring

* More array destructuring!!!

* Replaced `game.scene.getXXXParty()[0]` with `game.field.getEnemyPokemon`

* Deleted duplicate sturdy test case

* Fiexd syntax errors

* Fixed remaining issues; removed direct assignment to `Pokemon.moveset`

* Fixed remaining error
2025-08-19 19:21:40 -05:00
fabske0 effa45228e
[i18n] Change i18n keys to be camel case Part 4 (#6290)
* change run-history

* change menu

* change settings

* change splash texts

* Change trainer classes

* change trainer names

* Change trainer titles

* fix trainer config comments and `setTitle()`

* change challenges

* update challenge 2

* change pokedex ui handler

* Update locales submodule
2025-08-19 13:17:23 -07:00
Wlowscha 248224c6d5
Merge branch 'beta' of https://github.com/pagefaultgames/pokerogue into new-modifier-rework 2025-08-19 08:41:34 +02:00
Wlowscha 224d586564
[Modifier Rework] Incorporated Form Change items as part of HeldItemId (#6282) 2025-08-17 22:18:39 +02:00
fabske0 5d13714ea6
[i18n] Change i18n keys to be camel case MEs (#6237)
* changed ME `intro_dialogue` to camel case

* changed MEs part 1

* changed MEs part 2

* changed MEs part 3

* chnaged MEs part 4

* Update locales submodule
2025-08-17 12:46:12 -07:00
Wlowscha 7f44054029
Merge branch 'beta' of https://github.com/Wlowscha/pokerogue into new-modifier-rework 2025-08-16 00:30:16 +02:00
Amani H. 19af9bdb8b
[Beta] [Bug] Fix Various Nuzlocke-related Issues (#6261)
* [Bug] Fix Various Nuzlocke-related Issues

* Update encounter-pokemon-utils.ts

* Update attempt-capture-phase.ts

---------

Co-authored-by: damocleas <damocleas25@gmail.com>
Co-authored-by: Wlowscha <54003515+Wlowscha@users.noreply.github.com>
2025-08-15 19:22:59 +02:00
Wlowscha 8f546ce4bb
Merge branch 'beta' of https://github.com/pagefaultgames/pokerogue into new-modifier-rework 2025-08-15 18:53:31 +02:00
Bertie690 ee4950633e
[Test] Added `toHaveArenaTagMatcher` + fixed prior matchers (#6205)
* [Test] Added `toHaveArenaTagMatcher` + fixed prior matchers

* Fixed imports and stuff

* Removed accidental test file addition

* More improvements and minor fixes

* More semantic changes

* Shuffled a few funcs around

* More fixups to strings

* Added `toHavePositionalTag` matcher

* Applied reviews and fixed my godawful penmanship

* Fix vitest.d.ts

* Fix imports in `vitest.d.ts`

---------

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
Co-authored-by: Sirz Benjie <142067137+SirzBenjie@users.noreply.github.com>
2025-08-14 13:16:23 -07:00
fabske0 76d8357d0b
[Dev] Rename `OPP_` overrides to `ENEMY_` (#6255)
rename `OPP_` to `ENEMY_`
2025-08-14 18:06:24 +00:00
Bertie690 f42237d415
[Refactor] Removed `map(x => x)` (#6256)
* Enforced a few usages of `toCamelCase`

* Removed `map(x => x)`

* Removed more maps and sufff

* Update test/mystery-encounter/encounters/weird-dream-encounter.test.ts

* Update game-data.ts types to work
2025-08-14 10:25:44 -07:00
Inês Simões 1517e0512e
[UI/UX] [Feature] Save Management Tool (Rename/Delete Saves) (#5978)
* Implement Name Run Feat
Modified load session ui component, adding a submenu when selecting a 3
slot. This menu has 4 options:
Load Game -> Behaves as before, allowing the player to continue
progress from the last saved state in the slot.

Rename Run -> Overlays a rename form, allowing the player to type a
name for the run, checking for string validity, with the option to
cancel or confirm (Rename).

Delete Run -> Prompts user confirmation to delete save data, removing
the current save slot from the users save data.

Cancel -> Hides menu overlay.

Modified game data to implement a function to accept and store
runNameText to the users data.

Modified run info ui component, to display the chosen name when
viewing run information.

Example: When loading the game, the user can choose the Load Game
menu option, then select a save slot, prompting the menu, then choose
"Rename Run" and type the name "Monotype Water Run" then confirm,
thus being able to better organize their save files.

Signed-off-by: Matheus Alves <matheus.r.noya.alves@tecnico.ulisboa.pt>
Co-authored-by: Inês Simões <ines.p.simoes@tecnico.ulisboa.pt>

* Implement Rename Input Design and Tests for Name Run Feat
Created a test to verify Name Run Feature behaviour in the
backend (rename_run.test.ts), checking possible errors and
 expected behaviours.

Created a UiHandler RenameRunFormUiHandler
(rename-run-ui-handler.ts), creating a frontend input
overlay for the Name Run Feature.

Signed-off-by: Matheus Alves <matheus.r.noya.alves@tecnico.ulisboa.pt>
Co-authored-by: Inês Simões <ines.p.simoes@tecnico.ulisboa.pt>

* Fixed formating and best practices issues:
Rewrote renameSession to be more inline with other
API call funtions, removed debugging comments and
whitespaces.

Signed-off-by: Matheus Alves <matheus.r.noya.alves@tecnico.ulisboa.pt>
Co-authored-by: Inês Simões <ines.p.simoes@tecnico.ulisboa.pt>

* Minor Sanitization for aesthetics
Deleting the input when closing the overlay for
aesthetics purpose

Signed-off-by: Matheus Alves <matheus.r.noya.alves@tecnico.ulisboa.pt>
Co-authored-by: Inês Simões <ines.p.simoes@tecnico.ulisboa.pt>

* Fixed minor rebase alterations.

Signed-off-by: Matheus Alves matheus.r.noya.alves@tecnico.ulisboa.pt
Co-authored-by: Inês Simões ines.p.simoes@tecnico.ulisboa.pt

* Implemented Default Name Logic
Altered logic in save-slot-select-ui-handler.ts to
support default naming of runs based on the run
game mode with decideFallback function.

In game-data.ts, to prevent inconsistent naming,
added check for unfilled input, ignoring empty
rename requests.

Signed-off-by: Matheus Alves matheus.r.noya.alves@tecnico.ulisboa.pt
Co-authored-by: Inês Simões ines.p.simoes@tecnico.ulisboa.pt

* Replace fallback name logic: use first active challenge instead
of game mode

Previously used game mode as the fallback name, updated to use the
first active challenge instead (e.g. Monogen or Mono Type), which
better reflects the run's theme.
Signed-off-by: Matheus Alves <matheus.r.noya.alves@tecnico.ulisboa.pt>
Co-authored-by: Inês Simões <ines.p.simoes@tecnico.ulisboa.pt>

* Rebasing and conflict resolution

Signed-off-by: Matheus Alves <matheus.r.noya.alves@tecnico.ulisboa.pt>
Co-authored-by: Inês Simões <ines.p.simoes@tecnico.ulisboa.pt>

* Lint fix

Signed-off-by: Matheus Alves <matheus.r.noya.alves@tecnico.ulisboa.pt>
Co-authored-by: Inês Simões <ines.p.simoes@tecnico.ulisboa.pt>

* Minor compile fix

* Dependency resolved

* Format name respected

* Add all active challenges to default challenge session name if possible

If more than 3 challenges are active, only the first 3 are added
to the name (to prevent the text going off-screen)
and then "..." is appended to the end to indicate
there were more challenges active than the ones listed

* Allow deleting malformed sessions

---------

Signed-off-by: Matheus Alves <matheus.r.noya.alves@tecnico.ulisboa.pt>
Signed-off-by: Matheus Alves matheus.r.noya.alves@tecnico.ulisboa.pt
Co-authored-by: Matheus Alves <matheus.r.noya.alves@tecnico.ulisboa.pt>
Co-authored-by: Wlowscha <54003515+Wlowscha@users.noreply.github.com>
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
Co-authored-by: Sirz Benjie <142067137+SirzBenjie@users.noreply.github.com>
2025-08-13 20:08:12 -05:00
Bertie690 6133e3c39f
Added test utils for held item tests (#6233)
* Added test utils for held item tests

* Update src/items/held-item-manager.ts

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

---------

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
2025-08-13 21:33:01 +02:00
Bertie690 0da37a0f0c
[Move] Added laser focus locales (#6202)
* Added Laser Focus locales

* Fixed key for locales text

* Added `MessageAttr`; cleaned up a lot of other jank move attrs
2025-08-13 08:16:08 -07:00
Wlowscha 238691c8bf
Merge branch 'beta' of https://github.com/pagefaultgames/pokerogue into new-modifier-rework 2025-08-09 22:35:54 +02:00
Desroi 7873181726
[Bug] Fix Recoil & Shell Bell not applying when hitting Substitute
https://github.com/pagefaultgames/pokerogue/pull/5712

* Created Double Edge testing for recoil damage on substitutes

* Changed the logic for substitute damage

* Made testing for the updated substitute logic

* Update test formatting

* Fixed error in damage logic

* Apply Biome

* Fix test file

* Apply suggestion and update test

* Remove obsolete workaround and console logs

---------

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
2025-08-07 22:46:19 -05:00
Bertie690 8e261512fc
[Test] Improved tests for arena trap (#6209)
* Added arena trap tests and such

* hopefullt fixed tests

* Marked test as todo since me smol brain

---------

Co-authored-by: Sirz Benjie <142067137+SirzBenjie@users.noreply.github.com>
2025-08-08 01:00:34 +00:00
fabske0 6e4dd36d5a
[Docs/Misc/i18n] Fix typos (#6231)
* fix comment typos

* fix typos in variable/parameter/class names

* fix typos in object names

* fix typos in `console.log()` and i18n key use

* fix typo in filename `abstact-option-select-ui-handler.ts`

* fix casing of `@privateremarks` to `@privateRemarks`

* fix use of `cancelControllerChoice`
2025-08-07 18:56:50 -06:00
Amani H. 94650670fd
[Challenge] Add Nuzlocke-related Challenges (#6186)
* [Challenge] Add Nuzlocke-related Challenges

Co-authored-by: Matilde Simões <matilde.simoes@tecnico.ulisboa.pt>
Co-authored-by: Fuad Ali <fuad.ali@tecnico.ulisboa.pt>
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
Co-authored-by: Sirzento <sirzento@gmx.de>

* Add Sacred Ash to `revive` Group

* Separate Challenge Utility Functions

* Misc. Changes

* Transition to `BooleanHolder`

* Add "Nuzlocke" Achievement

* Change Challenge Order

* Adjust Nuzlocke Achievement to Include Fresh Start

* Fix Infinite Reward Reroll Bug

* Fix Party Heal

* Minor Change

* Adjust TODOs

* Add Unit Tests

* Tweak Faint Cry in Permanent Faint

* Resolve rebase issue

* Apply Matthew's Suggestions

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

* Apply Matthew's Suggestions Pt. 2

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

* Fix and Lint Suggestions

* Revert Accidental Overrides

* Fix and Lint Suggestions Pt. 2

* Rename Challenges

* Prevent `RandomMoveAttr` from Using Banned Moves

* Update Locales

---------

Co-authored-by: Matilde Simões <matilde.simoes@tecnico.ulisboa.pt>
Co-authored-by: Fuad Ali <fuad.ali@tecnico.ulisboa.pt>
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
Co-authored-by: Sirzento <sirzento@gmx.de>
Co-authored-by: Bertie690 <136088738+Bertie690@users.noreply.github.com>
2025-08-07 18:47:28 -06:00
damocleas d7194accdd
[Balance] Minor ME Adjustments and Fixes 1.10 (#6166)
- Adjusted A Trainer's Test
- Adjusted The Expert Pokémon Breeder
- Adjusted Trash to Treasure
- Adjusted Weird Dream

- Reorganized Dark Deal
- Adjusted Weird Dream Test
2025-08-07 16:42:58 -05:00
Bertie690 6660e33836 Merge remote-tracking branch 'upstream/beta' into modifier 2025-08-07 14:13:39 -04:00
Bertie690 2aca187c66
Reward type safety (#6211)
* Added type safety to reward generators

* Removed duplicate class member so biome won't yell at meeeeeee

* Update all-reward-type.ts

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

* Update all-rewards.ts

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

* Moved `allRewards` to a const object; general cleanup

* Added `noneReward`

* Removed `getPregenArgs`

* Resolved kev's commnet

* Expunged `RewardFunc`

---------

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
2025-08-07 19:58:53 +02: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
Wlowscha dac9e202a0
[Modifier Refactor] Modernize reward pool (#6208)
* Added missing `export`s to classes

* Created `allRewards` object

* RewardPool now uses ids; function to generate appropriate reward from id (including held item or trainer item)

* Added generateRewardOptionFromId function

* Using `RewardSpecs` for predetermined reward generation

* Removed RewardOverride

* Removed rewardInitObj

* Removed WeightedReward

* Proper initialization of allRewards
2025-08-04 09:04:48 +02:00