Invincibility frame

From Terraria Wiki
(Redirected from Global invincibility frame)
Jump to navigation Jump to search

An invincibility frame (also known as immune frame, immunity frame, or invulnerability frame, sometimes abbreviated to iframe or i-frame) is a brief period of time during which an entity cannot take any damage. It is usually granted immediately after taking damage.

The general purpose of invincibility frames is to prevent an entity from taking too much damage from continuous or rapidly repeated damage sources. For instance, a player submerged in lava would take damage from it every tick[1], i.e. 60 times per second. Instead, they receive an invincibility frame after taking damage which renders them temporarily invincible to further damage for a very short time.

Players in particular are also granted invincibility frames under a few other conditions, not just taking damage.

Player invincibility

The player gets an invincibility frame after taking damage from any source. The length of the invincibility frame varies depending on the circumstances; certain items will also provide invincibility frames when their effects are triggered. See below for details.

Invincibility groups

On the Desktop version Desktop version, Console version Console version, and Mobile version Mobile version, some groups of damage sources grant separate "types" of invincibility frames. These different types of invincibility frames will not interfere with each other. The vast majority of damage sources are in the same group ("Group 4" below), but there are three other groups:

Group 1
Damage inflicted by darkness in a Constant world[2], and damage inflicted by these tiles:[3]
Group 2
All damage inflicted by these bosses:[4]
Group 3
Damage inflicted by lavalava.[5]
Group 4
All other damage sources.

For example, if the player takes damage from a Spike ("Group 1" above), they will not take any damage from e.g. touching a Rolling Cactus (also "Group 1") for the duration of the invincibility frame, but they will still take damage from e.g. an enemy ("Group 4") during this time.

On the Old-gen console version Old-gen console version and Nintendo 3DSNintendo 3DS version version, there are no different groups of invincibility. All damage sources grant the same "type" of invincibility frame.

Invincibility frame length

Taking damage usually grants the player an invincibility frame of 0.67 seconds by default. This duration is halved if the amount of damage taken is 1, and is even lower in PvP. The Cross Necklace and its upgrades increase the length of the invincibility frame[a]. Various other effects also grant an invincibility frame, such as respawning, dodging, parrying, or dealing damage with a mount. See the following table for details.

Source Default[b] Cross Necklace[c]
Default invincibility frames
when taking damage[6]
0.67 seconds 1.33 seconds
If the damage taken is 1[6] 0.33 seconds 0.67 seconds
PvP damage[d] 0.13 seconds n/a
Respawning after dying in PvP[7] 5 seconds n/a
Respawning after dying
outside of PvP[7]
3 seconds n/a
When entering a world, or being
teleported back to spawn point
(e.g. via Magic Mirror)[7]
1 second n/a
Holy Protection Holy Protection(Desktop, Console and Mobile versions)[8] 1.33 seconds[e] 2 seconds[e]
Shadow Dodge Shadow Dodge(Old-gen console and 3DS versions)
Black Belt Black Belt(and its upgrades)[9]
Brain of Confusion Brain of Confusion(Dodge effect)[10]
Brand of the Inferno Brand of the Inferno(Desktop, Console and Mobile versions)(shield parry)[11] 0.5 seconds 1 second
Sergeant United Shield Sergeant United Shield(Desktop, Console and Mobile versions)(shield parry)
Strange Brew Strange Brew(Desktop, Console and Mobile versions)[12] Provide invincibility frames at
different chances when used:[e]

11%: 4 seconds
20%: 2 seconds
30%: 1 second
39%: None

n/a
Companion Cube Companion Cube(Desktop, Console and Mobile versions)(stab)[13] None n/a
Slime Mount Slime Mount(Desktop, Console, Old-gen console and Mobile versions)(on hit)[14] 0.1 seconds n/a
Winged Slime Mount Winged Slime Mount(Desktop, Console and Mobile versions)(on hit)
Unicorn Mount Unicorn Mount(Desktop, Console and Mobile versions)(on hit)[15]
Painted Horse Mount Painted Horse Mount(Desktop, Console and Mobile versions)(on hit)
Majestic Horse Mount Majestic Horse Mount(Desktop, Console and Mobile versions)(on hit)
Dark Horse Mount Dark Horse Mount(Desktop, Console and Mobile versions)(on hit)
Goat Mount Goat Mount(Desktop, Console and Mobile versions)(on hit)
Pirate Ship Mount Pirate Ship Mount(Desktop, Console and Mobile versions)(on hit)
Tree Mount Tree Mount(Desktop, Console and Mobile versions)(on hit)
Basilisk Mount Basilisk Mount(Desktop, Console and Mobile versions)(on hit)
Lawn Mower Lawn Mower(Desktop, Console and Mobile versions)[16]
Golf Cart Golf Cart(Desktop, Console and Mobile versions)(on hit) 0.2 seconds n/a
Shield of Cthulhu Shield of Cthulhu(Desktop, Console and Mobile versions)(dash hit)[17] 0.07 seconds n/a
Solar Flare armor Solar Flare armor(Desktop, Console and Mobile versions)(dash hit)

