pokerogue/test
Sirz Benjie ec4ddab8be
[Bug] [Refactor] [Move] Add selection prevention and move failures (#6276)
* Add failure conditions and move failures part 1

* Add second and third failure sequences

* Refactor mostly complete, need to recheck tests

* Adjust status checks to respect ignoreStatus useModes

* Adjust restriction for stuff cheeks

* Address bertie's review comments

* Add counterRedirectAttr to other counter-like moves

* Adjust some documentation for new methods

* Make substitute use the move tag

* Adjust counter attr to use array.find

* Adjust move condition check that occurs in the third failure check sequence

* Insert move failure check sequence part 4 into move phase

* Revert type adjustment to getBattlerIndex

* Make charging moves deduct pp on use instead of on release

* Fix first move condition not using 1 based starting wave

* Tweak charge move handling and protean timing

* Adjust fly tests to expect pp reduction properly

* Add missing attribute to counter

* Adjust revival blessing hardcore test to respect new return value of isUsable

* Adjust copycat test to account for how it actually works

* Play sleep animation and message

* Remove BYPASS_SLEEP battler tag in favor of boolean holder

* Finish unfinished docs

* Ensure move restrictions are only checked for players

* Adjust pollen puff condition, fix docs on `isOpponent`

* Fix failAgainstFinalBossCondition

* Fix dig test

* Adjust dive's test

* Fix missing break in applyConditions

* Fix getBattlerIndex for enemyPokemon

* Adjust type hint test to not rely on teleport

* Minor adjustments from code review

Co-authored-by: Bertie690 <136088738+Bertie690@users.noreply.github.com>

* Add tests for teleport

* Minor adjustments from code review

Co-authored-by: Bertie690 <136088738+Bertie690@users.noreply.github.com>

* PR review changes

Fix type hints test name

Update Dig/Dive test name

Separate TSDoc imports in `pokemon-utils.ts`

Add missing `@returns` in `move-phase.ts`

Fix comment typos

Separate TSDoc imports in `move-phase.ts`

Add return hints to `trySelectMove`

Minor formatting

Remove duplicate `.affectedByGravity()` on Telekinesis

Fix docs for `checkRestrictions`

Manually format method definition

Fix comment spacing

Fix variable naming

* Address kev's review comments

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

* Minor adjustments from code review

Co-authored-by: Bertie690 <136088738+Bertie690@users.noreply.github.com>

* Remove optional chaining

* fix: type for InferKeys

* chore: apply biome

* chore: fix merge conflicts from Biome update

* Remove latent isNullOrUndefined

* Drop readonly on timingModifier

* docs: Add class comment

* Address comments from code review

* Drop readonly from timingModifier

* Cleanup proc chance computation

* Move `cureStatus` into the Pokemon class

* Final touchups

---------

Co-authored-by: Bertie690 <136088738+Bertie690@users.noreply.github.com>
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
2025-09-29 12:08:42 -05:00
..
@types [Test] Added Map key matcher; enforced strong typing on matchers (#6561) 2025-09-20 17:24:27 -05:00
abilities [Bug] [Refactor] [Move] Add selection prevention and move failures (#6276) 2025-09-29 12:08:42 -05:00
achievements [Misc] [UX] Add Daily Run Achievement, Re-Arrange Achievements, Replace some Icon Sprites (#6292) 2025-08-22 19:21:17 -04:00
ai [AI][Beta][Bug] Ensure AI always spawns with 4 moves if it can (#6563) 2025-09-28 22:57:01 -05:00
arena [Test] Replace game.scene.getXPokemon()! with game.field.getXPokemon() 2025-08-04 21:19:57 -07:00
battle [Misc/Feature] Add dynamic turn order (#6036) 2025-09-20 17:49:40 -05:00
battler-tags [Bug] [Refactor] [Move] Add selection prevention and move failures (#6276) 2025-09-29 12:08:42 -05:00
challenges [Bug] [Refactor] [Move] Add selection prevention and move failures (#6276) 2025-09-29 12:08:42 -05:00
data [Test] Replace game.scene.getXPokemon()! with game.field.getXPokemon() 2025-08-04 21:19:57 -07:00
eggs [Refactor] Remove isNullOrUndefined in favor of loose check against null (#6549) 2025-09-12 14:53:27 -05:00
field [Balance][Challenge] Block master ball catching final boss in challenges (#6273) 2025-08-20 19:24:55 -04:00
inputs [Misc] Standardize-file-names (#6137) 2025-07-24 16:38:31 -04:00
items [Test] Updated more uses of game.scene.getEnemyField and game.scene.getPlayerField to use updated test utils (#6524) 2025-09-18 09:36:08 -05:00
moves [Bug] [Refactor] [Move] Add selection prevention and move failures (#6276) 2025-09-29 12:08:42 -05:00
mystery-encounter [AI][Beta][Bug] Ensure AI always spawns with 4 moves if it can (#6563) 2025-09-28 22:57:01 -05:00
phases [Misc] Simplifying imports of UI files (#6542) 2025-09-11 00:30:17 -07:00
plugins/api [Misc][UI/UX] See stats of other users in admin panel (#6579) 2025-09-27 14:44:29 -07:00
setting-menu [Dev] Migrated to Biome 2.2.3, added more rules (#6259) 2025-09-08 10:35:18 -05:00
setup [Refactor][Dev] Move public to its own submodule (#6590) 2025-09-27 11:01:12 -05:00
sprites [Refactor][Dev] Move public to its own submodule (#6590) 2025-09-27 11:01:12 -05:00
status-effects [Bug] Fix status effects overwriting each other (#6392) 2025-08-24 12:51:16 -05:00
system [Refactor] Move type definitions away from game-data.ts (#6487) 2025-09-10 14:09:33 -05:00
test-utils [Misc][UI/UX] See stats of other users in admin panel (#6579) 2025-09-27 14:44:29 -07:00
types [Test] Port over + augment remaining test matchers from pkty (#6159) 2025-08-02 15:35:06 -07:00
ui [Bug] [Refactor] [Move] Add selection prevention and move failures (#6276) 2025-09-29 12:08:42 -05:00
utils [Refactor] Refactor boss health segment calculation to improve clarity (#6574) 2025-09-22 20:08:39 -05:00
account.test.ts [Dev] Enable Biome import sorting (#6052) 2025-07-13 00:21:25 -07:00
battle-scene.test.ts [Misc] Standardize-file-names (#6137) 2025-07-24 16:38:31 -04:00
boss-pokemon.test.ts [Refactor] Refactor boss health segment calculation to improve clarity (#6574) 2025-09-22 20:08:39 -05:00
daily-mode.test.ts [Misc] Simplifying imports of UI files (#6542) 2025-09-11 00:30:17 -07:00
endless-boss.test.ts [Test] Replace game.scene.getXPokemon()! with game.field.getXPokemon() 2025-08-04 21:19:57 -07:00
enemy-command.test.ts [Test] Replace game.scene.getXPokemon()! with game.field.getXPokemon() 2025-08-04 21:19:57 -07:00
escape-calculations.test.ts [Test] Updated more uses of game.scene.getEnemyField and game.scene.getPlayerField to use updated test utils (#6524) 2025-09-18 09:36:08 -05:00
evolution.test.ts [Hotfix] Fix tyrogue evo (#6414) 2025-08-26 06:57:11 +00:00
final-boss.test.ts [Test] Replace game.scene.getXPokemon()! with game.field.getXPokemon() 2025-08-04 21:19:57 -07:00
game-mode.test.ts [Misc] Standardize-file-names (#6137) 2025-07-24 16:38:31 -04:00
internals.test.ts [Test] Replace game.scene.getXPokemon()! with game.field.getXPokemon() 2025-08-04 21:19:57 -07:00
misc.test.ts [Misc] Move asset initialization from preload to launchBattle 2025-08-02 14:29:35 -07:00
reload.test.ts [Misc] Standardize-file-names (#6137) 2025-07-24 16:38:31 -04:00
utils.test.ts [Dev] Enable Biome import sorting (#6052) 2025-07-13 00:21:25 -07:00