[Add] Adds uncloneable trait (#16688)

This commit is contained in:
OctoRocket
2023-05-31 12:34:29 -05:00
committed by GitHub
parent d79181e66c
commit 3d5c491a6e
5 changed files with 32 additions and 0 deletions

View File

@@ -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<UncloneableComponent>(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);

View File

@@ -0,0 +1,10 @@
namespace Content.Server.Traits.Assorted;
/// <summary>
/// This is used for the uncloneable trait.
/// </summary>
[RegisterComponent]
public sealed class UncloneableComponent : Component
{
}

View File

@@ -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.

View File

@@ -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

View File

@@ -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