Skip to content

Commit

Permalink
Fix Quick Claw chance (#3737)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexOn1ine authored Dec 15, 2023
1 parent 9cb1b97 commit 94ffeb2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/battle_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -5107,7 +5107,7 @@ static void TryChangingTurnOrderEffects(u32 battler1, u32 battler2)
gProtectStructs[battler1].quickDraw = TRUE;
// Quick Claw and Custap Berry
if (!gProtectStructs[battler1].quickDraw
&& ((holdEffectBattler1 == HOLD_EFFECT_QUICK_CLAW && RandomPercentage(RNG_QUICK_CLAW, 10))
&& ((holdEffectBattler1 == HOLD_EFFECT_QUICK_CLAW && RandomPercentage(RNG_QUICK_CLAW, GetBattlerHoldEffectParam(battler1)))
|| (holdEffectBattler1 == HOLD_EFFECT_CUSTAP_BERRY && HasEnoughHpToEatBerry(battler1, 4, gBattleMons[battler1].item))))
gProtectStructs[battler1].usedCustapBerry = TRUE;

Expand All @@ -5117,7 +5117,7 @@ static void TryChangingTurnOrderEffects(u32 battler1, u32 battler2)
gProtectStructs[battler2].quickDraw = TRUE;
// Quick Claw and Custap Berry
if (!gProtectStructs[battler2].quickDraw
&& ((holdEffectBattler2 == HOLD_EFFECT_QUICK_CLAW && RandomPercentage(RNG_QUICK_CLAW, 10))
&& ((holdEffectBattler2 == HOLD_EFFECT_QUICK_CLAW && RandomPercentage(RNG_QUICK_CLAW, GetBattlerHoldEffectParam(battler2)))
|| (holdEffectBattler2 == HOLD_EFFECT_CUSTAP_BERRY && HasEnoughHpToEatBerry(battler2, 4, gBattleMons[battler2].item))))
gProtectStructs[battler2].usedCustapBerry = TRUE;
}
Expand Down
2 changes: 1 addition & 1 deletion test/battle/hold_effect/quick_claw.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ ASSUMPTIONS

SINGLE_BATTLE_TEST("Quick Claw activates 10% of the time")
{
PASSES_RANDOMLY(1, 10, RNG_QUICK_CLAW);
PASSES_RANDOMLY(2, 10, RNG_QUICK_CLAW);
GIVEN {
PLAYER(SPECIES_WOBBUFFET) { Speed(1); Item(ITEM_QUICK_CLAW); }
OPPONENT(SPECIES_WOBBUFFET) { Speed(100); }
Expand Down

0 comments on commit 94ffeb2

Please sign in to comment.