SingularityAttractorComponent.cs 1010 B

123456789101112131415161718192021222324252627282930
  1. using Content.Server.Singularity.EntitySystems;
  2. using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
  3. namespace Content.Server.Singularity.Components;
  4. /// <summary>
  5. /// Attracts the singularity.
  6. /// </summary>
  7. [RegisterComponent]
  8. [Access(typeof(SingularityAttractorSystem))]
  9. public sealed partial class SingularityAttractorComponent : Component
  10. {
  11. /// <summary>
  12. /// The range at which singularities will be unable to go away from the attractor.
  13. /// </summary>
  14. [DataField, ViewVariables(VVAccess.ReadWrite)]
  15. public float BaseRange = 25f;
  16. /// <summary>
  17. /// The amount of time that should elapse between pulses of this attractor.
  18. /// </summary>
  19. [DataField, ViewVariables(VVAccess.ReadOnly)]
  20. public TimeSpan TargetPulsePeriod = TimeSpan.FromSeconds(2);
  21. /// <summary>
  22. /// The last time this attractor pulsed.
  23. /// </summary>
  24. [DataField(customTypeSerializer: typeof(TimeOffsetSerializer))]
  25. public TimeSpan LastPulseTime = default!;
  26. }