From 39028484f0747731b0e23d894f5977bfb263f93f Mon Sep 17 00:00:00 2001 From: Olink Date: Sun, 24 May 2020 16:36:13 -0400 Subject: [PATCH 1/4] Fixes #1890. Added support for two new invasions. --- CHANGELOG.md | 8 +++++--- TShockAPI/GetDataHandlers.cs | 28 +++++++++++++++++----------- 2 files changed, 22 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 57305fd8..7a888f9e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,10 +7,12 @@ This is the rolling changelog for TShock for Terraria. Use past tense when addin * Fixed /wind command. (@AxeelAnder) * Fixed NPC buff bouncer. (@AxeelAnder) * Fixed players are unable to remove an NPC. Change `byte NPCHomeChangeEventArgs.Homeless` to `HouseholdStatus NPCHomeChangeEventArgs.HouseholdStatus`. (@AxeelAnder) -* Fixed lava, wet, honey, and dry bombs; - and lava, wet, honey, and dry grenades; - and lava, wet, honey, and dry rockets; +* Fixed lava, wet, honey, and dry bombs; + and lava, wet, honey, and dry grenades; + and lava, wet, honey, and dry rockets; and lava, wet, honey, and dry mines. (@Olink) +* Fix Bloody Tear displaying the wrong text when used. (@Olink) + ## TShock 4.4.0 (Pre-release 7 (Entangled)) * Fixed bed spawn issues when trying to remove spawn point in SSC. (@Olink) diff --git a/TShockAPI/GetDataHandlers.cs b/TShockAPI/GetDataHandlers.cs index 0e426783..8076d30b 100644 --- a/TShockAPI/GetDataHandlers.cs +++ b/TShockAPI/GetDataHandlers.cs @@ -2850,38 +2850,44 @@ namespace TShockAPI string thing; switch (thingType) { + case -11: + thing = "applied advanced combat techniques"; + break; + case -10: + thing = "summoned a Blood Moon"; + break; case -8: - thing = "a Moon Lord"; + thing = "summoned a Moon Lord"; break; case -7: - thing = "a Martian invasion"; + thing = "summoned a Martian invasion"; break; case -6: - thing = "an eclipse"; + thing = "summoned an eclipse"; break; case -5: - thing = "a frost moon"; + thing = "summoned a frost moon"; break; case -4: - thing = "a pumpkin moon"; + thing = "summoned a pumpkin moon"; break; case -3: - thing = "the Pirates"; + thing = "summoned the Pirates"; break; case -2: - thing = "the Snow Legion"; + thing = "summoned the Snow Legion"; break; case -1: - thing = "a Goblin Invasion"; + thing = "summoned a Goblin Invasion"; break; default: - thing = String.Format("the {0}", npc.FullName); + thing = String.Format("summoned the {0}", npc.FullName); break; } if (TShock.Config.AnonymousBossInvasions) - TShock.Utils.SendLogs(string.Format("{0} summoned {1}!", args.Player.Name, thing), Color.PaleVioletRed, args.Player); + TShock.Utils.SendLogs(string.Format("{0} {1}!", args.Player.Name, thing), Color.PaleVioletRed, args.Player); else - TShock.Utils.Broadcast(String.Format("{0} summoned {1}!", args.Player.Name, thing), 175, 75, 255); + TShock.Utils.Broadcast(String.Format("{0} {1}!", args.Player.Name, thing), 175, 75, 255); return false; } From 35c103e0114cd3c0c4d473a7134913cd697c59ce Mon Sep 17 00:00:00 2001 From: Lucas Nicodemus Date: Sun, 24 May 2020 14:04:11 -0700 Subject: [PATCH 2/4] Fix bouncer debug message being incorrect --- TShockAPI/Bouncer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TShockAPI/Bouncer.cs b/TShockAPI/Bouncer.cs index e5600d90..28406095 100644 --- a/TShockAPI/Bouncer.cs +++ b/TShockAPI/Bouncer.cs @@ -528,7 +528,7 @@ namespace TShockAPI if (args.Player.HasPermission(Permissions.allowclientsideworldedit)) { - TShock.Log.ConsoleDebug("Bouncer / SendTileSquare rejected clientside world edit from {0}", args.Player.Name); + TShock.Log.ConsoleDebug("Bouncer / SendTileSquare accepted clientside world edit from {0}", args.Player.Name); args.Handled = false; return; } From 472b81e9f436a55a3c5a7b8e8989e0d3ae6c8bd9 Mon Sep 17 00:00:00 2001 From: Lucas Nicodemus Date: Sun, 24 May 2020 14:04:35 -0700 Subject: [PATCH 3/4] Increase default thresholds in config file Based on user testing of the new explosives from Olink, these really need to be higher to support the new lava/wet/dry/honey bombs/explosives. --- TShockAPI/ConfigFile.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TShockAPI/ConfigFile.cs b/TShockAPI/ConfigFile.cs index fb920732..bda097c3 100644 --- a/TShockAPI/ConfigFile.cs +++ b/TShockAPI/ConfigFile.cs @@ -275,11 +275,11 @@ namespace TShockAPI /// Disables a player and reverts their actions if this number of tile places is exceeded within 1 second. [Description("Disables a player and reverts their actions if this number of tile places is exceeded within 1 second.")] - public int TilePlaceThreshold = 20; + public int TilePlaceThreshold = 32; /// Disables a player if this number of liquid sets is exceeded within 1 second. [Description("Disables a player if this number of liquid sets is exceeded within 1 second.")] - public int TileLiquidThreshold = 15; + public int TileLiquidThreshold = 50; /// Disable a player if this number of projectiles is created within 1 second. [Description("Disable a player if this number of projectiles is created within 1 second.")] From d04f57d8649ffec277fcd10a88afd454e9da2a59 Mon Sep 17 00:00:00 2001 From: Olink Date: Sun, 24 May 2020 17:09:25 -0400 Subject: [PATCH 4/4] Fixes #1867 --- CHANGELOG.md | 1 + TShockAPI/GetDataHandlers.cs | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7a888f9e..46e2ce49 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ This is the rolling changelog for TShock for Terraria. Use past tense when addin and lava, wet, honey, and dry rockets; and lava, wet, honey, and dry mines. (@Olink) * Fix Bloody Tear displaying the wrong text when used. (@Olink) +* Fix the visibility toggle for the last two accessory slots. (@Olink) ## TShock 4.4.0 (Pre-release 7 (Entangled)) diff --git a/TShockAPI/GetDataHandlers.cs b/TShockAPI/GetDataHandlers.cs index 8076d30b..46e3502d 100644 --- a/TShockAPI/GetDataHandlers.cs +++ b/TShockAPI/GetDataHandlers.cs @@ -1923,11 +1923,14 @@ namespace TShockAPI args.Player.TPlayer.shirtColor = shirtColor; args.Player.TPlayer.underShirtColor = underShirtColor; args.Player.TPlayer.shoeColor = shoeColor; + //@Olink: If you need to change bool[10], please make sure you also update the for loops below to account for it. + //There are two arrays from terraria that we only have a single array for. You will need to make sure that you are looking + //at the correct terraria array (hideVisual or hideVisual2). args.Player.TPlayer.hideVisibleAccessory = new bool[10]; for (int i = 0; i < 8; i++) args.Player.TPlayer.hideVisibleAccessory[i] = hideVisual[i]; - for (int i = 8; i < 10; i++) - args.Player.TPlayer.hideVisibleAccessory[i] = hideVisual2[i]; + for (int i = 0; i < 2; i++) + args.Player.TPlayer.hideVisibleAccessory[i+8] = hideVisual2[i]; args.Player.TPlayer.hideMisc = hideMisc; args.Player.TPlayer.extraAccessory = extraSlot; NetMessage.SendData((int)PacketTypes.PlayerInfo, -1, args.Player.Index, NetworkText.FromLiteral(args.Player.Name), args.Player.Index);