Damage

Damage figures

When damage is calculated, we have an Effect (EffectDamage), an Attacker (unit), and a Target (unit).

Following are the sources that contribute to damage calculation:

Data Source Data Field Explanation

Effect

Amount

Effect

Random

Effect

Kind

Effect

Armor Reduction

Amount of damage that 1 point of armor removes from the effect. (Default: 1) → A value higher than 1 makes an effect that is worse against armor. This is applied to every vital (whose armor is > 0).

Effect

Shield Bonus

Amount of damage added or subtracted when damaging shields.

Effect

Attribute Bonus

Damage modifiers when attacking a unit that has this attribute flag(s).

Effect

Attribute Factor

Percent damage modifiers when attacking a unit that has this attribute flag(s).

Attacker

Damage Multiplier

for Effect: Kind

Attacker

Damage Bonus

for Effect: Kind

Target

Energy Damage Ratio

If greater than zero, damage will be applied to energy before life. This many points of damage will be absorbed for each point of energy lost. (Default: 0)

Target

Shield Damage Ratio

If greater than zero, damage will be applied to shield before life. This many points of damage will be absorbed for each point of shield lost.") (Default: 1)

(TODO: The vital Leeched from damage dealt is calculated after everything else and could even be calculated after damage was applied).

Damage calculation

  • check if target is invulnerable ⇒ if yes exit

calculate the damage for the attacker:

  • Effect: Amount plus Effect: Random

  • apply Attacker: DamageMultiplier (of effect kind)

  • apply Effect: Attribute Factor

  • add Attacker: DamageBonus (of effect kind).

  • add Effect: Attribute Bonus

apply the damage that the target receives:

  • Apply damage to shield, respecting:

    • Target:Shield Damage Ratio

    • Target:Armor:Shield

    • Effect: Armor Reduction

  • apply damage to energy, respecting:

    • Target:Energy Damage Ratio

    • Target:Armor:Energy

    • Effect: Armor Reduction

  • apply damage to life, respecting

    • damage ratio is always 1 here

    • Target:Armor:Life

    • Effect: Armor Reduction