Defense damage
Defense damage is a mechanic that makes certain enemies' and bosses' attacks reduce the player's defense and damage reduction on hit. The amount of defense damage depends on the actual damage of the enemy or projectile, the mode and the stage of the game. Whenever defense damage is taken, a unique impact sound effect plays and a gray number pops up above the player, showing the amount of defense damage.
Calculations
Defense
Upon getting hit by an attack with defense damage, the player's defense stat is reduced by 33% of the damage mitigated by their defense, up to a maximum of 25% of the player's defense. If a boss is alive, defense damage can't be lower than a certain value:
Mode | Pre-Hardmode | Hardmode | Post-Moon Lord |
---|---|---|---|
Classic | 3 | 8 | 16 |
Revengeance | 4 | 10 | 20 |
Death | 5 | 12 | 24 |
Boss Rush | 25 |
Defense cannot be reduced below 0 due to defense damage, and is set to 0 in case enough defense damage is received.
Recovery
After all invincibility frames wear off and an additional of a second (10 ticks[1]) has passed, defense damage will decrease (i.e. lost defense will start to recover). The rate is dependent on two values:
- How long the player has been recovering from defense damage (currentRecovery)
- The total amount of time the player is currently going to be recovering from defense damage for (totalRecovery)
TotalRecovery has a base value of of a second, and is incremented by another of a second each time the player takes more defense damage while recovering. This also resets currentRecovery back to 0. Defense damage is decreased linearly based on . So if a player is one third of the way through their recovery timer, they will have recovered one third of their lost defense.
Damage Reduction
Defense damage also reduces damage reduction by the following amount: .
NPCs capable of dealing defense damage
|
Notes
- The mode-based floor for defense damage is applied before the cap of 25% of the player's maximum defense. This means theoretically, a player can take less than that floor, if they have sufficiently low maximum defense.
- For example, if a player has less than 96 defense when fighting a post-Moon Lord boss in Death Mode, they would take less than the 24 defense damage specified in the table.
- Defense damage's inability to make defense drop below 0 is bypassed in the For the worthy and Get fixed boi seeds.
References
- ↑ A tick is a time unit countable by the software. Most of Terraria's updating logic happens every tick. A tick has the length of 1/60th of a second, hence there are 60 ticks in a second and 3600 ticks in a minute.
History
- 2.0.4.002: Indicator can no longer display if the player takes 0 defense damage from an attack.
- 2.0.4.001: Sound effect now scales in volume based on how much defense damage the player took, reaching maximum volume if 40% / 50%
/ 55%
/ 60%
/ 70%
of the player's defense is lost.
- 2.0.3.008:
- Can now make defense go below 0 and does not cap damage reduction damage in the For the worthy seed.
- Fixed it always taking 10 frames to start recovering after being inflicted, allowing it to regenerate during immunity frames.
- 2.0.3.007:
- Changed how it is calculated:
- Defense damage taken is now 33% of damage mitigated instead of 10% of damage taken.
- Damage reduction loss from defense damage is still based on the ratio of defense damage taken to total defense.
- Increased the defense damage floor while a boss is alive in pre-Hardmode from 1 / 2
/ 3
/ 4
to 3 / 4
/ 5
, in Hardmode from 2 / 4
/ 6
/ 8
to 8 / 10
/ 12
, and in post-Moon Lord from 3 / 6
/ 9
/ 12
to 16 / 20
/ 24
. Boss Rush now has a defense damage floor of 25.
- Fixed it not being applied if contact damage that inflicts defense damage and a projectile that does not inflict defense damage hit the player on the same frame.
- Changed how it is calculated:
- 2.0.1.002: Now only occurs if damage taken is above zero, no longer occurring during dodges.
- 2.0.1.001: Decreased the global ratio from 15% to 10%.
- 2.0.0.003: Sound effects are now only played client side in multiplayer.
- 2.0.0.001: Now has a UI indicator.
- 1.5.0.003: Decreased recovery delay from 0.5 seconds to 0.17 and minimum total regeneration time from 1 second to 0.83.
- 1.5.0.002:
- The following enemies can no longer inflict it:
- All Armed Zombie variants, all Crimera variants, Devourers, all Eater of Souls variants, and Goblin Warriors.
- Additionally, Antlions and Tomb Crawlers can no longer inflict Defense damage until after defeating Desert Scourge.
- Reworked the formula:
- The ratio of damage to defense damage is now always 15%, regardless of difficulty.
- The player cannot take more than 25% of their maximum defense as defense damage.
- Increased the defense damage regeneration delay timer from 0.25 seconds to 0.5.
- Defense that is lost now regenerates back at a dynamic percentage every 3 frames once the regeneration delay timer has ended.
- If the player takes defense damage and is not hit again, all defense will have been regenerated back in 1 second.
- Consecutive hits after taking defense damage now slow the percentage of defense that is regenerated back every 3 frames. The total time for all of the player's defense to be regenerated back is capped at 15 seconds.
- Defense damage can now only be applied to the player once every 0.25 seconds instead of every 0.083.
- The following enemies can no longer inflict it:
- 1.5.0.001: Introduced.
Game mechanics | |||||||||
---|---|---|---|---|---|---|---|---|---|
Combat | Damage reduction • Defense damage • Enchantment • Hit sounds • Immunity frames • Lifesteal • Minions • Pierce resistance • Rogue | ||||||||
Environment | Biome backgrounds • Events • Music • World generation | ||||||||
Events | Acid Rain • Boss Rush | ||||||||
Game | Bestiary • Configuration options • Difficulty Modes (Death Mode • Revengeance Mode) • Fishing • Game controls • Lore • Secret world seeds (For the worthy • Get fixed boi) • Vanilla changes | ||||||||
Items | Alternative crafting ingredients • Charge • Consumable • Crafting stations (By Hand) • Drops • Modifiers • Rarity • Recipes • Vanilla item recipes | ||||||||
Player | Adrenaline Meter • Aggro • Buffs and Debuffs • Dash • Death prevention • Defense • Dodge • Flight Time Bar • Rage Meter | ||||||||
UI | Boss Health Bar • Cooldown Rack • Speedrun Timer • Status messages • Tips |