Demiplan polishing 2 (#528)
* wizden PR copy * starter rooms * grass geode location, new modifiers
This commit is contained in:
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user