using Robust.Shared.Containers;
using Robust.Shared.GameStates;
using Robust.Shared.Serialization;
namespace Content.Shared.Ensnaring.Components;
///
/// Use this on an entity that you would like to be ensnared by anything that has the
///
[RegisterComponent, NetworkedComponent]
public sealed partial class EnsnareableComponent : Component
{
///
/// How much should this slow down the entities walk?
///
[ViewVariables(VVAccess.ReadWrite)]
[DataField("walkSpeed")]
public float WalkSpeed = 1.0f;
///
/// How much should this slow down the entities sprint?
///
[ViewVariables(VVAccess.ReadWrite)]
[DataField("sprintSpeed")]
public float SprintSpeed = 1.0f;
///
/// Is this entity currently ensnared?
///
[ViewVariables(VVAccess.ReadWrite)]
[DataField("isEnsnared")]
public bool IsEnsnared;
///
/// The container where the entity will be stored
///
public Container Container = default!;
[DataField("sprite")]
public string? Sprite;
[DataField("state")]
public string? State;
}
[Serializable, NetSerializable]
public sealed class EnsnareableComponentState : ComponentState
{
public readonly bool IsEnsnared;
public EnsnareableComponentState(bool isEnsnared)
{
IsEnsnared = isEnsnared;
}
}
public sealed class EnsnaredChangedEvent : EntityEventArgs
{
public readonly bool IsEnsnared;
public EnsnaredChangedEvent(bool isEnsnared)
{
IsEnsnared = isEnsnared;
}
}