AnomalyVesselComponent.cs 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. using Content.Shared.Anomaly;
  2. using Robust.Shared.Audio;
  3. using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
  4. namespace Content.Server.Anomaly.Components;
  5. /// <summary>
  6. /// Anomaly Vessels can have an anomaly "stored" in them
  7. /// by interacting on them with an anomaly scanner. Then,
  8. /// they generate points for the selected server based on
  9. /// the anomaly's stability and severity.
  10. /// </summary>
  11. [RegisterComponent, Access(typeof(SharedAnomalySystem)), AutoGenerateComponentPause]
  12. public sealed partial class AnomalyVesselComponent : Component
  13. {
  14. /// <summary>
  15. /// The anomaly that the vessel is storing.
  16. /// Can be null.
  17. /// </summary>
  18. [ViewVariables]
  19. public EntityUid? Anomaly;
  20. /// <summary>
  21. /// A multiplier applied to the amount of points generated.
  22. /// </summary>
  23. [DataField, ViewVariables(VVAccess.ReadWrite)]
  24. public float PointMultiplier = 1;
  25. /// <summary>
  26. /// The maximum time between each beep
  27. /// </summary>
  28. [DataField("maxBeepInterval")]
  29. public TimeSpan MaxBeepInterval = TimeSpan.FromSeconds(2f);
  30. /// <summary>
  31. /// The minimum time between each beep
  32. /// </summary>
  33. [DataField("minBeepInterval")]
  34. public TimeSpan MinBeepInterval = TimeSpan.FromSeconds(0.75f);
  35. /// <summary>
  36. /// When the next beep sound will play
  37. /// </summary>
  38. [DataField("nextBeep", customTypeSerializer:typeof(TimeOffsetSerializer))]
  39. [AutoPausedField]
  40. public TimeSpan NextBeep = TimeSpan.Zero;
  41. /// <summary>
  42. /// The sound that is played repeatedly when the anomaly is destabilizing/decaying
  43. /// </summary>
  44. [DataField("beepSound")]
  45. public SoundSpecifier BeepSound = new SoundPathSpecifier("/Audio/Machines/vessel_warning.ogg");
  46. }