Damage on forced uncuff (#17801)
* cuffs do 1 damage * Update SharedCuffableSystem.cs * Update SharedCuffableSystem.cs * remove unused code * Update CuffableComponent.cs * alphabetical * damage --------- Co-authored-by: Chief-Engineer <119664036+Chief-Engineer@users.noreply.github.com>
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
using Content.Shared.Damage;
|
||||||
using Robust.Shared.Containers;
|
using Robust.Shared.Containers;
|
||||||
using Robust.Shared.GameStates;
|
using Robust.Shared.GameStates;
|
||||||
using Robust.Shared.Serialization;
|
using Robust.Shared.Serialization;
|
||||||
@@ -38,6 +39,18 @@ public sealed class CuffableComponent : Component
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[DataField("canStillInteract"), ViewVariables(VVAccess.ReadWrite)]
|
[DataField("canStillInteract"), ViewVariables(VVAccess.ReadWrite)]
|
||||||
public bool CanStillInteract = true;
|
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]
|
[Serializable, NetSerializable]
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ using Content.Shared.Administration.Logs;
|
|||||||
using Content.Shared.Alert;
|
using Content.Shared.Alert;
|
||||||
using Content.Shared.Buckle.Components;
|
using Content.Shared.Buckle.Components;
|
||||||
using Content.Shared.Cuffs.Components;
|
using Content.Shared.Cuffs.Components;
|
||||||
|
using Content.Shared.Damage;
|
||||||
using Content.Shared.Database;
|
using Content.Shared.Database;
|
||||||
using Content.Shared.DoAfter;
|
using Content.Shared.DoAfter;
|
||||||
using Content.Shared.Hands;
|
using Content.Shared.Hands;
|
||||||
@@ -41,6 +42,7 @@ namespace Content.Shared.Cuffs
|
|||||||
[Dependency] private readonly ISharedAdminLogManager _adminLog = default!;
|
[Dependency] private readonly ISharedAdminLogManager _adminLog = default!;
|
||||||
[Dependency] private readonly ActionBlockerSystem _actionBlocker = default!;
|
[Dependency] private readonly ActionBlockerSystem _actionBlocker = default!;
|
||||||
[Dependency] private readonly AlertsSystem _alerts = default!;
|
[Dependency] private readonly AlertsSystem _alerts = default!;
|
||||||
|
[Dependency] private readonly DamageableSystem _damageSystem = default!;
|
||||||
[Dependency] private readonly MobStateSystem _mobState = default!;
|
[Dependency] private readonly MobStateSystem _mobState = default!;
|
||||||
[Dependency] private readonly SharedAudioSystem _audio = default!;
|
[Dependency] private readonly SharedAudioSystem _audio = default!;
|
||||||
[Dependency] private readonly SharedContainerSystem _container = default!;
|
[Dependency] private readonly SharedContainerSystem _container = default!;
|
||||||
@@ -573,6 +575,13 @@ namespace Content.Shared.Cuffs
|
|||||||
if (!_doAfter.TryStartDoAfter(doAfterEventArgs))
|
if (!_doAfter.TryStartDoAfter(doAfterEventArgs))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
_adminLog.Add(LogType.Action, LogImpact.Low, $"{ToPrettyString(user)} is trying to uncuff {ToPrettyString(target)}");
|
||||||
|
|
||||||
|
if (isOwner)
|
||||||
|
{
|
||||||
|
_damageSystem.TryChangeDamage(target, cuffable.DamageOnResist, true, false);
|
||||||
|
}
|
||||||
|
|
||||||
if (_net.IsServer)
|
if (_net.IsServer)
|
||||||
{
|
{
|
||||||
_popup.PopupEntity(Loc.GetString("cuffable-component-start-uncuffing-observer",
|
_popup.PopupEntity(Loc.GetString("cuffable-component-start-uncuffing-observer",
|
||||||
|
|||||||
Reference in New Issue
Block a user