diff --git a/Content.Shared/Cuffs/Components/CuffableComponent.cs b/Content.Shared/Cuffs/Components/CuffableComponent.cs index 624cc06ac4..7c431ff9a3 100644 --- a/Content.Shared/Cuffs/Components/CuffableComponent.cs +++ b/Content.Shared/Cuffs/Components/CuffableComponent.cs @@ -1,3 +1,4 @@ +using Content.Shared.Damage; using Robust.Shared.Containers; using Robust.Shared.GameStates; using Robust.Shared.Serialization; @@ -38,6 +39,18 @@ public sealed class CuffableComponent : Component /// [DataField("canStillInteract"), ViewVariables(VVAccess.ReadWrite)] public bool CanStillInteract = true; + + /// + /// Damage is applied to someone when they try to uncuff themselves. + /// + [DataField("damageOnResist"), ViewVariables(VVAccess.ReadWrite)] + public DamageSpecifier DamageOnResist = new() + { + DamageDict = new() + { + { "Blunt", 3.0 }, + } + }; } [Serializable, NetSerializable] diff --git a/Content.Shared/Cuffs/SharedCuffableSystem.cs b/Content.Shared/Cuffs/SharedCuffableSystem.cs index 64f9b7c6e3..059f4b1742 100644 --- a/Content.Shared/Cuffs/SharedCuffableSystem.cs +++ b/Content.Shared/Cuffs/SharedCuffableSystem.cs @@ -5,6 +5,7 @@ using Content.Shared.Administration.Logs; using Content.Shared.Alert; using Content.Shared.Buckle.Components; using Content.Shared.Cuffs.Components; +using Content.Shared.Damage; using Content.Shared.Database; using Content.Shared.DoAfter; using Content.Shared.Hands; @@ -41,6 +42,7 @@ namespace Content.Shared.Cuffs [Dependency] private readonly ISharedAdminLogManager _adminLog = default!; [Dependency] private readonly ActionBlockerSystem _actionBlocker = default!; [Dependency] private readonly AlertsSystem _alerts = default!; + [Dependency] private readonly DamageableSystem _damageSystem = default!; [Dependency] private readonly MobStateSystem _mobState = default!; [Dependency] private readonly SharedAudioSystem _audio = default!; [Dependency] private readonly SharedContainerSystem _container = default!; @@ -573,6 +575,13 @@ namespace Content.Shared.Cuffs if (!_doAfter.TryStartDoAfter(doAfterEventArgs)) return; + _adminLog.Add(LogType.Action, LogImpact.Low, $"{ToPrettyString(user)} is trying to uncuff {ToPrettyString(target)}"); + + if (isOwner) + { + _damageSystem.TryChangeDamage(target, cuffable.DamageOnResist, true, false); + } + if (_net.IsServer) { _popup.PopupEntity(Loc.GetString("cuffable-component-start-uncuffing-observer",