From b30afb357c51142fc5cc51b23a6a54fb8ef1c0d1 Mon Sep 17 00:00:00 2001 From: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Date: Wed, 10 Jan 2024 22:15:48 +1100 Subject: [PATCH] Hide ruins spawns (#23857) * Hide ruins spawns * Update count * Add naming --- .../Shuttles/Components/GridSpawnComponent.cs | 10 ++++++++++ .../Shuttles/Systems/ShuttleSystem.GridFill.cs | 14 ++++++++++++++ Resources/Prototypes/Entities/Stations/base.yml | 10 +++++++++- 3 files changed, 33 insertions(+), 1 deletion(-) diff --git a/Content.Server/Shuttles/Components/GridSpawnComponent.cs b/Content.Server/Shuttles/Components/GridSpawnComponent.cs index 7e6e308fd3..86874541df 100644 --- a/Content.Server/Shuttles/Components/GridSpawnComponent.cs +++ b/Content.Server/Shuttles/Components/GridSpawnComponent.cs @@ -23,6 +23,16 @@ public record struct GridSpawnGroup public int MinCount = 1; public int MaxCount = 1; + /// + /// Hide the IFF of the grid. + /// + public bool Hide = false; + + /// + /// Should we set the metadata name of a grid. Useful for admin purposes. + /// + public bool NameGrid = false; + public GridSpawnGroup() { } diff --git a/Content.Server/Shuttles/Systems/ShuttleSystem.GridFill.cs b/Content.Server/Shuttles/Systems/ShuttleSystem.GridFill.cs index 678a557668..5452a0bb9d 100644 --- a/Content.Server/Shuttles/Systems/ShuttleSystem.GridFill.cs +++ b/Content.Server/Shuttles/Systems/ShuttleSystem.GridFill.cs @@ -3,6 +3,7 @@ using Content.Server.Station.Components; using Content.Server.Station.Events; using Content.Shared.Cargo.Components; using Content.Shared.CCVar; +using Content.Shared.Shuttles.Components; using Robust.Shared.Random; using Robust.Shared.Utility; @@ -87,6 +88,13 @@ public sealed partial class ShuttleSystem if (_loader.TryLoad(mapId, path.ToString(), out var ent) && ent.Count == 1) { + if (group.Hide) + { + var iffComp = EnsureComp(ent[0]); + iffComp.Flags |= IFFFlags.Hide; + Dirty(ent[0], iffComp); + } + if (TryComp(ent[0], out var shuttle)) { TryFTLProximity(ent[0], shuttle, targetGrid.Value); @@ -96,6 +104,12 @@ public sealed partial class ShuttleSystem { valid = false; } + + if (group.NameGrid) + { + var name = path.FilenameWithoutExtension; + _metadata.SetEntityName(ent[0], name); + } } else { diff --git a/Resources/Prototypes/Entities/Stations/base.yml b/Resources/Prototypes/Entities/Stations/base.yml index 049fd78d4b..4871ae50f1 100644 --- a/Resources/Prototypes/Entities/Stations/base.yml +++ b/Resources/Prototypes/Entities/Stations/base.yml @@ -52,6 +52,10 @@ paths: - /Maps/Shuttles/mining.yml ruins: + hide: true + nameGrid: true + minCount: 2 + maxCount: 2 paths: - /Maps/Ruins/derelict.yml - /Maps/Ruins/djstation.yml @@ -59,7 +63,7 @@ - /Maps/Ruins/relaystation.yml - /Maps/Ruins/whiteship_ancient.yml - /Maps/Ruins/whiteship_bluespacejumper.yml - + - type: entity @@ -75,6 +79,10 @@ paths: - /Maps/Shuttles/mining.yml ruins: + hide: true + nameGrid: true + minCount: 2 + maxCount: 2 paths: - /Maps/Ruins/derelict.yml - /Maps/Ruins/djstation.yml