DrowsinessComponent.cs 965 B

12345678910111213141516171819202122232425262728
  1. using System.Numerics;
  2. using Robust.Shared.GameStates;
  3. using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
  4. namespace Content.Shared.Drowsiness;
  5. /// <summary>
  6. /// Exists for use as a status effect. Adds a shader to the client that scales with the effect duration.
  7. /// </summary>
  8. [RegisterComponent, NetworkedComponent, AutoGenerateComponentPause]
  9. public sealed partial class DrowsinessComponent : Component
  10. {
  11. /// <summary>
  12. /// The random time between sleeping incidents, (min, max).
  13. /// </summary>
  14. [DataField(required: true)]
  15. public Vector2 TimeBetweenIncidents = new Vector2(5f, 60f);
  16. /// <summary>
  17. /// The duration of sleeping incidents, (min, max).
  18. /// </summary>
  19. [DataField(required: true)]
  20. public Vector2 DurationOfIncident = new Vector2(2, 5);
  21. [DataField(customTypeSerializer: typeof(TimeOffsetSerializer))]
  22. [AutoPausedField]
  23. public TimeSpan NextIncidentTime = TimeSpan.Zero;
  24. }