1
0

TemperatureSpeedComponent.cs 1.1 KB

123456789101112131415161718192021222324252627282930
  1. using Content.Shared.Temperature.Systems;
  2. using Robust.Shared.GameStates;
  3. namespace Content.Shared.Temperature.Components;
  4. /// <summary>
  5. /// This is used for an entity that varies in speed based on current temperature.
  6. /// </summary>
  7. [RegisterComponent, NetworkedComponent, Access(typeof(SharedTemperatureSystem)), AutoGenerateComponentState, AutoGenerateComponentPause]
  8. public sealed partial class TemperatureSpeedComponent : Component
  9. {
  10. /// <summary>
  11. /// Pairs of temperature thresholds to applied slowdown values.
  12. /// </summary>
  13. [DataField]
  14. public Dictionary<float, float> Thresholds = new();
  15. /// <summary>
  16. /// The current speed modifier from <see cref="Thresholds"/> we reached.
  17. /// Stored and networked so that the client doesn't mispredict temperature
  18. /// </summary>
  19. [DataField, AutoNetworkedField]
  20. public float? CurrentSpeedModifier;
  21. /// <summary>
  22. /// The time at which the temperature slowdown is updated.
  23. /// </summary>
  24. [DataField, AutoNetworkedField, AutoPausedField]
  25. public TimeSpan? NextSlowdownUpdate;
  26. }