diff --git a/Content.Server/Cloning/CloningSystem.cs b/Content.Server/Cloning/CloningSystem.cs index f0077ff588..f5bde07203 100644 --- a/Content.Server/Cloning/CloningSystem.cs +++ b/Content.Server/Cloning/CloningSystem.cs @@ -38,6 +38,7 @@ using Content.Shared.Emag.Systems; using Robust.Shared.Audio; using System.Runtime.InteropServices; using Content.Server.Popups; +using Content.Server.Traits.Assorted; namespace Content.Server.Cloning { @@ -194,6 +195,16 @@ namespace Content.Server.Cloning if (_configManager.GetCVar(CCVars.BiomassEasyMode)) cloningCost = (int) Math.Round(cloningCost * EasyModeCloningCost); + // Check if they have the uncloneable trait + if (TryComp(bodyToClone, out _)) + { + if (clonePod.ConnectedConsole != null) + _chatSystem.TrySendInGameICMessage(clonePod.ConnectedConsole.Value, + Loc.GetString("cloning-console-uncloneable-trait-error"), + InGameICChatType.Speak, false); + return false; + } + // biomass checks var biomassAmount = _material.GetMaterialAmount(uid, clonePod.RequiredMaterial); diff --git a/Content.Server/Traits/Assorted/UncloneableComponent.cs b/Content.Server/Traits/Assorted/UncloneableComponent.cs new file mode 100644 index 0000000000..8e20ec9bf1 --- /dev/null +++ b/Content.Server/Traits/Assorted/UncloneableComponent.cs @@ -0,0 +1,10 @@ +namespace Content.Server.Traits.Assorted; + +/// +/// This is used for the uncloneable trait. +/// +[RegisterComponent] +public sealed class UncloneableComponent : Component +{ + +} diff --git a/Resources/Locale/en-US/medical/components/cloning-console-component.ftl b/Resources/Locale/en-US/medical/components/cloning-console-component.ftl index ceb1cdaf85..b801f92580 100644 --- a/Resources/Locale/en-US/medical/components/cloning-console-component.ftl +++ b/Resources/Locale/en-US/medical/components/cloning-console-component.ftl @@ -26,4 +26,5 @@ cloning-console-component-msg-no-cloner = Not Ready: No Cloner Detected cloning-console-component-msg-no-mind = Not Ready: No Soul Activity Detected cloning-console-chat-error = ERROR: INSUFFICIENT BIOMASS. CLONING THIS BODY REQUIRES {$units} UNITS OF BIOMASS. +cloning-console-uncloneable-trait-error = ERROR: SOUL IS ABSENT, CLONING IS IMPOSSIBLE. cloning-console-cellular-warning = WARNING: GENEFSCK CONFIDENCE SCORE IS {$percent}%. CLONING MAY HAVE UNEXPECTED RESULTS. diff --git a/Resources/Locale/en-US/traits/traits.ftl b/Resources/Locale/en-US/traits/traits.ftl index 92984c6efb..f81772d6a9 100644 --- a/Resources/Locale/en-US/traits/traits.ftl +++ b/Resources/Locale/en-US/traits/traits.ftl @@ -16,3 +16,6 @@ trait-muted-desc = You can't speak trait-paracusia-name = Paracusia trait-paracusia-desc = You hear sounds that aren't really there + +trait-uncloneable-name = Uncloneable +trait-uncloneable-desc = Cannot be cloned diff --git a/Resources/Prototypes/Traits/disabilities.yml b/Resources/Prototypes/Traits/disabilities.yml index d6de5161a2..d820f0ded0 100644 --- a/Resources/Prototypes/Traits/disabilities.yml +++ b/Resources/Prototypes/Traits/disabilities.yml @@ -42,3 +42,10 @@ description: trait-muted-desc components: - type: Muted + +- type: trait + id: Uncloneable + name: trait-uncloneable-name + description: trait-uncloneable-desc + components: + - type: Uncloneable