fixed bug giving immunity to full-paralysis when B_MAGIC_GUARD is >= GEN_4 (#6032)

This commit is contained in:
AERDU 2025-01-18 18:54:20 +00:00 committed by GitHub
parent 9ed3b176f0
commit e4e4460636
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 3 additions and 3 deletions

View File

@ -156,7 +156,7 @@
// In Gen3, Effect Spore has a 10% chance to sleep, poison or paralyze, with an equal chance. // In Gen3, Effect Spore has a 10% chance to sleep, poison or paralyze, with an equal chance.
// In Gen4, it's 30%. In Gen5+ it has 11% to sleep, 9% chance to poison and 10% chance to paralyze. // In Gen4, it's 30%. In Gen5+ it has 11% to sleep, 9% chance to poison and 10% chance to paralyze.
#define B_PICKUP_WILD GEN_LATEST // In Gen9+, Pickup allows its user to pickup its own used item at the end of the turn in wild battles. #define B_PICKUP_WILD GEN_LATEST // In Gen9+, Pickup allows its user to pickup its own used item at the end of the turn in wild battles.
#define B_MAGIC_GUARD GEN_LATEST // In Gen4+, Magic Guard ignores immobilization caused by paralysis #define B_MAGIC_GUARD GEN_LATEST // In Gen4 only, Magic Guard ignores immobilization caused by paralysis
// Item settings // Item settings
#define B_HP_BERRIES GEN_LATEST // In Gen4+, berries which restore HP activate immediately after HP drops to half. In Gen3, the effect occurs at the end of the turn. #define B_HP_BERRIES GEN_LATEST // In Gen4+, berries which restore HP activate immediately after HP drops to half. In Gen3, the effect occurs at the end of the turn.

View File

@ -3507,7 +3507,7 @@ u8 AtkCanceller_UnableToUseMove(u32 moveType)
case CANCELLER_PARALYSED: // paralysis case CANCELLER_PARALYSED: // paralysis
if (!gBattleStruct->isAtkCancelerForCalledMove if (!gBattleStruct->isAtkCancelerForCalledMove
&& gBattleMons[gBattlerAttacker].status1 & STATUS1_PARALYSIS && gBattleMons[gBattlerAttacker].status1 & STATUS1_PARALYSIS
&& (GetBattlerAbility(gBattlerAttacker) != ABILITY_MAGIC_GUARD && B_MAGIC_GUARD >= GEN_4) && !(B_MAGIC_GUARD == GEN_4 && GetBattlerAbility(gBattlerAttacker) == ABILITY_MAGIC_GUARD)
&& !RandomPercentage(RNG_PARALYSIS, 75)) && !RandomPercentage(RNG_PARALYSIS, 75))
{ {
gProtectStructs[gBattlerAttacker].prlzImmobility = TRUE; gProtectStructs[gBattlerAttacker].prlzImmobility = TRUE;

View File

@ -18,7 +18,7 @@ SINGLE_BATTLE_TEST("Magic Guard prevents recoil damage to the user")
SINGLE_BATTLE_TEST("Magic Guard ignores immobilization that can be caused by paralysis") SINGLE_BATTLE_TEST("Magic Guard ignores immobilization that can be caused by paralysis")
{ {
if (B_MAGIC_GUARD >= GEN_4) if (B_MAGIC_GUARD == GEN_4)
PASSES_RANDOMLY(1, 1, RNG_PARALYSIS); PASSES_RANDOMLY(1, 1, RNG_PARALYSIS);
else else
PASSES_RANDOMLY(75, 100, RNG_PARALYSIS); PASSES_RANDOMLY(75, 100, RNG_PARALYSIS);