From 8e7ff2c66b1b77ecb15ab40c57ea6e957a5e5265 Mon Sep 17 00:00:00 2001 From: Fansana Date: Mon, 30 Dec 2024 19:41:53 +0100 Subject: [PATCH 1/5] update engine to v228.0.0 --- RobustToolbox | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RobustToolbox b/RobustToolbox index a9aea7027f1..fc1cca4f48f 160000 --- a/RobustToolbox +++ b/RobustToolbox @@ -1 +1 @@ -Subproject commit a9aea7027f1840c83bcaf1c973caf099745f9eed +Subproject commit fc1cca4f48f2f2d3fbf41aa42b80b4e43b1095a4 From 8907a38f33da9bcfa539ebe6b480df273da67ceb Mon Sep 17 00:00:00 2001 From: Fansana Date: Tue, 31 Dec 2024 15:17:08 +0100 Subject: [PATCH 2/5] fix TheDarkSystem --- .../FloofStation/HideoutGeneratorComponent.cs | 17 ++++++++++++++ Content.Server/FloofStation/TheDarkSystem.cs | 23 +++++++++++++++---- .../Prototypes/Entities/Stations/base.yml | 7 ++++++ .../Entities/Stations/nanotrasen.yml | 1 + 4 files changed, 44 insertions(+), 4 deletions(-) create mode 100644 Content.Server/FloofStation/HideoutGeneratorComponent.cs diff --git a/Content.Server/FloofStation/HideoutGeneratorComponent.cs b/Content.Server/FloofStation/HideoutGeneratorComponent.cs new file mode 100644 index 00000000000..5ae7643a382 --- /dev/null +++ b/Content.Server/FloofStation/HideoutGeneratorComponent.cs @@ -0,0 +1,17 @@ +using Robust.Shared.Map; + + +namespace Content.Server.FloofStation; + + +[RegisterComponent] +public sealed partial class HideoutGeneratorComponent : Component +{ + + /// + /// Maps we've generated. + /// + [DataField] + public List Generated = new(); + +} diff --git a/Content.Server/FloofStation/TheDarkSystem.cs b/Content.Server/FloofStation/TheDarkSystem.cs index 8ba2e69d05f..d742000b59f 100644 --- a/Content.Server/FloofStation/TheDarkSystem.cs +++ b/Content.Server/FloofStation/TheDarkSystem.cs @@ -14,12 +14,13 @@ public sealed class TheDarkSystem : EntitySystem public override void Initialize() { base.Initialize(); - - SubscribeLocalEvent(SetupTheDark); + SubscribeLocalEvent(SetupTheDark); + SubscribeLocalEvent(DestroyTheDark); } - private void SetupTheDark(RoundStartingEvent ev) + private void SetupTheDark(EntityUid uid, HideoutGeneratorComponent component, MapInitEvent args) { + Logger.Debug(uid.ToString()); var mapId = _mapManager.CreateMap(); _mapManager.AddUninitializedMap(mapId); @@ -30,7 +31,21 @@ private void SetupTheDark(RoundStartingEvent ev) { EnsureComp(id); } - + component.Generated.Add(mapId); _mapManager.DoMapInitialize(mapId); } + + private void DestroyTheDark(EntityUid uid, HideoutGeneratorComponent component, ComponentShutdown args) + { + + foreach (var mapId in component.Generated) + { + if (!_mapManager.MapExists(mapId)) + continue; + + _mapManager.DeleteMap(mapId); + } + + + } } diff --git a/Resources/Prototypes/Entities/Stations/base.yml b/Resources/Prototypes/Entities/Stations/base.yml index 66ea8dadea6..8f89b1feb3f 100644 --- a/Resources/Prototypes/Entities/Stations/base.yml +++ b/Resources/Prototypes/Entities/Stations/base.yml @@ -180,3 +180,10 @@ abstract: true components: - type: StationEventEligible # For when someone makes this more granular in the future. + +# Floof +- type: entity + id: BaseStationTheDark + abstract: true + components: + - type: HideoutGenerator diff --git a/Resources/Prototypes/Entities/Stations/nanotrasen.yml b/Resources/Prototypes/Entities/Stations/nanotrasen.yml index 329542a267a..1357b32bfe2 100644 --- a/Resources/Prototypes/Entities/Stations/nanotrasen.yml +++ b/Resources/Prototypes/Entities/Stations/nanotrasen.yml @@ -27,6 +27,7 @@ - BaseStationNanotrasen - BaseRandomStation - BaseStationMail # Nyano component, required for station mail to function + - BaseStationTheDark # Floof noSpawn: true components: - type: Transform From 0d9e685188936aa05a51378b39acc2459e45012e Mon Sep 17 00:00:00 2001 From: Fansana Date: Tue, 31 Dec 2024 16:08:59 +0100 Subject: [PATCH 3/5] update engine to v228.0.2 --- RobustToolbox | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RobustToolbox b/RobustToolbox index fc1cca4f48f..950ceb235a8 160000 --- a/RobustToolbox +++ b/RobustToolbox @@ -1 +1 @@ -Subproject commit fc1cca4f48f2f2d3fbf41aa42b80b4e43b1095a4 +Subproject commit 950ceb235a8f93c218e8f71ebfdad56a1cf07e3e From 54b8c132835b5f41f21db74e048eeb3184413e0a Mon Sep 17 00:00:00 2001 From: Fansana Date: Tue, 31 Dec 2024 17:52:59 +0100 Subject: [PATCH 4/5] replace SpawnEntity --- .../Tests/Interaction/InteractionTest.Helpers.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Content.IntegrationTests/Tests/Interaction/InteractionTest.Helpers.cs b/Content.IntegrationTests/Tests/Interaction/InteractionTest.Helpers.cs index 19ca83a9715..39f3cdf251b 100644 --- a/Content.IntegrationTests/Tests/Interaction/InteractionTest.Helpers.cs +++ b/Content.IntegrationTests/Tests/Interaction/InteractionTest.Helpers.cs @@ -88,7 +88,7 @@ protected async Task SpawnTarget(string prototype) Target = NetEntity.Invalid; await Server.WaitPost(() => { - Target = SEntMan.GetNetEntity(SEntMan.SpawnEntity(prototype, SEntMan.GetCoordinates(TargetCoords))); + Target = SEntMan.GetNetEntity(SEntMan.SpawnAtPosition(prototype, SEntMan.GetCoordinates(TargetCoords))); }); await RunTicks(5); From 758007b272c1a24c0be29cad711d7f75f7efb636 Mon Sep 17 00:00:00 2001 From: Fansana Date: Tue, 31 Dec 2024 20:26:51 +0100 Subject: [PATCH 5/5] fix SpawnEntity --- .../Tests/Interaction/InteractionTest.EntitySpecifier.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Content.IntegrationTests/Tests/Interaction/InteractionTest.EntitySpecifier.cs b/Content.IntegrationTests/Tests/Interaction/InteractionTest.EntitySpecifier.cs index 37dca721373..d2511fc5d81 100644 --- a/Content.IntegrationTests/Tests/Interaction/InteractionTest.EntitySpecifier.cs +++ b/Content.IntegrationTests/Tests/Interaction/InteractionTest.EntitySpecifier.cs @@ -92,7 +92,7 @@ protected async Task SpawnEntity(EntitySpecifier spec, EntityCoordina { await Server.WaitPost(() => { - uid = SEntMan.SpawnEntity(stackProto.Spawn, coords); + uid = SEntMan.SpawnAtPosition(stackProto.Spawn, coords); Stack.SetCount(uid, spec.Quantity); }); return uid; @@ -114,13 +114,13 @@ await Server.WaitPost(() => return await SpawnEntity((stack.StackTypeId, spec.Quantity), coords); Assert.That(spec.Quantity, Is.EqualTo(1), "SpawnEntity only supports returning a singular entity"); - await Server.WaitPost(() => uid = SEntMan.SpawnEntity(spec.Prototype, coords)); + await Server.WaitPost(() => uid = SEntMan.SpawnAtPosition(spec.Prototype, coords)); return uid; } /// /// Convert an entity-uid to a matching entity specifier. Useful when doing entity lookups & checking that the - /// right quantity of entities/materials werre produced. Returns null if passed an entity with a null prototype. + /// right quantity of entities/materials were produced. Returns null if passed an entity with a null prototype. /// protected EntitySpecifier? ToEntitySpecifier(EntityUid uid) {