Port DeltaV Lavaland Initial (2)

This commit is contained in:
tommy
2025-11-26 22:38:52 -05:00
parent da7cf45fa6
commit 3e33dc5936
10 changed files with 129 additions and 33 deletions

View File

@@ -2,10 +2,11 @@ using Content.Server.Atmos.EntitySystems;
using Content.Server.Parallax; using Content.Server.Parallax;
using Content.Shared.DeltaV.Planet; using Content.Shared.DeltaV.Planet;
using Content.Shared.Parallax.Biomes; using Content.Shared.Parallax.Biomes;
using Robust.Server.GameObjects; using Robust.Shared.EntitySerialization.Systems;
using Robust.Shared.Map; using Robust.Shared.Map;
using Robust.Shared.Map.Components; using Robust.Shared.Map.Components;
using Robust.Shared.Prototypes; using Robust.Shared.Prototypes;
using Robust.Shared.Utility;
namespace Content.Server.DeltaV.Planet; namespace Content.Server.DeltaV.Planet;
@@ -14,9 +15,9 @@ public sealed class PlanetSystem : EntitySystem
[Dependency] private readonly AtmosphereSystem _atmos = default!; [Dependency] private readonly AtmosphereSystem _atmos = default!;
[Dependency] private readonly BiomeSystem _biome = default!; [Dependency] private readonly BiomeSystem _biome = default!;
[Dependency] private readonly IPrototypeManager _proto = default!; [Dependency] private readonly IPrototypeManager _proto = default!;
[Dependency] private readonly MapSystem _map = default!;
[Dependency] private readonly MapLoaderSystem _mapLoader = default!; [Dependency] private readonly MapLoaderSystem _mapLoader = default!;
[Dependency] private readonly MetaDataSystem _meta = default!; [Dependency] private readonly MetaDataSystem _meta = default!;
[Dependency] private readonly SharedMapSystem _map = default!;
private readonly List<(Vector2i, Tile)> _setTiles = new(); private readonly List<(Vector2i, Tile)> _setTiles = new();
@@ -51,11 +52,11 @@ public sealed class PlanetSystem : EntitySystem
/// Spawns an initialized planet map from a planet prototype and loads a grid onto it. /// Spawns an initialized planet map from a planet prototype and loads a grid onto it.
/// Returns the map entity if loading succeeded. /// Returns the map entity if loading succeeded.
/// </summary> /// </summary>
public EntityUid? LoadPlanet(ProtoId<PlanetPrototype> id, string path) public EntityUid? LoadPlanet(ProtoId<PlanetPrototype> id, ResPath path)
{ {
var map = SpawnPlanet(id, runMapInit: false); var map = SpawnPlanet(id, runMapInit: false);
var mapId = Comp<MapComponent>(map).MapId; var mapId = Comp<MapComponent>(map).MapId;
if (!_mapLoader.TryLoad(mapId, path, out var grids)) if (!_mapLoader.TryLoadGrid(mapId, path, out var grid))
{ {
Log.Error($"Failed to load planet grid {path} for planet {id}!"); Log.Error($"Failed to load planet grid {path} for planet {id}!");
Del(map); Del(map);
@@ -63,12 +64,9 @@ public sealed class PlanetSystem : EntitySystem
} }
// don't want rocks spawning inside the base // don't want rocks spawning inside the base
foreach (var gridUid in grids) _setTiles.Clear();
{ var aabb = Comp<MapGridComponent>(grid.Value).LocalAABB;
_setTiles.Clear(); _biome.ReserveTiles(map, aabb.Enlarged(0.2f), _setTiles);
var aabb = Comp<MapGridComponent>(gridUid).LocalAABB;
_biome.ReserveTiles(map, aabb.Enlarged(0.2f), _setTiles);
}
_map.InitializeMap(map); _map.InitializeMap(map);
return map; return map;

View File

@@ -1,9 +1,9 @@
using Content.Server.Shuttles.Events; using Content.Server.Shuttles.Events;
using Content.Server.Station.Components;
using Content.Server.Station.Systems; using Content.Server.Station.Systems;
using Content.Shared.DeltaV.Shuttles.Components; using Content.Shared.DeltaV.Shuttles.Components;
using Content.Shared.DeltaV.Shuttles.Systems; using Content.Shared.DeltaV.Shuttles.Systems;
using Content.Shared.Shuttles.Components; using Content.Shared.Shuttles.Components;
using Content.Shared.Station.Components;
using Content.Shared.Whitelist; using Content.Shared.Whitelist;
using Robust.Shared.Map.Components; using Robust.Shared.Map.Components;
using System.Linq; using System.Linq;

View File

@@ -20,7 +20,7 @@ public sealed class StationPlanetSpawnerSystem : EntitySystem
if (ent.Comp.GridPath is not {} path) if (ent.Comp.GridPath is not {} path)
return; return;
ent.Comp.Map = _planet.LoadPlanet(ent.Comp.Planet, path.ToString()); ent.Comp.Map = _planet.LoadPlanet(ent.Comp.Planet, path);
} }
private void OnShutdown(Entity<StationPlanetSpawnerComponent> ent, ref ComponentShutdown args) private void OnShutdown(Entity<StationPlanetSpawnerComponent> ent, ref ComponentShutdown args)

