v2.0.0: fixed softlocks caused by warden fadeleaf and boss levels

This commit is contained in:
Evan Debenham
2022-11-17 13:11:37 -05:00
parent a324b502ec
commit 5eb14fc50b
4 changed files with 8 additions and 11 deletions

View File

@@ -249,8 +249,6 @@ public class CavesBossLevel extends Level {
@Override
public void occupyCell(Char ch) {
super.occupyCell(ch);
//seal the level when the hero moves near to a pylon, the level isn't already sealed, and the gate hasn't been destroyed
int gatePos = pointToCell(new Point(gate.left, gate.top));
if (ch == Dungeon.hero && !locked && solid[gatePos]){
@@ -261,6 +259,8 @@ public class CavesBossLevel extends Level {
}
}
}
super.occupyCell(ch);
}
@Override

View File

@@ -294,15 +294,12 @@ public class CityBossLevel extends Level {
@Override
public void occupyCell( Char ch ) {
super.occupyCell( ch );
if (map[bottomDoor] != Terrain.LOCKED_DOOR && map[topDoor] == Terrain.LOCKED_DOOR
&& ch.pos < bottomDoor && ch == Dungeon.hero) {
seal();
}
super.occupyCell( ch );
}
@Override

View File

@@ -220,12 +220,12 @@ public class HallsBossLevel extends Level {
@Override
public void occupyCell( Char ch ) {
super.occupyCell( ch );
if (map[entrance()] == Terrain.ENTRANCE && map[exit()] != Terrain.EXIT
&& ch == Dungeon.hero && Dungeon.level.distance(ch.pos, entrance()) >= 2) {
seal();
}
super.occupyCell( ch );
}
@Override

View File

@@ -547,8 +547,6 @@ public class PrisonBossLevel extends Level {
@Override
public void occupyCell(Char ch) {
super.occupyCell(ch);
if (ch == Dungeon.hero){
switch (state){
case START:
@@ -564,6 +562,8 @@ public class PrisonBossLevel extends Level {
break;
}
}
super.occupyCell(ch);
}
@Override