Commit Graph

5 Commits

Author SHA1 Message Date
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
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
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
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