diff --git a/android/src/main/assets/custom_tiles/prison_exit_new.png b/android/src/main/assets/custom_tiles/prison_exit_new.png index ffe7a681c..4ef5d56e8 100644 Binary files a/android/src/main/assets/custom_tiles/prison_exit_new.png and b/android/src/main/assets/custom_tiles/prison_exit_new.png differ diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java index 53bf0ff0b..c4501bcd2 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java @@ -845,7 +845,7 @@ public class Hero extends Char { private boolean actDescend( HeroAction.Descend action ) { int stairs = action.dst; - if (pos == stairs && pos == Dungeon.level.exit) { + if (pos == stairs) { curAction = null; @@ -871,7 +871,7 @@ public class Hero extends Char { private boolean actAscend( HeroAction.Ascend action ) { int stairs = action.dst; - if (pos == stairs && pos == Dungeon.level.entrance) { + if (pos == stairs) { if (Dungeon.depth == 1) { @@ -1231,11 +1231,12 @@ public class Hero extends Char { curAction = new HeroAction.Unlock( cell ); - } else if (cell == Dungeon.level.exit && Dungeon.depth < 26) { + } else if ((cell == Dungeon.level.exit || Dungeon.level.map[cell] == Terrain.EXIT || Dungeon.level.map[cell] == Terrain.UNLOCKED_EXIT) + && Dungeon.depth < 26) { curAction = new HeroAction.Descend( cell ); - } else if (cell == Dungeon.level.entrance) { + } else if (cell == Dungeon.level.entrance || Dungeon.level.map[cell] == Terrain.ENTRANCE) { curAction = new HeroAction.Ascend( cell ); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/NewPrisonBossLevel.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/NewPrisonBossLevel.java index 16ad898a9..9aadcbf5a 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/NewPrisonBossLevel.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/NewPrisonBossLevel.java @@ -131,6 +131,18 @@ public class NewPrisonBossLevel extends Level { } triggered = bundle.getBooleanArray(TRIGGERED); + + //compatibility with pre-0.7.5a saves + if (state == State.WON){ + int cell = pointToCell(endStart); + int i = 0; + while (cell < length()){ + System.arraycopy(endMap, i, map, cell, 14); + i += 14; + cell += width(); + } + exit = pointToCell(levelExit); + } } @Override @@ -260,10 +272,11 @@ public class NewPrisonBossLevel extends Level { private static int W = Terrain.WALL; private static int D = Terrain.WALL_DECO; private static int e = Terrain.EMPTY; + private static int E = Terrain.EXIT; private static int C = Terrain.CHASM; private static final Point endStart = new Point( startHallway.left+2, startHallway.top+2); - private static final Point levelExit = new Point( endStart.x+12, endStart.y+8); + private static final Point levelExit = new Point( endStart.x+12, endStart.y+6); private static final int[] endMap = new int[]{ W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, e, e, e, W, W, W, W, W, W, W, W, W, W, @@ -271,9 +284,9 @@ public class NewPrisonBossLevel extends Level { e, e, e, e, e, e, e, e, e, e, e, e, W, W, e, e, e, e, e, e, e, e, e, e, e, e, e, W, e, e, e, C, C, C, C, C, C, C, C, e, e, W, - e, W, C, C, C, C, C, C, C, C, C, C, e, W, - e, e, e, C, C, C, C, C, C, C, C, C, e, W, - e, e, e, e, e, C, C, C, C, C, C, C, e, W, + e, W, C, C, C, C, C, C, C, C, C, E, E, W, + e, e, e, C, C, C, C, C, C, C, C, E, E, W, + e, e, e, e, e, C, C, C, C, C, C, E, E, W, e, e, e, e, e, e, e, W, W, W, C, C, C, W, W, e, e, e, e, e, W, W, W, W, C, C, C, W, W, e, e, e, e, W, W, W, W, W, W, C, C, W, @@ -323,7 +336,6 @@ public class NewPrisonBossLevel extends Level { } exit = pointToCell(levelExit); - Painter.set(this, exit, Terrain.EXIT); } //keep track of removed items as the level is changed. Dump them back into the level at the end. @@ -806,9 +818,9 @@ public class NewPrisonBossLevel extends Level { 1, 0, 0, 1, 1, 1, 1, 1, 1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