using Content.Shared.Actions.ActionTypes;
using Content.Shared.Sound;
using Content.Shared.Containers.ItemSlots;
using Robust.Shared.Audio;
using Robust.Shared.Utility;
using Content.Shared.Whitelist;
namespace Content.Shared.Vehicle.Components
{
///
/// This is particularly for vehicles that use
/// buckle. Stuff like clown cars may need a different
/// component at some point.
/// All vehicles should have Physics, Strap, and SharedPlayerInputMover components.
///
[RegisterComponent]
public sealed class VehicleComponent : Component
{
///
/// Whether someone is currently riding the vehicle
///
/// The entity currently riding the vehicle.
///
[ViewVariables]
public EntityUid? Rider;
///
/// Whether the vehicle should treat north as it's unique direction in its visualizer
///
[DataField("northOnly")]
public bool NorthOnly = false;
///
/// What the y buckle offset should be in north / south
///
[DataField("northOverride")]
public float NorthOverride = 0f;
///
/// What the y buckle offset should be in north / south
///
[DataField("southOverride")]
public float SouthOverride = 0f;
///
/// The base offset for the vehicle (when facing east)
///
public Vector2 BaseBuckleOffset = Vector2.Zero;
///
/// The sound that the horn makes
///
[DataField("hornSound")]
public SoundSpecifier? HornSound = new SoundPathSpecifier("/Audio/Effects/Vehicle/carhorn.ogg");
///
/// Whether the horn is a siren or not.
///
[DataField("hornIsSiren")]
public bool HornIsLooping = false;
///
/// If this vehicle has a siren currently playing.
///
public bool LoopingHornIsPlaying = false;
public IPlayingAudioStream? SirenPlayingStream;
/// Use ambient sound component for the idle sound.
///
/// The action for the horn (if any)
///
[DataField("hornAction")]
public InstantAction HornAction = new()
{
UseDelay = TimeSpan.FromSeconds(3.4),
Icon = new SpriteSpecifier.Texture(new ResourcePath("Objects/Fun/bikehorn.rsi/icon.png")),
Name = "action-name-honk",
Description = "action-desc-honk",
Event = new HonkActionEvent(),
};
///
/// The prototype ID of the key that was inserted so it can be
/// spawned when the key is removed.
///
public ItemSlot KeySlot = new();
///
/// Whether the vehicle has a key currently inside it or not.
///
public bool HasKey = false;
}
}