Enemy invincibility

"Piercing" redirects here. For the removed, Mobile version Mobile-exclusive modifier, see Modifiers § History.
See also: Introduction to enemy invincibility by Leinfors (under "Spoiler: 1.4.4 Balance Changes", then "Spoiler: Glossary")

Enemies also receive an invincibility frame, albeit only when hit by piercing or continuous attacks, i.e. attacks from any damage source that can strike an enemy and then remain able to cause damage afterwards. This includes player-inflicted damage sources like Meteor Shots, Unholy Arrows, the Vilethorn, or the Rainbow Gun, but also environmental hazards like traps or lava. The invincibility frame for enemies usually lasts 0.17 seconds.

Non-piercing attacks, such as bullets that only hit once, do not grant hit enemies an invincibility frame.

There are three different ways in which damage sources grant enemies invincibility:

  • Global invincibility: Invincibility from all damage
  • Static invincibility: Invincibility from damage from other projectiles of the same type
  • Local invincibility: Invincibility from damage from the one specific projectile

Global invincibility

Most piercing weapons in Terraria render enemies hit by them temporarily invulnerable to all sources of piercing damage, including other types of attacks, for the duration of the invincibility frame. It lasts 0.17 seconds by default, but is different for certain projectiles to allow faster or slower hitting. This was the original implementation of Terraria's invincibility frame system for enemies, so a large number of projectiles (especially older ones) use global invincibility.

Developers at Re-Logic are shifting away from global invincibility over time, as it has the unfortunate consequence of "blocking" the player from doing damage with different types of damage sources. Many projectiles that grant global invincibility were balanced around this limitation, doing more damage than they might otherwise if they were not.

On the Old-gen console version Old-gen console version and Nintendo 3DSNintendo 3DS version version,Verify global invincibility applies to almost all piercing projectiles. This can sharply limit the effects of other piercing weapons used against the same target, as well as weapons that fire multiple piercing projectiles such as the Poison Staff. Most minions are considered to have piercing attacks, which can also hinder the efficiency of piercing weapons used alongside them. This problem is remarkably present with the Spider Staff.

Static invincibility

Some piercing projectiles have been changed to only grant invincibility from damage inflicted by projectiles of that specific projectile type (i.e. projectiles with the same ID). Though repeated hits from the same type of piercing projectile during the invincibility frame will not be able to land, hits from any other type of piercing projectile will be able to deal damage. Most projectiles that grant static invincibility are balanced around this fact.

For example, firing a volley of Jester's Arrows (which grant static invincibility) with the Tsunami at an enemy will result in only one of the arrows hitting. When one of the arrows hits it, the enemy will become temporarily invincible from all Jester's Arrows, and the others will pass through without dealing damage. However, the enemy will still take damage from any other type of projectile during the Jester's Arrows' invincibility frame, such as a Nimbus Rod raindrop (projectile ID 239, different from the Jester's Arrow's ID 5) or a Raven minion (projectile ID 317).

Local invincibility

Finally, some piercing projectiles grant invincibility only from themselves, i.e. the exact specific projectile instance that inflicted the damage. All other piercing projectiles, even projectiles of the same type, can still deal damage during the invincibility frame. Therefore, firing large quantities of projectiles that grant local invincibility is not as inefficient as with static invincibility. As this type of invincibility was not usable for the majority of Terraria's history, almost all piercing weapons were not balanced around it.

