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

◆ CheckLavaDeath()

void Terraria.Item.CheckLavaDeath ( int i)
inlineprivate

Definition at line 50280 of file Item.cs.

50281 {
50282 //IL_00d4: Unknown result type (might be due to invalid IL or missing references)
50283 if (type == 267)
50284 {
50285 if (Main.netMode == 1)
50286 {
50287 return;
50288 }
50289 int num = stack;
50290 active = false;
50291 type = 0;
50292 stack = 0;
50293 bool flag = false;
50294 for (int j = 0; j < 200; j++)
50295 {
50296 if (Main.npc[j].active && Main.npc[j].type == 22)
50297 {
50298 int num2 = -Main.npc[j].direction;
50299 if (Main.npc[j].IsNPCValidForBestiaryKillCredit())
50300 {
50301 Main.BestiaryTracker.Kills.RegisterKill(Main.npc[j]);
50302 }
50303 Main.npc[j].StrikeNPCNoInteraction(9999, 10f, -num2);
50304 num--;
50305 flag = true;
50306 if (Main.netMode == 2)
50307 {
50308 NetMessage.SendData(28, -1, -1, null, j, 9999f, 10f, -num2);
50309 }
50310 NPC.SpawnWOF(position);
50311 }
50312 }
50313 if (flag)
50314 {
50315 List<int> list = new List<int>();
50316 for (int k = 0; k < 200; k++)
50317 {
50318 if (num <= 0)
50319 {
50320 break;
50321 }
50322 NPC nPC = Main.npc[k];
50323 if (nPC.active && nPC.isLikeATownNPC)
50324 {
50325 list.Add(k);
50326 }
50327 }
50328 while (num > 0 && list.Count > 0)
50329 {
50330 int index = Main.rand.Next(list.Count);
50331 int num3 = list[index];
50332 list.RemoveAt(index);
50333 int num4 = -Main.npc[num3].direction;
50334 if (Main.npc[num3].IsNPCValidForBestiaryKillCredit())
50335 {
50336 Main.BestiaryTracker.Kills.RegisterKill(Main.npc[num3]);
50337 }
50338 Main.npc[num3].StrikeNPCNoInteraction(9999, 10f, -num4);
50339 num--;
50340 if (Main.netMode == 2)
50341 {
50342 NetMessage.SendData(28, -1, -1, null, num3, 9999f, 10f, -num4);
50343 }
50344 }
50345 }
50346 NetMessage.SendData(21, -1, -1, null, i);
50347 }
50348 else if (playerIndexTheItemIsReservedFor == Main.myPlayer && rare == 0 && type >= 0 && !ItemID.Sets.IsLavaImmuneRegardlessOfRarity[type])
50349 {
50350 active = false;
50351 type = 0;
50352 stack = 0;
50353 if (Main.netMode != 0)
50354 {
50355 NetMessage.SendData(21, -1, -1, null, i);
50356 }
50357 }
50358 }
Vector2 position
The position of this Entity in world coordinates.
Definition Entity.cs:28
bool active
If true, the Entity actually exists within the game world. Within the specific entity array,...
Definition Entity.cs:21
static bool[] IsLavaImmuneRegardlessOfRarity
If true for a given item type (F:Terraria.Item.type), then that item will not burn when dropped in la...
Definition ItemID.cs:99
int stack
The current stack of the item. F:Terraria.Item.maxStack indicates the max possible stack.
Definition Item.cs:396
int rare
Indicates the rarity of an item. Assign to a T:Terraria.ID.ItemRarityID value. Vanilla values range f...
Definition Item.cs:587
int playerIndexTheItemIsReservedFor
Definition Item.cs:578
int type
The Item ID of this item. The Item ID is a unique number assigned to each Item loaded into the game....
Definition Item.cs:345

References Terraria.Entity.active, Terraria.Main.BestiaryTracker, Terraria.ID.ItemID.Sets.IsLavaImmuneRegardlessOfRarity, Terraria.Main.myPlayer, Terraria.Main.netMode, Terraria.Main.npc, Terraria.Item.playerIndexTheItemIsReservedFor, Terraria.Entity.position, Terraria.Main.rand, Terraria.Item.rare, Terraria.NetMessage.SendData(), Terraria.NPC.SpawnWOF(), Terraria.Item.stack, and Terraria.Item.type.

Referenced by Terraria.Item.UpdateItem().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: