Skip to content

Commit

Permalink
Various AI fixes (#5474)
Browse files Browse the repository at this point in the history
* fix AI mirror move check viability call

* fix EFFECT_ABSORB missing break in AI_CalcMoveEffectScore

---------

Co-authored-by: ghoulslash <[email protected]>
  • Loading branch information
ghoulslash and ghoulslash authored Oct 6, 2024
1 parent 6f59d26 commit 06fefe3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/battle_ai_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -3302,6 +3302,7 @@ static u32 AI_CalcMoveEffectScore(u32 battlerAtk, u32 battlerDef, u32 move)
case EFFECT_ABSORB:
if (aiData->holdEffects[battlerAtk] == HOLD_EFFECT_BIG_ROOT && effectiveness >= AI_EFFECTIVENESS_x1)
ADJUST_SCORE(DECENT_EFFECT);
break;
case EFFECT_EXPLOSION:
case EFFECT_MEMENTO:
if (AI_THINKING_STRUCT->aiFlags[battlerAtk] & AI_FLAG_WILL_SUICIDE && gBattleMons[battlerDef].statStages[STAT_EVASION] < 7)
Expand All @@ -3316,7 +3317,7 @@ static u32 AI_CalcMoveEffectScore(u32 battlerAtk, u32 battlerDef, u32 move)
break;
case EFFECT_MIRROR_MOVE:
if (predictedMove != MOVE_NONE)
return AI_CheckViability(battlerAtk, battlerDef, gLastMoves[battlerDef], score);
return AI_CheckViability(battlerAtk, battlerDef, predictedMove, score);
break;
case EFFECT_ATTACK_UP:
case EFFECT_ATTACK_UP_USER_ALLY:
Expand Down

0 comments on commit 06fefe3

Please sign in to comment.