diff --git a/core/src/main/assets/environment/custom_tiles/prison_exit.png b/core/src/main/assets/environment/custom_tiles/prison_exit.png index 2030603d0..0eff96f3b 100644 Binary files a/core/src/main/assets/environment/custom_tiles/prison_exit.png and b/core/src/main/assets/environment/custom_tiles/prison_exit.png differ diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/HallsBossLevel.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/HallsBossLevel.java index f8220c723..b7d37ba1c 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/HallsBossLevel.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/HallsBossLevel.java @@ -132,10 +132,13 @@ public class HallsBossLevel extends Level { } + int exitCell = width/2 + ((ROOM_TOP+1) * width); + int bossPos = exitCell + width*3; + boolean[] patch = Patch.generate(width, height, 0.20f, 0, true); for (int i = 0; i < length(); i++) { if (map[i] == Terrain.EMPTY && patch[i]) { - map[i] = Terrain.STATUE; + map[i] = distance(i, bossPos)+Random.Int(5) >= 10 ? Terrain.REGION_DECO : Terrain.STATUE; } } @@ -145,7 +148,7 @@ public class HallsBossLevel extends Level { patch = Patch.generate(width, height, 0.30f, 3, true); for (int i = 0; i < length(); i++) { - if ((map[i] == Terrain.EMPTY || map[i] == Terrain.STATUE) && patch[i]) { + if ((map[i] == Terrain.EMPTY || map[i] == Terrain.STATUE || map[i] == Terrain.REGION_DECO) && patch[i]) { map[i] = Terrain.WATER; } } @@ -164,7 +167,6 @@ public class HallsBossLevel extends Level { Painter.fill(this, ROOM_LEFT+3, ROOM_TOP+2, 3, 4, Terrain.EMPTY ); - int exitCell = width/2 + ((ROOM_TOP+1) * width); LevelTransition exit = new LevelTransition(this, exitCell, LevelTransition.Type.REGULAR_EXIT); exit.top--; exit.left--; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/PrisonBossLevel.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/PrisonBossLevel.java index 0c5bf2b6b..911125418 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/PrisonBossLevel.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/PrisonBossLevel.java @@ -210,6 +210,8 @@ public class PrisonBossLevel extends Level { Painter.set(this, p, Terrain.WALL_DECO); } + addCagesToCells(); + //we set up the exit for consistently with other levels, even though it's in the walls LevelTransition exit = new LevelTransition(this, pointToCell(levelExit), LevelTransition.Type.REGULAR_EXIT); exit.right+=2; @@ -233,6 +235,8 @@ public class PrisonBossLevel extends Level { Painter.set(this, startHallway.left+1, startHallway.top, Terrain.EMPTY); Painter.set(this, startHallway.left+1, startHallway.top+1, Terrain.DOOR); + addCagesToCells(); + } private static final Rect arena = new Rect(3, 1, 18, 16); @@ -320,6 +324,8 @@ public class PrisonBossLevel extends Level { exit.bottom += 3; transitions.add(exit); } + + addCagesToCells(); } //keep track of removed items as the level is changed. Dump them back into the level at the end. @@ -380,6 +386,25 @@ public class PrisonBossLevel extends Level { GameScene.resetMap(); Dungeon.observe(); } + + //randomly places up to 5 cages on tiles that are aside walls (but not torches or doors!) + public void addCagesToCells(){ + Random.pushGenerator(Dungeon.seedCurDepth()); + for (int i = 0; i < 5; i++){ + int cell = randomPrisonCellPos(); + boolean valid = false; + for (int j : PathFinder.NEIGHBOURS4){ + if (map[cell+j] == Terrain.WALL){ + valid = true; + } + } + if (valid){ + Painter.set(this, cell, Terrain.REGION_DECO); + } + } + + Random.popGenerator(); + } @Override public Group addVisuals() { @@ -592,7 +617,11 @@ public class PrisonBossLevel extends Level { } Random.popGenerator(); - drop(new IronKey(10), randomPrisonCellPos()); + int pos; + do { + pos = randomPrisonCellPos(); + } while (solid[pos]); + drop(new IronKey(10), pos); } @Override