From b04d153a24858c25ad6f8d67e6dd163dac984b0e Mon Sep 17 00:00:00 2001 From: WillKolada <57021938+WillKolada@users.noreply.github.com> Date: Tue, 7 May 2024 15:47:20 -0500 Subject: [PATCH] Expanded AI awareness of moves that don't work against Dynamax Pokemon (#4521) * Update IsDamageMoveUsable to check for Steel Roller viability * Condense terrain flag checks and renamed IsDamageMoveUsable IsDamageMoveUsable is now named IsDamageMoveUnusable to more accurately reflect the boolean it returns. * Made the AI aware of when more moves will fail against Dynamax Pokemon Turns out Dynamax Pokemon are immune to quite a few moves. The AI is only aware of one of these at present--the Low Kick/Grass Knot effect, which I learned when the AI tried to Heavy Slam my Dynamaxed Pokemon. These additional cases should prevent the AI from selecting moves that have no effect against Dynamax Pokemon, though it may still select moves whose secondary effect won't work on Dynamaxed Pokemon (such as Fake Out or Circle Throw). * Update battle_ai_util.c Now handles damaging moves that Dynamax Pokemon are immune to --- src/battle_ai_util.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/battle_ai_util.c b/src/battle_ai_util.c index 009cef3bdc..4a83fc6e4e 100644 --- a/src/battle_ai_util.c +++ b/src/battle_ai_util.c @@ -431,6 +431,7 @@ bool32 IsDamageMoveUnusable(u32 move, u32 battlerAtk, u32 battlerDef) return TRUE; break; case EFFECT_LOW_KICK: + case EFFECT_HEAT_CRASH: if (IsDynamaxed(battlerDef)) return TRUE; break;