PowerSinkComponent.cs 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. using Robust.Shared.Audio;
  2. using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
  3. namespace Content.Server.PowerSink
  4. {
  5. /// <summary>
  6. /// Absorbs power up to its capacity when anchored then explodes.
  7. /// </summary>
  8. [RegisterComponent, AutoGenerateComponentPause]
  9. public sealed partial class PowerSinkComponent : Component
  10. {
  11. /// <summary>
  12. /// When the power sink is nearing its explosion, warn the crew so they can look for it
  13. /// (if they're not already).
  14. /// </summary>
  15. [DataField("sentImminentExplosionWarning")]
  16. [ViewVariables(VVAccess.ReadWrite)]
  17. public bool SentImminentExplosionWarningMessage = false;
  18. /// <summary>
  19. /// If explosion has been triggered, time at which to explode.
  20. /// </summary>
  21. [DataField("explosionTime", customTypeSerializer:typeof(TimeOffsetSerializer))]
  22. [AutoPausedField]
  23. public System.TimeSpan? ExplosionTime = null;
  24. /// <summary>
  25. /// The highest sound warning threshold that has been hit (plays sfx occasionally as explosion nears)
  26. /// </summary>
  27. [DataField("highestWarningSoundThreshold")]
  28. [ViewVariables(VVAccess.ReadWrite)]
  29. public float HighestWarningSoundThreshold = 0f;
  30. [DataField("chargeFireSound")]
  31. public SoundSpecifier ChargeFireSound = new SoundPathSpecifier("/Audio/Effects/PowerSink/charge_fire.ogg");
  32. [DataField("electricSound")] public SoundSpecifier ElectricSound =
  33. new SoundPathSpecifier("/Audio/Effects/PowerSink/electric.ogg")
  34. {
  35. Params = AudioParams.Default
  36. .WithVolume(15f) // audible even behind walls
  37. .WithRolloffFactor(10)
  38. };
  39. }
  40. }