diff --git a/data/rooms.dat b/data/rooms.dat index 97580fd..8829ab6 100644 --- a/data/rooms.dat +++ b/data/rooms.dat @@ -4,7 +4,7 @@ New Room Description: You are in a circular room. The windows to the east are c Locked: false Boarded: false Items: Lightbulb, Candlestick -Riddler: "Hello there. My name is Kevin and I am Sir Pellatt's butler. I understand that my master
Sir Pellatt has wrongfully imprisoned you. If you answer my riddle I can give you something to
help you with your escape - nothing comes for free you know!", "What goes moo?", "Cows", Lockpick +Riddler: "Hello there. My name is Kevin and I am Sir Pellatt's butler. I understand that my master
Sir Pellatt has wrongfully imprisoned you. If you answer my riddle I can give you something to
help you with your escape - nothing comes for free you know!", "What has a head a tail is brown and has no legs?", "A penny", Lockpick Exit Rooms: W-Apple Hallway Room name: Apple Hallway @@ -189,7 +189,7 @@ Exit Rooms: S-Aspen Bedroom, E-Willow Bedroom Room name: Guest Bedroom Room Description: Welcome to the guest bedroom, where guests like yourself stay for the night. There is another tailored
man in the corner. He seems to have something he would like to tell you. -New Room Description: +New Room Description: Welcome to the guest bedroom, where guests like yourself stay for the night. Locked: false Boarded: false Items: @@ -251,8 +251,8 @@ Riddler: Exit Rooms: S-Breakfast Room, E-Library, W-Conservatory Room name: Conservatory -Room Description: You are now in the Conservatory. The walls and ceilings are all glass, which gives you a gorgeous view of the outdoors.
A few potted plants lay directly in the sunlight. There is a tailored woman standing in the corner of the room. -New Room Description: +Room Description: You are now in the Conservatory. The walls and ceilings are all glass, which gives you a gorgeous view of the outdoors.
A few potted plants lay directly in the sunlight. There is a woman in a tailored pantsuit standing in the corner of the room. +New Room Description: You are now in the Conservatory. The walls and ceilings are all glass, which gives you a gorgeous view of the outdoors.
A few potted plants lay directly in the sunlight. Locked: false Boarded: false Items: diff --git a/src/com/bayviewglen/zork/Game.java b/src/com/bayviewglen/zork/Game.java index b971927..7f677ac 100644 --- a/src/com/bayviewglen/zork/Game.java +++ b/src/com/bayviewglen/zork/Game.java @@ -61,7 +61,7 @@ class Game { room.setDescription(roomDescription.split(": ")[1].replaceAll("
", "\n").trim()); //Read room description after riddler is removed. String newRoomDescription = roomScanner.nextLine(); - room.setNewRoomDescription(newRoomDescription.split(": ")[1].replaceAll("
", "\n").trim()); + room.setNewRoomDescription(newRoomDescription.substring(newRoomDescription.indexOf(":") + 1,newRoomDescription.length()).replaceAll("
", "\n").trim()); // Read the locked state boolean locked = Boolean.parseBoolean(roomScanner.nextLine().split(": ")[1].replaceAll("
", "\n").trim()); room.setLocked(locked); diff --git a/src/com/bayviewglen/zork/Room.java b/src/com/bayviewglen/zork/Room.java index 9224cc9..b4dc0ac 100644 --- a/src/com/bayviewglen/zork/Room.java +++ b/src/com/bayviewglen/zork/Room.java @@ -25,7 +25,7 @@ import com.bayviewglen.zork.Items.*; class Room { private String roomName; private String description; - private String newRoomDescription; + private String newDescription; private HashMap exits; // stores exits of this room. private ArrayList items; private Riddler riddler; //needs to altered outside of the class so that riddler can be set to null. @@ -254,6 +254,7 @@ class Room { public void removeRiddler() { riddler = null; + this.description = newDescription; } @@ -266,7 +267,7 @@ class Room { } public void setNewRoomDescription(String newRoomDesc) { - this.newRoomDescription = newRoomDesc; + this.newDescription = newRoomDesc; }