Add FTL destinations (#9685)
This commit is contained in:
@@ -13,6 +13,9 @@ namespace Content.Server.Shuttles.Components
|
||||
[ViewVariables]
|
||||
public Joint? DockJoint;
|
||||
|
||||
[ViewVariables, DataField("dockJointId")]
|
||||
public string? DockJointId;
|
||||
|
||||
[ViewVariables]
|
||||
public override bool Docked => DockedWith != null;
|
||||
|
||||
|
||||
52
Content.Server/Shuttles/Components/FTLComponent.cs
Normal file
52
Content.Server/Shuttles/Components/FTLComponent.cs
Normal file
@@ -0,0 +1,52 @@
|
||||
using Content.Shared.Shuttles.Systems;
|
||||
using Content.Shared.Sound;
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.Map;
|
||||
|
||||
namespace Content.Server.Shuttles.Components;
|
||||
|
||||
/// <summary>
|
||||
/// Added to a component when it is queued or is travelling via FTL.
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
public sealed class FTLComponent : Component
|
||||
{
|
||||
[ViewVariables]
|
||||
public FTLState State = FTLState.Available;
|
||||
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
public float StartupTime = 0f;
|
||||
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
public float TravelTime = 0f;
|
||||
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
public float Accumulator = 0f;
|
||||
|
||||
/// <summary>
|
||||
/// Target Uid to dock with at the end of FTL.
|
||||
/// </summary>
|
||||
[ViewVariables(VVAccess.ReadWrite), DataField("targetUid")]
|
||||
public EntityUid? TargetUid;
|
||||
|
||||
[ViewVariables(VVAccess.ReadWrite), DataField("targetCoordinates")]
|
||||
public EntityCoordinates TargetCoordinates;
|
||||
|
||||
/// <summary>
|
||||
/// Should we dock with the target when arriving or show up nearby.
|
||||
/// </summary>
|
||||
[ViewVariables(VVAccess.ReadWrite), DataField("dock")]
|
||||
public bool Dock;
|
||||
|
||||
[ViewVariables(VVAccess.ReadWrite), DataField("soundTravel")]
|
||||
public SoundSpecifier? TravelSound = new SoundPathSpecifier("/Audio/Effects/Shuttle/hyperspace_progress.ogg")
|
||||
{
|
||||
Params =
|
||||
{
|
||||
Volume = -10,
|
||||
Loop = true,
|
||||
}
|
||||
};
|
||||
|
||||
public IPlayingAudioStream? TravelStream;
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using Content.Shared.Whitelist;
|
||||
|
||||
namespace Content.Server.Shuttles.Components;
|
||||
|
||||
[RegisterComponent]
|
||||
public sealed class FTLDestinationComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
/// Should this destination be restricted in some form from console visibility.
|
||||
/// </summary>
|
||||
[ViewVariables(VVAccess.ReadWrite), DataField("whitelist")]
|
||||
public EntityWhitelist? Whitelist;
|
||||
|
||||
/// <summary>
|
||||
/// Is this destination visible but available to be warped to?
|
||||
/// </summary>
|
||||
[ViewVariables(VVAccess.ReadWrite), DataField("enabled")]
|
||||
public bool Enabled = true;
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
using Robust.Shared.Map;
|
||||
|
||||
namespace Content.Server.Shuttles.Components;
|
||||
|
||||
/// <summary>
|
||||
/// Added to a component when it is queued or is travelling through hyperspace
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
public sealed class HyperspaceComponent : Component
|
||||
{
|
||||
[ViewVariables]
|
||||
public HyperspaceState State = HyperspaceState.Starting;
|
||||
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
public float StartupTime = 0f;
|
||||
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
public float TravelTime = 0f;
|
||||
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
public float Accumulator = 0f;
|
||||
|
||||
/// <summary>
|
||||
/// Target Uid to dock with at the end of hyperspace.
|
||||
/// </summary>
|
||||
[ViewVariables(VVAccess.ReadWrite), DataField("targetUid")]
|
||||
public EntityUid? TargetUid;
|
||||
|
||||
[ViewVariables(VVAccess.ReadWrite), DataField("targetCoordinates")]
|
||||
public EntityCoordinates TargetCoordinates;
|
||||
}
|
||||
|
||||
public enum HyperspaceState : byte
|
||||
{
|
||||
Starting,
|
||||
Travelling,
|
||||
}
|
||||
@@ -5,12 +5,6 @@ namespace Content.Server.Shuttles.Components
|
||||
[RegisterComponent]
|
||||
public sealed class ShuttleComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
/// Should controls be enabled or disabled on this shuttle.
|
||||
/// </summary>
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
public bool CanPilot = true;
|
||||
|
||||
[ViewVariables]
|
||||
public bool Enabled = true;
|
||||
|
||||
|
||||
@@ -5,12 +5,6 @@ namespace Content.Server.Shuttles.Components
|
||||
[RegisterComponent]
|
||||
public sealed class ShuttleConsoleComponent : SharedShuttleConsoleComponent
|
||||
{
|
||||
/// <summary>
|
||||
/// Set by shuttlesystem if the grid should no longer be pilotable.
|
||||
/// </summary>
|
||||
[ViewVariables]
|
||||
public bool CanPilot = true;
|
||||
|
||||
[ViewVariables]
|
||||
public readonly List<PilotComponent> SubscribedPilots = new();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user