From 3a55023ce2b38454864e7a5a456ed0d13d99f73e Mon Sep 17 00:00:00 2001 From: JustMarfix Date: Sat, 2 Dec 2023 20:08:28 +0300 Subject: [PATCH] =?UTF-8?q?Fix:=20vudclassd=20=D1=81=D1=80=D0=B0=D0=B7?= =?UTF-8?q?=D1=83=20=D1=81=D0=BF=D0=B0=D0=B2=D0=BD=D0=B8=D1=82,=20vudscien?= =?UTF-8?q?ce=20=D0=B1=D0=BE=D0=BB=D1=8C=D1=88=D0=B5=20=D0=BD=D0=B5=20115h?= =?UTF-8?q?p,=20classd=20=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D0=B0=D0=B5=D1=82?= =?UTF-8?q?=20=D1=82=D0=BE=D0=BB=D1=8C=D0=BA=D0=BE=20=D0=B5=D1=81=D0=BB?= =?UTF-8?q?=D0=B8=20=D1=87=D0=B5=D0=BB=D0=BE=D0=B2=D0=B5=D0=BA=20=D0=BD?= =?UTF-8?q?=D0=B5=20=D0=BC=D0=B5=D0=BD=D1=8F=D0=BB=20=D1=80=D0=BE=D0=BB?= =?UTF-8?q?=D1=8C=20New:=20spawn966?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Commands/spawn966.cs | 60 ++++++++++++++++++++++++++++++++++++++++++ Commands/vudclassd.cs | 6 +++-- Commands/vudscience.cs | 4 +-- VeryUsualDay.cs | 4 +-- VeryUsualDay.csproj | 1 + 5 files changed, 69 insertions(+), 6 deletions(-) create mode 100644 Commands/spawn966.cs diff --git a/Commands/spawn966.cs b/Commands/spawn966.cs new file mode 100644 index 0000000..17bfab1 --- /dev/null +++ b/Commands/spawn966.cs @@ -0,0 +1,60 @@ +using CommandSystem; +using Exiled.API.Features; +using MEC; +using System; + +namespace VeryUsualDay.Commands +{ + [CommandHandler(typeof(RemoteAdminCommandHandler))] + public class spawn966 : ICommand + { + public string Command { get; set; } = "spawn966"; + + public string[] Aliases { get; set; } = { }; + + public string Description { get; set; } = "Работает при СОД. Спавнит SCP-966."; + + public bool Execute(ArraySegment arguments, ICommandSender sender, out string response) + { + if (!VeryUsualDay.Instance.IsEnabledInRound) + { + response = "Режим СОД не включён!"; + return false; + } + int id = int.Parse(arguments.Array[1]); + if (Player.TryGet(id, out Player scp966)) + { + if (VeryUsualDay.Instance.ScpPlayers.ContainsKey(id)) + { + scp966.MaxHealth = 100f; + scp966.CustomInfo = "Человек"; + scp966.Role.Set(PlayerRoles.RoleTypeId.Tutorial, reason: Exiled.API.Enums.SpawnReason.ForceClass); + scp966.Scale = new UnityEngine.Vector3(1f, 1f, 1f); + VeryUsualDay.Instance.ScpPlayers.Remove(id); + response = "SCP удалён!"; + return true; + } + else + { + scp966.Role.Set(PlayerRoles.RoleTypeId.Tutorial, reason: Exiled.API.Enums.SpawnReason.ForceClass, spawnFlags: PlayerRoles.RoleSpawnFlags.AssignInventory); + Timing.CallDelayed(2f, () => + { + scp966.CustomInfo = "SCP-966"; + scp966.MaxHealth = 1000f; + scp966.Health = 1000f; + scp966.Scale = new UnityEngine.Vector3(0f, 1f, 0f); + scp966.IsGodModeEnabled = false; + VeryUsualDay.Instance.ScpPlayers.Add(id, VeryUsualDay.Scps.Scp966); + }); + response = "SCP-966 создан!"; + return true; + } + } + else + { + response = "Не удалось найти игрока с таким ID!"; + return false; + } + } + } +} diff --git a/Commands/vudclassd.cs b/Commands/vudclassd.cs index 1d9cf7b..d93578d 100644 --- a/Commands/vudclassd.cs +++ b/Commands/vudclassd.cs @@ -24,16 +24,18 @@ public bool Execute(ArraySegment arguments, ICommandSender sender, out s int id = int.Parse(arguments.Array[1]); if (Player.TryGet(id, out Player dboy)) { - dboy.Role.Set(PlayerRoles.RoleTypeId.ClassD, reason: Exiled.API.Enums.SpawnReason.ForceClass, spawnFlags: PlayerRoles.RoleSpawnFlags.AssignInventory); - Timing.CallDelayed(2f, () => + dboy.Role.Set(PlayerRoles.RoleTypeId.ClassD, reason: Exiled.API.Enums.SpawnReason.ForceClass, spawnFlags: PlayerRoles.RoleSpawnFlags.All); + Timing.CallDelayed(1f, () => { dboy.ClearInventory(); + dboy.Handcuff(); dboy.MaxHealth = 115f; dboy.Health = 115f; dboy.CustomName = $"Испытуемый - ##-{VeryUsualDay.Instance.SpawnedDboysCounter}"; dboy.Broadcast(10, "Вы стали Испытуемым! Можете сотрудничать с фондом или принимать попытки побега при первой возможности. "); VeryUsualDay.Instance.SpawnedDboysCounter += 1; }); + Cassie.Message("Вы стали Испытуемым! Можете сотрудничать с фондом или принимать попытки побега при первой возможности. ", isNoisy: false, isSubtitles: true); response = "Испытуемый заспавнен успешно!"; return true; } diff --git a/Commands/vudscience.cs b/Commands/vudscience.cs index 32ec9eb..0d5ad53 100644 --- a/Commands/vudscience.cs +++ b/Commands/vudscience.cs @@ -28,8 +28,8 @@ public bool Execute(ArraySegment arguments, ICommandSender sender, out s Timing.CallDelayed(2f, () => { scientist.ClearInventory(); - scientist.MaxHealth = 115f; - scientist.Health = 115f; + scientist.MaxHealth = 100f; + scientist.Health = 100f; scientist.AddItem(ItemType.KeycardScientist); scientist.AddItem(ItemType.Painkillers); scientist.AddItem(ItemType.Flashlight); diff --git a/VeryUsualDay.cs b/VeryUsualDay.cs index a72b622..690003c 100644 --- a/VeryUsualDay.cs +++ b/VeryUsualDay.cs @@ -22,7 +22,7 @@ public VeryUsualDay() { } public override string Author => "JustMarfix"; public override string Name => "VeryUsualDay"; - public override Version Version => new Version(2, 1, 1); + public override Version Version => new Version(2, 1, 3); public bool IsEnabledInRound { get; set; } = false; public bool Is008Leaked { get; set; } = false; @@ -103,7 +103,7 @@ public IEnumerator _joining() { if (Player.TryGet(i, out Player dboy)) { - if (dboy.CustomInfo == "Человек" || dboy.CustomInfo is null) + if ((dboy.CustomInfo == "Человек" || dboy.CustomInfo is null) && dboy.Role.Type == PlayerRoles.RoleTypeId.Tutorial) { if (JoinedDboys.Count >= 5) { diff --git a/VeryUsualDay.csproj b/VeryUsualDay.csproj index 814ef7f..2f20905 100644 --- a/VeryUsualDay.csproj +++ b/VeryUsualDay.csproj @@ -113,6 +113,7 @@ +