v0.6.3: improved how the game handles chasm floors
This commit is contained in:
parent
608a09a92c
commit
43d0beb36d
|
@ -591,11 +591,15 @@ public abstract class Level implements Bundlable {
|
|||
int lastRow = length() - width();
|
||||
for (int i=0; i < width(); i++) {
|
||||
passable[i] = avoid[i] = false;
|
||||
losBlocking[i] = true;
|
||||
passable[lastRow + i] = avoid[lastRow + i] = false;
|
||||
losBlocking[lastRow + i] = true;
|
||||
}
|
||||
for (int i=width(); i < lastRow; i += width()) {
|
||||
passable[i] = avoid[i] = false;
|
||||
losBlocking[i] = true;
|
||||
passable[i + width()-1] = avoid[i + width()-1] = false;
|
||||
losBlocking[i + width()-1] = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -73,6 +73,9 @@ public abstract class RegularPainter extends Painter {
|
|||
|
||||
//painter can be used without rooms
|
||||
if (rooms != null) {
|
||||
|
||||
int padding = level.feeling == Level.Feeling.CHASM ? 2 : 1;
|
||||
|
||||
int leftMost = Integer.MAX_VALUE, topMost = Integer.MAX_VALUE;
|
||||
|
||||
for (Room r : rooms) {
|
||||
|
@ -80,9 +83,8 @@ public abstract class RegularPainter extends Painter {
|
|||
if (r.top < topMost) topMost = r.top;
|
||||
}
|
||||
|
||||
//subtract 1 for padding
|
||||
leftMost--;
|
||||
topMost--;
|
||||
leftMost -= padding;
|
||||
topMost -= padding;
|
||||
|
||||
int rightMost = 0, bottomMost = 0;
|
||||
|
||||
|
@ -92,9 +94,8 @@ public abstract class RegularPainter extends Painter {
|
|||
if (r.bottom > bottomMost) bottomMost = r.bottom;
|
||||
}
|
||||
|
||||
//add 1 for padding
|
||||
rightMost++;
|
||||
bottomMost++;
|
||||
rightMost += padding;
|
||||
bottomMost += padding;
|
||||
|
||||
//add 1 to account for 0 values
|
||||
level.setSize(rightMost + 1, bottomMost + 1);
|
||||
|
|
Loading…
Reference in New Issue
Block a user