From 6f922df7ef7d6d3db502b6fef24c0a2ce0cfc214 Mon Sep 17 00:00:00 2001 From: Pawkkie <61265402+Pawkkie@users.noreply.github.com> Date: Tue, 10 Sep 2024 06:58:30 -0400 Subject: [PATCH] Frostbite score fixes (#5362) --- src/battle_ai_util.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/battle_ai_util.c b/src/battle_ai_util.c index 82425a3082..b2e18db740 100644 --- a/src/battle_ai_util.c +++ b/src/battle_ai_util.c @@ -3828,11 +3828,14 @@ void IncreaseFrostbiteScore(u32 battlerAtk, u32 battlerDef, u32 move, s32 *score if (AI_CanGiveFrostbite(battlerAtk, battlerDef, AI_DATA->abilities[battlerDef], BATTLE_PARTNER(battlerAtk), move, AI_DATA->partnerMove)) { - ADJUST_SCORE_PTR(WEAK_EFFECT); // frostbite is good - if (HasMoveWithCategory(battlerDef, DAMAGE_CATEGORY_SPECIAL)) + if (HasMoveWithCategory(battlerDef, DAMAGE_CATEGORY_SPECIAL) + || (!(AI_THINKING_STRUCT->aiFlags[battlerAtk] & AI_FLAG_OMNISCIENT) // Not Omniscient but expects special attacker + && gSpeciesInfo[gBattleMons[battlerDef].species].baseSpAttack >= gSpeciesInfo[gBattleMons[battlerDef].species].baseAttack + 10)) { - if (CanTargetFaintAi(battlerDef, battlerAtk)) - ADJUST_SCORE_PTR(DECENT_EFFECT); // frostbiting the target to stay alive is cool + if (gMovesInfo[GetBestDmgMoveFromBattler(battlerDef, battlerAtk)].category == DAMAGE_CATEGORY_SPECIAL) + ADJUST_SCORE_PTR(DECENT_EFFECT); + else + ADJUST_SCORE_PTR(WEAK_EFFECT); } if (HasMoveEffectANDArg(battlerAtk, EFFECT_DOUBLE_POWER_ON_ARG_STATUS, STATUS1_FROSTBITE)