How much damage an attack will do to a unit?

From StarCraft AI, the resource for custom StarCraft Brood War AIs
Jump to: navigation, search
Original article at Staredit Network Wiki

To determine how much damage an attack will do to a unit, follow these steps.

  1. If the unit has shield HP, subtract shield armor upgrades from the damage.
  2. Apply the damage to the shield HP.
  3. If any damage remains, subtract the unit's armor from the damage.
  4. If the damage is Explosive or Concussive type, modify it based on the unit's size.
  5. Explosive damage deals 100% to large units, 75% to medium units, and 50% to small units.
  6. Concussive damage deals 25% to large units, 50% to medium units, and 100% to small units.
  7. Apply the remaining damage to the HP. If the remaining damage is one-half or less, it will do a half-point of damage.
Example 1

Siege Tank (70 damage, explosive) attacks a Zealot (60 shields, 100 hit points, 1 armor)

  1. 70 damage is reduced by 0. (No shield armor upgrades)
  2. 60 shield points are removed from the zealot. 10 damage remains.
  3. 10 damage is reduced by 1. (Zealot base armor)
  4. The damage is Explosive type and the Zealot is small. 9 damage becomes 4.5 damage.
  5. 100 HP reduced to 96.5.
Example 2

Hydralisk (10 damage, explosive) attacks a Matriarch (300 hit points, 3 armor, medium size)

  1. 10 damage is reduced by 0. (No shield armor upgrades)
  2. 0 shield points are removed from the Matriarch. 10 damage remains.
  3. 10 damage is reduced by 3. (Matriarch base armor)
  4. The damage is Explosive type and the Matriarch is medium (75% damage). 7 damage becomes 5.25 damage.
  5. 300 HP reduced to 294.75.
Example 3

Ghost (10 damage, concussive) attacks a Siege Tank (150 hit points, 1 armor, large size)

  1. 10 damage is reduced by 0. (No shield armor upgrades)
  2. 0 shield points are removed from the Siege Tank. 10 damage remains.
  3. 10 damage is reduced by 1. (Siege Tank base armor)
  4. The damage is Concussive type and the Siege Tank is large (25% damage). 9 damage becomes 2.25 damage.
  5. 150 HP reduced to 147.75.
Spell Damage

All spells except for Yamato Cannon and Nuke ignore unit armor. Yamato Cannon does 260 explosive damage to a single target. Plague also ignores Protoss shields and does damage directly to the unit or buildings HP. See the 3 spell pages for full details, including damage and duration, for all spells and abilities.