Merge pull request #1673 from ghoulslash/gen8_move_effects

Gen8 move effects Fixes
This commit is contained in:
Eduardo Quezada D'Ottone 2021-09-23 18:04:20 -03:00 committed by GitHub
commit 13a464ffa4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 3 deletions

View File

@ -3094,6 +3094,7 @@ void FaintClearSetData(void)
gProtectStructs[gActiveBattler].usedGravityPreventedMove = 0;
gProtectStructs[gActiveBattler].usedThroatChopPreventedMove = 0;
gProtectStructs[gActiveBattler].statRaised = 0;
gProtectStructs[gActiveBattler].statFell = 0;
gDisableStructs[gActiveBattler].isFirstTurn = 2;

View File

@ -5193,6 +5193,7 @@ static void Cmd_moveend(void)
u8 battler = battlers[i];
if (IsBattlerAlive(battler)
&& gProtectStructs[battler].statFell
&& gProtectStructs[battler].disableEjectPack == 0
&& 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
@ -9442,9 +9443,7 @@ static u32 ChangeStatBuffs(s8 statValue, u32 statId, u32 flags, const u8 *BS_ptr
}
else
{
// 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)
gProtectStructs[gActiveBattler].statFell = 1;
gProtectStructs[gActiveBattler].statFell = 1; // Eject pack, lash out
gBattleCommunication[MULTISTRING_CHOOSER] = (gBattlerTarget == gActiveBattler); // B_MSG_ATTACKER_STAT_FELL or B_MSG_DEFENDER_STAT_FELL
}
}

View File

@ -6011,6 +6011,7 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
break;
case HOLD_EFFECT_EJECT_PACK:
if (gProtectStructs[battlerId].statFell
&& gProtectStructs[battlerId].disableEjectPack == 0
&& !(gCurrentMove == MOVE_PARTING_SHOT && CanBattlerSwitch(gBattlerAttacker))) // Does not activate if attacker used Parting Shot and can switch out
{
gProtectStructs[battlerId].statFell = FALSE;