Commit Graph

5248 Commits

Author SHA1 Message Date
Sirz Benjie
6030dd6462
Cleanup text.ts file 2025-06-15 13:56:07 -05:00
Sirz Benjie
c353f54a42
Move TextStyle to enums, convert into const object 2025-06-15 13:56:04 -05: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
damocleas
73e0a2905b
[Beta] Revert "[UI/UX] Default cursor to no when stop trying to teach move" (#5990)
Revert "[UI/UX] Default cursor to no when stop trying to teach move"

This reverts commit ba2158ec64.
2025-06-14 17:40:18 -04:00
NightKev
7cf51d48a7 [Test] Make sure items are removed from enemies in Last Respects test 2025-06-14 05:06:46 -07:00
Wlowscha
fd1404706a
[Bug] Remove empty modifierPool (#5988) 2025-06-14 12:01:29 +00:00
Bertie690
a41de39d4f
[Misc] Run biome on all files; update some rules to be errors now
https://github.com/pagefaultgames/pokerogue/pull/5962/

* Fixed lint issue; ran biome on entire repository

* Fixed biome.jsonc

* Trimmed trailing whitespace... again...

* Fixed PR template md

* Fixed package json

* Fixed void return issues + ran biome again

* ran biome
2025-06-14 00:59:34 -07:00
fabske0
9a525ac8fd
[UI/UX] Position setting Icons dynamically (#5969)
* position setting icons dynamically

* add comment for potential overlap
2025-06-14 03:19:05 +00:00
Bertie690
d91a6ee11e
[Github] Update pull_request_template.md with more labels
https://github.com/pagefaultgames/pokerogue/pull/5974

* Update pull_request_template.md with more labels

More better

* Fix create test script name post refactor

Forgot to change it earlier
2025-06-14 01:38:54 +00:00
damocleas
718d6f61cf
[Bug] Fix Fog interactions with Morning Sun/Synthesis/Moonlight and Solar Beam/Blade (#5987)
Fix Weather based Healing Moves and Solar Beam/Blade not interacting with Fog

Update move.ts
2025-06-13 21:10:38 -04:00
NightKev
7c6189e812
[Refactor] Create utility function coerceArray (#5723)
* [Refactor] Create utility function `makeArray`

This replaces the `if(!Array.isArray(var)) { var = [var] }` pattern

* Replace `if` with ternary, rename to `coerceArray`

* Add TSDocs

* Improve type inferencing

* Replace missed `Array.isArray` checks

* Apply Biome

* Re-apply changes to phase manager

* Re-apply to `SpeciesFormChangeStatusEffectTrigger` constructor

Apply to new instances in test mocks
2025-06-12 21:30:01 -07:00
Mourouh
425985a056
[Balance] Add wild encounter chance to Maushold and Dudunsparce forms (#5975)
Added wild encounter chance to Maushold and Dudunsparce forms
2025-06-12 16:56:37 -05:00
Dean
ff9aefb0e5
[Bug] Activate PostSummon Abilities in Speed and Priority Order
https://github.com/pagefaultgames/pokerogue/pull/5513

* Add prependToPhaseWithCondition and use it in SummonPhase to determine speed order

* Move logic to PostSummonPhase

* Add test base

* Pivot to using sort strategy instead

* Add and update tests

* Support priority ability activations

* Ensure priority abilities are still activated on switch in

* Add test for priority

* Update to use priority numbers instead of a boolean

* Add ability priorities to constructors

* Move sorting to BattleScene

* Rename phase file

* Update import

* Move application to applyPostSummonAbAttrs and stop assuming no other phases in queue

* Ensure all PostSummonPhases from encounters are added at the same time

* Switch to priority queue approach

* Ensure that zero/negative priority activations happen after postsummonphase

* Revert 07646fe (not needed due to stable sort)

* Always create separate ability phases for passive and use boolean instead of priority number when applying

* Add test for dynamic updates

* Add BattlerIndex import

* Clear queues for testing

* Benjie suggestion

* Split files

* Update import in battlescene

* Remove extra spaces added by VSCode

* Fix other conflicts

* Update PhaseManager

* Update to use PhaseManager

* Immediately start postsummons

* Fix test

* Fix BattlerIndex import

* Remove unused imports

* Fix postsummon application

* Make priority readonly
2025-06-11 22:28:27 -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
Dobin Shin
ba2158ec64
[UI/UX] Default cursor to no when stop trying to teach move
https://github.com/pagefaultgames/pokerogue/pull/5924

* [UI/UX] "Stop trying to teach move" Defaulting to "No"

* [Test] setCursor to 0, 'Yes' to end learning move

* Move confirmUIMode to its own file in enums, add docs

---------

Co-authored-by: Sirz Benjie <142067137+SirzBenjie@users.noreply.github.com>
2025-06-11 16:24:27 -07:00
Lugiad
f499ea0568
[UI/UX] [Localization] Type icons corrections (#5952)
* Updated both Spanish type icons

* Update Brazilian Portuguese type icons

* Update Catalan type icons

* Update Traditional Chinese type icons

* Update Turkish type icons

* Update Russian type icons

* Update Catalan type icons

* Delete error

* Update Russian type icon

* Update Russian type icons
2025-06-11 04:44:30 +00:00
Bertie690
aea2c178c9
[i18n] Added locales text for force switch moves (#5930) 2025-06-10 19:54:44 -04:00
Bertie690
581348ec0a
[Misc] Remove extra newline in test-boilerplate.ts (#5965) 2025-06-09 18:28:39 -07:00
NightKev
60105f0402
[Dev] Update test creation script (#5939) 2025-06-09 17:48:41 -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
AJ Fontaine
b1c50dd69f
[Bug] Fix TM compatibility for Terapagos and Knock Off (#5958)
Fix TM compatibility for Terapagos and Knock Off
2025-06-08 16:49:50 -07:00
NightKev
d2ace47e1e [Test] Add missing ability override to Dancer tests 2025-06-08 15:36:01 -07:00
Wlowscha
5ef88a6d4d
[Refactor] Refactor select-modifier-phase.ts (#5886)
* Refactored select-modifier-phase.ts

* Added some missing type signatures

* Changes from suggestions

* Added ModifierSelectCallback type
2025-06-08 15:13:26 -07:00
Tiago Rodrigues
37767799cd
[Bug] Gorilla Tactics now activates on protect and miss (#5567)
* [Bug] Fix #5112: Gorilla Tactics only registers succesful moves as move usage

* Apply small fixes 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-08 12:52:48 -04:00
Sirz Benjie
1c4edabd1d
[Refactor] Ensure that new phases are created through the phase manager
https://github.com/pagefaultgames/pokerogue/pull/5955

* Add newPhase method to phase-manager

* Update calls to append/prepend phase to use string phase

* Replace instantiations of new phase with phase manager
2025-06-07 23:55:30 -07:00
NightKev
75beec12a8
[Dev] Enable Biome checking of ability.ts (#5948) 2025-06-07 21:43:30 -07:00
Bertie690
35a09af475
[Utils] Create utility function randSeedFloat (#5767) 2025-06-07 19:29:10 -07:00
Bertie690
09e30070f9
[Docs] Fixed test helper functions to conform with TSDoc standard; deprecated runToSummon/startBattle without args (#5912)
* Updated doc comments for test-related functions

* Marked `classicMode.runToSummon` and `classicMode.startBattle` without species as deprecated

Having the species being used depend on daily run RNG is both unintuitive, janky and prone to flaking out (as happened with the Gastro Acid tests)

* Fixed the bug

* Update field-helper.ts

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

---------

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
2025-06-07 18:02:25 -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
Jimmybald1
3114035673
[Balance] Update catch rates to Gen 9 (#5954)
Updated catch rates to gen 9w

Co-authored-by: Jimmybald1 <147992650+IBBCalc@users.noreply.github.com>
2025-06-07 20:54:33 -04:00
Bertie690
ef6029ae4b
[Refactor] Add methods isPlayer and isEnemy to reduce circular imports
https://github.com/pagefaultgames/pokerogue/pull/5902

* Added functions `isPlayer` and `isEnemy` for type checking

* Apply suggestions from Kev code review

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

* Fix merge issue

* Split imports

---------

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
2025-06-07 17:44:58 -07:00
NightKev
d3bc33cd4e [Misc] Remove debug.js reference from index.html 2025-06-07 17:37:09 -07:00
Bertie690
1ff45687c5
[Refactor] Merged interfaces/ into @types/; removed runtime orphan modules
https://github.com/pagefaultgames/pokerogue/pull/5951
2025-06-07 17:28:01 -07:00
NightKev
c5db827381
[Dev] Enable Biome linting of move-effect-phase.ts (#5947) 2025-06-06 23:09:23 -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
Bertie690
88e4ab978b
[Misc] Removed cases of a ? true : false and useless super calls from subclasses (#5943)
* Removed cases of `if (a) {return true}' return false`

* Removed useless `super.xyz` calls from functions

* Fixde missing issur

* Use early return in `Pokemon#isOffsetBySubstitute`

---------

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
2025-06-06 17:00:09 -07:00
Bertie690
3ca11e83a6
[Dev] Add lefthook script to update submodules post-checkout (#5941) 2025-06-06 23:27:58 +00:00
SmhMyHead
0336858708
[UI/UX] Legendary UP Gacha timer (#5921)
* [UI/UIX] Legendary UP Gacha timer

* Update egg-gacha-ui-handler.ts

Seems "fixedInt" was needed on the delay of the playTimeTimer so the game speed doesn't affect it.

* New timer container by damocleas.

* gacha_legendary.png second version from @damocleas

* Use phaser object chaining methods

---------

Co-authored-by: Sirz Benjie <142067137+SirzBenjie@users.noreply.github.com>
2025-06-06 21:20:02 +00:00
Sirz Benjie
855868bfea
[Refactor] Cleanup achvs ui handler (#5919) 2025-06-06 21:15:13 +00:00
Sirz Benjie
1fc42b3231
[Misc] Add phase#is method to help reduce circular imports (#5868)
* Move phase types out of phase interceptor

* Create isXPhase method and add properties to each phase

* Replace instanceof phase with isXPhase

* Fix missing union types for phaseName

* Update doc comment in phase.ts

* Fix incomplete comment in encounter-phase

* Make phaseName as public and fix more uses

* Move phaseName property declaration before constructor in move anim phase

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

* Rename isXPhase to is

---------

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
2025-06-06 21:08:23 +00:00
Lugiad
9021e4b41e
[i18n] More Controller settings localization (#5920) 2025-06-06 19:52:35 +00:00
ShinigamiHolo
2a769e2733
[UI/UX] Adding more space in Egg Gacha for another languge (#5934) 2025-06-06 19:45:12 +00:00
Sirz Benjie
178de207f1
[Refactor] Cleanup egg list ui handler (#5890)
Cleanup egg list ui handler

Co-authored-by: Wlowscha <54003515+Wlowscha@users.noreply.github.com>
2025-06-06 21:34:38 +02:00
Lugiad
e82e182507
[UI/UX] [Localization] Russian Gatcha Text Resize (#5929)
Russian Gatch Text Resize

Co-authored-by: Wlowscha <54003515+Wlowscha@users.noreply.github.com>
2025-06-06 18:33:13 +02:00
PrabbyDD
0c54fc1be0
[Bug] Fix no EXP awarded if all active pokemon faint (#4688)
Party pokemon will now gain EXP from EXP Share
even if all the active pokemon are fainted

---------

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
2025-06-05 18:22:27 -04:00
Sirz Benjie
193c5ffb0c
[UI/UX] Move Reload Required text to bottom of settings (#5928)
* Move Reload Required text to bottom of settings

* Remove unneeded reloadRequiredText field
2025-06-05 15:18:07 -07:00
Wlowscha
39b8dc9a85
[Refactor] Removing unused logic for mbh/grip claw (#5914)
* Removing unused logic for mbh/grip claw

* Updated docstring

---------

Co-authored-by: Sirz Benjie <142067137+SirzBenjie@users.noreply.github.com>
2025-06-05 21:54:50 +00:00