v0.9.1: made merged room logic much more permissive (too much atm!)
This commit is contained in:
parent
1e555ddd7f
commit
81ea918406
|
@ -28,8 +28,8 @@ import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.levels.Patch;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.Room;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.standard.EmptyRoom;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.standard.EntranceRoom;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.standard.StandardRoom;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.traps.Trap;
|
||||
import com.watabou.utils.Graph;
|
||||
import com.watabou.utils.PathFinder;
|
||||
|
@ -232,12 +232,13 @@ public abstract class RegularPainter extends Painter {
|
|||
}
|
||||
|
||||
protected boolean joinRooms( Level l, Room r, Room n ) {
|
||||
|
||||
if (!(r instanceof EmptyRoom && n instanceof EmptyRoom)) {
|
||||
|
||||
//FIXME currently this joins rooms a bit too often! Need to think up some limitations
|
||||
if (!(r instanceof StandardRoom) || !((StandardRoom) r).joinable
|
||||
|| !(n instanceof StandardRoom) || !((StandardRoom) n).joinable) {
|
||||
return false;
|
||||
}
|
||||
|
||||
//TODO decide on good probabilities and dimension restrictions
|
||||
Rect w = r.intersect( n );
|
||||
if (w.left == w.right) {
|
||||
|
||||
|
@ -245,17 +246,7 @@ public abstract class RegularPainter extends Painter {
|
|||
return false;
|
||||
}
|
||||
|
||||
if (w.height()+1 == Math.max( r.height(), n.height() )) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (r.width() + n.width() > 10) {
|
||||
return false;
|
||||
}
|
||||
|
||||
w.top += 1;
|
||||
w.bottom -= 0;
|
||||
|
||||
w.top++;
|
||||
w.right++;
|
||||
|
||||
Painter.fill( l, w.left, w.top, 1, w.height(), Terrain.EMPTY );
|
||||
|
@ -266,17 +257,7 @@ public abstract class RegularPainter extends Painter {
|
|||
return false;
|
||||
}
|
||||
|
||||
if (w.width()+1 == Math.max( r.width(), n.width() )) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (r.height() + n.height() > 10) {
|
||||
return false;
|
||||
}
|
||||
|
||||
w.left += 1;
|
||||
w.right -= 0;
|
||||
|
||||
w.left++;
|
||||
w.bottom++;
|
||||
|
||||
Painter.fill( l, w.left, w.top, w.width(), 1, Terrain.EMPTY );
|
||||
|
|
|
@ -31,6 +31,10 @@ import com.watabou.utils.Point;
|
|||
import com.watabou.utils.Random;
|
||||
|
||||
public class BlacksmithRoom extends StandardRoom {
|
||||
|
||||
{
|
||||
joinable = false; //TODO maybe joinable? Could be neat in terms of layout
|
||||
}
|
||||
|
||||
@Override
|
||||
public int minWidth() {
|
||||
|
|
|
@ -26,7 +26,11 @@ import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter;
|
||||
|
||||
public class CaveRoom extends PatchRoom {
|
||||
|
||||
|
||||
{
|
||||
joinable = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float[] sizeCatProbs() {
|
||||
return new float[]{9, 3, 1};
|
||||
|
|
|
@ -27,6 +27,10 @@ import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter;
|
|||
|
||||
public class CirclePitRoom extends StandardRoom {
|
||||
|
||||
{
|
||||
joinable = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int minWidth() {
|
||||
return Math.max(8, super.minWidth());
|
||||
|
|
|
@ -25,7 +25,6 @@ import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter;
|
||||
|
||||
//other rooms should only extend emptyRoom if they do not add significant terrain
|
||||
public class EmptyRoom extends StandardRoom {
|
||||
|
||||
@Override
|
||||
|
|
|
@ -32,6 +32,8 @@ import com.watabou.utils.Point;
|
|||
import com.watabou.utils.Random;
|
||||
|
||||
public class EntranceRoom extends StandardRoom {
|
||||
|
||||
//TODO maybe not joinable? It's a little BS to spawn with enemies
|
||||
|
||||
@Override
|
||||
public int minWidth() {
|
||||
|
|
|
@ -28,6 +28,8 @@ import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.Room;
|
|||
import com.watabou.utils.Point;
|
||||
|
||||
public class ExitRoom extends StandardRoom {
|
||||
|
||||
//TODO maybe not joinable?
|
||||
|
||||
@Override
|
||||
public int minWidth() {
|
||||
|
|
|
@ -30,7 +30,11 @@ import com.watabou.utils.PointF;
|
|||
import com.watabou.utils.Random;
|
||||
import com.watabou.utils.Rect;
|
||||
|
||||
public class HallwayRoom extends EmptyRoom {
|
||||
public class HallwayRoom extends StandardRoom {
|
||||
|
||||
{
|
||||
joinable = false;
|
||||
}
|
||||
|
||||
//FIXME lots of copy-pasta from tunnel rooms here
|
||||
@Override
|
||||
|
|
|
@ -29,7 +29,11 @@ import com.watabou.utils.Random;
|
|||
import com.watabou.utils.Rect;
|
||||
|
||||
public class SegmentedRoom extends StandardRoom {
|
||||
|
||||
|
||||
{
|
||||
joinable = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int minWidth() {
|
||||
return Math.max(super.minWidth(), 7);
|
||||
|
|
|
@ -35,6 +35,10 @@ import java.util.ArrayList;
|
|||
|
||||
public class SewerPipeRoom extends StandardRoom {
|
||||
|
||||
{
|
||||
joinable = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int minWidth() {
|
||||
return Math.max(7, super.minWidth());
|
||||
|
|
|
@ -27,6 +27,10 @@ import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter;
|
|||
|
||||
public class SkullsRoom extends StandardRoom {
|
||||
|
||||
{
|
||||
joinable = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int minWidth() {
|
||||
return Math.max(7, super.minWidth());
|
||||
|
|
|
@ -29,6 +29,10 @@ import com.watabou.utils.Reflection;
|
|||
import java.util.ArrayList;
|
||||
|
||||
public abstract class StandardRoom extends Room {
|
||||
|
||||
//whether this room can be joined with other standard rooms
|
||||
//should usually be set to false by rooms that substantially alter terrain
|
||||
public boolean joinable = true;
|
||||
|
||||
public enum SizeCategory {
|
||||
|
||||
|
|
|
@ -30,6 +30,10 @@ import com.watabou.utils.Point;
|
|||
import com.watabou.utils.Random;
|
||||
|
||||
public class StudyRoom extends StandardRoom {
|
||||
|
||||
{
|
||||
joinable = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int minWidth() {
|
||||
|
|
|
@ -30,7 +30,7 @@ import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter;
|
||||
import com.watabou.utils.Random;
|
||||
|
||||
public class SuspiciousChestRoom extends EmptyRoom {
|
||||
public class SuspiciousChestRoom extends StandardRoom {
|
||||
|
||||
@Override
|
||||
public int minWidth() {
|
||||
|
@ -44,7 +44,8 @@ public class SuspiciousChestRoom extends EmptyRoom {
|
|||
|
||||
@Override
|
||||
public void paint(Level level) {
|
||||
super.paint(level);
|
||||
Painter.fill( level, this, Terrain.WALL );
|
||||
Painter.fill( level, this, 1 , Terrain.EMPTY );
|
||||
|
||||
Item i = level.findPrizeItem();
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user