From c19d4c2f9fe432ea36de9ab2cd2747d4f9e30ba5 Mon Sep 17 00:00:00 2001 From: 3cxc <81449257+3cxc@users.noreply.github.com> Date: Thu, 12 Feb 2026 17:31:16 +0800 Subject: [PATCH] =?UTF-8?q?style:=20=E6=B8=85=E7=90=86=E6=9C=AA=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E7=9A=84=E5=BC=95=E7=94=A8=E5=B9=B6=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E7=BC=A9=E8=BF=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BadgeSystem/Badge.cs | 8 +------- Commands/RescueCommand.cs | 4 ---- Configs/BadgeConfig.cs | 7 +------ Configs/Config.cs | 5 +---- Configs/CustomRoleConfig.cs | 9 +-------- Configs/DataBaseConfig.cs | 4 ---- Configs/TranslateConfig.cs | 4 ---- DataBase/DataAPI.cs | 7 +------ DataBase/InfoExtension.cs | 4 ++-- Events/CustomEventHandler.cs | 26 ++++++++------------------ Plugins.cs | 7 ------- Properties/AssemblyInfo.cs | 1 - Utils/ChatUtils.cs | 2 -- Utils/Ini.cs | 2 -- Utils/ScpReal.cs | 18 ++++++++---------- Utils/Util.cs | 3 --- 16 files changed, 23 insertions(+), 88 deletions(-) diff --git a/BadgeSystem/Badge.cs b/BadgeSystem/Badge.cs index f84d9b1..766fc27 100644 --- a/BadgeSystem/Badge.cs +++ b/BadgeSystem/Badge.cs @@ -1,15 +1,9 @@ -using EasyTools.Configs; -using EasyTools.Events; -using GameCore; +using EasyTools.Events; using LabApi.Features.Wrappers; using MEC; using NewXp.IniApi; -using System; using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using Log = LabApi.Features.Console.Logger; namespace EasyTools.BadgeSystem diff --git a/Commands/RescueCommand.cs b/Commands/RescueCommand.cs index 0659d4b..79cc0d7 100644 --- a/Commands/RescueCommand.cs +++ b/Commands/RescueCommand.cs @@ -4,10 +4,6 @@ using EasyTools.Events; using LabApi.Features.Wrappers; using RelativePositioning; using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace EasyTools.Commands { diff --git a/Configs/BadgeConfig.cs b/Configs/BadgeConfig.cs index 1263057..a31c8a1 100644 --- a/Configs/BadgeConfig.cs +++ b/Configs/BadgeConfig.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System.ComponentModel; namespace EasyTools.Configs { diff --git a/Configs/Config.cs b/Configs/Config.cs index a3d6ed0..eb50ad4 100644 --- a/Configs/Config.cs +++ b/Configs/Config.cs @@ -3,9 +3,6 @@ using System; using System.Collections.Generic; using System.ComponentModel; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace EasyTools.Configs { @@ -25,7 +22,7 @@ namespace EasyTools.Configs public ushort AutoServerMessageTimer { get; set; } = 5; [Description("服务器广播文本")] - public List AutoServerMessageText { get; set; } = ["服务器广播1","服务器广播2"]; + public List AutoServerMessageText { get; set; } = ["服务器广播1", "服务器广播2"]; /// ///////////////////////////////////////////////// [Description("启用.bc和.c聊天系统")] diff --git a/Configs/CustomRoleConfig.cs b/Configs/CustomRoleConfig.cs index a9abb77..cec486b 100644 --- a/Configs/CustomRoleConfig.cs +++ b/Configs/CustomRoleConfig.cs @@ -1,11 +1,4 @@ -using LabApi.Loader.Features.Paths; -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System.ComponentModel; namespace EasyTools.Configs { diff --git a/Configs/DataBaseConfig.cs b/Configs/DataBaseConfig.cs index 8f5aeca..382d648 100644 --- a/Configs/DataBaseConfig.cs +++ b/Configs/DataBaseConfig.cs @@ -1,11 +1,7 @@ using LabApi.Loader.Features.Paths; using System; -using System.Collections.Generic; using System.ComponentModel; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace EasyTools.Configs { diff --git a/Configs/TranslateConfig.cs b/Configs/TranslateConfig.cs index 9fbc179..80151d4 100644 --- a/Configs/TranslateConfig.cs +++ b/Configs/TranslateConfig.cs @@ -1,11 +1,7 @@ using EasyTools.Utils; using PlayerRoles; -using System; using System.Collections.Generic; using System.ComponentModel; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace EasyTools.Configs { diff --git a/DataBase/DataAPI.cs b/DataBase/DataAPI.cs index 42552c5..fad3c11 100644 --- a/DataBase/DataAPI.cs +++ b/DataBase/DataAPI.cs @@ -1,12 +1,7 @@ using EasyTools.DataBase.Serialization; using EasyTools.Events; using LiteDB; -using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using UnityEngine.LowLevel; namespace EasyTools.DataBase { @@ -22,7 +17,7 @@ namespace EasyTools.DataBase return true; } using LiteDatabase database = new(CustomEventHandler.DataBaseConfig.database_path); - + if ((data = database.GetCollection("Players")?.FindById(id)) != null) { PlayerDataDic.Add(id, data); diff --git a/DataBase/InfoExtension.cs b/DataBase/InfoExtension.cs index d4d3f48..8c01266 100644 --- a/DataBase/InfoExtension.cs +++ b/DataBase/InfoExtension.cs @@ -1,10 +1,10 @@ -using System.Collections.Generic; -using EasyTools.DataBase.Serialization; +using EasyTools.DataBase.Serialization; using EasyTools.Events; using LabApi.Features.Wrappers; using LiteDB; using MEC; using System; +using System.Collections.Generic; namespace EasyTools.DataBase { diff --git a/Events/CustomEventHandler.cs b/Events/CustomEventHandler.cs index dff2900..77c81b5 100644 --- a/Events/CustomEventHandler.cs +++ b/Events/CustomEventHandler.cs @@ -1,31 +1,19 @@ -using CommandSystem.Commands.RemoteAdmin.Decontamination; -using EasyTools.BadgeSystem; +using EasyTools.BadgeSystem; using EasyTools.Configs; using EasyTools.Utils; -using GameCore; -using HintServiceMeow.UI.Utilities; using InventorySystem.Items; using LabApi.Events.Arguments.PlayerEvents; using LabApi.Events.Arguments.ServerEvents; using LabApi.Events.CustomHandlers; using LabApi.Features.Wrappers; using MEC; -using NewXp.IniApi; using PlayerRoles; using PlayerStatsSystem; -using RemoteAdmin.Communication; using System; using System.Collections.Generic; -using System.Data; using System.IO; using System.Linq; -using System.Reflection.Emit; -using System.Text; -using System.Threading.Tasks; using UnityEngine; -using UnityEngine.LowLevel; -using static Broadcast; -using static UnityEngine.GraphicsBuffer; using Log = LabApi.Features.Console.Logger; namespace EasyTools.Events @@ -123,7 +111,7 @@ namespace EasyTools.Events { Badge.Remove(player); } - + } public override void OnPlayerHurting(PlayerHurtingEventArgs ev) @@ -239,7 +227,7 @@ namespace EasyTools.Events { Timing.CallDelayed(0.5f, () => { - Player.GiveCandy(InventorySystem.Items.Usables.Scp330.CandyKindID.Pink, ItemAddReason.AdminCommand); + Player.GiveCandy(InventorySystem.Items.Usables.Scp330.CandyKindID.Pink, ItemAddReason.AdminCommand); }); } @@ -386,7 +374,7 @@ namespace EasyTools.Events } else if (randomValue < 15f && !success) // 5% 粉糖 { - player.GiveCandy(InventorySystem.Items.Usables.Scp330.CandyKindID.Pink,ItemAddReason.Undefined); + player.GiveCandy(InventorySystem.Items.Usables.Scp330.CandyKindID.Pink, ItemAddReason.Undefined); rewardName = "获得了粉糖"; success = true; } @@ -412,7 +400,8 @@ namespace EasyTools.Events if (healthIndex) { player.AddItem(ItemType.SCP500); - }else + } + else { player.AddItem(ItemType.Medkit); } @@ -450,7 +439,8 @@ namespace EasyTools.Events { PocketDimension.ForceInside(player); rewardName = "传送到老头空间"; - }else + } + else { PocketDimension.ForceExit(player); rewardName = "离开了老头空间"; diff --git a/Plugins.cs b/Plugins.cs index 593a7cf..12a6012 100644 --- a/Plugins.cs +++ b/Plugins.cs @@ -1,17 +1,10 @@ using EasyTools.Configs; using EasyTools.Events; using LabApi.Events.CustomHandlers; -using LabApi.Events.Handlers; using LabApi.Features; -using LabApi.Features.Wrappers; using LabApi.Loader; using LabApi.Loader.Features.Plugins; -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace EasyTools { diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs index 0be70db..c181b56 100644 --- a/Properties/AssemblyInfo.cs +++ b/Properties/AssemblyInfo.cs @@ -1,5 +1,4 @@ using System.Reflection; -using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // 有关程序集的一般信息由以下 diff --git a/Utils/ChatUtils.cs b/Utils/ChatUtils.cs index 852bb28..382c408 100644 --- a/Utils/ChatUtils.cs +++ b/Utils/ChatUtils.cs @@ -7,8 +7,6 @@ using PlayerRoles; using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace EasyTools.Utils { diff --git a/Utils/Ini.cs b/Utils/Ini.cs index 1cf4854..4a0d3a3 100644 --- a/Utils/Ini.cs +++ b/Utils/Ini.cs @@ -2,8 +2,6 @@ using System.Collections.Generic; using System.IO; using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace NewXp.IniApi { diff --git a/Utils/ScpReal.cs b/Utils/ScpReal.cs index 70ee75c..8eca143 100644 --- a/Utils/ScpReal.cs +++ b/Utils/ScpReal.cs @@ -1,12 +1,8 @@ -using CustomPlayerEffects; -using EasyTools.Events; +using EasyTools.Events; using LabApi.Features.Wrappers; using MEC; using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using UnityEngine; namespace EasyTools.Utils @@ -45,14 +41,14 @@ namespace EasyTools.Utils _lastHealth[p] = lastHealth; Vector3 pos = p.Position; - if(_lastMove.TryGetValue(p,out var last)) + if (_lastMove.TryGetValue(p, out var last)) { - if (Vector3.Distance(pos,last.pos) < 0.1f) + if (Vector3.Distance(pos, last.pos) < 0.1f) { bool canceled = false; // 检测是否正在受伤 - if (_lastDamageTime.TryGetValue(p,out var lastDamageTime)) + if (_lastDamageTime.TryGetValue(p, out var lastDamageTime)) { if (DateTime.UtcNow - lastDamageTime < TimeSpan.FromSeconds(CustomEventHandler.Config.heal_atk_secend)) { canceled = true; } } @@ -68,8 +64,10 @@ namespace EasyTools.Utils } } else { _lastMove[p] = (pos, DateTime.UtcNow); } - }else { _lastMove[p] = (pos, DateTime.UtcNow); } - }else if (_lastMove.ContainsKey(p)) { _lastMove.Remove(p); } + } + else { _lastMove[p] = (pos, DateTime.UtcNow); } + } + else if (_lastMove.ContainsKey(p)) { _lastMove.Remove(p); } } yield return Timing.WaitForSeconds(1f); } diff --git a/Utils/Util.cs b/Utils/Util.cs index b4e4b4d..ffd34e7 100644 --- a/Utils/Util.cs +++ b/Utils/Util.cs @@ -3,9 +3,6 @@ using LabApi.Features.Wrappers; using MEC; using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace EasyTools.Utils {