Handcuff system (#1831)
* Implemented most serverside logic * All serverside cuff logic complete * SFX, Clientside HUD stuff, Other logic. * fffff * Cuffs 1.0 * missing loc string * Cuffs are stored in the balls now. * Basic integrationtest * Support stripping menu. * rrr * Fixes * properties * gun emoji * fixes * get rid of unused * reeee * Update Content.Shared/GameObjects/ContentNetIDs.cs Co-authored-by: Víctor Aguilera Puerto <6766154+Zumorica@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
using Content.Shared.GameObjects.EntitySystems;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Serialization;
|
||||
using Robust.Shared.Maths;
|
||||
using Robust.Shared.ViewVariables;
|
||||
using System;
|
||||
|
||||
namespace Content.Shared.GameObjects.Components.ActionBlocking
|
||||
{
|
||||
public class SharedCuffableComponent : Component, IActionBlocker
|
||||
{
|
||||
public override string Name => "Cuffable";
|
||||
public override uint? NetID => ContentNetIDs.CUFFED;
|
||||
|
||||
[ViewVariables]
|
||||
public bool CanStillInteract = true;
|
||||
|
||||
#region ActionBlockers
|
||||
|
||||
bool IActionBlocker.CanInteract() => CanStillInteract;
|
||||
bool IActionBlocker.CanUse() => CanStillInteract;
|
||||
bool IActionBlocker.CanPickup() => CanStillInteract;
|
||||
bool IActionBlocker.CanDrop() => CanStillInteract;
|
||||
bool IActionBlocker.CanAttack() => CanStillInteract;
|
||||
bool IActionBlocker.CanEquip() => CanStillInteract;
|
||||
bool IActionBlocker.CanUnequip() => CanStillInteract;
|
||||
|
||||
#endregion
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
protected sealed class CuffableComponentState : ComponentState
|
||||
{
|
||||
public bool CanStillInteract { get; }
|
||||
public int NumHandsCuffed { get; }
|
||||
public string RSI { get; }
|
||||
public string IconState { get; }
|
||||
public Color Color { get; }
|
||||
|
||||
public CuffableComponentState(int numHandsCuffed, bool canStillInteract, string rsiPath, string iconState, Color color) : base(ContentNetIDs.CUFFED)
|
||||
{
|
||||
NumHandsCuffed = numHandsCuffed;
|
||||
CanStillInteract = canStillInteract;
|
||||
RSI = rsiPath;
|
||||
IconState = iconState;
|
||||
Color = color;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Serialization;
|
||||
using System;
|
||||
|
||||
namespace Content.Shared.GameObjects.Components.ActionBlocking
|
||||
{
|
||||
public class SharedHandcuffComponent : Component
|
||||
{
|
||||
public override string Name => "Handcuff";
|
||||
public override uint? NetID => ContentNetIDs.HANDCUFFS;
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
protected sealed class HandcuffedComponentState : ComponentState
|
||||
{
|
||||
public string IconState { get; }
|
||||
|
||||
public HandcuffedComponentState(string iconState) : base(ContentNetIDs.HANDCUFFS)
|
||||
{
|
||||
IconState = iconState;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -41,16 +41,29 @@ namespace Content.Shared.GameObjects.Components.GUI
|
||||
}
|
||||
}
|
||||
|
||||
[NetSerializable, Serializable]
|
||||
public class StrippingHandcuffButtonPressed : BoundUserInterfaceMessage
|
||||
{
|
||||
public EntityUid Handcuff { get; }
|
||||
|
||||
public StrippingHandcuffButtonPressed(EntityUid handcuff)
|
||||
{
|
||||
Handcuff = handcuff;
|
||||
}
|
||||
}
|
||||
|
||||
[NetSerializable, Serializable]
|
||||
public class StrippingBoundUserInterfaceState : BoundUserInterfaceState
|
||||
{
|
||||
public Dictionary<Slots, string> Inventory { get; }
|
||||
public Dictionary<string, string> Hands { get; }
|
||||
public Dictionary<EntityUid, string> Handcuffs { get; }
|
||||
|
||||
public StrippingBoundUserInterfaceState(Dictionary<Slots, string> inventory, Dictionary<string, string> hands)
|
||||
public StrippingBoundUserInterfaceState(Dictionary<Slots, string> inventory, Dictionary<string, string> hands, Dictionary<EntityUid, string> handcuffs)
|
||||
{
|
||||
Inventory = inventory;
|
||||
Hands = hands;
|
||||
Handcuffs = handcuffs;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Serialization;
|
||||
@@ -58,6 +58,7 @@ namespace Content.Shared.GameObjects.Components.Mobs
|
||||
Thirst,
|
||||
Pressure,
|
||||
Stun,
|
||||
Cuffed,
|
||||
Buckled,
|
||||
Piloting,
|
||||
Pulling,
|
||||
|
||||
Reference in New Issue
Block a user