Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com> Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com> Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Co-authored-by: Princess Cheeseballs <66055347+Pronana@users.noreply.github.com> Co-authored-by: ScarKy0 <scarky0@onet.eu>
132 lines
4.5 KiB
C#
132 lines
4.5 KiB
C#
using Content.Shared.Damage;
|
|
using Robust.Shared.Audio;
|
|
using Robust.Shared.GameStates;
|
|
using Robust.Shared.Prototypes;
|
|
|
|
namespace Content.Shared.Cuffs.Components;
|
|
|
|
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
|
|
[Access(typeof(SharedCuffableSystem))]
|
|
public sealed partial class HandcuffComponent : Component
|
|
{
|
|
/// <summary>
|
|
/// The time it takes to cuff an entity.
|
|
/// </summary>
|
|
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
|
public float CuffTime = 3.5f;
|
|
|
|
/// <summary>
|
|
/// The time it takes to uncuff an entity.
|
|
/// </summary>
|
|
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
|
public float UncuffTime = 3.5f;
|
|
|
|
/// <summary>
|
|
/// The time it takes for a cuffed entity to uncuff itself.
|
|
/// </summary>
|
|
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
|
public float BreakoutTime = 15f;
|
|
|
|
/// <summary>
|
|
/// If an entity being cuffed is stunned, this amount of time is subtracted from the time it takes to add/remove their cuffs.
|
|
/// </summary>
|
|
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
|
public float StunBonus = 2f;
|
|
|
|
/// <summary>
|
|
/// Modifier for the amount of time it takes an entity to stand up if cuffed.
|
|
/// </summary>
|
|
[DataField]
|
|
public float StandupMod = 5f;
|
|
|
|
/// <summary>
|
|
/// Modifier to the speed of an entity who is cuffed, does not stack with KnockedMovementMod
|
|
/// </summary>
|
|
[DataField]
|
|
public float MovementMod = 1f;
|
|
|
|
/// <summary>
|
|
/// Modifier to the knocked down speed of an entity who is cuffed
|
|
/// </summary>
|
|
[DataField]
|
|
public float KnockedMovementMod = 0.4f;
|
|
|
|
/// <summary>
|
|
/// Will the cuffs break when removed?
|
|
/// </summary>
|
|
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
|
public bool BreakOnRemove;
|
|
|
|
/// <summary>
|
|
/// Will the cuffs break when removed?
|
|
/// </summary>
|
|
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
|
public EntProtoId? BrokenPrototype;
|
|
|
|
/// <summary>
|
|
/// Whether or not these cuffs are in the process of being removed.
|
|
/// Used simply to prevent spawning multiple <see cref="BrokenPrototype"/>.
|
|
/// </summary>
|
|
[DataField]
|
|
public bool Removing;
|
|
|
|
/// <summary>
|
|
/// Whether the cuffs are currently being used to cuff someone.
|
|
/// We need the extra information for when the virtual item is deleted because that can happen when you simply stop
|
|
/// pulling them on the ground.
|
|
/// </summary>
|
|
[DataField]
|
|
public bool Used;
|
|
|
|
/// <summary>
|
|
/// The path of the RSI file used for the player cuffed overlay.
|
|
/// </summary>
|
|
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
|
public string? CuffedRSI = "Objects/Misc/handcuffs.rsi";
|
|
|
|
/// <summary>
|
|
/// The iconstate used with the RSI file for the player cuffed overlay.
|
|
/// </summary>
|
|
[DataField, ViewVariables(VVAccess.ReadWrite), AutoNetworkedField]
|
|
public string? BodyIconState = "body-overlay";
|
|
|
|
/// <summary>
|
|
/// An opptional color specification for <see cref="BodyIconState"/>
|
|
/// </summary>
|
|
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
|
public Color Color = Color.White;
|
|
|
|
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
|
public SoundSpecifier StartCuffSound = new SoundPathSpecifier("/Audio/Items/Handcuffs/cuff_start.ogg");
|
|
|
|
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
|
public SoundSpecifier EndCuffSound = new SoundPathSpecifier("/Audio/Items/Handcuffs/cuff_end.ogg");
|
|
|
|
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
|
public SoundSpecifier StartBreakoutSound = new SoundPathSpecifier("/Audio/Items/Handcuffs/cuff_breakout_start.ogg");
|
|
|
|
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
|
public SoundSpecifier StartUncuffSound = new SoundPathSpecifier("/Audio/Items/Handcuffs/cuff_takeoff_start.ogg");
|
|
|
|
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
|
public SoundSpecifier EndUncuffSound = new SoundPathSpecifier("/Audio/Items/Handcuffs/cuff_takeoff_end.ogg");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Event fired on the User when the User attempts to uncuff the Target.
|
|
/// Should generate popups on the User.
|
|
/// </summary>
|
|
[ByRefEvent]
|
|
public record struct UncuffAttemptEvent(EntityUid User, EntityUid Target)
|
|
{
|
|
public readonly EntityUid User = User;
|
|
public readonly EntityUid Target = Target;
|
|
public bool Cancelled = false;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Event raised on an entity being uncuffed to determine any modifiers to the amount of time it takes to uncuff them.
|
|
/// </summary>
|
|
[ByRefEvent]
|
|
public record struct ModifyUncuffDurationEvent(EntityUid User, EntityUid Target, float Duration);
|