|
|
@@ -62,6 +62,12 @@ public class GameController implements Observer {
|
|
|
var passages = room.getPassages();
|
|
|
|
|
|
for (var passage : passages) {
|
|
|
+ var lastPassage = Session.getGame().getLastPassage();
|
|
|
+
|
|
|
+ if (!Session.getGame().getCurrentRoom().isExplored() && (lastPassage.isEmpty() || passage != lastPassage.get())) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
var label = passage.isSeeThrough() || passage.getOtherRoom(room).wasEntered()
|
|
|
? enter.getName() + " " + passage.getName() + " (>> " + passage.getOtherRoom(Session.getGame().getCurrentRoom()).getName() + ")"
|
|
|
: enter.getName() + " " + passage.getName() + " (>> ???)";
|
|
|
@@ -75,6 +81,10 @@ public class GameController implements Observer {
|
|
|
}
|
|
|
}
|
|
|
case PressButton pressButton -> {
|
|
|
+ if (!Session.getGame().getCurrentRoom().isExplored()) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
if (Session.getGame().getCurrentRoom().isBlockedByEnemy()) {
|
|
|
continue;
|
|
|
}
|
|
|
@@ -95,6 +105,10 @@ public class GameController implements Observer {
|
|
|
}
|
|
|
}
|
|
|
case Slay slay -> {
|
|
|
+ if (!Session.getGame().getCurrentRoom().isExplored()) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
var enemy = Session.getGame().getCurrentRoom().getEnemy();
|
|
|
|
|
|
if (enemy.isPresent() && enemy.get().isAlive()) {
|
|
|
@@ -109,6 +123,10 @@ public class GameController implements Observer {
|
|
|
}
|
|
|
}
|
|
|
case TakeItem takeItem -> {
|
|
|
+ if (!Session.getGame().getCurrentRoom().isExplored()) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
if (Session.getGame().getCurrentRoom().isBlockedByEnemy()) {
|
|
|
continue;
|
|
|
}
|