Port DeltaV Lavaland Initial

This commit is contained in:
deltanedas
2024-12-10 18:37:43 +00:00
committed by tommy
parent 8d66d0bc7c
commit da7cf45fa6
22 changed files with 5141 additions and 7 deletions

View File

@@ -0,0 +1,49 @@
using Content.Shared.Atmos;
using Content.Shared.Parallax.Biomes;
using Content.Shared.Parallax.Biomes.Markers;
using Robust.Shared.Prototypes;
namespace Content.Shared.DeltaV.Planet;
[Prototype]
public sealed partial class PlanetPrototype : IPrototype
{
[IdDataField]
public string ID { get; set; } = string.Empty;
/// <summary>
/// The biome to create the planet with.
/// </summary>
[DataField(required: true)]
public ProtoId<BiomeTemplatePrototype> Biome;
/// <summary>
/// Name to give to the map.
/// </summary>
[DataField(required: true)]
public LocId MapName;
/// <summary>
/// Ambient lighting for the map.
/// </summary>
[DataField]
public Color MapLight = Color.FromHex("#D8B059");
/// <summary>
/// Components to add to the map.
/// </summary>
[DataField]
public ComponentRegistry? AddedComponents;
/// <summary>
/// The gas mixture to use for the atmosphere.
/// </summary>
[DataField(required: true)]
public GasMixture Atmosphere = new();
/// <summary>
/// Biome layers to add to the map, i.e. ores.
/// </summary>
[DataField]
public List<ProtoId<BiomeMarkerLayerPrototype>> BiomeMarkerLayers = new();
}

View File

@@ -0,0 +1,48 @@
using Content.Shared.DeltaV.Shuttles.Systems;
using Content.Shared.Tag;
using Content.Shared.Whitelist;
using Robust.Shared.GameStates;
using Robust.Shared.Prototypes;
namespace Content.Shared.DeltaV.Shuttles.Components;
/// <summary>
/// A shuttle console that can only ftl-dock between 2 grids.
/// The shuttle used must have <see cref="DockingShuttleComponent"/>.
/// </summary>
[RegisterComponent, NetworkedComponent, Access(typeof(SharedDockingConsoleSystem))]
[AutoGenerateComponentState]
public sealed partial class DockingConsoleComponent : Component
{
/// <summary>
/// Title of the window to use
/// </summary>
[DataField(required: true)]
public LocId WindowTitle;
/// <summary>
/// Airlock tag that it will prioritize docking to.
/// </summary>
[DataField(required: true)]
public ProtoId<TagPrototype> DockTag;
/// <summary>
/// A whitelist the shuttle has to match to be piloted.
/// </summary>
[DataField(required: true)]
public EntityWhitelist ShuttleWhitelist = new();
/// <summary>
/// The shuttle that matches <see cref="ShuttleWhitelist"/>.
/// If this is null a shuttle was not found and this console does nothing.
/// </summary>
[DataField]
public EntityUid? Shuttle;
/// <summary>
/// Whether <see cref="Shuttle"/> is set on the server or not.
/// Client can't use Shuttle outside of PVS range so that isn't networked.
/// </summary>
[DataField, AutoNetworkedField]
public bool HasShuttle;
}

View File

@@ -0,0 +1,46 @@
using Content.Shared.DeltaV.Shuttles.Systems;
using Robust.Shared.GameStates;
using Robust.Shared.Map;
using Robust.Shared.Serialization;
namespace Content.Shared.DeltaV.Shuttles.Components;
/// <summary>
/// Component that stores destinations a docking-only shuttle can use.
/// Used by <see cref="DockingConsoleComponent"/> to access destinations.
/// </summary>
[RegisterComponent, NetworkedComponent, Access(typeof(SharedDockingShuttleSystem))]
public sealed partial class DockingShuttleComponent : Component
{
/// <summary>
/// The station this shuttle belongs to.
/// </summary>
[DataField]
public EntityUid? Station;
/// <summary>
/// Every destination this console can FTL to.
/// </summary>
[DataField]
public List<DockingDestination> Destinations = new();
}
/// <summary>
/// A map a shuttle can FTL to.
/// Created automatically on shuttle mapinit.
/// </summary>
[DataDefinition, Serializable, NetSerializable]
public partial struct DockingDestination
{
/// <summary>
/// The name of the destination to use in UI.
/// </summary>
[DataField]
public LocId Name;
/// <summary>
/// The map ID.
/// </summary>
[DataField]
public MapId Map;
}

View File

@@ -0,0 +1,10 @@
using Robust.Shared.GameStates;
namespace Content.Shared.DeltaV.Shuttles.Components;
/// <summary>
/// Marker component for the mining shuttle grid.
/// Used for lavaland's FTL whitelist.
/// </summary>
[RegisterComponent, NetworkedComponent]
public sealed partial class MiningShuttleComponent : Component;

View File

@@ -0,0 +1,26 @@
using Content.Shared.DeltaV.Shuttles.Components;
using Content.Shared.Shuttles.Systems;
using Content.Shared.Timing;
using Robust.Shared.Serialization;
namespace Content.Shared.DeltaV.Shuttles;
[Serializable, NetSerializable]
public enum DockingConsoleUiKey : byte
{
Key
}
[Serializable, NetSerializable]
public sealed class DockingConsoleState(FTLState ftlState, StartEndTime ftlTime, List<DockingDestination> destinations) : BoundUserInterfaceState
{
public FTLState FTLState = ftlState;
public StartEndTime FTLTime = ftlTime;
public List<DockingDestination> Destinations = destinations;
}
[Serializable, NetSerializable]
public sealed class DockingConsoleFTLMessage(int index) : BoundUserInterfaceMessage
{
public int Index = index;
}

View File

@@ -0,0 +1,3 @@
namespace Content.Shared.DeltaV.Shuttles.Systems;
public abstract class SharedDockingConsoleSystem : EntitySystem;

View File

@@ -0,0 +1,3 @@
namespace Content.Shared.DeltaV.Shuttles.Systems;
public abstract class SharedDockingShuttleSystem : EntitySystem;