Placeholder pAIs, ghost role rules window (#4972)
This commit is contained in:
@@ -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.");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user