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

◆ ItemCheck_UseEventItems()

void Terraria.Player.ItemCheck_UseEventItems ( Item sItem)
inlineprivate

Definition at line 41731 of file Player.cs.

41732 {
41733 if (ItemTimeIsZero && itemAnimation > 0 && sItem.type == 361 && Main.CanStartInvasion(1, ignoreDelay: true))
41734 {
41736 SoundEngine.PlaySound(15, (int)position.X, (int)position.Y, 0);
41737 if (Main.netMode != 1)
41738 {
41739 if (Main.invasionType == 0)
41740 {
41741 Main.invasionDelay = 0;
41742 Main.StartInvasion();
41743 }
41744 }
41745 else
41746 {
41747 NetMessage.SendData(61, -1, -1, null, whoAmI, -1f);
41748 }
41749 }
41750 if (ItemTimeIsZero && itemAnimation > 0 && sItem.type == 602 && Main.CanStartInvasion(2, ignoreDelay: true))
41751 {
41753 SoundEngine.PlaySound(15, (int)position.X, (int)position.Y, 0);
41754 if (Main.netMode != 1)
41755 {
41756 if (Main.invasionType == 0)
41757 {
41758 Main.invasionDelay = 0;
41759 Main.StartInvasion(2);
41760 }
41761 }
41762 else
41763 {
41764 NetMessage.SendData(61, -1, -1, null, whoAmI, -2f);
41765 }
41766 }
41767 if (ItemTimeIsZero && itemAnimation > 0 && sItem.type == 1315 && Main.CanStartInvasion(3, ignoreDelay: true))
41768 {
41770 SoundEngine.PlaySound(15, (int)position.X, (int)position.Y, 0);
41771 if (Main.netMode != 1)
41772 {
41773 if (Main.invasionType == 0)
41774 {
41775 Main.invasionDelay = 0;
41776 Main.StartInvasion(3);
41777 }
41778 }
41779 else
41780 {
41781 NetMessage.SendData(61, -1, -1, null, whoAmI, -3f);
41782 }
41783 }
41784 if (ItemTimeIsZero && itemAnimation > 0 && sItem.type == 1844 && !Main.dayTime && !Main.pumpkinMoon && !Main.snowMoon && !DD2Event.Ongoing)
41785 {
41787 SoundEngine.PlaySound(15, (int)position.X, (int)position.Y, 0);
41788 if (Main.netMode != 1)
41789 {
41790 Main.NewText(Lang.misc[31].Value, 50, byte.MaxValue, 130);
41791 Main.startPumpkinMoon();
41792 }
41793 else
41794 {
41795 NetMessage.SendData(61, -1, -1, null, whoAmI, -4f);
41796 }
41797 }
41798 if (ItemTimeIsZero && itemAnimation > 0 && sItem.type == 2767 && Main.dayTime && !Main.eclipse)
41799 {
41800 SoundEngine.PlaySound(15, (int)position.X, (int)position.Y, 0);
41802 if (Main.netMode == 0)
41803 {
41804 Main.eclipse = true;
41805 if (Main.remixWorld)
41806 {
41807 Main.NewText(Lang.misc[106].Value, 50, byte.MaxValue, 130);
41808 }
41809 else
41810 {
41811 Main.NewText(Lang.misc[20].Value, 50, byte.MaxValue, 130);
41812 }
41813 }
41814 else
41815 {
41816 NetMessage.SendData(61, -1, -1, null, whoAmI, -6f);
41817 }
41818 }
41819 if (ItemTimeIsZero && itemAnimation > 0 && sItem.type == 4271 && !Main.dayTime && !Main.bloodMoon)
41820 {
41821 SoundEngine.PlaySound(15, (int)position.X, (int)position.Y, 0);
41823 if (Main.netMode == 0)
41824 {
41826 Main.bloodMoon = true;
41827 if (Main.GetMoonPhase() == MoonPhase.Empty)
41828 {
41829 Main.moonPhase = 5;
41830 }
41831 Main.NewText(Lang.misc[8].Value, 50, byte.MaxValue, 130);
41832 }
41833 else
41834 {
41835 NetMessage.SendData(61, -1, -1, null, whoAmI, -10f);
41836 }
41837 }
41838 if (ItemTimeIsZero && itemAnimation > 0 && sItem.type == 3601 && NPC.downedGolemBoss && Main.hardMode && !NPC.AnyDanger() && !NPC.AnyoneNearCultists())
41839 {
41840 SoundEngine.PlaySound(15, (int)position.X, (int)position.Y, 0);
41842 if (Main.netMode == 0)
41843 {
41844 WorldGen.StartImpendingDoom(720);
41845 }
41846 else
41847 {
41848 NetMessage.SendData(61, -1, -1, null, whoAmI, -8f);
41849 }
41850 }
41851 if (ItemTimeIsZero && itemAnimation > 0 && sItem.type == 1958 && !Main.dayTime && !Main.pumpkinMoon && !Main.snowMoon && !DD2Event.Ongoing)
41852 {
41854 SoundEngine.PlaySound(15, (int)position.X, (int)position.Y, 0);
41855 if (Main.netMode != 1)
41856 {
41857 Main.NewText(Lang.misc[34].Value, 50, byte.MaxValue, 130);
41858 Main.startSnowMoon();
41859 }
41860 else
41861 {
41862 NetMessage.SendData(61, -1, -1, null, whoAmI, -5f);
41863 }
41864 }
41865 }
static void PlaySound(int type, Vector2 position, int style=1)
Vector2 position
Definition Entity.cs:14
void ApplyItemTime(Item sItem)
Definition Player.cs:3752
bool ItemTimeIsZero
Definition Player.cs:3525

References Terraria.NPC.AnyDanger(), Terraria.NPC.AnyoneNearCultists(), Terraria.Main.bloodMoon, Terraria.Main.CanStartInvasion(), Terraria.Main.dayTime, Terraria.NPC.downedGolemBoss, Terraria.Main.eclipse, Terraria.Main.GetMoonPhase(), Terraria.Main.hardMode, Terraria.Main.invasionType, Terraria.Lang.misc, Terraria.Main.netMode, Terraria.Main.NewText(), Terraria.GameContent.Achievements.AchievementsHelper.NotifyProgressionEvent(), Terraria.GameContent.Events.DD2Event.Ongoing, Terraria.Audio.SoundEngine.PlaySound(), Terraria.Main.pumpkinMoon, Terraria.Main.remixWorld, Terraria.NetMessage.SendData(), Terraria.Main.snowMoon, Terraria.WorldGen.StartImpendingDoom(), Terraria.Main.StartInvasion(), Terraria.Main.startPumpkinMoon(), and Terraria.Main.startSnowMoon().