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

◆ OpenShadowLockbox()

void Terraria.Player.OpenShadowLockbox ( int boxType)
inline

Definition at line 8555 of file Player.cs.

8556 {
8557 bool flag = true;
8559 while (flag)
8560 {
8561 flag = false;
8562 int type = Main.rand.NextFromList(new short[5] { 274, 220, 112, 218, 3019 });
8563 if (Main.remixWorld)
8564 {
8565 type = Main.rand.NextFromList(new short[5] { 274, 220, 683, 218, 3019 });
8566 }
8567 int number = Item.NewItem(itemSource_OpenItem, (int)position.X, (int)position.Y, width, height, type, 1, noBroadcast: false, -1);
8568 if (Main.netMode == 1)
8569 {
8570 NetMessage.SendData(21, -1, -1, null, number, 1f);
8571 }
8572 if (Main.rand.Next(5) == 0)
8573 {
8574 number = Item.NewItem(itemSource_OpenItem, (int)position.X, (int)position.Y, width, height, 5010, 1, noBroadcast: false, -1);
8575 if (Main.netMode == 1)
8576 {
8577 NetMessage.SendData(21, -1, -1, null, number, 1f);
8578 }
8579 }
8580 }
8581 }
Vector2 position
Definition Entity.cs:14
IEntitySource GetItemSource_OpenItem(int itemType)
Definition Player.cs:9277

References Terraria.Main.netMode, Terraria.Item.NewItem(), Terraria.Main.rand, Terraria.Main.remixWorld, Terraria.NetMessage.SendData(), and System.type.

Referenced by Terraria.UI.ItemSlot.TryOpenContainer().