Skip to content

Commit

Permalink
Merge pull request #26 from Isratosh/ragoola-dev
Browse files Browse the repository at this point in the history
FINISHING THE GAME!
  • Loading branch information
ragoolaman committed Jan 17, 2016
2 parents 7770b46 + fa7f606 commit f6f76fd
Show file tree
Hide file tree
Showing 7 changed files with 314 additions and 95 deletions.
3 changes: 2 additions & 1 deletion Character.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,13 @@ public String getConvText()
{
return convText;
}
public void talkTo()
public String talkTo()
{
if(questText != null)
{
offering = true;
}
return convText;
}
public void acceptQuest()
{
Expand Down
17 changes: 8 additions & 9 deletions Dungeon.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ public class Dungeon {
public static final int RAT = 0;
public static final int DOOR = 1;
public static final int SKULL = 2;
public static final int KNIFE = 3;
public static int newVar1;
public static String placeToGo = "house";

Expand All @@ -18,25 +19,19 @@ public class Dungeon {
private Item rat;
private Item door;
private Item skull;
private Item key;
private Item knife;

/**
* @param args
*/
public static void setup()
{
theDungeon = new Dungeon();
theDungeon.items = new Item[3];
theDungeon.items = new Item[4];
theDungeon.generateItems();
}
public static void main(String[] args) {
// TODO Auto-generated method stub
//theDungeon = new Dungeon();
//theDungeon.items = new Item[3];
//theDungeon.generateItems();
//System.out.println(getItemShortDescs()); //temp
//System.out.println(getItemLongDescs()); //temp
//System.out.println(getSpecItem(2).getLongDesc()); //temp

}

public static String getItemLongDescs()
Expand Down Expand Up @@ -88,6 +83,8 @@ public static Item getSpecItem(String newVar)
case "skull":
newVar1 = 2;
break;
case "knife":
newVar1 = 3;
}
return theDungeon.items[newVar1];
}
Expand All @@ -101,9 +98,11 @@ private void generateItems()
rat = new Item("Rats", "Many rats squeaking in your cell.", "Huge rats lurk in the shadows, hopefully they aren't diseased.", "kick rat", "You killed it! The other rats hissed enragedly, and run away", "");
door = new Item("Door", "A door made of iron bars", "A large door crafted of mid sized iron bars, they seem rusting and weak.", "bend bars", "You've bent the bars! Now you can leave, but better hurry! You don't want to get caught!", "");
skull = new Item("Skulls", "Some skulls are on the floors", "The old white skulls appear to have been there for years, you shiver and wonder what killed it.", "unlock chest", "", "");
knife = new Item("Knife", "Micheal's knife, once you take it you can leave!", "An old adorned knife, perhaps the finest you've ever seen.", "take knife", "You shove the knife into your belt. now, to get out of here...", "");
items[RAT] = rat; // 0
items[DOOR] = door; // 1
items[SKULL] = skull; // 2
items[KNIFE] = knife;
}

}
20 changes: 7 additions & 13 deletions House.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,7 @@ public static void setup()
theHouse.generateItems();
}
public static void main(String[] args) {
// TODO Auto-generated method stub
//house = new House();
//house.items = new Item[4];
//house.generateItems();
//System.out.println(getItemShortDescs()); //temp
//System.out.println(getItemLongDescs()); //temp
//System.out.println(getSpecItem(2).getLongDesc()); //temp

}

public static String getItemLongDescs()
Expand Down Expand Up @@ -123,14 +117,14 @@ public static Item itemUsed(int index)

