Commit Graph

601 Commits

Author SHA1 Message Date
Bertie690
08ed35e4a9
Merge 1bb688f284 into 1ff2701964 2025-06-19 22:29:37 -04: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
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
cce6acec6f IV safety part 0.5 2025-06-15 09:56:31 -04:00
Bertie690
887f750253 Added utility types for strong typing IVs and stats 2025-06-14 23:37:24 -04: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
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
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
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
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
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
Sirz Benjie
d5789105f3
[Refactor][UI/UX] Cleanup battle-info ui code (#5696)
* Create battle-info directory and move battle-info.ts to it

* Move player and enemy battle info to their own files

* Move subclass specific parts of constructor to subclass constructor

* Fixup mock gameobject methods to match phaser gameobject returns

* Make statOrder specific to subclass

* Create getShinyDescriptor function in utils

* Move icon construction to its own function

* Cleanup enemybattleinfo constructor to use chaining

* Make flyout exclusive to EnemyBattleInfo

* Move EnemyPokemon specific init Logic to its class

* Break up initInfo into different methods

* Remove hp bar segment dividers from base battle info

* Move setMini to pokemoninfo

* Breakup updateInfo into smaller parts

* Remove hp info handling from base updateInfo

* Use phaser object chaining methods

* Add some docs

* Add missing chain usage

* Use getShinyDescriptor in pokemon-info-container

* Minor cleanup of updatePokemonExp

* Fixup setSizeToFrame mock

* Ensure pokemon hp numbers are not visible during stat display

* Update src/utils/common.ts

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

* Make summary-ui-handler use new shinyDescriptor method

* Remove `undefined` parameter pass

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

* Address kev's review comments

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

* Ensure hp number display fades in/out

* Ensure ribbon and caught indicator fade with stat display

* Update src/ui/battle-info/battle-info.ts

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

* Move construction of stats and type icons to their own methods

* Make setPositionRelative return this

* Improve doc comment on paddingX param

* Fix mock sprite's setPositionRelative

---------

Co-authored-by: Wlowscha <54003515+Wlowscha@users.noreply.github.com>
Co-authored-by: Amani H. <109637146+xsn34kzx@users.noreply.github.com>
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
2025-05-28 17:29:03 +00: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
Sirz Benjie
f0e806c508
[Misc] Move allMoves to data-lists.ts (#5860) 2025-05-21 20:18:24 -07:00
AJ Fontaine
1cf19b49f2
[Balance] Moveset generation adjustments (#5801)
* Moveset generation adjustments

* Remove shiny explosion check, prevent 2 self-KO moves
2025-05-20 19:59:39 -07:00
Sirz Benjie
663c64fdb4
[Misc] Fix trailing whitespace (#5856)
Remove trailing whitespace
2025-05-20 14:46:23 -07: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
Dean
0c48fff14b
[Bug] Fix Substitute sprite crash & revived Pokemon softlock (#5829)
Break `resetSummonData` into two methods

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: 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>
2025-05-17 10:35:38 -05:00
Dean
d790b30a30
[Bug][Hotfix] Fix Transformed Sprites not loading properly (#5808)
* Fix ditto sprite not loading properly

* Remove review comment
2025-05-11 18:23:37 -07:00
Dean
0712f86462
[Bug][Hotfix] Fix crashes when loading save with a transformed pokemon (#5806)
* Fix speciesForm being saved incorrectly

* Fix transformed icon

* Fix moveset loading errors
2025-05-09 01:34:28 -07:00
Dean
5a58abfddf
[Bug][Hotfix] Suppress Illusion if NG is already active (#5797)
* Suppress preSummon attrs off field

* Add test case
2025-05-07 21:04:24 -07:00
NightKev
cf1367cece
[Bug] PokemonSummonData movesets will now be loaded correctly (#5793) 2025-05-07 21:02:16 -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
Sirz Benjie
3161461b6c
[Bug][UI/UX] Update battle-info inside pokemon#damageAndUpdate (#5778)
* Update battle-info inside pokemon#damageAndUpdate

* Ensure updatePokemonHp does not skip last hp number
2025-05-05 18:35:51 -04:00
Bertie690
6d90649b92
[Refactor/Bug/Ability] Reworked BattleData, fixed Rage Fist, Harvest, Belch + Implemented Cud Chew (#5655)
* Grabbed reverted changes from stuff

* Added version migrator for rage fist data + deepMergeSpriteData tests

* fixed formattign

* Fied a few

* Fixed constructor (maybe), moved deepCopy and deepMergeSpriteData to own file

`common.ts` is hella bloated so seems legit

* Moved empty moveset verification mapping thing to upgrade script bc i wanted to

* Fixed tests

* test added

* Fixed summondata being cleared inside summonPhase, removed `summonDataPrimer`

like seriously how come no-one checked this

* Fixed test

I forgot that we outsped and oneshot

* Fixed test

* huhjjjjjb

* Hopefully fixed bug

my sanity and homework are paying the price for this lol

* added commented out console.log statement

uncomment to see new berry data

* Fixed migrate script, re-added deprecated attributes out of necessity

* Fixed failing test by not trying to mock rng

* Fixed test

* Fixed tests

* Update ability.ts

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

* Update ability.ts

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

* Update overrides.ts

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

* Update berry-phase.ts

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

* Update encounter-phase.ts

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

* Update game-data.ts

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

* Update move-phase.ts

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

* Added utility function `randSeedFloat`

basically just `Phaser.math.RND.realInRange(0, 1)`

* Applied review comments, cleaned up code a bit

* Removed unnecessary null checks for turnData and co.

I explicitly made them initialized by default for this very reason

* Added tests for Last Resort regarding moveHistory

* Update pokemon.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 pokemon.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 pokemon.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 pokemon.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 battle-scene.ts

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

* Update the-winstrate-challenge-encounter.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 pokemon.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 ability.ts

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

* Update move.ts

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

* Update move.ts

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

* Update move.ts

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

* Update battle-anims.ts

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

* Update pokemon.ts comments

* Fixed a few outstanding issues with documentation

* Updated switch summon phase comment

* Re-added BattleSummonData as TempSummonData

* Hppefully fixed -1 sprite scale glitch

* Fixed comment

* Reveted `pokemon-forms.ts`

* Fuxed constructor

* fixed -1 bug

* Revert "Added utility function `randSeedFloat`"

This reverts commit 4c3447c851.

---------

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
Co-authored-by: Sirz Benjie <142067137+SirzBenjie@users.noreply.github.com>
2025-05-02 00:06:07 -05:00
Dean
7a9fc3fc8d
[Bug] Clear status immediately in menus (#5739)
Add asPhase parameter
2025-05-01 22:50:56 -04:00
Sirz Benjie
3af1bdbcff
[Bug][Ability] Fix change move type abilities (#5665)
* Make type changing moves change type after abilities but before ion deluge/electrify

* Create unified test file for galvanize, pixilate, and refrigerate

* Make type boost items like silk scarf affect the move after its type change

* Add tests for type boost item interaction

* Remove leftover log messages

* Update spies in type-change ability tests

* Add automated tests for normalize

* Fix test name injection for tera blast

* Add automated test for tera blast normalize interaction

* Restore pokemon as a type-only import in moves.ts

* Add aerilate to type changing tests

* Rename galvanize test file

* Fix utils import

* Apply suggestions from code review

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

* Remove unnecessary mockRestore

* Remove unnecessary nullish coalescing

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

* Update src/field/pokemon.ts

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

---------

Co-authored-by: Madmadness65 <59298170+Madmadness65@users.noreply.github.com>
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
2025-05-01 22:41:57 -04:00
Sirz Benjie
34670fd921
[Bug] Only moves will show the explicit status immunity effect (#5728)
* Add quiet parameter to trySetStatus

* Make quiet default to false
2025-04-28 23:53:01 -04:00
NightKev
a7479c8eb6
[Balance] Trainer pokemon now have minimum IVs of wave/10 (#5719) 2025-04-27 12:27:34 -07:00
Inês Simões
75400a39ed
[Bug] [UI/UX] Status moves now play a No Effect Message Against Immune Type Pokemon (#5533)
* Fix #5085  Moves dont play a No Effect Message Against Immune Type

When using non-volatile status move like: Will-O-Wisp, Thunder
Wave, Toxic, or Poison Gas against a Pokémon whose type is immune
to that Status condition, no "It doesn't affect" message plays.

My proposed fixes:
In move.ts:
Removed a redudant if statement in StatusEffectAttr class

In pokemon.ts:
Renamed the "messageIsImmune" function to "queueImmuneMessage"
2025-04-23 21:29:44 +00:00
Sirz Benjie
110fd2f0a1
[Refactor][Move] Refactor move effect phase (#5678)
* Add enum for hit check result

Co-authored-by: innerthunder <brandonerickson98@gmail.com>

* Refactor parameter list for pokemon#getBaseDamage and pokemon#getAttackDamage

* Rewrite move phase

Co-authored-by: innerthunder <brandonerickson98@gmail.com>

* Update tests to reflect move effect phase changes

Co-authored-by: innerthunder <brandonerickson98@gmail.com>

* Fix pluck / bug bite

Co-authored-by: innerthunder <brandonerickson98@gmail.com>

* Fix reviver seed ohko, remove leftover dead code

Co-authored-by: innerthunder <brandonerickson98@gmail.com>

* Cleanup jsdoc comments

* Remove hitsSubstitute check from postDefend abilities

* Fix improper i18nkey in moveEffectPhase#applyToTargets

* Cleanup comments

* Fix type issue with substitute test

* Move MYSTERY_ENCOUNTER_WAVES to constants.ts

* Update linkcode in damageparams to use proper tsdoc syntax

---------

Co-authored-by: innerthunder <brandonerickson98@gmail.com>
2025-04-23 00:10:27 +00:00
AJ Fontaine
aadb57ab75
[Balance] [Mystery] Salesman ME offers mons from event encounter pool (#5674)
* Initial event commit

* Salesman odds

* Clean up imports

* globalScene shiny rate getter, fix reroll, remove placeholder event

* Rerolling shiny also tries rerolling for better variant

* Shiny reroll affects 'trainer' mons too

---------

Co-authored-by: damocleas <damocleas25@gmail.com>
Co-authored-by: Sirz Benjie <142067137+SirzBenjie@users.noreply.github.com>
2025-04-23 00:03:49 +00:00
zaccie
d0be6a9274
[Bug] Fix order of operations when displaying enemy Boss level (#5685)
* order of operations in creating boss battleInfo

fixed a bug where because of an order of operations error in this file it ignored the position update of the boss life value set in battle-info.ts (around line 562)
2025-04-20 18:33:17 +00:00
Sirz Benjie
65294f408e
[Bug][UI/UX] Fix type hint after enemy disappears (#5677)
* Fix type hint after enemy disappears

* Add automated test for type hint bugfix

* Make onField default to true

* Replace reference to Mode with UiMode and battleType with BattleStyle
2025-04-19 08:04:19 -07:00
Sirz Benjie
5854b21da0
[Refactor] Remove circular imports part 1 (#5663)
* Extract Mode enum out of UI and into its own file

Reduces circular imports from 909 to 773

* Move around utility files

Reduces cyclical dependencies from 773 to 765

* Remove starterColors and bypassLogin from battle-scene

Reduces cyclical dependencies from 765 to 623

* Fix test runner error

* Update import for bypassLogin in test

* Update mocks for utils in tests

* Fix broken tests

* Update selectWithTera override

* Update path for utils in ab-attr.ts

* Update path for utils in ability-class.ts

* Fix utils import path in healer.test.ts
2025-04-19 11:57:03 +00:00
Lylian BALL
82cd492117
[Bug] Pokemon with illusion imitate the cry of the illusion (#5675) 2025-04-18 09:33:28 +00:00
Sirz Benjie
3a46aae687
[Bug] Fix beak blast: not applying if user faints and not respecting long reach (#5639)
* Add test for beak blast applying after user faints

* Rewrite tags for contact protected and check moveFlags.doesFlagEffectApply

* Add test to beak blast ensuring a long reach user does not get burned

* Re-add DamageProtectedTag to relevant inheritance chains

* Move resetSummonData to faintPhase instead of pokemon.apply

* Remove passing of grudge and destiny bond tags to faint phase
2025-04-17 15:25:38 -05:00
Sirz Benjie
45a2f42602
[Bug] Prevent game from hanging when loading in a new battle (#5676) 2025-04-17 11:44:50 -04:00
Sirz Benjie
ae588ebff9
[Bug][Move] Struggle no longer gets STAB (#5643)
* Struggle no longer gets STAB

* 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-04-16 16:05:40 -05:00
Sirz Benjie
ff44cbfa97
[Refactor] Refactor ability file part 1 (#5589)
* Move ability.ts to subfolder

* Extract types out of ability.ts

* Update imports in ability.ts and friends

* Cleanup imports in ability.ts

* Re-add imports lost during sort

* Update imports forgotten during rebase

* Re-import proper type from enums

* Update biome.jsonc

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

* Add commit to force tests to rerun

---------

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
2025-04-15 14:08:35 +00:00
damocleas
b41eee3c7f
Revert "[Refactor] Move many interfaces and enums to their own file" (#5661)
Revert "[Refactor] Move many interfaces and enums to their own file (#5646)"

This reverts commit c82e01eed3.
2025-04-14 12:28:36 -04:00
Sirz Benjie
c82e01eed3
[Refactor] Move many interfaces and enums to their own file (#5646)
* Move LearnMoveSituation to its own file

* Remove unused selfStatLowerMoves array

* Move all-moves to its own file

* Move TurnMove interface to its own file

* move AiType to its own file

* Move PokemonMove to its own file

* Move DamageCalculationResult interface to its own file

* Move fieldPosition to its own file

* Move hit-result to its own file

* Move DamageResult to its own file

* Move SpeciesWildEvolutionDelay to its own file

* move EvolutionItem to its own file
2025-04-14 08:31:26 -07:00