# Damage calculation This article is under construction.Please help review and edit this page.

Reason: "Use official terminology from What's In Store for the 2.10.0 Update (Notification)"

## Notation

The $⌊⌋$ and $⌈⌉$ notation is used to mean the Floor and ceiling functions in these formulae. For example, $⌊2.4⌋ = 2$ and $⌈2.4⌉ = 3$.

The $\operatorname{trunc}()$ notation is used to mean truncation in these formulae. This means that $\operatorname{trunc}(-1.6) = -1$, it is effectively dropping all numbers after the decimal point. To make the formulae more readable, this notation will only be used when floor is not sufficient to provide a visual shorthand for truncation.

The positive part of Positive and negative parts notation $x^+$ is used to set a number to 0 if it is negative.

Damage is calculated in these steps:

1. Base Damage
3. Final Damage

## Base Damage calculation

### Simple hit

The damage calculation for a simple hit is: $(Atk − Mit)^+$
Variable Description
Atk The Attack stat of the attacking unit.
Mit The Mitigation stat of the defending unit.

Physical attacks are mitigated by Def, while magical attacks are mitigated by Res. $x^+$ Positive part. In short, this is used in damage calculation formulas to say "if the number is negative, set it to 0, otherwise, keep it".
Note: Damage is never negative.
Example
Example: A sword unit with an Atk of 15 attacks another red unit with a Def of 11. $Atk = 15$ $Mit = 11$ $Atk − Mit = 15 − 11$ $Atk − Mit = 4$ $(Atk + trunc(Atk × (Adv × (Aff + 20)/20)) − Mit)^+$

Variable / Notation Description
Aff Affinity from sources such as Triangle Adept and Ruby Sword and Trilemma+'s Triangle Adept status effect. The default is 0, and only the highest value applies. Example values include 0, 15 (such as from Triangle Adept 2), 20 (such as from Ruby Sword+), etc.

Note: Cancel Affinity 3 reverses the affinity provided by skills or status effects. In the situations where affinity is reversed, make Aff negative.

