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

Fixes Defiant interaction with Court Changed Sticky Web + Fickle Beam description #5093

Merged
merged 4 commits into from
Aug 6, 2024

Conversation

PhallenTree
Copy link

@PhallenTree PhallenTree commented Aug 5, 2024

Fixes Defiant/Competitive no longer working if the battler enters the field with a Court Changed Sticky Web on its side of the field. Adds test for this and for Defiant not triggering on Court Changed Sticky Web.

Fixes Fickle Beam's description's first line being too long.

Issue(s) that this PR fixes

Fixes #5086

Discord contact info

PhallenTree

@AlexOn1ine
Copy link
Collaborator

@PhallenTree I don't understand why it was broken and why this fixes it. Could you provide a small overview of the problem and fix?

@Pawkkie Pawkkie added category: battle-mechanic Pertains to battle mechanics bugfix Bugfixes labels Aug 6, 2024
@hedara90
Copy link
Collaborator

hedara90 commented Aug 6, 2024

I was the one who reported the bug. I don't know why this fixes it (I haven't checked).
But the problem was:

  • Player uses Sticky Web
  • Someone uses Court Change to switch the webs to the player side
  • Player switches in a 'mon with Defiant
  • Defiant does not trigger from the speed drop from the webs (intended behavior)
  • Further stat drops from opposing sources no longer triggers Defiant for the 'mon (bugged behavior)

@PhallenTree
Copy link
Author

PhallenTree commented Aug 6, 2024

This bug occurs in the first place because gBattleScripting.stickyWebStatDrop gets set to 1 when a mon switches into Sticky Web and would only get set to 0 if Defiant/Competitive triggered. Since the value was 1, !(gBattleScripting.stickyWebStatDrop == 1 && gSideTimers[targetSide].stickyWebBattlerSide == targetSide) (which is the last condition to trigger Defiant/Competitive) would always fail as long as the target has a Sticky Web on its side of the field setup by its own side of the field. The fix sets gBattleScripting.stickyWebStatDrop to 0 once Sticky Web is done so that Defiant/Competitive continue working correctly afterwards.
I've replaced my previous fix with one which makes a bit more sense.

@AlexOn1ine AlexOn1ine merged commit 67f049f into rh-hideout:master Aug 6, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix Bugfixes category: battle-mechanic Pertains to battle mechanics
Projects
None yet
Development

Successfully merging this pull request may close these issues.

If Court Change moves Sticky Web to the users side Defient stops working for the user on switch in
4 participants