From 7d499548e8451b05a4aa2c62e1b44e8a653e0586 Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Sat, 15 Apr 2023 10:48:46 -0300 Subject: [PATCH] Updates -Added EFFECT_JUNGLE_HEALING to IsHealingMoveEffect -Modified the code for EFFECT_TAKE_HEART inside AI_CheckViability and AI_CheckBadMove --- src/battle_ai_main.c | 7 +++++-- src/battle_ai_util.c | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/battle_ai_main.c b/src/battle_ai_main.c index a17f621b00..c52f9bc032 100644 --- a/src/battle_ai_main.c +++ b/src/battle_ai_main.c @@ -2612,7 +2612,10 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) score -= 10; break;*/ case EFFECT_TAKE_HEART: - if (!AnyPartyMemberStatused(battlerAtk, FALSE) || PartnerHasSameMoveEffectWithoutTarget(BATTLE_PARTNER(battlerAtk), move, AI_DATA->partnerMove)) + if ((!(gBattleMons[battlerAtk].status1 & STATUS1_ANY) + || PartnerHasSameMoveEffectWithoutTarget(BATTLE_PARTNER(battlerAtk), move, AI_DATA->partnerMove)) + && !BattlerStatCanRise(battlerAtk, AI_DATA->abilities[battlerAtk], STAT_SPATK) + && !BattlerStatCanRise(battlerAtk, AI_DATA->abilities[battlerAtk], STAT_SPDEF)) score -= 10; break; case EFFECT_PLACEHOLDER: @@ -3731,7 +3734,6 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) break; case EFFECT_WISH: case EFFECT_HEAL_BELL: - case EFFECT_TAKE_HEART: if (ShouldUseWishAromatherapy(battlerAtk, battlerDef, move)) score += 3; break; @@ -4368,6 +4370,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) score++; break; case EFFECT_REFRESH: + case EFFECT_TAKE_HEART: if (gBattleMons[battlerAtk].status1 & STATUS1_ANY) score += 2; break; diff --git a/src/battle_ai_util.c b/src/battle_ai_util.c index a9e3ed3e0b..4c4f132beb 100644 --- a/src/battle_ai_util.c +++ b/src/battle_ai_util.c @@ -2021,6 +2021,7 @@ bool32 IsHealingMoveEffect(u16 effect) case EFFECT_HEALING_WISH: case EFFECT_HEAL_PULSE: case EFFECT_REST: + case EFFECT_JUNGLE_HEALING: return TRUE; default: return FALSE;