TModLoader v1.4.4.9
TModLoader source code documentation
Loading...
Searching...
No Matches

◆ immune

int [] Terraria.NPC.immune = new int[256]

This determines if an NPC can be hit by a item or projectile owned by a particular player (it is an array, each slot corresponds to different players (whoAmI)). It is decremented towards 0 every update. Melee items set immune[Player.whoAmI] to Player.itemAnimation, which starts at item.useAnimation and decrements towards 0. Penetrating projectiles usually set immune to 10, while non-penetrating projectiles do not set immune. ExamplePiercingProjectile.csexplains more about options for npc and projectile immunity.

Definition at line 981 of file NPC.cs.

Referenced by Terraria.Cinematics.DSTFilm.CreateDeerclops(), Terraria.Cinematics.DD2Film.CreateDryad(), and Terraria.Cinematics.DD2Film.CreateOgre().