Power Sink Upgraded (#15683)

Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
This commit is contained in:
Skye
2023-05-17 06:55:42 -07:00
committed by GitHub
parent befb0900cf
commit 67d6d1528b
7 changed files with 161 additions and 10 deletions

View File

@@ -1,8 +1,44 @@
namespace Content.Server.PowerSink
using Robust.Shared.Audio;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
namespace Content.Server.PowerSink
{
/// <summary>
/// Absorbs power up to its capacity when anchored then explodes.
/// </summary>
[RegisterComponent]
public sealed class PowerSinkComponent : Component {}
public sealed class PowerSinkComponent : Component
{
/// <summary>
/// When the power sink is nearing its explosion, warn the crew so they can look for it
/// (if they're not already).
/// </summary>
[DataField("sentImminentExplosionWarning")]
[ViewVariables(VVAccess.ReadWrite)]
public bool SentImminentExplosionWarningMessage = false;
/// <summary>
/// If explosion has been triggered, time at which to explode.
/// </summary>
[DataField("explosionTime", customTypeSerializer:typeof(TimeOffsetSerializer))]
public System.TimeSpan? ExplosionTime = null;
/// <summary>
/// The highest sound warning threshold that has been hit (plays sfx occasionally as explosion nears)
/// </summary>
[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)
};
}
}