From 4c5991130c68cd4543d2451af403b9b64f4592be Mon Sep 17 00:00:00 2001 From: Mikhail Reznichenko Date: Sat, 5 Oct 2024 16:47:21 +0300 Subject: [PATCH] Big plugin update closes #61, closes #76, closes #32 added utils module moved all playable classes to utils added scp-019-2 --- Commands/Aban.cs | 1 - Commands/AllowSpawn.cs | 1 - Commands/Breach244.cs | 1 - Commands/ChaosMode.cs | 1 - Commands/CheckCode.cs | 1 - Commands/CheckCodePlayer.cs | 1 - Commands/ClassD.cs | 1 - Commands/GoComplex.cs | 1 - Commands/Lock049Gate.cs | 1 - Commands/Lock173Gate.cs | 1 - Commands/Lunch.cs | 1 - Commands/ManageTesla.cs | 1 - Commands/Patogen008.cs | 43 ++++++++++++++++++++ Commands/PluginEnable.cs | 15 ++++++- Commands/ReDoors.cs | 1 - Commands/Recontain008.cs | 53 +++++++++++++++++++++++++ Commands/Recontain244.cs | 1 - Commands/RoleDistribution.cs | 1 - Commands/SetCode.cs | 1 - Commands/Spawn0082.cs | 40 +++++++++++++++++++ Commands/Spawn01921.cs | 34 ++++++++++++++++ Commands/Spawn01922.cs | 34 ++++++++++++++++ Commands/Spawn035.cs | 32 ++------------- Commands/Spawn0352.cs | 23 ++--------- Commands/Spawn049.cs | 23 ++--------- Commands/Spawn0762.cs | 29 ++------------ Commands/Spawn372.cs | 25 ++---------- Commands/Spawn682.cs | 34 ++-------------- Commands/Spawn966.cs | 23 ++--------- Commands/Spawn999.cs | 23 ++--------- Commands/Spawnbuo.cs | 17 ++++---- Commands/SupplyCassie.cs | 1 - Commands/VudClassD.cs | 17 +------- Commands/VudClear.cs | 1 - Commands/VudGuard.cs | 21 +--------- Commands/VudMedic.cs | 28 +------------ Commands/VudMood.cs | 1 - Commands/VudScience.cs | 21 +--------- Commands/VudSupply.cs | 1 - Commands/VudWorker.cs | 16 +------- Handlers/Player.cs | 43 +++++++++++++++++++- Handlers/Server.cs | 2 + Helpers.cs | 38 ++++++++++++++++++ Properties/AssemblyInfo.cs | 2 +- Utils/ClassD.cs | 34 ++++++++++++++++ Utils/Guard.cs | 37 +++++++++++++++++ Utils/MtfMedic.cs | 46 +++++++++++++++++++++ Utils/Scientist.cs | 38 ++++++++++++++++++ Utils/Scp0082.cs | 45 +++++++++++++++++++++ Utils/Scp01921.cs | 37 +++++++++++++++++ Utils/Scp01922.cs | 38 ++++++++++++++++++ Utils/Scp035.cs | 40 +++++++++++++++++++ Utils/Scp0352.cs | 28 +++++++++++++ Utils/Scp049.cs | 33 ++++++++++++++++ Utils/Scp0762.cs | 41 +++++++++++++++++++ Utils/Scp372.cs | 34 ++++++++++++++++ Utils/Scp682.cs | 42 ++++++++++++++++++++ Utils/Scp966.cs | 34 ++++++++++++++++ Utils/Scp999.cs | 33 ++++++++++++++++ Utils/TutorialHuman.cs | 55 ++++++++++++++++++++++++++ Utils/Worker.cs | 36 +++++++++++++++++ VeryUsualDay.cs | 77 ++++++++++++++++++------------------ VeryUsualDay.csproj | 25 +++++++++++- 63 files changed, 1054 insertions(+), 355 deletions(-) create mode 100644 Commands/Patogen008.cs create mode 100644 Commands/Recontain008.cs create mode 100644 Commands/Spawn0082.cs create mode 100644 Commands/Spawn01921.cs create mode 100644 Commands/Spawn01922.cs create mode 100644 Helpers.cs create mode 100644 Utils/ClassD.cs create mode 100644 Utils/Guard.cs create mode 100644 Utils/MtfMedic.cs create mode 100644 Utils/Scientist.cs create mode 100644 Utils/Scp0082.cs create mode 100644 Utils/Scp01921.cs create mode 100644 Utils/Scp01922.cs create mode 100644 Utils/Scp035.cs create mode 100644 Utils/Scp0352.cs create mode 100644 Utils/Scp049.cs create mode 100644 Utils/Scp0762.cs create mode 100644 Utils/Scp372.cs create mode 100644 Utils/Scp682.cs create mode 100644 Utils/Scp966.cs create mode 100644 Utils/Scp999.cs create mode 100644 Utils/TutorialHuman.cs create mode 100644 Utils/Worker.cs diff --git a/Commands/Aban.cs b/Commands/Aban.cs index 1d0400c..82e2fb6 100644 --- a/Commands/Aban.cs +++ b/Commands/Aban.cs @@ -12,7 +12,6 @@ public class Aban : ICommand public string Command => "aban"; public string[] Aliases => new string[] {}; public string Description => "Admin-ban для ивентов. Срок идёт только во время ивентов. Работает только на Foundation-X."; - public bool SanitizeResponse => false; public bool Execute(ArraySegment arguments, ICommandSender sender, out string response) { diff --git a/Commands/AllowSpawn.cs b/Commands/AllowSpawn.cs index c7b2a76..846922f 100644 --- a/Commands/AllowSpawn.cs +++ b/Commands/AllowSpawn.cs @@ -9,7 +9,6 @@ public class AllowSpawn : ICommand public string Command => "allowspawn"; public string[] Aliases => new string[] { }; public string Description => "Включает/выключает самостоятельный спавн ClassD. Доступно только на FX."; - public bool SanitizeResponse => false; public bool Execute(ArraySegment arguments, ICommandSender sender, out string response) { diff --git a/Commands/Breach244.cs b/Commands/Breach244.cs index bd8cbf0..367913b 100644 --- a/Commands/Breach244.cs +++ b/Commands/Breach244.cs @@ -12,7 +12,6 @@ public class Breach244 : ICommand public string Command => "breach244"; public string[] Aliases => new string[] { }; public string Description => "Вызывает НУС объекта SCP-244-A/B. Только для FX."; - public bool SanitizeResponse => false; public bool Execute(ArraySegment arguments, ICommandSender sender, out string response) { diff --git a/Commands/ChaosMode.cs b/Commands/ChaosMode.cs index 057e58e..9d8eb8a 100644 --- a/Commands/ChaosMode.cs +++ b/Commands/ChaosMode.cs @@ -13,7 +13,6 @@ public class ChaosMode : ICommand public string Command => "chaosmode"; public string[] Aliases => new string[] { }; public string Description => "Для FX. Включает режим хаоса для конкретной комнаты / для всего комплекса."; - public bool SanitizeResponse => false; public string[] Zones => new[] { "LCZ", "HCZ", "EZ", "SFC" }; public bool Execute(ArraySegment arguments, ICommandSender sender, out string response) diff --git a/Commands/CheckCode.cs b/Commands/CheckCode.cs index 33b0397..9fda41e 100644 --- a/Commands/CheckCode.cs +++ b/Commands/CheckCode.cs @@ -9,7 +9,6 @@ public class CheckCode : ICommand public string Command => "checkcode"; public string[] Aliases => new string[] { }; public string Description => "Для FX. Вывести действующий код."; - public bool SanitizeResponse => false; public bool Execute(ArraySegment arguments, ICommandSender sender, out string response) { diff --git a/Commands/CheckCodePlayer.cs b/Commands/CheckCodePlayer.cs index 48f1eb9..0fe9ff3 100644 --- a/Commands/CheckCodePlayer.cs +++ b/Commands/CheckCodePlayer.cs @@ -9,7 +9,6 @@ public class CheckCodePlayer : ICommand public string Command => "code"; public string[] Aliases => new string[] { }; public string Description => "Показывает текущий код FX."; - public bool SanitizeResponse => false; private const string Str1 = "Статус обеда: активен"; private const string Str2 = "Статус обеда: неактивен"; diff --git a/Commands/ClassD.cs b/Commands/ClassD.cs index 172025a..ef7c9ca 100644 --- a/Commands/ClassD.cs +++ b/Commands/ClassD.cs @@ -11,7 +11,6 @@ public class ClassD : ICommand public string Command => "classd"; public string[] Aliases => new string[] { }; public string Description => "Позволяет встать в очередь на спавн за Испытуемого. Работает только на Слишком Обычном Дне."; - public bool SanitizeResponse => false; public bool Execute(ArraySegment arguments, ICommandSender sender, out string response) { diff --git a/Commands/GoComplex.cs b/Commands/GoComplex.cs index 05dc3cc..73b6593 100644 --- a/Commands/GoComplex.cs +++ b/Commands/GoComplex.cs @@ -11,7 +11,6 @@ public class GoComplex : ICommand public string Command => "gocomplex"; public string[] Aliases => new [] { "gocm" }; public string Description => "Для FX. Отправляет людей на поверхность и кидает CASSIE."; - public bool SanitizeResponse => false; public bool Execute(ArraySegment arguments, ICommandSender sender, out string response) { diff --git a/Commands/Lock049Gate.cs b/Commands/Lock049Gate.cs index 00a0f26..a5b54a1 100644 --- a/Commands/Lock049Gate.cs +++ b/Commands/Lock049Gate.cs @@ -11,7 +11,6 @@ public class Lock049Gate : ICommand public string Command => "lock049gate"; public string[] Aliases => new string[] { }; public string Description => "Заблокировать/разблокировать гейт К.С. 049."; - public bool SanitizeResponse => false; public bool Execute(ArraySegment arguments, ICommandSender sender, out string response) { diff --git a/Commands/Lock173Gate.cs b/Commands/Lock173Gate.cs index 750e792..bd73376 100644 --- a/Commands/Lock173Gate.cs +++ b/Commands/Lock173Gate.cs @@ -11,7 +11,6 @@ public class Lock173Gate : ICommand public string Command => "lock173gate"; public string[] Aliases => new string[] { }; public string Description => "Заблокировать/разблокировать новый гейт SCP-173."; - public bool SanitizeResponse => false; public bool Execute(ArraySegment arguments, ICommandSender sender, out string response) { diff --git a/Commands/Lunch.cs b/Commands/Lunch.cs index 8da9f96..0160d84 100644 --- a/Commands/Lunch.cs +++ b/Commands/Lunch.cs @@ -11,7 +11,6 @@ public class Lunch : ICommand public string Command => "lunch"; public string[] Aliases => new string[] { }; public string Description => "Начинает или принудительно заканчивает обед. Сделано для FX."; - public bool SanitizeResponse => false; public bool Execute(ArraySegment arguments, ICommandSender sender, out string response) { diff --git a/Commands/ManageTesla.cs b/Commands/ManageTesla.cs index c25dc63..dc082a3 100644 --- a/Commands/ManageTesla.cs +++ b/Commands/ManageTesla.cs @@ -10,7 +10,6 @@ public class ManageTesla : ICommand public string Command => "managetesla"; public string[] Aliases => new[] { "mtesla" }; public string Description => "Управление тесла-гейтами. Использование: mtesla on/off"; - public bool SanitizeResponse => false; public bool Execute(ArraySegment arguments, ICommandSender sender, out string response) { diff --git a/Commands/Patogen008.cs b/Commands/Patogen008.cs new file mode 100644 index 0000000..0dbf491 --- /dev/null +++ b/Commands/Patogen008.cs @@ -0,0 +1,43 @@ +using System; +using CommandSystem; +using Exiled.API.Enums; +using Exiled.API.Features; +using Exiled.API.Features.Doors; +using MEC; + +namespace VeryUsualDay.Commands +{ + [CommandHandler(typeof(RemoteAdminCommandHandler))] + public class Patogen008 : ICommand + { + public string Command => "patogen008"; + public string[] Aliases => new string[] { }; + public string Description => "Вызывает НОУС SCP-008. FX."; + + public bool Execute(ArraySegment arguments, ICommandSender sender, out string response) + { + if (!VeryUsualDay.Instance.IsEnabledInRound) + { + response = "Режим СОД не включён!"; + return false; + } + if (VeryUsualDay.Instance.Is008Leaked) + { + Timing.KillCoroutines("_008_poisoning"); + Door.Get(DoorType.Scp106Primary).Unlock(); + VeryUsualDay.Instance.Is008Leaked = false; + Cassie.DelayedMessage("[ВОУС]: Объект-008 был перекрыт, распространение патогена прекращено. pitch_0.1 .G2 . pitch_1.0 . . . . . . ", 1f, isSubtitles: true, isNoisy: false); + response = "Распространение SCP-008 прекращено."; + } + else + { + Timing.RunCoroutine(VeryUsualDay.Instance._008_poisoning(), "_008_poisoning"); + Door.Get(DoorType.Scp106Primary).Lock(float.PositiveInfinity, DoorLockType.AdminCommand); + VeryUsualDay.Instance.Is008Leaked = true; + Cassie.DelayedMessage("[ВНИМАНИЕ] В зонах содержания зафиксировано распространение аномальной инфекции. Заражение перешло в активную стадию. Всем боевым единицам ликвидировать аномалии pitch_0.2 .G1 .G1 . .G6 .", 1f, isSubtitles: true, isNoisy: false); + response = "Распространение SCP-008 начато."; + } + return true; + } + } +} \ No newline at end of file diff --git a/Commands/PluginEnable.cs b/Commands/PluginEnable.cs index 5353114..3bbe794 100644 --- a/Commands/PluginEnable.cs +++ b/Commands/PluginEnable.cs @@ -5,7 +5,9 @@ using Exiled.API.Features; using MEC; using PlayerRoles; +using PluginAPI.Core.Items; using UnityEngine; +using Item = Exiled.API.Features.Items.Item; namespace VeryUsualDay.Commands { @@ -15,7 +17,6 @@ public class PluginEnable : ICommand public string Command => "fxmode"; public string[] Aliases => new string[] {}; public string Description => "Не использовать, если не проводите FX!"; - public bool SanitizeResponse => false; public bool Execute(ArraySegment arguments, ICommandSender sender, out string response) { @@ -24,6 +25,7 @@ public bool Execute(ArraySegment arguments, ICommandSender sender, out s VeryUsualDay.Instance.IsEnabledInRound = false; VeryUsualDay.Instance.IsLunchtimeActive = false; VeryUsualDay.Instance.IsDboysSpawnAllowed = false; + VeryUsualDay.Instance.Is008Leaked = false; VeryUsualDay.Instance.CurrentCode = VeryUsualDay.Codes.Green; VeryUsualDay.Instance.BuoCounter = 0; VeryUsualDay.Instance.SpawnedDboysCounter = 1; @@ -31,11 +33,13 @@ public bool Execute(ArraySegment arguments, ICommandSender sender, out s VeryUsualDay.Instance.SpawnedScientistCounter = 1; VeryUsualDay.Instance.SpawnedSecurityCounter = 1; VeryUsualDay.Instance.ScpPlayers.Clear(); + VeryUsualDay.Instance.Zombies.Clear(); VeryUsualDay.Instance.JoinedDboys.Clear(); VeryUsualDay.Instance.DBoysQueue.Clear(); VeryUsualDay.Instance.ChaosRooms.Clear(); VeryUsualDay.Instance.Shakheds.Clear(); // Timing.KillCoroutines("_avel"); + Timing.KillCoroutines("_008_poisoning"); Timing.KillCoroutines("_joining"); Timing.KillCoroutines("_prisonTimer"); Timing.KillCoroutines("_chaos"); @@ -48,7 +52,6 @@ public bool Execute(ArraySegment arguments, ICommandSender sender, out s player.TryGetSessionVariable("prisonReason", out string reason); player.TryGetSessionVariable("prisonTime", out Int32 time); VeryUsualDay.SendToPrison(player, time, reason); - // Log.Info($"Игроку {player.UserId} осталось в тюрьме {time} секунд. СОД закончен."); Timing.CallDelayed(3f, () => { player.UnMute(); @@ -67,9 +70,11 @@ public bool Execute(ArraySegment arguments, ICommandSender sender, out s { VeryUsualDay.Instance.IsEnabledInRound = true; // Timing.RunCoroutine(VeryUsualDay.Instance._avel(), "_avel"); + Timing.RunCoroutine(VeryUsualDay.Instance._008_poisoning(), "_008_poisoning"); Timing.RunCoroutine(VeryUsualDay.Instance._joining(), "_joining"); Timing.RunCoroutine(VeryUsualDay.Instance._prisonTimer(), "_prisonTimer"); Timing.RunCoroutine(VeryUsualDay.Instance._chaos(), "_chaos"); + foreach (var room in Room.List) { if (room.Zone != ZoneType.Unspecified && room.Color == Color.red) @@ -77,10 +82,12 @@ public bool Execute(ArraySegment arguments, ICommandSender sender, out s room.ResetColor(); } } + Timing.CallDelayed(5f, () => { VeryUsualDay.Instance.SupplyBoxCoords = Room.Get(RoomType.EzGateB).Position + new Vector3(-6.193f, 2.243f, -5.901f); }); + if (VeryUsualDay.Instance.Config.AuthToken != "") { foreach (var player in Player.List) @@ -99,6 +106,10 @@ public bool Execute(ArraySegment arguments, ICommandSender sender, out s } } + var vase = Item.Create(ItemType.SCP244a); + vase.Scale = new Vector3(8f, 8f, 8f); + vase.CreatePickup(Room.Get(RoomType.Lcz173).Position + new Vector3(20.193f, 13.6f, 7.638f)); + response = "Режим FX включён."; } return true; diff --git a/Commands/ReDoors.cs b/Commands/ReDoors.cs index fb742ee..29c75f9 100644 --- a/Commands/ReDoors.cs +++ b/Commands/ReDoors.cs @@ -12,7 +12,6 @@ public class ReDoors : ICommand public string Command => "redoors"; public string[] Aliases => new string[] { }; public string Description => "Позволяет рестартнуть систему дверей (FX)."; - public bool SanitizeResponse => false; public bool Execute(ArraySegment arguments, ICommandSender sender, out string response) { diff --git a/Commands/Recontain008.cs b/Commands/Recontain008.cs new file mode 100644 index 0000000..e024a05 --- /dev/null +++ b/Commands/Recontain008.cs @@ -0,0 +1,53 @@ +using System; +using CommandSystem; +using Exiled.API.Enums; +using Exiled.API.Features; +using Exiled.API.Features.Doors; +using MEC; +using PlayerRoles; + +namespace VeryUsualDay.Commands +{ + [CommandHandler(typeof(ClientCommandHandler))] + public class Recontain008 : ICommand + { + public string Command => "recontain008"; + public string[] Aliases => new string[] { }; + public string Description => "Восстанавливает ОУС SCP-008. Использовать только в К.С. SCP-008."; + + public bool Execute(ArraySegment arguments, ICommandSender sender, out string response) + { + if (!VeryUsualDay.Instance.Is008Leaked) + { + response = "ОУС SCP-008 не нарушены!"; + return false; + } + var playerSender = Player.Get(sender); + if (playerSender.CurrentRoom.Type != RoomType.Hcz106) + { + response = "Вы не находитесь в К.С. SCP-008."; + return false; + } + if (Door.Get(DoorType.Scp106Primary).IsLocked) + { + response = "Для ВОУС необходимо, чтобы дверь в К.С. SCP-008 была разблокирована."; + return false; + } + if (playerSender.Role.Team != Team.FoundationForces && playerSender.Role.Team != Team.ChaosInsurgency) + { + response = "Восстановить ОУС SCP-008 может только человек с ролью Охраны/МОГ/ПХ (рп-отыгровка: вам не хватило силы/знаний)"; + return false; + } + if (Math.Abs(Room.Get(RoomType.Hcz106).Position.z - playerSender.Position.z) < 19 && Math.Abs(Room.Get(RoomType.Hcz106).Position.x - playerSender.Position.x) < 18) + { + response = "Вы не находитесь в К.С. SCP-008."; + return false; + } + Cassie.DelayedMessage("[ВОУС]: Объект-008 был перекрыт, распространение патогена прекращено. pitch_0.1 .G2 . pitch_1.0 . . . . . . ", 1f, isSubtitles: true, isNoisy: false); + Timing.KillCoroutines("_008_poisoning"); + VeryUsualDay.Instance.Is008Leaked = false; + response = "ВОУС SCP-008 прошло успешно."; + return true; + } + } +} \ No newline at end of file diff --git a/Commands/Recontain244.cs b/Commands/Recontain244.cs index 7bc563e..a7c4648 100644 --- a/Commands/Recontain244.cs +++ b/Commands/Recontain244.cs @@ -12,7 +12,6 @@ public class Recontain244 : ICommand public string Command => "recontain244"; public string[] Aliases => new string[] { }; public string Description => "Вызывает ВОУС объекта SCP-244-A/B. Только для FX."; - public bool SanitizeResponse => false; public bool Execute(ArraySegment arguments, ICommandSender sender, out string response) { diff --git a/Commands/RoleDistribution.cs b/Commands/RoleDistribution.cs index 76d0f31..dcaa67b 100644 --- a/Commands/RoleDistribution.cs +++ b/Commands/RoleDistribution.cs @@ -9,7 +9,6 @@ public class RoleDistribution : ICommand public string Command => "roledistr"; public string[] Aliases => new string[] { }; public string Description => "Распределяет роли для людей из БД. Не использовать без FX."; - public bool SanitizeResponse => false; public bool Execute(ArraySegment arguments, ICommandSender sender, out string response) { diff --git a/Commands/SetCode.cs b/Commands/SetCode.cs index 5fe23d7..43c7042 100644 --- a/Commands/SetCode.cs +++ b/Commands/SetCode.cs @@ -11,7 +11,6 @@ public class SetCode : ICommand public string Command => "setcode"; public string[] Aliases => new [] { "code" }; public string Description => "Установить код в комплексе. Используется для FX."; - public bool SanitizeResponse => false; public bool Execute(ArraySegment arguments, ICommandSender sender, out string response) { diff --git a/Commands/Spawn0082.cs b/Commands/Spawn0082.cs new file mode 100644 index 0000000..e825f84 --- /dev/null +++ b/Commands/Spawn0082.cs @@ -0,0 +1,40 @@ +using System; +using System.Linq; +using CommandSystem; +using Exiled.API.Features; +using VeryUsualDay.Utils; + +namespace VeryUsualDay.Commands +{ + [CommandHandler(typeof(RemoteAdminCommandHandler))] + public class Spawn0082 : ICommand + { + public string Command => "spawn008-2"; + public string[] Aliases => new string[] { }; + public string Description => "Работает при СОД. Спавнит SCP-008-2."; + + public bool Execute(ArraySegment arguments, ICommandSender sender, out string response) + { + if (!VeryUsualDay.Instance.IsEnabledInRound) + { + response = "Режим СОД не включён!"; + return false; + } + var id = int.Parse(arguments.ToArray()[0]); + if (Player.TryGet(id, out var scp0082)) + { + if (VeryUsualDay.Instance.ScpPlayers.ContainsKey(id)) + { + var human = new TutorialHuman(scp0082); + response = "SCP удалён!"; + return true; + } + var scp = new Scp0082(scp0082, isPatogenZombie: false); + response = "SCP-008-2 создан!"; + return true; + } + response = "Не удалось найти игрока с таким ID!"; + return false; + } + } +} \ No newline at end of file diff --git a/Commands/Spawn01921.cs b/Commands/Spawn01921.cs new file mode 100644 index 0000000..ce8130e --- /dev/null +++ b/Commands/Spawn01921.cs @@ -0,0 +1,34 @@ +using System; +using System.Linq; +using CommandSystem; +using Exiled.API.Features; +using VeryUsualDay.Utils; + +namespace VeryUsualDay.Commands +{ + [CommandHandler(typeof(RemoteAdminCommandHandler))] + public class Spawn01921 : ICommand + { + public string Command => "spawn019-2-1"; + public string[] Aliases => new string[] { }; + public string Description => "Работает при FX. Спавнит SCP-019-2 (1 вариант)."; + + public bool Execute(ArraySegment arguments, ICommandSender sender, out string response) + { + if (!VeryUsualDay.Instance.IsEnabledInRound) + { + response = "Режим FX не включён!"; + return false; + } + + foreach (var id in arguments.ToArray()) + { + if (!Player.TryGet(int.Parse(id), out var player)) continue; + var scp = new Scp01921(player); + } + + response = "Игроки заспавнены."; + return true; + } + } +} \ No newline at end of file diff --git a/Commands/Spawn01922.cs b/Commands/Spawn01922.cs new file mode 100644 index 0000000..5ad7471 --- /dev/null +++ b/Commands/Spawn01922.cs @@ -0,0 +1,34 @@ +using System; +using System.Linq; +using CommandSystem; +using Exiled.API.Features; +using VeryUsualDay.Utils; + +namespace VeryUsualDay.Commands +{ + [CommandHandler(typeof(RemoteAdminCommandHandler))] + public class Spawn01922 + { + public string Command => "spawn019-2-2"; + public string[] Aliases => new string[] { }; + public string Description => "Работает при FX. Спавнит SCP-019-2 (2 вариант)."; + + public bool Execute(ArraySegment arguments, ICommandSender sender, out string response) + { + if (!VeryUsualDay.Instance.IsEnabledInRound) + { + response = "Режим FX не включён!"; + return false; + } + + foreach (var id in arguments.ToArray()) + { + if (!Player.TryGet(int.Parse(id), out var player)) continue; + var scp = new Scp01922(player); + } + + response = "Игроки заспавнены."; + return true; + } + } +} \ No newline at end of file diff --git a/Commands/Spawn035.cs b/Commands/Spawn035.cs index 419393c..6b49231 100644 --- a/Commands/Spawn035.cs +++ b/Commands/Spawn035.cs @@ -1,11 +1,8 @@ using System; using System.Linq; using CommandSystem; -using Exiled.API.Enums; using Exiled.API.Features; -using MEC; -using PlayerRoles; -using UnityEngine; +using VeryUsualDay.Utils; namespace VeryUsualDay.Commands { @@ -15,7 +12,6 @@ public class Spawn035 : ICommand public string Command => "spawn035"; public string[] Aliases => new string[] { }; public string Description => "Работает при FX. Спавнит SCP-035."; - public bool SanitizeResponse => false; public bool Execute(ArraySegment arguments, ICommandSender sender, out string response) { @@ -29,34 +25,12 @@ public bool Execute(ArraySegment arguments, ICommandSender sender, out s { if (VeryUsualDay.Instance.ScpPlayers.ContainsKey(id)) { - scp035.MaxHealth = 100f; - scp035.CustomInfo = "Человек"; - scp035.DisableEffect(EffectType.BodyshotReduction); - scp035.DisableEffect(EffectType.DamageReduction); - scp035.Role.Set(RoleTypeId.Tutorial, reason: SpawnReason.ForceClass); - scp035.Scale = new Vector3(1f, 1f, 1f); - VeryUsualDay.Instance.ScpPlayers.Remove(id); + var human = new TutorialHuman(scp035); response = "SCP удалён!"; return true; } - scp035.Role.Set(RoleTypeId.ClassD, reason: SpawnReason.ForceClass, spawnFlags: RoleSpawnFlags.AssignInventory); - Timing.CallDelayed(2f, () => - { - scp035.CustomInfo = "SCP-035"; - scp035.AddItem(ItemType.GunRevolver); - scp035.AddAmmo(AmmoType.Ammo44Cal, 32); - scp035.MaxHealth = 7500f; - scp035.Health = 7500f; - scp035.Scale = new Vector3(0.87f, 0.87f, 1f); - scp035.EnableEffect(EffectType.BodyshotReduction); - scp035.ChangeEffectIntensity(EffectType.BodyshotReduction, 15); - scp035.EnableEffect(EffectType.DamageReduction); - scp035.ChangeEffectIntensity(EffectType.DamageReduction, 15); - scp035.EnableEffect(EffectType.Poisoned); - scp035.IsGodModeEnabled = true; - VeryUsualDay.Instance.ScpPlayers.Add(id, VeryUsualDay.Scps.Scp035); - }); + var scp = new Scp035(scp035); response = "SCP-035 создан!"; return true; } diff --git a/Commands/Spawn0352.cs b/Commands/Spawn0352.cs index 86db33b..655d9a4 100644 --- a/Commands/Spawn0352.cs +++ b/Commands/Spawn0352.cs @@ -1,11 +1,8 @@ using System; using System.Linq; using CommandSystem; -using Exiled.API.Enums; using Exiled.API.Features; -using MEC; -using PlayerRoles; -using UnityEngine; +using VeryUsualDay.Utils; namespace VeryUsualDay.Commands { @@ -15,7 +12,6 @@ public class Spawn0352 : ICommand public string Command => "spawn035-2"; public string[] Aliases => new string[] { }; public string Description => "Работает при FX. Спавнит SCP-035-2."; - public bool SanitizeResponse => false; public bool Execute(ArraySegment arguments, ICommandSender sender, out string response) { @@ -29,25 +25,12 @@ public bool Execute(ArraySegment arguments, ICommandSender sender, out s { if (VeryUsualDay.Instance.ScpPlayers.ContainsKey(id)) { - scp0352.MaxHealth = 100f; - scp0352.CustomInfo = "Человек"; - scp0352.Role.Set(RoleTypeId.Tutorial, reason: SpawnReason.ForceClass); - scp0352.Scale = new Vector3(1f, 1f, 1f); - VeryUsualDay.Instance.ScpPlayers.Remove(id); + var human = new TutorialHuman(scp0352); response = "SCP удалён!"; return true; } - Timing.CallDelayed(2f, () => - { - scp0352.CustomInfo = "SCP-035-2"; - scp0352.MaxHealth = 350f; - scp0352.Health = 350f; - scp0352.Scale = new Vector3(1f, 1f, 1f); - scp0352.IsGodModeEnabled = false; - scp0352.Broadcast(10, "Вы теперь подчиняетесь SCP-035."); - VeryUsualDay.Instance.ScpPlayers.Add(id, VeryUsualDay.Scps.Scp0352); - }); + var scp = new Scp0352(scp0352); response = "SCP-035-2 создан!"; return true; } diff --git a/Commands/Spawn049.cs b/Commands/Spawn049.cs index ae5f483..f33d60d 100644 --- a/Commands/Spawn049.cs +++ b/Commands/Spawn049.cs @@ -1,11 +1,8 @@ using System; using System.Linq; using CommandSystem; -using Exiled.API.Enums; using Exiled.API.Features; -using MEC; -using PlayerRoles; -using UnityEngine; +using VeryUsualDay.Utils; namespace VeryUsualDay.Commands { @@ -15,7 +12,6 @@ public class Spawn049 : ICommand public string Command => "spawn049"; public string[] Aliases => new string[] { }; public string Description => "Работает при FX. Спавнит SCP-049."; - public bool SanitizeResponse => false; public bool Execute(ArraySegment arguments, ICommandSender sender, out string response) { @@ -29,25 +25,12 @@ public bool Execute(ArraySegment arguments, ICommandSender sender, out s { if (VeryUsualDay.Instance.ScpPlayers.ContainsKey(id)) { - scp049.MaxHealth = 100f; - scp049.CustomInfo = "Человек"; - scp049.Role.Set(RoleTypeId.Tutorial, reason: SpawnReason.ForceClass); - scp049.Scale = new Vector3(1f, 1f, 1f); - VeryUsualDay.Instance.ScpPlayers.Remove(id); + var human = new TutorialHuman(scp049); response = "SCP удалён!"; return true; } - scp049.Role.Set(RoleTypeId.Scp049, reason: SpawnReason.ForceClass, spawnFlags: RoleSpawnFlags.AssignInventory); - Timing.CallDelayed(2f, () => - { - scp049.CustomInfo = "SCP-049"; - scp049.MaxHealth = 13000f; - scp049.Health = 13000f; - scp049.Scale = new Vector3(1f, 1f, 1f); - scp049.IsGodModeEnabled = false; - VeryUsualDay.Instance.ScpPlayers.Add(id, VeryUsualDay.Scps.Scp049); - }); + var scp = new Scp049(scp049); response = "SCP-049 создан!"; return true; } diff --git a/Commands/Spawn0762.cs b/Commands/Spawn0762.cs index d6f4e04..1a0b157 100644 --- a/Commands/Spawn0762.cs +++ b/Commands/Spawn0762.cs @@ -6,6 +6,7 @@ using MEC; using PlayerRoles; using UnityEngine; +using VeryUsualDay.Utils; namespace VeryUsualDay.Commands { @@ -15,7 +16,6 @@ public class Spawn0762 : ICommand public string Command => "spawn076-2"; public string[] Aliases => new string[] { }; public string Description => "Работает при FX. Спавнит Авеля."; - public bool SanitizeResponse => false; public bool Execute(ArraySegment arguments, ICommandSender sender, out string response) { @@ -30,35 +30,12 @@ public bool Execute(ArraySegment arguments, ICommandSender sender, out s { if (VeryUsualDay.Instance.ScpPlayers.ContainsKey(id)) { - avel.MaxHealth = 100f; - avel.CustomInfo = "Человек"; - avel.DisableEffect(EffectType.MovementBoost); - avel.DisableEffect(EffectType.BodyshotReduction); - avel.DisableEffect(EffectType.DamageReduction); - avel.Role.Set(RoleTypeId.Tutorial, reason: SpawnReason.ForceClass); - avel.Scale = new Vector3(1f, 1f, 1f); - VeryUsualDay.Instance.ScpPlayers.Remove(id); + var human = new TutorialHuman(avel); response = "SCP удалён!"; return true; } - avel.Role.Set(RoleTypeId.Tutorial, reason: SpawnReason.ForceClass, - spawnFlags: RoleSpawnFlags.AssignInventory); - Timing.CallDelayed(2f, () => - { - avel.CustomInfo = "SCP-076-2"; - avel.MaxHealth = 9500f; - avel.Health = 9500f; - avel.EnableEffect(EffectType.MovementBoost); - avel.EnableEffect(EffectType.BodyshotReduction); - avel.EnableEffect(EffectType.DamageReduction); - avel.ChangeEffectIntensity(EffectType.MovementBoost, 25); - avel.ChangeEffectIntensity(EffectType.BodyshotReduction, 70); - avel.ChangeEffectIntensity(EffectType.DamageReduction, 70); - avel.CurrentItem = avel.AddItem(ItemType.Jailbird); - avel.Scale = new Vector3(1.15f, 1.15f, 1.15f); - VeryUsualDay.Instance.ScpPlayers.Add(id, VeryUsualDay.Scps.Scp0762); - }); + var scp = new Scp0762(avel); response = "Авель создан!"; return true; } diff --git a/Commands/Spawn372.cs b/Commands/Spawn372.cs index 32b6cd4..945137b 100644 --- a/Commands/Spawn372.cs +++ b/Commands/Spawn372.cs @@ -1,11 +1,8 @@ using System; using System.Linq; using CommandSystem; -using Exiled.API.Enums; using Exiled.API.Features; -using MEC; -using PlayerRoles; -using UnityEngine; +using VeryUsualDay.Utils; namespace VeryUsualDay.Commands { @@ -15,7 +12,6 @@ public class Spawn372 : ICommand public string Command => "spawn372"; public string[] Aliases => new string[] { }; public string Description => "Работает при FX. Спавнит SCP-372."; - public bool SanitizeResponse => false; public bool Execute(ArraySegment arguments, ICommandSender sender, out string response) { @@ -29,27 +25,12 @@ public bool Execute(ArraySegment arguments, ICommandSender sender, out s { if (VeryUsualDay.Instance.ScpPlayers.ContainsKey(id)) { - scp372.MaxHealth = 100f; - scp372.CustomInfo = "Человек"; - scp372.DisableEffect(EffectType.MovementBoost); - scp372.Role.Set(RoleTypeId.Tutorial, reason: SpawnReason.ForceClass); - scp372.Scale = new Vector3(1f, 1f, 1f); - VeryUsualDay.Instance.ScpPlayers.Remove(id); + var human = new TutorialHuman(scp372); response = "SCP удалён!"; return true; } - scp372.Role.Set(RoleTypeId.Scp939, reason: SpawnReason.ForceClass, spawnFlags: RoleSpawnFlags.AssignInventory); - Timing.CallDelayed(2f, () => - { - scp372.CustomInfo = "SCP-372"; - scp372.MaxHealth = 650f; - scp372.Health = 650f; - scp372.Scale = new Vector3(0.1f, 0.8f, 1f); - scp372.EnableEffect(EffectType.MovementBoost); - scp372.ChangeEffectIntensity(EffectType.MovementBoost, 255); - VeryUsualDay.Instance.ScpPlayers.Add(id, VeryUsualDay.Scps.Scp372); - }); + var scp = new Scp372(scp372); response = "SCP-372 создан!"; return true; } diff --git a/Commands/Spawn682.cs b/Commands/Spawn682.cs index ede9d47..b89e146 100644 --- a/Commands/Spawn682.cs +++ b/Commands/Spawn682.cs @@ -1,11 +1,8 @@ using System; using System.Linq; using CommandSystem; -using Exiled.API.Enums; using Exiled.API.Features; -using MEC; -using PlayerRoles; -using UnityEngine; +using VeryUsualDay.Utils; namespace VeryUsualDay.Commands { @@ -15,7 +12,6 @@ public class Spawn682 : ICommand public string Command => "spawn682"; public string[] Aliases => new string[] { }; public string Description => "Работает при FX. Спавнит SCP-682-MT."; - public bool SanitizeResponse => false; public bool Execute(ArraySegment arguments, ICommandSender sender, out string response) { @@ -29,36 +25,12 @@ public bool Execute(ArraySegment arguments, ICommandSender sender, out s { if (VeryUsualDay.Instance.ScpPlayers.ContainsKey(id)) { - scp682.MaxHealth = 100f; - scp682.CustomInfo = "Человек"; - scp682.DisableEffect(EffectType.Invigorated); - scp682.DisableEffect(EffectType.RainbowTaste); - scp682.DisableEffect(EffectType.Disabled); - scp682.Role.Set(RoleTypeId.Tutorial, reason: SpawnReason.ForceClass); - scp682.Scale = new Vector3(1f, 1f, 1f); - VeryUsualDay.Instance.ScpPlayers.Remove(id); + var human = new TutorialHuman(scp682); response = "SCP удалён!"; return true; } - scp682.Role.Set(RoleTypeId.Scp939, reason: SpawnReason.ForceClass, spawnFlags: RoleSpawnFlags.AssignInventory); - Timing.CallDelayed(2f, () => - { - scp682.CustomInfo = "SCP-682-MT"; - scp682.MaxHealth = 15000f; - scp682.Health = 15000f; - scp682.HumeShield = 5000f; - scp682.Scale = new Vector3(1.2f, 1.25f, 1.2f); - scp682.IsGodModeEnabled = false; - scp682.EnableEffect(EffectType.Invigorated); - scp682.EnableEffect(EffectType.RainbowTaste); - scp682.EnableEffect(EffectType.Disabled); - scp682.EnableEffect(EffectType.DamageReduction); - scp682.EnableEffect(EffectType.BodyshotReduction); - scp682.ChangeEffectIntensity(EffectType.DamageReduction, 30); - scp682.ChangeEffectIntensity(EffectType.BodyshotReduction, 30); - VeryUsualDay.Instance.ScpPlayers.Add(id, VeryUsualDay.Scps.Scp682); - }); + var scp = new Scp682(scp682); response = "SCP-682 создан!"; return true; } diff --git a/Commands/Spawn966.cs b/Commands/Spawn966.cs index 4ebf52b..ae8bdd4 100644 --- a/Commands/Spawn966.cs +++ b/Commands/Spawn966.cs @@ -1,11 +1,8 @@ using System; using System.Linq; using CommandSystem; -using Exiled.API.Enums; using Exiled.API.Features; -using MEC; -using PlayerRoles; -using UnityEngine; +using VeryUsualDay.Utils; namespace VeryUsualDay.Commands { @@ -17,7 +14,6 @@ public class Spawn966 : ICommand public string[] Aliases => new string[] { }; public string Description => "Работает при FX. Спавнит SCP-966."; - public bool SanitizeResponse => false; public bool Execute(ArraySegment arguments, ICommandSender sender, out string response) { @@ -31,25 +27,12 @@ public bool Execute(ArraySegment arguments, ICommandSender sender, out s { if (VeryUsualDay.Instance.ScpPlayers.ContainsKey(id)) { - scp966.MaxHealth = 100f; - scp966.CustomInfo = "Человек"; - scp966.Role.Set(RoleTypeId.Tutorial, reason: SpawnReason.ForceClass); - scp966.Scale = new Vector3(1f, 1f, 1f); - VeryUsualDay.Instance.ScpPlayers.Remove(id); + var human = new TutorialHuman(scp966); response = "SCP удалён!"; return true; } - scp966.Role.Set(RoleTypeId.Scp0492, reason: SpawnReason.ForceClass, spawnFlags: RoleSpawnFlags.AssignInventory); - Timing.CallDelayed(2f, () => - { - scp966.CustomInfo = "SCP-966"; - scp966.MaxHealth = 1000f; - scp966.Health = 1000f; - scp966.Scale = new Vector3(0f, 1f, 0f); - scp966.IsGodModeEnabled = false; - VeryUsualDay.Instance.ScpPlayers.Add(id, VeryUsualDay.Scps.Scp966); - }); + var scp = new Scp966(scp966); response = "SCP-966 создан!"; return true; } diff --git a/Commands/Spawn999.cs b/Commands/Spawn999.cs index 25ea701..d3dcaa5 100644 --- a/Commands/Spawn999.cs +++ b/Commands/Spawn999.cs @@ -1,11 +1,8 @@ using System; using System.Linq; using CommandSystem; -using Exiled.API.Enums; using Exiled.API.Features; -using MEC; -using PlayerRoles; -using UnityEngine; +using VeryUsualDay.Utils; namespace VeryUsualDay.Commands { @@ -15,7 +12,6 @@ public class Spawn999 : ICommand public string Command => "spawn999"; public string[] Aliases => new string[] { }; public string Description => "Работает при FX. Спавнит SCP-999."; - public bool SanitizeResponse => false; public bool Execute(ArraySegment arguments, ICommandSender sender, out string response) { @@ -29,25 +25,12 @@ public bool Execute(ArraySegment arguments, ICommandSender sender, out s { if (VeryUsualDay.Instance.ScpPlayers.ContainsKey(id)) { - scp999.MaxHealth = 100f; - scp999.CustomInfo = "Человек"; - scp999.Role.Set(RoleTypeId.Tutorial, reason: SpawnReason.ForceClass); - scp999.Scale = new Vector3(1f, 1f, 1f); - VeryUsualDay.Instance.ScpPlayers.Remove(id); + var human = new TutorialHuman(scp999); response = "SCP удалён!"; return true; } - scp999.Role.Set(RoleTypeId.Tutorial, reason: SpawnReason.ForceClass, spawnFlags: RoleSpawnFlags.AssignInventory); - Timing.CallDelayed(2f, () => - { - scp999.CustomInfo = "SCP-999"; - scp999.MaxHealth = 10000f; - scp999.Health = 10000f; - scp999.Scale = new Vector3(1f, 0.1f, 1f); - scp999.IsGodModeEnabled = false; - VeryUsualDay.Instance.ScpPlayers.Add(id, VeryUsualDay.Scps.Scp999); - }); + var scp = new Scp999(scp999); response = "SCP-999 создан!"; return true; } diff --git a/Commands/Spawnbuo.cs b/Commands/Spawnbuo.cs index dc54916..55c2f62 100644 --- a/Commands/Spawnbuo.cs +++ b/Commands/Spawnbuo.cs @@ -16,7 +16,6 @@ public class Spawnbuo : ICommand public string[] Aliases => new string[] { }; public string Description => "Позволяет заспавнить бойцов БУО. Использование: spawnbuo . Для FX."; - public bool SanitizeResponse => false; public bool Execute(ArraySegment arguments, ICommandSender sender, out string response) { @@ -41,8 +40,8 @@ public bool Execute(ArraySegment arguments, ICommandSender sender, out s player.Role.Set(RoleTypeId.ChaosConscript, RoleSpawnFlags.AssignInventory); Timing.CallDelayed(2f, () => { - player.MaxHealth = 300f; - player.Health = 300f; + player.MaxHealth = 375f; + player.Health = 375f; player.ResetInventory(VeryUsualDay.Instance.Config.BuoPrivateInventory); player.AddAmmo(AmmoType.Ammo44Cal, 16); player.AddAmmo(AmmoType.Ammo12Gauge, 28); @@ -57,8 +56,8 @@ public bool Execute(ArraySegment arguments, ICommandSender sender, out s player.Role.Set(RoleTypeId.ChaosRifleman, RoleSpawnFlags.AssignInventory); Timing.CallDelayed(2f, () => { - player.MaxHealth = 350f; - player.Health = 350f; + player.MaxHealth = 425f; + player.Health = 425f; player.ResetInventory(VeryUsualDay.Instance.Config.BuoSergeantInventory); player.AddAmmo(AmmoType.Ammo44Cal, 16); player.AddAmmo(AmmoType.Nato556, 100); @@ -73,8 +72,8 @@ public bool Execute(ArraySegment arguments, ICommandSender sender, out s player.Role.Set(RoleTypeId.ChaosMarauder, RoleSpawnFlags.AssignInventory); Timing.CallDelayed(2f, () => { - player.MaxHealth = 400f; - player.Health = 400f; + player.MaxHealth = 475f; + player.Health = 475f; player.ResetInventory(VeryUsualDay.Instance.Config.BuoJaggerInventory); player.AddAmmo(AmmoType.Ammo44Cal, 16); player.AddAmmo(AmmoType.Nato762, 200); @@ -89,8 +88,8 @@ public bool Execute(ArraySegment arguments, ICommandSender sender, out s player.Role.Set(RoleTypeId.ChaosRepressor, RoleSpawnFlags.AssignInventory); Timing.CallDelayed(2f, () => { - player.MaxHealth = 450f; - player.Health = 450f; + player.MaxHealth = 525f; + player.Health = 525f; player.ResetInventory(VeryUsualDay.Instance.Config.BuoTerminatorInventory); player.AddAmmo(AmmoType.Nato556, 120); player.CustomName = $"БУО #{VeryUsualDay.Instance.BuoCounter} - ##-{peopleCounter}"; diff --git a/Commands/SupplyCassie.cs b/Commands/SupplyCassie.cs index 94b0ec4..34ffe1c 100644 --- a/Commands/SupplyCassie.cs +++ b/Commands/SupplyCassie.cs @@ -10,7 +10,6 @@ public class SupplyCassie : ICommand public string Command => "supplycassie"; public string[] Aliases => new string[] { }; public string Description => "Вызывает CASSIE о доставке SCP. Только для FX."; - public bool SanitizeResponse => false; public bool Execute(ArraySegment arguments, ICommandSender sender, out string response) { diff --git a/Commands/VudClassD.cs b/Commands/VudClassD.cs index cba4033..2abf284 100644 --- a/Commands/VudClassD.cs +++ b/Commands/VudClassD.cs @@ -1,10 +1,7 @@ using System; using System.Linq; using CommandSystem; -using Exiled.API.Enums; using Exiled.API.Features; -using MEC; -using PlayerRoles; namespace VeryUsualDay.Commands { @@ -14,7 +11,6 @@ public class VudClassD : ICommand public string Command => "vudclassd"; public string[] Aliases => new string[] { }; public string Description => "Спавнит испытуемого на FX."; - public bool SanitizeResponse => false; public bool Execute(ArraySegment arguments, ICommandSender sender, out string response) { @@ -33,18 +29,7 @@ public bool Execute(ArraySegment arguments, ICommandSender sender, out s { if (Player.TryGet(id, out var dboy)) { - dboy.Role.Set(RoleTypeId.ClassD, reason: SpawnReason.ForceClass, spawnFlags: RoleSpawnFlags.All); - Timing.CallDelayed(1f, () => - { - dboy.ClearInventory(); - dboy.Handcuff(); - dboy.MaxHealth = 115f; - dboy.Health = 115f; - dboy.CustomName = $"Испытуемый - ##-{VeryUsualDay.Instance.SpawnedDboysCounter}"; - dboy.CustomInfo = "Человек"; - dboy.Broadcast(10, "Вы стали Испытуемым! Можете сотрудничать с фондом или принимать попытки побега при первой возможности. "); - VeryUsualDay.Instance.SpawnedDboysCounter += 1; - }); + var classd = new Utils.ClassD(dboy); cnt += 1; } else diff --git a/Commands/VudClear.cs b/Commands/VudClear.cs index 0a63229..7852c1b 100644 --- a/Commands/VudClear.cs +++ b/Commands/VudClear.cs @@ -11,7 +11,6 @@ public class VudClear : ICommand public string Command => "vudclear"; public string[] Aliases => new string[] { }; public string Description => "Очищает с пола все предметы, за исключением тех, что указаны в конфиге."; - public bool SanitizeResponse => false; public bool Execute(ArraySegment arguments, ICommandSender sender, out string response) { diff --git a/Commands/VudGuard.cs b/Commands/VudGuard.cs index ca11bf1..dbbc65b 100644 --- a/Commands/VudGuard.cs +++ b/Commands/VudGuard.cs @@ -1,10 +1,8 @@ using System; using System.Linq; using CommandSystem; -using Exiled.API.Enums; using Exiled.API.Features; -using MEC; -using PlayerRoles; +using VeryUsualDay.Utils; namespace VeryUsualDay.Commands { @@ -14,7 +12,6 @@ public class VudGuard : ICommand public string Command => "vudguard"; public string[] Aliases => new string[] { }; public string Description => "Спавнит СБ-стажёра на FX."; - public bool SanitizeResponse => false; public bool Execute(ArraySegment arguments, ICommandSender sender, out string response) { @@ -32,21 +29,7 @@ public bool Execute(ArraySegment arguments, ICommandSender sender, out s { if (Player.TryGet(id, out var guard)) { - guard.Role.Set(RoleTypeId.FacilityGuard, reason: SpawnReason.ForceClass, spawnFlags: RoleSpawnFlags.AssignInventory); - Timing.CallDelayed(2f, () => - { - guard.MaxHealth = 100f; - guard.Health = 100f; - guard.ClearInventory(); - guard.AddItem(ItemType.GunCOM15); - guard.AddItem(ItemType.KeycardJanitor); - guard.AddItem(ItemType.Painkillers); - guard.AddItem(ItemType.Radio); - guard.CustomName = $"Охранник - ##-{VeryUsualDay.Instance.SpawnedSecurityCounter}"; - guard.CustomInfo = "Человек"; - guard.Broadcast(10, "Вы вступили в Службу Безопасности! Патрулируйте комплекс, сохраняйте безопасную обстановку в подземной части."); - VeryUsualDay.Instance.SpawnedSecurityCounter += 1; - }); + var security = new Guard(guard); } else { diff --git a/Commands/VudMedic.cs b/Commands/VudMedic.cs index 34b22a2..6bce5f8 100644 --- a/Commands/VudMedic.cs +++ b/Commands/VudMedic.cs @@ -1,12 +1,8 @@ using System; using System.Linq; using CommandSystem; -using Exiled.API.Enums; using Exiled.API.Features; -using Exiled.CustomItems.API.Features; -using MEC; -using PlayerRoles; -using UnityEngine; +using VeryUsualDay.Utils; namespace VeryUsualDay.Commands { @@ -34,27 +30,7 @@ public bool Execute(ArraySegment arguments, ICommandSender sender, out s { if (Player.TryGet(id, out var medic)) { - medic.Role.Set(RoleTypeId.FacilityGuard, reason: SpawnReason.ForceClass, spawnFlags: RoleSpawnFlags.AssignInventory); - Timing.CallDelayed(2f, () => - { - medic.MaxHealth = 200f; - medic.Health = 200f; - medic.Scale = new Vector3(1.03f, 1.03f, 1.03f); - medic.ClearInventory(); - medic.AddItem(ItemType.GunCrossvec); - medic.AddItem(ItemType.KeycardGuard); - medic.AddItem(ItemType.ArmorCombat); - medic.AddItem(ItemType.Radio); - medic.AddItem(ItemType.Painkillers); - medic.AddItem(ItemType.Painkillers); - medic.AddAmmo(AmmoType.Nato9, 60); - CustomItem.TryGive(medic, "MG-119"); - medic.EnableEffect(EffectType.BodyshotReduction, 10); - medic.EnableEffect(EffectType.DamageReduction, 10); - medic.EnableEffect(EffectType.MovementBoost, 2); - medic.CustomInfo = "Медик Реагирования"; - medic.Broadcast(10, "Вы стали медиком СБ! Вы прошли обучение в мед. центре Фонда, и теперь готовы защищать сотрудников от аномалий."); - }); + var mtf = new MtfMedic(medic); } else { diff --git a/Commands/VudMood.cs b/Commands/VudMood.cs index 5be24d3..29a9b2a 100644 --- a/Commands/VudMood.cs +++ b/Commands/VudMood.cs @@ -11,7 +11,6 @@ public class VudMood : ICommand public string Command => "vudmood"; public string[] Aliases => new string[] { }; public string Description => "Для FX. Изменяет состояние игрока. Использование: vudmood <новое состояние>"; - public bool SanitizeResponse => false; public bool Execute(ArraySegment arguments, ICommandSender sender, out string response) { diff --git a/Commands/VudScience.cs b/Commands/VudScience.cs index 88bacf3..e0b6755 100644 --- a/Commands/VudScience.cs +++ b/Commands/VudScience.cs @@ -1,10 +1,8 @@ using System; using System.Linq; using CommandSystem; -using Exiled.API.Enums; using Exiled.API.Features; -using MEC; -using PlayerRoles; +using VeryUsualDay.Utils; namespace VeryUsualDay.Commands { @@ -14,7 +12,6 @@ public class VudScience : ICommand public string Command => "vudscience"; public string[] Aliases => new string[] { }; public string Description => "Спавнит стажёра-научника на FX."; - public bool SanitizeResponse => false; public bool Execute(ArraySegment arguments, ICommandSender sender, out string response) { @@ -32,21 +29,7 @@ public bool Execute(ArraySegment arguments, ICommandSender sender, out s { if (Player.TryGet(id, out var scientist)) { - scientist.Role.Set(RoleTypeId.Scientist, reason: SpawnReason.ForceClass, spawnFlags: RoleSpawnFlags.AssignInventory); - Timing.CallDelayed(2f, () => - { - scientist.ClearInventory(); - scientist.MaxHealth = 100f; - scientist.Health = 100f; - scientist.AddItem(ItemType.KeycardJanitor); - scientist.AddItem(ItemType.Painkillers); - scientist.AddItem(ItemType.Flashlight); - scientist.AddItem(ItemType.Radio); - scientist.CustomName = $"Сотрудник - ##-{VeryUsualDay.Instance.SpawnedScientistCounter}"; - scientist.CustomInfo = "Человек"; - scientist.Broadcast(10, "Вы вступили в Научный отдел! Исследуйте и сдерживайте аномалии, помогайте работе фонда."); - VeryUsualDay.Instance.SpawnedScientistCounter += 1; - }); + var player = new Scientist(scientist); } else { diff --git a/Commands/VudSupply.cs b/Commands/VudSupply.cs index a5d41a2..a7bb681 100644 --- a/Commands/VudSupply.cs +++ b/Commands/VudSupply.cs @@ -14,7 +14,6 @@ public class VudSupply : ICommand public string Command => "vudsupply"; public string[] Aliases => new string[] { }; public string Description => "Поставка припасов на FXе."; - public bool SanitizeResponse => false; private Vector3 _coords; public bool Execute(ArraySegment arguments, ICommandSender sender, out string response) diff --git a/Commands/VudWorker.cs b/Commands/VudWorker.cs index 4254654..56b67aa 100644 --- a/Commands/VudWorker.cs +++ b/Commands/VudWorker.cs @@ -5,6 +5,7 @@ using Exiled.API.Features; using MEC; using PlayerRoles; +using VeryUsualDay.Utils; namespace VeryUsualDay.Commands { @@ -14,7 +15,6 @@ public class VudWorker : ICommand public string Command => "vudworker"; public string[] Aliases => new string[] { }; public string Description => "Спавнит стажёра-рабочего на FX."; - public bool SanitizeResponse => false; public bool Execute(ArraySegment arguments, ICommandSender sender, out string response) { @@ -32,19 +32,7 @@ public bool Execute(ArraySegment arguments, ICommandSender sender, out s { if (Player.TryGet(id, out var worker)) { - worker.Role.Set(RoleTypeId.ClassD, reason: SpawnReason.ForceClass, spawnFlags: RoleSpawnFlags.AssignInventory); - Timing.CallDelayed(2f, () => - { - worker.ClearInventory(); - worker.MaxHealth = 110f; - worker.Health = 110f; - worker.AddItem(ItemType.KeycardJanitor); - worker.AddItem(ItemType.Flashlight); - worker.CustomName = $"Рабочий - ##-{VeryUsualDay.Instance.SpawnedWorkersCounter}"; - worker.CustomInfo = "Человек"; - worker.Broadcast(10, "Вы вступили в отдел Рабочих! Работайте в столовой комплекса и следите за порядком в коридорах."); - VeryUsualDay.Instance.SpawnedWorkersCounter += 1; - }); + var player = new Worker(worker); } else { diff --git a/Handlers/Player.cs b/Handlers/Player.cs index 51b0d4b..04af64f 100644 --- a/Handlers/Player.cs +++ b/Handlers/Player.cs @@ -8,6 +8,7 @@ using MEC; using PlayerRoles; using UnityEngine; +using VeryUsualDay.Utils; namespace VeryUsualDay.Handlers { @@ -31,7 +32,7 @@ public static void OnChangingRole(ChangingRoleEventArgs ev) { if (!VeryUsualDay.Instance.IsEnabledInRound) return; ev.Player.SessionVariables.Remove("vudmood"); - if (ev.NewRole != RoleTypeId.Spectator && (ev.NewRole != RoleTypeId.Tutorial || ev.Player.CustomName.Split(' ')[0] == "Агент")) + if (ev.NewRole != RoleTypeId.Spectator && ev.NewRole.GetSide() != Side.Scp && (ev.NewRole != RoleTypeId.Tutorial || ev.Player.CustomName.Split(' ')[0] == "Агент")) { ev.Player.SessionVariables.Add("vudmood", "Полностью здоров"); } @@ -40,6 +41,14 @@ public static void OnChangingRole(ChangingRoleEventArgs ev) if (ev.Player.TryGetSessionVariable("isInPrison", out bool prisonState) && prisonState) return; if (ev.NewRole != RoleTypeId.Spectator || ev.Reason == SpawnReason.ForceClass) return; + + if (VeryUsualDay.Instance.Is008Leaked) + { + if (ev.Player.Role.Type == RoleTypeId.Scp0492) + { + return; + } + } if (ev.Reason == SpawnReason.Died || ev.Reason == SpawnReason.Destroyed) { @@ -136,6 +145,15 @@ public static void OnHurting(HurtingEventArgs ev) } } + public static void OnDying(DyingEventArgs ev) + { + if (VeryUsualDay.Instance.CurrentCode == VeryUsualDay.Codes.Green || + VeryUsualDay.Instance.CurrentCode == VeryUsualDay.Codes.Emerald) + { + ev.Player.ClearInventory(destroy: true); + } + } + public static void OnDied(DiedEventArgs ev) { if (!VeryUsualDay.Instance.IsEnabledInRound) return; @@ -144,6 +162,24 @@ public static void OnDied(DiedEventArgs ev) ev.Player.Scale = new Vector3(1f, 1f, 1f); ev.Player.SessionVariables.Remove("vudmood"); + if (VeryUsualDay.Instance.Zombies.Contains(ev.Player.Id)) + { + ev.Player.UnMute(); + VeryUsualDay.Instance.Zombies.Remove(ev.Player.Id); + } + else if (!VeryUsualDay.Instance.ScpPlayers.ContainsKey(ev.Player.Id) && VeryUsualDay.Instance.Is008Leaked) + { + Timing.CallDelayed(2f, () => + { + var scp = new Scp0082(ev.Player, true); + }); + } + if (VeryUsualDay.Instance.ScpPlayers.ContainsKey(ev.Player.Id)) + { + if (VeryUsualDay.Instance.ScpPlayers[ev.Player.Id] == VeryUsualDay.Scps.Scp0082) ev.Player.UnMute(); + VeryUsualDay.Instance.ScpPlayers.Remove(ev.Player.Id); + } + if (VeryUsualDay.Instance.DBoysQueue.Contains(ev.Player.Id)) { VeryUsualDay.Instance.DBoysQueue.Remove(ev.Player.Id); @@ -171,6 +207,11 @@ public static void OnLeft(LeftEventArgs ev) ev.Player.TryGetSessionVariable("prisonTime", out int time); VeryUsualDay.SendToPrison(ev.Player, time, reason); } + if (VeryUsualDay.Instance.Zombies.Contains(ev.Player.Id)) + { + ev.Player.UnMute(); + VeryUsualDay.Instance.Zombies.Remove(ev.Player.Id); + } if (!VeryUsualDay.Instance.IsEnabledInRound) return; if (VeryUsualDay.Instance.ScpPlayers.ContainsKey(ev.Player.Id)) { diff --git a/Handlers/Server.cs b/Handlers/Server.cs index b781e93..787afd4 100644 --- a/Handlers/Server.cs +++ b/Handlers/Server.cs @@ -19,11 +19,13 @@ public static void OnWaitingForPlayers() VeryUsualDay.Instance.SpawnedScientistCounter = 1; VeryUsualDay.Instance.SpawnedSecurityCounter = 1; VeryUsualDay.Instance.ScpPlayers.Clear(); + VeryUsualDay.Instance.Zombies.Clear(); VeryUsualDay.Instance.JoinedDboys.Clear(); VeryUsualDay.Instance.DBoysQueue.Clear(); VeryUsualDay.Instance.ChaosRooms.Clear(); VeryUsualDay.Instance.Shakheds.Clear(); // Timing.KillCoroutines("_avel"); + Timing.KillCoroutines("_008_poisoning"); Timing.KillCoroutines("_joining"); Timing.KillCoroutines("_prisonTimer"); Timing.KillCoroutines("_chaos"); diff --git a/Helpers.cs b/Helpers.cs new file mode 100644 index 0000000..f6b8c03 --- /dev/null +++ b/Helpers.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using Random = UnityEngine.Random; + +namespace VeryUsualDay +{ + public static class Helpers + { + private static string GetCustomDescription(object objEnum) + { + var fi = objEnum.GetType().GetField(objEnum.ToString()); + var attributes = (DescriptionAttribute[])fi.GetCustomAttributes(typeof(DescriptionAttribute), false); + return (attributes.Length > 0) ? attributes[0].Description : objEnum.ToString(); + } + + public static string Description(this Enum value) + { + return GetCustomDescription(value); + } + + public static bool In(this T val, params T[] vals) => vals.Contains(val); + + public static IEnumerable Shuffle(this IEnumerable enumerable) + { + var enumerable1 = enumerable.ToList(); + var newEnum = Enumerable.Empty(); + while (enumerable1.Count != 0) + { + var index = Random.Range(0, enumerable1.Count); + newEnum = newEnum.Append(enumerable1[index]); + enumerable1.RemoveAt(index); + } + return newEnum; + } + } +} \ No newline at end of file diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs index f2db8ec..b5c74ac 100644 --- a/Properties/AssemblyInfo.cs +++ b/Properties/AssemblyInfo.cs @@ -9,7 +9,7 @@ [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("VeryUsualDay")] -[assembly: AssemblyCopyright("Copyright JustMarfix © 2023")] +[assembly: AssemblyCopyright("Copyright JustMarfix © 2024")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] diff --git a/Utils/ClassD.cs b/Utils/ClassD.cs new file mode 100644 index 0000000..d905ee3 --- /dev/null +++ b/Utils/ClassD.cs @@ -0,0 +1,34 @@ +using Exiled.API.Enums; +using Exiled.API.Features; +using MEC; +using PlayerRoles; + +namespace VeryUsualDay.Utils +{ + public class ClassD + { + private Player User { get; set; } + + public ClassD(Player player) + { + User = player; + _spawn(); + } + + private void _spawn() + { + User.Role.Set(RoleTypeId.ClassD, reason: SpawnReason.ForceClass, spawnFlags: RoleSpawnFlags.All); + Timing.CallDelayed(1f, () => + { + User.ClearInventory(); + User.Handcuff(); + User.MaxHealth = 115f; + User.Health = 115f; + User.CustomName = $"Испытуемый - ##-{VeryUsualDay.Instance.SpawnedDboysCounter}"; + User.CustomInfo = "Человек"; + User.Broadcast(10, "Вы стали Испытуемым! Можете сотрудничать с фондом или принимать попытки побега при первой возможности. "); + VeryUsualDay.Instance.SpawnedDboysCounter += 1; + }); + } + } +} \ No newline at end of file diff --git a/Utils/Guard.cs b/Utils/Guard.cs new file mode 100644 index 0000000..32ebf04 --- /dev/null +++ b/Utils/Guard.cs @@ -0,0 +1,37 @@ +using Exiled.API.Enums; +using Exiled.API.Features; +using MEC; +using PlayerRoles; + +namespace VeryUsualDay.Utils +{ + public class Guard + { + private Player User { get; set; } + + public Guard(Player player) + { + User = player; + _spawn(); + } + + private void _spawn() + { + User.Role.Set(RoleTypeId.FacilityGuard, reason: SpawnReason.ForceClass, spawnFlags: RoleSpawnFlags.AssignInventory); + Timing.CallDelayed(2f, () => + { + User.MaxHealth = 100f; + User.Health = 100f; + User.ClearInventory(); + User.AddItem(ItemType.GunCOM15); + User.AddItem(ItemType.KeycardJanitor); + User.AddItem(ItemType.Painkillers); + User.AddItem(ItemType.Radio); + User.CustomName = $"Охранник - ##-{VeryUsualDay.Instance.SpawnedSecurityCounter}"; + User.CustomInfo = "Человек"; + User.Broadcast(10, "Вы вступили в Службу Безопасности! Патрулируйте комплекс, сохраняйте безопасную обстановку в подземной части."); + VeryUsualDay.Instance.SpawnedSecurityCounter += 1; + }); + } + } +} \ No newline at end of file diff --git a/Utils/MtfMedic.cs b/Utils/MtfMedic.cs new file mode 100644 index 0000000..51d8435 --- /dev/null +++ b/Utils/MtfMedic.cs @@ -0,0 +1,46 @@ +using Exiled.API.Enums; +using Exiled.API.Features; +using Exiled.CustomItems.API.Features; +using MEC; +using PlayerRoles; +using UnityEngine; + +namespace VeryUsualDay.Utils +{ + public class MtfMedic + { + private Player User { get; set; } + + public MtfMedic(Player player) + { + User = player; + _spawn(); + } + + private void _spawn() + { + User.Role.Set(RoleTypeId.FacilityGuard, reason: SpawnReason.ForceClass, spawnFlags: RoleSpawnFlags.AssignInventory); + Timing.CallDelayed(2f, () => + { + User.MaxHealth = 200f; + User.Health = 200f; + User.Scale = new Vector3(1.03f, 1.03f, 1.03f); + User.ClearInventory(); + User.AddItem(ItemType.GunCrossvec); + User.AddItem(ItemType.KeycardGuard); + User.AddItem(ItemType.ArmorCombat); + User.AddItem(ItemType.Radio); + User.AddItem(ItemType.Painkillers); + User.AddItem(ItemType.Painkillers); + User.AddAmmo(AmmoType.Nato9, 60); + CustomItem.TryGive(User, "MG-119"); + User.EnableEffect(EffectType.BodyshotReduction, 10); + User.EnableEffect(EffectType.DamageReduction, 10); + User.EnableEffect(EffectType.MovementBoost, 2); + User.CustomInfo = "Медик Реагирования"; + User.Broadcast(10, "Вы стали медиком СБ! Вы прошли обучение в мед. центре Фонда, и теперь готовы защищать сотрудников от аномалий."); + }); + + } + } +} \ No newline at end of file diff --git a/Utils/Scientist.cs b/Utils/Scientist.cs new file mode 100644 index 0000000..4c85ab9 --- /dev/null +++ b/Utils/Scientist.cs @@ -0,0 +1,38 @@ +using Exiled.API.Enums; +using Exiled.API.Features; +using MEC; +using PlayerRoles; + +namespace VeryUsualDay.Utils +{ + public class Scientist + { + private Player User { get; set; } + + public Scientist(Player player) + { + User = player; + _spawn(); + } + + private void _spawn() + { + User.Role.Set(RoleTypeId.Scientist, reason: SpawnReason.ForceClass, spawnFlags: RoleSpawnFlags.AssignInventory); + Timing.CallDelayed(2f, () => + { + User.ClearInventory(); + User.MaxHealth = 100f; + User.Health = 100f; + User.AddItem(ItemType.KeycardJanitor); + User.AddItem(ItemType.Painkillers); + User.AddItem(ItemType.Flashlight); + User.AddItem(ItemType.Radio); + User.CustomName = $"Сотрудник - ##-{VeryUsualDay.Instance.SpawnedScientistCounter}"; + User.CustomInfo = "Человек"; + User.Broadcast(10, "Вы вступили в Научный отдел! Исследуйте и сдерживайте аномалии, помогайте работе фонда."); + VeryUsualDay.Instance.SpawnedScientistCounter += 1; + }); + + } + } +} \ No newline at end of file diff --git a/Utils/Scp0082.cs b/Utils/Scp0082.cs new file mode 100644 index 0000000..1de938d --- /dev/null +++ b/Utils/Scp0082.cs @@ -0,0 +1,45 @@ +using Exiled.API.Enums; +using Exiled.API.Features; +using MEC; +using PlayerRoles; +using UnityEngine; + +namespace VeryUsualDay.Utils +{ + public class Scp0082 + { + private Player User { get; set; } + + public Scp0082(Player player, bool isPatogenZombie) + { + User = player; + _spawn(isPatogenZombie); + } + + private void _spawn(bool isPatogenZombie) + { + User.Role.Set(RoleTypeId.Scp0492, reason: SpawnReason.ForceClass, spawnFlags: RoleSpawnFlags.AssignInventory); + Timing.CallDelayed(2f, () => + { + User.CustomInfo = "SCP-008-2"; + User.MaxHealth = 1500f; + User.Health = 1500f; + User.Scale = new Vector3(1f, 1f, 1f); + User.EnableEffect(EffectType.Stained); + User.EnableEffect(EffectType.Poisoned); + User.IsGodModeEnabled = false; + User.Broadcast(10, + "Вы стали SCP-008-2!\nАтакуйте людей до конца жизни!"); + User.Mute(); + if (!isPatogenZombie) + { + VeryUsualDay.Instance.ScpPlayers.Add(User.Id, VeryUsualDay.Scps.Scp0082); + } + else + { + VeryUsualDay.Instance.Zombies.Add(User.Id); + } + }); + } + } +} \ No newline at end of file diff --git a/Utils/Scp01921.cs b/Utils/Scp01921.cs new file mode 100644 index 0000000..81ff3f9 --- /dev/null +++ b/Utils/Scp01921.cs @@ -0,0 +1,37 @@ +using Exiled.API.Enums; +using Exiled.API.Features; +using MEC; +using PlayerRoles; +using UnityEngine; + +namespace VeryUsualDay.Utils +{ + public class Scp01921 + { + private Player User { get; set; } + + public Scp01921(Player player) + { + User = player; + _spawn(); + } + + private void _spawn() + { + User.Role.Set(RoleTypeId.Scp0492, reason: SpawnReason.ForceClass, spawnFlags: RoleSpawnFlags.AssignInventory); + Timing.CallDelayed(2f, () => + { + var hp = Random.Range(500, 1700); + User.CustomInfo = "SCP-019-2"; + User.CustomName = "Объект"; + User.MaxHealth = hp; + User.Health = hp; + User.Scale = new Vector3(0.6f, 0.6f, 0.6f); + User.IsGodModeEnabled = false; + User.Teleport(Room.Get(RoomType.Lcz173).Position + new Vector3(20.193f, 13.7f, 7.638f)); + VeryUsualDay.Instance.ScpPlayers.Add(User.Id, VeryUsualDay.Scps.Scp01921); + }); + + } + } +} \ No newline at end of file diff --git a/Utils/Scp01922.cs b/Utils/Scp01922.cs new file mode 100644 index 0000000..e309720 --- /dev/null +++ b/Utils/Scp01922.cs @@ -0,0 +1,38 @@ +using Exiled.API.Enums; +using Exiled.API.Features; +using MEC; +using PlayerRoles; +using UnityEngine; + +namespace VeryUsualDay.Utils +{ + public class Scp01922 + { + private Player User { get; set; } + + public Scp01922(Player player) + { + User = player; + _spawn(); + } + + private void _spawn() + { + User.Role.Set(RoleTypeId.Scp939, reason: SpawnReason.ForceClass, spawnFlags: RoleSpawnFlags.AssignInventory); + Timing.CallDelayed(2f, () => + { + var hp = Random.Range(100, 600); + User.CustomInfo = "SCP-019-2"; + User.CustomName = "Объект"; + User.MaxHealth = hp; + User.Health = hp; + User.Scale = new Vector3(0.6f, 0.6f, 0.6f); + User.IsGodModeEnabled = false; + User.EnableEffect(EffectType.Disabled); + User.Teleport(Room.Get(RoomType.Lcz173).Position + new Vector3(20.193f, 13.7f, 7.638f)); + VeryUsualDay.Instance.ScpPlayers.Add(User.Id, VeryUsualDay.Scps.Scp01922); + }); + + } + } +} \ No newline at end of file diff --git a/Utils/Scp035.cs b/Utils/Scp035.cs new file mode 100644 index 0000000..2cf4fdc --- /dev/null +++ b/Utils/Scp035.cs @@ -0,0 +1,40 @@ +using Exiled.API.Enums; +using Exiled.API.Features; +using MEC; +using PlayerRoles; +using UnityEngine; + +namespace VeryUsualDay.Utils +{ + public class Scp035 + { + private Player User { get; set; } + + public Scp035(Player player) + { + User = player; + _spawn(); + } + + private void _spawn() + { + User.Role.Set(RoleTypeId.ClassD, reason: SpawnReason.ForceClass, spawnFlags: RoleSpawnFlags.AssignInventory); + Timing.CallDelayed(2f, () => + { + User.CustomInfo = "SCP-035"; + User.AddItem(ItemType.GunRevolver); + User.AddAmmo(AmmoType.Ammo44Cal, 32); + User.MaxHealth = 7500f; + User.Health = 7500f; + User.Scale = new Vector3(0.87f, 0.87f, 1f); + User.EnableEffect(EffectType.BodyshotReduction); + User.ChangeEffectIntensity(EffectType.BodyshotReduction, 15); + User.EnableEffect(EffectType.DamageReduction); + User.ChangeEffectIntensity(EffectType.DamageReduction, 15); + User.EnableEffect(EffectType.Poisoned); + User.IsGodModeEnabled = true; + VeryUsualDay.Instance.ScpPlayers.Add(User.Id, VeryUsualDay.Scps.Scp035); + }); + } + } +} \ No newline at end of file diff --git a/Utils/Scp0352.cs b/Utils/Scp0352.cs new file mode 100644 index 0000000..e9901e9 --- /dev/null +++ b/Utils/Scp0352.cs @@ -0,0 +1,28 @@ +using Exiled.API.Features; +using MEC; +using UnityEngine; + +namespace VeryUsualDay.Utils +{ + public class Scp0352 + { + private Player User; + + public Scp0352(Player player) + { + User = player; + _spawn(); + } + + private void _spawn() + { + User.CustomInfo = "SCP-035-2"; + User.MaxHealth = 350f; + User.Health = 350f; + User.Scale = new Vector3(1f, 1f, 1f); + User.IsGodModeEnabled = false; + User.Broadcast(10, "Вы теперь подчиняетесь SCP-035."); + VeryUsualDay.Instance.ScpPlayers.Add(User.Id, VeryUsualDay.Scps.Scp0352); + } + } +} \ No newline at end of file diff --git a/Utils/Scp049.cs b/Utils/Scp049.cs new file mode 100644 index 0000000..50581b9 --- /dev/null +++ b/Utils/Scp049.cs @@ -0,0 +1,33 @@ +using Exiled.API.Enums; +using Exiled.API.Features; +using MEC; +using PlayerRoles; +using UnityEngine; + +namespace VeryUsualDay.Utils +{ + public class Scp049 + { + private Player User { get; set; } + + public Scp049(Player player) + { + User = player; + _spawn(); + } + + private void _spawn() + { + User.Role.Set(RoleTypeId.Scp049, reason: SpawnReason.ForceClass, spawnFlags: RoleSpawnFlags.AssignInventory); + Timing.CallDelayed(2f, () => + { + User.CustomInfo = "SCP-049"; + User.MaxHealth = 13000f; + User.Health = 13000f; + User.Scale = new Vector3(1f, 1f, 1f); + User.IsGodModeEnabled = false; + VeryUsualDay.Instance.ScpPlayers.Add(User.Id, VeryUsualDay.Scps.Scp049); + }); + } + } +} \ No newline at end of file diff --git a/Utils/Scp0762.cs b/Utils/Scp0762.cs new file mode 100644 index 0000000..a3074eb --- /dev/null +++ b/Utils/Scp0762.cs @@ -0,0 +1,41 @@ +using Exiled.API.Enums; +using Exiled.API.Features; +using MEC; +using PlayerRoles; +using UnityEngine; + +namespace VeryUsualDay.Utils +{ + public class Scp0762 + { + private Player User { get; set; } + + public Scp0762(Player player) + { + User = player; + _spawn(); + } + + private void _spawn() + { + User.Role.Set(RoleTypeId.Tutorial, reason: SpawnReason.ForceClass, + spawnFlags: RoleSpawnFlags.AssignInventory); + Timing.CallDelayed(2f, () => + { + User.CustomInfo = "SCP-076-2"; + User.MaxHealth = 9500f; + User.Health = 9500f; + User.EnableEffect(EffectType.MovementBoost); + User.EnableEffect(EffectType.BodyshotReduction); + User.EnableEffect(EffectType.DamageReduction); + User.ChangeEffectIntensity(EffectType.MovementBoost, 25); + User.ChangeEffectIntensity(EffectType.BodyshotReduction, 70); + User.ChangeEffectIntensity(EffectType.DamageReduction, 70); + User.CurrentItem = User.AddItem(ItemType.Jailbird); + User.Scale = new Vector3(1.15f, 1.15f, 1.15f); + VeryUsualDay.Instance.ScpPlayers.Add(User.Id, VeryUsualDay.Scps.Scp0762); + }); + + } + } +} \ No newline at end of file diff --git a/Utils/Scp372.cs b/Utils/Scp372.cs new file mode 100644 index 0000000..6481456 --- /dev/null +++ b/Utils/Scp372.cs @@ -0,0 +1,34 @@ +using Exiled.API.Enums; +using Exiled.API.Features; +using MEC; +using PlayerRoles; +using UnityEngine; + +namespace VeryUsualDay.Utils +{ + public class Scp372 + { + private Player User { get; set; } + + public Scp372(Player player) + { + User = player; + _spawn(); + } + + private void _spawn() + { + User.Role.Set(RoleTypeId.Scp939, reason: SpawnReason.ForceClass, spawnFlags: RoleSpawnFlags.AssignInventory); + Timing.CallDelayed(2f, () => + { + User.CustomInfo = "SCP-372"; + User.MaxHealth = 650f; + User.Health = 650f; + User.Scale = new Vector3(0.1f, 0.8f, 1f); + User.EnableEffect(EffectType.MovementBoost); + User.ChangeEffectIntensity(EffectType.MovementBoost, 255); + VeryUsualDay.Instance.ScpPlayers.Add(User.Id, VeryUsualDay.Scps.Scp372); + }); + } + } +} \ No newline at end of file diff --git a/Utils/Scp682.cs b/Utils/Scp682.cs new file mode 100644 index 0000000..209f690 --- /dev/null +++ b/Utils/Scp682.cs @@ -0,0 +1,42 @@ +using Exiled.API.Enums; +using Exiled.API.Features; +using MEC; +using PlayerRoles; +using UnityEngine; + +namespace VeryUsualDay.Utils +{ + public class Scp682 + { + private Player User { get; set; } + + public Scp682(Player player) + { + User = player; + _spawn(); + } + + private void _spawn() + { + User.Role.Set(RoleTypeId.Scp939, reason: SpawnReason.ForceClass, spawnFlags: RoleSpawnFlags.AssignInventory); + Timing.CallDelayed(2f, () => + { + User.CustomInfo = "SCP-682-MT"; + User.MaxHealth = 15000f; + User.Health = 15000f; + User.HumeShield = 5000f; + User.Scale = new Vector3(1.2f, 1.25f, 1.2f); + User.IsGodModeEnabled = false; + User.EnableEffect(EffectType.Invigorated); + User.EnableEffect(EffectType.RainbowTaste); + User.EnableEffect(EffectType.Disabled); + User.EnableEffect(EffectType.DamageReduction); + User.EnableEffect(EffectType.BodyshotReduction); + User.ChangeEffectIntensity(EffectType.DamageReduction, 30); + User.ChangeEffectIntensity(EffectType.BodyshotReduction, 30); + VeryUsualDay.Instance.ScpPlayers.Add(User.Id, VeryUsualDay.Scps.Scp682); + }); + + } + } +} \ No newline at end of file diff --git a/Utils/Scp966.cs b/Utils/Scp966.cs new file mode 100644 index 0000000..bff84a7 --- /dev/null +++ b/Utils/Scp966.cs @@ -0,0 +1,34 @@ +using Exiled.API.Enums; +using Exiled.API.Features; +using MEC; +using PlayerRoles; +using UnityEngine; + +namespace VeryUsualDay.Utils +{ + public class Scp966 + { + private Player User { get; set; } + + public Scp966(Player player) + { + User = player; + _spawn(); + } + + private void _spawn() + { + User.Role.Set(RoleTypeId.Scp0492, reason: SpawnReason.ForceClass, spawnFlags: RoleSpawnFlags.AssignInventory); + Timing.CallDelayed(2f, () => + { + User.CustomInfo = "SCP-966"; + User.MaxHealth = 1000f; + User.Health = 1000f; + User.Scale = new Vector3(0f, 1f, 0f); + User.IsGodModeEnabled = false; + VeryUsualDay.Instance.ScpPlayers.Add(User.Id, VeryUsualDay.Scps.Scp966); + }); + + } + } +} \ No newline at end of file diff --git a/Utils/Scp999.cs b/Utils/Scp999.cs new file mode 100644 index 0000000..1bdfa86 --- /dev/null +++ b/Utils/Scp999.cs @@ -0,0 +1,33 @@ +using Exiled.API.Enums; +using Exiled.API.Features; +using MEC; +using PlayerRoles; +using UnityEngine; + +namespace VeryUsualDay.Utils +{ + public class Scp999 + { + private Player User { get; set; } + + public Scp999(Player player) + { + User = player; + _spawn(); + } + + private void _spawn() + { + User.Role.Set(RoleTypeId.Tutorial, reason: SpawnReason.ForceClass, spawnFlags: RoleSpawnFlags.AssignInventory); + Timing.CallDelayed(2f, () => + { + User.CustomInfo = "SCP-999"; + User.MaxHealth = 10000f; + User.Health = 10000f; + User.Scale = new Vector3(1f, 0.1f, 1f); + User.IsGodModeEnabled = false; + VeryUsualDay.Instance.ScpPlayers.Add(User.Id, VeryUsualDay.Scps.Scp999); + }); + } + } +} \ No newline at end of file diff --git a/Utils/TutorialHuman.cs b/Utils/TutorialHuman.cs new file mode 100644 index 0000000..f9c71b0 --- /dev/null +++ b/Utils/TutorialHuman.cs @@ -0,0 +1,55 @@ +using Exiled.API.Enums; +using Exiled.API.Features; +using MEC; +using PlayerRoles; +using UnityEngine; + +namespace VeryUsualDay.Utils +{ + public class TutorialHuman + { + private Player User { get; set; } + + public TutorialHuman(Player player) + { + User = player; + _spawn(); + } + + private void _spawn() + { + User.Role.Set(RoleTypeId.Tutorial, reason: SpawnReason.ForceClass); + Timing.CallDelayed(1.5f, () => + { + User.MaxHealth = 100f; + User.Health = 100f; + User.CustomName = null; + User.CustomInfo = "Человек"; + User.Scale = new Vector3(1f, 1f, 1f); + User.IsGodModeEnabled = false; + if (VeryUsualDay.Instance.Zombies.Contains(User.Id)) + { + User.UnMute(); + VeryUsualDay.Instance.Zombies.Remove(User.Id); + } + if (VeryUsualDay.Instance.ScpPlayers.ContainsKey(User.Id)) + { + VeryUsualDay.Instance.ScpPlayers.Remove(User.Id); + } + if (VeryUsualDay.Instance.DBoysQueue.Contains(User.Id)) + { + VeryUsualDay.Instance.DBoysQueue.Remove(User.Id); + } + if (VeryUsualDay.Instance.JoinedDboys.Contains(User.Id)) + { + VeryUsualDay.Instance.JoinedDboys.Remove(User.Id); + } + if (VeryUsualDay.Instance.Shakheds.Contains(User.Id)) + { + VeryUsualDay.Instance.Shakheds.Remove(User.Id); + } + + }); + } + } +} \ No newline at end of file diff --git a/Utils/Worker.cs b/Utils/Worker.cs new file mode 100644 index 0000000..8a41c4e --- /dev/null +++ b/Utils/Worker.cs @@ -0,0 +1,36 @@ +using Exiled.API.Enums; +using Exiled.API.Features; +using MEC; +using PlayerRoles; + +namespace VeryUsualDay.Utils +{ + public class Worker + { + private Player User { get; set; } + + public Worker(Player player) + { + User = player; + _spawn(); + } + + private void _spawn() + { + User.Role.Set(RoleTypeId.ClassD, reason: SpawnReason.ForceClass, spawnFlags: RoleSpawnFlags.AssignInventory); + Timing.CallDelayed(2f, () => + { + User.ClearInventory(); + User.MaxHealth = 110f; + User.Health = 110f; + User.AddItem(ItemType.KeycardJanitor); + User.AddItem(ItemType.Flashlight); + User.CustomName = $"Рабочий - ##-{VeryUsualDay.Instance.SpawnedWorkersCounter}"; + User.CustomInfo = "Человек"; + User.Broadcast(10, "Вы вступили в отдел Рабочих! Работайте в столовой комплекса и следите за порядком в коридорах."); + VeryUsualDay.Instance.SpawnedWorkersCounter += 1; + }); + + } + } +} \ No newline at end of file diff --git a/VeryUsualDay.cs b/VeryUsualDay.cs index 9e25b73..bd78192 100644 --- a/VeryUsualDay.cs +++ b/VeryUsualDay.cs @@ -28,15 +28,17 @@ public class VeryUsualDay : Plugin public override string Author => "JustMarfix"; public override string Name => "VeryUsualDay (FX Version)"; - public override Version Version => new Version(4, 7, 0); + public override Version Version => new Version(5, 0, 0); public bool IsEnabledInRound { get; set; } public bool IsLunchtimeActive { get; set; } public bool IsDboysSpawnAllowed { get; set; } public bool IsTeslaEnabled { get; set; } + public bool Is008Leaked { get; set; } public List JoinedDboys { get; set; } = new List(); public List DBoysQueue { get; set; } = new List(); public List Shakheds { get; set; } = new List(); + public List Zombies { get; set; } = new List(); public List ChaosRooms { get; set; } = new List(); public int BuoCounter { get; set; } = 1; public int SpawnedDboysCounter { get; set; } = 1; @@ -74,6 +76,9 @@ public enum Codes public enum Scps { + Scp0082, + Scp01921, + Scp01922, Scp035, Scp0352, Scp049, @@ -81,23 +86,19 @@ public enum Scps Scp372, Scp682, Scp966, - Scp999 + Scp999, } public Codes CurrentCode { get; set; } = Codes.Green; public Dictionary ScpPlayers { get; set; } = new Dictionary(); - public override void OnEnabled() + private static void _registerEvents() { - Instance = this; - if (Instance.Config.AuthToken == "") - { - Log.Error("AuthToken пуст - функционал тюрьмы и БД будет недоступен."); - } PlayerHandler.ChangingRole += Player.OnChangingRole; PlayerHandler.PickingUpItem += Player.OnPickingUpItem; PlayerHandler.DroppingItem += Player.OnDroppingItem; PlayerHandler.Hurting += Player.OnHurting; + PlayerHandler.Dying += Player.OnDying; PlayerHandler.Died += Player.OnDied; PlayerHandler.Left += Player.OnLeft; PlayerHandler.Shooting += Player.OnShooting; @@ -110,10 +111,9 @@ public override void OnEnabled() PlayerHandler.InteractingDoor += Player.OnInteractingDoor; ServerHandler.WaitingForPlayers += Server.OnWaitingForPlayers; ServerHandler.RoundStarted += Server.OnRoundStarted; - base.OnEnabled(); } - public override void OnDisabled() + private static void _unregisterEvents() { PlayerHandler.ChangingRole -= Player.OnChangingRole; PlayerHandler.PickingUpItem -= Player.OnPickingUpItem; @@ -130,9 +130,37 @@ public override void OnDisabled() PlayerHandler.InteractingDoor -= Player.OnInteractingDoor; ServerHandler.WaitingForPlayers -= Server.OnWaitingForPlayers; ServerHandler.RoundStarted -= Server.OnRoundStarted; + } + + public override void OnEnabled() + { + Instance = this; + if (Instance.Config.AuthToken == "") + { + Log.Error("AuthToken пуст - функционал тюрьмы и БД будет недоступен."); + } + _registerEvents(); + base.OnEnabled(); + } + + public override void OnDisabled() + { Instance = null; + _unregisterEvents(); base.OnDisabled(); } + + public IEnumerator _008_poisoning() + { + for (;;) + { + foreach (var target in Exiled.API.Features.Player.Get(player => player.Zone == ZoneType.HeavyContainment && !Instance.Config.DoNotPoisonRoles.Contains(player.Role.Type) && player.Role.Team != Team.SCPs && (player.CustomInfo is null || !player.CustomInfo.ToLower().Contains("scp")))) + { + target.EnableEffect(EffectType.Poisoned); + } + yield return Timing.WaitForSeconds(10f); + } + } public IEnumerator _joining() { @@ -512,33 +540,4 @@ public static (bool, int, string) CheckIfPlayerInPrison(Exiled.API.Features.Play } } } - public static class ReflectionHelpers - { - private static string GetCustomDescription(object objEnum) - { - var fi = objEnum.GetType().GetField(objEnum.ToString()); - var attributes = (DescriptionAttribute[])fi.GetCustomAttributes(typeof(DescriptionAttribute), false); - return (attributes.Length > 0) ? attributes[0].Description : objEnum.ToString(); - } - - public static string Description(this Enum value) - { - return GetCustomDescription(value); - } - - public static bool In(this T val, params T[] vals) => vals.Contains(val); - - public static IEnumerable Shuffle(this IEnumerable enumerable) - { - var enumerable1 = enumerable.ToList(); - var newEnum = Enumerable.Empty(); - while (enumerable1.Count != 0) - { - var index = Random.Range(0, enumerable1.Count); - newEnum = newEnum.Append(enumerable1[index]); - enumerable1.RemoveAt(index); - } - return newEnum; - } - } } diff --git a/VeryUsualDay.csproj b/VeryUsualDay.csproj index b31cba1..fcac166 100644 --- a/VeryUsualDay.csproj +++ b/VeryUsualDay.csproj @@ -65,7 +65,7 @@ - + @@ -83,12 +83,17 @@ + + + + + @@ -111,6 +116,24 @@ + + + + + + + + + + + + + + + + + +