Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -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 let in just enough light to see.<br>There seems to be some writing on the wall.
|
||||
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
|
||||
@@ -7,7 +7,7 @@ Riddle: "Who is never hungry during Christmas?", "The turkey because he is alway
|
||||
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:
|
||||
@@ -36,7 +36,7 @@ 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.
|
||||
@@ -57,13 +57,13 @@ 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:
|
||||
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:
|
||||
@@ -73,13 +73,13 @@ 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
|
||||
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
|
||||
@@ -87,7 +87,7 @@ 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
|
||||
@@ -100,7 +100,7 @@ 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.
|
||||
@@ -124,7 +124,7 @@ 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?
|
||||
@@ -135,7 +135,7 @@ 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:
|
||||
@@ -159,7 +159,7 @@ 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:
|
||||
@@ -167,15 +167,15 @@ 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... There is faint writing on the west wall. Might want to take a look...
|
||||
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
|
||||
Boarded: false
|
||||
Items: Scroll 2
|
||||
Riddle: "What letter comes next in this sequence: o,t,t,f,f?", "s"
|
||||
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:
|
||||
@@ -191,7 +191,7 @@ 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
|
||||
@@ -212,7 +212,7 @@ 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.
|
||||
@@ -223,11 +223,11 @@ 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
|
||||
Boarded: 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
|
||||
@@ -247,7 +247,7 @@ 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
|
||||
@@ -262,7 +262,7 @@ 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
|
||||
@@ -271,7 +271,7 @@ 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:
|
||||
|
||||
@@ -29,13 +29,14 @@ class Command {
|
||||
private ArrayList<String> otherWords;
|
||||
private String item;
|
||||
private String enemy;
|
||||
private String riddler;
|
||||
|
||||
/**
|
||||
* Create a command object. First and second word must be supplied, but
|
||||
* either one (or both) can be null. The command word should be null to
|
||||
* indicate that this was a command that is not recognised by this game.
|
||||
*/
|
||||
public Command(String firstWord, ArrayList<String> otherWords, String direction, String item, String enemy) {
|
||||
public Command(String firstWord, ArrayList<String> otherWords, String direction, String item, String enemy, String riddler) {
|
||||
commandWord = firstWord;
|
||||
this.otherWords = otherWords;
|
||||
this.direction = direction;
|
||||
@@ -53,6 +54,7 @@ class Command {
|
||||
this.direction = "down";
|
||||
this.item = item;
|
||||
this.enemy = enemy;
|
||||
this.riddler = riddler;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -104,6 +106,9 @@ class Command {
|
||||
}
|
||||
public String getEnemy() {
|
||||
return enemy;
|
||||
}
|
||||
public boolean hasRiddler() {
|
||||
|
||||
}
|
||||
public boolean hasEnemy() {
|
||||
return !enemy.equals("");
|
||||
|
||||
@@ -16,8 +16,7 @@ import java.util.Scanner;
|
||||
*/
|
||||
class CommandWords {
|
||||
// a constant array that holds all valid command words
|
||||
private static HashMap<String, String> m_words = new HashMap<String, String>();
|
||||
private static HashMap<String, String> m_synonyms = new HashMap<String, String>();
|
||||
private static HashMap<String, String> m_words = new HashMap<String, String>();;
|
||||
/**
|
||||
* Constructor - initialise the command words.
|
||||
*/
|
||||
@@ -34,18 +33,6 @@ class CommandWords {
|
||||
}catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
try {
|
||||
Scanner in = new Scanner(new File("data/synonyms.dat"));
|
||||
while(in.hasNext()){
|
||||
String text = in.nextLine();
|
||||
String[] textarr = text.split(",");
|
||||
m_synonyms.put(textarr[0], textarr[1].substring(1));
|
||||
}
|
||||
in.close();
|
||||
}catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -95,16 +82,4 @@ class CommandWords {
|
||||
}
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
public static String replaceSynonym(String word) {
|
||||
try {
|
||||
String words = m_synonyms.get(word);
|
||||
if(words == null)
|
||||
throw new Exception();
|
||||
else
|
||||
return words;
|
||||
} catch(Exception e) {
|
||||
return word;
|
||||
}
|
||||
}
|
||||
}
|
||||
27
src/com/bayviewglen/zork/Entities/Riddle.java
Normal file
27
src/com/bayviewglen/zork/Entities/Riddle.java
Normal file
@@ -0,0 +1,27 @@
|
||||
package com.bayviewglen.zork.Entities;
|
||||
|
||||
public class Riddle {
|
||||
private String question;
|
||||
private String answer;
|
||||
|
||||
public Riddle() {
|
||||
this.question = "The quick brown fox jumped over the lazy dog";
|
||||
this.answer = "Okay";
|
||||
}
|
||||
|
||||
public Riddle(String question, String answer) {
|
||||
this.question = question;
|
||||
this.answer = answer;
|
||||
}
|
||||
|
||||
public String getQuestion() {
|
||||
return question;
|
||||
}
|
||||
|
||||
public String getAnswer() {
|
||||
return answer;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
13
src/com/bayviewglen/zork/Entities/Riddler.java
Normal file
13
src/com/bayviewglen/zork/Entities/Riddler.java
Normal file
@@ -0,0 +1,13 @@
|
||||
package com.bayviewglen.zork.Entities;
|
||||
|
||||
public class Riddler extends Entity {
|
||||
Riddle riddle;
|
||||
String message;
|
||||
|
||||
public Riddler(double health, double hunger, Riddle riddle) {
|
||||
super(health, hunger);
|
||||
this.riddle = riddle;
|
||||
this.message = "I can help you in your quest, but only if you answer my riddle.";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -7,6 +7,8 @@ import java.util.HashMap;
|
||||
import java.util.Scanner;
|
||||
|
||||
import com.bayviewglen.zork.Entities.Player;
|
||||
import com.bayviewglen.zork.Entities.Riddle;
|
||||
import com.bayviewglen.zork.Entities.Riddler;
|
||||
import com.bayviewglen.zork.Entities.Enemies.Enemy;
|
||||
import com.bayviewglen.zork.Items.*;
|
||||
|
||||
@@ -80,8 +82,9 @@ class Game {
|
||||
try {
|
||||
String question = riddle.split(",")[0].trim().substring(1, riddle.split(",")[0].length()-1).replaceAll("<comma>", ",");
|
||||
String answer = riddle.split(",")[1].trim().substring(1, riddle.split(",")[1].length()-2).replaceAll("<comma>", ",");
|
||||
Riddle r = new Riddle(question, answer);
|
||||
room.addRiddle(r);
|
||||
Riddle riddleObj = new Riddle(question, answer);
|
||||
Riddler butler = new Riddler(100, 100, riddleObj);
|
||||
room.addRiddler(butler);
|
||||
}catch(Exception e) {
|
||||
}
|
||||
|
||||
@@ -357,6 +360,8 @@ class Game {
|
||||
System.out.println("Eat what?");
|
||||
}
|
||||
break;
|
||||
case "talk":
|
||||
|
||||
case "take":
|
||||
boolean hasAll = false;
|
||||
for(String a : command.getOtherWords()) {
|
||||
@@ -508,9 +513,6 @@ class Game {
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case "read":
|
||||
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
package com.bayviewglen.zork.Items;
|
||||
|
||||
public class Riddle extends Item{
|
||||
private String question;
|
||||
private String answer;
|
||||
|
||||
public Riddle() {
|
||||
super(36, "Riddle", "A faded engraving on the wall. It may help you, or hurt you.", false, 0, 0);
|
||||
this.question = "The quick brown fox jumped over the lazy dog";
|
||||
}
|
||||
|
||||
public Riddle(String question, String answer) {
|
||||
super(36, "Riddle", "A faded engraving on the wall. It may help you, or hurt you.", false, 0, 0);
|
||||
this.question = question;
|
||||
this.answer = answer;
|
||||
}
|
||||
|
||||
public String getQuestion() {
|
||||
return question;
|
||||
}
|
||||
|
||||
public String getAnswer() {
|
||||
return answer;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -36,6 +36,7 @@ class Parser {
|
||||
String direction = "";
|
||||
String item = "";
|
||||
String enemy = "";
|
||||
String
|
||||
boolean open = false;
|
||||
//String word2;
|
||||
ArrayList<String> words = new ArrayList<String>();
|
||||
|
||||
@@ -18,6 +18,8 @@ import java.util.Set;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
|
||||
import com.bayviewglen.zork.Entities.*;
|
||||
import com.bayviewglen.zork.Items.*;
|
||||
|
||||
class Room {
|
||||
@@ -25,7 +27,7 @@ class Room {
|
||||
private String description;
|
||||
private HashMap<String, Room> exits; // stores exits of this room.
|
||||
private ArrayList<Item> items;
|
||||
private Riddle riddle;
|
||||
private Riddler riddler;
|
||||
private boolean locked;
|
||||
private boolean boarded;
|
||||
|
||||
@@ -93,8 +95,8 @@ class Room {
|
||||
/*
|
||||
* Assigns a Riddle object to the Room
|
||||
*/
|
||||
public void addRiddle(Riddle riddle) {
|
||||
this.riddle = riddle;
|
||||
public void addRiddler(Riddler riddler) {
|
||||
this.riddler = riddler;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user