v0.9.1: added a bit of chaos to larger tunnel/hall rooms with many doors

This commit is contained in:
Evan Debenham
2020-10-21 15:23:46 -04:00
parent dd9e25308b
commit 0d9bd47ba6
2 changed files with 16 additions and 0 deletions

View File

@@ -76,6 +76,14 @@ public class TunnelRoom extends ConnectionRoom {
Painter.drawLine( level, mid, end, floor );
}
//fill in an extra diagonal tile at center randomly if we're a larger room with many connections
if (width() >= 7 && height() >= 7 && connected.size() > 4 && c.square() == 0){
Point p = new Point(c.left, c.top);
p.x += Random.Int(2) == 0 ? 1 : -1;
p.y += Random.Int(2) == 0 ? 1 : -1;
Painter.set(level, p, floor);
}
for (Door door : connected.values()) {
door.set( Door.Type.TUNNEL );
}

View File

@@ -90,6 +90,14 @@ public class HallwayRoom extends StandardRoom {
}
//fill in an extra diagonal tile at center randomly if we're a larger room with many connections
if (width() >= 7 && height() >= 7 && connected.size() > 4 && c.square() == 0){
Point p = new Point(c.left, c.top);
p.x += Random.Int(2) == 0 ? 1 : -1;
p.y += Random.Int(2) == 0 ? 1 : -1;
Painter.set(level, p, Terrain.EMPTY_SP);
}
for (Door door : connected.values()) {
door.set( Door.Type.REGULAR );
}