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

◆ SpawnBoss()

static void Terraria.NPC.SpawnBoss ( int spawnPositionX,
int spawnPositionY,
int Type,
int targetPlayerIndex )
inlinestatic

Definition at line 77584 of file NPC.cs.

77585 {
77586 int num = 200;
77587 if (Type == 127 && mechQueen != -1)
77588 {
77590 Main.npc[mechQueen].ai[3] = mechQueen;
77591 }
77592 else
77593 {
77595 }
77596 if (num == 200)
77597 {
77598 return;
77599 }
77600 Main.npc[num].target = targetPlayerIndex;
77601 Main.npc[num].timeLeft *= 20;
77602 string typeName = Main.npc[num].TypeName;
77603 if (Main.netMode == 2 && num < 200)
77604 {
77605 NetMessage.SendData(23, -1, -1, null, num);
77606 }
77607 if (Type == 134 || Type == 127 || Type == 126 || Type == 125)
77608 {
77610 }
77611 if (Type == 127 && mechQueen == num)
77612 {
77613 if (Main.netMode == 0)
77614 {
77615 Main.NewText(Lang.misc[107].Value, 175, 75);
77616 }
77617 else if (Main.netMode == 2)
77618 {
77619 ChatHelper.BroadcastChatMessage(Lang.misc[107].ToNetworkText(), new Color(175, 75, 255));
77620 }
77621 return;
77622 }
77623 switch (Type)
77624 {
77625 case 125:
77626 if (Main.netMode == 0)
77627 {
77628 Main.NewText(Lang.misc[48].Value, 175, 75);
77629 }
77630 else if (Main.netMode == 2)
77631 {
77632 ChatHelper.BroadcastChatMessage(Lang.misc[48].ToNetworkText(), new Color(175, 75, 255));
77633 }
77634 return;
77635 case 50:
77636 case 82:
77637 case 126:
77638 case 316:
77639 case 398:
77640 case 551:
77641 case 662:
77642 return;
77643 }
77644 if (Main.netMode == 0)
77645 {
77646 Main.NewText(Language.GetTextValue("Announcement.HasAwoken", typeName), 175, 75);
77647 }
77648 else if (Main.netMode == 2)
77649 {
77650 ChatHelper.BroadcastChatMessage(NetworkText.FromKey("Announcement.HasAwoken", Main.npc[num].GetTypeNetName()), new Color(175, 75, 255));
77651 }
77652 }
static void BroadcastChatMessage(NetworkText text, Color color, int excludedPlayer=-1)
Definition ChatHelper.cs:46
static string GetTextValue(string key)
Definition Language.cs:15
static NetworkText FromKey(string key, params object[] substitutions)
static int NewNPC(IEntitySource source, int X, int Y, int Type, int Start=0, float ai0=0f, float ai1=0f, float ai2=0f, float ai3=0f, int Target=255)
Definition NPC.cs:77654
static IEntitySource GetBossSpawnSource(int targetPlayerIndex)
Definition NPC.cs:77579
static int mechQueen
Definition NPC.cs:581

References Terraria.Chat.ChatHelper.BroadcastChatMessage(), Terraria.GameContent.Achievements.AchievementsHelper.CheckMechaMayhem(), Terraria.Localization.NetworkText.FromKey(), Terraria.Localization.Language.GetTextValue(), Terraria.Lang.misc, Terraria.Main.netMode, Terraria.Main.NewText(), Terraria.Main.npc, and Terraria.NetMessage.SendData().

Referenced by Terraria.NPC.DoDeathEvents().