Otherwise, the NPC is struck and does not receive any immunity frames. If the NPC has immunity frames, the projectile does not strike. -2: The NPC's immunity frames are unaffected by the projectile.Summary of the behavior of localNPCHitCooldown values: This also lends credence to the phrase "ignores iframes", because the projectile literally ignores the immunity frames of the NPC it is hitting. When localNPCHitCooldown is set to -1, the projectile sets npc.immune to zero on hit, ensuring that it always hits no matter what.
![all references in calamity mod terraria all references in calamity mod terraria](https://www.minecraftskins.com/uploads/preview-skins/2018/12/09/terraria-calamity-mod---draedon-12645903.png)
This means that the NPC can only be hit by a projectile with negative localNPCHitCooldown once, no matter how long the projectile lasts. Instead, the NPC that was struck by the projectile becomes permanently immune to that specific projectile forever.
![all references in calamity mod terraria all references in calamity mod terraria](https://i3.ytimg.com/vi/VHlZ-jAkJj0/hqdefault.jpg)
In both of these cases, no internal timer is set. LocalNPCHitCooldown also has two special values, -2 and -1. Any other projectiles - even piercing ones - can still hit the NPC while the timer is running, which is what gives the impression that the projectile "ignores iframes". However, the timer only applies to the specific projectile which started it. Since Terraria runs at 60 tick per second, a value of 60 for localNPCHitCooldown would limit the projectile to striking once per second. The length of the timer is determined by the variable localNPCHitCooldown. Once the timer is up, the projectile can strike that NPC again. When the projectile strikes an NPC, instead of setting the NPC's npc.immune, it sets up a timer on the projectile which stops that specific projectile from striking the NPC for a certain number of frames. If a projectile sets usesLocalNPCImmunity to true, its interaction with immunity frames fundamentally changes. UsesLocalNPCImmunity This section primarily describes vanilla Terraria behavior.
![all references in calamity mod terraria all references in calamity mod terraria](https://progameguides.com/wp-content/uploads/2021/10/Featured-Terraria-What-is-Master-Mode-in-Terraria-450x450.jpg)
Terraria provides three mechanisms by which projectiles may ignore, bypass or reduce NPC immunity frames. Only certain effects can affect immunity frames given by an attack with cooldownSlot set to 0 or 1, those effects being the Cross Necklace, the accessories which inherit its effects, and any effects which add to the player's on-hit immunity frames all other items have no effect.Ī table of all enemies and projectiles in the Calamity Mod that have cooldownSlot set to 0 or 1, thereby only preventing hits from sources with the same value and ignoring immuneTime modifications by any items except Cross Necklace (and its inheritors), is below: For instance, if the player is hit by a projectile with the variable set to 1, they can still be dealt damage by another projectile with the default value of -1 immediately after, but cannot be immediately hurt by another slot 1 projectile.
![all references in calamity mod terraria all references in calamity mod terraria](https://i.ytimg.com/vi/ZVHw5sbNOmw/maxresdefault.jpg)
However, if cooldownSlot is set to 0 or 1, then the player is given unique immunity frames that only protect against further damage from sources with the same cooldownSlot number. All damage sources have the variable set to -1 by default, which uses standard immuneTime that is affected by all immunity frame-affecting items. When anything hurts the player, they are given one of three different types of immunity frames, based on what the damage source sets the cooldownSlot variable to upon dealing the damage. You can also view the data on another page.ĬooldownSlot This section primarily describes vanilla Terraria behavior. This table requires JavaScript to be enabled and site tooltips to be turned on to be displayed. Additionally, effects which add immunity frames will affect the immunity frames of attacks with a cooldownSlot of 0 or 1, whereas effects which directly set their immunity frames will have no effect on such attacks.Ī table of all items that use this code, along with the corresponding immuneTime values is below: Effects which add immunity frames will stack with the Cross Necklace or other accessories which inherit that effect. There are several events and effects that directly set or add to a player's immuneTime instead of multiplying.