Fix bola stam damage, bring back old construction requirements (#21340)
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user