using Robust.Shared.Audio;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
namespace Content.Server.PowerSink
{
///
/// Absorbs power up to its capacity when anchored then explodes.
///
[RegisterComponent]
public sealed partial class PowerSinkComponent : Component
{
///
/// When the power sink is nearing its explosion, warn the crew so they can look for it
/// (if they're not already).
///
[DataField("sentImminentExplosionWarning")]
[ViewVariables(VVAccess.ReadWrite)]
public bool SentImminentExplosionWarningMessage = false;
///
/// If explosion has been triggered, time at which to explode.
///
[DataField("explosionTime", customTypeSerializer:typeof(TimeOffsetSerializer))]
public System.TimeSpan? ExplosionTime = null;
///
/// The highest sound warning threshold that has been hit (plays sfx occasionally as explosion nears)
///
[DataField("highestWarningSoundThreshold")]
[ViewVariables(VVAccess.ReadWrite)]
public float HighestWarningSoundThreshold = 0f;
[DataField("chargeFireSound")]
public SoundSpecifier ChargeFireSound = new SoundPathSpecifier("/Audio/Effects/PowerSink/charge_fire.ogg");
[DataField("electricSound")] public SoundSpecifier ElectricSound =
new SoundPathSpecifier("/Audio/Effects/PowerSink/electric.ogg")
{
Params = AudioParams.Default
.WithVolume(15f) // audible even behind walls
.WithRolloffFactor(10)
};
}
}