[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);