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:
@@ -15,6 +15,8 @@ public sealed class Dungeon
|
||||
|
||||
public readonly HashSet<Vector2i> CorridorExteriorTiles = new();
|
||||
|
||||
public readonly HashSet<Vector2i> Entrances = new();
|
||||
|
||||
public Dungeon()
|
||||
{
|
||||
Rooms = new List<DungeonRoom>();
|
||||
@@ -23,5 +25,10 @@ public sealed class Dungeon
|
||||
public Dungeon(List<DungeonRoom> rooms)
|
||||
{
|
||||
Rooms = rooms;
|
||||
|
||||
foreach (var room in Rooms)
|
||||
{
|
||||
Entrances.UnionWith(room.Entrances);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ namespace Content.Shared.Procedural;
|
||||
|
||||
public sealed record DungeonRoom(HashSet<Vector2i> Tiles, Vector2 Center, Box2i Bounds, HashSet<Vector2i> Exterior)
|
||||
{
|
||||
public List<Vector2i> Entrances = new();
|
||||
public readonly List<Vector2i> Entrances = new();
|
||||
|
||||
/// <summary>
|
||||
/// Nodes adjacent to tiles, including the corners.
|
||||
|
||||
@@ -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,
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user