Commit Graph

1996 Commits

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

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

* Fixed Chilly Reception displaying message when used virtually

* Fixed lack of message causing Chilly Reception to fail

* Fixed tests

* Reverted bool change + fixed test

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

* Append `_category` to locale entry
2025-06-20 00:04:57 +00:00
NightKev
560ebbaee2 Merge branch 'beta' into minor-1.9.6 2025-06-18 18:27:37 -07:00
AJ Fontaine
80ae42d3ba
[Sprite] Minior and Ferrothorn variants (#6005)
* Minior variants

* Add Ferrothorn variants

* Fix shiny Minior front and icons
2025-06-18 19:49:21 -04:00
AJ Fontaine
2065f4fd7f
[Bug] Fix incorrect form key being checked for evo items (#5995) 2025-06-17 10:08:20 -07:00
Sirz Benjie
6ff258fb37
[Bug] Fix weather form changes not changing with weather abilities
https://github.com/pagefaultgames/pokerogue/pull/5857

* Add test for forecast

* Fix PostSummonFormChangeByWeatherAbAttr

* Fix overrides in forecast test

* Remove a test whose trigger conditions can no longer happen

* Update src/data/abilities/ability.ts

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

* Fix missing tsdoc param

* Apply kev's suggestions from code review

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

* Simplify PostSummonFormChangeByWeather's canApplyPostSummon

* Fix unused params that messed up after rebase

* Fix form change import

Messed up due to improper rebase

---------

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

* Fix test

* Fix Shedinja

* Simplify Gimmighoul evolution

* Primeape and Stantler evolve by using their move 10 times

* Basculin white stripe evolves by taking 294 recoil damage

* Primeape and Stantler use modifiers for tracking

* Basculin uses modifier too

* Remove evo count from pokemon data

* No more evo counter data, Gallade/Froslass

* Fix allmoves import

* Clamperl

* Struggle shouldn't count for Basc recoil

* Change to nicer type

* Apply Benjie's suggestions

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

* Address formatting

* Undo new evolution changes

* Remove unused imports

* Fix speciesid

* Fixed up descriptions a little

* Change a key name

* Fix Gimmighoul

* Apply Biome

* Apply Biome unsafe fixes

* Review suggestions

- Convert `EvoCondKey` enum to `const` object

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

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

- Implement `coerceArray`

- Fix Shelmet evolution condition
checking for Shelmet and not Karrablast

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

* Remove leftover enforce func loop

* Fix circular imports issue

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

---------

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

* Update ability.ts

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

* Update pokemon.ts

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

* Update game-mode.ts

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

---------

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
2025-06-16 05:36:09 -07:00
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
Dean
18ba33e6f0
[Bug] Fix zombie pokemon in Fun+Games ME (#5992) 2025-06-15 00:36:28 -07: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
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
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
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
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
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
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
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
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
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
Madmadness65
ea64024e09
[P3 Bug] Remove Expert Breeder trainer type from ME egg source (#5893)
Remove Expert Breeder trainer type from ME eggs

It effectively duplicated the text in the egg source text box,
and overflowed the visual text box as a result.
2025-06-02 14:32:34 +00:00
NightKev
d5f7665b15
[Test] Update test utils (#5848)
* [Test] Add/update test utils

- Add `FieldHelper` which has methods to mock a pokemon's ability
or force a pokemon to be Terastallized

- Add `MoveHelper#use` which can be used to remove the need
for setting pokemon move overrides by modifying the
moveset of the pokemon

- Add `MoveHelper#selectEnemyMove` to make an enemy pokemon
select a specific move

- Add `MoveHelper#forceEnemyMove` which modifies
the pokemon's moveset and then uses `selectEnemyMove`

- Fix `GameManager#toNextTurn` to work correctly in double battles

- Add `GameManager#toEndOfTurn` which advances to the end of the turn

* Update some tests

- Disable broken Good As Gold test
and add `.edgeCase` to Good As Gold

- Fix Powder test

- Update some tests to demonstrate new methods
2025-05-30 12:24:05 -07:00
damocleas
eb0937a09b
Hotfix 1.9.5 to Beta
Hotfix 1.9.5 to beta
2025-05-27 23:57:16 -04:00
Sirz Benjie
2deced5565
[Bug][Move] Allow gastro acid to suppress passives if main ability is unsuppressable (#5854)
* Allow gastro acid to suppress passives if main ability is unsuppressable

* Update gastro_acid.test.ts

* Update src/data/moves/move.ts

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

* Add test to ensure unsuppressable main ability is not suppressed

---------

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
2025-05-27 16:46:56 -05:00
NightKev
68dddbc424
[Dev] Enable Biome checking of pokemon.ts (#5720)
* [Dev] Enable biome parsing of `pokemon.ts`

* Apply unsafe fixes

* Add + apply rule disallowing the use of the `integer` type alias

* Fix typo in comment; remove unnecessary `!!`

* Re-apply Biome after merge

* Re-apply Biome "unsafe" fixes after merge

* Fix import

* Add comment to `getFusionIconAtlasKey` too
2025-05-27 07:50:54 -07:00
NightKev
a98f897591 [Bug] Fix Dipplin's weight (was mistakenly set to the lbs value) 2025-05-27 05:02:58 -07:00
NightKev
999cbf911e [Bug] Fix Pichu form weights (61.5 -> 2) 2025-05-27 03:56:52 -07:00
Madmadness65
a0484bbde1
[Item] Add Deep Sea Scale & Deep Sea Tooth items (#5078)
* Add Deep Sea Scale & Tooth items

Also changes Clamperl's evolution method from gender-specific to requiring one of the Deep Sea items to be held.

* Move Deep Sea items to Great tier

Also gives every species stat booster item a `rare` boolean to split these items from the rest of the species stat booster items. Updated the existing tests accordingly to account for the split.

* Reduce Great tier species booster item weight

* Fix global scene on evolution conditions

* Merge branch 'beta' into deep-sea-items

* Change how the held item is found in evolution condition

It should no longer look through the entire party's modifiers when seeing if Clamperl is eligible to use a Linking Cord.

* Fix wrong type being boosted

---------

Co-authored-by: damocleas <damocleas25@gmail.com>
Co-authored-by: Sirz Benjie <142067137+SirzBenjie@users.noreply.github.com>
2025-05-23 07:36:30 +00:00
Sirz Benjie
f0e806c508
[Misc] Move allMoves to data-lists.ts (#5860) 2025-05-21 20:18:24 -07:00
Sophia
d1b0bbb155
[Bug]: Fix #5010: roar and whirlwind missing fail message when against a trainer (#5659)
* [BUG] Fixes #5010 Roar and Whirlwind don´t display a fail message
Roar and Whirlwind should now display a fail message when
used against a trainer with only one pokémon left

* Apply suggestions from code review made by SirzBenjie
2025-05-21 07:14:16 +00:00
itgalex24
288e4e7e7e
[Bug] [Move] Synchronoise hitting Tera Type fix (#5779)
* synchronoize fix

* Add regression test for synchronoise

---------

Co-authored-by: Sirz Benjie <142067137+SirzBenjie@users.noreply.github.com>
2025-05-20 23:12:54 +00:00
Sirz Benjie
663c64fdb4
[Misc] Fix trailing whitespace (#5856)
Remove trailing whitespace
2025-05-20 14:46:23 -07:00
AJ Fontaine
23e1d88c3a
[Balance] Update TM compatibility for Curse (#5791)
* Update Curse TM compat with former egg moves/level ups

* Pumpkaboo is not Phantump
2025-05-20 19:40:05 +00:00
Jimmybald1
998619e7e5
[Bug] IVs of trainers were incorrectly using the battle seed (#5822)
* Fixed IVs of trainers using the Battle Seed.

* Renamed the randSeedInt functions that use the Battle Seed to randBattleSeedInt functions

* Incorrectly used this in common

* Fixed tests that were still calling the old function name

---------

Co-authored-by: damocleas <damocleas25@gmail.com>
Co-authored-by: Bertie690 <136088738+Bertie690@users.noreply.github.com>
Co-authored-by: AJ Fontaine <36677462+Fontbane@users.noreply.github.com>
Co-authored-by: Dean <69436131+emdeann@users.noreply.github.com>
Co-authored-by: lxy-lxy-lxy <55084073+lxy-lxy-lxy@users.noreply.github.com>
Co-authored-by: Xavion3 <xavion333@gmail.com>
Co-authored-by: Sirz Benjie <142067137+SirzBenjie@users.noreply.github.com>
Co-authored-by: Lylian BALL <131535108+PyGaVS@users.noreply.github.com>
Co-authored-by: Jimmybald1 <147992650+IBBCalc@users.noreply.github.com>
2025-05-17 10:36:16 -05:00
NightKev
fa6c51d1e2
[Bug] Prevent some corrupt eggs from crashing the game (#5787)
If an egg is somehow a species that doesn't have an associated egg tier
(such as Pikachu), `Egg#getEggTier` now falls back to `EggTier.COMMON`
2025-05-07 21:01:54 -07:00
Lylian BALL
4f541a8dce
[Bug] Fix some moves using illusion type instead of real type (#5772)
* fix revelation dance using the type of the illusion instead of the actual type

* fix other move that might get the illusion type as well

* fix other move that might get the illusion type as well

* fix abilities that might get the illusion type as well

* fix illusion icon in party ui handler

* Fix TSDoc for `Pokemon#getTypes`

* Remove now-unnecessary changes to `.getTypes()` calls

Revert `overrides.ts` changes

* Replace `|| false` with `!!`

---------

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
2025-05-05 18:31:11 -07:00
Dean
c31bd9ef61
[Bug][Hotfix] Secondary effects no longer trigger status immunity messages (#5764)
Fix secondary effects triggering status immunity messages
2025-05-03 23:04:04 -07:00
AJ Fontaine
b353b0de62
[Hotfix] Fix evil grunts using wrong template (#5763) 2025-05-03 22:59:37 -07:00