diff --git a/Assets/Scripts/Generation/DungeonGenerator.cs b/Assets/Scripts/Generation/DungeonGenerator.cs index 17eac4d..f68769e 100644 --- a/Assets/Scripts/Generation/DungeonGenerator.cs +++ b/Assets/Scripts/Generation/DungeonGenerator.cs @@ -402,7 +402,6 @@ public class DungeonGenerator { } public void GenerateInterior(GenRoom r) { - Vector2Int root = new Vector2Int (1, 1); for (int x = r.bounds.x; x < r.bounds.x + r.bounds.width; x++) @@ -413,10 +412,6 @@ public class DungeonGenerator { if (!r.tiles.ContainsKey(pos) || r.tiles[pos].type != Room.TileType.GROUND) continue; float prob = 0.0075f; - if (UnityEngine.Random.value > 1 - prob) - { - r.tiles[pos].type = Room.TileType.ROCK; - } if (UnityEngine.Random.value > 1 - prob * 2) { int count = (int ) (UnityEngine.Random.value * UnityEngine.Random.value * 6); @@ -427,7 +422,18 @@ public class DungeonGenerator { if (r.tiles.ContainsKey(pos2) && r.tiles[pos2].type == Room.TileType.GROUND) r.tiles[pos2].type = Room.TileType.ROCK; } + continue; + } + if (UnityEngine.Random.value > 1 - prob) + { + r.tiles[pos].type = Room.TileType.ROCK; + continue; } + float prob2 = 0.02f; + if (UnityEngine.Random.value > 1 - prob2) + { + r.spawnpoints.Add(pos); + } } } } diff --git a/Assets/Scripts/Generation/GenRoom.cs b/Assets/Scripts/Generation/GenRoom.cs index 810bac4..ada813e 100644 --- a/Assets/Scripts/Generation/GenRoom.cs +++ b/Assets/Scripts/Generation/GenRoom.cs @@ -18,6 +18,7 @@ public class GenRoom { public Vector2Int roomPosition; // All positions are in room space relative to the room's anchor public Dictionary tiles = new Dictionary(); + public HashSet spawnpoints = new HashSet(); public float Distance(GenRoom r) { return Math.Abs(GetCenter().x - r.GetCenter().x) + Math.Abs(GetCenter().y - r.GetCenter().y);