]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Moves cloning comp & cloning event to shared (#21253)
authorkeronshb <54602815+keronshb@users.noreply.github.com>
Sat, 28 Oct 2023 13:47:42 +0000 (09:47 -0400)
committerGitHub <noreply@github.com>
Sat, 28 Oct 2023 13:47:42 +0000 (09:47 -0400)
Content.Server/Cloning/CloningSystem.cs
Content.Server/Cloning/Components/CloningPodComponent.cs [deleted file]
Content.Server/Zombies/ZombieSystem.cs
Content.Shared/Cloning/CloningPodComponent.cs [new file with mode: 0644]
Content.Shared/Cloning/SharedCloningPodComponent.cs [deleted file]

index c81651c512b6398b7b8025da804ce7c7b91b048e..6d34e0e6f73e68d5b063cae1507f0877271edf3d 100644 (file)
@@ -373,22 +373,4 @@ namespace Content.Server.Cloning
             ClonesWaitingForMind.Clear();
         }
     }
-
-    /// <summary>
-    /// Raised after a new mob got spawned when cloning a humanoid
-    /// </summary>
-    [ByRefEvent]
-    public struct CloningEvent
-    {
-        public bool NameHandled = false;
-
-        public readonly EntityUid Source;
-        public readonly EntityUid Target;
-
-        public CloningEvent(EntityUid source, EntityUid target)
-        {
-            Source = source;
-            Target = target;
-        }
-    }
 }
diff --git a/Content.Server/Cloning/Components/CloningPodComponent.cs b/Content.Server/Cloning/Components/CloningPodComponent.cs
deleted file mode 100644 (file)
index e2c3f46..0000000
+++ /dev/null
@@ -1,107 +0,0 @@
-using Content.Shared.Cloning;
-using Content.Shared.Construction.Prototypes;
-using Content.Shared.Materials;
-using Robust.Shared.Audio;
-using Robust.Shared.Containers;
-using Robust.Shared.Prototypes;
-using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
-
-namespace Content.Server.Cloning.Components
-{
-    [RegisterComponent]
-    public sealed partial class CloningPodComponent : Component
-    {
-        public const string PodPort = "CloningPodReceiver";
-
-        [ViewVariables]
-        public ContainerSlot BodyContainer = default!;
-
-        /// <summary>
-        /// How long the cloning has been going on for.
-        /// </summary>
-        [ViewVariables]
-        public float CloningProgress = 0;
-
-        [ViewVariables]
-        public int UsedBiomass = 70;
-
-        [ViewVariables]
-        public bool FailedClone = false;
-
-        /// <summary>
-        /// The material that is used to clone entities.
-        /// </summary>
-        [DataField("requiredMaterial", customTypeSerializer: typeof(PrototypeIdSerializer<MaterialPrototype>)), ViewVariables(VVAccess.ReadWrite)]
-        public string RequiredMaterial = "Biomass";
-
-        /// <summary>
-        /// The base amount of time it takes to clone a body
-        /// </summary>
-        [DataField("baseCloningTime")]
-        public float BaseCloningTime = 30f;
-
-        /// <summary>
-        /// The multiplier for cloning duration
-        /// </summary>
-        [DataField("partRatingSpeedMultiplier")]
-        public float PartRatingSpeedMultiplier = 0.75f;
-
-        /// <summary>
-        /// The machine part that affects cloning speed
-        /// </summary>
-        [DataField("machinePartCloningSpeed", customTypeSerializer: typeof(PrototypeIdSerializer<MachinePartPrototype>))]
-        public string MachinePartCloningSpeed = "Manipulator";
-
-        /// <summary>
-        /// The current amount of time it takes to clone a body
-        /// </summary>
-        [ViewVariables(VVAccess.ReadWrite)]
-        public float CloningTime = 30f;
-
-        /// <summary>
-        /// The mob to spawn on emag
-        /// </summary>
-        [ViewVariables(VVAccess.ReadWrite), DataField("mobSpawnId", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))]
-        public string MobSpawnId = "MobAbomination";
-
-        /// <summary>
-        /// Emag sound effects.
-        /// </summary>
-        [DataField("sparkSound")]
-        public SoundSpecifier SparkSound = new SoundCollectionSpecifier("sparks")
-        {
-            Params = AudioParams.Default.WithVolume(8),
-        };
-
-        [DataField("screamSound")]
-        public SoundSpecifier ScreamSound = new SoundCollectionSpecifier("ZombieScreams")
-        {
-            Params = AudioParams.Default.WithVolume(4),
-        };
-
-        /// <summary>
-        /// The machine part that affects how much biomass is needed to clone a body.
-        /// </summary>
-        [DataField("partRatingMaterialMultiplier")]
-        public float PartRatingMaterialMultiplier = 0.85f;
-
-        /// <summary>
-        /// The current multiplier on the body weight, which determines the
-        /// amount of biomass needed to clone.
-        /// </summary>
-        [ViewVariables(VVAccess.ReadWrite)]
-        public float BiomassRequirementMultiplier = 1;
-
-        /// <summary>
-        /// The machine part that decreases the amount of material needed for cloning
-        /// </summary>
-        [DataField("machinePartMaterialUse", customTypeSerializer: typeof(PrototypeIdSerializer<MachinePartPrototype>))]
-        public string MachinePartMaterialUse = "MatterBin";
-
-        [ViewVariables(VVAccess.ReadWrite)]
-        public CloningPodStatus Status;
-
-        [ViewVariables]
-        public EntityUid? ConnectedConsole;
-    }
-}
index 1f8f5fbd42ffd13d7571ac382e0268fcdd23daae..51cbf34d99c9727cda8a73f4a5591248c2d595d8 100644 (file)
@@ -8,6 +8,7 @@ using Content.Server.Emoting.Systems;
 using Content.Server.Inventory;
 using Content.Server.Speech.EntitySystems;
 using Content.Shared.Bed.Sleep;
+using Content.Shared.Cloning;
 using Content.Shared.Damage;
 using Content.Shared.Humanoid;
 using Content.Shared.Inventory;
diff --git a/Content.Shared/Cloning/CloningPodComponent.cs b/Content.Shared/Cloning/CloningPodComponent.cs
new file mode 100644 (file)
index 0000000..60d4c1e
--- /dev/null
@@ -0,0 +1,142 @@
+using Content.Shared.Construction.Prototypes;
+using Content.Shared.DeviceLinking;
+using Content.Shared.Materials;
+using Robust.Shared.Audio;
+using Robust.Shared.Containers;
+using Robust.Shared.Prototypes;
+using Robust.Shared.Serialization;
+using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
+
+namespace Content.Shared.Cloning;
+
+[RegisterComponent]
+public sealed partial class CloningPodComponent : Component
+{
+    [ValidatePrototypeId<SinkPortPrototype>]
+    public const string PodPort = "CloningPodReceiver";
+
+    [ViewVariables]
+    public ContainerSlot BodyContainer = default!;
+
+    /// <summary>
+    /// How long the cloning has been going on for.
+    /// </summary>
+    [ViewVariables]
+    public float CloningProgress = 0;
+
+    [ViewVariables]
+    public int UsedBiomass = 70;
+
+    [ViewVariables]
+    public bool FailedClone = false;
+
+    /// <summary>
+    /// The material that is used to clone entities.
+    /// </summary>
+    [DataField("requiredMaterial"), ViewVariables(VVAccess.ReadWrite)]
+    public ProtoId<MaterialPrototype> RequiredMaterial = "Biomass";
+
+    /// <summary>
+    /// The base amount of time it takes to clone a body
+    /// </summary>
+    [DataField("baseCloningTime")]
+    public float BaseCloningTime = 30f;
+
+    /// <summary>
+    /// The multiplier for cloning duration
+    /// </summary>
+    [DataField("partRatingSpeedMultiplier")]
+    public float PartRatingSpeedMultiplier = 0.75f;
+
+    /// <summary>
+    /// The machine part that affects cloning speed
+    /// </summary>
+    [DataField("machinePartCloningSpeed"), ViewVariables(VVAccess.ReadWrite)]
+    public ProtoId<MachinePartPrototype> MachinePartCloningSpeed = "Manipulator";
+
+    /// <summary>
+    /// The current amount of time it takes to clone a body
+    /// </summary>
+    [ViewVariables(VVAccess.ReadWrite)]
+    public float CloningTime = 30f;
+
+    /// <summary>
+    /// The mob to spawn on emag
+    /// </summary>
+    [DataField("mobSpawnId"), ViewVariables(VVAccess.ReadWrite)]
+    public EntProtoId MobSpawnId = "MobAbomination";
+
+    /// <summary>
+    /// Emag sound effects.
+    /// </summary>
+    [DataField("sparkSound")]
+    public SoundSpecifier SparkSound = new SoundCollectionSpecifier("sparks")
+    {
+        Params = AudioParams.Default.WithVolume(8),
+    };
+
+    // TODO: Remove this from here when cloning and/or zombies are refactored
+    [DataField("screamSound")]
+    public SoundSpecifier ScreamSound = new SoundCollectionSpecifier("ZombieScreams")
+    {
+        Params = AudioParams.Default.WithVolume(4),
+    };
+
+    /// <summary>
+    /// The machine part that affects how much biomass is needed to clone a body.
+    /// </summary>
+    [DataField("partRatingMaterialMultiplier")]
+    public float PartRatingMaterialMultiplier = 0.85f;
+
+    /// <summary>
+    /// The current multiplier on the body weight, which determines the
+    /// amount of biomass needed to clone.
+    /// </summary>
+    [ViewVariables(VVAccess.ReadWrite)]
+    public float BiomassRequirementMultiplier = 1;
+
+    /// <summary>
+    /// The machine part that decreases the amount of material needed for cloning
+    /// </summary>
+    [DataField("machinePartMaterialUse"), ViewVariables(VVAccess.ReadWrite)]
+    public ProtoId<MachinePartPrototype> MachinePartMaterialUse = "MatterBin";
+
+    [ViewVariables(VVAccess.ReadWrite)]
+    public CloningPodStatus Status;
+
+    [ViewVariables]
+    public EntityUid? ConnectedConsole;
+}
+
+[Serializable, NetSerializable]
+public enum CloningPodVisuals : byte
+{
+    Status
+}
+
+[Serializable, NetSerializable]
+public enum CloningPodStatus : byte
+{
+    Idle,
+    Cloning,
+    Gore,
+    NoMind
+}
+
+/// <summary>
+/// Raised after a new mob got spawned when cloning a humanoid
+/// </summary>
+[ByRefEvent]
+public struct CloningEvent
+{
+    public bool NameHandled = false;
+
+    public readonly EntityUid Source;
+    public readonly EntityUid Target;
+
+    public CloningEvent(EntityUid source, EntityUid target)
+    {
+        Source = source;
+        Target = target;
+    }
+}
diff --git a/Content.Shared/Cloning/SharedCloningPodComponent.cs b/Content.Shared/Cloning/SharedCloningPodComponent.cs
deleted file mode 100644 (file)
index aafbb59..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-using Robust.Shared.Serialization;
-
-namespace Content.Shared.Cloning
-{
-    [Serializable, NetSerializable]
-    public enum CloningPodVisuals : byte
-    {
-        Status
-    }
-    [Serializable, NetSerializable]
-    public enum CloningPodStatus : byte
-    {
-        Idle,
-        Cloning,
-        Gore,
-        NoMind
-    }
-}