Cuff enhancements (#3087)
* Cuff enhancements * Cuffs now have an OnClick for the alert to remove them * nullables * Use default interaction range so highlights are accurate * Cuffing fails more gracely * Make shared abstract and add component references to client / server * Don't cache AudioSystem and HandsComponent given cuffs are rarely used * Fix test Co-authored-by: Metal Gear Sloth <metalgearsloth@gmail.com>
This commit is contained in:
25
Content.Server/Alert/Click/RemoveCuffs.cs
Normal file
25
Content.Server/Alert/Click/RemoveCuffs.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
#nullable enable
|
||||
using Content.Server.GameObjects.Components.ActionBlocking;
|
||||
using Content.Shared.Alert;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Shared.Serialization;
|
||||
|
||||
namespace Content.Server.Alert.Click
|
||||
{
|
||||
/// <summary>
|
||||
/// Try to remove handcuffs from yourself
|
||||
/// </summary>
|
||||
[UsedImplicitly]
|
||||
public class RemoveCuffs : IAlertClick
|
||||
{
|
||||
public void ExposeData(ObjectSerializer serializer) {}
|
||||
|
||||
public void AlertClicked(ClickAlertEventArgs args)
|
||||
{
|
||||
if (args.Player.TryGetComponent(out CuffableComponent? cuffableComponent))
|
||||
{
|
||||
cuffableComponent.TryUncuff(args.Player);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user