Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Fix Wimp Out/EE Trainer Battle causing enemy stack with multi hit #4935

Open
wants to merge 9 commits into
base: beta
Choose a base branch
from

Conversation

muscode13
Copy link
Contributor

@muscode13 muscode13 commented Nov 23, 2024

What are the changes the user will see?

Activating Wimp Out or Emergency Exit on a boss pokemon (Guzma 115) will no longer cause the ability to trigger twice and cause 2 pokemon to stack on top of one another

Why am I making these changes?

Bug Thread: https://discord.com/channels/1125469663833370665/1290778513363959941

What are the changes from a developer perspective?

Screenshots/Videos

How to test the changes?

Basically this issue started happening due to Wimp Out and Emergency Exit triggering twice due to the interaction with the boss break bars. One for Multi-hit, which waits until the end of damage, and the other is just for general damage.

To prevent this I've added more guardrails around the applyAbAttrs to prevent this from happening again. Now there should be no overlap between the two applyAbAttrs.

I added an optional argument move to damageAndUpdate in pokemon.ts. This allows me to check for MultiHitAttr

I moved the multi-hit check to move-effect-phase.ts to utilize the lastHit variable. This will make the effect more consistent rather than relying on hitCount or hitsLeft.

Videos

Before

Multi-Hit Move
before_multihit.mp4
Multi-Lens
before_lens.mp4
Parental Bond
before_bond.mp4

After

Multi-Hit Move
yaboi_multihit.mp4
Multi-Lens
yaboi_lens.mp4
Parental Bond
yaboi_bond.mp4

Checklist

  • I'm using beta as my base branch
  • There is no overlap with another PR?
  • The PR is self-contained and cannot be split into smaller PRs?
  • Have I provided a clear explanation of the changes?
  • Have I tested the changes manually?
  • Are all unit tests still passing? (npm run test)
    • Have I created new automated tests (npm run create-test) or updated existing tests related to the PR's changes?
  • Have I provided screenshots/videos of the changes (if applicable)?
    • 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?
    • If so, please leave a link to it here:
  • Has the translation team been contacted for proofreading/translation?

@muscode13 muscode13 requested a review from a team as a code owner November 23, 2024 07:28
@Tempo-anon Tempo-anon added Ability Affects an ability P2 Bug Minor. Non crashing Incorrect move/ability/interaction labels Nov 25, 2024
src/field/pokemon.ts Outdated Show resolved Hide resolved
DayKev
DayKev previously approved these changes Nov 26, 2024
frutescens
frutescens previously approved these changes Nov 28, 2024
src/phases/move-effect-phase.ts Outdated Show resolved Hide resolved
src/field/pokemon.ts Outdated Show resolved Hide resolved
src/field/pokemon.ts Outdated Show resolved Hide resolved
@DayKev DayKev dismissed stale reviews from frutescens and themself via c20aa9f November 29, 2024 21:57
@DayKev
Copy link
Collaborator

DayKev commented Nov 29, 2024

@innerthunder tested your version but it fails if there is no pokemon source for the damage (ie: stealth rocks). See: Wimp Out test failures.

Edit: Currently testing some modifications.

It was a simple fix, nevermind.

@DayKev
Copy link
Collaborator

DayKev commented Nov 29, 2024

Video of new method:

wimp.out.multihit.test.mp4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ability Affects an ability P2 Bug Minor. Non crashing Incorrect move/ability/interaction
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants