Fixed Stomping Tantrum not doubling in damage if the user failed Protect (#8008)
This commit is contained in:
parent
2416bfb53b
commit
dc0d910182
@ -217,6 +217,7 @@ enum RandomTag
|
||||
RNG_WRAP,
|
||||
RNG_BALLTHROW_CRITICAL,
|
||||
RNG_BALLTHROW_SHAKE,
|
||||
RNG_PROTECT_FAIL,
|
||||
};
|
||||
|
||||
#define RandomWeighted(tag, ...) \
|
||||
|
||||
@ -9575,7 +9575,7 @@ static void Cmd_setprotectlike(void)
|
||||
if (gCurrentTurnActionNumber == (gBattlersCount - 1))
|
||||
notLastTurn = FALSE;
|
||||
|
||||
if ((sProtectSuccessRates[gDisableStructs[gBattlerAttacker].protectUses] >= Random() && notLastTurn)
|
||||
if ((sProtectSuccessRates[gDisableStructs[gBattlerAttacker].protectUses] >= RandomUniform(RNG_PROTECT_FAIL, 0, USHRT_MAX) && notLastTurn)
|
||||
|| (protectMethod == PROTECT_WIDE_GUARD && B_WIDE_GUARD != GEN_5)
|
||||
|| (protectMethod == PROTECT_QUICK_GUARD && B_QUICK_GUARD != GEN_5))
|
||||
{
|
||||
@ -9604,6 +9604,7 @@ static void Cmd_setprotectlike(void)
|
||||
gDisableStructs[gBattlerAttacker].protectUses = 0;
|
||||
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_PROTECT_FAILED;
|
||||
gBattleStruct->moveResultFlags[gBattlerTarget] |= MOVE_RESULT_MISSED;
|
||||
gBattleStruct->battlerState[gBattlerAttacker].stompingTantrumTimer = 2;
|
||||
}
|
||||
|
||||
gBattlescriptCurrInstr = cmd->nextInstr;
|
||||
|
||||
@ -90,6 +90,31 @@ SINGLE_BATTLE_TEST("Stomping Tantrum will not deal double damage if target prote
|
||||
}
|
||||
}
|
||||
|
||||
SINGLE_BATTLE_TEST("Stomping Tantrum will deal double damage if user failed a Protect")
|
||||
{
|
||||
s16 damage[2];
|
||||
GIVEN {
|
||||
PLAYER(SPECIES_WOBBUFFET);
|
||||
OPPONENT(SPECIES_WOBBUFFET);
|
||||
} WHEN {
|
||||
TURN { MOVE(player, MOVE_STOMPING_TANTRUM); }
|
||||
TURN { MOVE(player, MOVE_PROTECT); }
|
||||
TURN { MOVE(player, MOVE_PROTECT, WITH_RNG(RNG_PROTECT_FAIL, USHRT_MAX)); }
|
||||
TURN { MOVE(player, MOVE_STOMPING_TANTRUM); }
|
||||
} SCENE {
|
||||
ANIMATION(ANIM_TYPE_MOVE, MOVE_STOMPING_TANTRUM, player);
|
||||
HP_BAR(opponent, captureDamage: &damage[0]);
|
||||
|
||||
ANIMATION(ANIM_TYPE_MOVE, MOVE_PROTECT, player);
|
||||
NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_PROTECT, player);
|
||||
|
||||
ANIMATION(ANIM_TYPE_MOVE, MOVE_STOMPING_TANTRUM, player);
|
||||
HP_BAR(opponent, captureDamage: &damage[1]);
|
||||
} THEN {
|
||||
EXPECT_MUL_EQ(damage[0], Q_4_12(2.0), damage[1]);
|
||||
}
|
||||
}
|
||||
|
||||
SINGLE_BATTLE_TEST("Stomping Tantrum will not deal double if it missed")
|
||||
{
|
||||
s16 damage[2];
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user