mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2025-01-15 08:03:45 +01:00
fix lash out stat fell
This commit is contained in:
parent
1309eea8ec
commit
9bf2ffe459
@ -148,6 +148,7 @@ struct ProtectStruct
|
|||||||
u32 custap:1; // also quick claw
|
u32 custap:1; // also quick claw
|
||||||
u32 touchedProtectLike:1;
|
u32 touchedProtectLike:1;
|
||||||
u32 disableEjectPack:1;
|
u32 disableEjectPack:1;
|
||||||
|
u32 statFell:1;
|
||||||
u32 physicalDmg;
|
u32 physicalDmg;
|
||||||
u32 specialDmg;
|
u32 specialDmg;
|
||||||
u8 physicalBattlerId;
|
u8 physicalBattlerId;
|
||||||
@ -156,7 +157,6 @@ struct ProtectStruct
|
|||||||
|
|
||||||
struct SpecialStatus
|
struct SpecialStatus
|
||||||
{
|
{
|
||||||
u8 statFell:1;
|
|
||||||
u8 statLowered:1;
|
u8 statLowered:1;
|
||||||
u8 lightningRodRedirected:1;
|
u8 lightningRodRedirected:1;
|
||||||
u8 restoredBattlerSprite: 1;
|
u8 restoredBattlerSprite: 1;
|
||||||
|
@ -5164,12 +5164,12 @@ static void Cmd_moveend(void)
|
|||||||
{
|
{
|
||||||
u8 battler = battlers[i];
|
u8 battler = battlers[i];
|
||||||
if (IsBattlerAlive(battler)
|
if (IsBattlerAlive(battler)
|
||||||
&& gSpecialStatuses[battler].statFell
|
&& gProtectStructs[battler].statFell
|
||||||
&& GetBattlerHoldEffect(battler, TRUE) == HOLD_EFFECT_EJECT_PACK
|
&& 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
|
&& !(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
|
&& CountUsablePartyMons(battler) > 0) // Has mon to switch into
|
||||||
{
|
{
|
||||||
gSpecialStatuses[battler].statFell = FALSE;
|
gProtectStructs[battler].statFell = FALSE;
|
||||||
gActiveBattler = gBattleScripting.battler = battler;
|
gActiveBattler = gBattleScripting.battler = battler;
|
||||||
gLastUsedItem = gBattleMons[battler].item;
|
gLastUsedItem = gBattleMons[battler].item;
|
||||||
BattleScriptPushCursor();
|
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)
|
// 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)
|
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
|
gBattleCommunication[MULTISTRING_CHOOSER] = (gBattlerTarget == gActiveBattler); // B_MSG_ATTACKER_STAT_FELL or B_MSG_DEFENDER_STAT_FELL
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5996,10 +5996,10 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case HOLD_EFFECT_EJECT_PACK:
|
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
|
&& !(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;
|
gActiveBattler = gBattleScripting.battler = battlerId;
|
||||||
effect = ITEM_STATS_CHANGE;
|
effect = ITEM_STATS_CHANGE;
|
||||||
if (moveTurn)
|
if (moveTurn)
|
||||||
@ -7468,7 +7468,7 @@ static u16 CalcMoveBasePower(u16 move, u8 battlerAtk, u8 battlerDef)
|
|||||||
basePower *= 2;
|
basePower *= 2;
|
||||||
break;
|
break;
|
||||||
case EFFECT_LASH_OUT:
|
case EFFECT_LASH_OUT:
|
||||||
if (gSpecialStatuses[battlerAtk].statFell == 1)
|
if (gProtectStructs[battlerAtk].statFell)
|
||||||
basePower *= 2;
|
basePower *= 2;
|
||||||
break;
|
break;
|
||||||
case EFFECT_EXPLOSION:
|
case EFFECT_EXPLOSION:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user