View File

@@ -1300,18 +1300,6 @@ entities:
- type: Transform - type: Transform
pos: 11.5,3.5 pos: 11.5,3.5
parent: 1 parent: 1
- proto: FoodPSB
entities:
- uid: 184
components:
- type: Transform
pos: -4.5806994,-2.5397594
parent: 1
- uid: 185
components:
- type: Transform
pos: -4.5650744,-2.2741344
parent: 1
- proto: GasMixer - proto: GasMixer
entities: entities:
- uid: 186 - uid: 186
@@ -3804,15 +3792,6 @@ entities:
rot: 1.5707963267948966 rad rot: 1.5707963267948966 rad
pos: -8.5,-4.5 pos: -8.5,-4.5
parent: 1 parent: 1
- proto: WarpPointSalvage
entities:
- uid: 545
components:
- type: Transform
pos: 0.5,0.5
parent: 1
- type: WarpPoint
location: Mining Station
- proto: WeaponProtoKineticAccelerator - proto: WeaponProtoKineticAccelerator
entities: entities:
- uid: 546 - uid: 546

View File

@@ -0,0 +1,10 @@
- type: entity
parent: BaseComputerCircuitboard
id: MiningShuttleConsoleCircuitboard
name: mining shuttle console board
description: A printed circuit board for a mining shuttle console.
components:
- type: Sprite
state: cpu_supply
- type: ComputerBoard
prototype: ComputerShuttleMining

View File

@@ -0,0 +1,7 @@
- type: entity
abstract: true
id: BaseStationLavaland
components:
- type: StationPlanetSpawner
planet: Lavaland
gridPath: /Maps/Nonstations/DeltaV/lavaland_mining_base.yml

View File

@@ -0,0 +1,24 @@
# this goes on lavaland, unlimited
- type: entity
parent: AirlockGlassShuttle
id: AirlockExternalGlassShuttleMining
suffix: External, Mining, Glass, Docking, Locked
components:
- type: PriorityDock
tag: DockMining
- type: ContainerFill
containers:
board: [ DoorElectronicsExternal ]
# 1 per map, this spawns the mining shuttle
- type: entity
parent: AirlockExternalGlassShuttleMining
id: AirlockExternalGlassShuttleMiningFilled
suffix: Mining, Filled, Locked
components:
- type: GridFill
path: /Maps/Shuttles/DeltaV/mining.yml
addComponents:
- type: IFF
flags:
- HideLabel

View File

@@ -0,0 +1,50 @@
- type: entity
abstract: true
parent: BaseComputer
id: BaseComputerDocking
components:
- type: Sprite
layers:
- map: [ "computerLayerBody" ]
state: computer
- map: [ "computerLayerKeyboard" ]
state: generic_keyboard
- map: [ "computerLayerScreen" ]
state: shuttle
- map: ["computerLayerKeys" ]
state: generic_keys
- map: [ "enum.WiresVisualLayers.MaintenancePanel" ]
state: generic_panel_open
- type: ActivatableUI
key: enum.DockingConsoleUiKey.Key
- type: UserInterface
interfaces:
enum.DockingConsoleUiKey.Key:
type: DockingConsoleBoundUserInterface
enum.WiresUiKey.Key:
type: WiresBoundUserInterface
- type: WorldLoader
radius: 256
- type: DockingConsole
- type: PointLight
radius: 1.5
energy: 1.6
color: "#43ccb5"
- type: entity
parent: BaseComputerDocking
id: ComputerShuttleMining
name: mining shuttle console
description: Used to pilot the mining shuttle to and from the mining base.
components:
- type: DockingConsole
windowTitle: mining-console-window-title
dockTag: DockMining
shuttleWhitelist:
components:
- MiningShuttle
- type: Computer
board: MiningShuttleConsoleCircuitboard
- type: AccessReader
access:
- [ Salvage ]

View File

@@ -0,0 +1,2 @@
- type: Tag
id: DockMining

View File

@@ -0,0 +1,26 @@
- type: planet
id: Lavaland
biome: Lava
mapName: shuttle-destination-lavaland
mapLight: "#A34931"
addedComponents:
- type: FTLDestination
whitelist:
components:
- MiningShuttle
atmosphere:
volume: 2500
temperature: 353.15 # 80C
moles: # 120kPa, 14% O2 (unbreathable)
- 14.38346
- 88.35554
biomeMarkerLayers:
- OreIron
- OreQuartz
- OreCoal
- OreGold
- OreSilver
- OrePlasma
- OreUranium
- OreDiamond
- OreArtifactFragment