2021-07-10 17:35:33 +02:00
|
|
|
using Content.Shared.Sound;
|
2021-09-09 16:20:41 +02:00
|
|
|
using Robust.Shared.Analyzers;
|
2020-07-06 16:37:39 -05:00
|
|
|
using Robust.Shared.GameObjects;
|
2021-03-05 01:08:38 +01:00
|
|
|
using Robust.Shared.Serialization.Manager.Attributes;
|
2020-07-06 16:37:39 -05:00
|
|
|
using Robust.Shared.ViewVariables;
|
|
|
|
|
|
2021-06-09 22:19:39 +02:00
|
|
|
namespace Content.Server.Flash.Components
|
2020-07-06 16:37:39 -05:00
|
|
|
{
|
2021-09-09 16:20:41 +02:00
|
|
|
[RegisterComponent, Friend(typeof(FlashSystem))]
|
2022-02-16 00:23:23 -07:00
|
|
|
public sealed class FlashComponent : Component
|
2020-07-06 16:37:39 -05:00
|
|
|
{
|
2021-06-05 00:20:52 -07:00
|
|
|
[DataField("duration")]
|
|
|
|
|
[ViewVariables(VVAccess.ReadWrite)]
|
|
|
|
|
public int FlashDuration { get; set; } = 5000;
|
2021-03-05 01:08:38 +01:00
|
|
|
|
2021-06-05 00:20:52 -07:00
|
|
|
[DataField("uses")]
|
|
|
|
|
[ViewVariables(VVAccess.ReadWrite)]
|
|
|
|
|
public int Uses { get; set; } = 5;
|
2020-07-06 16:37:39 -05:00
|
|
|
|
2021-06-05 00:20:52 -07:00
|
|
|
[DataField("range")]
|
|
|
|
|
[ViewVariables(VVAccess.ReadWrite)]
|
|
|
|
|
public float Range { get; set; } = 7f;
|
2020-07-06 16:37:39 -05:00
|
|
|
|
2021-06-05 00:20:52 -07:00
|
|
|
[ViewVariables(VVAccess.ReadWrite)]
|
|
|
|
|
[DataField("aoeFlashDuration")]
|
|
|
|
|
public int AoeFlashDuration { get; set; } = 2000;
|
2020-07-06 16:37:39 -05:00
|
|
|
|
2021-06-05 00:20:52 -07:00
|
|
|
[DataField("slowTo")]
|
|
|
|
|
[ViewVariables(VVAccess.ReadWrite)]
|
|
|
|
|
public float SlowTo { get; set; } = 0.5f;
|
2020-07-06 16:37:39 -05:00
|
|
|
|
2021-07-10 17:35:33 +02:00
|
|
|
[ViewVariables(VVAccess.ReadWrite)]
|
|
|
|
|
[DataField("sound")]
|
|
|
|
|
public SoundSpecifier Sound { get; set; } = new SoundPathSpecifier("/Audio/Weapons/flash.ogg");
|
|
|
|
|
|
2021-06-05 00:20:52 -07:00
|
|
|
public bool Flashing;
|
2020-07-06 16:37:39 -05:00
|
|
|
|
2021-06-05 00:20:52 -07:00
|
|
|
public bool HasUses => Uses > 0;
|
2020-07-06 16:37:39 -05:00
|
|
|
}
|
|
|
|
|
}
|