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

◆ ItemCheck_UseBossSpawners()

void Terraria.Player.ItemCheck_UseBossSpawners ( int onWhichPlayer,
Item sItem )
inlineprivate

Definition at line 41562 of file Player.cs.

41563 {
41564 if (!ItemTimeIsZero || itemAnimation <= 0 || (sItem.type != 43 && sItem.type != 70 && sItem.type != 544 && sItem.type != 556 && sItem.type != 557 && sItem.type != 560 && sItem.type != 1133 && sItem.type != 1331 && sItem.type != 4988 && sItem.type != 5120 && sItem.type != 5334) || !SummonItemCheck(sItem))
41565 {
41566 return;
41567 }
41568 if (sItem.type == 560)
41569 {
41571 SoundEngine.PlaySound(15, (int)position.X, (int)position.Y, 0);
41572 if (Main.netMode != 1)
41573 {
41574 NPC.SpawnOnPlayer(onWhichPlayer, 50);
41575 }
41576 else
41577 {
41578 NetMessage.SendData(61, -1, -1, null, whoAmI, 50f);
41579 }
41580 }
41581 else if (sItem.type == 43)
41582 {
41583 if (!Main.IsItDay())
41584 {
41586 SoundEngine.PlaySound(15, (int)position.X, (int)position.Y, 0);
41587 if (Main.netMode != 1)
41588 {
41589 NPC.SpawnOnPlayer(onWhichPlayer, 4);
41590 }
41591 else
41592 {
41593 NetMessage.SendData(61, -1, -1, null, whoAmI, 4f);
41594 }
41595 }
41596 }
41597 else if (sItem.type == 70)
41598 {
41599 if (ZoneCorrupt)
41600 {
41602 SoundEngine.PlaySound(15, (int)position.X, (int)position.Y, 0);
41603 if (Main.netMode != 1)
41604 {
41605 NPC.SpawnOnPlayer(onWhichPlayer, 13);
41606 }
41607 else
41608 {
41609 NetMessage.SendData(61, -1, -1, null, whoAmI, 13f);
41610 }
41611 }
41612 }
41613 else if (sItem.type == 544)
41614 {
41615 if (!Main.IsItDay() && sItem.Variant != ItemVariants.DisabledBossSummonVariant)
41616 {
41618 SoundEngine.PlaySound(15, (int)position.X, (int)position.Y, 0);
41619 if (Main.netMode != 1)
41620 {
41621 NPC.SpawnOnPlayer(onWhichPlayer, 125);
41622 NPC.SpawnOnPlayer(onWhichPlayer, 126);
41623 }
41624 else
41625 {
41626 NetMessage.SendData(61, -1, -1, null, whoAmI, 125f);
41627 NetMessage.SendData(61, -1, -1, null, whoAmI, 126f);
41628 }
41629 }
41630 }
41631 else if (sItem.type == 556)
41632 {
41633 if (!Main.IsItDay() && sItem.Variant != ItemVariants.DisabledBossSummonVariant)
41634 {
41636 SoundEngine.PlaySound(15, (int)position.X, (int)position.Y, 0);
41637 if (Main.netMode != 1)
41638 {
41639 NPC.SpawnOnPlayer(onWhichPlayer, 134);
41640 }
41641 else
41642 {
41643 NetMessage.SendData(61, -1, -1, null, whoAmI, 134f);
41644 }
41645 }
41646 }
41647 else if (sItem.type == 557)
41648 {
41649 if (!Main.IsItDay() && sItem.Variant != ItemVariants.DisabledBossSummonVariant)
41650 {
41652 SoundEngine.PlaySound(15, (int)position.X, (int)position.Y, 0);
41653 if (Main.netMode != 1)
41654 {
41655 NPC.SpawnOnPlayer(onWhichPlayer, 127);
41656 }
41657 else
41658 {
41659 NetMessage.SendData(61, -1, -1, null, whoAmI, 127f);
41660 }
41661 }
41662 }
41663 else if (sItem.type == 5334)
41664 {
41665 if (NPC.SpawnMechQueen(whoAmI))
41666 {
41668 SoundEngine.PlaySound(15, (int)position.X, (int)position.Y, 0);
41669 }
41670 }
41671 else if (sItem.type == 1133)
41672 {
41675 if (Main.netMode != 1)
41676 {
41677 NPC.SpawnOnPlayer(onWhichPlayer, 222);
41678 }
41679 else
41680 {
41681 NetMessage.SendData(61, -1, -1, null, whoAmI, 222f);
41682 }
41683 }
41684 else if (sItem.type == 1331)
41685 {
41686 if (ZoneCrimson)
41687 {
41689 SoundEngine.PlaySound(15, (int)position.X, (int)position.Y, 0);
41690 if (Main.netMode != 1)
41691 {
41692 NPC.SpawnOnPlayer(onWhichPlayer, 266);
41693 }
41694 else
41695 {
41696 NetMessage.SendData(61, -1, -1, null, whoAmI, 266f);
41697 }
41698 }
41699 }
41700 else if (sItem.type == 4988)
41701 {
41702 if (ZoneHallow)
41703 {
41705 SoundEngine.PlaySound(15, (int)position.X, (int)position.Y, 0);
41706 if (Main.netMode != 1)
41707 {
41708 NPC.SpawnOnPlayer(onWhichPlayer, 657);
41709 }
41710 else
41711 {
41712 NetMessage.SendData(61, -1, -1, null, whoAmI, 657f);
41713 }
41714 }
41715 }
41716 else if (sItem.type == 5120 && ZoneSnow)
41717 {
41719 SoundEngine.PlaySound(15, (int)position.X, (int)position.Y, 0);
41720 if (Main.netMode != 1)
41721 {
41722 NPC.SpawnOnPlayer(onWhichPlayer, 668);
41723 }
41724 else
41725 {
41726 NetMessage.SendData(61, -1, -1, null, whoAmI, 668f);
41727 }
41728 }
41729 }
static void PlaySound(int type, Vector2 position, int style=1)
Vector2 position
Definition Entity.cs:14
static readonly LegacySoundStyle Item173
Definition SoundID.cs:760
void ApplyItemTime(Item sItem)
Definition Player.cs:3752
bool ItemTimeIsZero
Definition Player.cs:3525
bool SummonItemCheck(Item item)
Definition Player.cs:40228

References Terraria.GameContent.Items.ItemVariants.DisabledBossSummonVariant, Terraria.Main.IsItDay(), Terraria.ID.SoundID.Item173, Terraria.Main.netMode, Terraria.Audio.SoundEngine.PlaySound(), Terraria.NetMessage.SendData(), Terraria.NPC.SpawnMechQueen(), and Terraria.NPC.SpawnOnPlayer().