From 303e31ae251b289fc46774314140617228d9e44e Mon Sep 17 00:00:00 2001 From: sbird Date: Wed, 22 Sep 2021 18:05:58 +0200 Subject: [PATCH] [ai] use expected value to simulate EFFECT_PSYWAVE --- src/battle_ai_util.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/battle_ai_util.c b/src/battle_ai_util.c index b68c68e1bf..95d979e943 100644 --- a/src/battle_ai_util.c +++ b/src/battle_ai_util.c @@ -737,6 +737,8 @@ s32 AI_CalcDamage(u16 move, u8 battlerAtk, u8 battlerDef) switch (gBattleMoves[move].effect) { case EFFECT_LEVEL_DAMAGE: + case EFFECT_PSYWAVE: + //psywave's expected damage is equal to the user's level dmg = gBattleMons[battlerAtk].level; break; case EFFECT_DRAGON_RAGE: @@ -745,16 +747,6 @@ s32 AI_CalcDamage(u16 move, u8 battlerAtk, u8 battlerDef) case EFFECT_SONICBOOM: dmg = 20; break; - case EFFECT_PSYWAVE: - { - u32 randDamage; - if (B_PSYWAVE_DMG >= GEN_6) - randDamage = (Random() % 101); - else - randDamage = (Random() % 11) * 10; - dmg = gBattleMons[battlerAtk].level * (randDamage + 50) / 100; - } - break; //case EFFECT_METAL_BURST: //case EFFECT_COUNTER: default: