2020-10-28 19:19:47 +01:00
|
|
|
using System.Threading;
|
2022-07-29 14:13:12 +12:00
|
|
|
using Robust.Shared.Audio;
|
2020-10-28 19:19:47 +01:00
|
|
|
|
2021-06-09 22:19:39 +02:00
|
|
|
namespace Content.Server.Singularity.Components
|
2020-10-28 19:19:47 +01:00
|
|
|
{
|
|
|
|
|
[RegisterComponent]
|
2022-02-16 00:23:23 -07:00
|
|
|
public sealed class EmitterComponent : Component
|
2020-10-28 19:19:47 +01:00
|
|
|
{
|
2021-07-24 13:42:05 +02:00
|
|
|
public CancellationTokenSource? TimerCancel;
|
2020-10-28 19:19:47 +01:00
|
|
|
|
|
|
|
|
// whether the power switch is in "on"
|
2021-07-24 13:42:05 +02:00
|
|
|
[ViewVariables] public bool IsOn;
|
2020-10-28 19:19:47 +01:00
|
|
|
// Whether the power switch is on AND the machine has enough power (so is actively firing)
|
2021-07-24 13:42:05 +02:00
|
|
|
[ViewVariables] public bool IsPowered;
|
2020-10-28 19:19:47 +01:00
|
|
|
|
2021-03-14 15:02:22 -07:00
|
|
|
// For the "emitter fired" sound
|
2021-07-24 13:42:05 +02:00
|
|
|
public const float Variation = 0.25f;
|
|
|
|
|
public const float Volume = 0.5f;
|
2022-08-08 10:31:53 +10:00
|
|
|
public const float Distance = 6f;
|
2020-10-28 19:19:47 +01:00
|
|
|
|
2021-07-24 13:42:05 +02:00
|
|
|
[ViewVariables] public int FireShotCounter;
|
2020-10-28 19:19:47 +01:00
|
|
|
|
2021-08-10 16:18:57 -07:00
|
|
|
[ViewVariables] [DataField("fireSound")] public SoundSpecifier FireSound = new SoundPathSpecifier("/Audio/Weapons/emitter.ogg");
|
2021-07-24 13:42:05 +02:00
|
|
|
[ViewVariables] [DataField("boltType")] public string BoltType = "EmitterBolt";
|
|
|
|
|
[ViewVariables] [DataField("powerUseActive")] public int PowerUseActive = 500;
|
|
|
|
|
[ViewVariables] [DataField("fireBurstSize")] public int FireBurstSize = 3;
|
|
|
|
|
[ViewVariables] [DataField("fireInterval")] public TimeSpan FireInterval = TimeSpan.FromSeconds(2);
|
|
|
|
|
[ViewVariables] [DataField("fireBurstDelayMin")] public TimeSpan FireBurstDelayMin = TimeSpan.FromSeconds(2);
|
|
|
|
|
[ViewVariables] [DataField("fireBurstDelayMax")] public TimeSpan FireBurstDelayMax = TimeSpan.FromSeconds(10);
|
2020-10-28 19:19:47 +01:00
|
|
|
}
|
|
|
|
|
}
|