using System.Linq;
using Content.Shared.Guidebook;
using Robust.Shared.Audio;
using Robust.Shared.GameStates;
namespace Content.Shared.Explosion.Components
{
[RegisterComponent, NetworkedComponent]
public sealed partial class OnUseTimerTriggerComponent : Component
{
[DataField] public float Delay = 1f;
///
/// If not null, a user can use verbs to configure the delay to one of these options.
///
[DataField] public List? DelayOptions = null;
///
/// If not null, this timer will periodically play this sound while active.
///
[DataField] public SoundSpecifier? BeepSound;
///
/// Time before beeping starts. Defaults to a single beep interval. If set to zero, will emit a beep immediately after use.
///
[DataField] public float? InitialBeepDelay;
[DataField] public float BeepInterval = 1;
///
/// Whether the timer should instead be activated through a verb in the right-click menu
///
[DataField] public bool UseVerbInstead = false;
///
/// Should timer be started when it was stuck to another entity.
/// Used for C4 charges and similar behaviour.
///
[DataField] public bool StartOnStick;
///
/// Allows changing the start-on-stick quality.
///
[DataField("canToggleStartOnStick")] public bool AllowToggleStartOnStick;
///
/// Whether you can examine the item to see its timer or not.
///
[DataField] public bool Examinable = true;
///
/// Whether or not to show the user a popup when starting the timer.
///
[DataField] public bool DoPopup = true;
#region GuidebookData
[GuidebookData]
public float? ShortestDelayOption => DelayOptions?.Min();
[GuidebookData]
public float? LongestDelayOption => DelayOptions?.Max();
#endregion GuidebookData
}
}