Defense

From Terraria Wiki
Jump to navigation Jump to search

Defense is a statistic that determines the decrease in damage taken per hit. The player's defense can be increased by wearing armor and accessories, and temporarily boosted/decreased by various buffs/debuffs. Enemies also have a defense statistic.

Defense cannot be reduced to below 0.[1] Furthermore, the damage dealt to an entity will always be at least 1, regardless of defense (with the exception of a player whose multiplayer ally is wearing a Paladin's Shield).

Some forms of damage are impossible to reduce through defense, e.g. damage from damage over time debuffs like Cursed Inferno or from drowning in water. Damage taken from lava, however, can be reduced through defense.

Some items have the ability of armor penetration, which, in most cases, allows them to ignore some or all of the target's defense when calculating damage.

Players

Defense gives a flat reduction in damage, i.e. damage is reduced by a fixed amount per hit (as opposed to a multiplicative damage reduction, which would reduce damage by a percentage). It is calculated after the general ±15% damage randomization.

The formula is: net dmg = \lfloorattack dmg - def × factor\rfloor, where factor is 0.5 in Classic Mode, 0.75 in Expert Mode, and 1 in Master Mode.[2]

Examples

Atk. dmg Def. Net damage
Classic mode icon.png Classic Expert mode icon.png Expert Master mode icon.png Master
40 20 30
<floor40 - 20 * 0.5\rfloor = 30
25
<floor40 - 20 * 0.75\rfloor = 25
20
<floor40 - 20 * 1\rfloor = 20
40 30 25
<floor40 - 30 * 0.5\rfloor = 25
17
<floor40 - 30 * 0.75\rfloor = 17
10
<floor40 - 30 * 1\rfloor = 10
75 20 65
<floor75 - 20 * 0.5\rfloor = 65
60
<floor75 - 20 * 0.75\rfloor = 60
55
<floor75 - 20 * 1\rfloor = 55
75 30 60
<floor75 - 30 * 0.5\rfloor = 60
52
<floor75 - 30 * 0.75\rfloor = 52
45
<floor75 - 30 * 1\rfloor = 45

Enemies

Enemies have a defense statistic just like players do, but they do not gain more protection from defense in Expert Mode or Master Mode. They will always reduce incoming damage by 50% of their defense: net dmg = \lfloorattack dmg - def × 0.5\rfloor.

Examples

Weapon Green SlimeGreen Slime
0 defense
Chaos ElementalChaos Elemental
30 defense
PaladinPaladin
50 defense
SharkronSharkron
100 defense
Gold BroadswordGold Broadsword
15 damage
15 1 (0) 1 (-10) 1 (-35)
MeowmereMeowmere
200 damage
200 185 175 150

Boosts

Armor and accessories

A player's defense score can be increased by equipping armor and accessories. Armor usually consists of three items, granting an additional bonus if all pieces match, the set bonus, which may increase the defense score further. Some accessories grant direct defense boosts (see the following table), but all accessories can also be reforged to have defense-increasing modifiers.

See armor for detailed defense information about every piece of armor.

Item Accessory defense
Cobalt ShieldCobalt Shield1
Obsidian SkullObsidian Skull1
ShackleShackle1
Obsidian ShieldObsidian Shield2
Shield of CthulhuShield of Cthulhu2
Ankh ShieldAnkh Shield4
Frozen ShieldFrozen Shield6
Paladin's ShieldPaladin's Shield6
Berserker's GloveBerserker's Glove8
Flesh KnucklesFlesh Knuckles8
Hero ShieldHero Shield10
Item Accessory defense
Moon CharmMoon Charm 3 (only during the night)
Moon ShellMoon Shell 3 (only during the night)
Moon StoneMoon Stone 4 (only during the night)
Sun StoneSun Stone 4 (only during the day)
Celestial ShellCelestial Shell 4 (during the day)
7 (during the night)
Frozen Turtle ShellFrozen Turtle Shell 30 (when below 25% health)
Modifier Defense
Hard 1
Guarding 2
Armored 3
Warding 4

Buffs and debuffs

Buffs and debuffs can temporarily alter a player's or an enemy's defense. The defense of enemies cannot be increased.

Buff/Debuff Buff/debuff defense
Well FedWell Fed 2
Plenty SatisfiedPlenty Satisfied 3
Exquisitely StuffedExquisitely Stuffed 4
The Bast DefenseThe Bast Defense 5
Dryad's BlessingDryad's Blessing 8
IronskinIronskin 8
TipsyTipsy −4
WeakWeak −4
Ichor (debuff)Ichor −15 / −20
Betsy's CurseBetsy's Curse −40
Broken ArmorBroken Armor −50%

Armor penetration

Armor penetration is a hidden player statistic that determines the effective amount of the enemy's defense portion that is ignored when dealing damage to it. It works by increasing the damage dealt as follows:[3]

  • If the player's total armor penetration is greater than the enemy's original defense (i.e. before defense is reduced by certain debuffs), the damage is increased by half of the enemy's defense. This means that the entirety of the enemy's defense is effectively ignored (as the enemy's damage reduction by half its defense – see above – is canceled out).
  • If the player's total armor penetration is lower than or equal to the enemy's original defense, the damage is increased by half of the armor penetration value. This means that any amount between nearly none and all of the enemy's defense is effectively ignored, depending on the specific values.

See below for examples.

Note that the defense-reducing debuffs Ichor and Betsy's Curse are disregarded in these calculations. All decimals are rounded down.

The following items grant armor penetration (they all stack with each other):

Item Armor penetration
Shark Tooth Necklace Shark Tooth Necklace 5
Stinger Necklace Stinger Necklace 5
Sharpening Station Sharpening Station 12 (for melee weapons only)
Hive Pack Hive Pack 5 (for Wasp Gun only)

In addition, the projectiles of certain weapons and accessories have an own armor penetration stat, which is added to the player's armor penetration when inflicting damage upon an enemy with them:[4]

Item Armor penetration
Blade Staff Blade Staff 25
Dark Harvest Dark Harvest("dark energy") 50
Cool Whip Cool Whip(snowflake) 30
Light's Bane Light's Bane(slash of darkness) 5
Blade of Grass Blade of Grass(projectile) 20
Muramasa Muramasa(slash) 5
Bone Glove Bone Glove 25
Crystal Vile Shard Crystal Vile Shard 10
Nettle Burst Nettle Burst 10
Wasp Gun Wasp Gun 10
Star Cloak Star Cloakand its upgrades 25
Arkhalis Arkhalis 20
Weather Pain Weather Pain 10
Flamethrower Flamethrower 15
Elf Melter Elf Melter 15

Examples

Enemy Player
AP
Increased
damage
Explanation
Green SlimeGreen Slime
0 defense
0 0 AP ≤ defense, so increase is AP/2
10 0 AP > defense, so increase is defense/2
Chaos ElementalChaos Elemental
30 defense
0 0 AP ≤ defense, so increase is AP/2 (0% of defense ignored)
10 5 AP ≤ defense, so increase is AP/2 (33.33% of defense ignored)
40 15 AP > defense, so increase is defense/2 (100% of defense ignored)
Sharkron
Sharkron
100 defense
5 2 AP ≤ defense, so increase is AP/2 (4% of defense ignored)
10 5 AP ≤ defense, so increase is AP/2 (10% of defense ignored)
40 20 AP ≤ defense, so increase is AP/2 (40% of defense ignored)
100 50 AP ≤ defense, so increase is AP/2 (100% of defense ignored)
(This is a theoretical example, as it is impossible to attain 100 AP.)

Maximum defense

The highest possible defense can be attained using the setups described in the following sections.

Desktop version Desktop version, Console version Console version, and Mobile version Mobile version

The maximum possible defense is 186 / 196 / 204:

Old-gen console version Old-gen console version and Nintendo 3DSNintendo 3DS version version

The maximum possible defense is 128:

Accessories (42 defense)
  • At night or day (depending on Moon/Sun Stone), at low health
  • Warding modifiers on all accessories
Buffs (10 defense)

Trivia

  • Although not possible in-game, if a piece of armor were to gain a modifier, it would apply the effects just like an accessory would. For example, a set of Warding modified armor would add 12 defense total; each piece adding 4 defense to the total.
  • Damage dealt by enemies is doubled in Expert Mode and tripled in Master Mode compared to Classic Mode. This means that despite the higher factors of defense in those modes, players will still take more damage than they would in Classic Mode.
  • If the player somehow has negative defense, they will take more damage according to the damage taken added with half / three quarters / full amount the defense.

See also

References

  1. Information taken from the Desktop version Desktop 1.4.3.6 source code, method StrikeNPC() in Terraria.NPC.cs. There may be inaccuracies, as the current Desktop version Desktop version is 1.4.4.9.
  2. Information taken from the Desktop version Desktop 1.4.1.2 source code, method CalculateDamagePlayersTake() in Terraria.Main.cs. There may be inaccuracies, as the current Desktop version Desktop version is 1.4.4.9.
  3. Information taken from the Desktop version Desktop 1.4.3.6 source code, method checkArmorPenetration() in Terraria.NPC.cs. There may be inaccuracies, as the current Desktop version Desktop version is 1.4.4.9.
  4. Information taken from the Desktop version Desktop 1.4.2.1 source code, method Damage() in Terraria.Projectile.cs. There may be inaccuracies, as the current Desktop version Desktop version is 1.4.4.9.