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 Quick Draw #3724

Merged
merged 3 commits into from
Dec 14, 2023
Merged

Fixes Quick Draw #3724

merged 3 commits into from
Dec 14, 2023

Conversation

AlexOn1ine
Copy link
Collaborator

@AlexOn1ine AlexOn1ine commented Dec 13, 2023

Quick Draw was not functioning correctly. Even though the ability triggered it didn't attack first sometimes. Additionally the user randomly attacked first without the ability triggering. For some reason tests don't catch it so it has to be tested manually. I've ran it manually a lot of times but it would be good to have confirmation that it is fixed now.

Recording with Slowbro attacking first without the ability triggering.

quick_draw.mp4

Also I added a test for Quick Claw and removed EWRAM_DATA u16 gRandomTurnNumber. The only place it was used was the Quick Claw check which I replaced with RandomPercentage

Fixes #3662

@AlexOn1ine AlexOn1ine marked this pull request as draft December 14, 2023 10:08
@AlexOn1ine
Copy link
Collaborator Author

Drafting this until I figure out what is going on

@AlexOn1ine
Copy link
Collaborator Author

Couldn't figure out the problem. Each time I fixed it a bunch of tests failed and I can't find the root cause. So two options:

  1. Merge without the fix that causes a regression (slowbro randomly attacking without the ability triggering)
  2. Close this PR

Technically it could be kept open on draft but I don't know when I will pick it up again.

@AlexOn1ine
Copy link
Collaborator Author

AlexOn1ine commented Dec 14, 2023

So I accidentally fixed it. When I was fixing issue #3662 I realized the fix might apply here as well and it seems like it did.

I moved all the Custap, Quick Draw, Quick Claw checks out of the function to a new one so it's only called from SetActionsAndBattlersTurnOrder

@AlexOn1ine AlexOn1ine marked this pull request as ready for review December 14, 2023 20:39
src/battle_main.c Outdated Show resolved Hide resolved
src/battle_main.c Outdated Show resolved Hide resolved
@Bassoonian Bassoonian merged commit be045fd into rh-hideout:master Dec 14, 2023
1 check passed
gProtectStructs[battler1].quickDraw = TRUE;
// Quick Claw and Custap Berry
if (!gProtectStructs[battler1].quickDraw
&& ((holdEffectBattler1 == HOLD_EFFECT_QUICK_CLAW && RandomPercentage(RNG_QUICK_CLAW, 10))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quick Claw has a 20% chance of boosting priority

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, #3737

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Custap Berry does not activate when the Player switches out
3 participants