From a6448cb87df41064702930dd8d61dc1f60549463 Mon Sep 17 00:00:00 2001 From: Subversionary <109166122+Subversionary@users.noreply.github.com> Date: Mon, 30 Oct 2023 00:27:43 +0200 Subject: [PATCH] Fix bola stam damage, bring back old construction requirements (#21340) --- .../Ensnaring/EnsnareableSystem.Ensnaring.cs | 13 ++++++++++++- .../Ensnaring/Components/EnsnaringComponent.cs | 7 +++++++ .../Entities/Objects/Weapons/Throwable/bola.yml | 6 +++--- .../Recipes/Construction/Graphs/weapons/bola.yml | 9 ++++++--- 4 files changed, 28 insertions(+), 7 deletions(-) diff --git a/Content.Server/Ensnaring/EnsnareableSystem.Ensnaring.cs b/Content.Server/Ensnaring/EnsnareableSystem.Ensnaring.cs index bb1690c935..b04c1296fc 100644 --- a/Content.Server/Ensnaring/EnsnareableSystem.Ensnaring.cs +++ b/Content.Server/Ensnaring/EnsnareableSystem.Ensnaring.cs @@ -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(target, out var stamina)) + { + _stamina.TakeStaminaDamage(target, component.StaminaDamage, with: ensnare); + } + } + component.Ensnared = target; ensnareable.Container.Insert(ensnare); ensnareable.IsEnsnared = true; diff --git a/Content.Shared/Ensnaring/Components/EnsnaringComponent.cs b/Content.Shared/Ensnaring/Components/EnsnaringComponent.cs index e7d769d339..6e1f3077f3 100644 --- a/Content.Shared/Ensnaring/Components/EnsnaringComponent.cs +++ b/Content.Shared/Ensnaring/Components/EnsnaringComponent.cs @@ -36,6 +36,13 @@ public sealed partial class EnsnaringComponent : Component [DataField("sprintSpeed")] public float SprintSpeed = 0.9f; + /// + /// How much stamina does the ensnare sap + /// + [ViewVariables(VVAccess.ReadWrite)] + [DataField("staminaDamage")] + public float StaminaDamage = 55f; + /// /// Should this ensnare someone when thrown? /// diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Throwable/bola.yml b/Resources/Prototypes/Entities/Objects/Weapons/Throwable/bola.yml index 1afb564036..ebd568c3b8 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Throwable/bola.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Throwable/bola.yml @@ -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 @@ -39,11 +37,13 @@ - 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 diff --git a/Resources/Prototypes/Recipes/Construction/Graphs/weapons/bola.yml b/Resources/Prototypes/Recipes/Construction/Graphs/weapons/bola.yml index ad454d52b0..10532996bd 100644 --- a/Resources/Prototypes/Recipes/Construction/Graphs/weapons/bola.yml +++ b/Resources/Prototypes/Recipes/Construction/Graphs/weapons/bola.yml @@ -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 -- 2.51.2