Damage (Long War)

From UFOpaedia
Revision as of 12:05, 23 October 2014 by Phwop (talk | contribs)
Jump to navigation Jump to search

Damage Calculation

Long War Chief Programmer Amineri has provided this general description of the damage calculations used in Long War (as of 3.0b14b):

In almost all cases, all damage reduction / maluses / bonuses are done additively, so they don't interact with each other.

In most cases this is handled by making various bonuses based on the "core" weapon damage -- the value defined in the DGC.ini. For example, HEAT adds +75% of this core weapon damage, so is not increased by stacking with Shredder, nor increased by perks such as Mayhem or Ranger. Conversely, the HEAT bonus is not decreased by DR or perks such as Flush that decrease damage.

The two major exceptions to this are Shredding and Critical Damage.

Shredding adds +40% bonus damage AFTER everything (except HEAT) is applied. This means that effects that increase damage stack with shredder, but that effects that decrease damage (e.g. Flush, DR) decrease shredding bonus.

Similarly critical damage is roughly +50% bonus damage (although it's computed differently).

In general, the following happens:

  1. Base damage is computed additively, including most perks. (Flush and Disabling Shot penalties are applied here but not HEAT, Shredding, or Damage Reduction)
  2. Base damage is randomized, and critical damage is computed (+50%).
  3. Any Damage Reduction is applied. (Which depends on target perks/items, not attacker's.)
  4. Shredding bonus is applied.
  5. HEAT bonus is applied, based on base weapon damage (75%), and thus is not affected by Shredding or Damage Reduction.

Shredding and HEAT are applied later because they depend on properties of the target, and apply to AoE-type attacks which can affect multiple targets (just in case you're wondering why they are applied near the end).

Damage Reduction

Long War adds a new mechanic called Damage Reduction. When a unit takes damage, it is reduced by the damage reduction value. It can be seen in game as a blue shield indication next to the normal red damage indication.

Damage reduction is gained in various ways:

  • Low cover gives 0.66 damage reduction.
  • High cover gives 1.0 damage reduction.
  • Several perks grant damage reduction.
  • Mechanized units commonly have built in damage reduction of varying amounts.

Hunker Down doubles the damage reduction effect of cover, as well as the normal effect of doubling the defense it gives.

If the damage reduction a unit has is not a whole number, the damage is reduced by one of the two nearest whole numbers, with probability based on the fraction. For example, a unit with 1.66 damage reduction has a 66% chance of the damage being reduced by 2 and a 34% chance of the damage being reduced by 1.

Damage reduction can have several interesting effects on game play. One is that a shot against a unit may do 0 damage if the damage inflicted is reduced to 0, which can be a nasty surprise if trying to finish off a 1 HP enemy with a pistol. Once you come up against more advanced units, particularly mechanized ones, you may find yourself completely unable to damage them with lighter weapons such as carbines.

In Detail

The steps in AbsorbDamage are:

  1. Unit with ShieldHP>0 (i.e. Mechtoids) has damage reduced by 50%
  2. Unit with ShockAbsorbantArmor perk has damage reduced by 33% if damage-dealing unit is within 4 tiles distance
  3. Unit with AbsorptionFields perk reduced damage based on formula fReturnDamage = fReturnDamage * (0.6 + 0.4 * Min(1, 2/fReturnDamage))
  4. Unit with general damage reduction stat set in DGC.ini BalanceMods has damage reduced by that amount
  5. Unit with IronSkin perk has damage reduced by 1.0
  6. Unit with HardTarget perk has damage reduced by 1.0
  7. Unit with DamageControl perk active has damage reduced by 1.5
  8. Unit with CombatStims active has damage reduced by 40%
  9. Units wearing Chyrssalid plating (or Chryssalids) get Melee/KSM damage reduced by 40%
  10. SHIVs get damage reduced based on type -- basic: 1.5, alloy, 2.5, Hover, 2.0
  11. MECs get damage reduced by 1.0
  12. If unit is poisoned, then 50% of reduced damage is restored
  13. Cover DR is applied:
    1. Only applies if unit is not flanked by attacker, unless weapon is a Needle Grenade
    2. Low Cover damage reduced by 0.667, OR Full Cover damage reduced by 1.0
    3. If Hunkered Down, then if in Low Cover damage reduced by -0.667 OR Full Cover damage reduced by 1.0
    4. If unit has WillToSurvive perk, damage reduced by 1.5
    5. If Unit has FortioresUna perk, damage reduced by 0.5
    6. If attacking unit has Combined Arms perk, damage increased by 1.0 -- this cannot do more than negate damage reduction from cover
  14. If attacking unit has armor-piercing ammo, damage increased by 1.0 -- this cannot do more than negate damage reduction from all sources above
  15. Any fractional damage is randomized using if(FRand() < (fReturnDamage - float(FFloor(fReturnDamage)))