diff --git a/src/battle_ai_util.c b/src/battle_ai_util.c index 33aeda104..7730604c8 100644 --- a/src/battle_ai_util.c +++ b/src/battle_ai_util.c @@ -822,47 +822,47 @@ s32 AI_CalcDamage(u16 move, u8 battlerAtk, u8 battlerDef, u8 *typeEffectiveness, else dmg = (critDmg + normalDmg * (critChance - 1)) / critChance; - // Handle dynamic move damage - switch (gBattleMoves[move].effect) + if (!gBattleStruct->zmove.active) { - case EFFECT_LEVEL_DAMAGE: - case EFFECT_PSYWAVE: - dmg = gBattleMons[battlerAtk].level * (AI_DATA->abilities[battlerAtk] == ABILITY_PARENTAL_BOND ? 2 : 1); - break; - case EFFECT_DRAGON_RAGE: - dmg = 40 * (AI_DATA->abilities[battlerAtk] == ABILITY_PARENTAL_BOND ? 2 : 1); - break; - case EFFECT_SONICBOOM: - dmg = 20 * (AI_DATA->abilities[battlerAtk] == ABILITY_PARENTAL_BOND ? 2 : 1); - break; - case EFFECT_MULTI_HIT: - dmg *= (AI_DATA->abilities[battlerAtk] == ABILITY_SKILL_LINK ? 5 : 3); - break; - case EFFECT_TRIPLE_KICK: - dmg *= (AI_DATA->abilities[battlerAtk] == ABILITY_SKILL_LINK ? 6 : 5); - break; - case EFFECT_ENDEAVOR: - // If target has less HP than user, Endeavor does no damage - dmg = max(0, gBattleMons[battlerDef].hp - gBattleMons[battlerAtk].hp); - break; - case EFFECT_SUPER_FANG: - dmg = (AI_DATA->abilities[battlerAtk] == ABILITY_PARENTAL_BOND - ? max(2, gBattleMons[battlerDef].hp * 3 / 4) - : max(1, gBattleMons[battlerDef].hp / 2)); - break; - case EFFECT_FINAL_GAMBIT: - dmg = gBattleMons[battlerAtk].hp; - break; + // Handle dynamic move damage + switch (gBattleMoves[move].effect) + { + case EFFECT_LEVEL_DAMAGE: + case EFFECT_PSYWAVE: + dmg = gBattleMons[battlerAtk].level * (AI_DATA->abilities[battlerAtk] == ABILITY_PARENTAL_BOND ? 2 : 1); + break; + case EFFECT_DRAGON_RAGE: + dmg = 40 * (AI_DATA->abilities[battlerAtk] == ABILITY_PARENTAL_BOND ? 2 : 1); + break; + case EFFECT_SONICBOOM: + dmg = 20 * (AI_DATA->abilities[battlerAtk] == ABILITY_PARENTAL_BOND ? 2 : 1); + break; + case EFFECT_MULTI_HIT: + dmg *= (AI_DATA->abilities[battlerAtk] == ABILITY_SKILL_LINK ? 5 : 3); + break; + case EFFECT_ENDEAVOR: + // If target has less HP than user, Endeavor does no damage + dmg = max(0, gBattleMons[battlerDef].hp - gBattleMons[battlerAtk].hp); + break; + case EFFECT_SUPER_FANG: + dmg = (AI_DATA->abilities[battlerAtk] == ABILITY_PARENTAL_BOND + ? max(2, gBattleMons[battlerDef].hp * 3 / 4) + : max(1, gBattleMons[battlerDef].hp / 2)); + break; + case EFFECT_FINAL_GAMBIT: + dmg = gBattleMons[battlerAtk].hp; + break; + } + + // Handle other multi-strike moves + if (gBattleMoves[move].flags & FLAG_TWO_STRIKES) + dmg *= 2; + else if (gBattleMoves[move].flags & FLAG_THREE_STRIKES || (move == MOVE_WATER_SHURIKEN && gBattleMons[battlerAtk].species == SPECIES_GRENINJA_ASH)) + dmg *= 3; + + if (dmg == 0) + dmg = 1; } - - // Handle other multi-strike moves - if (gBattleMoves[move].flags & FLAG_TWO_STRIKES) - dmg *= 2; - else if (gBattleMoves[move].flags & FLAG_THREE_STRIKES || (move == MOVE_WATER_SHURIKEN && gBattleMons[battlerAtk].species == SPECIES_GRENINJA_ASH)) - dmg *= 3; - - if (dmg == 0) - dmg = 1; } else { diff --git a/src/battle_util.c b/src/battle_util.c index e8f4ffdca..93d023363 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -8499,7 +8499,10 @@ static u16 CalcMoveBasePower(u16 move, u8 battlerAtk, u8 battlerDef) basePower = gBattleStruct->presentBasePower; break; case EFFECT_TRIPLE_KICK: - basePower *= (4 - gMultiHitCounter); + if (gMultiHitCounter == 0) // Calc damage with max BP for move consideration + basePower *= 6; + else + basePower *= (4 - gMultiHitCounter); break; case EFFECT_SPIT_UP: basePower = 100 * gDisableStructs[battlerAtk].stockpileCounter;