From 062856cc6c0a9c951a13cbd8493c427975a309e7 Mon Sep 17 00:00:00 2001 From: Pawkkie <61265402+Pawkkie@users.noreply.github.com> Date: Thu, 25 Jul 2024 07:57:42 -0400 Subject: [PATCH] Add Memento to Risky AI flag (#5032) --- src/battle_ai_main.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/battle_ai_main.c b/src/battle_ai_main.c index b80a7e6c84..8267722e6c 100644 --- a/src/battle_ai_main.c +++ b/src/battle_ai_main.c @@ -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; @@ -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: