Skip to content

Commit

Permalink
Add Memento to Risky AI flag (#5032)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pawkkie authored Jul 25, 2024
1 parent 3f4b4ad commit 062856c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/battle_ai_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -4911,6 +4911,8 @@ static s32 AI_SetupFirstTurn(u32 battlerAtk, u32 battlerDef, u32 move, s32 score
static s32 AI_Risky(u32 battlerAtk, u32 battlerDef, u32 move, s32 score)
{
u8 i;
struct AiLogicData *aiData = AI_DATA;

if (IS_TARGETING_PARTNER(battlerAtk, battlerDef))
return score;

Expand All @@ -4933,12 +4935,16 @@ static s32 AI_Risky(u32 battlerAtk, u32 battlerDef, u32 move, s32 score)
break;

// +2 Score
case EFFECT_MEMENTO:
if (aiData->hpPercents[battlerAtk] < 50 && AI_RandLessThan(128))
ADJUST_SCORE(AVERAGE_RISKY_EFFECT);
break;
case EFFECT_REVENGE:
if (gSpeciesInfo[gBattleMons[battlerDef].species].baseSpeed >= gSpeciesInfo[gBattleMons[battlerAtk].species].baseSpeed + 10)
ADJUST_SCORE(AVERAGE_RISKY_EFFECT);
break;
case EFFECT_BELLY_DRUM:
if (gBattleMons[battlerAtk].hp >= gBattleMons[battlerAtk].maxHP * 90 / 100)
if (aiData->hpPercents[battlerAtk] >= 90)
ADJUST_SCORE(AVERAGE_RISKY_EFFECT);
break;
case EFFECT_MAX_HP_50_RECOIL:
Expand Down

0 comments on commit 062856c

Please sign in to comment.