pokerogue/test
schmidtc1 40e1e7fd4e
[Bug] Fix Reviver Seed and endure triggering on indirect damage (#5182)
* Create new turnData field for tracking damageResults, check for HitResult in Reviver Seed modifier

* Optional chaining for cases like stealth rock

* Adds HitResult.SELF for confusion to distinguish from indirect damage

* Adds HitResult.SELF to damage sound effect switch

* Cover edge case of salt cure, insert HitResult for ALL damage regardless of optional variable

* Change Liquid Ooze HitResult to OTHER from HEAL

* Adjust OHKO moves to not bypass endure or RSeed

* Add tests for reviver seed

* Fixes endure to no longer block indirect damage, updates weather damage to be HitResult.OTHER, adds/fixes unit test

* Change destiny bond to HitResult.OTHER so it doesn't trigger rseed

* Adds destiny bond unit test

* Creates additional unit tests for endure

* Rename SELF hitresult to CONFUSION

* Update CONFUSION enum

* Refactors implementation per Wlowscha's suggestions: removes damageSources array and preventEndure variable

* Rename HitResult.OTHER to INDIRECT, create INDIRECT_KO for PSong/DBond, add functionality for INDIRECT_KO to damageanim/number handler

* Fixes hit result for stealth rock

* Removes unnecessary check, makes DamageResult default to EFFECTIVE, updates remaining damageAndUpdate calls to use INDIRECT

* Refactors damageAndUpdate to replace optional parameters with object parameter

* Fixes based on Kev's suggestions

* Updates tsdocs for damageAndUpdate

* Fix merge conflict

---------

Co-authored-by: Wlowscha <54003515+Wlowscha@users.noreply.github.com>
2025-03-23 22:59:19 +00:00
..
abilities [BUG] fixes #5472 - transform on reload (#5508) 2025-03-23 12:07:14 -07:00
achievements [Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495) 2025-03-09 14:13:25 -07:00
arena [Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495) 2025-03-09 14:13:25 -07:00
battle [Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495) 2025-03-09 14:13:25 -07:00
battlerTags [Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495) 2025-03-09 14:13:25 -07:00
data [Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495) 2025-03-09 14:13:25 -07:00
eggs [Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495) 2025-03-09 14:13:25 -07:00
field [Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495) 2025-03-09 14:13:25 -07:00
inputs [Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495) 2025-03-09 14:13:25 -07:00
items [Bug] Fix Reviver Seed and endure triggering on indirect damage (#5182) 2025-03-23 22:59:19 +00:00
moves [Bug] Fix Reviver Seed and endure triggering on indirect damage (#5182) 2025-03-23 22:59:19 +00:00
mystery-encounter [Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495) 2025-03-09 14:13:25 -07:00
phases [Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495) 2025-03-09 14:13:25 -07:00
plugins/api [Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495) 2025-03-09 14:13:25 -07:00
settingMenu [Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495) 2025-03-09 14:13:25 -07:00
sprites [Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495) 2025-03-09 14:13:25 -07:00
system [Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495) 2025-03-09 14:13:25 -07:00
testUtils [Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495) 2025-03-09 14:13:25 -07:00
ui [Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495) 2025-03-09 14:13:25 -07:00
account.test.ts [Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495) 2025-03-09 14:13:25 -07:00
battle-scene.test.ts [Test] Move test folder out of src (#5398) 2025-02-22 22:52:07 -06:00
boss-pokemon.test.ts [Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495) 2025-03-09 14:13:25 -07:00
daily_mode.test.ts [Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495) 2025-03-09 14:13:25 -07:00
endless_boss.test.ts [Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495) 2025-03-09 14:13:25 -07:00
enemy_command.test.ts [Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495) 2025-03-09 14:13:25 -07:00
escape-calculations.test.ts [Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495) 2025-03-09 14:13:25 -07:00
evolution.test.ts [Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495) 2025-03-09 14:13:25 -07:00
final_boss.test.ts [Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495) 2025-03-09 14:13:25 -07:00
fontFace.setup.ts [Test] Move test folder out of src (#5398) 2025-02-22 22:52:07 -06:00
game-mode.test.ts [Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495) 2025-03-09 14:13:25 -07:00
imports.test.ts [Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495) 2025-03-09 14:13:25 -07:00
internals.test.ts [Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495) 2025-03-09 14:13:25 -07:00
misc.test.ts [Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495) 2025-03-09 14:13:25 -07:00
pre.test.ts [Test] Move test folder out of src (#5398) 2025-02-22 22:52:07 -06:00
reload.test.ts [Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495) 2025-03-09 14:13:25 -07:00
vitest.setup.ts [Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495) 2025-03-09 14:13:25 -07:00