diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/levels/CavesBossLevel.java b/src/com/shatteredpixel/shatteredpixeldungeon/levels/CavesBossLevel.java index 974bc04c1..ec962d818 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/levels/CavesBossLevel.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/levels/CavesBossLevel.java @@ -218,6 +218,7 @@ public class CavesBossLevel extends Level { if (!enteredArena && outsideEntraceRoom( cell ) && hero == Dungeon.hero) { enteredArena = true; + locked = true; Mob boss = Bestiary.mob( Dungeon.depth ); boss.state = Mob.State.HUNTING; @@ -245,6 +246,7 @@ public class CavesBossLevel extends Level { if (!keyDropped && item instanceof SkeletonKey) { keyDropped = true; + locked = false; CellEmitter.get( arenaDoor ).start( Speck.factory( Speck.ROCK ), 0.07f, 10 ); diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/levels/CityBossLevel.java b/src/com/shatteredpixel/shatteredpixeldungeon/levels/CityBossLevel.java index af267e6cc..254118971 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/levels/CityBossLevel.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/levels/CityBossLevel.java @@ -176,6 +176,7 @@ public class CityBossLevel extends Level { if (!enteredArena && outsideEntraceRoom( cell ) && hero == Dungeon.hero) { enteredArena = true; + locked = true; Mob boss = Bestiary.mob( Dungeon.depth ); boss.state = Mob.State.HUNTING; @@ -199,6 +200,7 @@ public class CityBossLevel extends Level { if (!keyDropped && item instanceof SkeletonKey) { keyDropped = true; + locked = false; set( arenaDoor, Terrain.DOOR ); GameScene.updateMap( arenaDoor ); diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/levels/HallsBossLevel.java b/src/com/shatteredpixel/shatteredpixeldungeon/levels/HallsBossLevel.java index cf25d47dc..8075a9a7e 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/levels/HallsBossLevel.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/levels/HallsBossLevel.java @@ -167,6 +167,7 @@ public class HallsBossLevel extends Level { if (!enteredArena && hero == Dungeon.hero && cell != entrance) { enteredArena = true; + locked = true; for (int i=ROOM_LEFT-1; i <= ROOM_RIGHT + 1; i++) { doMagic( (ROOM_TOP - 1) * WIDTH + i ); @@ -205,6 +206,7 @@ public class HallsBossLevel extends Level { if (!keyDropped && item instanceof SkeletonKey) { keyDropped = true; + locked = false; entrance = stairs; set( entrance, Terrain.ENTRANCE ); diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/levels/Level.java b/src/com/shatteredpixel/shatteredpixeldungeon/levels/Level.java index cf8d74b53..f6d1f74e0 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/levels/Level.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/levels/Level.java @@ -132,6 +132,9 @@ public abstract class Level implements Bundlable { public int entrance; public int exit; + + //when a boss level has become locked. + public boolean locked = false; public HashSet mobs; public SparseArray heaps; @@ -151,6 +154,7 @@ public abstract class Level implements Bundlable { private static final String MAPPED = "mapped"; private static final String ENTRANCE = "entrance"; private static final String EXIT = "exit"; + private static final String LOCKED = "locked"; private static final String HEAPS = "heaps"; private static final String PLANTS = "plants"; private static final String MOBS = "mobs"; @@ -256,6 +260,8 @@ public abstract class Level implements Bundlable { entrance = bundle.getInt( ENTRANCE ); exit = bundle.getInt( EXIT ); + + locked = bundle.getBoolean( LOCKED ); weakFloorCreated = false; @@ -308,6 +314,7 @@ public abstract class Level implements Bundlable { bundle.put( MAPPED, mapped ); bundle.put( ENTRANCE, entrance ); bundle.put( EXIT, exit ); + bundle.put( LOCKED, locked ); bundle.put( HEAPS, heaps.values() ); bundle.put( PLANTS, plants.values() ); bundle.put( MOBS, mobs ); diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/levels/PrisonBossLevel.java b/src/com/shatteredpixel/shatteredpixeldungeon/levels/PrisonBossLevel.java index beeb1c16c..0f85550dd 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/levels/PrisonBossLevel.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/levels/PrisonBossLevel.java @@ -309,6 +309,7 @@ public class PrisonBossLevel extends RegularLevel { if (ch == Dungeon.hero && !enteredArena && roomExit.inside( cell )) { enteredArena = true; + locked = true; int pos; do { @@ -326,6 +327,7 @@ public class PrisonBossLevel extends RegularLevel { set( arenaDoor, Terrain.LOCKED_DOOR ); GameScene.updateMap( arenaDoor ); Dungeon.observe(); + } } @@ -335,6 +337,7 @@ public class PrisonBossLevel extends RegularLevel { if (!keyDropped && item instanceof SkeletonKey) { keyDropped = true; + locked = false; set( arenaDoor, Terrain.DOOR ); GameScene.updateMap( arenaDoor ); diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/levels/SewerBossLevel.java b/src/com/shatteredpixel/shatteredpixeldungeon/levels/SewerBossLevel.java index 100c7a937..fae9006c8 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/levels/SewerBossLevel.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/levels/SewerBossLevel.java @@ -232,6 +232,8 @@ public class SewerBossLevel extends RegularLevel { public void seal() { if (entrance != 0) { + + locked = true; set( entrance, Terrain.WATER_TILES ); GameScene.updateMap( entrance ); @@ -244,12 +246,15 @@ public class SewerBossLevel extends RegularLevel { public void unseal() { if (stairs != 0) { + + locked = false; entrance = stairs; stairs = 0; set( entrance, Terrain.ENTRANCE ); GameScene.updateMap( entrance ); + } }