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

◆ ApplyToNPC()

void Terraria.DataStructures.NPCDebuffImmunityData.ApplyToNPC ( NPC npc)
inline

Definition at line 13 of file NPCDebuffImmunityData.cs.

14 {
16 {
17 for (int i = 1; i < BuffID.Count; i++)
18 {
19 bool flag = BuffID.Sets.IsAnNPCWhipDebuff[i];
20 bool flag2 = false;
21 flag2 |= flag && ImmuneToWhips;
22 flag2 |= !flag && ImmuneToAllBuffsThatAreNotWhips;
23 npc.buffImmune[i] = flag2;
24 }
25 }
26 if (SpecificallyImmuneTo != null)
27 {
28 for (int j = 0; j < SpecificallyImmuneTo.Length; j++)
29 {
30 int num = SpecificallyImmuneTo[j];
31 npc.buffImmune[num] = true;
32 }
33 }
34 }
static bool[] IsAnNPCWhipDebuff
Definition BuffID.cs:22
static readonly int Count
Definition BuffID.cs:1069

References Terraria.NPC.buffImmune, Terraria.ID.BuffID.Count, Terraria.DataStructures.NPCDebuffImmunityData.ImmuneToAllBuffsThatAreNotWhips, Terraria.DataStructures.NPCDebuffImmunityData.ImmuneToWhips, Terraria.ID.BuffID.Sets.IsAnNPCWhipDebuff, and Terraria.DataStructures.NPCDebuffImmunityData.SpecificallyImmuneTo.