Fixed part
Damage in combat come in three parts: a fixed part, the modifiers and a random part. The fixed part of damage, called F, comes with different computation formulas.
- For a normal attack, F = 4 * attacker's ATK - 2 * target's DEF.
- For a physical skill, F = skill's power * attacker's ATK - skill's mitigation * target's DEF.
- For a magical skill, F = skill's power * attacker's MATK - skill's mitigation * target's MDEF.
- For a damaging item, F = item's base damage - 2 * target's MDF.
Modifiers
Multiplicative modifiers come in the damage computation. Those modifiers are:
- 0.25 if the target is guarding,
- 3 in case of critical hit,
- 1.5 if the target has an elemental weakness to the attack,
- 0.25 if the target has an elemental resistance to the attack,
- multipliers coming from special effects like Light II hitting a demon.
We call D the product of F by all the applied modifiers.
Random part
Damage have a random part. We will call R this random part. When using a damaging item, R = 0. In all other cases, we make the follow those steps:
- The greatest possible change is V=D/5 rounded down to the nearest integer.
- Let L be the attacker's luck factor.
- The potential bonus is V * min(1, L). The potential bonus is equal to the greatest possible change when the attacker has equal to or greater luck than the defender, and decreases the more the defender's luck exceeds the attacker's.
- The potential penalty is V / max(1, L). The potential penalty is equal to the greatest possible penalty when the attacker has less than or equal luck to the defender and decreases the more the attacker's luck exceeds the defender's.
- The actual bonus is a random integer between 0 and the potential bonus.
- The actual penalty is a random integer between 0 and the potential penalty.
- The actual change (R) is the actual bonus minus the actual penalty.
Final damage
The final damage is equal to max(1, D+R).