Damage

From Terraria Wiki
Jump to navigation Jump to search

Damage is the number of health points subtracted from an entity's current health. It can be inflicted by a multitude of entities, most prominently weapons, enemies, and NPCs (and all related projectiles). Furthermore, it can be caused by environmental hazards (such as thorny bushes, traps, or lava) and game mechanics (such as fall damage, drowning, or debuffs). Damage can generally only be inflicted on entities with a health statistic, i.e., players, most enemies, and NPCs. Most damage sources additionally inflict knockback on the damaged entity and briefly render it invincible.

When an entity receives damage, several calculations increasing or decreasing the amount of damage (depending on several factors; see below) are performed before the actual damage is applied to the entity. Therefore, the damage statistic of any damaging entity is usually only the average damage it inflicts. The actual damage of most hits will deviate from this average number.

Damage inflicted by player-wielded weapons is categorized into four different types: melee, ranged, magic, and summon. Accessories, buffs, and other damage-boosting or damage-decreasing effects often only affect one of these damage types. A few weapons as well as all other damaging entities are not categorized into any of the four types.

Damage types

Melee

Melee weapons are used in close- to medium-ranged combat. Their defining trait is the fact that they do not consume ammunition or mana upon use. They are roughly categorized into swords, spears, flails, boomerangs, and yoyos(Desktop, Console and Mobile versions). There are several other melee weapons not fitting any of these types.

In total, there are 189 different melee weapons.

Ranged

Ranged weapons are used in long-ranged combat. Their defining trait is the requirement of ammunition in order for the weapon to operate. They are roughly categorized into bows, repeaters, guns, and launchers. All consumable weapons are classified as ranged weapons as well. Although boomerangs are thrown, Terraria classifies them as melee weapons.

In total, there are 113 different ranged weapons.

Magic

Magic weapons are used in medium- to long-ranged combat. Their defining trait is the consumption of mana upon every use. Due to their unusual and unique forms of attack, the majority of magic weapons can hardly be categorized into distinct types.

In total, there are 77 different magic weapons.

Summon

Summoning weapons include summon staffs and whips(Desktop, Console and Mobile versions). Using a summon staff spawns a secondary character which will aid the player in battle by automatically attacking enemies. The summoned character is either mobile, i.e. following the player around (minion), or stationary, i.e. remaining at the location it was summoned at (sentry). Whips are close- to mid-range weapons which boost minion damage on hit enemies as well as marking them, making minions focus on those enemies.

Before 1.4.4(Desktop, Console and Mobile versions), summon damage is referred to as "minion damage" in most tooltips.

In total, there are 47 different summon weapons.

Calculations

Weapon damage

The damage of a player-wielded weapon or damaging consumables is determined as following:[1]

First, apply the effect of the weapon's modifier:

Weapon damage = Base weapon damage × Modifier damage multiplier

Then, all damage bonuses (from accessories, armor, buffs, modifiers from accessories, mounts, etc.) are added to the multiplier of the respective damage type (melee, ranged, magic, or summon). The default damage multiplier is 1, meaning the weapon does 100% base damage without any bonuses.[2]

  • For example, equipping the Ranger Emblem adds 0.15 to the ranged damage multiplier; activating the Clairvoyance buff adds 0.05 to the magic damage multiplier.
  • For general damage bonuses (i.e. "x% increased damage"), the bonus value is added to all damage types. For example, equipping the Destroyer Emblem adds 0.1 to melee, ranged, magic, and summon damage multipliers.

The damage value is then calculated with the following formulas, rounded down.

  • For melee, magic, and summon weapons:[3]
Final damage = Weapon damage × Respective damage multiplier
  • For ranged weapons, the weapon damage and ammo damage is calculated separately:

Desktop versionConsole versionMobile version
Desktop/Console/Mobile-Only Content: This section's information applies only to the Desktop, Console, and Mobile versions of Terraria.

When calculating the weapon's damage, the ranged damage multiplier will first be modified by the bonuses of Shroomite armor helmets and Magic Quiver and its upgrades:[4]

For weapons firing arrows or Stakes: Weapon ranged multiplier = (Ranged damage multiplier + Quiver bonus) × Shroomite bonus
For weapons firing other ammos: Weapon ranged multiplier = Ranged damage multiplier × Shroomite bonus
Then the weapon damage is calculated: Final weapon damage = Weapon damage × Weapon ranged multiplier

Old-gen console versionNintendo 3DS version
Old-gen console/3DS-Only Content: This section's information applies only to the Old-gen console and 3DS versions of Terraria.

When calculating the weapon's damage, the ranged damage multiplier is directly applied first:[5]

Boosted ranged damage = Ranged weapon damage × Ranged damage multiplier

Then, the bonuses of Shroomite armor helmets and the Magic Quiver are applied:

For weapons firing arrows or Stakes: Final weapon damage = Boosted ranged damage × (1 + Shroomite bonus + Quiver bonus)
For weapons firing other ammos: Final weapon damage = Boosted ranged damage × (1 + Shroomite bonus)
  • The Shroomite bonus is 0.15; the Magic Quiver grants 0.1 Quiver bonus.

If the ammo item used by the weapon deals more than 0 damage and deals ranged damage, the ranged damage multiplier will be directly used to calculate its damage:[6][7]

Ammo damage = Base ammo damage × Ranged damage multiplier

If the ammo deals 0 damage or less (i.e. has the default damage value of -1[8][9]) or does not deal ranged damage, the Ammo damage will be the damage value of the ammo item. As a result, Fallen Star, Gel, and Sand Blocks will actually reduce the final damage by 1.

When checking the damage of the ammo item, some effects provides Additional damage that directly adds to the damage value:[10][11]

The final damage will be the sum of weapon damage, ammo damage, and additional damage. If the Archery buff is active and the ammo is arrows or Stake, it will be multiplied by 1.1(Desktop, Console and Mobile versions) / 1.2(Old-gen console and 3DS versions):[10][11]

Final damage = (Final weapon damage + Ammo damage + Additional damage) × Archery buff

Additionally, the damage listed in ranged weapon's tooltip has a different formula:[12][13]

(Desktop, Console and Mobile versions) Tooltip damage = Weapon damage × Weapon ranged multiplier × Archery buff
(Old-gen console and 3DS versions) Tooltip damage = Weapon damage × Ranged damage multiplier × (1 + Shroomite bonus + Quiver bonus) × Archery buff

Example

  • Example 1

    Godly Meowmere(Desktop, Console and Mobile versions), Turtle armor, Menacing Warrior Emblem, Menacing Avenger Emblem, Menacing Destroyer Emblem, Menacing Mechanical Glove, Menacing Celestial Stone, and Well Fed buff.

    • The base damage of the Meowmere is 200. The Godly modifier increases it to 230.
    • Melee damage multiplier = 1 + 0.14 + 0.2 + 0.15 + 0.12 + 0.1 + 0.12 + 0.1 + 0.05 = 1.98
    • Final damage = 230 × 1.98 = 455
    Example 2

    Godly Chlorophyte Shotbow and Wooden Arrow, Shroomite armor with Shroomite Headgear, Menacing Ranger Emblem, Menacing Avenger Emblem, Menacing Destroyer Emblem, Menacing Magic Quiver, and Archery buff.

    On the Desktop version Desktop version, Console version Console version, and Mobile version Mobile version:

    • The base damage of the Chlorophyte Shotbow is 34. The Godly modifier increases it to 39.
    • Ranged damage multiplier = 1 + 0.13 + 0.6 + 0.16 + 0.15 + 0.12 + 0.1= 2.26
    • Final weapon damage = 39 × (2.26 + 0.1) × 1.15 = 105
    • Ammo damage = 5 × 2.26 = 11
    • The damage in the tooltip of Chlorophyte Shotbow is 39 × (2.26 + 0.1) × 1.15 × 1.1 = 116
    • Final damage = (105 + 11) ×1.1 = 127

    On the Old-gen console version Old-gen console version and Nintendo 3DSNintendo 3DS version version:

    • The base damage of the Chlorophyte Shotbow is 34. The Godly modifier increases it to 39.
    • Ranged damage multiplier = 1 + 0.13 + 0.6 + 0.16 + 0.15 + 0.12 + 0.1= 2.26
    • Final weapon damage = 39 × 2.26 × (1 + 0.15 + 0.1) = 110
    • Ammo damage = 4 × 2.26 = 9
    • The damage in the tooltip of Chlorophyte Shotbow is 39 × 2.26 × (1 + 0.15 + 0.1) × 1.2 = 132
    • Final damage = (110 + 9) ×1.2 = 142
  • Damage to entities

    Apart from the weapon damage, the damage done to entities will be modified by various other factors: whether there is a related enemy banner nearby, the player's armor penetration, and the target's defense, etc. The following formulas are used in calculation:[14][15]

    • Damage without a banner: Damage after banner = Final damage;
    • Damage with a banner : Damage after banner = Factor × Final damage;
    • The effect of defense when calculating damage:Defense damage reduction = ⌈Enemy defense/2⌉
    • Calculate the random damage variance:Damage variance = Damage × Factor2, where Factor2 is a random value between 0.85 and 1.15 (inclusive).
      • The result is rounded to the nearest integer. If the fractional part is 0.5, round to the nearest even number instead.

    The game uses different methods to determine damage for melee weapons and projectiles.[16]

    Melee weapons

    • Apply the banners' effects to get Damage after banner. The calculation uses Final damage calculated above.
    • Apply the Striking Moment buff effect by multiplying Damage after banner by 5.
    • Apply weapon effects on damage (e.g.(Desktop, Console and Mobile versions) The Breaker Blade's effect).
    • Apply the random damage variance.
    • Apply the effect of armor penetration.
    • (Old-gen console and 3DS versions) Apply the effect of Ichor debuff.
    • Apply the effect of defense by substracting Defense damage reduction from damage. If the result is less than 1, set the damage to 1.
    • If the attack is a critical strike, multiply the damage by 2.
    • If the target is a Selenian that is spinning, multiply the damage by 3.[17]

    Projectiles

    • Calculate the base damage of the projectile, using Final damage calculated above. By default this equals to the Final damage, for minions that get stronger with extra summons (e.g.Stardust Dragon), the damage is calculated by the formula listed on their respective pages.
    • Apply the random damage variance.
    • Apply the banners' effects to get Damage after banner.
    • If the projectile is a melee projectile, apply the Striking Moment buff effect by multiplying Damage after banner by 5.
    • Apply the effect of armor penetration.
    • (Old-gen console and 3DS versions) Apply the effect of Ichor debuff.
    • Apply the effect of defense by substracting Defense damage reduction from damage. If the result is less than 1, set the damage to 1.
    • If the attack is a critical strike, multiply the damage by 2.
    • If the target is a Selenian that is spinning, multiply the damage by 3.[17]

    Mounts

    Some mounts have their own attack method (by firing projectiles). Their damage calculation is the same as projectiles', however they do not benefit from damage type boosts, and instead only benefit from critical strike chance of a certain type. Projectiles that do not have damage type set will not be able to do critical hits.[18]

    Mount Base damage Damage type
    Minecart Upgrade Kit Minecart Upgrade Kit(Desktop, Console and Mobile versions)(any minecart) 60 n/a
    Scutlix Mount Scutlix Mount(Desktop, Console and Mobile versions) 150 n/a
    Santank Mount Santank Mount(Desktop, Console and Mobile versions)(bullet) 100 Ranged
    Santank Mount Santank Mount(Desktop, Console and Mobile versions)(rocket) 120 Ranged

    Certain mounts are able to deal damage to entities on contact. Their damage is calculated as following (certain formula is the same used above):[19]

    • If affected, multiply Base damage with the player's summon damage.
    • Apply the banners' effects.
    • Apply the effect of armor penetration.
    • (Old-gen console and 3DS versions) Apply the effect of Ichor debuff.
    • Apply the effect of defense by substracting Defense damage reduction from damage. If the result is less than 1, set the damage to 1.
    • If the target is a Selenian that is spinning, multiply the damage by 3.[17]
    • Note that no damage variance is applied, and these damage cannot do critical strikes.
    Mount Base damage Affected by
    summon damage
    Slime Mount Slime Mount(Desktop, Console, Old-gen console and Mobile versions) 40 ✔️
    Winged Slime Mount Winged Slime Mount(Desktop, Console and Mobile versions)
    Golf Cart Golf Cart(Desktop, Console and Mobile versions)(run into entities)
    Golf Cart Golf Cart(Desktop, Console and Mobile versions)(fall onto entities) 40
    Painted Horse Mount Painted Horse Mount(Desktop, Console and Mobile versions) 30 ✔️
    Majestic Horse Mount Majestic Horse Mount(Desktop, Console and Mobile versions)
    Dark Horse Mount Dark Horse Mount(Desktop, Console and Mobile versions)
    Unicorn Mount Unicorn Mount(Desktop, Console and Mobile versions) 60 ✔️
    Goat Mount Goat Mount(Desktop, Console and Mobile versions)
    Pirate Ship Mount Pirate Ship Mount(Desktop, Console and Mobile versions) 100 ✔️
    Tree Mount Tree Mount(Desktop, Console and Mobile versions) 120 ✔️
    Basilisk Mount Basilisk Mount(Desktop, Console and Mobile versions) 90 ✔️

    Minecarts

    The contact damage minecarts deals is calculated as following:

    • Calculate the base damage by formulas in Minecarts § Notes.
    • Apply the random damage variance.
    • Apply the banners' effects.
    • (Old-gen console and 3DS versions) Apply the effect of Ichor debuff.
    • Apply the effect of armor penetration.
    • Apply the effect of defense by substracting Defense damage reduction from damage. If the result is less than 1, set the damage to 1.
    • If the target is a Selenian that is spinning, multiply the damage by 3.[17]

    See also

    References

    1. Information taken from the Desktop version Desktop 1.4.4.9 source code, methods Prefix() in Terraria.Item.cs, GetWeaponDamage() in Terraria.Player.cs, GrantArmorBenefits() in Terraria.Player.cs, GrantPrefixBenefits() in Terraria.Player.cs, ItemCheck_Shoot() in Terraria.Player.cs, and PickAmmo() in Terraria.Player.cs.
    2. Information taken from the Desktop version Desktop 1.4.4.9 source code, methods UpdateEffects() in Terraria.Mount.cs, ApplyEquipFunctional() in Terraria.Player.cs, GrantArmorBenefits() in Terraria.Player.cs, and GrantPrefixBenefits() in Terraria.Player.cs.
    3. Information taken from the Desktop version Desktop 1.4.4.9 source code, methods ItemCheck() in Terraria.Player.cs, GetWeaponDamage() in Terraria.Player.cs, and ItemCheck_OwnerOnlyCode() in Terraria.Player.cs.
    4. Information taken from the Desktop version Desktop 1.4.4.9 source code, methods ItemCheck() in Terraria.Player.cs and GetWeaponDamage() in Terraria.Player.cs.
    5. Information taken from the Desktop version Desktop 1.4.3.6 source code, methods ItemCheck() in Terraria.Player.cs and GetWeaponDamage() in Terraria.Player.cs.
    6. Information taken from the Desktop version Desktop 1.4.4.9 source code, methods ItemCheck() in Terraria.Player.cs, GetWeaponDamage() in Terraria.Player.cs, ItemCheck_OwnerOnlyCode() in Terraria.Player.cs, ItemCheck_Shoot() in Terraria.Player.cs, and PickAmmo() in Terraria.Player.cs.
    7. Information taken from the Desktop version Desktop 1.4.3.6 source code, methods ItemCheck() in Terraria.Player.cs, GetWeaponDamage() in Terraria.Player.cs, ItemCheck_Shoot() in Terraria.Player.cs, and PickAmmo() in Terraria.Player.cs.
    8. Information taken from the Desktop version Desktop 1.4.4.9 source code, method ResetStats() in Terraria.Item.cs.
    9. Information taken from the Desktop version Desktop 1.4.3.6 source code, method ResetStats() in Terraria.Item.cs.
    10. 10.0 10.1 Information taken from the Desktop version Desktop 1.4.4.9 source code, method PickAmmo() in Terraria.Player.cs.
    11. 11.0 11.1 Information taken from the Desktop version Desktop 1.4.3.6 source code, method PickAmmo() in Terraria.Player.cs.
    12. Information taken from the Desktop version Desktop 1.4.4.9 source code, method MouseText_DrawItemTooltip_GetLinesInfo() in Terraria.Main.cs.
    13. Information taken from the Desktop version Desktop 1.4.3.6 source code, method MouseText_DrawItemTooltip_GetLinesInfo() in Terraria.Main.cs.
    14. Information taken from the Desktop version Desktop 1.4.4.9 source code, methods ApplyDamageToNPC() in Terraria.Player.cs and StrikeNPC() in Terraria.NPC.cs.
    15. Information taken from the Desktop version Desktop 1.4.3.6 source code, method StrikeNPC() in Terraria.NPC.cs.
    16. Information taken from the Desktop version Desktop 1.4.4.9 source code, methods ProcessHitAgainstNPC() in Terraria.Player.cs and Damage() in Terraria.Player.cs.
    17. 17.0 17.1 17.2 17.3 Information taken from the Desktop version Desktop 1.4.4.9 source code, method AI_003_Fighters() in Terraria.NPC.cs.
    18. Information taken from the Desktop version Desktop 1.4.4.9 source code, methods Damage() in Terraria.Projectile.cs, CastSuperCartLaser() in Terraria.Mount.cs, and UseAbility() in Terraria.Mount.cs.
    19. Information taken from the Desktop version Desktop 1.4.4.9 source code, methods JumpMovement() in Terraria.Player.cs and HorizontalMovement() in Terraria.Player.cs.