From 889116a9539499ecec555d4fe6736df9c57e8174 Mon Sep 17 00:00:00 2001 From: Ed Date: Sat, 2 Nov 2024 14:14:49 +0300 Subject: [PATCH] required exits and enters! --- .../Jobs/CP14SpawnRandomDemiplaneJob.cs | 14 +++++-- .../Demiplane/Locations/t1_caves.yml | 19 +-------- .../Demiplane/Locations/t1_grass_geode.yml | 17 +------- .../Locations/t1_grassland_island.yml | 18 +-------- .../Procedural/Demiplane/Modifiers/test.yml | 39 ++++++++++--------- .../Procedural/Demiplane/required_layers.yml | 15 +++++++ 6 files changed, 53 insertions(+), 69 deletions(-) create mode 100644 Resources/Prototypes/_CP14/Procedural/Demiplane/required_layers.yml diff --git a/Content.Server/_CP14/Demiplane/Jobs/CP14SpawnRandomDemiplaneJob.cs b/Content.Server/_CP14/Demiplane/Jobs/CP14SpawnRandomDemiplaneJob.cs index 6200b669c7..a8438d2c23 100644 --- a/Content.Server/_CP14/Demiplane/Jobs/CP14SpawnRandomDemiplaneJob.cs +++ b/Content.Server/_CP14/Demiplane/Jobs/CP14SpawnRandomDemiplaneJob.cs @@ -5,6 +5,8 @@ using Content.Server.Procedural; using Content.Shared._CP14.Demiplane.Prototypes; using Content.Shared.Atmos; using Content.Shared.Gravity; +using Content.Shared.Procedural; +using Content.Shared.Procedural.DungeonGenerators; using Robust.Shared.CPUJob.JobQueues; using Robust.Shared.Map; using Robust.Shared.Prototypes; @@ -90,11 +92,14 @@ public sealed class CP14SpawnRandomDemiplaneJob : Job _entManager.AddComponents(DemiplaneMapUid, indexedModifier.Components); } - _mapManager.DoMapInitialize(_demiplaneMapId); - _mapManager.SetMapPaused(_demiplaneMapId, false); + //Enter and exits + if (_prototypeManager.TryIndex("DemiplaneConnections", out var indexedConnections)) + { + indexedLocation.Layers.AddRange(indexedConnections.Layers); + } //Spawn modified config - await _dungeon.GenerateDungeonAsync(indexedLocation, + _dungeon.GenerateDungeon(indexedLocation, grid, grid, Vector2i.Zero, @@ -112,6 +117,9 @@ public sealed class CP14SpawnRandomDemiplaneJob : Job var mixture = new GasMixture(moles, Atmospherics.T20C); _entManager.System().SetMapAtmosphere(DemiplaneMapUid, false, mixture); + _mapManager.DoMapInitialize(_demiplaneMapId); + _mapManager.SetMapPaused(_demiplaneMapId, false); + return true; } } diff --git a/Resources/Prototypes/_CP14/Procedural/Demiplane/Locations/t1_caves.yml b/Resources/Prototypes/_CP14/Procedural/Demiplane/Locations/t1_caves.yml index 2dc59e68bf..1b7daa7868 100644 --- a/Resources/Prototypes/_CP14/Procedural/Demiplane/Locations/t1_caves.yml +++ b/Resources/Prototypes/_CP14/Procedural/Demiplane/Locations/t1_caves.yml @@ -12,23 +12,14 @@ - type: dungeonConfig id: CP14ExpeditionCaves layers: - # Masks (from center to border!) + # Masks - !type:PrototypeDunGen proto: CP14ExpeditionCavesFloorMaskBorder - !type:PrototypeDunGen proto: CP14ExpeditionCavesFloorMaskStone - !type:PrototypeDunGen proto: CP14ExpeditionCavesFloorMaskAir - # Exterior rooms - # Enter and Exit - - !type:MobsDunGen - minCount: 1 - maxCount: 1 - groups: - - id: CP14DemiplanEnterRoomMarker - amount: 1 - #here - # Biome Spawner fills (from border to center!) order is very important! For inexplicable reasons, only a certain sequence works! + # Biomes - !type:PrototypeDunGen proto: CP14ExpeditionCavesFillBorder - !type:BiomeDunGen @@ -39,12 +30,6 @@ biomeTemplate: CP14CavesFloor tileMask: - CP14FloorGrass - - !type:MobsDunGen - minCount: 2 - maxCount: 2 - groups: - - id: CP14DemiplanePassway - amount: 1 - type: dungeonConfig id: CP14ExpeditionCavesFloorMaskAir diff --git a/Resources/Prototypes/_CP14/Procedural/Demiplane/Locations/t1_grass_geode.yml b/Resources/Prototypes/_CP14/Procedural/Demiplane/Locations/t1_grass_geode.yml index e54f3e92a8..1d60442742 100644 --- a/Resources/Prototypes/_CP14/Procedural/Demiplane/Locations/t1_grass_geode.yml +++ b/Resources/Prototypes/_CP14/Procedural/Demiplane/Locations/t1_grass_geode.yml @@ -15,7 +15,7 @@ - type: dungeonConfig id: CP14DemiplaneGrassGeode layers: - # Masks (from center to border!) + # Masks - !type:PrototypeDunGen proto: CP14DemiplaneGrassGeodeFloorMaskBorder - !type:PrototypeDunGen @@ -24,14 +24,7 @@ proto: CP14DemiplaneGrassGeodeFloorMaskAir - !type:PrototypeDunGen proto: CP14DemiplaneGrassGeodeFloorMaskWater - # Enter and Exit - - !type:MobsDunGen - minCount: 1 - maxCount: 1 - groups: - - id: CP14DemiplanEnterRoomMarker - amount: 1 - # Biome Spawner fills (from border to center!) order is very important! For inexplicable reasons, only a certain sequence works! + # Biomes - !type:PrototypeDunGen proto: CP14ExpeditionCavesFillBorder - !type:BiomeDunGen @@ -44,12 +37,6 @@ - CP14FloorSand - !type:PrototypeDunGen proto: CP14DemiplaneGrassGeodeFillWater - - !type:MobsDunGen - minCount: 2 - maxCount: 2 - groups: - - id: CP14DemiplanePassway - amount: 1 - type: dungeonConfig id: CP14DemiplaneGrassGeodeFloorMaskWater diff --git a/Resources/Prototypes/_CP14/Procedural/Demiplane/Locations/t1_grassland_island.yml b/Resources/Prototypes/_CP14/Procedural/Demiplane/Locations/t1_grassland_island.yml index 24ee80acf9..531f9b0d2e 100644 --- a/Resources/Prototypes/_CP14/Procedural/Demiplane/Locations/t1_grassland_island.yml +++ b/Resources/Prototypes/_CP14/Procedural/Demiplane/Locations/t1_grassland_island.yml @@ -43,22 +43,14 @@ - type: dungeonConfig id: CP14ExpeditionGrasslandIsland layers: - # Masks (from center to border!) + # Masks - !type:PrototypeDunGen proto: CP14ExpeditionGrasslandIslandFloorMaskSand - !type:PrototypeDunGen proto: CP14ExpeditionGrasslandIslandFloorMaskGrass - !type:PrototypeDunGen proto: CP14ExpeditionGrasslandIslandFloorMaskStone - # Exterior rooms - # Enter and Exit - - !type:MobsDunGen - minCount: 1 - maxCount: 1 - groups: - - id: CP14DemiplanEnterRoomMarker - amount: 1 - # Biome Spawner fills (from border to center!) order is very important! For inexplicable reasons, only a certain sequence works! + # Biomes - !type:BiomeDunGen biomeTemplate: CP14GrasslandTestResult tileMask: @@ -67,12 +59,6 @@ biomeTemplate: CP14CavesGeneric tileMask: - CP14FloorBase - - !type:MobsDunGen - minCount: 2 - maxCount: 2 - groups: - - id: CP14DemiplanePassway - amount: 1 - type: dungeonConfig id: CP14ExpeditionGrasslandIslandFloorMaskStone diff --git a/Resources/Prototypes/_CP14/Procedural/Demiplane/Modifiers/test.yml b/Resources/Prototypes/_CP14/Procedural/Demiplane/Modifiers/test.yml index 986f814cc1..0bf2611246 100644 --- a/Resources/Prototypes/_CP14/Procedural/Demiplane/Modifiers/test.yml +++ b/Resources/Prototypes/_CP14/Procedural/Demiplane/Modifiers/test.yml @@ -270,24 +270,25 @@ requiredTags: - CP14DemiplanUnderground layers: - - !type:EntityTableDunGen + - !type:MobsDunGen minCount: 5 - maxCount: 10 - table: !type:GroupSelector - children: - - id: CP14MobXenoDrone - - id: CP14MobXeno + maxCount: 8 + groups: + - id: CP14MobXenoDrone + amount: 1 + - id: CP14MobXeno + amount: 1 - type: cp14DemiplaneModifier id: EnemyZombie difficulty: 0.4 layers: - - !type:EntityTableDunGen - minCount: 5 - maxCount: 10 - table: !type:GroupSelector - children: - - id: CP14SpawnMobUndeadZombie + - !type:MobsDunGen + minCount: 3 + maxCount: 6 + groups: + - id: CP14SpawnMobUndeadZombie + amount: 1 - type: cp14DemiplaneModifier id: EnemyDyno @@ -306,14 +307,16 @@ id: EnemySnakes difficulty: 0.7 layers: - - !type:EntityTableDunGen + - !type:MobsDunGen minCount: 3 maxCount: 6 - table: !type:GroupSelector - children: - - id: CP14MobPurpleSnake - - id: CP14MobSmallPurpleSnake - - id: CP14MobSpaceCobra + groups: + - id: CP14MobPurpleSnake + amount: 1 + - id: CP14MobSmallPurpleSnake + amount: 1 + - id: CP14MobSpaceCobra + amount: 1 - type: cp14DemiplaneModifier id: EnemyMagmawind diff --git a/Resources/Prototypes/_CP14/Procedural/Demiplane/required_layers.yml b/Resources/Prototypes/_CP14/Procedural/Demiplane/required_layers.yml new file mode 100644 index 0000000000..0f39196c65 --- /dev/null +++ b/Resources/Prototypes/_CP14/Procedural/Demiplane/required_layers.yml @@ -0,0 +1,15 @@ +- type: dungeonConfig + id: DemiplaneConnections + layers: + - !type:EntityTableDunGen + minCount: 1 + maxCount: 1 + table: !type:GroupSelector + children: + - id: CP14DemiplanEnterRoomMarker + - !type:EntityTableDunGen + minCount: 2 + maxCount: 2 + table: !type:GroupSelector + children: + - id: CP14DemiplanePassway \ No newline at end of file