From 3e33dc59365ef522a6410c50b7eb0a38063ff841 Mon Sep 17 00:00:00 2001 From: tommy Date: Wed, 26 Nov 2025 22:38:52 -0500 Subject: [PATCH] Port DeltaV Lavaland Initial (2) --- Content.Server/DeltaV/Planet/PlanetSystem.cs | 18 +++---- .../Shuttles/Systems/DockingShuttleSystem.cs | 2 +- .../Systems/StationPlanetSpawnerSystem.cs | 2 +- .../DeltaV/lavaland_mining_base.yml | 21 -------- .../Devices/CircuitBoards/computer.yml | 10 ++++ .../DeltaV/Entities/Stations/base.yml | 7 +++ .../Structures/Doors/Airlocks/access.yml | 24 +++++++++ .../Structures/Machines/computers.yml | 50 +++++++++++++++++++ Resources/Prototypes/DeltaV/tags.yml | 2 + Resources/Prototypes/planets.yml | 26 ++++++++++ 10 files changed, 129 insertions(+), 33 deletions(-) create mode 100644 Resources/Prototypes/DeltaV/Entities/Objects/Devices/CircuitBoards/computer.yml create mode 100644 Resources/Prototypes/DeltaV/Entities/Stations/base.yml create mode 100644 Resources/Prototypes/DeltaV/Entities/Structures/Doors/Airlocks/access.yml create mode 100644 Resources/Prototypes/DeltaV/Entities/Structures/Machines/computers.yml create mode 100644 Resources/Prototypes/DeltaV/tags.yml create mode 100644 Resources/Prototypes/planets.yml diff --git a/Content.Server/DeltaV/Planet/PlanetSystem.cs b/Content.Server/DeltaV/Planet/PlanetSystem.cs index 0178a45bb1..9bfc1e5c15 100644 --- a/Content.Server/DeltaV/Planet/PlanetSystem.cs +++ b/Content.Server/DeltaV/Planet/PlanetSystem.cs @@ -2,10 +2,11 @@ using Content.Server.Atmos.EntitySystems; using Content.Server.Parallax; using Content.Shared.DeltaV.Planet; using Content.Shared.Parallax.Biomes; -using Robust.Server.GameObjects; +using Robust.Shared.EntitySerialization.Systems; using Robust.Shared.Map; using Robust.Shared.Map.Components; using Robust.Shared.Prototypes; +using Robust.Shared.Utility; namespace Content.Server.DeltaV.Planet; @@ -14,9 +15,9 @@ public sealed class PlanetSystem : EntitySystem [Dependency] private readonly AtmosphereSystem _atmos = default!; [Dependency] private readonly BiomeSystem _biome = default!; [Dependency] private readonly IPrototypeManager _proto = default!; - [Dependency] private readonly MapSystem _map = default!; [Dependency] private readonly MapLoaderSystem _mapLoader = default!; [Dependency] private readonly MetaDataSystem _meta = default!; + [Dependency] private readonly SharedMapSystem _map = default!; 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. /// Returns the map entity if loading succeeded. /// - public EntityUid? LoadPlanet(ProtoId id, string path) + public EntityUid? LoadPlanet(ProtoId id, ResPath path) { var map = SpawnPlanet(id, runMapInit: false); var mapId = Comp(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}!"); Del(map); @@ -63,12 +64,9 @@ public sealed class PlanetSystem : EntitySystem } // don't want rocks spawning inside the base - foreach (var gridUid in grids) - { - _setTiles.Clear(); - var aabb = Comp(gridUid).LocalAABB; - _biome.ReserveTiles(map, aabb.Enlarged(0.2f), _setTiles); - } + _setTiles.Clear(); + var aabb = Comp(grid.Value).LocalAABB; + _biome.ReserveTiles(map, aabb.Enlarged(0.2f), _setTiles); _map.InitializeMap(map); return map; diff --git a/Content.Server/DeltaV/Shuttles/Systems/DockingShuttleSystem.cs b/Content.Server/DeltaV/Shuttles/Systems/DockingShuttleSystem.cs index 5f95761f65..6fbb76c34c 100644 --- a/Content.Server/DeltaV/Shuttles/Systems/DockingShuttleSystem.cs +++ b/Content.Server/DeltaV/Shuttles/Systems/DockingShuttleSystem.cs @@ -1,9 +1,9 @@ using Content.Server.Shuttles.Events; -using Content.Server.Station.Components; using Content.Server.Station.Systems; using Content.Shared.DeltaV.Shuttles.Components; using Content.Shared.DeltaV.Shuttles.Systems; using Content.Shared.Shuttles.Components; +using Content.Shared.Station.Components; using Content.Shared.Whitelist; using Robust.Shared.Map.Components; using System.Linq; diff --git a/Content.Server/DeltaV/Station/Systems/StationPlanetSpawnerSystem.cs b/Content.Server/DeltaV/Station/Systems/StationPlanetSpawnerSystem.cs index 47729cb8a0..99a9ab8674 100644 --- a/Content.Server/DeltaV/Station/Systems/StationPlanetSpawnerSystem.cs +++ b/Content.Server/DeltaV/Station/Systems/StationPlanetSpawnerSystem.cs @@ -20,7 +20,7 @@ public sealed class StationPlanetSpawnerSystem : EntitySystem if (ent.Comp.GridPath is not {} path) return; - ent.Comp.Map = _planet.LoadPlanet(ent.Comp.Planet, path.ToString()); + ent.Comp.Map = _planet.LoadPlanet(ent.Comp.Planet, path); } private void OnShutdown(Entity ent, ref ComponentShutdown args) diff --git a/Resources/Maps/Nonstations/DeltaV/lavaland_mining_base.yml b/Resources/Maps/Nonstations/DeltaV/lavaland_mining_base.yml index c57ce374fe..9dd6a38466 100644 --- a/Resources/Maps/Nonstations/DeltaV/lavaland_mining_base.yml +++ b/Resources/Maps/Nonstations/DeltaV/lavaland_mining_base.yml @@ -1300,18 +1300,6 @@ entities: - type: Transform pos: 11.5,3.5 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 entities: - uid: 186 @@ -3804,15 +3792,6 @@ entities: rot: 1.5707963267948966 rad pos: -8.5,-4.5 parent: 1 -- proto: WarpPointSalvage - entities: - - uid: 545 - components: - - type: Transform - pos: 0.5,0.5 - parent: 1 - - type: WarpPoint - location: Mining Station - proto: WeaponProtoKineticAccelerator entities: - uid: 546 diff --git a/Resources/Prototypes/DeltaV/Entities/Objects/Devices/CircuitBoards/computer.yml b/Resources/Prototypes/DeltaV/Entities/Objects/Devices/CircuitBoards/computer.yml new file mode 100644 index 0000000000..a0d764ab61 --- /dev/null +++ b/Resources/Prototypes/DeltaV/Entities/Objects/Devices/CircuitBoards/computer.yml @@ -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 diff --git a/Resources/Prototypes/DeltaV/Entities/Stations/base.yml b/Resources/Prototypes/DeltaV/Entities/Stations/base.yml new file mode 100644 index 0000000000..b7492db40b --- /dev/null +++ b/Resources/Prototypes/DeltaV/Entities/Stations/base.yml @@ -0,0 +1,7 @@ +- type: entity + abstract: true + id: BaseStationLavaland + components: + - type: StationPlanetSpawner + planet: Lavaland + gridPath: /Maps/Nonstations/DeltaV/lavaland_mining_base.yml \ No newline at end of file diff --git a/Resources/Prototypes/DeltaV/Entities/Structures/Doors/Airlocks/access.yml b/Resources/Prototypes/DeltaV/Entities/Structures/Doors/Airlocks/access.yml new file mode 100644 index 0000000000..8b3da51de4 --- /dev/null +++ b/Resources/Prototypes/DeltaV/Entities/Structures/Doors/Airlocks/access.yml @@ -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 \ No newline at end of file diff --git a/Resources/Prototypes/DeltaV/Entities/Structures/Machines/computers.yml b/Resources/Prototypes/DeltaV/Entities/Structures/Machines/computers.yml new file mode 100644 index 0000000000..8b3f66d3ee --- /dev/null +++ b/Resources/Prototypes/DeltaV/Entities/Structures/Machines/computers.yml @@ -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 ] diff --git a/Resources/Prototypes/DeltaV/tags.yml b/Resources/Prototypes/DeltaV/tags.yml new file mode 100644 index 0000000000..7c570e8a9b --- /dev/null +++ b/Resources/Prototypes/DeltaV/tags.yml @@ -0,0 +1,2 @@ +- type: Tag + id: DockMining \ No newline at end of file diff --git a/Resources/Prototypes/planets.yml b/Resources/Prototypes/planets.yml new file mode 100644 index 0000000000..3ab467225b --- /dev/null +++ b/Resources/Prototypes/planets.yml @@ -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