IgniteOnTriggerComponent.cs 1.1 KB

123456789101112131415161718192021222324252627282930
  1. using Robust.Shared.Audio;
  2. using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
  3. namespace Content.Server.IgnitionSource;
  4. /// <summary>
  5. /// Ignites for a certain length of time when triggered.
  6. /// Requires <see cref="IgnitionSourceComponent"/> along with triggering components.
  7. /// </summary>
  8. [RegisterComponent, Access(typeof(IgniteOnTriggerSystem))]
  9. public sealed partial class IgniteOnTriggerComponent : Component
  10. {
  11. /// <summary>
  12. /// Once ignited, the time it will unignite at.
  13. /// </summary>
  14. [DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), ViewVariables(VVAccess.ReadWrite)]
  15. public TimeSpan IgnitedUntil = TimeSpan.Zero;
  16. /// <summary>
  17. /// How long the ignition source is active for after triggering.
  18. /// </summary>
  19. [DataField, ViewVariables(VVAccess.ReadWrite)]
  20. public TimeSpan IgnitedTime = TimeSpan.FromSeconds(0.5);
  21. /// <summary>
  22. /// Sound to play when igniting.
  23. /// </summary>
  24. [DataField]
  25. public SoundSpecifier IgniteSound = new SoundCollectionSpecifier("WelderOn");
  26. }