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

◆ GetHurtByOtherNPCs()

void Terraria.NPC.GetHurtByOtherNPCs ( bool[] acceptableNPCIDs)
inlineprivate

Definition at line 89134 of file NPC.cs.

89135 {
89137 {
89138 return;
89139 }
89140 int specialHitSetter = 1;
89141 float damageMultiplier = 1f;
89142 if (immune[255] != 0)
89143 {
89144 return;
89145 }
89146 Rectangle hitbox = base.Hitbox;
89147 for (int i = 0; i < 200; i++)
89148 {
89149 NPC nPC = Main.npc[i];
89150 if (acceptableNPCIDs[nPC.type] && nPC.active && !nPC.friendly && nPC.damage > 0)
89151 {
89152 Rectangle npcRect = nPC.Hitbox;
89154 if (hitbox.Intersects(npcRect) && (type != 453 || !NPCID.Sets.Skeletons[nPC.type]) && nPC.type != 624)
89155 {
89157 break;
89158 }
89159 }
89160 }
89161 }
static bool[] Skeletons
Definition NPCID.cs:4238
int[] immune
Definition NPC.cs:441
bool immortal
Definition NPC.cs:261
bool dontTakeDamageFromHostiles
Definition NPC.cs:279
bool dontTakeDamage
Definition NPC.cs:527
int type
Definition NPC.cs:445
static void GetMeleeCollisionData(Rectangle victimHitbox, int enemyIndex, ref int specialHitSetter, ref float damageMultiplier, ref Rectangle npcRect)
Definition NPC.cs:91619
void BeHurtByOtherNPC(int npcIndex, NPC thatNPC)
Definition NPC.cs:89163

References Terraria.Main.npc, Terraria.ID.NPCID.Sets.Skeletons, and System.type.