Example
Example: A red sword unit with Atk 15 attacks a blue unit with Def 11. The red unit has a disadvantage, so Adv is negative. $(Atk + trunc(Atk × (Adv × (Aff + 20)/20)) − Mit)^+$ $(15 + ⌊15 × −0.2⌋ − 11$ $(15 - 3 - 11)^+$ $1$

Important is that although weapon-triangle advantage is "Atk+20%" and Triangle Adept 3 will "boost Atk by 20%", these modifiers all affect the same component and do not act independently, thus, $Atk + \operatorname{trunc}(Atk \times 0.2) + \operatorname{trunc}(Atk \times 0.2)$ is incorrect while $Atk + \operatorname{trunc}(Atk \times 0.4)$ is correct.

To illustrate this point, take the example of a red unit with 54 Atk attacking a green unit with a Mitigation of 34.

Example

Damage: $\mathit{Atk} + \operatorname{trunc}(\mathit{Atk} \times 0.2) + \operatorname{trunc}(\mathit{Atk} \times 0.2) - \mathit{Mit} \neq \mathit{Atk} + \operatorname{trunc}(\mathit{Atk} \times (0.2 + 0.2)) - \mathit{Mit}$ $54 + \operatorname{trunc}(54 \times 0.2) + \operatorname{trunc}(54 \times 0.2) - 34 \neq 54 + \operatorname{trunc}(54 \times 0.4) - 34$ $40 \neq 41$
The correct formula is the one on the right.

Note: Affinity does not stack. Triangle Adept does not stack with the gemstone weapons. Only the highest value is applied.

### Effectiveness

The formula including the weapon-triangle and factoring effective damage in is $(\lfloor \mathit{Atk} \times \mathit{Eff}\rfloor + \operatorname{trunc}(\lfloor \mathit{Atk} \times \mathit{Eff}\rfloor \times (\mathit{Adv} \times \frac{\mathit{Aff} + 20}{20})) - \mathit{Mit})^+$
Variable Description
Eff The effectiveness multiplier a unit receives when using a

weapon effective against an enemy. Either 1 for normal attacks or 1.5 for effective attacks.

Note that effectiveness is first instead of weapon-triangle advantage. To illustrate this, take a look at the following example.

Example
In this example, attacks Lance Flier and deals 57 damage. Environment: The correct formula is displayed on the left while the incorrect one is on the right. $\lfloor \mathit{Atk} \times \mathit{Eff}\rfloor + \operatorname{trunc}(\lfloor \mathit{Atk} \times \mathit{Eff}\rfloor \times (\mathit{Adv} \times \frac{\mathit{Aff} + 20}{20})) - \mathit{Mit} \neq \big\lfloor(\mathit{Atk} + \lfloor \mathit{Atk} \times (\mathit{Adv} \times \frac{\mathit{Aff} + 20}{20})\rfloor) \times \mathit{Eff}\big\rfloor - \mathit{Mit}$ $\lfloor 44 \times 1.5\rfloor + \lfloor \lfloor 44 \times 1.5\rfloor \times 0.2\rfloor - 22 \neq \big\lfloor(44 + \lfloor 44 \times 0.2\rfloor) \times 1.5\big\rfloor - 22$ $57 \neq 56$

Note that the formula cannot be simplified to $\lfloor \mathit{Atk} \times \mathit{Eff}\rfloor + \lfloor \mathit{Atk} \times \mathit{Eff} \times (\mathit{Adv} \times \frac{\mathit{Aff} + 20}{20})\rfloor - \mathit{Mit}$. This can be proven with the next example:

Example
In this example, attacks Green Manakete and deals 88 damage. Environment: The correct formula is displayed on the left while the incorrect one is on the right. $\lfloor \mathit{Atk} \times \mathit{Eff}\rfloor + \operatorname{trunc}(\lfloor \mathit{Atk} \times \mathit{Eff}\rfloor \times (\mathit{Adv} \times \frac{\mathit{Aff} + 20}{20})) - \mathit{Mit} \neq \lfloor \mathit{Atk} \times \mathit{Eff}\rfloor + \lfloor \mathit{Atk} \times \mathit{Eff} \times (\mathit{Adv} \times \frac{\mathit{Aff} + 20}{20})\rfloor - \mathit{Mit}$ $\lfloor 49 \times 1.5\rfloor + \lfloor \lfloor 49 \times 1.5\rfloor \times 0.3\rfloor - 6 \neq \lfloor 49 \times 1.5\rfloor + \lfloor 49 \times 1.5 \times 0.3\rfloor - 6$ $88 \neq 89$

### Boosted Damage

Some Specials can also add boosted damage. When a Special is capable of doing so, its description will say that it boosts damage. This boosted damage is also referred to as "special damage bonus" (奥義ダメージ). The formula looks like this: $(\lfloor \mathit{Atk} \times \mathit{Eff}\rfloor + \operatorname{trunc}(\lfloor \mathit{Atk} \times \mathit{Eff}\rfloor \times (\mathit{Adv} \times \frac{\mathit{Aff} + 20}{20})) + BoostedDamage - \mathit{Mit})^+$

Currently only Specials use boosted damage in the game. Other extra damage skills use dealt damage instead, described later. Note that BoostedDamage is added within the first set of parentheses that have positive part applied to them. This means, unlike the calculations that come afterwards, boosted damage from specials will need to "make up" negative damage.

Variable Description
BoostedDamage The damage added as a result of the Special.

#### Calculating Boosted Damage

This section describes how to calculate the boosted damage for various Specials. Some specials, like Blue Flame, tell the amount directly in the skill description.

##### Stat-based Specials $BoostedDamage = \lfloor \mathit{Stat} \times 0.5\rfloor$

##### Luna $BoostedDamage = \lfloor \mathit{Mit} \times 0.5\rfloor$

The formula above applies for similar skills such as Moonbow or Aether, simply replace 0.5 with the appropriate value.

Note that despite Luna stating that it treats foe’s Def/Res "as if reduced by 50% during combat", it does not actually do this, because the activation of Luna also does not change whether or not the condition "If foe's Def ≥ foe's Res+5" for Shining Bow+ or Light Brand is true or not. In addition, the activation of Luna on a foe does not change the amount added to damage dealt for Lunar Brace.[citation needed]

It is currently mathematically accurate to say adding 50% of foe's Def/Res to damage is identical to reducing foe's Def/Res by 50%, but only for the purpose of Base Damage calculation:

1. $\mathit{Atk} + \mathit{BoostedDamage} - \mathit{Mit} = \mathit{Atk} - (\mathit{Mit} - \lfloor \mathit{Mit} \times 0.5\rfloor)$
2. $\mathit{Atk} + \lfloor \mathit{Mit} \times 0.5\rfloor - \mathit{Mit} = \mathit{Atk} - (\mathit{Mit} - \lfloor \mathit{Mit} \times 0.5\rfloor)$
3. $\mathit{Atk} + \lfloor \mathit{Mit} \times 0.5\rfloor - \mathit{Mit} = \mathit{Atk} - \mathit{Mit} + \lfloor \mathit{Mit} \times 0.5\rfloor$
4. $\mathit{Atk} + \lfloor \mathit{Mit} \times 0.5\rfloor - \mathit{Mit} = \mathit{Atk} + \lfloor \mathit{Mit} \times 0.5\rfloor - \mathit{Mit}$
Variable Description
Mit Use the Def or Res stat, depending on the situation.
Example
In this example, attacks while triggering Luna, and this results in 42 damage. Environment:
1. $\mathit{BoostedDamage} = \lfloor \mathit{Mit} \times 0.5\rfloor$
2. $\mathit{BoostedDamage} = \lfloor 37 \times 0.5\rfloor$
3. $\mathit{BoostedDamage} = 18$
4. $\mathit{Base Damage} = (\lfloor \mathit{Atk} \times \mathit{Eff}\rfloor + \operatorname{trunc}(\lfloor \mathit{Atk} \times \mathit{Eff}\rfloor \times (\mathit{Adv} \times \frac{\mathit{Aff} + 20}{20})) + BoostedDamage - \mathit{Mit})^+$
5. $\mathit{Base Damage} = (51 + \lfloor 51 \times 0.2\rfloor + 18 - 37)^+$
6. $42$
##### Astra

Astra does not use boosted damage.