rcd refactor (#15172)

Co-authored-by: deltanedas <@deltanedas:kde.org>
This commit is contained in:
deltanedas
2023-05-01 13:46:59 +00:00
committed by GitHub
parent 10e3635a7b
commit ddc2785110
14 changed files with 495 additions and 355 deletions

View File

@@ -0,0 +1,51 @@
using Content.Shared.Maps;
using Content.Shared.RCD.Systems;
using Robust.Shared.Audio;
using Robust.Shared.GameStates;
using Robust.Shared.Serialization;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
namespace Content.Shared.RCD.Components;
public enum RcdMode : byte
{
Floors,
Walls,
Airlock,
Deconstruct
}
/// <summary>
/// Main component for the RCD
/// Optionally uses LimitedChargesComponent.
/// Charges can be refilled with RCD ammo
/// </summary>
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
[Access(typeof(RCDSystem))]
public sealed partial class RCDComponent : Component
{
/// <summary>
/// Time taken to do an action like placing a wall
/// </summary>
[DataField("delay"), ViewVariables(VVAccess.ReadWrite), AutoNetworkedField]
public float Delay = 2f;
[DataField("swapModeSound")]
public SoundSpecifier SwapModeSound = new SoundPathSpecifier("/Audio/Items/genhit.ogg");
[DataField("successSound")]
public SoundSpecifier SuccessSound = new SoundPathSpecifier("/Audio/Items/deconstruct.ogg");
/// <summary>
/// What mode are we on? Can be floors, walls, airlock, deconstruct.
/// </summary>
[DataField("mode"), AutoNetworkedField]
public RcdMode Mode = RcdMode.Floors;
/// <summary>
/// ID of the floor to create when using the floor mode.
/// </summary>
[DataField("floor", customTypeSerializer: typeof(PrototypeIdSerializer<ContentTileDefinition>))]
[ViewVariables(VVAccess.ReadWrite), AutoNetworkedField]
public string Floor = "FloorSteel";
}