Placeholder pAIs, ghost role rules window (#4972)

This commit is contained in:
20kdc
2021-11-02 00:42:04 +00:00
committed by GitHub
parent 76bc00b218
commit 7a03f00cfd
18 changed files with 350 additions and 12 deletions

View File

@@ -5,6 +5,7 @@ using Content.Shared.Administration;
using Robust.Shared.Console;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Localization;
namespace Content.Server.Ghost.Roles
{
@@ -13,11 +14,11 @@ namespace Content.Server.Ghost.Roles
{
public string Command => "makeghostrole";
public string Description => "Turns an entity into a ghost role.";
public string Help => $"Usage: {Command} <entity uid> <name> <description>";
public string Help => $"Usage: {Command} <entity uid> <name> <description> [<rules>]";
public void Execute(IConsoleShell shell, string argStr, string[] args)
{
if (args.Length != 3)
if (args.Length < 3 || args.Length > 4)
{
shell.WriteLine($"Invalid amount of arguments.\n{Help}");
return;
@@ -46,6 +47,7 @@ namespace Content.Server.Ghost.Roles
var name = args[1];
var description = args[2];
var rules = args.Length >= 4 ? args[3] : Loc.GetString("ghost-role-component-default-rules");
if (entity.EnsureComponent(out GhostTakeoverAvailableComponent takeOver))
{
@@ -55,6 +57,7 @@ namespace Content.Server.Ghost.Roles
takeOver.RoleName = name;
takeOver.RoleDescription = description;
takeOver.RoleRules = rules;
shell.WriteLine($"Made entity {entity.Name} a ghost role.");
}