Files
tbd-station-14/Content.Shared/Flash/Components/FlashComponent.cs
2024-06-02 00:17:53 -04:00

56 lines
1.6 KiB
C#

using Robust.Shared.Audio;
using Robust.Shared.GameStates;
using Robust.Shared.Serialization;
namespace Content.Shared.Flash.Components
{
[RegisterComponent, NetworkedComponent, Access(typeof(SharedFlashSystem))]
public sealed partial class FlashComponent : Component
{
[DataField("duration")]
[ViewVariables(VVAccess.ReadWrite)]
public int FlashDuration { get; set; } = 5000;
/// <summary>
/// How long a target is stunned when a melee flash is used.
/// If null, melee flashes will not stun at all
/// </summary>
[DataField]
public TimeSpan? MeleeStunDuration = TimeSpan.FromSeconds(1.5);
[DataField("range")]
[ViewVariables(VVAccess.ReadWrite)]
public float Range { get; set; } = 7f;
[ViewVariables(VVAccess.ReadWrite)]
[DataField("aoeFlashDuration")]
public int AoeFlashDuration { get; set; } = 2000;
[DataField("slowTo")]
[ViewVariables(VVAccess.ReadWrite)]
public float SlowTo { get; set; } = 0.5f;
[ViewVariables(VVAccess.ReadWrite)]
[DataField("sound")]
public SoundSpecifier Sound { get; set; } = new SoundPathSpecifier("/Audio/Weapons/flash.ogg")
{
Params = AudioParams.Default.WithVolume(1f).WithMaxDistance(3f)
};
public bool Flashing;
[DataField]
public float Probability = 1f;
}
[Serializable, NetSerializable]
public enum FlashVisuals : byte
{
BaseLayer,
LightLayer,
Burnt,
Flashing,
}
}