Defense damage

From Calamity Mod Wiki
Jump to navigation Jump to search

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 10% of the damage taken up to a maximum of 25% of the player's defense. The Draedon's Heart reduces defense damage by 50%. If a boss is alive, defense damage can't be lower than a certain value:

Mode Pre-Hardmode Hardmode Post-Moon Lord
Classic 1 2 3
Expert 2 4 6
Revengeance 3 6 9
Death 4 8 12
Boss Rush 5 10 15

Defense can't 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

  • Image NPC
    Anahita Anahita (contact)
    Aquatic Aberration Aquatic Aberration (contact)
    Aquatic Scourge Aquatic Scourge (contact, clouds)
    Armored Digger Head Armored Digger Head (contact)
    Astrum Aureus Astrum Aureus (contact)
    Astrum Deus Head Astrum Deus Head (contact, mine)
    Atlas Atlas (contact)
    Aureus Spawn Aureus Spawn (explosion)
    Bobbit Worm Bobbit Worm (contact)
    Bohldohr Bohldohr (contact)
    Brimstone Elemental Brimstone Elemental (Brimstone Hellfireball, Brimstone Hellblast, Brimstone Ray)
    Calamitas Clone Calamitas Clone (contact, Brimstone Hellfireball, Brimstone Hellblast, Brimstone Fireblast)
    Cataclysmic Construct Cataclysmic Construct (contact)
    Catastrophe Catastrophe (slash)
    Catastrophic Construct Catastrophic Construct (contact)
    Ceaseless Void Ceaseless Void (contact, dark energy ball)
    Cosmic Mine Cosmic Mine (contact)
    Crabulon Crabulon (contact)
    Cragmaw Mire Cragmaw Mire (contact)
    Crimulan Paladin Crimulan Paladin (contact, projectiles)
    Cryogen's Shield Cryogen's Shield (contact)
    Cryogen Cryogen (contact, ice bomb)
    Dank Creeper Dank Creeper (contact)
    Dark Energy Dark Energy (contact)
    Desert Scourge Head Desert Scourge Head (contact)
    Desert Nuisance Head Desert Nuisance Head (contact)
    Devil Fish Devil Fish (contact)
    Earth Elemental Earth Elemental (contact, large rock)
    Ebonian Paladin Ebonian Paladin (contact, projectiles)
    Eidolist Eidolist (contact, lightning, ice mist)
    Eidolon Wyrm Eidolon Wyrm (lightning, ice cluster)
    Giant Clam Giant Clam (contact)
    Gnasher Gnasher (contact)
    Great Sand Shark Great Sand Shark (contact)
    Gulper Eel Head Gulper Eel Head (contact)
    Yharon, Dragon of Rebirth Yharon, Dragon of Rebirth (contact, projectiles)
    Leviathan Leviathan (contact, meteor)
    Mantis Mantis (contact, scythe)
    Mauler Mauler (contact)
    Nuclear Terror Nuclear Terror (contact)
    Plague Homing Missile Plague Homing Missile (contact)
    Plague Mine Plague Mine (contact)
    Plaguebringer Plaguebringer (contact)
    Polterghast Polterghast (contact, Phantom Blasts)
    Primordial Wyrm Primordial Wyrm (contact, lightning, ice mist)
    Profaned Guardians Profaned Guardians (contact, projectiles)
    Ravager Ravager (contact)
    Reaper Shark Reaper Shark (contact)
    Rock Pillar Rock Pillar (contact)
    Scorn Eater Scorn Eater (contact)
    Signus, Envoy of the Devourer Signus, Envoy of the Devourer (contact, scythes)
    Slime God Core Slime God Core (contact, projectiles)
    Storm Weaver Head Storm Weaver Head (contact, frost wave)
    Sulphurous Sharkron Sulphurous Sharkron (contact)
    Supreme Witch, Calamitas Supreme Witch, Calamitas (contact, Brimstone Hellfireball, Brimstone Hellblast, Brimstone Fireblast, Brimestone Gigablast, Brimstone Monster)
    The Devourer of Gods The Devourer of Gods (contact, fireball, laser walls)
    Dragonfolly Dragonfolly (contact, projectiles)
    The Hive Mind The Hive Mind (contact)
    The Old Duke The Old Duke (contact, vortex)
    The Perforators The Perforators (contact)
    The Plaguebringer Goliath The Plaguebringer Goliath (contact, missiles)
    Providence, the Profaned Goddess Providence, the Profaned Goddess (molten blast, molten glob, crystal shard, coccoon star, holy blast, holy ray)
    Tooth Ball (Old Duke) Tooth Ball (Old Duke) (contact)
    Trasher Trasher (contact)
    XM-05 Thanatos XM-05 Thanatos (contact, projectiles)
    XS-01 Artemis XS-01 Artemis (contact, projectiles)
    XS-03 Apollo XS-03 Apollo (contact, projectiles)
    King Slime King Slime (contact)
    Eye of Cthulhu Eye of Cthulhu (contact)
    Brain of Cthulhu Brain of Cthulhu (contact)
    Queen Bee Queen Bee (contact)
    Corruptor Corruptor (contact)
    Crawdad Crawdad (contact)
    Man Eater Man Eater (contact)
    Angry Trapper Angry Trapper (contact)
    Snatcher Snatcher (contact)
    Spike Ball Spike Ball (contact)
    Basilisk Basilisk (contact)
    Bone Lee Bone Lee (contact)
    Paladin Paladin (contact, hammer)
    Corrupt Mimic Corrupt Mimic (contact)
    Crimson Mimic Crimson Mimic (contact)
    Hallowed Mimic Hallowed Mimic (contact)
    Digger Head Digger Head (contact)
    World Feeder Head World Feeder Head (contact)
    Dune Splicer Head Dune Splicer Head (contact)
    Crawltipede (Head) Crawltipede (Head) (contact)
    Mimic Mimic (contact)
    Sand Shark Sand Shark (contact)
    Bone Biter Bone Biter (contact)
    Flesh Reaver Flesh Reaver (contact)
    Crystal Thresher Crystal Thresher (contact)
    Butcher Butcher (contact)
    Deadly Sphere Deadly Sphere (contact)
    Mothron Mothron (contact)
    Reaper Reaper (contact)
    Psycho Psycho (contact)
    Present Mimic Present Mimic (contact)
    Yeti Yeti (contact)
    Evolution Beast Evolution Beast (contact)
    Corite Corite (contact)
    Milkyway Weaver (Head) Milkyway Weaver (Head) (contact)
    Eater of Worlds Head Eater of Worlds Head (contact)
    Skeletron Skeletron (contact, skull)
    Wall of Flesh Mouth Wall of Flesh Mouth (contact)
    The Hungry The Hungry (contact)
    The Hungry II The Hungry II (contact)
    Spazmatism Spazmatism (contact)
    Retinazer Retinazer (contact)
    Skeletron Prime Skeletron Prime (contact, bombs, skulls)
    Plantera Plantera (contact, spore gas, thorn ball)
    Golem Golem (contact)
    Phantasm Dragon (Head) Phantasm Dragon (Head) (contact)
    Ancient Vision Ancient Vision (contact)
    Ancient Light Ancient Light (contact)
    Ogre Ogre (contact)
    Betsy Betsy (contact, fireball, flame breath)
    Pumpking Hand Pumpking Hand (contact, blades)
    Santa-NK1 Santa-NK1 (contact, presents)
    Duke Fishron Duke Fishron (contact, sharknado, cthulhunado)
    Rock Golem Rock Golem (contact, rocks)
    Blood Eel Head Blood Eel Head (contact)
    Dreadnautilus Dreadnautilus (contact)
    Hemogoblin Shark Hemogoblin Shark (contact)
    Zombie Merman Zombie Merman (contact)
    Empress of Light Empress of Light (contact, lance walls, sun dance, trails)
    Queen Slime Queen Slime (contact)
    Deerclops Deerclops (contact, ice spike, shadow hands)
    Pirate Captain Pirate Captain (cannonball)
    Demon Demon (scythe)
    Voodoo Demon Voodoo Demon (scythe)
    Ice Queen Ice Queen (frost wave)
    Diabolist Diabolist (fireblast)
    Hoplite Hoplite (javelin)
    Lunatic Cultist Lunatic Cultist (fireball, lightning, ice mist)
    Moon Lord Moon Lord (phantasmal deathray, phantasmal sphere)
    True Eye of Cthulhu True Eye of Cthulhu (phantasmal sphere)
    Skeleton Commando Skeleton Commando (rocket)
    Rune Wizard Rune Wizard (blast)
    Martian Saucer Martian Saucer (missile, deathray)
    Dungeon Guardian Dungeon Guardian (skull)
    Skeleton Sniper Skeleton Sniper (bullet)
    Red Devil Red Devil (trident)
  • 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 48 defense when fighting a post-Moon Lord boss in Death Mode, they would take less than the 12 defense damage specified in the table.

    References

    1. 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

    These history sections are still a work-in-progress, and may not yet contain changes relevant to the current version of the Calamity Mod.
    • 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 Expert Mode / 3 Revengeance Mode / 4 Death Mode to 3 / 4 Revengeance Mode / 5 Death Mode, in Hardmode from 2 / 4 Expert Mode / 6 Revengeance Mode / 8 Death Mode to 8 / 10 Revengeance Mode / 12 Death Mode, and in post-Moon Lord from 3 / 6 Expert Mode / 9 Revengeance Mode / 12 Death Mode to 16 / 20 Revengeance Mode / 24 Death Mode. 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.
    • 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.
    • 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.