v0.6.2: adjusted weak floor room logic to prevent well visual clipping

This commit is contained in:
Evan Debenham 2017-09-12 00:22:35 -04:00
parent 50566234c7
commit f67a2e561f

View File

@ -41,34 +41,30 @@ public class WeakFloorRoom extends SpecialRoom {
Door door = entrance(); Door door = entrance();
door.set( Door.Type.REGULAR ); door.set( Door.Type.REGULAR );
if (door.x == left) {
for (int i=top + 1; i < bottom; i++) {
Painter.drawInside( level, this, new Point( left, i ), Random.IntRange( 1, width() - 3 ), Terrain.EMPTY_SP );
}
} else if (door.x == right) {
for (int i=top + 1; i < bottom; i++) {
Painter.drawInside( level, this, new Point( right, i ), Random.IntRange( 1, width() - 3 ), Terrain.EMPTY_SP );
}
} else if (door.y == top) {
for (int i=left + 1; i < right; i++) {
Painter.drawInside( level, this, new Point( i, top ), Random.IntRange( 1, height() - 3 ), Terrain.EMPTY_SP );
}
} else if (door.y == bottom) {
for (int i=left + 1; i < right; i++) {
Painter.drawInside( level, this, new Point( i, bottom ), Random.IntRange( 1, height() - 3 ), Terrain.EMPTY_SP );
}
}
Point well = null; Point well = null;
if (door.x == left) { if (door.x == left) {
for (int i=top + 1; i < bottom; i++) {
Painter.drawInside( level, this, new Point( left, i ), Random.IntRange( 1, width() - 4 ), Terrain.EMPTY_SP );
}
well = new Point( right-1, Random.Int( 2 ) == 0 ? top + 2 : bottom - 1 ); well = new Point( right-1, Random.Int( 2 ) == 0 ? top + 2 : bottom - 1 );
} else if (door.x == right) { } else if (door.x == right) {
for (int i=top + 1; i < bottom; i++) {
Painter.drawInside( level, this, new Point( right, i ), Random.IntRange( 1, width() - 4 ), Terrain.EMPTY_SP );
}
well = new Point( left+1, Random.Int( 2 ) == 0 ? top + 2 : bottom - 1 ); well = new Point( left+1, Random.Int( 2 ) == 0 ? top + 2 : bottom - 1 );
} else if (door.y == top) { } else if (door.y == top) {
for (int i=left + 1; i < right; i++) {
Painter.drawInside( level, this, new Point( i, top ), Random.IntRange( 1, height() - 4 ), Terrain.EMPTY_SP );
}
well = new Point( Random.Int( 2 ) == 0 ? left + 1 : right - 1, bottom-1 ); well = new Point( Random.Int( 2 ) == 0 ? left + 1 : right - 1, bottom-1 );
} else if (door.y == bottom) { } else if (door.y == bottom) {
for (int i=left + 1; i < right; i++) {
Painter.drawInside( level, this, new Point( i, bottom ), Random.IntRange( 1, height() - 4 ), Terrain.EMPTY_SP );
}
well = new Point( Random.Int( 2 ) == 0 ? left + 1 : right - 1, top+2 ); well = new Point( Random.Int( 2 ) == 0 ? left + 1 : right - 1, top+2 );
} }
Painter.set(level, well, Terrain.CHASM); Painter.set(level, well, Terrain.CHASM);
CustomTiledVisual vis = new HiddenWell(); CustomTiledVisual vis = new HiddenWell();
vis.pos(well.x, well.y); vis.pos(well.x, well.y);