Demiplan polishing 2 (#528)

* wizden PR copy

* starter rooms

* grass geode location, new modifiers
This commit is contained in:
Ed
2024-11-02 00:59:55 +03:00
committed by GitHub
parent 3b520ac69c
commit 2b9d949eea
17 changed files with 2300 additions and 939 deletions

View File

@@ -19,7 +19,7 @@ public sealed partial class DungeonSystem
/// <summary>
/// Gets a random dungeon room matching the specified area and whitelist.
/// </summary>
public DungeonRoomPrototype? GetRoomPrototype(Vector2i size, Random random, EntityWhitelist? whitelist = null)
public DungeonRoomPrototype? GetRoomPrototype(Random random, EntityWhitelist? whitelist = null, Vector2i? size = null)
{
// Can never be true.
if (whitelist is { Tags: null })
@@ -31,7 +31,7 @@ public sealed partial class DungeonSystem
foreach (var proto in _prototype.EnumeratePrototypes<DungeonRoomPrototype>())
{
if (proto.Size != size)
if (size is not null && proto.Size != size)
continue;
if (whitelist == null)
@@ -156,6 +156,12 @@ public sealed partial class DungeonSystem
if (!clearExisting && reservedTiles?.Contains(rounded) == true)
continue;
if (room.IgnoreTile is not null)
{
if (_maps.TryGetTileDef(templateGrid, indices, out var tileDef) && room.IgnoreTile == tileDef.ID)
continue;
}
_tiles.Add((rounded, tileRef.Tile));
}
}