mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-12-26 19:54:21 +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
|
else
|
||||||
dmg = (critDmg + normalDmg * (critChance - 1)) / critChance;
|
dmg = (critDmg + normalDmg * (critChance - 1)) / critChance;
|
||||||
|
|
||||||
|
if (!gBattleStruct->zmove.active)
|
||||||
|
{
|
||||||
// Handle dynamic move damage
|
// Handle dynamic move damage
|
||||||
switch (gBattleMoves[move].effect)
|
switch (gBattleMoves[move].effect)
|
||||||
{
|
{
|
||||||
@ -838,9 +840,6 @@ s32 AI_CalcDamage(u16 move, u8 battlerAtk, u8 battlerDef, u8 *typeEffectiveness,
|
|||||||
case EFFECT_MULTI_HIT:
|
case EFFECT_MULTI_HIT:
|
||||||
dmg *= (AI_DATA->abilities[battlerAtk] == ABILITY_SKILL_LINK ? 5 : 3);
|
dmg *= (AI_DATA->abilities[battlerAtk] == ABILITY_SKILL_LINK ? 5 : 3);
|
||||||
break;
|
break;
|
||||||
case EFFECT_TRIPLE_KICK:
|
|
||||||
dmg *= (AI_DATA->abilities[battlerAtk] == ABILITY_SKILL_LINK ? 6 : 5);
|
|
||||||
break;
|
|
||||||
case EFFECT_ENDEAVOR:
|
case EFFECT_ENDEAVOR:
|
||||||
// If target has less HP than user, Endeavor does no damage
|
// If target has less HP than user, Endeavor does no damage
|
||||||
dmg = max(0, gBattleMons[battlerDef].hp - gBattleMons[battlerAtk].hp);
|
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)
|
if (dmg == 0)
|
||||||
dmg = 1;
|
dmg = 1;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
effectivenessMultiplier = CalcTypeEffectivenessMultiplier(move, moveType, battlerAtk, battlerDef, FALSE);
|
effectivenessMultiplier = CalcTypeEffectivenessMultiplier(move, moveType, battlerAtk, battlerDef, FALSE);
|
||||||
|
@ -8499,6 +8499,9 @@ static u16 CalcMoveBasePower(u16 move, u8 battlerAtk, u8 battlerDef)
|
|||||||
basePower = gBattleStruct->presentBasePower;
|
basePower = gBattleStruct->presentBasePower;
|
||||||
break;
|
break;
|
||||||
case EFFECT_TRIPLE_KICK:
|
case EFFECT_TRIPLE_KICK:
|
||||||
|
if (gMultiHitCounter == 0) // Calc damage with max BP for move consideration
|
||||||
|
basePower *= 6;
|
||||||
|
else
|
||||||
basePower *= (4 - gMultiHitCounter);
|
basePower *= (4 - gMultiHitCounter);
|
||||||
break;
|
break;
|
||||||
case EFFECT_SPIT_UP:
|
case EFFECT_SPIT_UP:
|
||||||
|
Loading…
Reference in New Issue
Block a user