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

◆ BecomeImmuneTo()

void Terraria.NPC.BecomeImmuneTo ( int buffType)
inline

Adjusts F:Terraria.NPC.buffImmune to make this NPC immune to the provided buff as well as all other buffs that inherit the immunity of that buff (via F:Terraria.ID.BuffID.Sets.GrantImmunityWith). This method can be followed by M:Terraria.NPC.ClearImmuneToBuffs(System.Boolean@) if the NPC should clear any buff it currently has that it is now immune to.

Parameters
buffType

Definition at line 112675 of file NPC.cs.

112676 {
112677 buffImmune[buffType] = true;
112678 for (int i = 0; i < BuffID.Sets.GrantImmunityWith.Length; i++)
112679 {
112680 if (BuffID.Sets.GrantImmunityWith[i].Contains(buffType))
112681 {
112682 buffImmune[i] = true;
112683 }
112684 }
112685 }
static List< int >[] GrantImmunityWith
An NPC will automatically become immune (F:Terraria.NPC.buffImmune) to the indexed buff type if it is...
Definition BuffID.cs:102
bool[] buffImmune
Contains the NPC buff immunities for this NPC. The default values in this array are populated from F:...
Definition NPC.cs:656
int[] buffType
Definition NPC.cs:649

References Terraria.ID.BuffID.Sets.GrantImmunityWith.