-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[Ability] Implement Wimp Out and Emergency Exit #4701
Conversation
@muscode13 Thank you for your contribution. |
Hey! @flx-sta Added some videos. Let me know if you'd like some more! Also just added the nightmare interaction following its recent bug fix |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like this can all be condensed into a single attribute if applied in Pokemon.damage
, which covers every source of damage and is where the Pokemon's HP is actually updated. A new subset of ability attributes (say, PostDamageAbAttr
) and a new apply function applyPostDamageAbAttrs
in support of Wimp Out/EE's attribute could also be helpful.
@innerthunder Refactored the code to now use a new class |
Alright! I updated the videos. They are all of the refactored version. Ready for another review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one nit left on my end
@DayKev Added some code for Multi-Lens, but it's pretty ghetto since the modifier doesn't update the turnData with all the damage dealt. Let me know if you think we're better off without it. Thanks! |
… lens in pokemon.apply
Added 3 more videos to the description showing the updated Multi Hit, Multi Lens, and P Bond interaction |
…ental Bond logic + test, put applyPostDamageAbAttrs back in damageAndUpdate
Co-authored-by: innerthunder <[email protected]>
13f01cc
to
8db0d37
Compare
…r U-turn changes, fix syntax error
What are the changes the user will see?
Wimp Out and Emergency Exit implemented
Why am I making these changes?
Ability is not implemented
What are the changes from a developer perspective?
There are several attributes and a condition function, as well as some helper functions I added to make this ability work:
calculateShellBellRecovery
- Calculates the amount healed off Shell Bell. This covers the case where if the pokemon's health falls below half and recovers back above half from a Shell Bell, Wimp Out should activate even after the Shell Bell recoveryForceSwitchOutHelper
- This is mostly logic from the ForceSwitchOutAttr in moves that was lifted and shifted here.PostDamageAbAttr
- This ability attribute triggers after the pokemon takes damage.PostDamageForceSwitchAbAttr
- This triggers a forced switch out after the pokemon drops below the given ratio, defaulting at 50%, it has several conditions like certain moves not triggering it like Pain Split or if it falls below half and recovers back above half from a Shell Bell, it will activate even after the Shell Bell recoveryI also had to add a small check and helper function to PostDamageForceSwitchAbAttr in moves.ts, to account for an edge case interaction: If Wimp Out activates due to being hit by U-turn or Volt Switch, the user of that move will not be switched out.
Videos
Hazard Activation (Stealth Rocks):
hazards.mp4
Recoil Activation:
recoil.mp4
Post Defend Activation:
defending.mp4
Weather Activation (Hail):
weather.mp4
Post Turn Damage Activation (Leech Seed):
postturn.mp4
Victory Activation (Aftermath):
aftermath.mp4
Ignore Trapped to Flee:
trapped.mp4
Substitute does not trigger Ability:
substitute.mp4
Wild Battle:
wild.mp4
Trainer Battle:
trainer.mp4
Vortex Trap (Whirlpool):
trap.mp4
Sky Drop Interaction:
skydrop.mp4
Sheer Force Interaction:
sheerforce.mp4
Multi-Hit moves continue uninterrupted:
multihit.mp4
U-Turn/Volt Switch interaction:
voltswitch.mp4
Does not Trigger when below half:
belowhalf.mp4
Status Damage:
toxic.mp4
Status Applied to Wimp Out user as they switch:
applystatus.mp4
If it falls below half and recovers back above half from a Shell Bell, Wimp Out will activate even after the Shell Bell recovery:
shellbell.mp4
Updated Multi Hit Move:
multihit.mp4
Multi Lens moves continue uninterrupted and triggers Ability:
multilens.mp4
Parental Bond continues uninterrupted and triggers Ability:
pbond.mp4
How to test the changes?
npm run test wimp_out
Checklist
beta
as my base branchnpm run test
)