From 1565171235f74a9335b42b14a0008d2765367771 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Tue, 5 Mar 2024 14:08:02 -0300 Subject: [PATCH] Fixed considering Mold Breaker but not Turboblaze/Teravolt for flinch-related decisions (#4244) --- src/battle_ai_util.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/battle_ai_util.c b/src/battle_ai_util.c index e89380aad822..ea54dcce3d24 100644 --- a/src/battle_ai_util.c +++ b/src/battle_ai_util.c @@ -2918,7 +2918,7 @@ bool32 AI_CanBeInfatuated(u32 battlerAtk, u32 battlerDef, u32 defAbility) u32 ShouldTryToFlinch(u32 battlerAtk, u32 battlerDef, u32 atkAbility, u32 defAbility, u32 move) { - if (((AI_DATA->abilities[battlerAtk] != ABILITY_MOLD_BREAKER && (defAbility == ABILITY_SHIELD_DUST || defAbility == ABILITY_INNER_FOCUS)) + if (((!IsMoldBreakerTypeAbility(AI_DATA->abilities[battlerAtk]) && (defAbility == ABILITY_SHIELD_DUST || defAbility == ABILITY_INNER_FOCUS)) || AI_DATA->holdEffects[battlerDef] == HOLD_EFFECT_COVERT_CLOAK || DoesSubstituteBlockMove(battlerAtk, battlerDef, move) || AI_WhoStrikesFirst(battlerAtk, battlerDef, move) == AI_IS_SLOWER)) // Opponent goes first @@ -2958,7 +2958,7 @@ bool32 ShouldFakeOut(u32 battlerAtk, u32 battlerDef, u32 move) || AI_DATA->holdEffects[battlerAtk] == HOLD_EFFECT_CHOICE_BAND || AI_DATA->holdEffects[battlerDef] == HOLD_EFFECT_COVERT_CLOAK || DoesSubstituteBlockMove(battlerAtk, battlerDef, move) - || (AI_DATA->abilities[battlerAtk] != ABILITY_MOLD_BREAKER + || (!IsMoldBreakerTypeAbility(AI_DATA->abilities[battlerAtk]) && (AI_DATA->abilities[battlerDef] == ABILITY_SHIELD_DUST || AI_DATA->abilities[battlerDef] == ABILITY_INNER_FOCUS))) return FALSE;