From 9bf2ffe45902a8ba23a0310a847e0cb32986bb74 Mon Sep 17 00:00:00 2001 From: ghoulslash Date: Wed, 22 Sep 2021 21:15:02 -0400 Subject: [PATCH] fix lash out stat fell --- include/battle.h | 2 +- src/battle_script_commands.c | 6 +++--- src/battle_util.c | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/battle.h b/include/battle.h index cf231f5ae6..b36780ee5f 100644 --- a/include/battle.h +++ b/include/battle.h @@ -148,6 +148,7 @@ struct ProtectStruct u32 custap:1; // also quick claw u32 touchedProtectLike:1; u32 disableEjectPack:1; + u32 statFell:1; u32 physicalDmg; u32 specialDmg; u8 physicalBattlerId; @@ -156,7 +157,6 @@ struct ProtectStruct struct SpecialStatus { - u8 statFell:1; u8 statLowered:1; u8 lightningRodRedirected:1; u8 restoredBattlerSprite: 1; diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index ea9278f45f..42e723ecc3 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -5164,12 +5164,12 @@ static void Cmd_moveend(void) { u8 battler = battlers[i]; if (IsBattlerAlive(battler) - && gSpecialStatuses[battler].statFell + && gProtectStructs[battler].statFell && GetBattlerHoldEffect(battler, TRUE) == HOLD_EFFECT_EJECT_PACK && !(gCurrentMove == MOVE_PARTING_SHOT && CanBattlerSwitch(gBattlerAttacker)) // Does not activate if attacker used Parting Shot and can switch out && CountUsablePartyMons(battler) > 0) // Has mon to switch into { - gSpecialStatuses[battler].statFell = FALSE; + gProtectStructs[battler].statFell = FALSE; gActiveBattler = gBattleScripting.battler = battler; gLastUsedItem = gBattleMons[battler].item; BattleScriptPushCursor(); @@ -9409,7 +9409,7 @@ static u32 ChangeStatBuffs(s8 statValue, u32 statId, u32 flags, const u8 *BS_ptr { // Check eject pack. disableEjectPack set for edge cases (e.g. attacking weak armor'd eject pack holder with u-turn) if (gProtectStructs[gActiveBattler].disableEjectPack == 0) - gSpecialStatuses[gActiveBattler].statFell = TRUE; + gProtectStructs[gActiveBattler].statFell = 1; gBattleCommunication[MULTISTRING_CHOOSER] = (gBattlerTarget == gActiveBattler); // B_MSG_ATTACKER_STAT_FELL or B_MSG_DEFENDER_STAT_FELL } } diff --git a/src/battle_util.c b/src/battle_util.c index 6eb6556363..80b5f824cd 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -5996,10 +5996,10 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn) } break; case HOLD_EFFECT_EJECT_PACK: - if (gSpecialStatuses[battlerId].statFell + if (gProtectStructs[battlerId].statFell && !(gCurrentMove == MOVE_PARTING_SHOT && CanBattlerSwitch(gBattlerAttacker))) // Does not activate if attacker used Parting Shot and can switch out { - gSpecialStatuses[battlerId].statFell = FALSE; + gProtectStructs[battlerId].statFell = FALSE; gActiveBattler = gBattleScripting.battler = battlerId; effect = ITEM_STATS_CHANGE; if (moveTurn) @@ -7468,7 +7468,7 @@ static u16 CalcMoveBasePower(u16 move, u8 battlerAtk, u8 battlerDef) basePower *= 2; break; case EFFECT_LASH_OUT: - if (gSpecialStatuses[battlerAtk].statFell == 1) + if (gProtectStructs[battlerAtk].statFell) basePower *= 2; break; case EFFECT_EXPLOSION: