Damage
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. Most hits' damage deviates 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 190 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:
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
- The
Shroomite bonus
is 1.15; the Magic Quiver, Molten Quiver, and Stalker's Quiver each grants 0.1Quiver bonus
.
- Then the weapon damage is calculated:
Final weapon damage = Weapon damage × Weapon ranged multiplier
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.1Quiver 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]
- For Sandgun, using Pearlsand, Ebonsand, or Crimsand provides 5 additional damage.
- When the Molten Quiver(Desktop, Console and Mobile versions) is equipped and the ammo is Wooden Arrow, 2 additional damage is provided.
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
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.
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
On the
|
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
;- In Classic Mode: Factor is 1.5 for normal enemies, and 1.1 for Old One's Army enemies.
- In Expert Mode: Factor is 2 for normal enemies, and 1.2 for Old One's Army enemies.
- The effect of defense when calculating damage:
Defense damage reduction = ⌈Enemy defense/2⌉
- Calculate the random damage variance:
Damage variance = Damage × Factor2
, whereFactor2
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 usesFinal 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 theFinal 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(Desktop, Console and Mobile versions)(any minecart) | 60 | n/a |
![]() |
Scutlix Mount(Desktop, Console and Mobile versions) | 150 | n/a |
![]() |
Santank Mount(Desktop, Console and Mobile versions)(bullet) | 100 | Ranged |
![]() |
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(Desktop, Console, Old-gen console and Mobile versions) | 40 | ✔️ |
![]() |
Winged Slime Mount(Desktop, Console and Mobile versions) | ||
![]() |
Golf Cart(Desktop, Console and Mobile versions)(run into entities) | ||
![]() |
Golf Cart(Desktop, Console and Mobile versions)(fall onto entities) | 40 | ❌ |
![]() |
Painted Horse Mount(Desktop, Console and Mobile versions) | 30 | ✔️ |
![]() |
Majestic Horse Mount(Desktop, Console and Mobile versions) | ||
![]() |
Dark Horse Mount(Desktop, Console and Mobile versions) | ||
![]() |
Unicorn Mount(Desktop, Console and Mobile versions) | 60 | ✔️ |
![]() |
Goat Mount(Desktop, Console and Mobile versions) | ||
![]() |
Pirate Ship Mount(Desktop, Console and Mobile versions) | 100 | ✔️ |
![]() |
Tree Mount(Desktop, Console and Mobile versions) | 120 | ✔️ |
![]() |
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
- ↑ Information taken from the
Desktop 1.4.4.9 source code, methods
Prefix()
inTerraria.Item.cs
,GetWeaponDamage()
inTerraria.Player.cs
,GrantArmorBenefits()
inTerraria.Player.cs
,GrantPrefixBenefits()
inTerraria.Player.cs
,ItemCheck_Shoot()
inTerraria.Player.cs
, andPickAmmo()
inTerraria.Player.cs
. - ↑ Information taken from the
Desktop 1.4.4.9 source code, methods
UpdateEffects()
inTerraria.Mount.cs
,ApplyEquipFunctional()
inTerraria.Player.cs
,GrantArmorBenefits()
inTerraria.Player.cs
, andGrantPrefixBenefits()
inTerraria.Player.cs
. - ↑ Information taken from the
Desktop 1.4.4.9 source code, methods
ItemCheck()
inTerraria.Player.cs
,GetWeaponDamage()
inTerraria.Player.cs
, andItemCheck_OwnerOnlyCode()
inTerraria.Player.cs
. - ↑ Information taken from the
Desktop 1.4.4.9 source code, methods
ItemCheck()
inTerraria.Player.cs
andGetWeaponDamage()
inTerraria.Player.cs
. - ↑ Information taken from the
Desktop 1.4.3.6 source code, methods
ItemCheck()
inTerraria.Player.cs
andGetWeaponDamage()
inTerraria.Player.cs
. - ↑ Information taken from the
Desktop 1.4.4.9 source code, methods
ItemCheck()
inTerraria.Player.cs
,GetWeaponDamage()
inTerraria.Player.cs
,ItemCheck_OwnerOnlyCode()
inTerraria.Player.cs
,ItemCheck_Shoot()
inTerraria.Player.cs
, andPickAmmo()
inTerraria.Player.cs
. - ↑ Information taken from the
Desktop 1.4.3.6 source code, methods
ItemCheck()
inTerraria.Player.cs
,GetWeaponDamage()
inTerraria.Player.cs
,ItemCheck_Shoot()
inTerraria.Player.cs
, andPickAmmo()
inTerraria.Player.cs
. - ↑ Information taken from the
Desktop 1.4.4.9 source code, method
ResetStats()
inTerraria.Item.cs
. - ↑ Information taken from the
Desktop 1.4.3.6 source code, method
ResetStats()
inTerraria.Item.cs
. - ↑ 10.0 10.1 Information taken from the
Desktop 1.4.4.9 source code, method
PickAmmo()
inTerraria.Player.cs
. - ↑ 11.0 11.1 Information taken from the
Desktop 1.4.3.6 source code, method
PickAmmo()
inTerraria.Player.cs
. - ↑ Information taken from the
Desktop 1.4.4.9 source code, method
MouseText_DrawItemTooltip_GetLinesInfo()
inTerraria.Main.cs
. - ↑ Information taken from the
Desktop 1.4.3.6 source code, method
MouseText_DrawItemTooltip_GetLinesInfo()
inTerraria.Main.cs
. - ↑ Information taken from the
Desktop 1.4.4.9 source code, methods
ApplyDamageToNPC()
inTerraria.Player.cs
andStrikeNPC()
inTerraria.NPC.cs
. - ↑ Information taken from the
Desktop 1.4.3.6 source code, method
StrikeNPC()
inTerraria.NPC.cs
. - ↑ Information taken from the
Desktop 1.4.4.9 source code, methods
ProcessHitAgainstNPC()
inTerraria.Player.cs
andDamage()
inTerraria.Player.cs
. - ↑ 17.0 17.1 17.2 17.3 Information taken from the
Desktop 1.4.4.9 source code, method
AI_003_Fighters()
inTerraria.NPC.cs
. - ↑ Information taken from the
Desktop 1.4.4.9 source code, methods
Damage()
inTerraria.Projectile.cs
,CastSuperCartLaser()
inTerraria.Mount.cs
, andUseAbility()
inTerraria.Mount.cs
. - ↑ Information taken from the
Desktop 1.4.4.9 source code, methods
JumpMovement()
inTerraria.Player.cs
andHorizontalMovement()
inTerraria.Player.cs
.