Changed riddler execution

This commit is contained in:
Luca Carnegie
2019-05-29 23:17:29 -04:00
parent d052273a99
commit 2fd7b3ed6f
5 changed files with 6 additions and 4 deletions

View File

@@ -1,5 +1,5 @@
Room name: Circle Room
Room Description: You are in a circular room. The windows to the east are covered with boards that<br>let in just enough light to see. You spot a man in a tailored suit.
Room Description: You are in a circular room. The windows to the east are covered with boards that<br>let in just enough light to see. You spot a man in a tailored suit moving some crates around.
Locked: false
Boarded: false
Items:Lockpick,Milk

View File

@@ -43,4 +43,5 @@ nibble, eat
swallow, eat
absorb, eat
drink, eat
i, inventory

View File

@@ -10,7 +10,6 @@ take, verb
open, verb
unlock, verb
inventory, verb
i, verb
die, verb
drop, verb
attack, verb

View File

@@ -385,6 +385,8 @@ class Game {
if(player.addToInventory(prize)) {
player.addToInventory(prize);
System.out.println("A " + prizeName + " has been added to your inventory.");
currentRoom.riddler = null;
System.out.println("I've got to go find Mr. Pellatt now. Good luck with your escape!");
}else {
System.out.println("Sorry, you can't carry any more ");
}

View File

@@ -27,8 +27,8 @@ class Room {
private String description;
private HashMap<String, Room> exits; // stores exits of this room.
private ArrayList<Item> items;
private Riddler riddler;
private boolean locked;
Riddler riddler; //needs to altered outside of the class so that riddler can be set to null.
private boolean locked; // Otherwise you can repeatedly solve the riddle and get unlimited items
private boolean boarded;
/**