Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import acm.util.RandomGenerator;
- import java.util.Scanner;
- public class textw {
- public static boolean sword=false;
- public static boolean armor=false;
- public static boolean coin=false;
- public static boolean Document=false;
- public static boolean Documenttwo=false;
- public static boolean BabyHippo=false;
- public static void main(String[] args){
- System.out.println("Welcome to Attack of the hippos v1.1 (there is currently only one main story line to follow)");
- System.out.println("You can not use caps in this game");
- System.out.println("");
- levelone();
- }
- private static RandomGenerator rgen = RandomGenerator.getInstance();
- private static String getinput() {
- Scanner keyboard= new Scanner(System.in);
- String input= keyboard.nextLine();
- return input;
- }
- private static void levelzero(){
- System.out.println("Thank you for playing Revenge of the Hippos. ");
- System.out.println("");
- System.out.println("This game has been coded by Alexander Chow with the help of TA Richard, and the rest of DMA. :) ");
- System.out.println("");
- System.out.println("To retry the game please type in [Restart]");
- String playerinput=getinput();
- if (playerinput.equalsIgnoreCase("Restart")){
- sword=false;
- Document=false;
- Documenttwo=false;
- levelone();
- }
- else{
- System.out.println("");
- System.out.println("");
- System.out.println("Thanks for coming, we hope to see you again!");
- }
- }
- private static void levelone() {
- System.out.println("You are in the ruins of your village");
- System.out.println("A village elder explains that Rampaging hipos have destroyed your village, and that he needs you to come talk when ready.");
- String playerinput=getinput(); // setting our variable, playerinput, of type String, to what the player types in
- System.out.println(playerinput);
- if(playerinput.contains("talk")){
- System.out.println("Village elder: I need you to go Hearl city and ask for aid.");
- leveltwo();
- }
- else if (playerinput.contains("ready")){
- System.out.println("Village elder: I need you to go to Hearl city and ask for aid.");
- leveltwo();
- }
- else if(playerinput.contains("leveltwentyone")){
- leveltwentyone();
- }
- else{
- System.out.println("Invalid move, you bumbling buffoon.");
- levelone();
- }
- }
- private static void leveltwo() {
- System.out.println("You exit the village entering a grassy field");
- System.out.println("You see a cross road runs throug the path showing 3 directions: South,North(Hearl city) and West");
- String playerinput=getinput();
- if
- (playerinput.equalsIgnoreCase("North")){
- levelthree();
- }
- else if
- (playerinput.equalsIgnoreCase("West")){
- levelfour();
- }
- else if
- (playerinput.equalsIgnoreCase("South")){
- levelsix();
- }
- else{
- System.out.println("Invalid move, you bumbling buffoon.");
- leveleight();
- }
- }
- private static void levelthree() {
- System.out.println("Heading north you arive at the gates of the city of Hearl.");
- String playerinput=getinput();
- if(playerinput.contains("enter")){
- System.out.println("Guard:Only those with the proper documents may pass.");
- if (Document == true){
- System.out.println("Guard: Oh you have them, you may pass");
- leveltwentythree();
- }
- if (Documenttwo == true) {
- System.out.println("Guard: Oh you have them, you may pass");
- leveltwentyfour();
- }
- else {
- System.out.println("Guard: You have no papers, SCRAM!");
- leveleight();
- }
- }
- else if
- (playerinput.contains("south")){
- leveleight();
- }
- else{
- System.out.println("Invalid move, you bumbling buffoon");
- levelthree();
- }
- }
- private static void levelfour() {
- System.out.println("You arive in a open plain");
- System.out.println("Either Explore or leave");
- String playerinput=getinput();
- if (playerinput.contains("explore")){
- System.out.println(" you find a man fighting a ugly looking hippo.");
- System.out.println("Either aid him or flee");
- leveltwentyfive();
- }
- else if(playerinput.contains("leave")){
- System.out.println("You leave wondering what you could have found");
- leveleight();
- }
- else{
- System.out.println("Invalid move, you bumbling buffoon.");
- levelfour();
- }
- }
- private static void levelfive() {
- System.out.println("Fallen Man: I tracked the beast after it attacked my village, south of the crossroads.");
- System.out.println("Fallen Man: Please let them know where I am");
- System.out.println("");
- System.out.println("You recieved Quest:Help me");
- leveleight();
- }
- private static void levelsix() {
- System.out.println("Heading south you find a rocky canyon entrance that has been blocked by a boulder.");
- System.out.println("search around for a way around or leave?");
- String playerinput=getinput();
- if (playerinput.contains("leave")){
- leveleight();
- }
- else {
- System.out.println("You find nothing while searching.");
- levelseven();
- }
- }
- private static void levelseven() {
- System.out.println("Keep searching or leave?");
- String playerinput=getinput();
- if(playerinput.contains("searching")){
- System.out.println("You find a small cave entrance and enter it");
- levelnine();
- }
- else{
- System.out.println("You give up heading back.");
- levelnine();
- }
- }
- private static void leveleight() {
- System.out.println("You see a cross road runs throug the path showing 3 directions: South,North and West");
- String playerinput=getinput();
- if
- (playerinput.equalsIgnoreCase("North")){
- levelthree();
- }
- else if
- (playerinput.equalsIgnoreCase("West")){
- levelfour();
- }
- else if
- (playerinput.equalsIgnoreCase("South")){
- levelsix();
- }
- else{
- System.out.println("Invalid move, you bumbling buffoon.");
- leveleight();
- }
- }
- private static void levelnine() {
- System.out.println("Entering into the cave you quickly become entangled in the spider webs hanging every where");
- if (sword==true) {
- System.out.println("Your sword easily slices through the webs allowing you to free yourself");
- System.out.println("However the blade snaps as you finish making you sad :(");
- sword=false;
- levelten();
- }
- else {
- System.out.println("Not being able to free yourself you black out from a lack of oxygen.");
- System.out.println("Error 404:page not found.");
- levelzero();
- }
- }
- private static void levelten() {
- System.out.println("Having escaped you hurry down the tunnel and burst out onto another adbandoned cross road.");
- System.out.println("You have three options: Go up,right or left.");
- String playerinput=getinput();
- if (playerinput.contains("up")){
- System.out.println("Heading up the hill you find and climb into a old,ugly tower.");
- leveleleven();
- }
- else if (playerinput.contains("right")){
- System.out.println("Turning right you find a dead end, you turn around dejected.");
- leveltwelve();
- }
- else if (playerinput.contains("left")){
- System.out.println("In your hurry to rush around the cliff, you trip and knock yourself out. ");
- }
- }
- private static void leveleleven() {
- System.out.println("There is nothing in the tower, go away");
- levelthirteen();
- }
- private static void leveltwelve() {
- System.out.println("You come back out of the dead end feeling sad.");
- System.out.println("You have three options: Go up,right or left.");
- String playerinput=getinput();
- if (playerinput.contains("up")){
- System.out.println("Heading up the hill you find and climb into a old,ugly tower.");
- leveleleven();
- }
- else if (playerinput.contains("right")){
- System.out.println("Turning right you find a dead end, you turn around dejected.");
- leveltwelve();
- }
- else if (playerinput.contains("left")){
- System.out.println("In your hurry to rush around the cliff, you trip and knock yourself out. ");
- levelfourteen();
- }
- else {
- System.out.println("Invalid move, you bumbling buffon");
- leveltwelve();
- }
- }
- private static void levelthirteen() {
- System.out.println("You come back out of the tower feeling sad.");
- System.out.println("You have three options: Go up,right or left.");
- String playerinput=getinput();
- if (playerinput.contains("up")){
- System.out.println("Heading up the hill you find and climb into a old,ugly tower.");
- leveleleven();
- }
- else if (playerinput.contains("right")){
- System.out.println("Turning right you find a dead end, you turn around dejected.");
- leveltwelve();
- }
- else if (playerinput.contains("left")){
- System.out.println("In your hurry to rush around the cliff, you trip and knock yourself out. ");
- levelfourteen();
- }
- else {
- System.out.println("Invalid move, you bumbling buffon");
- levelthirteen();
- }
- }
- private static void levelfourteen(){
- System.out.println("You wake up in the same spot as before with a pounding head.");
- System.out.println("Either go back to sleep or try and get up");
- String playerinput=getinput();
- if (playerinput.contains("up")){
- System.out.println("You wake up from your dream and glance around, your in a small hut. ");
- System.out.println("Either leave hut or wait for something to happen");
- }
- else if (playerinput.contains("leave")){
- System.out.println("As you leave the hut a man approachs you warrily. ");
- levelfifteen();
- }
- else if (playerinput.contains("wait")){
- System.out.println("While waiting you fall back asleep");
- levelfourteen();
- }
- else {
- System.out.println("Invalid move, you bumbling buffon");
- levelfourteen();
- }
- }
- private static void levelfifteen(){
- System.out.println("The man motions you to follow him into a hut");
- System.out.println("Either follow him or make a run for it");
- String playerinput=getinput();
- if (playerinput.contains("follow")){
- System.out.println("Following the man into the hut you notice it's empty.");
- System.out.println("This is the end of this story line for now sorry :( (you must die, sorry)");
- levelzero();
- }
- else if(playerinput.contains("run")){
- System.out.println("As the man turns his back you run for the hills and disappear into the rocks.");
- levelsixteen();
- }
- else {
- System.out.println("Invalid command, you bumbling buffoon.");
- levelfifteen();
- }
- }
- private static void levelsixteen(){
- System.out.println("Exhausted you fall slumped against a pile of rocks and glance around you notice that hippo tracks are in the ground!");
- System.out.println("Either follow the tracks or follow the path out of the hills/dessert");
- String playerinput=getinput();
- if (playerinput.contains("tracks")){
- System.out.println("You follow the tracks to a hiddeon oasis when the ground suddenly gives out frome under you!");
- levelseventeen();
- }
- else if (playerinput.contains("path")){
- System.out.println("The path seems to just go on and on, eventualy you notice a small cluster of buildings and stumble towards them");
- leveltwentyone();
- }
- else {
- System.out.println("Invalid move, you bumbling buffoon.");
- levelsixteen();
- }
- }
- private static void levelseventeen(){
- System.out.println("The rocks above the oaisis your standing on collapse and send you tumbling down the hill into a group of Hippos!");
- System.out.println("");
- System.out.println("The Hippos quickly surround you and demand you to surrender. Either comply or resist ");
- String playerinput=getinput();
- if (playerinput.contains("comply")){
- System.out.println("Satisfied with your compliance the hippos put you into a cave and block it off with a boulder");
- levelnineteen();
- }
- else if(playerinput.contains("resist")){
- System.out.println("impressed with your courage the group agrees to take you to their leader");
- leveltwenty();
- }
- else{
- System.out.println("Invalid move, Do you want to die?");
- leveleighteen();
- }
- }
- private static void leveleighteen(){
- System.out.println("The hippos await your action");
- System.out.println("either surrender or resist");
- String playerinput=getinput();
- if (playerinput.contains("surrender")){
- System.out.println("Satisfied with your compliance the hippos put you into a cave and block it off with a boulder");
- levelnineteen();
- }
- else if(playerinput.contains("resist")){
- System.out.println("impressed with your courage the group agrees to take you to their leader");
- leveltwenty();
- }
- else{
- System.out.println("Invalid move, Do you want to die?");
- leveleighteen();
- }
- }
- private static void levelnineteen(){
- System.out.println("The hippos keep you alive, but you never escape. The fate of your people is now hidden from you");
- levelzero();
- }
- private static void leveltwenty() {
- System.out.println("They take you into a cave and them from there the hippos push you into a smaller off-shoot.\n there is a dark 'hippo' shape in the corner./n Hippo shaped figure: I need you to do a mission for me, if you fail it i will track you down and HUG you.");
- System.out.println("Hippo shaped figure:Your mission is to take a message to one of my contacts inside Hearl city. /n here is some Documents to get you into the city ");
- Document=true;
- leveleight();
- }
- private static void leveltwentyone(){
- System.out.println("Inside the village you find a enchanted stone, pick it up or no?");
- String playerinput=getinput();
- if (playerinput.equalsIgnoreCase("pick it up")){
- int x = rgen.nextInt(4);
- //
- if (x==0) {
- System.out.println("The stone glows red and hands you a Document!");
- Documenttwo=true;
- leveleight();}
- //
- if (x==1){
- System.out.println("Nothing happens and you are teleported back to the rocks" );
- leveltwentytwo();}
- //
- if (x==2) {
- System.out.println("The stone glows red and hands you a Document!");
- Documenttwo=true;
- leveleight();}
- //
- if (x==3){
- System.out.println("You are teleported");
- levelone();
- }
- }
- else if(playerinput.contains("no")){
- levelsixteen();
- }
- else{
- System.out.print("What did you just do??");
- leveltwentyone();
- }
- }
- //Copy of level 16 after strange stone event
- private static void leveltwentytwo(){
- System.out.println("Exhausted you fall slumped against a pile of rocks and glance around you notice that hippo tracks are in the ground!");
- System.out.println("You must follow the hipo tracks");
- String playerinput=getinput();
- if (playerinput.contains("tracks")){
- System.out.println("You follow the tracks to a hiddeon oasis when the ground suddenly gives out frome under you!");
- levelseventeen();
- }
- else {
- System.out.println("Invalid move, you bumbling buffoon.");
- levelsixteen();
- }
- }
- private static void leveltwentythree(){
- System.out.println("Thanks for enterinh Hearl city with Documents going with story line 'Heroes of the hippo' ");
- levelzero();
- }
- private static void leveltwentyfour(){
- System.out.println("Thanks for entering Hearl city with Documents going with story ling 'Heroes of man'");
- levelzero();
- }
- private static void leveltwentyfive() {
- String playerinput=getinput();
- if(playerinput.contains("aid")){
- System.out.println("You reach the man just as he collapses, you slay the hippo with his sword");
- System.out.println("You gained: The Sword!");
- sword=true;
- levelfive();
- }
- else if
- (playerinput.contains("flee")){
- System.out.println("You Escaped!");
- leveleight();
- }
- }
- private static void leveltwentsix(){
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement