This commit is contained in:
Luca Carnegie
2019-05-29 13:43:06 -04:00
12 changed files with 136 additions and 31 deletions

View File

@@ -1,13 +1,15 @@
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. You spot a man in a tailored suit.
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
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.
Room Description: You are in an empty hallway. Many closed doors surround you. To the east is the Circle Room and north is the Porcupine Stairs. The door to the stairs is locked and there is not key.
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,13 +33,15 @@ 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
Exit Rooms: E-Porcupine Stairs (2nd Floor), W-Lady Pellatt's Bedroom, S-Linen Closet
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,13 +57,15 @@ 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
Items:
Boarded: false
Items:Clock,Lightbulb,Keyboard
Riddle:
Exit Rooms: W-Porcupine Stairs (2nd Floor), S-Landing, N-East Sitting Room, E-Round Room
Room name: Round Room
Room Description: You are now into the Round Room. Nothing is out of the ordinary in here...
Room Description: You are now in 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,20 +73,23 @@ 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
Items: Water bottle,Pen,Book
Boarded: false
Items:Water bottle,Pen,Book
Riddle:
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.
Room Description: Welcome to the East Sitting Room. Boring name for a 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
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.
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.
Locked: false
Boarded: false
Items:Socks
Riddle:
Exit Rooms: N-Round Room, W-Landing
@@ -85,13 +97,15 @@ 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
Exit Rooms: W-Sir Henry Mill Pellatt's Bedroom, E-Oak Bedroom, N-Pipe Room
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,20 +121,23 @@ 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
Exit Rooms: E-Sir Henry Mill Pellatt's Bedroom, W-Guest Bedroom, S-Willow Bedroom, N-Bulb Room
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
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!
Room Description: Congratulations! You made it to the Silver Stairs. The bright staircase will light your way towards the first floor.
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,27 +153,31 @@ 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
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.
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. Sit down for a bit, get comfortable. But not too comfortable, you need to escape before Sir Pellatt finds you!
Locked: false
Boarded: false
Items:
Riddle:
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.
Room Description: Welcome to the guest bedroom, where guests like yourself stay for the night. There is faint writing on the west wall. You might want to take a look...
Locked: false
Items: Scroll 2
Riddle:
Exit Rooms: E-Linen Closet, S-Another Sitting Area
Boarded: false
Items:
Riddle: "What are the next 3 letters in this sequence: o,t,t,f,f,s,s?", "e,n,t"
Exit Rooms: E-Linen Closet, S-Another Sitting Area, N-Lady Pellatt's Bedroom
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.
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 although it could just 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,13 +185,15 @@ 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
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.
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 and 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,27 +209,31 @@ 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
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
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.
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 faint writing on the south wall.
Locked: false
Items:Scroll 3
Riddle:
Boarded: false
Items:
Riddle: "Marking mortal privation, when firmly in place. An enduring summation, inscribed in my face. What am I?", "tombstone"
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,13 +241,15 @@ 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
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...
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. What an interesting choice of decor...
Locked: false
Boarded: false
Items:Sword
Riddle:
Exit Rooms: W-Great hall, S-Smoking Room
@@ -225,20 +257,23 @@ 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
Room name: Billards Room
Room name: Billiard 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
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???
Room Description: CONGRATULATIONS!!! You have escaped alive! I guess Sir Pellatt will have to find another victim tomorrow.
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

@@ -58,4 +58,7 @@ i, verb
unlock, verb
drop, verb
henrypellatt, enemy
attack, verb
attack, verb
clock, item
keyboard, item
lightbulb, item

View File

@@ -62,6 +62,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 {
@@ -279,6 +282,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":
@@ -517,8 +545,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

@@ -3,7 +3,7 @@ package com.bayviewglen.zork.Items;
public class Base extends Item{
public Base(){
super(5, "Base", "A base for an ancient battering ram", false, 100, 1);
super(5, "Base", "A base for an ancient battering ram", false, 100, 30);
}
}

View File

@@ -0,0 +1,9 @@
package com.bayviewglen.zork.Items;
public class Clock extends Item{
public Clock() {
super(34, "Clock", "An antique clock that is no longer working is propped up against the wall", false, 20, 10);
}
}

View File

@@ -2,7 +2,7 @@ package com.bayviewglen.zork.Items;
public class Cylinder extends Item{
public Cylinder(){
super(6, "Cylinder", "A part of a battering ram meant to lay on the base and have a point attatched to the end", false, 100, 1);
super(6, "Cylinder", "A part of a battering ram meant to lay on the base and have a point attatched to the end", false, 100, 30);
}
}

View File

@@ -0,0 +1,9 @@
package com.bayviewglen.zork.Items;
public class Keyboard extends Item{
public Keyboard() {
super(36, "Keyboard", "An unplugged keyboard for a desktop computer is neatly placed by a wall", false, 20, 10);
}
}

View File

@@ -0,0 +1,9 @@
package com.bayviewglen.zork.Items;
public class Lightbulb extends Item{
public Lightbulb() {
super(35, "Lightbulb", "An incandescent light bulb rolls around on the floor", false, 20, 5);
}
}

View File

@@ -2,7 +2,7 @@ package com.bayviewglen.zork.Items;
public class Point extends Item{
public Point() {
super(7, "Point", "A part of the battering ram that is attatched to the cylinder and smashes the door", false, 100, 1);
super(7, "Point", "A part of the battering ram that is attatched to the cylinder and smashes the door", false, 100, 30);
}
}

View File

@@ -2,7 +2,7 @@ package com.bayviewglen.zork.Items;
public class Sword extends Item{
public Sword(){
super(33, "Sword", "A steel, double-edged sword which seems to have been sharpened recently", 20, 20);
super(33, "Sword", "A steel, double-edged sword which seems to have been sharpened recently", 50, 30);
}
}

View File

@@ -29,6 +29,7 @@ class Room {
private ArrayList<Item> items;
private Riddler riddler;
private boolean locked;
private boolean boarded;
/**
* Create a room described "description". Initially, it has no exits.
@@ -51,10 +52,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 = "";