Skip to content

Commit

Permalink
Release1.3.9
Browse files Browse the repository at this point in the history
  • Loading branch information
XLittleLeft committed Jan 25, 2025
1 parent fe4566b commit 1977f41
Show file tree
Hide file tree
Showing 18 changed files with 341 additions and 121 deletions.
30 changes: 0 additions & 30 deletions HelpSense/Commands/Timer.cs

This file was deleted.

5 changes: 3 additions & 2 deletions HelpSense/Commands/VersionCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public bool Execute(ArraySegment<string> arguments, ICommandSender sender, out s
sb.AppendLine("功能开启列表(不是全部.只显示比较重要的):");
sb.AppendFormat("非礼勿视机动特遣队:{0}", BoolTranslate(config.EnableSeeNoEvil)).AppendLine();
sb.AppendFormat("天网机动特遣队:{0}", BoolTranslate(config.EnableSkynet)).AppendLine();
sb.AppendFormat("SCP-023 黑煞星:{0}", BoolTranslate(config.SCP023)).AppendLine();
sb.AppendFormat("SCP-029 暗影之女:{0}", BoolTranslate(config.EnableSCP029)).AppendLine();
sb.AppendFormat("SCP-073 亚伯/亚当:{0}", BoolTranslate(config.SCP073)).AppendLine();
sb.AppendFormat("SCP-191 机械少女:{0}", BoolTranslate(config.SCP191)).AppendLine();
Expand All @@ -42,8 +43,8 @@ public bool Execute(ArraySegment<string> arguments, ICommandSender sender, out s
sb.AppendFormat("无限子弹模式:{0}", Plugin.Instance.Config.InfiniteAmmoType).AppendLine();

//Copyright
sb.AppendLine("-Made By X小左-");
sb.AppendLine("Copyright © X小左 2022-2024");
sb.AppendLine("-Made By X小左(XLittleLeft)-");
sb.AppendLine("Copyright © X小左 2022-2025");

response = sb.ToString();
StringBuilderPool.Pool.Return(sb);
Expand Down
7 changes: 4 additions & 3 deletions HelpSense/ConfigSystem/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ public class Config
// /////////////////////////////////////////////////
[Description("无限子弹")]
public bool InfiniteAmmo { get; set; } = true;
[Description("无限子弹模式(0->Old:给玩家加备用子弹来装填;1->Normal:(可能有点问题)正常模式,有换弹动作,不需要子弹换弹;2->Moment:瞬间换弹,无换弹动作,不需要子弹换弹;3->Infinite:真·无限子弹,不需要换弹)")]
public InfiniteAmmoType InfiniteAmmoType { get; set; } = InfiniteAmmoType.Old;
[Description("无限子弹模式(Old:给玩家加备用子弹来装填;Moment:瞬间换弹,无换弹动作,不需要子弹换弹;Infinite:真·无限子弹,不需要换弹)")]
public InfiniteAmmoType InfiniteAmmoType { get; set; } = InfiniteAmmoType.Normal;

/// /////////////////////////////////////////////////
[Description("启用修改SCP血量系统")]
Expand Down Expand Up @@ -196,6 +196,8 @@ public class Config
public bool SCP2936 { get; set; } = true;
[Description("SCP-1093")]
public bool SCP1093 { get; set; } = true;
[Description("SCP-023")]
public bool SCP023 { get; set; } = true;
}
public enum MessageType
{
Expand All @@ -204,7 +206,6 @@ public enum MessageType
};
public enum InfiniteAmmoType
{
Old,
Normal,
Moment,
Infinite
Expand Down
25 changes: 25 additions & 0 deletions HelpSense/ConfigSystem/SSSSTranslateConfig.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace HelpSense.ConfigSystem
{
public class SSSSTranslateConfig
{
[Description("穿门技能")]
public string DoorPiercingAbility { get; set; } = "穿门技能";
[Description("穿门技能按键")]
public string DoorPiercingAbilityKey { get; set; } = "穿门技能按键";
[Description("穿门技能按键说明")]
public string DoorPiercingAbilityKeyDescription { get; set; } = "按一下或长按就可以穿门了";
[Description("穿门技能发动模式")]
public string PiercingSkillActivationMode { get; set; } = "穿门技能发动模式";
[Description("长按")]
public string Hold { get; set; } = "长按";
[Description("开关")]
public string Toggle { get; set; } = "开关";
}
}
24 changes: 18 additions & 6 deletions HelpSense/ConfigSystem/TranslateConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -219,22 +219,32 @@ public class TranslateConfig
[Description("SCP-1093刷新广播")]
public string SCP1093SpawnBroadcast { get; set; } = "你是 <color=yellow>SCP-1093 人灯</color>";
[Description("SCP-1093技能介绍")]
public List<string> SCP1093SkillIntroduction { get; set; } = new List<string>()
{
public List<string> SCP1093SkillIntroduction { get; set; } =
[
"你是 [SCP-1093] 持续照亮附近5米范围,并辐射附近1米范围内的人",
"你的头是虚无的,任何人对你头部没有伤害"
};
];
[Description("SCP-023刷新广播")]
public string SCP023SpawnBroadcast { get; set; } = "你是 <color=red>SCP-023 黑煞星</color>";
[Description("SCP-023技能介绍")]
public List<string> SCP023SkillIntroduction { get; set; } =
[
"你是 [SCP-023] 按对应的按键可以发动穿门技能",
"使用SCP-1344的攻击你的人会遭到反噬"
];
[Description("SCP-023被带SCP1344的人伤害时攻击者被反噬的死亡原因")]
public string SCP023ReversedCauseOfDeath { get; set; } = "你不应该带着SCP-1344出现在SCP-023面前的";
[Description("警卫队长刷新广播")]
public string GuardCaptainSpawnBroadcast { get; set; } = "<size=60><color=#E5DADA>你是安保队长</color></size>";
[Description("SCP-191刷新广播")]
public string SCP191SpawnBroadcast { get; set; } = "你成为了<color=red>SCP-191 机械少女</color>";
[Description("SCP-191技能介绍")]
public List<string> SCP191SkillIntroduction { get; set; } = new List<string>()
{
public List<string> SCP191SkillIntroduction { get; set; } =
[
"你是 [SCP-191] 因为你的身体的改造",
"你对除了电磁和爆炸伤害的<color=red>抗性很高</color>",
"但别忘了去079收容室充电"
};
];
[Description("SCP-191电量显示")]
public string SCP191BatteryHintShow { get; set; } = "<align=right><size=40><b>你目前剩余的电量:<color=yellow>%Battery%安</color></size></b></align>";
[Description("SCP-191电量耗尽死亡原因")]
Expand Down Expand Up @@ -269,6 +279,8 @@ public class TranslateConfig
public string SCP191SpecialIntroduction { get; set; } = "<color=red>SCP-191 机械少女</color>";
[Description("SCP-2936特殊介绍")]
public string SCP2936SpecialIntroduction { get; set; } = "<color=red>SCP-2936-1 巨型德国机器人</color>";
[Description("SCP-023特殊介绍")]
public string SCP023SpecialIntroduction { get; set; } = "<color=red>SCP-023 黑煞星</color>";
[Description("天网机动特遣队特殊介绍")]
public string SkynetSpecialIntroduction { get; set; } = "<color=blue>天网 机动特遣队</color>";
[Description("非礼勿视机动特遣队特殊介绍")]
Expand Down
4 changes: 3 additions & 1 deletion HelpSense/HelpSense.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@
<Compile Include="Commands\ChatCommand\BcCommand.cs" />
<Compile Include="Commands\ChatCommand\CCommand.cs" />
<Compile Include="Commands\InfoCommand.cs" />
<Compile Include="Commands\Timer.cs" />
<Compile Include="Commands\VersionCommand.cs" />
<Compile Include="Commands\RescueCommand.cs" />
<Compile Include="ConfigSystem\Config.cs" />
<Compile Include="ConfigSystem\SSSSTranslateConfig.cs" />
<Compile Include="ConfigSystem\TranslateConfig.cs" />
<Compile Include="Handler\LobbyLocationHandler.cs" />
<Compile Include="Helper\Chat\ChatHelper.cs" />
Expand All @@ -71,8 +71,10 @@
<Compile Include="Helper\SCP\SCPHPChangeSystem.cs" />
<Compile Include="MonoBehaviors\PlayerGlowBehavior.cs" />
<Compile Include="MonoBehaviors\PlayerLightBehavior.cs" />
<Compile Include="SSSS\GhostlyAbility.cs" />
<Compile Include="Patches\MaxHealthGetPatch.cs" />
<Compile Include="Patches\PositionSyncingPatch.cs" />
<Compile Include="Patches\ReloaderModulePatch.cs" />
<Compile Include="Plugin.cs" />
<Compile Include="ConfigSystem\Properties.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
Expand Down
9 changes: 5 additions & 4 deletions HelpSense/Helper/Event/EventHelper.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using CustomPlayerEffects;
using HelpSense.Helper.SCP;
using InventorySystem.Items;
using MapGeneration;
using MEC;
using PlayerRoles;
Expand Down Expand Up @@ -112,7 +113,7 @@ public static void OnTeamRespawn(SpawnableWaveBase spawnableWaveBase, List<Refer
{
if (Player.Role is RoleTypeId.NtfCaptain)
{
Player.AddItem(ItemType.MicroHID);
Player.AddItem(ItemType.MicroHID, ItemAddReason.AdminCommand);
}
}
});
Expand All @@ -134,7 +135,7 @@ public static void OnTeamRespawn(SpawnableWaveBase spawnableWaveBase, List<Refer

player.ShowBroadcast(Plugin.Instance.TranslateConfig.ChaosLeaderSpawnBroadcast, 10, Broadcast.BroadcastFlags.Normal);

player.AddItem(ItemType.ParticleDisruptor);
player.AddItem(ItemType.ParticleDisruptor , ItemAddReason.AdminCommand);

player.AddItem(ItemType.SCP1853);
player.AddItem(ItemType.SCP268);
Expand Down Expand Up @@ -186,10 +187,10 @@ public static void OnTeamRespawn(SpawnableWaveBase spawnableWaveBase, List<Refer
{
player.SendBroadcast(Plugin.Instance.TranslateConfig.SCP073AbelSpawnBroadcast, 6);

player.ClearInventory();
player.ClearInventory(false);
for (int i = 0; i < 8; i++)
{
player.AddItem(ItemType.Jailbird);
player.AddItem(ItemType.Jailbird , ItemAddReason.AdminCommand);
}

Timing.RunCoroutine(XHelper.PositionCheckerCoroutine(player).CancelWith(player.GameObject));
Expand Down
5 changes: 3 additions & 2 deletions HelpSense/Helper/SCP/SCPHelper.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using PlayerRoles;
using InventorySystem.Items;
using PlayerRoles;
using PluginAPI.Core;
using System.Collections.Generic;
using UnityEngine;
Expand Down Expand Up @@ -202,7 +203,7 @@ public void AddItems(Player Player, List<ItemType> Items)
{
foreach (ItemType Item in Items)
{
Player.AddItem(Item);
Player.AddItem(Item , ItemAddReason.AdminCommand);
}
}
}
Expand Down
6 changes: 6 additions & 0 deletions HelpSense/Helper/SpecialRole/SpecialRoleHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public static IEnumerator<float> SpecialRoleInfoHandle()
string SCP1093SpecialIntroduction = config.SCP1093SpecialIntroduction;
string SCP191SpecialIntroduction = config.SCP191SpecialIntroduction;
string SCP2936SpecialIntroduction = config.SCP2936SpecialIntroduction;
string SCP023SpecialIntroduction = config.SCP023SpecialIntroduction;
string SCP073AbelSpecialIntroduction = config.SCP073AbelSpecialIntroduction;
string SCP073CainSpecialIntroduction = config.SCP073CainSpecialIntroduction;
string SkynetSpecialIntroduction = config.SkynetSpecialIntroduction;
Expand Down Expand Up @@ -115,6 +116,11 @@ public static IEnumerator<float> SpecialRoleInfoHandle()
Plugin.Instance.SCP191.Player.GetPlayerUi().CommonHint.ShowRoleHint(SCP191SpecialIntroduction, [.. config.SCP191SkillIntroduction], 1.25f);
}

if (Plugin.Instance.SCP023 != null && Plugin.Instance.SCP023.Player != null)
{
Plugin.Instance.SCP023.Player.GetPlayerUi().CommonHint.ShowRoleHint(SCP023SpecialIntroduction, [.. config.SCP023SkillIntroduction], 1.25f);
}

if (!Plugin.Instance.SkynetPlayers.IsEmpty())
{
foreach (Player Player in Plugin.Instance.SkynetPlayers)
Expand Down
17 changes: 0 additions & 17 deletions HelpSense/Helper/XHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -399,23 +399,6 @@ public static IEnumerator<float> PositionCheckerCoroutine(Player player)
}
}

public static IEnumerator<float> InAmmo()
{
while (true)
{
if (Round.IsRoundEnded) yield break;
foreach (Player Player in PlayerList.Where(x => x.IsHuman))
{
Player.SetAmmo(ItemType.Ammo9x19, 180);
Player.SetAmmo(ItemType.Ammo12gauge, 18);
Player.SetAmmo(ItemType.Ammo44cal, 18);
Player.SetAmmo(ItemType.Ammo762x39, 180);
Player.SetAmmo(ItemType.Ammo556x45, 180);
}
yield return Timing.WaitForSeconds(3f);
}
}

public static bool IsSameTeam(this Player player1, Player player2)
{
if (player1.Team is Team.FoundationForces && player2.Team is Team.Scientists)
Expand Down
5 changes: 5 additions & 0 deletions HelpSense/Patches/MaxHealthGetPatch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ public static bool Prefix(ref float __result, HealthStat __instance)
__result = 300;
return false;
}
if (Player.Get(__instance.Hub).RoleName == "SCP-023")
{
__result = 200;
return false;
}
if (Player.Get(__instance.Hub).RoleName == Plugin.Instance.TranslateConfig.ChaosLeaderRoleName)
{
__result = 150;
Expand Down
60 changes: 60 additions & 0 deletions HelpSense/Patches/ReloaderModulePatch.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
using HarmonyLib;
using HelpSense.ConfigSystem;
using InventorySystem.Items.Autosync;
using InventorySystem.Items.Firearms;
using InventorySystem.Items.Firearms.Modules;
using MEC;
using Mirror;
using PluginAPI.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static InventorySystem.Items.Firearms.Modules.AnimatorReloaderModuleBase;

namespace HelpSense.Patches
{
[HarmonyPatch(typeof(AnimatorReloaderModuleBase) , nameof(AnimatorReloaderModuleBase.ServerProcessCmd))]
public static class ReloaderModulePatch
{
public static bool Prefix(AnimatorReloaderModuleBase __instance , NetworkReader reader)
{
if (!Plugin.Instance.Config.InfiniteAmmo) return true;

ReloaderMessageHeader header = (ReloaderMessageHeader)reader.ReadByte();
Firearm Firearm = __instance.Firearm;
Player Player = Player.Get(Firearm.Owner);

if (!__instance.TryContinueDeserialization(reader, Firearm.ItemSerial, header, AutosyncMessageType.Cmd))
{
return true;
}

if (header is ReloaderMessageHeader.Reload && IReloadUnloadValidatorModule.ValidateReload(Firearm))
{
if (Firearm.ItemTypeId is ItemType.ParticleDisruptor) return true;
if (Firearm.TryGetModule<MagazineModule>(out var MagazineModule))
{
switch (Plugin.Instance.Config.InfiniteAmmoType)
{
case InfiniteAmmoType.Normal:
Player.SetAmmo(MagazineModule.AmmoType, (ushort)(MagazineModule.AmmoMax - MagazineModule.AmmoStored + 1));
break;
case InfiniteAmmoType.Moment:
MagazineModule.ServerSetInstanceAmmo(Firearm.ItemSerial, MagazineModule.AmmoMax);
break;
}
}
else if (Firearm.ItemTypeId is ItemType.GunRevolver && Firearm.TryGetModule<CylinderAmmoModule>(out var CylinderAmmoModule))
{
Player.SetAmmo(CylinderAmmoModule.AmmoType, (ushort)(CylinderAmmoModule.AmmoMax - CylinderAmmoModule.AmmoStored + 1));
}
}

reader.Position -= sizeof(byte);

return true;
}
}
}
Loading

0 comments on commit 1977f41

Please sign in to comment.