Haunted dungeon template (#23768)

* haunted dungeon

* Initial work

Still needs prefab gen work to make it interesting.

* ime a worm

* weh

* Work

* Slight tweaks

---------

Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
This commit is contained in:
Emisse
2024-03-23 21:37:18 -06:00
committed by GitHub
parent 2cc8db3007
commit 952b7f4c4e
17 changed files with 4009 additions and 67 deletions

View File

@@ -9,15 +9,25 @@ namespace Content.Shared.Procedural.PostGeneration;
/// </summary>
public sealed partial class BoundaryWallPostGen : IPostDunGen
{
[DataField("tile", customTypeSerializer:typeof(PrototypeIdSerializer<ContentTileDefinition>))]
public string Tile = "FloorSteel";
[DataField]
public ProtoId<ContentTileDefinition> Tile = "FloorSteel";
[DataField("wall", customTypeSerializer:typeof(PrototypeIdSerializer<EntityPrototype>))]
public string Wall = "WallSolid";
[DataField]
public EntProtoId Wall = "WallSolid";
/// <summary>
/// Walls to use in corners if applicable.
/// </summary>
[DataField("cornerWall", customTypeSerializer:typeof(PrototypeIdSerializer<EntityPrototype>))]
[DataField]
public string? CornerWall;
[DataField]
public BoundaryWallFlags Flags = BoundaryWallFlags.Corridors | BoundaryWallFlags.Rooms;
}
[Flags]
public enum BoundaryWallFlags : byte
{
Rooms = 1 << 0,
Corridors = 1 << 1,
}

View File

@@ -7,12 +7,12 @@ namespace Content.Shared.Procedural.PostGeneration;
/// </summary>
public sealed partial class CornerClutterPostGen : IPostDunGen
{
[DataField("chance")]
[DataField]
public float Chance = 0.50f;
/// <summary>
/// The default starting bulbs
/// </summary>
[DataField("contents", required: true)]
[DataField(required: true)]
public List<EntitySpawnEntry> Contents = new();
}

View File

@@ -0,0 +1,18 @@
using Content.Shared.Storage;
namespace Content.Shared.Procedural.PostGeneration;
/// <summary>
/// Adds entities randomly to the corridors.
/// </summary>
public sealed partial class CorridorClutterPostGen : IPostDunGen
{
[DataField]
public float Chance = 0.05f;
/// <summary>
/// The default starting bulbs
/// </summary>
[DataField(required: true)]
public List<EntitySpawnEntry> Contents = new();
}

View File

@@ -14,24 +14,15 @@ public sealed partial class CorridorPostGen : IPostDunGen
/// <remarks>
/// Given the heavy weightings this needs to be fairly large for larger dungeons.
/// </remarks>
[DataField("pathLimit")]
[DataField]
public int PathLimit = 2048;
[DataField("method")]
public CorridorPostGenMethod Method = CorridorPostGenMethod.MinimumSpanningTree;
[DataField]
public ProtoId<ContentTileDefinition> Tile = "FloorSteel";
/// <summary>
/// How wide to make the corridor.
/// </summary>
[DataField("width")]
public int Width = 3;
}
public enum CorridorPostGenMethod : byte
{
Invalid,
MinimumSpanningTree,
[DataField]
public float Width = 3f;
}

View File

@@ -0,0 +1,42 @@
using Content.Shared.Maps;
using Content.Shared.Procedural.DungeonGenerators;
using Robust.Shared.Prototypes;
namespace Content.Shared.Procedural.PostGeneration;
// Ime a worm
/// <summary>
/// Generates worm corridors.
/// </summary>
public sealed partial class WormCorridorPostGen : IPostDunGen
{
[DataField]
public int PathLimit = 2048;
/// <summary>
/// How many times to run the worm
/// </summary>
[DataField]
public int Count = 20;
/// <summary>
/// How long to make each worm
/// </summary>
[DataField]
public int Length = 20;
/// <summary>
/// Maximum amount the angle can change in a single step.
/// </summary>
[DataField]
public Angle MaxAngleChange = Angle.FromDegrees(45);
[DataField]
public ProtoId<ContentTileDefinition> Tile = "FloorSteel";
/// <summary>
/// How wide to make the corridor.
/// </summary>
[DataField]
public float Width = 3f;
}