For example, Deadly Sphere minions (which grant local invincibility) all operate on their own independent invincibility timers and will not conflict with each other at all. If one Deadly Sphere damages an enemy, another Deadly Sphere can still inflict damage during the invincibility frame granted by the first minion. At higher summon counts, Deadly Spheres are able to inflict significantly more damage than if they granted static or global invincibility.

Peculiarities

On the Desktop version Desktop version, Console version Console version, and Mobile version Mobile version, summons do not hinder other piercing weapons, but piercing weapons may still hinder the effectiveness of summons.

A few advanced weapons have special behavior:

Invincibility between non-player entities

Non-player entities will also get invincibility frames after taking contact damage. This invincibility frame does not interfere with invincibility frames from piercing attacks. The length of the invincibility is 0.33 seconds for the Eternia Crystal(Desktop, Console and Mobile versions), and 0.5 seconds for all other entities, including critters, town NPCs, and enemies.[18]

Only a few methods can grant this kind of invincibility frame, including:

  • Critters and town NPCs taking contact damage from enemies.
  • (Desktop, Console and Mobile versions) Eternia Crystal taking damage from enemies.
  • (Desktop, Console and Mobile versions) Bees attacking enemies.

History

  • Desktop 1.4.1.2: Damage from lava to players now has its own group of invincibility, separate from all other damage sources.
  • Desktop 1.3.0.5: Damaging tiles (Thorny bushes, Spikes, and Wooden Spikes) against players now have their own group of invincibility, separate from all other damage sources.

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.
  2. Information taken from the Desktop version Desktop 1.4.4.9 source code, method Update() in Terraria.GameContent.DontStarveDarknessDamageDealer.cs.
  3. Information taken from the Desktop version Desktop 1.4.4.9 source code, method ApplyTouchDamage() in Terraria.Player.cs.
  4. Information taken from the Desktop version Desktop 1.4.4.9 source code, method Update_NPCCollision() in Terraria.Player.cs.
  5. Information taken from the Desktop version Desktop 1.4.4.9 source code, method Update() in Terraria.Player.cs.
  6. 6.0 6.1 Information taken from the Desktop version Desktop 1.4.4.9 source code, method Hurt() in Terraria.Player.cs.
  7. 7.0 7.1 7.2 Information taken from the Desktop version Desktop 1.4.4.9 source code, method Spawn() in Terraria.Player.cs.
  8. Information taken from the Desktop version Desktop 1.4.4.9 source code, method ShadowDodge() in Terraria.Player.cs.
  9. Information taken from the Desktop version Desktop 1.4.4.9 source code, method NinjaDodge() in Terraria.Player.cs.
  10. Information taken from the Desktop version Desktop 1.4.4.9 source code, method BrainOfConfusionDodge() in Terraria.Player.cs.
  11. Information taken from the Desktop version Desktop 1.4.4.9 source code, method Update_NPCCollision() in Terraria.Player.cs.
  12. Information taken from the Desktop version Desktop 1.4.4.9 source code, method ApplyLifeAndOrMana() in Terraria.Player.cs.
  13. Information taken from the Desktop version Desktop 1.4.4.9 source code, method AI_067_FreakingPirates() in Terraria.Projectile.cs.
  14. Information taken from the Desktop version Desktop 1.4.4.9 source code, method JumpMovement() in Terraria.Player.cs.
  15. Information taken from the Desktop version Desktop 1.4.4.9 source code, method HorizontalMovement() in Terraria.Player.cs.
  16. Information taken from the Desktop version Desktop 1.4.4.9 source code, method MowTheLawn() in Terraria.Player.cs.
  17. Information taken from the Desktop version Desktop 1.4.4.9 source code, method DashMovement() in Terraria.Player.cs.
  18. Information taken from the Desktop version Desktop 1.4.4.9 source code, method BeHurtByOtherNPC() in Terraria.NPC.cs.
  1. The Cross Necklace and its upgrades do not stack with each other.
  2. Invincibility frames provided by default.
  3. Invincibility frames provided if the Cross Necklace or its upgrades is equipped. "n/a" means not affected by Cross Necklace.
  4. Includes both damage from another player and self-induced damage, e.g. explosives and (Old-gen console and 3DS versions) Exploding Bullets.
  5. 5.0 5.1 5.2 Provide all types of invincibility frames. Information taken from the Desktop version Desktop 1.4.4.9 source code, method SetImmuneTimeForAllTypes() in Terraria.Player.cs.