namespace Content.Server.Administration.Commands;
[AdminCommand(AdminFlags.Fun)]
-public sealed class AddPolymorphActionCommand : IConsoleCommand
+public sealed class AddPolymorphActionCommand : LocalizedEntityCommands
{
- [Dependency] private readonly IEntityManager _entityManager = default!;
+ [Dependency] private readonly PolymorphSystem _polySystem = default!;
- public string Command => "addpolymorphaction";
+ public override string Command => "addpolymorphaction";
- public string Description => Loc.GetString("add-polymorph-action-command-description");
-
- public string Help => Loc.GetString("add-polymorph-action-command-help-text");
-
- public void Execute(IConsoleShell shell, string argStr, string[] args)
+ public override void Execute(IConsoleShell shell, string argStr, string[] args)
{
if (args.Length != 2)
{
return;
}
- if (!NetEntity.TryParse(args[0], out var entityUidNet) || !_entityManager.TryGetEntity(entityUidNet, out var entityUid))
+ if (!NetEntity.TryParse(args[0], out var entityUidNet) || !EntityManager.TryGetEntity(entityUidNet, out var entityUid))
{
- shell.WriteError(Loc.GetString("shell-entity-uid-must-be-number"));
+ shell.WriteError(Loc.GetString("shell-could-not-find-entity-with-uid", ("uid", args[0])));
return;
}
- var polySystem = _entityManager.EntitySysManager.GetEntitySystem<PolymorphSystem>();
-
- var polymorphable = _entityManager.EnsureComponent<PolymorphableComponent>(entityUid.Value);
- polySystem.CreatePolymorphAction(args[1], (entityUid.Value, polymorphable));
+ var polymorphable = EntityManager.EnsureComponent<PolymorphableComponent>(entityUid.Value);
+ _polySystem.CreatePolymorphAction(args[1], (entityUid.Value, polymorphable));
}
}
+++ /dev/null
-polymorph-command-description = For when you need someone to stop being a person. Takes an entity and a polymorph prototype.
-polymorph-command-help-text = polymorph <id> <polymorph prototype>
-
-add-polymorph-action-command-description = Takes an entity and gives them a voluntary polymorph.
-add-polymorph-action-command-help-text = addpolymorphaction <id> <polymorph prototype>
-
-
-polymorph-not-valid-prototype-error = Polymorph prototype is not valid.
\ No newline at end of file