mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-12-26 03:34:15 +01:00
Fixes Triple Kick effect and Z move damage calc (#2983)
This commit is contained in:
commit
2e08277a4e
@ -822,6 +822,8 @@ s32 AI_CalcDamage(u16 move, u8 battlerAtk, u8 battlerDef, u8 *typeEffectiveness,
|
||||
else
|
||||
dmg = (critDmg + normalDmg * (critChance - 1)) / critChance;
|
||||
|
||||
if (!gBattleStruct->zmove.active)
|
||||
{
|
||||
// Handle dynamic move damage
|
||||
switch (gBattleMoves[move].effect)
|
||||
{
|
||||
@ -838,9 +840,6 @@ s32 AI_CalcDamage(u16 move, u8 battlerAtk, u8 battlerDef, u8 *typeEffectiveness,
|
||||
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);
|
||||
@ -864,6 +863,7 @@ s32 AI_CalcDamage(u16 move, u8 battlerAtk, u8 battlerDef, u8 *typeEffectiveness,
|
||||
if (dmg == 0)
|
||||
dmg = 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
effectivenessMultiplier = CalcTypeEffectivenessMultiplier(move, moveType, battlerAtk, battlerDef, FALSE);
|
||||
|
@ -8499,6 +8499,9 @@ static u16 CalcMoveBasePower(u16 move, u8 battlerAtk, u8 battlerDef)
|
||||
basePower = gBattleStruct->presentBasePower;
|
||||
break;
|
||||
case EFFECT_TRIPLE_KICK:
|
||||
if (gMultiHitCounter == 0) // Calc damage with max BP for move consideration
|
||||
basePower *= 6;
|
||||
else
|
||||
basePower *= (4 - gMultiHitCounter);
|
||||
break;
|
||||
case EFFECT_SPIT_UP:
|
||||
|
Loading…
Reference in New Issue
Block a user