using System.Numerics;
using Content.Shared.Alert;
using Content.Shared.Whitelist;
using Robust.Shared.Audio;
using Robust.Shared.GameStates;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization;
namespace Content.Shared.Buckle.Components;
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
[Access(typeof(SharedBuckleSystem))]
public sealed partial class StrapComponent : Component
{
///
/// The entities that are currently buckled to this strap.
///
[ViewVariables]
public HashSet BuckledEntities = new();
///
/// Entities that this strap accepts and can buckle
/// If null it accepts any entity
///
[DataField]
public EntityWhitelist? Whitelist;
///
/// Entities that this strap does not accept and cannot buckle.
///
[DataField]
public EntityWhitelist? Blacklist;
///
/// The change in position to the strapped mob
///
[DataField, AutoNetworkedField]
public StrapPosition Position = StrapPosition.None;
///
/// The buckled entity will be offset by this amount from the center of the strap object.
///
[DataField, AutoNetworkedField]
public Vector2 BuckleOffset = Vector2.Zero;
///
/// The angle to rotate the player by when they get strapped
///
[DataField]
public Angle Rotation;
///
/// The size of the strap which is compared against when buckling entities
///
[DataField]
public int Size = 100;
///
/// If disabled, nothing can be buckled on this object, and it will unbuckle anything that's already buckled
///
[DataField, AutoNetworkedField]
public bool Enabled = true;
///
/// You can specify the offset the entity will have after unbuckling.
///
[DataField]
public Vector2 UnbuckleOffset = Vector2.Zero;
///
/// The sound to be played when a mob is buckled
///
[DataField]
public SoundSpecifier BuckleSound = new SoundPathSpecifier("/Audio/Effects/buckle.ogg");
///
/// The sound to be played when a mob is unbuckled
///
[DataField]
public SoundSpecifier UnbuckleSound = new SoundPathSpecifier("/Audio/Effects/unbuckle.ogg");
///
/// ID of the alert to show when buckled
///
[DataField]
public ProtoId BuckledAlertType = "Buckled";
}
public enum StrapPosition
{
///
/// (Default) Makes no change to the buckled mob
///
None = 0,
///
/// Makes the mob stand up
///
Stand,
///
/// Makes the mob lie down
///
Down
}
[Serializable, NetSerializable]
public enum StrapVisuals : byte
{
RotationAngle,
State
}