Skip to content

Commit

Permalink
Expanded AI awareness of moves that don't work against Dynamax Pokemon (
Browse files Browse the repository at this point in the history
rh-hideout#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
  • Loading branch information
WillKolada authored May 7, 2024
1 parent 82b626a commit b04d153
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/battle_ai_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit b04d153

Please sign in to comment.