Damage

Types of Damage
There are four main types of damage, which do not overlap with each other.
 * Direct attacks (DA). This occurs when your units collide directly with the target at low combo.
 * Power flips (PF). This occurs when your units launch off the flippers at high combo (9, 15, and 39 for LV. 1, 2, and 3 power flips).
 * Spell damage (SD). This occurs when your units cast damaging spells.
 * Ability damage (AD). This occurs when your units do damage with their abilities. This source of damage is not yet available in the global server.

Basics
The full reconstructed damage formula is shown below. In this section, rather than analyze it in full, we focus on heuristics and intuitive understanding. Generally speaking, there are six relevant factors: There also exist other more unusual effects described in detail in the following section. Buffs corresponding to the same factor are additive; the different factors are then multiplied together. That these independent factors multiply means that buffs should be spread out over each factor rather than concentrated on one or two factors. For instance, a  ATK buff and a   SD buff would result in a   multiplier to damage, compared to a   ATK buff and a   SD buff yielding only a   multiplier to damage.
 *  Unit 's base attack. Increases with equipped weapon, main's stats, and unison's stats, a quarter of which is added to the main's stats.
 * Unit's attack modifier. The sum of all attack buffs on the unit.
 * Unit's damage type modifier. The sum of all buffs of a certain damage type (DA/PF/SD/AD) on the unit.
 * Target's status effects and unit's status modifiers. The sum of all active non-downed status modifiers (often called *punishers*) on the unit. Status modifiers are active if the target is afflicted with the status.
 * Target's downed status and unit's downed modifiers. The sum of all active downed modifiers on the unit. Further multiplied by . Separate from other status modifiers.
 * Target's elemental resistance and unit's elemental advantage. The sum of all resistance modifiers on the target corresponding to the main character's element. Spell and ability damage deal damage based on their character's element instead.

Formula
The maximum damage that can be dealt is 9,999,999,999. In practice, the maximum attainable damage is around 99,999,999. The full damage formula is given by 1  Unit_Attack * (1 + Attack_%_Modifier) subject to a number of conditional damage multipliers 2 * WeakAndHostile ? 1.5 : NotWeakAndHostile ? 1 : NotWeakAndNotHostile ? 0.5 3 * Total_Resist > 0 ? / (1 + Total_Resist) : * (1 - Total_Resist) 4 * targetHasPinch ? 1.5 * (1 + statModifierPinchSlayer) 5 * targetHasGuard ? 0.2 6 * (1 - totalResistanceToConditionEnemies) 7 * (1 + raceSlayer) 8 * (1 + statModifierAdversity) * attackerFractionHealthLost 9 * createdByDirectAttack ? (1 + statModifierDirectAttackDamage) 10     * (1 + statModifierAdditionalDirectAttackDamage) / statModifierAdditionalDirectAttackTimes 11 * createdByPowerFlipAction ? (1 + statModifierPowerFlipDamage) 12 * createdByPowerFlipAction AND ChargeLevel > 0 ? (1 + statModifierPowerFlipLvDamage * (1 + statModifierPowerFlipLvDamageSlayer)) 13 * createdBySkillAction ? (1 + statModifierSkillDamage) * Skill_Attack_Multiplier 14     * enablesComboBonus ? (1 + CurrentCombo) 15     * enablesCoffinCountBonus ? (1 + TotalCoffinCounts) 16     * enablesBuffCountBonus ? (1 + TotalBuffCount) 17     * enablesRangeBonus ? Distance^2 18 * (1 + random) 19 - elementDamageCut 20 * targetIsInvincible ? 0 which we will go over line by line. The notation  means. Input  is optional. Because the exact damage formula is obfuscated, the above formula has been reconstructed and interpreted, so it should not be treated as paramount. Variables in the code are used when possible, but some are made up. Uncertain segments are marked in red.


 * 1) Base damage.   is the base attack of the attacker.   is the sum of all attack modifiers to the attacker from weapons, abilities, souls, and buffs.
 * 2) Elements.   deals with elemental advantage, and   determines whether the damage is dealt to a player or monster. Monsters with an elemental weakness take   damage from units or attacks of that element. In addition, they only deal   damage to units of that element.
 * 3) Resistance.   is the total elemental resistance the target has against damage of that element, which can be positive or negative. The damage multiplier is defined piecewise for positive and negative values. Example: a   resistance corresponds to a multiplier of , whereas a   resistance corresponds to a multiplier of.
 * 4) Downed.   checks the monster's break/down status, which occurs momentarily after breaking all of a target's weak points, after a skill chain, or once sufficiently many hits are dealt during fever.   is the sum of all break/down damage modifiers to the attacker from weapons, abilities, souls, and buffs.
 * 5) Guarded.   checks the player's guard status. Guarding is active for player targets when moving toward a monster attack at high speed, and gives a constant   damage multiplier.
 * 6) Status effects.   is the sum of all status effect modifiers from weapons, abilities, souls, and buffs to a target subject to those status effects and applies, for example, via Bianca's Abi2 and Cipher's Abi1.
 * 7) Race.   is the sum of all race modifiers from weapons, abilities, souls, and buffs to a target with a given race, and applies, for example, via Vyron's Abi3.
 * 8) Adversity.   is the sum of all adversity modifiers to the attacker from weapons, abilities, souls, and buffs. This multiplier scales linearly with , the fraction of health that the attacker has lost. Not yet applicable to the global server.
 * 9) DA only; DA damage.   is the sum of all direct attack damage modifiers to the attacker from weapons, abilities, souls, and buffs.
 * 10) DA only; multihit.   is the additional damage dealt by multi-hit, and   is the number of multi-hits. Example: Sonia's Abi3 gives her a multi-hit of , so   and  . In other words, Sonia's multi-hit causes her to do two attacks, each at   times their usual strength.
 * 11) PF only; PF damage.   is the sum of all power flip damage modifiers to the attacker from weapons, abilities, souls, and buffs.
 * 12) PF only; PF multipliers.   is a multiplier to power flip damage that depends on the level (1, 2, 3) and type (sword, fist, bow, special, support) of power flip.   is an additional multiplier to the damage for specific power flip levels and applies, for example, via Rolf's Abi3.
 * 13) SD only; skill damage.   is the sum of all spell damage modifiers to the attacker from weapons, abilities, souls, and buffs.   is the multiplier associated with the attacker's skill. If the skill has multiple projectiles, then this is the multiplier associated with each projectile.
 * 14) SD only; combo multiplier. This applies, for example, via Kannon's skill.   is capped at.
 * 15) SD only; coffin multiplier. This applies, for example, via Luna's skill.
 * 16) SD only; buff multiplier. This applies, for example, via Ellya's skill.
 * 17) SD only; distance multiplier. This applies, for example, via Selgir's skill. Note that this multiplier scales quadratically with distance.
 * 18) Random fluctuation.   is uniformly distributed between   and , causing the damage to fluctuate between   and   of its deterministic value.
 * 19) Flat damage reduction.   accounts for flat elemental damage resistance the target has against damage of that element, and applies, for example, via Walter's skill.
 * 20) Invincibility. This accounts for whether the target is currently targetable and applies, for example, during Orochi Adv's body phase.