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

◆ DespawnIfMeetingConditions()

void Terraria.Item.DespawnIfMeetingConditions ( int i)
inlineprivate

Definition at line 48552 of file Item.cs.

48553 {
48554 if (type == 75 && Main.dayTime && !Main.remixWorld && !shimmered && !beingGrabbed)
48555 {
48556 for (int j = 0; j < 10; j++)
48557 {
48558 Dust.NewDust(position, width, height, 15, velocity.X, velocity.Y, 150, default(Color), 1.2f);
48559 }
48560 for (int k = 0; k < 3; k++)
48561 {
48562 Gore.NewGore(position, new Vector2(velocity.X, velocity.Y), Main.rand.Next(16, 18));
48563 }
48564 active = false;
48565 type = 0;
48566 stack = 0;
48567 if (Main.netMode == 2)
48568 {
48569 NetMessage.SendData(21, -1, -1, null, i);
48570 }
48571 }
48572 if (type == 4143 && timeSinceItemSpawned > 300)
48573 {
48574 for (int l = 0; l < 20; l++)
48575 {
48576 Dust.NewDust(position, width, height, 15, velocity.X, velocity.Y, 150, Color.Lerp(Color.CornflowerBlue, Color.Indigo, Main.rand.NextFloat()), 1.2f);
48577 }
48578 active = false;
48579 type = 0;
48580 stack = 0;
48581 if (Main.netMode == 2)
48582 {
48583 NetMessage.SendData(21, -1, -1, null, i);
48584 }
48585 }
48586 if (type == 3822 && !DD2Event.Ongoing)
48587 {
48588 int num = Main.rand.Next(18, 24);
48589 for (int m = 0; m < num; m++)
48590 {
48591 int num2 = Dust.NewDust(base.Center, 0, 0, 61, 0f, 0f, 0, default(Color), 1.7f);
48592 Main.dust[num2].velocity *= 8f;
48593 Main.dust[num2].velocity.Y -= 1f;
48594 Main.dust[num2].position = Vector2.Lerp(Main.dust[num2].position, base.Center, 0.5f);
48595 Main.dust[num2].noGravity = true;
48596 Main.dust[num2].noLight = true;
48597 }
48598 active = false;
48599 type = 0;
48600 stack = 0;
48601 if (Main.netMode == 2)
48602 {
48603 NetMessage.SendData(21, -1, -1, null, i);
48604 }
48605 }
48606 }
Vector2 velocity
Definition Entity.cs:16
Vector2 position
Definition Entity.cs:14
int stack
Definition Item.cs:149
bool shimmered
Definition Item.cs:322
bool beingGrabbed
Definition Item.cs:85
int timeSinceItemSpawned
Definition Item.cs:87
static Color CornflowerBlue
Definition Color.cs:112
static Color Lerp(Color value1, Color value2, float amount)
Definition Color.cs:491
static Vector2 Lerp(Vector2 value1, Vector2 value2, float amount)
Definition Vector2.cs:227

References Terraria.Entity.active, Terraria.Item.beingGrabbed, Microsoft.Xna.Framework.Color.CornflowerBlue, Terraria.Main.dayTime, Terraria.Main.dust, Terraria.Entity.height, Microsoft.Xna.Framework.Color.Indigo, Microsoft.Xna.Framework.Color.Lerp(), Microsoft.Xna.Framework.Vector2.Lerp(), Terraria.Main.netMode, Terraria.Dust.NewDust(), Terraria.Gore.NewGore(), Terraria.GameContent.Events.DD2Event.Ongoing, Terraria.Entity.position, Terraria.Main.rand, Terraria.Main.remixWorld, Terraria.NetMessage.SendData(), Terraria.Item.shimmered, Terraria.Item.stack, Terraria.Item.timeSinceItemSpawned, Terraria.Item.type, Terraria.Entity.velocity, Terraria.Entity.width, Microsoft.Xna.Framework.Vector2.X, and Microsoft.Xna.Framework.Vector2.Y.

Referenced by Terraria.Item.UpdateItem().