pokerogue/src
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 [Bug] [Refactor] [Move] Add selection prevention and move failures (#6276) 2025-09-29 12:08:42 -05:00
ai [AI][Beta][Bug] Ensure AI always spawns with 4 moves if it can (#6563) 2025-09-28 22:57:01 -05:00
configs/inputs [Dev] Migrated to Biome 2.2.3, added more rules (#6259) 2025-09-08 10:35:18 -05:00
constants [Bug] [Docs] Fix @module tags (#6557) 2025-09-14 22:35:12 -05:00
data [Bug] [Refactor] [Move] Add selection prevention and move failures (#6276) 2025-09-29 12:08:42 -05:00
enums [Bug] [Refactor] [Move] Add selection prevention and move failures (#6276) 2025-09-29 12:08:42 -05:00
events [UI/UX] Show correct max duration in flyout (#6566) 2025-09-18 13:35:22 -07:00
field [Bug] [Refactor] [Move] Add selection prevention and move failures (#6276) 2025-09-29 12:08:42 -05:00
global-vars [Refactor] Merged interfaces/ into @types/; removed runtime orphan modules 2025-06-07 17:28:01 -07:00
init [Misc] Simplifying imports of UI files (#6542) 2025-09-11 00:30:17 -07:00
modifier [Misc/Feature] Add dynamic turn order (#6036) 2025-09-20 17:49:40 -05:00
phases [Bug] [Refactor] [Move] Add selection prevention and move failures (#6276) 2025-09-29 12:08:42 -05:00
pipelines Revert "[Refactor] Add TIME_OF_DAY_OVERRIDE & refactor arena tint code" 2025-09-27 14:55:59 -07:00
plugins [Misc][UI/UX] See stats of other users in admin panel (#6579) 2025-09-27 14:44:29 -07:00
queues [Misc/Feature] Add dynamic turn order (#6036) 2025-09-20 17:49:40 -05:00
sprites [Refactor] Remove isNullOrUndefined in favor of loose check against null (#6549) 2025-09-12 14:53:27 -05:00
system [Misc][UI/UX] See stats of other users in admin panel (#6579) 2025-09-27 14:44:29 -07:00
typings [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 [Bug] [Refactor] [Move] Add selection prevention and move failures (#6276) 2025-09-29 12:08:42 -05:00
account.ts [Bug] [Beta] Fix renaming runs (#6268) 2025-08-14 16:57:01 -05:00
battle-scene.ts Revert "[Refactor] Add TIME_OF_DAY_OVERRIDE & refactor arena tint code" 2025-09-27 14:55:59 -07:00
battle.ts [Dev] Migrated to Biome 2.2.3, added more rules (#6259) 2025-09-08 10:35:18 -05:00
constants.ts [Misc] Fix circular dep (#6361) 2025-08-23 10:00:00 -05:00
dynamic-queue-manager.ts [Misc] Blacklist more dynamic phases (#6585) 2025-09-21 12:05:13 -07:00
game-mode.ts [Refactor] Remove isNullOrUndefined in favor of loose check against null (#6549) 2025-09-12 14:53:27 -05:00
global-event-manager.ts [Dev] Enable Biome import sorting (#6052) 2025-07-13 00:21:25 -07:00
global-scene.ts [Dev] Enable Biome import sorting (#6052) 2025-07-13 00:21:25 -07:00
inputs-controller.ts [Dev] Migrated to Biome 2.2.3, added more rules (#6259) 2025-09-08 10:35:18 -05:00
loading-scene.ts [UI/UX] Add language selection to login screen (#6302) 2025-09-10 13:53:57 -05:00
main.ts [Dev] Migrated to Biome 2.2.3, added more rules (#6259) 2025-09-08 10:35:18 -05:00
messages.ts [Docs] Fixup typedoc warnings (#6540) 2025-09-10 13:35:55 -05:00
overrides.ts Revert "[Refactor] Add TIME_OF_DAY_OVERRIDE & refactor arena tint code" 2025-09-27 14:55:59 -07:00
phase-manager.ts [Misc/Feature] Add dynamic turn order (#6036) 2025-09-20 17:49:40 -05:00
phase-tree.ts [Docs] Fix/update some comments and spacing 2025-09-21 00:22:53 -07:00
phase.ts [Test] Removed deprecated functions from phase interceptor (#6195) 2025-08-19 19:54:40 -05:00
polyfills.ts [Dev] Add support for manually rolling polyfills. Add polyfill for promise.withResolvers (#6103) 2025-07-19 09:06:32 -07:00
scene-base.ts [Dev] Enable Biome import sorting (#6052) 2025-07-13 00:21:25 -07:00
starting-wave.ts [Dev] Enable Biome import sorting (#6052) 2025-07-13 00:21:25 -07:00
timed-event-manager.ts [i18n] Language codes adjustments (#6587) 2025-09-22 05:45:28 -07:00
touch-controls.ts [Bug] Make touch events prevent pointer events (#6528) 2025-09-10 13:59:21 -05:00
tutorial.ts [Misc] Simplifying imports of UI files (#6542) 2025-09-11 00:30:17 -07:00
ui-inputs.ts [Misc] Simplifying imports of UI files (#6542) 2025-09-11 00:30:17 -07:00
vite.env.d.ts [Tests][Bug][Beta] Fix ditto bug and add unit tests (#6559) 2025-09-15 23:26:57 -05:00