diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java index 3b7c67469..98399c51d 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java @@ -994,8 +994,10 @@ public class Hero extends Char { if (Actor.findChar( target ) == null) { if (Level.pit[target] && !flying && !Chasm.jumpConfirmed) { - Chasm.heroJump( this ); - interrupt(); + if (!Level.solid[target]) { + Chasm.heroJump(this); + interrupt(); + } return false; } if (Level.passable[target] || Level.avoid[target]) { diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/levels/DeadEndLevel.java b/src/com/shatteredpixel/shatteredpixeldungeon/levels/DeadEndLevel.java index d675b0b58..9c74f9bf9 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/levels/DeadEndLevel.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/levels/DeadEndLevel.java @@ -63,9 +63,9 @@ public class DeadEndLevel extends Level { entrance = SIZE * WIDTH + SIZE / 2 + 1; map[entrance] = Terrain.ENTRANCE; - exit = -1; + exit = (SIZE / 2 + 1) * (WIDTH + 1); - map[(SIZE / 2 + 1) * (WIDTH + 1)] = Terrain.SIGN; + map[exit] = Terrain.SIGN; return true; } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/levels/LastLevel.java b/src/com/shatteredpixel/shatteredpixeldungeon/levels/LastLevel.java index c368dec26..e7ba1b8d8 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/levels/LastLevel.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/levels/LastLevel.java @@ -27,52 +27,85 @@ import com.watabou.utils.Random; public class LastLevel extends Level { - private static final int SIZE = 7; - + private static final int SIZE = 30; + { color1 = 0x801500; color2 = 0xa68521; + + viewDistance = 8; } - + private int pedestal; - + @Override public String tilesTex() { return Assets.TILES_HALLS; } - + @Override public String waterTex() { return Assets.WATER_HALLS; } - + + @Override + public void create() { + super.create(); + for (int i=0; i < LENGTH; i++) { + int flags = Terrain.flags[map[i]]; + if ((flags & Terrain.PIT) != 0){ + passable[i] = avoid[i] = false; + solid[i] = true; + } + } + } + @Override protected boolean build() { - Arrays.fill( map, Terrain.WALL ); - Painter.fill( this, 1, 1, SIZE, SIZE, Terrain.WATER ); - Painter.fill( this, 2, 2, SIZE-2, SIZE-2, Terrain.EMPTY ); - Painter.fill( this, SIZE/2, SIZE/2, 3, 3, Terrain.EMPTY_SP ); - + Arrays.fill( map, Terrain.CHASM ); + + Painter.fill( this, 7, 31, 19, 1, Terrain.WALL ); + Painter.fill( this, 15, 10, 3, 21, Terrain.EMPTY); + Painter.fill( this, 13, 30, 7, 1, Terrain.EMPTY); + Painter.fill( this, 14, 29, 5, 1, Terrain.EMPTY); + + Painter.fill( this, 14, 9, 5, 7, Terrain.EMPTY); + Painter.fill( this, 13, 10, 7, 5, Terrain.EMPTY); + + //Painter.fill( this, 2, 2, SIZE-2, SIZE-2, Terrain.EMPTY ); + //Painter.fill( this, SIZE/2, SIZE/2, 3, 3, Terrain.EMPTY_SP ); + entrance = SIZE * WIDTH + SIZE / 2 + 1; map[entrance] = Terrain.ENTRANCE; - - exit = entrance - WIDTH * SIZE; - map[exit] = Terrain.LOCKED_EXIT; - - pedestal = (SIZE / 2 + 1) * (WIDTH + 1); + + pedestal = (SIZE / 2 + 1) * (WIDTH + 1) - 4*WIDTH; map[pedestal] = Terrain.PEDESTAL; - map[pedestal-1] = map[pedestal+1] = Terrain.STATUE_SP; - + map[pedestal-1-WIDTH] = map[pedestal+1-WIDTH] = map[pedestal-1+WIDTH] = map[pedestal+1+WIDTH] = Terrain.STATUE_SP; + + exit = pedestal; + + int pos = pedestal; + + map[pos-WIDTH] = map[pos-1] = map[pos+1] = map[pos-2] = map[pos+2] = Terrain.WATER; + pos+=WIDTH; + map[pos] = map[pos-2] = map[pos+2] = map[pos-3] = map[pos+3] = Terrain.WATER; + pos+=WIDTH; + map[pos-3] = map[pos-2] = map[pos-1] = map[pos] = map[pos+1] = map[pos+2] = map[pos+3] = Terrain.WATER; + pos+=WIDTH; + map[pos-2] = map[pos+2] = Terrain.WATER; + + feeling = Feeling.NONE; - + viewDistance = 8; + return true; } @Override protected void decorate() { for (int i=0; i < LENGTH; i++) { - if (map[i] == Terrain.EMPTY && Random.Int( 10 ) == 0) { + if (map[i] == Terrain.EMPTY && Random.Int( 10 ) == 0) { map[i] = Terrain.EMPTY_DECO; } } @@ -86,7 +119,7 @@ public class LastLevel extends Level { protected void createItems() { drop( new Amulet(), pedestal ); } - + @Override public int randomRespawnCell() { return -1; @@ -108,7 +141,7 @@ public class LastLevel extends Level { return super.tileName( tile ); } } - + @Override public String tileDesc(int tile) { switch (tile) { @@ -116,14 +149,15 @@ public class LastLevel extends Level { return "It looks like lava, but it's cold and probably safe to touch."; case Terrain.STATUE: case Terrain.STATUE_SP: - return "The pillar is made of real humanoid skulls. Awesome."; + return "The pillar is made of real humanoid skulls. Awesome."; default: return super.tileDesc( tile ); } } - + @Override public void addVisuals( Scene scene ) { + super.addVisuals( scene ); HallsLevel.addVisuals( this, scene ); } }