[Bug][Ability] Fix wimp out and emergency exit skipping waves in double battles #5261
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?
Emergency Exit and Wimp Out will no longer open an alternate dimension and skip waves when a pokemon with wimp out's ability triggers in response to a spread move that causes its teammates to faint.
Why am I making these changes?
Fixes #5032
![image](https://private-user-images.githubusercontent.com/142067137/410316386-1018ee00-e636-460b-b2b8-cd174d2df0c5.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk1ODUzNDEsIm5iZiI6MTczOTU4NTA0MSwicGF0aCI6Ii8xNDIwNjcxMzcvNDEwMzE2Mzg2LTEwMThlZTAwLWU2MzYtNDYwYi1iMmI4LWNkMTc0ZDJkZjBjNS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjE1JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxNVQwMjA0MDFaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1hOGUzZTQ5ZjE5M2FmNTk3YWNiOWM4Mjk0MTE4YWU2NGQ4YmM1NGQzMzg1ZGEyNzczZDY5NDI5NzFkZDk2NDY5JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.Q7wFDHJYEAdVPcjQ9Pw5sjH1UrHBdTpfdYyMmAHewTg)
What are the changes from a developer perspective?
Inside the
start
method ofNewBattlePhase
andEndBattlePhase
, the first thing that is done after the call tosuper()
is to filter out the phase queue (and prependPhaseQueue) to clear out any extra phases that have been added.This ends up being defensive programming. Rather than adding convoluted checks at the places where
NewBattlePhase
andEndBattlePhase
occur to determine whether or not they should properly occur isScreenshots/Videos
Fixed Wimp Out
wimp_out_fixed.mp4
Old behavior on #5032
How to test the changes?
Go into a new battle with this override set:
Follow the steps in the video depicted in #5032
Checklist
beta
as my base branchnpm run test
)npm run create-test
) or updated existing tests related to the PR's changes?[ ] Have I made sure that any UI change works for both UI themes (default and legacy)?Are there any localization additions or changes? If so:[ ] Has a locales PR been created on the locales repo?[ ] Has the translation team been contacted for proofreading/translation?