v2.4.0: adjusted bridge rooms to not place items/chars in gaps

This commit is contained in:
Evan Debenham
2024-04-22 15:56:40 -04:00
parent da5cb1ceb5
commit 28628a31be
2 changed files with 20 additions and 0 deletions
@@ -51,6 +51,16 @@ public abstract class BridgeRoom extends StandardRoom {
return l.map[cell] != spaceTile(); return l.map[cell] != spaceTile();
} }
@Override
public boolean canPlaceItem(Point p, Level l) {
return super.canPlaceItem(p, l) && !spaceRect.inside(p);
}
@Override
public boolean canPlaceCharacter(Point p, Level l) {
return super.canPlaceItem(p, l) && !spaceRect.inside(p);
}
//keep these so that subclasses can use them in their methods //keep these so that subclasses can use them in their methods
protected Rect spaceRect; protected Rect spaceRect;
protected Rect bridgeRect; protected Rect bridgeRect;
@@ -59,6 +59,16 @@ public class CavesFissureRoom extends StandardRoom {
} }
} }
@Override
public boolean canPlaceItem(Point p, Level l) {
return super.canPlaceItem(p, l) && l.map[l.pointToCell(p)] != Terrain.EMPTY_SP;
}
@Override
public boolean canPlaceCharacter(Point p, Level l) {
return super.canPlaceItem(p, l) && l.map[l.pointToCell(p)] != Terrain.EMPTY_SP;
}
@Override @Override
public void paint(Level level) { public void paint(Level level) {