boarded rooms

This commit is contained in:
jslightham
2019-05-29 11:42:22 -04:00
parent 4f62ae7c0e
commit 28a4b723ff
4 changed files with 77 additions and 2 deletions

View File

@@ -1,6 +1,7 @@
Room name: Circle Room
Room Description: You are in a circular room. The windows to the east are covered with boards that let in just enough light to see.<br>There seems to be some writing on the wall.
Locked: false
Boarded: false
Items:Lockpick,Milk
Riddle: "Who is never hungry during Christmas?", "The turkey because he is always stuffed."
Exit Rooms: W-Apple Hallway
@@ -8,6 +9,7 @@ Exit Rooms: W-Apple Hallway
Room name: Apple Hallway
Room Description: You are in an empty hallway. Many closed doors surround you. To the west is the Circle Room and north is the Porcupine Stairs. The door to the stairs is locked. There is no key to the door.
Locked: false
Boarded: false
Items:
Riddle:
Exit Rooms: E-Circle Room, N-Porcupine Stairs (3rd Floor)
@@ -15,6 +17,7 @@ Exit Rooms: E-Circle Room, N-Porcupine Stairs (3rd Floor)
Room name: Porcupine Stairs (3rd Floor)
Room Description: You are in the Porcupine Stairs. The stone, cold walls are trapped in darkness. Below you is the second floor and above you is the third floor.
Locked: true
Boarded: false
Items:
Riddle:
Exit Rooms: S-Apple Hallway, Down-Porcupine Stairs (2nd Floor)
@@ -22,6 +25,7 @@ Exit Rooms: S-Apple Hallway, Down-Porcupine Stairs (2nd Floor)
Room name: Porcupine Stairs (2nd Floor)
Room Description: You are now on the second floor. The hallway is completely deserted. A few doors are left slightly ajar.
Locked: false
Boarded: false
Items:
Riddle:
Exit Rooms: S-Sir Henry Mill Pellatt's Bedroom, W-Bulb Room, E-Pipe Room, Up-Porcupine Stairs (3rd Floor)
@@ -29,6 +33,7 @@ Exit Rooms: S-Sir Henry Mill Pellatt's Bedroom, W-Bulb Room, E-Pipe Room, Up-Por
Room name: Bulb Room
Room Description: You are in the Bulb Room. There is a ragged red rug with a noticeable lump in the middle. One window facing north is bolted shut.
Locked: false
Boarded: false
Items:Garlic
Riddle:
Exit Rooms: E-Porcupine Stairs (2nd Floor), W-Lady Pellatt's Bedroom
@@ -36,6 +41,7 @@ Exit Rooms: E-Porcupine Stairs (2nd Floor), W-Lady Pellatt's Bedroom
Room name: Lady Pellatt's Bedroom
Room Description: You are now in Lady Pellatt's Bedroom. A four-post bed with elegant pink bedsheets lies in the middle of the room. A golden wardrobe sits along the east wall with a few robes hanging out.
Locked: false
Boarded: false
Items:Robes
Riddle:
Exit Rooms: N-Sitting Area, S-Guest Bedroom, E-Bulb Room
@@ -43,6 +49,7 @@ Exit Rooms: N-Sitting Area, S-Guest Bedroom, E-Bulb Room
Room name: Sitting Area
Room Description: You are in a room with multiple chairs and fake plants. There are several windows, all of which are shut. A few scratches can be noted on the chairs.
Locked: false
Boarded: false
Items:
Riddle:
Exit Rooms: S-Lady Pellatt's Bedroom
@@ -50,6 +57,7 @@ Exit Rooms: S-Lady Pellatt's Bedroom
Room name: Pipe Room
Room Description: Welcome to the Pipe Room. A misty smell fills the room. Strange items lay in a pile near the north wall. I suggest you take a look...
Locked: false
Boarded: false
Items:
Riddle:
Exit Rooms: W-Porcupine Stairs (2nd Floor), S-Landing, N-East Sitting Room, E-Round Room
@@ -57,6 +65,7 @@ Exit Rooms: W-Porcupine Stairs (2nd Floor), S-Landing, N-East Sitting Room, E-Ro
Room name: Round Room
Room Description: You are now into the Round Room. Nothing is out of the ordinary in here...
Locked: false
Boarded: false
Items:
Riddle:
Exit Rooms: W-Pipe Room, N-Elm Bedroom, S-Oak Bedroom
@@ -64,6 +73,7 @@ Exit Rooms: W-Pipe Room, N-Elm Bedroom, S-Oak Bedroom
Room name: Elm Bedroom
Room Description: You are in the Elm Bedroom. The walls are all wooden and a few windows face north. A bed sits in the middle of the room. A few pillows are on the ground. It looks like someone was in here...
Locked: false
Boarded: false
Items: Water bottle,Pen,Book
Riddle:
Exit Rooms: S-Round Room, W-East Sitting Room
@@ -71,6 +81,7 @@ Exit Rooms: S-Round Room, W-East Sitting Room
Room name: East Sitting Room
Room Description: Welcome to the East Sitting Room. Boring name but not so boring room. Take a look at the paintings, admire the art.
Locked: false
Boarded: false
Items:Painting
Riddle:
Exit Rooms: S-Pipe Room, E-Elm Bedroom
@@ -78,6 +89,7 @@ Exit Rooms: S-Pipe Room, E-Elm Bedroom
Room name: Oak Bedroom
Room Description: You are now in the Oak Bedroom. The walls are covered with pink floral wallpaper and a few socks are strewn about the room. A small four-post bedroom lies in the south-east corner of the room.
Locked: false
Boarded: false
Items:Socks
Riddle:
Exit Rooms: N-Round Room, W-Landing
@@ -85,6 +97,7 @@ Exit Rooms: N-Round Room, W-Landing
Room name: Landing
Room Description: You are now outside on the Landing. A cold gust of wind sweeps by. There doesn't seem to be anywhere to go. It is too high to jump, and you don't have a ladder.
Locked: false
Boarded: false
Items:
Riddle:
Exit Rooms: W-Sir Henry Mill Pellatt's Bedroom, E-Oak Bedroom
@@ -92,6 +105,7 @@ Exit Rooms: W-Sir Henry Mill Pellatt's Bedroom, E-Oak Bedroom
Room name: Sir Henry Mill Pellatt's Bedroom
Room Description: Welcome to Sir Henry Mill Pellatt's Bedroom. As the master of this castle, Sir Pellatt isn't in this room very often. Only some clothes, a bed, and a desk reside here. Oh, and don't touch his notebook.
Locked: false
Boarded: false
Items:Notebook
Riddle:
Exit Rooms: N-Porcupine Stairs (2nd Floor), E-Landing, S-Sir Henry Mill Pellatt's Bathroom, W-Linen Closet
@@ -99,6 +113,7 @@ Exit Rooms: N-Porcupine Stairs (2nd Floor), E-Landing, S-Sir Henry Mill Pellatt'
Room name: Sir Henry Mill Pellatt's Bathroom
Room Description: You are now in Sir Henry Mill Pellatt's Bathroom. The floor mat is still quite wet. Perhaps someone just took a shower. A half-empty shaving cream bottle lies on the counter, along with a toothbrush and some toothpaste.
Locked: false
Boarded: false
Items:Shaving Cream,Toothbrush,Toothpaste
Riddle:
Exit Rooms: N-Sir Henry Mill Pellatt's Bathroom
@@ -106,6 +121,7 @@ Exit Rooms: N-Sir Henry Mill Pellatt's Bathroom
Room name: Linen Closet
Room Description: A whiff of lavender-scented laundry detergent enters your nostrils as you step into a dark room. Ah, you must be in the Linen Closet. No one really comes in here other than the servants. I'm pretty sure Sir Pellatt and Lady Pellat don't even know this room exists.
Locked: false
Boarded: false
Items:Clothes
Riddle:
Exit Rooms: E-Sir Henry Mill Pellatt's Bedroom, W-Guest Bedroom, S-Willow Bedroom
@@ -113,6 +129,7 @@ Exit Rooms: E-Sir Henry Mill Pellatt's Bedroom, W-Guest Bedroom, S-Willow Bedroo
Room name: Willow Bedroom
Room Description: This is the Willow Bedroom. Pretty ordinary, if you ask me. Say, doesn't this look like the Oak Bedroom?
Locked: false
Boarded: false
Items:
Riddle:
Exit Rooms: N-Linen Closet, S-Silver Stairs (2nd Floor), W-Another Sitting Area
@@ -120,6 +137,7 @@ Exit Rooms: N-Linen Closet, S-Silver Stairs (2nd Floor), W-Another Sitting Area
Room name: Silver Stairs (2nd Floor)
Room Description: You are now in the Silver Stairs on the second floor. The bottom of the stairs is blocked by a door. Looks like you need to have something in order to open it. Better find it quick!
Locked: true
Boarded: true
Items:
Riddle:
Exit Rooms: Down-Silver Stairs (1st Floor), N-Willow Bedroom, S-Evergreen Bedroom
@@ -127,6 +145,7 @@ Exit Rooms: Down-Silver Stairs (1st Floor), N-Willow Bedroom, S-Evergreen Bedroo
Room name: Evergreen Bedroom
Room Description: Oh look! Another bedroom! How exciting! This one's walls are even green this time. Cool!
Locked: false
Boarded: false
Items:
Riddle:
Exit Rooms: N-Silver Stairs (2nd Floor), W-Aspen Bedroom
@@ -134,6 +153,7 @@ Exit Rooms: N-Silver Stairs (2nd Floor), W-Aspen Bedroom
Room name: Aspen Bedroom
Room Description: Jeez, how many bedrooms are there? It doesn't even look like anybody's slept here before. The curtains are blowing though. Could be a draft...
Locked: false
Boarded: false
Items:
Riddle:
Exit Rooms: E-Evergreen Bedroom, N-Another Sitting Area
@@ -141,6 +161,7 @@ Exit Rooms: E-Evergreen Bedroom, N-Another Sitting Area
Room name: Another Sitting Area
Room Description: You are now in Another Sitting Area. Yes, that is really its name. Sir Pellatt lacks creativity. This is quite a spectactular room, however. Sitting down for a bit, get comfortable. But not too comfortable, you need to escape.
Locked: false
Boarded: false
Items:
Riddle:
Exit Rooms: S-Apsen Bedroom, E-Willow Bedroom
@@ -148,6 +169,7 @@ Exit Rooms: S-Apsen Bedroom, E-Willow Bedroom
Room name: Guest Bedroom
Room Description: Welcome to the guest bedroom, where guests like yourself stay for the night. Except Sir Pellatt has other plans for you... It looks like there's something on the bed. Might be for you.
Locked: false
Boarded: false
Items: Scroll 2
Riddle:
Exit Rooms: E-Linen Closet, S-Another Sitting Area
@@ -155,6 +177,7 @@ Exit Rooms: E-Linen Closet, S-Another Sitting Area
Room name: Silver Stairs (1st Floor)
Room Description: Welcome to the First Floor. You made it this far, don't give up now. Quite a few doors are open down here. Someone even left a few lights on. Could be the servants.
Locked: false
Boarded: false
Items:
Riddle:
Exit Rooms: N-Study, S-Food Supply Closet, W-Supply Closet, Up-Silver Stairs (2nd Floor)
@@ -162,6 +185,7 @@ Exit Rooms: N-Study, S-Food Supply Closet, W-Supply Closet, Up-Silver Stairs (2n
Room name: Food Supply Closet
Room Description: You are now in the food supply closet. Its pretty full in here. A fridge filled with dairy such as milk, cheese, and yogurt lies in front of the far wall. Cabinets lining the side walls contain snacks such as chips, granola bars, and chocolate. Go eat something, you must be famished.
Locked: false
Boarded: false
Items:Milk,Cheese,Yogurt,Chips,Granola Bars,Chocolate
Riddle:
Exit Rooms: N-Silver Stairs (1st Floor), W-Kitchen
@@ -169,6 +193,7 @@ Exit Rooms: N-Silver Stairs (1st Floor), W-Kitchen
Room name: Kitchen
Room Description: You are in the Kitchen. The stove, toaster, and microwave along the walls are all turned off. A few pots are soaking in the sink. Warm bread rests in the oven. The sweet smell of yeast fills the room.
Locked: false
Boarded: false
Items:Warm Bread
Riddle:
Exit Rooms: E-Food Supply Closet, N-Supply Closet
@@ -176,6 +201,7 @@ Exit Rooms: E-Food Supply Closet, N-Supply Closet
Room name: Supply Closet
Room Description: You are in the Supply Closet. A mop, bucket and a few towels lay on the ground. The space is quite small and can only hold around 3 people. Nothing interesting seems to be happening in here.
Locked: false
Boarded: false
Items:Mop,Bucket,Towels
Riddle:
Exit Rooms: E-Silver Stairs (1st Floor), S-Kitchen, N-Serving and Breakfast Room
@@ -183,6 +209,7 @@ Exit Rooms: E-Silver Stairs (1st Floor), S-Kitchen, N-Serving and Breakfast Room
Room name: Serving and Breakfast Room
Room Description: You are now in the Serving and Breakfast Room. A small wood table covered in crumbs lies in the corner, surrounded by 4 chairs. On its left lies a counter with a sink and some butter. Around the counter are 5 high chairs. Looks like someone ate breakfast here earlier.
Locked: false
Boarded: false
Items:Butter
Riddle:
Exit Rooms: N-Dining Room, E-Study, S- Supply Closet
@@ -190,6 +217,7 @@ Exit Rooms: N-Dining Room, E-Study, S- Supply Closet
Room name: Dining Room
Room Description: Welcome to the Dining Room. The old wood boards squeak below you. An elegant chandelier hangs in the center of the room, although it is turned off. A gigantic long wood table sits in the center of the room with 12 cushioned chairs sitting around it. A cello rests in the corner of the room, along with a small stool and a music stand.
Locked: false
Boarded: false
Items:
Riddle:
Exit Rooms: S-Serving and Breakfast Room, E-Library, W-Conservatory
@@ -197,6 +225,7 @@ Exit Rooms: S-Serving and 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. It looks like there's a scroll on the ground. Check it out, you're running out of time.
Locked: false
Boarded: false
Items:Scroll 3
Riddle:
Exit Rooms: E-Dining Room
@@ -204,6 +233,7 @@ Exit Rooms: E-Dining Room
Room name: Library
Room Description: You are in the Library. Intricate designs are carved into the tall arced ceiling. Thousands and thousands of books stretch from the floor to the ceiling. A few blue couches with a lantern on a small side table sit in the far northwest corner of the room. An open novel with a dusty leather cover rests on the table.
Locked: false
Boarded: false
Items:Novel
Riddle:
Exit Rooms: W-Dining Room, S-Study, E-Great Hall
@@ -211,6 +241,7 @@ Exit Rooms: W-Dining Room, S-Study, E-Great Hall
Room name: Great Hall
Room Description: You are in the Great Hall. This empty room gives off an eerie feeling. On the north wall, there is a fire place that looks like it is about to burn out. I don't think someone is going to light it again.
Locked: false
Boarded: false
Items:
Riddle:
Exit Rooms: S-Entry, W-Library, E-Oak Drawing Room
@@ -218,6 +249,7 @@ Exit Rooms: S-Entry, W-Library, E-Oak Drawing Room
Room name: Oak Drawing Room
Room Description: Welcome to the Oak Drawing Room. A large red carpet covers the floor. Giant floor-to-ceiling windows face north, letting in lots of sunlight. A sword is perched on a small table in the center of the room. Interesting choice of decor...
Locked: false
Boarded: false
Items:Sword
Riddle:
Exit Rooms: W-Great hall, S-Smoking Room
@@ -225,6 +257,7 @@ Exit Rooms: W-Great hall, S-Smoking Room
Room name: Smoking Room
Room Description: You are now in the Smoking Room. This room is too fancy for its purpose if you ask me. I don't see why the fireplace or deer heads are necessary. A leather couch faces the fireplace, and a fur blanket hangs over it.
Locked: false
Boarded: false
Items:Blanket
Riddle:
Exit Rooms: N-Oak Drawing Room, S-Billiard Room, W-Entry
@@ -232,6 +265,7 @@ Exit Rooms: N-Oak Drawing Room, S-Billiard Room, W-Entry
Room name: Billards Room
Room Description: You are in the Billiard Room. The only thing in this room would be the pool table in the center. There aren't any balls or poles around though, so I guess no game today!
Locked: false
Boarded: false
Items:
Riddle:
Exit Rooms: N-Smoking Room
@@ -239,6 +273,7 @@ Exit Rooms: N-Smoking Room
Room name: Entry
Room Description: Welcome to the entrance of Casa Loma. This is where you escape! Oh wait, that door is bolted shut. Plus, it doesn't even have a lock! Shucks, how will you get out now???
Locked: true
Boarded: true
Items:
Riddle:
Exit Rooms: E-Smoking Room, N-Great Hall, W-Study
@@ -246,6 +281,7 @@ Exit Rooms: E-Smoking Room, N-Great Hall, W-Study
Room name: Study
Room Description: You are now in the Study. The south wall has a floor-to-ceiling book shelf, towering over you. A big wooden desk, along with a cushioned chair, face the entrance. 2 lit candles illuminate the desk, and a key is visible.
Locked: false
Boarded: false
Items:Key
Riddle:
Exit Rooms: N-Library, E-Entry, W-Serving and Breakfast Room

View File

@@ -39,4 +39,5 @@ aid, help
benefit, help
scram, go
hightail, go
everything, all
everything, all
drink, eat

View File

@@ -60,6 +60,9 @@ class Game {
// Read the locked state
boolean locked = Boolean.parseBoolean(roomScanner.nextLine().split(":")[1].replaceAll("<br>", "\n").trim());
room.setLocked(locked);
// Read the boarded state
boolean boarded = Boolean.parseBoolean(roomScanner.nextLine().split(":")[1].replaceAll("<br>", "\n").trim());
room.setBoarded(boarded);
// Read the Items
String items = roomScanner.nextLine();
try {
@@ -276,6 +279,31 @@ class Game {
System.out.println("In what direction do you want to go in?");
}else {
System.out.println("What do you want to open the door with?");
}
boolean hasCrowbar = false;
for(int i =0; i<player.getInventory().size(); i++) {
if(player.getInventory().get(i).equals(new Crowbar())) {
hasCrowbar = true;
break;
}
}
if(command.hasDirection() && hasCrowbar) {
Room nextRoom = currentRoom.nextRoom(command.getDirection());
try {
if(nextRoom.getBoarded()) {
nextRoom.setBoarded(false);
player.removeFromInventory(new Crowbar());
System.out.println("With great effort, you pry the boards off the door with the crowbar! However, it breaks and is no longer useable.");
}else{
System.out.println("That door is already unlocked!");
}
}catch(Exception e) {
System.out.println("There is no door there!");
}
}else if(!command.hasDirection()){
}else {
}
break;
case "go": case "n": case "s": case "e": case "w": case "north": case "south": case "west": case "east": case "up": case "down": case "d": case "u":
@@ -515,8 +543,11 @@ class Game {
Room nextRoom = currentRoom.nextRoom(direction);
if (nextRoom == null)
System.out.println("There is no door!");
else if(nextRoom.getLocked() && nextRoom.getBoarded()) {
System.out.println("The door is locked and boarded shut. You need to find a key and crowbar to open it.");
}
else if(nextRoom.getLocked()) {
System.out.println("The door is locked. You need to find a key to open it.");
System.out.println("The door is locked. You need a key to open it.");
}
else {
currentRoom = nextRoom;

View File

@@ -27,6 +27,7 @@ class Room {
private ArrayList<Item> items;
private Riddle riddle;
private boolean locked;
private boolean boarded;
/**
* Create a room described "description". Initially, it has no exits.
@@ -49,10 +50,16 @@ class Room {
public void setLocked(boolean b) {
locked = b;
}
public void setBoarded(boolean b) {
boarded = b;
}
public boolean getLocked() {
return locked;
}
public boolean getBoarded() {
return boarded;
}
public void setExit(char direction, Room r) throws Exception {
String dir = "";