--- /dev/null
+using Content.Server.Administration;
+using Content.Server.Humanoid;
+using Content.Shared.Administration;
+using Content.Shared.Cloning;
+using Content.Shared.Inventory;
+using Robust.Shared.Prototypes;
+using Robust.Shared.Toolshed;
+
+namespace Content.Server.Cloning.Commands;
+
+[ToolshedCommand, AdminCommand(AdminFlags.Fun)]
+public sealed class CloneCommand : ToolshedCommand
+{
+ private HumanoidAppearanceSystem? _appearance;
+ private CloningSystem? _cloning;
+ private MetaDataSystem? _metadata;
+
+ [CommandImplementation("humanoidappearance")]
+ public IEnumerable<EntityUid> HumanoidAppearance([PipedArgument] IEnumerable<EntityUid> targets, EntityUid source, bool rename)
+ {
+ _appearance ??= GetSys<HumanoidAppearanceSystem>();
+ _metadata ??= GetSys<MetaDataSystem>();
+
+ foreach (var ent in targets)
+ {
+ _appearance.CloneAppearance(source, ent);
+
+ if (rename)
+ _metadata.SetEntityName(ent, MetaData(source).EntityName, raiseEvents: true);
+
+ yield return ent;
+ }
+ }
+
+ [CommandImplementation("comps")]
+ public IEnumerable<EntityUid> Comps([PipedArgument] IEnumerable<EntityUid> targets, EntityUid source, ProtoId<CloningSettingsPrototype> settings)
+ {
+ _cloning ??= GetSys<CloningSystem>();
+
+ foreach (var ent in targets)
+ {
+ _cloning.CloneComponents(source, ent, settings);
+ yield return ent;
+ }
+ }
+
+ [CommandImplementation("equipment")]
+ public IEnumerable<EntityUid> Equipment([PipedArgument] IEnumerable<EntityUid> targets, EntityUid source, SlotFlags flags)
+ {
+ _cloning ??= GetSys<CloningSystem>();
+
+ foreach (var ent in targets)
+ {
+ _cloning.CopyEquipment(source, ent, flags);
+ yield return ent;
+ }
+ }
+
+ [CommandImplementation("implants")]
+ public IEnumerable<EntityUid> Implants([PipedArgument] IEnumerable<EntityUid> targets, EntityUid source, bool copyStorage)
+ {
+ _cloning ??= GetSys<CloningSystem>();
+
+ foreach (var ent in targets)
+ {
+ _cloning.CopyImplants(source, ent, copyStorage);
+ yield return ent;
+ }
+ }
+
+ [CommandImplementation("storage")]
+ public IEnumerable<EntityUid> InternalStorage([PipedArgument] IEnumerable<EntityUid> targets, EntityUid source)
+ {
+ _cloning ??= GetSys<CloningSystem>();
+
+ foreach (var ent in targets)
+ {
+ _cloning.CopyStorage(source, ent);
+ yield return ent;
+ }
+ }
+}
+using Robust.Shared.Prototypes;
+
namespace Content.Shared.Cloning;
public abstract partial class SharedCloningSystem : EntitySystem
public virtual void CloneComponents(EntityUid original, EntityUid clone, CloningSettingsPrototype settings)
{
}
+
+ /// <summary>
+ /// Copy components from one entity to another based on a CloningSettingsPrototype.
+ /// </summary>
+ /// <param name="original">The orignal Entity to clone components from.</param>
+ /// <param name="clone">The target Entity to clone components to.</param>
+ /// <param name="settings">The clone settings prototype id containing the list of components to clone.</param>
+ public virtual void CloneComponents(EntityUid original, EntityUid clone, ProtoId<CloningSettingsPrototype> settings)
+ {
+ }
}
Sets the money for the given bank account.
command-description-bank-amount =
Returns the money for the given bank account.
+command-description-clone-humanoidappearance =
+ Clones the humanoid appearance of provided entity to all input entities.
+command-description-clone-comps =
+ Clones all components from the provided entity to all input entities. Only works for supported components.
+command-description-clone-equipment =
+ Clones the equipment from the provided entity to all input entities. Uses base prototypes, meaning changes to equipment won't persist to the cloned versions.
+command-description-clone-implants =
+ Clones the implants from the provided entity to all input entities. Uses base prototypes, meaning changes to implants won't persist to the cloned versions.
+command-description-clone-storage =
+ Clones the storage from the provided entity to all input entities. Uses base prototypes, meaning changes to contents won't persist to the cloned versions.
command-description-jobs-jobs =
Returns all jobs on a station.
command-description-jobs-job =