How damage works
Every attack in a battle works out its damage the same way: a power, mostly the attacker’s ATK, of which a tenth is dealt, with a small random spread. What changes from one kind of attack to the next is where the power comes from and which modifiers apply. All values are whole numbers, and every division drops the fraction.
- Where
- main.dol, battle_fx_attack_basic, battle_fx_special_attack_weaken, battle_fx_special_attack, battle_fx_counter, battle_fx_damage
- Basic damage
- About a tenth of the attack’s power, give or take 1% of the power
- Power cap
- 12,000 before a critical hit
- Critical hit
- Double power; chance luck x 5 in 1,000
- Guard
- DEF is subtracted, then the damage is halved
The common formula
power = depends on the attack (below), at most 12,000
power = power x 2 on a critical hit
r = a random whole number from -100 to +100
damage = power x r / 10,000 + (power - D) / 10 (at least 0)
D = the target's DEF while it guards, otherwise 0
So damage is a tenth of the power, give or take a hundredth of the power. An attack with 2,000 power does 180 to 220. DEF counts only while the target guards (details).
Each kind of attack
| Power | Critical hit | Guard | Statuses 1-3, “reduced damage” trait | |
|---|---|---|---|---|
| Basic attack | ATK, plus the passive ability’s bonus against the target’s class, plus the values of the equipped permanent cards | Luck, or certain when an equipped card names the target’s class | DEF, then half | Yes |
| Special attack | ATK plus or minus the special’s value | Luck | DEF, then half | Yes |
| Combined attack | ATK plus the special’s value plus the ATK of the one or two linked allies | Luck | DEF, then half | No |
| Damage card | The card’s value, plus the user’s Magic Craft bonus for cards of categories 5-9 | Never | Half, no DEF | No |
| Counter-attack | Half the countering monster’s ATK | Never | No effect | Only the trait |
The damage card and the counter-attack use a shorter formula, with no DEF: damage = power / 10 + power x r / 10,000.
Critical hits
The chance is luck x 10 / 2 in 1,000, so a monster with luck 99 hits critically 495 times in 1,000. A critical basic attack also gives the attacker 2 experience and its side 500 score.
Guarding
Guarding (the R command) costs 1 energy and adds 300 to the side’s score. A guarding monster that is hit by a basic, special or combined attack gets 2 experience, 2 more if the hit did no damage, and its side gets 50 score. The guard ends at the start of the monster’s own next turn, or earlier when a basic attack does it damage; special and combined attacks leave it up.
Statuses that change damage
After the guard, the basic attack and the special attack check the target’s statuses in this order:
- Status 1: the attacker loses 100 ATK (not below 0).
- Status 2: the target strikes back with a counter-attack, before the attack’s own damage is dealt.
- Status 3: the damage is halved.
- The “reduced damage” trait: the damage is cut to 80 percent.
The combined attack and the damage cards check none of these. The counter-attack applies only the trait.
Evidence
Each formula was read from the battle’s decompiled code: the basic attack (battle_fx_attack_basic), the special attack (battle_fx_special_attack_weaken), the combined attack (battle_fx_special_attack), the counter-attack (battle_fx_counter) and the damage card (battle_fx_damage). The random number r is 201 x rand / 65536 - 100, with rand the game’s 16-bit random number.