main cult
This commit is contained in:
48
Content.Server/Chat/Commands/CultCommand.cs
Normal file
48
Content.Server/Chat/Commands/CultCommand.cs
Normal file
@@ -0,0 +1,48 @@
|
||||
using Content.Server.Chat.Systems;
|
||||
using Content.Shared.Administration;
|
||||
using Content.Shared.Chat;
|
||||
using Content.Shared.White.Cult;
|
||||
using Robust.Server.Player;
|
||||
using Robust.Shared.Console;
|
||||
using Robust.Shared.Enums;
|
||||
|
||||
namespace Content.Server.Chat.Commands
|
||||
{
|
||||
[AnyCommand]
|
||||
internal sealed class CultCommand : IConsoleCommand
|
||||
{
|
||||
public string Command => "csay";
|
||||
public string Description => "Send cult message";
|
||||
public string Help => "csay <text>";
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
if (shell.Player is not IPlayerSession player)
|
||||
{
|
||||
shell.WriteError("This command cannot be run from the server.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (player.AttachedEntity is not { Valid: true } entity)
|
||||
return;
|
||||
|
||||
if (player.Status != SessionStatus.InGame)
|
||||
return;
|
||||
|
||||
if (args.Length < 1)
|
||||
return;
|
||||
|
||||
var entityManager = IoCManager.Resolve<EntityManager>();
|
||||
|
||||
if (!entityManager.HasComponent<CultistComponent>(entity))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var message = string.Join(" ", args).Trim();
|
||||
if (string.IsNullOrEmpty(message))
|
||||
return;
|
||||
EntitySystem.Get<ChatSystem>().TrySendInGameOOCMessage(entity, message, InGameOOCChatType.Cult, false, shell, player);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user