Skip to content

Commit

Permalink
Added Back Unclonable Trait - From Wizden (Sector-Umbra#262)
Browse files Browse the repository at this point in the history
* added unclonable base pr with small additions

* changed new files into their own name space, added new comments

* renamed unclonable error in cloning-console-component.ftl

* Update cloning-console-component.ftl

---------

Co-authored-by: OctoRocket <[email protected]>
Co-authored-by: TsjipTsjip <[email protected]>
  • Loading branch information
3 people authored Jan 31, 2025
1 parent 4574355 commit 5b53bf2
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 1 deletion.
11 changes: 11 additions & 0 deletions Content.Server/Cloning/CloningSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
using Robust.Shared.Physics.Components;
using Robust.Shared.Prototypes;
using Robust.Shared.Random;
using Content.Server.Traits.Assorted; // Umbra: Unclonable Trait

namespace Content.Server.Cloning
{
Expand Down Expand Up @@ -176,6 +177,16 @@ public bool TryCloning(EntityUid uid, EntityUid bodyToClone, Entity<MindComponen
if (_configManager.GetCVar(CCVars.BiomassEasyMode))
cloningCost = (int) Math.Round(cloningCost * EasyModeCloningCost);

// Umbra: 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);

Expand Down
10 changes: 10 additions & 0 deletions Content.Server/_Umbra/Traits/Assorted/UncloneableComponent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
namespace Content.Server.Traits.Assorted;

/// <summary>
/// This is used for the uncloneable trait.
/// </summary>
[RegisterComponent]
public sealed partial class UncloneableComponent : Component
{

}
3 changes: 3 additions & 0 deletions Resources/Locale/en-US/_Umbra/traits/traits.ftl
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
trait-illeism-name = Illeism
trait-illeism-desc = You seem to only be able to refer to yourself by name.
trait-uncloneable-name = Uncloneable
trait-uncloneable-desc = Cannot be cloned.
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,6 @@ 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.
# Umbra: cloning-console-uncloneable-trait-error modified from ERROR: SOUL IS ABSENT, CLONING IS IMPOSSIBLE.
cloning-console-uncloneable-trait-error = ERROR: CLONING IS IMPOSSIBLE.
cloning-console-cellular-warning = WARNING: GENEFSCK CONFIDENCE SCORE IS {$percent}%. CLONING MAY HAVE UNEXPECTED RESULTS.
7 changes: 7 additions & 0 deletions Resources/Prototypes/_Umbra/Traits/disabilities.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
- type: trait
id: Uncloneable
name: trait-uncloneable-name
description: trait-uncloneable-desc
category: Disabilities
components:
- type: Uncloneable

0 comments on commit 5b53bf2

Please sign in to comment.