v2.4.0: adjusted bridge rooms to not place items/chars in gaps
This commit is contained in:
+10
@@ -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;
|
||||||
|
|||||||
+10
@@ -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) {
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user