2022-03-23 13:02:49 +11:00
|
|
|
using System.Threading;
|
2021-07-10 17:35:33 +02:00
|
|
|
using Content.Shared.Sound;
|
2020-08-13 12:39:23 -05:00
|
|
|
using Robust.Shared.GameObjects;
|
2021-03-05 01:08:38 +01:00
|
|
|
using Robust.Shared.Serialization.Manager.Attributes;
|
2020-08-13 12:39:23 -05:00
|
|
|
using Robust.Shared.ViewVariables;
|
|
|
|
|
|
2021-06-09 22:19:39 +02:00
|
|
|
namespace Content.Server.RCD.Components
|
2020-08-13 12:39:23 -05:00
|
|
|
{
|
2022-03-23 13:02:49 +11:00
|
|
|
public enum RcdMode : byte
|
2020-08-13 12:39:23 -05:00
|
|
|
{
|
2021-10-24 06:34:00 +03:00
|
|
|
Floors,
|
|
|
|
|
Walls,
|
|
|
|
|
Airlock,
|
|
|
|
|
Deconstruct
|
|
|
|
|
}
|
2020-08-13 12:39:23 -05:00
|
|
|
|
2021-10-24 06:34:00 +03:00
|
|
|
[RegisterComponent]
|
2022-02-16 00:23:23 -07:00
|
|
|
public sealed class RCDComponent : Component
|
2021-10-24 06:34:00 +03:00
|
|
|
{
|
2022-03-23 13:02:49 +11:00
|
|
|
private const int DefaultAmmoCount = 5;
|
2020-08-13 12:39:23 -05:00
|
|
|
|
2021-10-24 06:34:00 +03:00
|
|
|
[ViewVariables(VVAccess.ReadOnly)]
|
2022-03-23 13:02:49 +11:00
|
|
|
[DataField("maxAmmo")] public int MaxAmmo = DefaultAmmoCount;
|
2020-08-13 12:39:23 -05:00
|
|
|
|
2021-10-24 06:34:00 +03:00
|
|
|
[ViewVariables(VVAccess.ReadWrite)] [DataField("delay")]
|
|
|
|
|
public float Delay = 2f;
|
2021-05-08 02:57:13 +02:00
|
|
|
|
2021-10-24 06:34:00 +03:00
|
|
|
[DataField("swapModeSound")]
|
|
|
|
|
public SoundSpecifier SwapModeSound = new SoundPathSpecifier("/Audio/Items/genhit.ogg");
|
2020-08-13 12:39:23 -05:00
|
|
|
|
2021-10-24 06:34:00 +03:00
|
|
|
[DataField("successSound")]
|
|
|
|
|
public SoundSpecifier SuccessSound = new SoundPathSpecifier("/Audio/Items/deconstruct.ogg");
|
2020-08-13 12:39:23 -05:00
|
|
|
|
2021-10-24 06:34:00 +03:00
|
|
|
/// <summary>
|
|
|
|
|
/// What mode are we on? Can be floors, walls, deconstruct.
|
|
|
|
|
/// </summary>
|
2022-03-23 13:02:49 +11:00
|
|
|
[ViewVariables]
|
|
|
|
|
[DataField("mode")]
|
2021-10-24 06:34:00 +03:00
|
|
|
public RcdMode Mode = RcdMode.Floors;
|
2020-08-13 12:39:23 -05:00
|
|
|
|
2021-10-24 06:34:00 +03:00
|
|
|
/// <summary>
|
|
|
|
|
/// How much "ammo" we have left. You can refill this with RCD ammo.
|
|
|
|
|
/// </summary>
|
2022-03-23 13:02:49 +11:00
|
|
|
[ViewVariables(VVAccess.ReadWrite)] [DataField("ammo")]
|
|
|
|
|
public int CurrentAmmo = DefaultAmmoCount;
|
2020-08-13 12:39:23 -05:00
|
|
|
|
2022-03-23 13:02:49 +11:00
|
|
|
public CancellationTokenSource? CancelToken = null;
|
2020-08-13 12:39:23 -05:00
|
|
|
}
|
|
|
|
|
}
|