[Bug] Fix multi-hit early stopping on spread moves #2648
Merged
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?
This fixes a bug where a spread move (e.g. Earthquake) from a source holding Multi-Lens only strikes each target once if one of those targets is protected or has an ability that nullifies damage.
Why am I doing these changes?
This bug was reported in the Discord. You can see Discharge incorrectly stopping in the video below
Screen_Recording_20240627_104035_Chrome.mp4
The user also provided beautiful artwork of the move's current behavior:
What did change?
Pokemon.stopMultiHit()
now has an optionaltarget
parameter. Iftarget
is specified, the target is removed from thetargets
list inMoveEffectPhase
for future strikes of the move.Screenshots/Videos
The video below shows Earthquake hitting the opponents multiple times despite the user's ally using Protect in the same turn.
PokeRogue.-.Google.Chrome.2024-06-26.20-42-24.mp4
How to test the changes?
To test via
overrides.ts
:Moves.EARTHQUAKE
) andMoves.PROTECT
)Checklist
npm run test
)