From 485fb4cb652793ab4f9cbe90bb2cbf555fbf5540 Mon Sep 17 00:00:00 2001
From: SlamBamActionman <83650252+SlamBamActionman@users.noreply.github.com>
Date: Mon, 26 Feb 2024 03:41:20 +0100
Subject: [PATCH] Remove self-uncuff spam suicide, damage changes (#25161)
* Initial commit
* Remove damage from cuffs entirely
* Changed from Action uncuffing cooldown to UseDelay cooldown
* Minor merge conflict fix
* Edit the actual correct line
* Submodule fix
---
.../Cuffs/Components/HandcuffComponent.cs | 9 -------
Content.Shared/Cuffs/SharedCuffableSystem.cs | 24 ++++++++++++-------
.../Entities/Objects/Misc/handcuffs.yml | 5 ++--
3 files changed, 18 insertions(+), 20 deletions(-)
diff --git a/Content.Shared/Cuffs/Components/HandcuffComponent.cs b/Content.Shared/Cuffs/Components/HandcuffComponent.cs
index a91692389f..91d5a412eb 100644
--- a/Content.Shared/Cuffs/Components/HandcuffComponent.cs
+++ b/Content.Shared/Cuffs/Components/HandcuffComponent.cs
@@ -52,15 +52,6 @@ public sealed partial class HandcuffComponent : Component
[DataField]
public bool Removing;
- [DataField, ViewVariables(VVAccess.ReadWrite)]
- public DamageSpecifier DamageOnResist = new()
- {
- DamageDict = new()
- {
- { "Blunt", 3.0 },
- }
- };
-
///
/// The path of the RSI file used for the player cuffed overlay.
///
diff --git a/Content.Shared/Cuffs/SharedCuffableSystem.cs b/Content.Shared/Cuffs/SharedCuffableSystem.cs
index 65d93f281e..fc005fd30f 100644
--- a/Content.Shared/Cuffs/SharedCuffableSystem.cs
+++ b/Content.Shared/Cuffs/SharedCuffableSystem.cs
@@ -6,7 +6,6 @@ using Content.Shared.Alert;
using Content.Shared.Atmos.Piping.Unary.Components;
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.Effects;
@@ -28,6 +27,7 @@ using Content.Shared.Pulling.Components;
using Content.Shared.Pulling.Events;
using Content.Shared.Rejuvenate;
using Content.Shared.Stunnable;
+using Content.Shared.Timing;
using Content.Shared.Verbs;
using Content.Shared.Weapons.Melee.Events;
using Robust.Shared.Audio;
@@ -48,7 +48,6 @@ namespace Content.Shared.Cuffs
[Dependency] private readonly ActionBlockerSystem _actionBlocker = default!;
[Dependency] private readonly AlertsSystem _alerts = default!;
[Dependency] private readonly SharedColorFlashEffectSystem _color = 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!;
@@ -58,6 +57,7 @@ namespace Content.Shared.Cuffs
[Dependency] private readonly SharedInteractionSystem _interaction = default!;
[Dependency] private readonly SharedPopupSystem _popup = default!;
[Dependency] private readonly SharedTransformSystem _transform = default!;
+ [Dependency] private readonly UseDelaySystem _delay = default!;
public override void Initialize()
{
@@ -560,6 +560,18 @@ namespace Content.Shared.Cuffs
}
var uncuffTime = isOwner ? cuff.BreakoutTime : cuff.UncuffTime;
+
+ if (isOwner)
+ {
+ if (!TryComp(cuffsToRemove.Value, out UseDelayComponent? useDelay))
+ return;
+
+ if (!_delay.TryResetDelay((cuffsToRemove.Value, useDelay), true))
+ {
+ return;
+ }
+ }
+
var doAfterEventArgs = new DoAfterArgs(EntityManager, user, uncuffTime, new UnCuffDoAfterEvent(), target, target, cuffsToRemove)
{
BreakOnUserMove = true,
@@ -574,11 +586,6 @@ namespace Content.Shared.Cuffs
_adminLog.Add(LogType.Action, LogImpact.Low, $"{ToPrettyString(user)} is trying to uncuff {ToPrettyString(target)}");
- if (isOwner)
- {
- _damageSystem.TryChangeDamage(target, cuff.DamageOnResist, true, false);
- }
-
_popup.PopupEntity(Loc.GetString("cuffable-component-start-uncuffing-observer",
("user", Identity.Name(user, EntityManager)), ("target", Identity.Name(target, EntityManager))),
target, Filter.Pvs(target, entityManager: EntityManager)
@@ -586,7 +593,6 @@ namespace Content.Shared.Cuffs
if (target == user)
{
- _color.RaiseEffect(Color.Red, new List() { user }, Filter.Pvs(user, entityManager: EntityManager));
_popup.PopupClient(Loc.GetString("cuffable-component-start-uncuffing-self"), user, user);
}
else
@@ -619,6 +625,8 @@ namespace Content.Shared.Cuffs
cuff.Removing = true;
_audio.PlayPredicted(cuff.EndUncuffSound, target, user);
+ var isOwner = user == target;
+
_container.Remove(cuffsToRemove, cuffable.Container);
if (_net.IsServer)
diff --git a/Resources/Prototypes/Entities/Objects/Misc/handcuffs.yml b/Resources/Prototypes/Entities/Objects/Misc/handcuffs.yml
index 2e33ef24a3..ad0e724358 100644
--- a/Resources/Prototypes/Entities/Objects/Misc/handcuffs.yml
+++ b/Resources/Prototypes/Entities/Objects/Misc/handcuffs.yml
@@ -25,6 +25,8 @@
- type: GuideHelp
guides:
- Security
+ - type: UseDelay
+ delay: 6
- type: entity
name: makeshift handcuffs
@@ -148,9 +150,6 @@
- type: Handcuff
cuffedRSI: Clothing/OuterClothing/Misc/straight_jacket.rsi
breakoutTime: 100
- damageOnResist:
- types:
- Blunt: 0
cuffTime: 10
uncuffTime: 10
stunBonus: 4
--
2.52.0