[Bug] Fix #5358 Abilities that Redirect Moves Consider Move-Typings before Ability Modifiers #5464
+245
−5
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What are the changes the user will see?
Redirection abilities based on type (Lightningrod, Storm Drain) will consider the current type of a move, not its base type. i.e. Lightningrod will not affect normalize thunderbolt, and Storm Drain will affect liquid voice psychic noise.
Why am I making these changes?
Fixes #5358
What are the changes from a developer perspective?
There is already a method to get a move's current type based on the pokemon using it, these abilities just weren't using it. I added the user of the move as an expected parameter (in args) to
apply
forRedirectMoveAbAttr
and replacedallMoves[moveId].type
withuser.getMoveType(allMoves[moveId])
.I don't forsee any edge cases here as these abilities should always consider the active type of a move, and if
getMoveType
doesn't always return the correct type then it would be an issue with that method.Screenshots/Videos
2025-03-02.00-24-05.mp4
How to test the changes?
Automated tests
Checklist
beta
as my base branchnpm run test
)npm run create-test
) or updated existing tests related to the PR's changes?Are there any localization additions or changes? If so: