V0.2.1 : Unblessed Ankh will now only reset a boss level when the level is locked.
This commit is contained in:
parent
dd2ddf6f81
commit
0e0faecc25
|
@ -218,6 +218,7 @@ public class CavesBossLevel extends Level {
|
||||||
if (!enteredArena && outsideEntraceRoom( cell ) && hero == Dungeon.hero) {
|
if (!enteredArena && outsideEntraceRoom( cell ) && hero == Dungeon.hero) {
|
||||||
|
|
||||||
enteredArena = true;
|
enteredArena = true;
|
||||||
|
locked = true;
|
||||||
|
|
||||||
Mob boss = Bestiary.mob( Dungeon.depth );
|
Mob boss = Bestiary.mob( Dungeon.depth );
|
||||||
boss.state = Mob.State.HUNTING;
|
boss.state = Mob.State.HUNTING;
|
||||||
|
@ -245,6 +246,7 @@ public class CavesBossLevel extends Level {
|
||||||
if (!keyDropped && item instanceof SkeletonKey) {
|
if (!keyDropped && item instanceof SkeletonKey) {
|
||||||
|
|
||||||
keyDropped = true;
|
keyDropped = true;
|
||||||
|
locked = false;
|
||||||
|
|
||||||
CellEmitter.get( arenaDoor ).start( Speck.factory( Speck.ROCK ), 0.07f, 10 );
|
CellEmitter.get( arenaDoor ).start( Speck.factory( Speck.ROCK ), 0.07f, 10 );
|
||||||
|
|
||||||
|
|
|
@ -176,6 +176,7 @@ public class CityBossLevel extends Level {
|
||||||
if (!enteredArena && outsideEntraceRoom( cell ) && hero == Dungeon.hero) {
|
if (!enteredArena && outsideEntraceRoom( cell ) && hero == Dungeon.hero) {
|
||||||
|
|
||||||
enteredArena = true;
|
enteredArena = true;
|
||||||
|
locked = true;
|
||||||
|
|
||||||
Mob boss = Bestiary.mob( Dungeon.depth );
|
Mob boss = Bestiary.mob( Dungeon.depth );
|
||||||
boss.state = Mob.State.HUNTING;
|
boss.state = Mob.State.HUNTING;
|
||||||
|
@ -199,6 +200,7 @@ public class CityBossLevel extends Level {
|
||||||
if (!keyDropped && item instanceof SkeletonKey) {
|
if (!keyDropped && item instanceof SkeletonKey) {
|
||||||
|
|
||||||
keyDropped = true;
|
keyDropped = true;
|
||||||
|
locked = false;
|
||||||
|
|
||||||
set( arenaDoor, Terrain.DOOR );
|
set( arenaDoor, Terrain.DOOR );
|
||||||
GameScene.updateMap( arenaDoor );
|
GameScene.updateMap( arenaDoor );
|
||||||
|
|
|
@ -167,6 +167,7 @@ public class HallsBossLevel extends Level {
|
||||||
if (!enteredArena && hero == Dungeon.hero && cell != entrance) {
|
if (!enteredArena && hero == Dungeon.hero && cell != entrance) {
|
||||||
|
|
||||||
enteredArena = true;
|
enteredArena = true;
|
||||||
|
locked = true;
|
||||||
|
|
||||||
for (int i=ROOM_LEFT-1; i <= ROOM_RIGHT + 1; i++) {
|
for (int i=ROOM_LEFT-1; i <= ROOM_RIGHT + 1; i++) {
|
||||||
doMagic( (ROOM_TOP - 1) * WIDTH + i );
|
doMagic( (ROOM_TOP - 1) * WIDTH + i );
|
||||||
|
@ -205,6 +206,7 @@ public class HallsBossLevel extends Level {
|
||||||
|
|
||||||
if (!keyDropped && item instanceof SkeletonKey) {
|
if (!keyDropped && item instanceof SkeletonKey) {
|
||||||
keyDropped = true;
|
keyDropped = true;
|
||||||
|
locked = false;
|
||||||
|
|
||||||
entrance = stairs;
|
entrance = stairs;
|
||||||
set( entrance, Terrain.ENTRANCE );
|
set( entrance, Terrain.ENTRANCE );
|
||||||
|
|
|
@ -132,6 +132,9 @@ public abstract class Level implements Bundlable {
|
||||||
|
|
||||||
public int entrance;
|
public int entrance;
|
||||||
public int exit;
|
public int exit;
|
||||||
|
|
||||||
|
//when a boss level has become locked.
|
||||||
|
public boolean locked = false;
|
||||||
|
|
||||||
public HashSet<Mob> mobs;
|
public HashSet<Mob> mobs;
|
||||||
public SparseArray<Heap> heaps;
|
public SparseArray<Heap> heaps;
|
||||||
|
@ -151,6 +154,7 @@ public abstract class Level implements Bundlable {
|
||||||
private static final String MAPPED = "mapped";
|
private static final String MAPPED = "mapped";
|
||||||
private static final String ENTRANCE = "entrance";
|
private static final String ENTRANCE = "entrance";
|
||||||
private static final String EXIT = "exit";
|
private static final String EXIT = "exit";
|
||||||
|
private static final String LOCKED = "locked";
|
||||||
private static final String HEAPS = "heaps";
|
private static final String HEAPS = "heaps";
|
||||||
private static final String PLANTS = "plants";
|
private static final String PLANTS = "plants";
|
||||||
private static final String MOBS = "mobs";
|
private static final String MOBS = "mobs";
|
||||||
|
@ -256,6 +260,8 @@ public abstract class Level implements Bundlable {
|
||||||
|
|
||||||
entrance = bundle.getInt( ENTRANCE );
|
entrance = bundle.getInt( ENTRANCE );
|
||||||
exit = bundle.getInt( EXIT );
|
exit = bundle.getInt( EXIT );
|
||||||
|
|
||||||
|
locked = bundle.getBoolean( LOCKED );
|
||||||
|
|
||||||
weakFloorCreated = false;
|
weakFloorCreated = false;
|
||||||
|
|
||||||
|
@ -308,6 +314,7 @@ public abstract class Level implements Bundlable {
|
||||||
bundle.put( MAPPED, mapped );
|
bundle.put( MAPPED, mapped );
|
||||||
bundle.put( ENTRANCE, entrance );
|
bundle.put( ENTRANCE, entrance );
|
||||||
bundle.put( EXIT, exit );
|
bundle.put( EXIT, exit );
|
||||||
|
bundle.put( LOCKED, locked );
|
||||||
bundle.put( HEAPS, heaps.values() );
|
bundle.put( HEAPS, heaps.values() );
|
||||||
bundle.put( PLANTS, plants.values() );
|
bundle.put( PLANTS, plants.values() );
|
||||||
bundle.put( MOBS, mobs );
|
bundle.put( MOBS, mobs );
|
||||||
|
|
|
@ -309,6 +309,7 @@ public class PrisonBossLevel extends RegularLevel {
|
||||||
if (ch == Dungeon.hero && !enteredArena && roomExit.inside( cell )) {
|
if (ch == Dungeon.hero && !enteredArena && roomExit.inside( cell )) {
|
||||||
|
|
||||||
enteredArena = true;
|
enteredArena = true;
|
||||||
|
locked = true;
|
||||||
|
|
||||||
int pos;
|
int pos;
|
||||||
do {
|
do {
|
||||||
|
@ -326,6 +327,7 @@ public class PrisonBossLevel extends RegularLevel {
|
||||||
set( arenaDoor, Terrain.LOCKED_DOOR );
|
set( arenaDoor, Terrain.LOCKED_DOOR );
|
||||||
GameScene.updateMap( arenaDoor );
|
GameScene.updateMap( arenaDoor );
|
||||||
Dungeon.observe();
|
Dungeon.observe();
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -335,6 +337,7 @@ public class PrisonBossLevel extends RegularLevel {
|
||||||
if (!keyDropped && item instanceof SkeletonKey) {
|
if (!keyDropped && item instanceof SkeletonKey) {
|
||||||
|
|
||||||
keyDropped = true;
|
keyDropped = true;
|
||||||
|
locked = false;
|
||||||
|
|
||||||
set( arenaDoor, Terrain.DOOR );
|
set( arenaDoor, Terrain.DOOR );
|
||||||
GameScene.updateMap( arenaDoor );
|
GameScene.updateMap( arenaDoor );
|
||||||
|
|
|
@ -232,6 +232,8 @@ public class SewerBossLevel extends RegularLevel {
|
||||||
|
|
||||||
public void seal() {
|
public void seal() {
|
||||||
if (entrance != 0) {
|
if (entrance != 0) {
|
||||||
|
|
||||||
|
locked = true;
|
||||||
|
|
||||||
set( entrance, Terrain.WATER_TILES );
|
set( entrance, Terrain.WATER_TILES );
|
||||||
GameScene.updateMap( entrance );
|
GameScene.updateMap( entrance );
|
||||||
|
@ -244,12 +246,15 @@ public class SewerBossLevel extends RegularLevel {
|
||||||
|
|
||||||
public void unseal() {
|
public void unseal() {
|
||||||
if (stairs != 0) {
|
if (stairs != 0) {
|
||||||
|
|
||||||
|
locked = false;
|
||||||
|
|
||||||
entrance = stairs;
|
entrance = stairs;
|
||||||
stairs = 0;
|
stairs = 0;
|
||||||
|
|
||||||
set( entrance, Terrain.ENTRANCE );
|
set( entrance, Terrain.ENTRANCE );
|
||||||
GameScene.updateMap( entrance );
|
GameScene.updateMap( entrance );
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user