From af5eb4e80fc3831a37f56df5ab17a4d739d5f20f Mon Sep 17 00:00:00 2001 From: Zack Piispanen Date: Fri, 25 Oct 2013 09:03:43 -0400 Subject: [PATCH] Ignore Mourning Woods projectiles Added pumpkin command to start the pumpkin wave on the correct wave. --- TShockAPI/Commands.cs | 25 +++++++++++++++++++++++++ TShockAPI/GetDataHandlers.cs | 2 +- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/TShockAPI/Commands.cs b/TShockAPI/Commands.cs index ccbc6221..fffa62c8 100755 --- a/TShockAPI/Commands.cs +++ b/TShockAPI/Commands.cs @@ -354,6 +354,10 @@ namespace TShockAPI { HelpText = "Sets the spawn rate of NPCs." }); + add(new Command(Permissions.invade, PumpkinInvasion, "pumpkin") + { + HelpText = "Starts a Pumpkin Moon invasion at the specified wave." + }); #endregion #region TP Commands add(new Command(Permissions.home, Home, "home") @@ -1670,6 +1674,27 @@ namespace TShockAPI } } + private static void PumpkinInvasion(CommandArgs args) + { + int wave = 0; + if (args.Parameters.Count != 0) + int.TryParse(args.Parameters[0], out wave); + + Main.pumpkinMoon = true; + Main.bloodMoon = false; + NPC.waveKills = 0f; + NPC.waveCount = wave; + string text = "Pumpkin Invasion started at wave;" + wave; + if (Main.netMode == 0) + { + Main.NewText(text, 175, 75, 255, false); + return; + } + if (Main.netMode == 2) + { + NetMessage.SendData(25, -1, -1, text, 255, 175f, 75f, 255f, 0); + } + } private static void Hardmode(CommandArgs args) { if (Main.hardMode) diff --git a/TShockAPI/GetDataHandlers.cs b/TShockAPI/GetDataHandlers.cs index 84ffef70..3e3d3ca6 100755 --- a/TShockAPI/GetDataHandlers.cs +++ b/TShockAPI/GetDataHandlers.cs @@ -2397,7 +2397,7 @@ namespace TShockAPI bool hasPermission = !TShock.CheckProjectilePermission(args.Player, index, type); if (!TShock.Config.IgnoreProjUpdate && !hasPermission) { - if ((type == 100) || (type > 289 && type < 298)) + if ((type == 100) || (type > 289 && type < 298) || (type >= 325 && type <= 328)) { Log.Debug("Certain projectiles have been ignored for cheat detection."); }