Files
wwdpublic/Content.Shared/Ensnaring/Components/EnsnaringComponent.cs
metalgearsloth c8d4c137c9 Predict stripping (#32478)
* Predict stripping

Stops mob verbs from getting moved around again.

* Bola

* Fix ftl
2025-07-20 15:53:14 +10:00

106 lines
2.7 KiB
C#

using Content.Shared.Whitelist;
using Robust.Shared.Audio;
using Robust.Shared.GameStates;
namespace Content.Shared.Ensnaring.Components;
/// <summary>
/// Use this on something you want to use to ensnare an entity with
/// </summary>
[RegisterComponent, NetworkedComponent]
public sealed partial class EnsnaringComponent : Component
{
/// <summary>
/// How long it should take to free someone else.
/// </summary>
[DataField]
public float FreeTime = 3.5f;
/// <summary>
/// How long it should take for an entity to free themselves.
/// </summary>
[DataField]
public float BreakoutTime = 30.0f;
/// <summary>
/// How much should this slow down the entities walk?
/// </summary>
[DataField]
public float WalkSpeed = 0.9f;
/// <summary>
/// How much should this slow down the entities sprint?
/// </summary>
[DataField]
public float SprintSpeed = 0.9f;
/// <summary>
/// How much stamina does the ensnare sap
/// </summary>
[DataField]
public float StaminaDamage = 55f;
/// <summary>
/// Should this ensnare someone when thrown?
/// </summary>
[DataField]
public bool CanThrowTrigger;
/// <summary>
/// What is ensnared?
/// </summary>
[DataField]
public EntityUid? Ensnared;
/// <summary>
/// Should breaking out be possible when moving?
/// </summary>
[DataField]
public bool CanMoveBreakout;
[DataField]
public SoundSpecifier? EnsnareSound = new SoundPathSpecifier("/Audio/Effects/snap.ogg");
/// <summary>
/// Should the ensaring entity be deleted upon removal?
/// </summary>
[DataField]
public bool DestroyOnRemove = false;
/// <summary>
/// Entites which bola will pass through.
/// </summary>
[DataField]
public EntityWhitelist? IgnoredTargets;
}
/// <summary>
/// Used whenever you want to do something when someone becomes ensnared by the <see cref="EnsnaringComponent"/>
/// </summary>
public sealed class EnsnareEvent : EntityEventArgs
{
public readonly float WalkSpeed;
public readonly float SprintSpeed;
public EnsnareEvent(float walkSpeed, float sprintSpeed)
{
WalkSpeed = walkSpeed;
SprintSpeed = sprintSpeed;
}
}
/// <summary>
/// Used whenever you want to do something when someone is freed by the <see cref="EnsnaringComponent"/>
/// </summary>
public sealed class EnsnareRemoveEvent : CancellableEntityEventArgs
{
public readonly float WalkSpeed;
public readonly float SprintSpeed;
public EnsnareRemoveEvent(float walkSpeed, float sprintSpeed)
{
WalkSpeed = walkSpeed;
SprintSpeed = sprintSpeed;
}
}