Skip to content

Commit

Permalink
Unclonable
Browse files Browse the repository at this point in the history
  • Loading branch information
dvir001 committed May 1, 2024
1 parent eeb5017 commit d5b9e0f
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 1 deletion.
13 changes: 13 additions & 0 deletions Content.Server/Cloning/CloningSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,19 @@ public bool TryCloning(EntityUid uid, EntityUid bodyToClone, Entity<MindComponen
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);

Expand Down
10 changes: 10 additions & 0 deletions Content.Server/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
{

}
2 changes: 2 additions & 0 deletions Resources/Locale/en-US/deltav/traits/traits.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ trait-deuteranopia-name = Deuteranopia
trait-deuteranopia-desc = Whether through custom bionic eyes, random mutation,
or being a Vulpkanin, you have red–green colour blindness.
trait-uncloneable-name = Uncloneable
trait-uncloneable-desc = Cannot be cloned
9 changes: 8 additions & 1 deletion Resources/Prototypes/Traits/disabilities.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,13 @@
prototype: VehicleWheelchair
- type: LegsParalyzed

- type: trait
id: Uncloneable
name: trait-uncloneable-name
description: trait-uncloneable-desc
components:
- type: Uncloneable

- type: trait
id: FrontalLisp
name: trait-frontal-lisp-name
Expand All @@ -78,4 +85,4 @@
name: trait-snoring-name
description: trait-snoring-desc
components:
- type: Snoring
- type: Snoring

0 comments on commit d5b9e0f

Please sign in to comment.