From 59f51231c81738f2c8a8b238a80a7e51c6b16e35 Mon Sep 17 00:00:00 2001
From: jslightham <31053827+jslightham@users.noreply.github.com>
Date: Wed, 22 May 2019 14:44:22 -0400
Subject: [PATCH 1/3] worked on locked doors
---
data/rooms.dat | 52 ++++++++++++++++--------------
src/com/bayviewglen/zork/Game.java | 21 +++++++++++-
src/com/bayviewglen/zork/Room.java | 9 ++++++
3 files changed, 56 insertions(+), 26 deletions(-)
diff --git a/data/rooms.dat b/data/rooms.dat
index c46a8b7..e39140a 100644
--- a/data/rooms.dat
+++ b/data/rooms.dat
@@ -1,9 +1,11 @@
Room name: Circle Room
Room Description: You are in the circular room. The windows to the west are bolted shut and curtains cover them.
To the east, a hallway. A scroll hangs on the north wall. Writing is visible.
+Locked: false
Items:Lockpick
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: true
Items:
Exit Rooms: E-Circle Room, N-Porcupine Stairs (3rd Floor)
Room name: Porcupine Stairs (3rd Floor)
@@ -16,11 +18,11 @@ Items:
Exit Rooms: S-Sir Henry Mill Pellatt's Bedroom, W-Bulb Room, E-Pipe Room, Up-Porcupine Stairs (3rd Floor)
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.
-Items: Garlic
+Items:Garlic
Exit Rooms: E-Porcupine Stairs (2nd Floor), W-Lady Pellat'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.
-Items: Robes
+Items:Robes
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.
@@ -29,22 +31,22 @@ 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...
Items:
-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...
-Items:
-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...
-Items: Water bottle,Pen,Book
-Exit Rooms: S-Round Room, W-East Sitting Room
+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...
+Items:
+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...
+Items: Water bottle,Pen,Book
+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. It might be helpful later on.
-Items: Painting
+Items:Painting
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.
-Items: Socks
+Items:Socks
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.
@@ -52,15 +54,15 @@ Items:
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.
-Items: Notebook
+Items:Notebook
Exit Rooms: N-Porcupine Stairs (2nd Floor), E-Landing, S-Sir Henry Mill Pellatt's Bathroom, W-Linen Closet
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.
-Items: Shaving Cream,Toothbrush,Toothpaste
+Items:Shaving Cream,Toothbrush,Toothpaste
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.
-Items: Clothes
+Items:Clothes
Exit Rooms: E-Sir Henry Mill Pellatt's Bedroom, W-Guest Bedroom, S-Willow Bedroom
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?
@@ -92,19 +94,19 @@ Items:
Exit Rooms: N-Study, S-Food Supply Closet, W-Supply Closet, Up-Silver Stairs (2nd Floor)
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.
-Items: Milk,Cheese,Yogurt,Chips,Granola Bars,Chocolate
+Items:Milk,Cheese,Yogurt,Chips,Granola Bars,Chocolate
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.
-Items: Warm Bread
+Items:Warm Bread
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.
-Items: Mop,Bucket,Towels
+Items:Mop,Bucket,Towels
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.
-Items: Butter
+Items:Butter
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.
@@ -112,11 +114,11 @@ Items:
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.
-Items: Scroll 3
+Items:Scroll 3
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 book with a dusty leather cover rests on the table.
-Items: Book
+Items:Book
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.
@@ -124,11 +126,11 @@ Items:
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...
-Items: Sword
+Items:Sword
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.
-Items: Blanket
+Items:Blanket
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!
@@ -140,5 +142,5 @@ Items:
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.
-Items: Key
+Items:Key
Exit Rooms: N-Library, E-Entry, W-Serving and Breakfast Room
\ No newline at end of file
diff --git a/src/com/bayviewglen/zork/Game.java b/src/com/bayviewglen/zork/Game.java
index 9ad2479..7ce839b 100644
--- a/src/com/bayviewglen/zork/Game.java
+++ b/src/com/bayviewglen/zork/Game.java
@@ -54,6 +54,9 @@ class Game {
// Read the Description
String roomDescription = roomScanner.nextLine();
room.setDescription(roomDescription.split(":")[1].replaceAll("
", "\n").trim());
+ // Read the Description
+ boolean locked = Boolean.parseBoolean(roomScanner.nextLine());
+ room.setLocked(locked);
// Read the Items
String items = roomScanner.nextLine();
try {
@@ -232,7 +235,20 @@ class Game {
System.out.println("You are empty handed.");
}
break;
-
+ case "open":
+ boolean hasLockpick = false;
+ for(int i =0; i exits; // stores exits of this room.
private ArrayList- items;
+ private boolean locked;
/**
* Create a room described "description". Initially, it has no exits.
@@ -45,6 +46,14 @@ class Room {
items = new ArrayList
- ();
}
+ public void setLocked(boolean b) {
+ locked = b;
+ }
+
+ public boolean getLocked() {
+ return locked;
+ }
+
public void setExit(char direction, Room r) throws Exception {
String dir = "";
switch (direction) {
From d6ce3ea8b90fc65545b115b30476c1e93e79d114 Mon Sep 17 00:00:00 2001
From: Luca Carnegie <41924665+lcarnegie@users.noreply.github.com>
Date: Wed, 22 May 2019 22:41:31 -0400
Subject: [PATCH 2/3] created Enemy class
---
src/com/bayviewglen/zork/Entities/Enemy.java | 5 +++++
1 file changed, 5 insertions(+)
create mode 100644 src/com/bayviewglen/zork/Entities/Enemy.java
diff --git a/src/com/bayviewglen/zork/Entities/Enemy.java b/src/com/bayviewglen/zork/Entities/Enemy.java
new file mode 100644
index 0000000..fa032fe
--- /dev/null
+++ b/src/com/bayviewglen/zork/Entities/Enemy.java
@@ -0,0 +1,5 @@
+package com.bayviewglen.zork.Entities;
+
+public class Enemy {
+
+}
From cfe2f0253d1b0939cc0377a0c2290d03e0804d21 Mon Sep 17 00:00:00 2001
From: elacey
Date: Wed, 22 May 2019 22:46:57 -0400
Subject: [PATCH 3/3] All items and some item classes added
---
data/words.dat | 16 +++++++++++++++-
src/com/bayviewglen/zork/Items/Notebook.java | 8 ++++++++
src/com/bayviewglen/zork/Items/ShavingCream.java | 8 ++++++++
src/com/bayviewglen/zork/Items/Toothbrush.java | 7 +++++++
src/com/bayviewglen/zork/Items/Toothpaste.java | 8 ++++++++
5 files changed, 46 insertions(+), 1 deletion(-)
create mode 100644 src/com/bayviewglen/zork/Items/Notebook.java
create mode 100644 src/com/bayviewglen/zork/Items/ShavingCream.java
create mode 100644 src/com/bayviewglen/zork/Items/Toothbrush.java
create mode 100644 src/com/bayviewglen/zork/Items/Toothpaste.java
diff --git a/data/words.dat b/data/words.dat
index 7a4ef89..4f9020e 100644
--- a/data/words.dat
+++ b/data/words.dat
@@ -32,4 +32,18 @@ book, item
socks, item
painting, item
inventory, verb
-i, verb
\ No newline at end of file
+i, verb
+notebook, item
+shaving cream, item
+toothbrush, item
+toothpaste, item
+milk, item
+cheese, item
+yogurt, item
+chips, item
+granola bars, item
+chocolate, item
+warm bread, item
+clothes, item
+sword, item
+blanket, item
\ No newline at end of file
diff --git a/src/com/bayviewglen/zork/Items/Notebook.java b/src/com/bayviewglen/zork/Items/Notebook.java
new file mode 100644
index 0000000..3088060
--- /dev/null
+++ b/src/com/bayviewglen/zork/Items/Notebook.java
@@ -0,0 +1,8 @@
+package com.bayviewglen.zork.Items;
+public class Notebook extends Item{
+
+ public Notebook(){
+ super(15, "Notebook", "A book filled with diagrams and descriptions, belonging to Henry Pellatt", false, 50, 1);
+ }
+
+}
diff --git a/src/com/bayviewglen/zork/Items/ShavingCream.java b/src/com/bayviewglen/zork/Items/ShavingCream.java
new file mode 100644
index 0000000..a234e0c
--- /dev/null
+++ b/src/com/bayviewglen/zork/Items/ShavingCream.java
@@ -0,0 +1,8 @@
+package com.bayviewglen.zork.Items;
+public class ShavingCream extends Item{
+
+ public ShavingCream(){
+ super(16, "Shaving Cream", "A can of shaving cream with foam still around the edge of the nozzle", false, 10, 1);
+ }
+
+}
diff --git a/src/com/bayviewglen/zork/Items/Toothbrush.java b/src/com/bayviewglen/zork/Items/Toothbrush.java
new file mode 100644
index 0000000..c800ff3
--- /dev/null
+++ b/src/com/bayviewglen/zork/Items/Toothbrush.java
@@ -0,0 +1,7 @@
+package com.bayviewglen.zork.Items;
+public class Toothbrush extends Item{
+
+ public Toothbrush(){
+ super(17, "Toothbrush", "A light blue manual toothbrush stained with missing bristles after continual use", false, 5, 1);
+ }
+}
diff --git a/src/com/bayviewglen/zork/Items/Toothpaste.java b/src/com/bayviewglen/zork/Items/Toothpaste.java
new file mode 100644
index 0000000..d327255
--- /dev/null
+++ b/src/com/bayviewglen/zork/Items/Toothpaste.java
@@ -0,0 +1,8 @@
+package com.bayviewglen.zork.Items;
+public class Toothpaste extends Item{
+
+ public Toothpaste(){
+ super(18, "Toothpaste", "A half used tube of toothpaste crumpled up with little care", false, 10, 1);
+ }
+
+}