v0.9.1: improved and moved around pillars, hallway, and statues rooms

This commit is contained in:
Evan Debenham 2020-10-26 21:28:02 -04:00
parent 3f5359146e
commit 4442997ef1
4 changed files with 24 additions and 12 deletions

View File

@ -36,6 +36,16 @@ public class HallwayRoom extends StandardRoom {
joinable = false;
}
@Override
public int minWidth() {
return Math.max(5, super.minWidth());
}
@Override
public int minHeight() {
return Math.max(5, super.minHeight());
}
//FIXME lots of copy-pasta from tunnel rooms here
@Override
public void paint(Level level) {
@ -90,13 +100,8 @@ 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);
}
Painter.fill( level, c.left, c.top, 3, 3, Terrain.EMPTY_SP );
Painter.fill( level, c.left+1, c.top+1, 1, 1, Terrain.STATUE_SP );
for (Door door : connected.values()) {
door.set( Door.Type.REGULAR );
@ -106,9 +111,12 @@ public class HallwayRoom extends StandardRoom {
//returns the space which all doors must connect to (usually 1 cell, but can be more)
//Note that, like rooms, this space is inclusive to its right and bottom sides
protected Rect getConnectionSpace(){
Point c = connected.size() <= 1 ? center() : getDoorCenter();
Point c = center();
return new Rect(c.x, c.y, c.x, c.y);
c.x = (int) GameMath.gate(left + 2, c.x, right - 2);
c.y = (int) GameMath.gate(top + 2, c.y, bottom - 2);
return new Rect(c.x-1, c.y-1, c.x+1, c.y+1);
}
//returns a point equidistant from all doors this room has

View File

@ -55,7 +55,7 @@ public class PillarsRoom extends StandardRoom {
int minDim = Math.min(width(), height());
//2 pillars
if (minDim == 7 || Random.Int(2) == 0){
if (minDim == 7 || (minDim <= 10 && Random.Int(2) == 0)){
int pillarInset = minDim >= 11 ? 2 : 1;
int pillarSize = ((minDim-3)/2) - pillarInset;

View File

@ -113,13 +113,13 @@ public abstract class StandardRoom extends Room {
rooms.add(CircleBasinRoom.class);
rooms.add(SegmentedRoom.class);
rooms.add(StatuesRoom.class);
rooms.add(PillarsRoom.class);
rooms.add(CaveRoom.class);
rooms.add(CirclePitRoom.class);
rooms.add(HallwayRoom.class);
rooms.add(PillarsRoom.class);
rooms.add(StatuesRoom.class);
rooms.add(SegmentedLibraryRoom.class);
rooms.add(RuinsRoom.class);

View File

@ -72,6 +72,10 @@ public class StatuesRoom extends StandardRoom {
Painter.set(level, left + w-1, top, Terrain.STATUE_SP);
Painter.set(level, left, top + h-1, Terrain.STATUE_SP);
Painter.set(level, left + w-1, top + h-1, Terrain.STATUE_SP);
if (w >= 5 && h >= 5){
Painter.fill(level, left+2, top+2, w-4, h-4, Terrain.STATUE_SP);
}
}
}