AI_CalcDamage returns 0 for status moves
This commit is contained in:
parent
57e110aa6a
commit
3f739a8f3b
1 changed files with 55 additions and 45 deletions
|
@ -736,11 +736,13 @@ s32 AI_CalcDamage(u16 move, u8 battlerAtk, u8 battlerDef, u8 *typeEffectiveness)
|
|||
SetTypeBeforeUsingMove(move, battlerAtk);
|
||||
GET_MOVE_TYPE(move, moveType);
|
||||
|
||||
if (gBattleMoves[move].power)
|
||||
{
|
||||
critChance = GetInverseCritChance(battlerAtk, battlerDef, move);
|
||||
normalDmg = CalculateMoveDamageAndEffectiveness(move, battlerAtk, battlerDef, moveType, &effectivenessMultiplier);
|
||||
critDmg = CalculateMoveDamage(move, battlerAtk, battlerDef, moveType, 0, TRUE, FALSE, FALSE);
|
||||
|
||||
if(critChance == -1)
|
||||
if (critChance == -1)
|
||||
dmg = normalDmg;
|
||||
else
|
||||
dmg = (critDmg + normalDmg * (critChance - 1)) / critChance;
|
||||
|
@ -784,6 +786,14 @@ s32 AI_CalcDamage(u16 move, u8 battlerAtk, u8 battlerDef, u8 *typeEffectiveness)
|
|||
else if (move == MOVE_SURGING_STRIKES || (move == MOVE_WATER_SHURIKEN && gBattleMons[battlerAtk].species == SPECIES_GRENINJA_ASH))
|
||||
dmg *= 3;
|
||||
|
||||
if (dmg == 0)
|
||||
dmg = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
dmg = 0;
|
||||
}
|
||||
|
||||
RestoreBattlerData(battlerAtk);
|
||||
RestoreBattlerData(battlerDef);
|
||||
|
||||
|
|
Loading…
Reference in a new issue