OnUseTimerTriggerComponent.cs 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. using System.Linq;
  2. using Content.Shared.Guidebook;
  3. using Robust.Shared.Audio;
  4. using Robust.Shared.GameStates;
  5. namespace Content.Shared.Explosion.Components
  6. {
  7. [RegisterComponent, NetworkedComponent]
  8. public sealed partial class OnUseTimerTriggerComponent : Component
  9. {
  10. [DataField] public float Delay = 1f;
  11. /// <summary>
  12. /// If not null, a user can use verbs to configure the delay to one of these options.
  13. /// </summary>
  14. [DataField] public List<float>? DelayOptions = null;
  15. /// <summary>
  16. /// If not null, this timer will periodically play this sound while active.
  17. /// </summary>
  18. [DataField] public SoundSpecifier? BeepSound;
  19. /// <summary>
  20. /// Time before beeping starts. Defaults to a single beep interval. If set to zero, will emit a beep immediately after use.
  21. /// </summary>
  22. [DataField] public float? InitialBeepDelay;
  23. [DataField] public float BeepInterval = 1;
  24. /// <summary>
  25. /// Whether the timer should instead be activated through a verb in the right-click menu
  26. /// </summary>
  27. [DataField] public bool UseVerbInstead = false;
  28. /// <summary>
  29. /// Should timer be started when it was stuck to another entity.
  30. /// Used for C4 charges and similar behaviour.
  31. /// </summary>
  32. [DataField] public bool StartOnStick;
  33. /// <summary>
  34. /// Allows changing the start-on-stick quality.
  35. /// </summary>
  36. [DataField("canToggleStartOnStick")] public bool AllowToggleStartOnStick;
  37. /// <summary>
  38. /// Whether you can examine the item to see its timer or not.
  39. /// </summary>
  40. [DataField] public bool Examinable = true;
  41. /// <summary>
  42. /// Whether or not to show the user a popup when starting the timer.
  43. /// </summary>
  44. [DataField] public bool DoPopup = true;
  45. #region GuidebookData
  46. [GuidebookData]
  47. public float? ShortestDelayOption => DelayOptions?.Min();
  48. [GuidebookData]
  49. public float? LongestDelayOption => DelayOptions?.Max();
  50. #endregion GuidebookData
  51. }
  52. }