1
0

LightCycleComponent.cs 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. using Robust.Shared.GameStates;
  2. using Robust.Shared.Map.Components;
  3. namespace Content.Shared.Light.Components;
  4. /// <summary>
  5. /// Cycles through colors AKA "Day / Night cycle" on <see cref="MapLightComponent"/>
  6. /// </summary>
  7. [RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
  8. public sealed partial class LightCycleComponent : Component
  9. {
  10. [DataField, AutoNetworkedField]
  11. public Color OriginalColor = Color.Transparent;
  12. /// <summary>
  13. /// How long an entire cycle lasts
  14. /// </summary>
  15. [DataField, AutoNetworkedField]
  16. public TimeSpan Duration = TimeSpan.FromMinutes(30);
  17. [DataField, AutoNetworkedField]
  18. public TimeSpan Offset;
  19. [DataField, AutoNetworkedField]
  20. public bool Enabled = true;
  21. /// <summary>
  22. /// Should the offset be randomised upon MapInit.
  23. /// </summary>
  24. [DataField, AutoNetworkedField]
  25. public bool InitialOffset = true;
  26. /// <summary>
  27. /// Trench of the oscillation.
  28. /// </summary>
  29. [DataField, AutoNetworkedField]
  30. public float MinLightLevel = 3f;
  31. /// <summary>
  32. /// Peak of the oscillation
  33. /// </summary>
  34. [DataField, AutoNetworkedField]
  35. public float MaxLightLevel = 3f;
  36. [DataField, AutoNetworkedField]
  37. public float ClipLight = 1.25f;
  38. [DataField, AutoNetworkedField]
  39. public Color ClipLevel = new Color(1f, 1f, 1.25f);
  40. [DataField, AutoNetworkedField]
  41. public Color MinLevel = new Color(0.1f, 0.15f, 0.50f);
  42. [DataField, AutoNetworkedField]
  43. public Color MaxLevel = new Color(2f, 2f, 5f);
  44. }