From 9bd5601b5c085a70111f0fc4eaf7d98e43adbfa8 Mon Sep 17 00:00:00 2001 From: Pawkkie <61265402+Pawkkie@users.noreply.github.com> Date: Mon, 2 Sep 2024 17:43:41 -0400 Subject: [PATCH] Wonder Guard AI Fix (#5317) * Fix Wonder Guard looping * Review + Sheer Cold --- src/battle_ai_main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/battle_ai_main.c b/src/battle_ai_main.c index 67e9b90a24..869f5dded3 100644 --- a/src/battle_ai_main.c +++ b/src/battle_ai_main.c @@ -889,7 +889,7 @@ static s32 AI_CheckBadMove(u32 battlerAtk, u32 battlerDef, u32 move, s32 score) break; case ABILITY_WONDER_GUARD: if (effectiveness < AI_EFFECTIVENESS_x2) - return 0; + RETURN_SCORE_MINUS(20); break; case ABILITY_JUSTIFIED: if (moveType == TYPE_DARK && !IS_MOVE_STATUS(move)) @@ -1498,7 +1498,7 @@ static s32 AI_CheckBadMove(u32 battlerAtk, u32 battlerDef, u32 move, s32 score) break; case EFFECT_OHKO: if (B_SHEER_COLD_IMMUNITY >= GEN_7 && move == MOVE_SHEER_COLD && IS_BATTLER_OF_TYPE(battlerDef, TYPE_ICE)) - return 0; + RETURN_SCORE_MINUS(20); if (!ShouldTryOHKO(battlerAtk, battlerDef, aiData->abilities[battlerAtk], aiData->abilities[battlerDef], move)) ADJUST_SCORE(-10); else if (GetActiveGimmick(battlerDef) == GIMMICK_DYNAMAX) @@ -2478,7 +2478,7 @@ static s32 AI_CheckBadMove(u32 battlerAtk, u32 battlerDef, u32 move, s32 score) if (IS_TARGETING_PARTNER(battlerAtk, battlerDef)) { if (gStatuses3[battlerDef] & STATUS3_HEAL_BLOCK) - return 0; + return 0; // cannot even select if (AtMaxHp(battlerDef)) ADJUST_SCORE(-10); else if (gBattleMons[battlerDef].hp > gBattleMons[battlerDef].maxHP / 2)