Damage

From Heroes 3 wiki
Jump to navigation Jump to search

Damage is a general term for the amount of health loss a creature or a spell can cause to a single creature or to a creatures stack. If a creature suffers more damage than its current health, it is eliminated, while in a stack of creatures, the topmost dies. The remainder of the damage is dealt to the next one and so forth until all damage is dealt or the whole stack is eliminated.

Creature's ability to deal damage typically has a range, which means that it causes randomly chosen damage between the minimum and maximum value. Some creatures like Nagas do not have a damage treshold meaning they always do the same amount of damage. Creatures in a stack cause individual damages, and the combined damage of the stack is calculated by adding them together. However, the final damage can deviate from the combined damage greatly because of different additions and reductions, which are covered in the next section.

Spells can deal damage much like creatures do, except that the amount of inflicted damage does not vary within a range but is fixed. The exact amount of unmodified spell damage can always be calculated with a linear formula. For example, basic Lightning Bolt cast by a hero with 7 spell power does 7 × 25 + 10 = 185 damage. For other spells different values than 25 and 10 need to be substituted. The eventual amount of spell damage is modified as follows:

Damage calculation of creature stacks

The damage calculation formula

Table 1: Damage calculation variables
 Description 
 I1   = 0.05 × (Attack - Defense) (if A ≥ D)
 I2   = 0.10, 0.25, 0.50 for basic, advanced, expert Archery

        = 0.10, 0.20, 0.30 for basic, advanced, expert Offense 

 I3   = 0.05 × I2 × hero level for Archery/Offense specialty

     = 0.03 × (hero ÷ creature level) for Adela's bless

 I4   = 1.00 for lucky strikes
 I5   = 1.00 for Death Blow, Ballista double damage

     = 1.00 if Elemental attacks opposite Elemental type
     = 0.50 for hate
     = 0.05 × hexes travelled for Cavaliers, Champions

 R1 = 0.025 × (Defense - Attack) (if D ≥ A)
 R2 = 0.05, 0.10, 0.15 for basic, advanced, expert Armorer
 R3 = 0.05 × R2 × hero level for Armorer specialty
 R4 = 0.15 for Shield, 0.30 at advanced, expert level

   = 0.25 for Air Shield, 0.50 at advanced, expert level
   = 0.50 for shooter with (basic) Forgetfulness

 R5 = 0.50 if attacker has range or melee penalty 
 R6 = 0.50 if target is behind a wall (obstacle penalty
 R7 = 0.50 for retaliation after being Blinded

   = 0.75 for retaliation after advanced Blind

 R8 = 0.50 for Psychic Elemental vs. mind spell immunity

   = 0.50 for Magic Elemental vs. lvl 1-5 spell immunity
   = 0.50 if target is petrified
   = 0.75 for retaliation after being paralyzed

Mathematical formula for calculating the final damage (DMGf) is:

DMGf = DMGb × (1 + I1 + I2 + I3 + I4 + I5) × (1 - R1)×(1 - R2)×(1 - R3)×(1 - R4)×(1 - R5)×(1 - R6)×(1 - R7)×(1 - R8)

Primary determinant for the final damage is the base damage (DMGb), which is affected by the number of attacking creatures and their damage range. All other variables are basically modifiers of the base damage. Variables are denoted as I if they (i)ncrease damage and as R if they (r)educe it. I1 and R1 are mutually exclusive, but all other variables may simultaneously affect the final damage (DMGf). A brief summary of the variables have been given in the table on the right.

To summarize the above formula, the content of the first parentheses increase the base damage by multiplying it with a modifier varying from 1.00 to 8.00, and the content of the second parentheses reduces the damage with a modifier varying from 0.00 to 1.00.

Attack-Defense difference – variables I1 and R1

The Attack-Defense difference, denoted by I1 and R1 in the formula, is typically the main modifier of base damage. It is calculated as the difference between the attacker's attack value and the defender's defense value. These are determined by adding up the attack skill of the attacking hero and of the attacking creature type, and by adding up defense skill of the defending hero and defending creature type. Spells and creature abilities that affect attack or defense values, such as Bloodlust and disease, are also taken into account in this part of the formula, as are any bonuses from native terrain or creature specialties.

If the attacking creature's total attack value is higher than the defending creature's total defense value (i.e., the difference is positive), then the attacking creature receives a 5% bonus to its base damage for every point the attack value is higher. If the difference is negative, then the attacking creature receives a 2.5% penalty to its total damage for every point the attack value is lower. A positive Attack-Defense difference therefore increases damage, meaning that the variable I1 in the formula is positive whereas R1 is 0. Conversely, a negative Attack-Defense difference decreases damage, meaning that R1 is positive whereas I1 is 0. An Attack-Defense difference of 0 does not modify base damage.

The Attack-Defense difference can modify base damage only within a specific limit. This limit is reached by a positive Attack-Defense difference of +60 and a negative Attack-Defense difference of -28. This means that a high attack skill can grant no more than +300% bonus damage, whereas a high defense skill can grant no more than a -70% penalty. Thus, the Attack-Defense difference can modify a base damage of 100 to no more than 400, and to no less than 30.

Secondary skill factors – variables I2 and I3

Variable I2 represents secondary skill modifier of either Archery or Offense depending on the attack type. Creatures able to attack from the distance gain bonus from the Archery secondary skill when using their ability. If a creature engages into melee combat, it gains bonus to its damage from Offense secondary skill.

Variable I2 is related to secondary skills Archery and Offense, and I3 to heroes specializing in these skills. Archery and Offense cannot affect damage simultaneously, because they are related to ranged and melee attacks, respectively. For ranged attacks, Archery secondary skill may give 0, 0.10, 0.25 or 0.50 depending on whether the hero has the skill and on what level the skill is. Similarly, Offense may give 0, 0.10, 0.20 or 0.30 to melee attacks.

Three heroes specialize in Archery or Offense. Orrin has Archery as a specialty while Gundula and Crag Hack has Offense. They receive additional bonus from Archery or Offense secondary skill, as calculated with the following formula:

I3 = 0.05 × hero level × I2

As can be seen from the formula, the specialty bonus requires that the hero has the appropriate secondary skill, otherwise I2 becomes 0, which leads I3 to become 0 as well. In other words, Orrin does not receive his specialty bonus if he does not have Archery secondary skill; same applies to Gundula and Crag Hack with Offense. By default these heroes start with the skill they specialize in, but in custom maps the map-maker may change the starting skills.

Additionally, Adela and her Bless specialty is a special case of variable I3. Adela's Bless maximizes base damage as usual, but also deals extra damage according to the following formula:

SP = 0.03 × hero level ÷ creature level

Because of the division, Adela's Bless bonus is greater for low-level than high-level creatures. Her Bless grants +3% damage per hero level to level 1 creatures, whereas it grants +0.6% per hero level for level 5 creatures.

Luck as combat modifier – variable I4

The luck variable may be either 0 or 1.00, depending on whether or not the attacking creatures gets "a lucky strike". This is determined by the combat variable luck, which may be 0 (neutral), +1 (positive), +2 (good) or +3 (excellent). These values determine how often lucky strikes occur. These probabilities are, respectively, 0/24 (0%), 1/24 (4.17%), 1/12 (8.33%) and 1/8 (12.5%). Luck may be affected by artifacts, adventure map locations, spells and the secondary skill Luck.

Creature abilities – variable I5

The final variable capable of increasing total damage is I5, which denotes creature specialties from Cavaliers and Champions, Dread Knights, Ballistas, Elementals, and creatures that hate each other.

The jousting specialty of Cavaliers and Champions lets them deal 5% extra damage for every hex they travel during the combat turn in which they attack their target:

I5 = 0.05 × squares travelled

Dread Knights can make Death Blow attacks, which gives variable I5 a value of 1.00, effectovely doubling base damage (though not necessarily total damage). The I5 variable is also 1.00 for a Ballista whose shots deal double (base) damage. Additionally, there are a few creatures who hate each other, which gives I5 a value of 0.50 when they attack each other. This is true for Angels and Devils, Titans and Black Dragons, and Genies and Efreeti. Finally, Fire Elementals and Water Elementals, as well as Air Elementals and Earth Elementals do double base damage against each other (i.e., I5 = 1).

Defense variables

Secondary skill factors – variables R1 and R2

Just like the variables I2 and I3 denote how learning and specializing in Archery and Offense increases, respectively, ranged and melee damage, so do the variables R2 and R3 denote how learning and specializing in Armorer reduces both ranged and melee damage. R2 can take the values 0.05, 0.10 and 0.15, indicating that basic, advanced and expert Armorer reduce damage by, respectively, 5%, 10% and 15%. The three heroes with an Armorer specialty - Mephala, Neela and Tazar - double the effectiveness of the Armorer skill when they reach level 20, as shown by the following formula:

D2 = 0.05 × hero level × D1

Armorer has two unexpected side effects. First, heroes with Armorer take double damage from arrow towers. Second, damage is reduced by 1 if creatures from a hero with Armorer take an amount of damage that is exactly an integer value. Thus, if 100 Peasants attack a stack of Peasants commanded by a hero with basic Armorer (and the Attack-Defense difference is 0), damage is not 100 × 1 ×(1 - 0.05) = 95, but 94. If the attack had instead been performed by 99 Peasants, the damage would be 99 × 1 ×(1 - 0.05) = 94.05, which is not an integer value and therefore rounded off in the usual way, that is, to 94.

Ohter factors – variables D3, D4, D5, D6, D7

  • Spells
    • Shield
    • Air Shield
  • Attack penalties:
    • Range or obstacle
    • Melee penalty
  • Petrified
  • Retaliate from blindness
  • Creatures
    • Attacker is Psychic Elemental, defender is immune to Mind spells
    • Attacker is Magic Elemental, defender is Magic Elemental or the Black Dragon

Examples

No heroes are assumed to be present in the battle.

  • 2 Nagas attack a stack of Pikemen.
  • The Nagas have a single unit damage value of 20 and their Attack skill is 16.
  • A Pikeman has 10 health and their Defense skill is 5.
  • The base stack damage done by the stack of Nagas is 2 * 20 = 40.
  • The Pikemen's Defense skill (5) is subtracted from the Nagas' Attack skill (16), which gives us 11, giving the nagas an att/def damage bonus.
  • The dealt damage will after the att/def consideration thusly have the bonus percentage modificator of 5%, multiplied with the damage bonus number in this case, 11, resulting in 55% bonus percentage of the Nagas damage towards the Pikemen.
  • So the damage is increased by a 55% increase and the nagas through superior attack skill have 155% damage on the Pikemen stack.
  • The total damage thus is 40 * 1.55 = 62 damage points.
  • 6 Pikemen will be killed, and the top Pikemen of the remaining stack will have 8 health left.

When the remaining (if any) Pikemen (attack points of 4) attack the nagas (sporting 13 points of defense):

  • -22.5% damage would be dealt by the Pikemen to the 5 creature level higher naga chimera stack.
  • The difference between the Pikemen attack (4) and the nagas defense (13) would mean 9 malus points with a malus point resulting in 2.5 % each malus point (the half of the bonus points).
  • ((2.5)*-9)% is -22.5% damage the Pikemen can damage the nagas with.