Fix Intimidate affecting fainted mons

This commit is contained in:
DizzyEggg 2021-12-07 12:19:27 +01:00 committed by GitHub
parent dff72b97dd
commit 0a7dd2edd6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -5525,10 +5525,11 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
case ABILITYEFFECT_INTIMIDATE2:
for (i = 0; i < gBattlersCount; i++)
{
if (GetBattlerAbility(i) == ABILITY_INTIMIDATE && gBattleResources->flags->flags[i] & RESOURCE_FLAG_INTIMIDATED)
if (GetBattlerAbility(i) == ABILITY_INTIMIDATE && gBattleResources->flags->flags[i] & RESOURCE_FLAG_INTIMIDATED
&& (IsBattlerAlive(BATTLE_OPPOSITE(i)) || IsBattlerAlive(BATTLE_PARTNER(BATTLE_OPPOSITE(i))))) // At least one opposing mon has to be alive.
{
gLastUsedAbility = ABILITY_INTIMIDATE;
gBattleResources->flags->flags[i] &= ~(RESOURCE_FLAG_INTIMIDATED);
gLastUsedAbility = ABILITY_INTIMIDATE;
if (caseID == ABILITYEFFECT_INTIMIDATE1)
{
BattleScriptPushCursorAndCallback(BattleScript_IntimidateActivatesEnd3);