]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Remove self-uncuff spam suicide, damage changes (#25161)
authorSlamBamActionman <83650252+SlamBamActionman@users.noreply.github.com>
Mon, 26 Feb 2024 02:41:20 +0000 (03:41 +0100)
committerGitHub <noreply@github.com>
Mon, 26 Feb 2024 02:41:20 +0000 (13:41 +1100)
* 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

Content.Shared/Cuffs/Components/HandcuffComponent.cs
Content.Shared/Cuffs/SharedCuffableSystem.cs
Resources/Prototypes/Entities/Objects/Misc/handcuffs.yml

index a91692389f1fbd225a092d722f0a01c364c612e5..91d5a412ebcbc953d448ec3504523ea2886a9b45 100644 (file)
@@ -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 },
-             }
-    };
-
     /// <summary>
     ///     The path of the RSI file used for the player cuffed overlay.
     /// </summary>
index 65d93f281ede9b95123c7ab12ffb9aa98e02e765..fc005fd30fa12aa6c123f8674356d0cfd3529e2f 100644 (file)
@@ -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<EntityUid>() { 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)
index 2e33ef24a30c97f29f159e89d18e9f630d1cdaea..ad0e724358104b58c495491de0fb2bd01704fe7b 100644 (file)
@@ -25,6 +25,8 @@
   - type: GuideHelp
     guides:
     - Security
+  - type: UseDelay
+    delay: 6
 
 - type: entity
   name: makeshift handcuffs
   - type: Handcuff
     cuffedRSI: Clothing/OuterClothing/Misc/straight_jacket.rsi
     breakoutTime: 100
-    damageOnResist:
-      types:
-        Blunt: 0
     cuffTime: 10
     uncuffTime: 10
     stunBonus: 4