private void generateItems()
{
doorMat = new Item("Doormat", "There is a doormat next to the exit.", "It is an old looking doormat with the words \"Welcome\" written on it. You don't know why it is on the inside of the door.", "look under mat", "You found the key, do you take it?\n", "");
doorMat = new Item("Doormat", "There is a doormat next to the exit.", "It is an old looking doormat with the words \"Welcome\" written on it. You don't know why it is on the inside of the door.", "look under mat", "You found the silver key, do you take it?\n", "");
table = new Item("Table", "There is a wooden table across from the door.", "It is a rickety old wooden table. One of the legs is shorter than the rest.", "", "", "");
chest = new Item("Chest", "A large wooden chest sits in the corner.", "A wooden chest covered in dust with a large iron lock on the front. You don't know what's inside of it, and you don't remember where you left the key.", "unlock chest", "The chest creaks open, you look into the darkness and see a sword, poison, and a gold key! do you take them?\n", "");
goldKey = new Item("GoldKey", "", "", "take gold key", "You found the gold key! It should fit in the door!\n", "");
silverKey = new Item("SilverKey", "", "A small key, too small for the door, but big enough for the chest.", "take key", "You found the silver key! It should fit in the chest...\n", "");
book = new Item("Book", "An old book sits open on top of the table, inviting you to read it.", "A dusty, old looking book with the spine falling off. You get the distinct feeling that you should read it.", "read book", "The title of the book is \"To Kill a King\" It was written by Prince Ragoolaman\nChapter 1: The Games Begin\nThe controls are simply your keyboard. What the game tells you doesn't provide rigid options. You type things that you think could work, and if they don't you will be notified.\nThe commands are as follows. To return to the main menu, simply type \"/exit\" And to get vague hints one just needs to type \"/help\"\nThe remainder of the princes novel has been ripped out, hence the broken spine.\nAll that remains past the first chapter is the final page, it has the words \"Meet me at the castle when you arrive. regards, P.R. \nP.S. I left your key under the doormat!\" scrawled into it.\n \nYou can't remember who P.R. is, but you feel like they is important, and that you should meet them with all haste!\nYou suddenly remember that you leave your house by typing \"leave (destination)\"however, you shouldn't leave here without your sword... Now where did you leave it again?\n", "");
poison = new Item("Poison", "", "", "take poison", "You picke up the poison, maybe it will become useful on your mission. You put it in your belt.\n ", "");
sword = new Item("Sword", "", "", "take sword", "You picked up your sword, you strap its sheath to your belt.\n", "");
goldKey = new Item("GoldKey", "You are missing the gold key to the door.", "", "take gold key", "You found the gold key! It should fit in the door!\n", "");
silverKey = new Item("SilverKey", "You are missing the silver key to the chest.", "A small key, too small for the door, but big enough for the chest.", "take key", "You found the silver key! It should fit in the chest...\n", "");
book = new Item("Book", "An old book sits open on top of the table, inviting you to read it.", "A dusty, old looking book with the spine falling off. You get the distinct feeling that you should read it.", "read book", "The title of the book is \"To Kill a King\" It was written by Prince Ragoolaman\nChapter 1: The Games Begin\nThe controls are simply your keyboard. What the game tells you doesn't provide rigid options. You type things that you think could work, and if they don't you will be notified.\nThe commands are as follows. To return to the main menu, simply type \"/exit\" And to get vague hints one just needs to type \"/help\"\nThe remainder of the princes novel has been ripped out, hence the broken spine.\nAll that remains past the first chapter is the final page, it has the words \"Meet me at the castle when you arrive. regards, P.R. \nP.S. I left your key under the doormat!\" scrawled into it.\n \nYou can't remember who P.R. is, but you feel like they is important, and that you should meet them with all haste!\nYou suddenly remember that you leave your house by typing \"/go (destination)\" You can also use \"accept (name)\" to accept quests! However, you shouldn't leave here without your sword... Now where did you leave it again?\n", "");
poison = new Item("Poison", "you are missing your poison.", "", "take poison", "You picke up the poison, maybe it will become useful on your mission. You put it in your belt.\n ", "");
sword = new Item("Sword", "you are missing your sword.", "", "take sword", "You picked up your sword, you strap its sheath to your belt.\n", "");
items[DOORMAT] = doorMat; // 0
items[TABLE] = table; // 1
items[CHEST] = chest; // 2
Expand Down
Loading

0 comments on commit f6f76fd

Please sign in to comment.