An explanation of enemy immunity frames

qwerty3.14

Terrarian
Terraria's immunity system is a bit confusing, this guide hopes to explain it. There are different ways enemies handle immunity.


Non Piercing Projectile:
Projectiles that don't pierce do not interact with immunity frames in any way. They don't create immunity frames and they cannot be blocked by immunity frames.

Global Immunity:
Most piercing projectiles in this game cause what have been called global immunity frames. They aren't called that in the source code but referring them to global helps to emphasize that when an enemy has global immunity frames it blocks all piercing projectiles or swords the player owns.

This immune system works per player so you never have to worry about your attacks blocking your friend from attacking the same enemy.

When a global immunity projectile hits an enemy it causes a set amount of immunity frames; this amount changes based on the projectile although it's usually 10.
20211001065346_1.jpg

When the shotbow fires 3 arrows at once, the first jester's arrow to hit causes 10 global immunity frames which prevents the other arrows from hitting.

Swung weapons like broadswords also cause global immunity frames. When ever I say 'sword' from now on I mean any item that uses the basic broadsword animation. Anything that looks like a 'sword' but doesn't use this animation is actually a projectile.

Swords cause immunity frames equal to the swing time remaining. This effectively locks swords to 1 hit per swing per enemy. This also causes some weird behavior when swords interact with piercing projectiles...


20211001061446_1.jpg

When this close to an enemy terra blade causes more immunity frames which causes it to prevent the terra beam from hitting.

20211001061517_1.jpg

Stand just a bit further away and now the blade won't hit until the end of its animation, cuasing less immunity frames. This causes the beam to be much less likely to be blocked by the blade substantially increasing dps.

gyazo.com

You might be wondering. "If swords cause immunity frame equal to their immune time then why are minions (a projectile) still able to hit while facetanking where the sword is hitting the moment the animation starts."

Turns out due to the order at which the game processes things piercing projectiles(the blade minion) processed right after npcs(the super dummy), so the frame the npc loses its immunity frames piercing projectiles are able to land a hit before the sword(the hammer) lands a hit on the next frame.

Piercing Local Immunity:

Projectiles that use local immunity won't cause global immunity frames on hit. Instead immunity frames are stored on the projectile. Remember how the shotbow with jester's arrows example only 1 arrow was hitting. Well projectiles that use local immunity don't have this issue.

Like with global immunity different projectile cause different amounts of immunity frames. Many local immunity projectiles cause -1 local immunity frames meaning that the projectile can never hit the same enemy twice.

There isn't much jank with piercing local immunity projectiles. The system really fixes most of the issues with global immunity.

Projectiles that use local immunity include: shortswords, Heavy Flails, All piercing bullets, luminite arrows, nebula arcanum, nightglow, lunar flare, sanguine staff, blade staff, stardust cell staff, terraprisma, solar eruption (also causes global immunity frames for some reason), daybreak.



Static Immunity:
Static immunity acts per static index. This usually means projectiles of the same type will share immunity but not interfere with other projectile types. Sometimes multiple projectile types will share the same static index, like with retnimini minion lasers and spazmini minions.

This is usually given to minions so they don't block your primary weapon. Although minions will still block each other if they use static immunity instead of local.

Examples include: Ghastly glaive, flinx minion, vampire frog, slime minion, imp minion, spider minions, mini twins minions, deadly sphere, and stardust dragon(technically it uses local immunity but in game it acts more like static).


Non Piercing Local Immunity (Has been patched):
A recent hotfix patch has fixed this exploit, the following is only applicable on older versions of terraria.


When a projectile with local immunity hits something it sets global immunity frames to 0 to make sure it doesn't cause global immunity frames. This usually isn't an issue since in order for a piercing projectile to hit something the global immunity frames of the npc would have to already be 0. So as long as all local immunity projectiles are piercing there shouldn't be any issues...

When obviously there are a few projectiles that don't pierce and have local immunity that's why I'm bringing this up: Stellar tune, Betsy wrath, and raven minions.

Whenever one of those projectiles hits an enemy it resets global immunity to 0. Since most global immunity projectiles are primary weapons raven minions are best able to take advantage of this.

Yoyos and Charged Blaster Cannon's deathray have the best synergy with the raven staff as they will be colliding with the enemy's hitbox constantly

20211001131928_1.jpg

Yoyo only
20211001132034_2.jpg

6 Ravens no yoyo.

So when combining them together we should expect around 1867 + 1570 = 3437dps
...

20211001132151_1.jpg

Instead we got 5904dps, that's quite a bit more than just the tow on their own combined.
Every time a raven hits empress it causes the yoyos' immunity frames to reset causing it to attack much faster.





20211001133507_1.jpg

Charged Blaster Cannon also has an insane synergy.

20211001134630_1.jpg

Rainbow gun is really the only lingering weapon that causes global immunity. So it's really the only weapon that can synergise with stellar tune and betsy's wrath. Stellar tune's synergy is much stronger than betsy due to its higher fire rate.
 
Last edited:
Back
Top Bottom