Skip to content

Commit

Permalink
Big plugin update
Browse files Browse the repository at this point in the history
closes #61, closes #76, closes #32

added utils module
moved all playable classes to utils
added scp-019-2
  • Loading branch information
JustMarfix committed Oct 5, 2024
1 parent 871e587 commit 4c59911
Show file tree
Hide file tree
Showing 63 changed files with 1,054 additions and 355 deletions.
1 change: 0 additions & 1 deletion Commands/Aban.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<string> arguments, ICommandSender sender, out string response)
{
Expand Down
1 change: 0 additions & 1 deletion Commands/AllowSpawn.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<string> arguments, ICommandSender sender, out string response)
{
Expand Down
1 change: 0 additions & 1 deletion Commands/Breach244.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<string> arguments, ICommandSender sender, out string response)
{
Expand Down
1 change: 0 additions & 1 deletion Commands/ChaosMode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<string> arguments, ICommandSender sender, out string response)
Expand Down
1 change: 0 additions & 1 deletion Commands/CheckCode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<string> arguments, ICommandSender sender, out string response)
{
Expand Down
1 change: 0 additions & 1 deletion Commands/CheckCodePlayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "Статус обеда: неактивен";
Expand Down
1 change: 0 additions & 1 deletion Commands/ClassD.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<string> arguments, ICommandSender sender, out string response)
{
Expand Down
1 change: 0 additions & 1 deletion Commands/GoComplex.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<string> arguments, ICommandSender sender, out string response)
{
Expand Down
1 change: 0 additions & 1 deletion Commands/Lock049Gate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<string> arguments, ICommandSender sender, out string response)
{
Expand Down
1 change: 0 additions & 1 deletion Commands/Lock173Gate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<string> arguments, ICommandSender sender, out string response)
{
Expand Down
1 change: 0 additions & 1 deletion Commands/Lunch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<string> arguments, ICommandSender sender, out string response)
{
Expand Down
1 change: 0 additions & 1 deletion Commands/ManageTesla.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<string> arguments, ICommandSender sender, out string response)
{
Expand Down
43 changes: 43 additions & 0 deletions Commands/Patogen008.cs
Original file line number Diff line number Diff line change
@@ -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<string> 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("<b><color=#727472>[ВОУС]</color></b>: Объект-008 был перекрыт, распространение патогена прекращено. <size=0> 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("<b><color=#C50000>[ВНИМАНИЕ]</color></b> В зонах содержания зафиксировано распространение аномальной инфекции. Заражение перешло в активную стадию. Всем боевым единицам ликвидировать аномалии <size=0> pitch_0.2 .G1 .G1 . .G6 .", 1f, isSubtitles: true, isNoisy: false);
response = "Распространение SCP-008 начато.";
}
return true;
}
}
}
15 changes: 13 additions & 2 deletions Commands/PluginEnable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand All @@ -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<string> arguments, ICommandSender sender, out string response)
{
Expand All @@ -24,18 +25,21 @@ public bool Execute(ArraySegment<string> 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;
VeryUsualDay.Instance.SpawnedWorkersCounter = 1;
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");
Expand All @@ -48,7 +52,6 @@ public bool Execute(ArraySegment<string> 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();
Expand All @@ -67,20 +70,24 @@ public bool Execute(ArraySegment<string> 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)
{
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)
Expand All @@ -99,6 +106,10 @@ public bool Execute(ArraySegment<string> 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;
Expand Down
1 change: 0 additions & 1 deletion Commands/ReDoors.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<string> arguments, ICommandSender sender, out string response)
{
Expand Down
53 changes: 53 additions & 0 deletions Commands/Recontain008.cs
Original file line number Diff line number Diff line change
@@ -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<string> 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("<b><color=#727472>[ВОУС]</color></b>: Объект-008 был перекрыт, распространение патогена прекращено. <size=0> 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;
}
}
}
1 change: 0 additions & 1 deletion Commands/Recontain244.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<string> arguments, ICommandSender sender, out string response)
{
Expand Down
1 change: 0 additions & 1 deletion Commands/RoleDistribution.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<string> arguments, ICommandSender sender, out string response)
{
Expand Down
1 change: 0 additions & 1 deletion Commands/SetCode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<string> arguments, ICommandSender sender, out string response)
{
Expand Down
40 changes: 40 additions & 0 deletions Commands/Spawn0082.cs
Original file line number Diff line number Diff line change
@@ -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<string> 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;
}
}
}
34 changes: 34 additions & 0 deletions Commands/Spawn01921.cs
Original file line number Diff line number Diff line change
@@ -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<string> 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;
}
}
}
Loading

0 comments on commit 4c59911

Please sign in to comment.