]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix bola stam damage, bring back old construction requirements (#21340)
authorSubversionary <109166122+Subversionary@users.noreply.github.com>
Sun, 29 Oct 2023 22:27:43 +0000 (00:27 +0200)
committerGitHub <noreply@github.com>
Sun, 29 Oct 2023 22:27:43 +0000 (18:27 -0400)
Content.Server/Ensnaring/EnsnareableSystem.Ensnaring.cs
Content.Shared/Ensnaring/Components/EnsnaringComponent.cs
Resources/Prototypes/Entities/Objects/Weapons/Throwable/bola.yml
Resources/Prototypes/Recipes/Construction/Graphs/weapons/bola.yml

index bb1690c93505492516578a01a1e9cf4bf0e73b2b..b04c1296fcfa5aa1f7b8f968b2a696b9cf26393a 100644 (file)
@@ -1,8 +1,9 @@
 using System.Linq;
 using Content.Server.Body.Systems;
 using Content.Shared.Alert;
-using Content.Shared.Body.Components;
 using Content.Shared.Body.Part;
+using Content.Shared.Damage.Components;
+using Content.Shared.Damage.Systems;
 using Content.Shared.DoAfter;
 using Content.Shared.Ensnaring;
 using Content.Shared.Ensnaring.Components;
@@ -17,6 +18,7 @@ public sealed partial class EnsnareableSystem
     [Dependency] private readonly SharedDoAfterSystem _doAfter = default!;
     [Dependency] private readonly AlertsSystem _alerts = default!;
     [Dependency] private readonly BodySystem _body = default!;
+    [Dependency] private readonly StaminaSystem _stamina = default!;
 
     public void InitializeEnsnaring()
     {
@@ -72,6 +74,15 @@ public sealed partial class EnsnareableSystem
         if (freeLegs <= 0)
             return;
 
+        // Apply stamina damage to target if they weren't ensnared before.
+        if (ensnareable.IsEnsnared != true)
+        {
+            if (TryComp<StaminaComponent>(target, out var stamina))
+            {
+                _stamina.TakeStaminaDamage(target, component.StaminaDamage, with: ensnare);
+            }
+        }
+
         component.Ensnared = target;
         ensnareable.Container.Insert(ensnare);
         ensnareable.IsEnsnared = true;
index e7d769d339584c8c288765c1cfa86933e7e9a245..6e1f3077f300073a1ec6fb50ae2591250df633aa 100644 (file)
@@ -36,6 +36,13 @@ public sealed partial class EnsnaringComponent : Component
     [DataField("sprintSpeed")]
     public float SprintSpeed = 0.9f;
 
+    /// <summary>
+    /// How much stamina does the ensnare sap
+    /// </summary>
+    [ViewVariables(VVAccess.ReadWrite)]
+    [DataField("staminaDamage")]
+    public float StaminaDamage = 55f;
+
     /// <summary>
     /// Should this ensnare someone when thrown?
     /// </summary>
index 1afb564036ea733dad177ba0df0c9a68bf7cd681..ebd568c3b8f6438fbb7e33c4db94adab667a02b3 100644 (file)
@@ -13,8 +13,6 @@
     sound: /Audio/Weapons/bolathrow.ogg
   - type: EmitSoundOnLand
     sound: /Audio/Effects/snap.ogg
-  - type: StaminaDamageOnCollide
-    damage: 80
   - type: Construction
     graph: Bola
     node: bola
   - type: DamageOnLand
     damage:
       types:
-        Blunt: 3
+        Blunt: 5
   - type: Ensnaring
     freeTime: 2.0
     breakoutTime: 3.5 #all bola should generally be fast to remove
     walkSpeed: 0.7 #makeshift bola shouldn't slow too much
     sprintSpeed: 0.7
+    staminaDamage: 55 # Sudden weight increase sapping stamina
     canThrowTrigger: true
+    canMoveBreakout: true
 
index ad454d52b0db11a7cbaeeac5fe1aaef576e8f0bf..10532996bd6cf4feeb8242a615724394d8393478 100644 (file)
@@ -6,9 +6,12 @@
       edges:
         - to: bola
           steps:
-            - material: Cable
-              amount: 5
-              doAfter: 2
+            - tag: Handcuffs
+              icon:
+                sprite: Objects/Misc/cablecuffs.rsi
+                state: cuff
+                color: red
+              name: cuffs
             - material: Steel
               amount: 6
               doAfter: 2