diff --git a/DisableMonsCoin/Commands.cs b/DisableMonsLoot/Commands.cs similarity index 99% rename from DisableMonsCoin/Commands.cs rename to DisableMonsLoot/Commands.cs index 05dd784a..7cf4f81c 100644 --- a/DisableMonsCoin/Commands.cs +++ b/DisableMonsLoot/Commands.cs @@ -1,7 +1,7 @@ using TShockAPI; using Microsoft.Xna.Framework; -namespace DisableMonsCoin +namespace DisableMonsLoot { public class Commands { diff --git a/DisableMonsCoin/Configuration.cs b/DisableMonsLoot/Configuration.cs similarity index 99% rename from DisableMonsCoin/Configuration.cs rename to DisableMonsLoot/Configuration.cs index a36eada9..4938effe 100644 --- a/DisableMonsCoin/Configuration.cs +++ b/DisableMonsLoot/Configuration.cs @@ -1,7 +1,7 @@ using Newtonsoft.Json; using TShockAPI; -namespace DisableMonsCoin +namespace DisableMonsLoot { internal class Configuration { diff --git a/DisableMonsCoin/DisableMonsCoin.csproj b/DisableMonsLoot/DisableMonsLoot.csproj similarity index 100% rename from DisableMonsCoin/DisableMonsCoin.csproj rename to DisableMonsLoot/DisableMonsLoot.csproj diff --git a/DisableMonsCoin/Plugin.cs b/DisableMonsLoot/Plugin.cs similarity index 97% rename from DisableMonsCoin/Plugin.cs rename to DisableMonsLoot/Plugin.cs index 7f73f3ee..391e0e1b 100644 --- a/DisableMonsCoin/Plugin.cs +++ b/DisableMonsLoot/Plugin.cs @@ -2,11 +2,11 @@ using TerrariaApi.Server; using TShockAPI; using TShockAPI.Hooks; -using static DisableMonsCoin.Configuration; -using static DisableMonsCoin.Commands; +using static DisableMonsLoot.Configuration; +using static DisableMonsLoot.Commands; -namespace DisableMonsCoin; +namespace DisableMonsLoot; [ApiVersion(2, 1)] public class Plugin : TerrariaPlugin diff --git a/DisableMonsCoin/README.md b/DisableMonsLoot/README.md similarity index 98% rename from DisableMonsCoin/README.md rename to DisableMonsLoot/README.md index 79f7b4ce..33c41b62 100644 --- a/DisableMonsCoin/README.md +++ b/DisableMonsLoot/README.md @@ -1,4 +1,4 @@ -# DisableMonsCoin 禁怪物掉落 +# DisableMonsLoot 禁怪物掉落 - 作者: 羽学 - 出处: [github](https://gitee.com/Crafty/bean-points) diff --git a/GoodNight/Commands.cs b/GoodNight/Commands.cs index 3440634d..d6913f39 100644 --- a/GoodNight/Commands.cs +++ b/GoodNight/Commands.cs @@ -2,6 +2,7 @@ using System.Globalization; using Terraria; using TShockAPI; +using static Org.BouncyCastle.Math.EC.ECCurve; namespace Goodnight { @@ -84,6 +85,17 @@ public static void GnCmd(CommandArgs args) } #endregion + #region 清理允许召唤表 + if (args.Parameters.Count == 1 && args.Parameters[0].ToLower() == "clear") + { + Goodnight.Config.NpcDead.Clear(); + Goodnight.KillCounters.Clear(); + args.Player.SendSuccessMessage($"已清理《允许召唤表》的怪物ID"); + Goodnight.Config.Write(); + return; + } + #endregion + #region 修改禁止怪物ID + 修改解禁怪物在线人数 if (args.Parameters.Count == 2) { @@ -258,6 +270,7 @@ private static void HelpCmd(TSPlayer player) "/gn kick —— 开启|关闭断连功能\n" + "/gn pos —— 开启|关闭召唤区\n" + "/gn all —— 开启|关闭召唤区需所有人在场\n" + + "/gn clear —— 清理《允许召唤表》\n" + "/gn boss 次数 —— 设置加入《允许召唤表》击杀要求次数\n" + "/gn reset ID —— 设置重置《允许召唤表》的怪物ID\n" + "/gn plr 人数 —— 设置无视《禁止怪物表》在线人数\n" + diff --git a/GoodNight/Goodnight.cs b/GoodNight/Goodnight.cs index 3620135a..267e41d5 100644 --- a/GoodNight/Goodnight.cs +++ b/GoodNight/Goodnight.cs @@ -13,7 +13,7 @@ public class Goodnight : TerrariaPlugin #region 变量与插件信息 public override string Name => "宵禁"; public override string Author => "Jonesn 羽学 少司命"; - public override Version Version => new Version(2, 7, 2); + public override Version Version => new Version(2, 7, 3); public override string Description => "设置服务器无法进入或禁止生成怪物的时段"; internal static Configuration Config; #endregion @@ -116,7 +116,7 @@ private void OnSpawn(NpcSpawnEventArgs args) { if (BcstSwitchOFF || (BcstDefault && BcstSwitch)) TShock.Utils.Broadcast( - $"【宵禁】当前[c/338AE1:服务器]存在 [c/FF3A4B:{PlayerCount}/{Config.MaxPlayers}]个玩家! \n" + + $"【宵禁】当前[c/338AE1:服务器]存在 [c/FF3A4B:{PlayerCount}]/{Config.MaxPlayers}个玩家! \n" + $"检测到{RegionInfo}已在【[c/E2FA76:{Config.RegionName}]】\n" + $"允许召唤以下怪物:\n" + $"[c/6EABE9:{NpcDeadInfo}]", Color.Aquamarine); @@ -125,7 +125,7 @@ private void OnSpawn(NpcSpawnEventArgs args) { if (BcstSwitchOFF || (BcstDefault && BcstSwitch)) TShock.Utils.Broadcast( - $"【宵禁】当前[c/338AE1:服务器]存在 [c/FF3A4B:{PlayerCount}/{Config.MaxPlayers}]个玩家! \n" + + $"【宵禁】当前[c/338AE1:服务器]存在 [c/FF3A4B:{PlayerCount}]/{Config.MaxPlayers}]个玩家! \n" + $"允许召唤表为[c/6EABE9:空],请在满足[c/FF3A4B:{Config.MaxPlayers}人]\n" + $"或[c/338AE1:宵禁时段]外: [c/DF95EC:{Config.Time.Start}] — [c/FF9187:{Config.Time.Stop}]\n" + $"尽可能击败该怪物([c/FF3A4B:{Config.DeadCount}次])来获取允许召唤权", Color.AntiqueWhite); @@ -182,7 +182,7 @@ private void OnSpawn(NpcSpawnEventArgs args) if (BcstSwitchOFF || (BcstDefault && BcstSwitch)) TShock.Utils.Broadcast( $"【宵禁】当前服务器处于维护时间\n" + - $"当前在线人数不满足:[c/FF3A4B:{PlayerCount}/{Config.MaxPlayers}人" + + $"当前在线人数不满足:[c/FF3A4B:{PlayerCount}]/{Config.MaxPlayers}人\n" + $"且处于宵禁时段: [c/DF95EC:{Config.Time.Start}] — [c/FF9187:{Config.Time.Stop}]\n"+ $"仅允许召唤以下怪物:\n" + $"[c/6EABE9:{NpcDeadInfo}]\n", Color.Aquamarine); @@ -280,7 +280,7 @@ private void OnTransform(NpcTransformationEventArgs args) #endregion #region 判断杀怪计数到《允许召唤表》方法 - private Dictionary KillCounters = new Dictionary(); + internal static Dictionary KillCounters = new Dictionary(); private void OnNPCKilled(NpcKilledEventArgs args) { if (!Config.Enabled || args.npc == null) return; @@ -288,6 +288,7 @@ private void OnNPCKilled(NpcKilledEventArgs args) int KillNpc = args.npc.netID; string npcName = TShock.Utils.GetNPCById(KillNpc)?.FullName ?? "未知NPC"; var NpcListInfo = string.Join(", ", Config.NpcDead.Select(x => TShock.Utils.GetNPCById(x)?.FullName + $"({x})")); + if (Config.Npcs.Contains(KillNpc)) { if (!KillCounters.ContainsKey(KillNpc)) @@ -353,10 +354,10 @@ private static bool InRegion2() { foreach (var plr in TShock.Players) { - if (plr != null - && plr.Active - && plr.CurrentRegion != null - && plr.CurrentRegion.Name == Config.RegionName) + if (plr != null && + plr.Active && + plr.CurrentRegion != null && + plr.CurrentRegion.Name == Config.RegionName) return true; } return false; diff --git a/GoodNight/README.md b/GoodNight/README.md index e34b82b3..1ba9f9e9 100644 --- a/GoodNight/README.md +++ b/GoodNight/README.md @@ -13,6 +13,10 @@ ## 更新日志 ``` +v2.7.3 +修正一些广播格式 +加入了清理《允许召唤表》的指令(/gn clear) + v2.7.2 修复检测到没有配置文件时,创建的配置没有参数 不会因为使用/reload重复写入或覆盖原来参数等问题 @@ -92,6 +96,7 @@ v2.0.0 | /gn kick | 无 | goodnight.admin | 开启或关闭断连功能 | | /gn pos | 无 | goodnight.admin | 开启或关闭召唤区 | | /gn all | 无 | goodnight.admin | 开启或关闭召唤区需所有人在场 | +| /gn clear | 无 | goodnight.admin | 清理《允许召唤表》的怪物ID | | /gn boss 次数 | 无 | goodnight.admin | 设置加入《允许召唤表》击杀要求次数 | | /gn reset 怪物ID | 无 | goodnight.admin | 设置重置《允许召唤表》的怪物ID | | /gn plr 人数 | 无 | goodnight.admin | 设置无视《禁止怪物表》在线人数 | diff --git a/Plugin.sln b/Plugin.sln index d0020a81..5a2e1292 100644 --- a/Plugin.sln +++ b/Plugin.sln @@ -44,8 +44,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CGive", "CGive\CGive.csproj EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DisableGodMod", "DisableGodMod\DisableGodMod.csproj", "{5C7C65FD-E104-4BDA-B7E5-4FC1BF0D2F16}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DisableMonsCoin", "DisableMonsCoin\DisableMonsCoin.csproj", "{C8B631CB-F176-4921-B313-6E49A4AAC3AC}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DisableSurfaceProjectiles", "DisableSurfaceProjectiles\DisableSurfaceProjectiles.csproj", "{CD5A7945-D416-4DEE-8079-DF0B9B3652ED}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NormalDropsBags", "NormalDropsBags\NormalDropsBags.csproj", "{D169A104-9372-4DB4-AF39-B511087885A0}" @@ -190,6 +188,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SpclPerm", "SpclPerm\SpclPe EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MonsterRegen", "MonsterRegen\MonsterRegen.csproj", "{9C2892C6-0F71-443D-9DF8-6FBF3BDCBE9D}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DisableMonsLoot", "DisableMonsLoot\DisableMonsLoot.csproj", "{98A03E00-1A75-426C-8172-3C954130EEA1}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -342,14 +342,6 @@ Global {5C7C65FD-E104-4BDA-B7E5-4FC1BF0D2F16}.Release|Any CPU.Build.0 = Release|Any CPU {5C7C65FD-E104-4BDA-B7E5-4FC1BF0D2F16}.Release|x64.ActiveCfg = Release|Any CPU {5C7C65FD-E104-4BDA-B7E5-4FC1BF0D2F16}.Release|x64.Build.0 = Release|Any CPU - {C8B631CB-F176-4921-B313-6E49A4AAC3AC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C8B631CB-F176-4921-B313-6E49A4AAC3AC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C8B631CB-F176-4921-B313-6E49A4AAC3AC}.Debug|x64.ActiveCfg = Debug|Any CPU - {C8B631CB-F176-4921-B313-6E49A4AAC3AC}.Debug|x64.Build.0 = Debug|Any CPU - {C8B631CB-F176-4921-B313-6E49A4AAC3AC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C8B631CB-F176-4921-B313-6E49A4AAC3AC}.Release|Any CPU.Build.0 = Release|Any CPU - {C8B631CB-F176-4921-B313-6E49A4AAC3AC}.Release|x64.ActiveCfg = Release|Any CPU - {C8B631CB-F176-4921-B313-6E49A4AAC3AC}.Release|x64.Build.0 = Release|Any CPU {CD5A7945-D416-4DEE-8079-DF0B9B3652ED}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {CD5A7945-D416-4DEE-8079-DF0B9B3652ED}.Debug|Any CPU.Build.0 = Debug|Any CPU {CD5A7945-D416-4DEE-8079-DF0B9B3652ED}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -926,6 +918,14 @@ Global {9C2892C6-0F71-443D-9DF8-6FBF3BDCBE9D}.Release|Any CPU.Build.0 = Release|Any CPU {9C2892C6-0F71-443D-9DF8-6FBF3BDCBE9D}.Release|x64.ActiveCfg = Release|Any CPU {9C2892C6-0F71-443D-9DF8-6FBF3BDCBE9D}.Release|x64.Build.0 = Release|Any CPU + {98A03E00-1A75-426C-8172-3C954130EEA1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {98A03E00-1A75-426C-8172-3C954130EEA1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {98A03E00-1A75-426C-8172-3C954130EEA1}.Debug|x64.ActiveCfg = Debug|Any CPU + {98A03E00-1A75-426C-8172-3C954130EEA1}.Debug|x64.Build.0 = Debug|Any CPU + {98A03E00-1A75-426C-8172-3C954130EEA1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {98A03E00-1A75-426C-8172-3C954130EEA1}.Release|Any CPU.Build.0 = Release|Any CPU + {98A03E00-1A75-426C-8172-3C954130EEA1}.Release|x64.ActiveCfg = Release|Any CPU + {98A03E00-1A75-426C-8172-3C954130EEA1}.Release|x64.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/README.md b/README.md index fee8933f..07d96141 100644 --- a/README.md +++ b/README.md @@ -72,7 +72,7 @@ | [BridgeBuilder](BridgeBuilder/README.md) | 快速铺桥 | 无 | | [OnlineGiftPackage](OnlineGiftPackage/README.md) | 在线礼包 | 无 | | [LifemaxExtra](LifemaxExtra/README.md) | 吃更多生命果/水晶 | 无 | -| [DisableMonsCoin](DisableMonsCoin/README.md) | 禁怪物掉落 | 无 | +| [DisableMonsLoot](DisableMonsLoot/README.md) | 禁怪物掉落 | 无 | | [PermaBuff](PermaBuff/README.md) | 永久 Buff | 无 | | [ShortCommand](ShortCommand/README.md) | 简短指令 | 无 | | [ProgressBag](ProgressBag/README.md) | 进度礼包 | 无 | diff --git a/Yaaiomni b/Yaaiomni index 1dc79675..b73e8bb8 160000 --- a/Yaaiomni +++ b/Yaaiomni @@ -1 +1 @@ -Subproject commit 1dc7967580c9bfbca9b756e924f073d924a6f581 +Subproject commit b73e8bb854683b57ec784246a7df4ca88e18db81