Straitjacket Functionality. (#18052)
This commit is contained in:
@@ -39,18 +39,6 @@ public sealed class CuffableComponent : Component
|
||||
/// </summary>
|
||||
[DataField("canStillInteract"), ViewVariables(VVAccess.ReadWrite)]
|
||||
public bool CanStillInteract = true;
|
||||
|
||||
/// <summary>
|
||||
/// Damage is applied to someone when they try to uncuff themselves.
|
||||
/// </summary>
|
||||
[DataField("damageOnResist"), ViewVariables(VVAccess.ReadWrite)]
|
||||
public DamageSpecifier DamageOnResist = new()
|
||||
{
|
||||
DamageDict = new()
|
||||
{
|
||||
{ "Blunt", 3.0 },
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Content.Shared.Damage;
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.GameStates;
|
||||
using Robust.Shared.Prototypes;
|
||||
@@ -47,6 +48,15 @@ public sealed class HandcuffComponent : Component
|
||||
[DataField("brokenPrototype", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>)), ViewVariables(VVAccess.ReadWrite)]
|
||||
public string? BrokenPrototype;
|
||||
|
||||
[DataField("damageOnResist"), 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>
|
||||
|
||||
@@ -266,7 +266,7 @@ namespace Content.Shared.Cuffs
|
||||
|
||||
private void OnCuffAfterInteract(EntityUid uid, HandcuffComponent component, AfterInteractEvent args)
|
||||
{
|
||||
if (args.Target is not {Valid: true} target)
|
||||
if (args.Target is not { Valid: true } target)
|
||||
return;
|
||||
|
||||
if (!args.CanReach)
|
||||
@@ -580,7 +580,7 @@ namespace Content.Shared.Cuffs
|
||||
|
||||
if (isOwner)
|
||||
{
|
||||
_damageSystem.TryChangeDamage(target, cuffable.DamageOnResist, true, false);
|
||||
_damageSystem.TryChangeDamage(target, cuff.DamageOnResist, true, false);
|
||||
}
|
||||
|
||||
if (_net.IsServer)
|
||||
|
||||
Reference in New Issue
Block a user