Commit Graph

5367 Commits

Author SHA1 Message Date
Wlowscha
7523f6d9c0
Fixed init-modifier-pools.ts 2025-06-17 23:36:51 +02:00
Wlowscha
f2a339fbe5
Held item generation for enemies follows the new scheme 2025-06-17 23:08:14 +02:00
Wlowscha
39be97ef8e
Daily run items are generated within the new system 2025-06-17 22:03:25 +02:00
Wlowscha
9611948d80
Some changes to modifier files 2025-06-17 21:27:03 +02:00
Wlowscha
a15920a605
Fixed select-modifier-phase 2025-06-17 19:33:55 +02:00
Wlowscha
847b938480
Fixed some ui handlers 2025-06-17 19:28:40 +02:00
Wlowscha
74349d431b
Fixed held item evolution condition 2025-06-17 18:59:58 +02:00
Wlowscha
68a9db5a6b
Merge branch 'beta' of https://github.com/pagefaultgames/pokerogue into held-item-refactor 2025-06-17 18:56:00 +02:00
Sirz Benjie
6ff258fb37
[Bug] Fix weather form changes not changing with weather abilities
https://github.com/pagefaultgames/pokerogue/pull/5857

* Add test for forecast

* Fix PostSummonFormChangeByWeatherAbAttr

* Fix overrides in forecast test

* Remove a test whose trigger conditions can no longer happen

* Update src/data/abilities/ability.ts

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

* Fix missing tsdoc param

* Apply kev's suggestions from code review

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

* Simplify PostSummonFormChangeByWeather's canApplyPostSummon

* Fix unused params that messed up after rebase

* Fix form change import

Messed up due to improper rebase

---------

Co-authored-by: Dean <69436131+emdeann@users.noreply.github.com>
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
2025-06-16 06:02:09 -07:00
AJ Fontaine
e3108603e3
[Refactor] Rework evolution conditions and descriptions (#5679)
* Refactor evo conditions and descriptions

* Fix test

* Fix Shedinja

* Simplify Gimmighoul evolution

* Primeape and Stantler evolve by using their move 10 times

* Basculin white stripe evolves by taking 294 recoil damage

* Primeape and Stantler use modifiers for tracking

* Basculin uses modifier too

* Remove evo count from pokemon data

* No more evo counter data, Gallade/Froslass

* Fix allmoves import

* Clamperl

* Struggle shouldn't count for Basc recoil

* Change to nicer type

* Apply Benjie's suggestions

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

* Address formatting

* Undo new evolution changes

* Remove unused imports

* Fix speciesid

* Fixed up descriptions a little

* Change a key name

* Fix Gimmighoul

* Apply Biome

* Apply Biome unsafe fixes

* Review suggestions

- Convert `EvoCondKey` enum to `const` object

- Use early returns in `SpeciesEvolutionCondition#description`
and `SpeciesFormEvolution#description`

- Replace `!!x.find` with `x.some`
and `y.indexOf() > -1` with `y.includes()`

- Implement `coerceArray`

- Fix Shelmet evolution condition
checking for Shelmet and not Karrablast

- Remove unnecessary type casting in `battle-scene.ts`

* Remove leftover enforce func loop

* Fix circular imports issue

- `getPokemonSpecies` moved to `src/utils/pokemon-utils.ts`
- `allSpecies` moved to `src/data/data-lists.ts`

---------

Co-authored-by: Sirz Benjie <142067137+SirzBenjie@users.noreply.github.com>
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
2025-06-16 05:57:51 -07:00
Bertie690
ccceaac877
[Test] Reworked crit override to allow for forced crits (#5738)
* Crit override stuff

* Update ability.ts

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

* Update pokemon.ts

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

* Update game-mode.ts

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

---------

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
2025-06-16 05:36:09 -07:00
AJ Fontaine
ebc6ff2ed3
[Refactor] Clean up shiny/HA reroll methods (#5803) 2025-06-16 05:18:44 -07:00
Wlowscha
aa84d03773
Added function to assign items from a given configuration 2025-06-16 00:12:11 +02:00
Wlowscha
694e82f280
Fixed some MEs 2025-06-15 20:51:31 +02:00
Wlowscha
0e5499bf25
Moved many data types for held items to a dedicated file; introduced held item pools for item generation 2025-06-15 20:51:05 +02: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
Wlowscha
89082921eb
Fixed evo tracker 2025-06-15 16:43:37 +02:00
Wlowscha
73292fcbe7
Merge branch 'beta' into held-item-refactor 2025-06-15 11:09:54 +02:00
Wlowscha
75907bc8e3
Merge branch 'beta' of https://github.com/pagefaultgames/pokerogue into held-item-refactor 2025-06-15 11:08:19 +02: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
Wlowscha
be84790b2d
Converting to held item pools 2025-06-14 08:15:05 +02:00
Wlowscha
6fb85ea742
Changes to the summary ui handler 2025-06-14 08:14:00 +02:00
Wlowscha
301db8a1de
Preliminary changes to some MEs 2025-06-14 08:12:58 +02: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
Wlowscha
ad7f2d133c
Fixed Slumbering Snorlax encounter, overrideItems of heldItemConfiguration can deal with items with 0 stack 2025-06-11 22:30:09 +02:00
Wlowscha
558d06cdaa
Converted The Strong Stuff encounter 2025-06-11 22:20:44 +02:00
Wlowscha
51a2a15799
Converted Berries Abound encounter 2025-06-11 22:11:03 +02: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
Wlowscha
9a79882e05
Updated modifier-bar.ts 2025-06-11 00:06:49 +02:00
Wlowscha
64b1cf1669
More various fixes; introduced isMaxStack(item) method to heldItemManager 2025-06-10 23:29:29 +02:00
Wlowscha
c198297abd
Reworked EnemyPokemonConfig to include a HeldItemProperty object (to feed to the heldItemManager). Updated Dark Deal ME 2025-06-10 22:51:25 +02:00
Wlowscha
d7882d4ca7
Various fixes 2025-06-10 22:50:27 +02:00
Wlowscha
4dc54ba17e
Fixed delibirdy encounter 2025-06-10 21:57:53 +02:00
Wlowscha
6a4e4a345d
Added some utility functions to check if an item fits a list of items/categories, or to filter out which held items fit 2025-06-10 21:56:57 +02:00
Wlowscha
b975382f73
Fixed form change trigger after merge conflicts 2025-06-10 20:12:27 +02:00
Wlowscha
90fa0c6796
Merge branch 'beta' of https://github.com/pagefaultgames/pokerogue into held-item-refactor 2025-06-10 20:09:44 +02:00