1
0

EmpDisabledComponent.cs 987 B

1234567891011121314151617181920212223242526272829
  1. using Robust.Shared.GameStates;
  2. using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
  3. namespace Content.Shared.Emp;
  4. /// <summary>
  5. /// While entity has this component it is "disabled" by EMP.
  6. /// Add desired behaviour in other systems
  7. /// </summary>
  8. [RegisterComponent, NetworkedComponent, AutoGenerateComponentPause]
  9. [Access(typeof(SharedEmpSystem))]
  10. public sealed partial class EmpDisabledComponent : Component
  11. {
  12. /// <summary>
  13. /// Moment of time when component is removed and entity stops being "disabled"
  14. /// </summary>
  15. [DataField("timeLeft", customTypeSerializer: typeof(TimeOffsetSerializer)), ViewVariables(VVAccess.ReadWrite)]
  16. [AutoPausedField]
  17. public TimeSpan DisabledUntil;
  18. [DataField("effectCoolDown"), ViewVariables(VVAccess.ReadWrite)]
  19. public float EffectCooldown = 3f;
  20. /// <summary>
  21. /// When next effect will be spawned
  22. /// </summary>
  23. [AutoPausedField]
  24. public TimeSpan TargetTime = TimeSpan.Zero;
  25. }