required exits and enters!

This commit is contained in:
Ed
2024-11-02 14:14:49 +03:00
parent 5af6624e62
commit 889116a953
6 changed files with 53 additions and 69 deletions

View File

@@ -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<bool>
_entManager.AddComponents(DemiplaneMapUid, indexedModifier.Components);
}
_mapManager.DoMapInitialize(_demiplaneMapId);
_mapManager.SetMapPaused(_demiplaneMapId, false);
//Enter and exits
if (_prototypeManager.TryIndex<DungeonConfigPrototype>("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<bool>
var mixture = new GasMixture(moles, Atmospherics.T20C);
_entManager.System<AtmosphereSystem>().SetMapAtmosphere(DemiplaneMapUid, false, mixture);
_mapManager.DoMapInitialize(_demiplaneMapId);
_mapManager.SetMapPaused(_demiplaneMapId, false);
return true;
}
}

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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