Assignment P1; AdventureProj

Code

// Donovan Rich
// Period 6
// Choose Your Own Slightly Longer Adventure
// AdventureProj.java
// 11/17/2015

import java.util.Scanner;

public class AdventureProj { 
    
    public static void main( String[] args ) {
        
        Scanner keyboard = new Scanner(System.in);
        String action="NA", start, BG, MD, SAM, CWE, RCend, TCend, ROTend, KS, LA, W8, FLX, FLXend, TPend, KEY, CKH, Scrend, Genend, PUK, PUKend, FSM, FSMend1, FSMend2, FSMend3, CH, FD, OD, Kn, WO, CL, Knend;
        start = "You awaken in a glass box. Do you 'break' the glass, 'sit' and wait, or 'look' around?";
        BG = "You break the glass. You are now out of the glass box. Do you go down the 'creepy' hallway or open the 'metal' door?";
        MD = "You open the metal door. You are in an armory. There is a knife on the table. Pick up 'knife' or 'search' more?";
        SAM = "You search the armory more. You find a cat with explosives tied to it. Do you pick up the 'cat' or 'search' more?";
        CWE = "You pick up the explosive cat. Will you 'throw' it at the wall or 'ride' the cat into the wall? Alternatively, you may 'rip' out your own throat. If you want.";
        RCend = "You ride the cat into a wall. It blows up and your organs are thrown about the room. END";
        TCend = "You throw the cat into the wall. It blows a hole in the wall. You are able to excape through the hole. END";
        ROTend = "You rip out your throat and die. END";
        KS = "You keep searching the armory.";
        LA = "You look around the glass box. You find some keys on the ground. Pick up 'keys' or 'wait' around for a bit?";
        W8 = "You wait a little bit.";
        FLX = "You flex your magnificent muscles. Keep 'flex'ing or 'teleport' out of the building?";
        FLXend = "You flex more. You suffer from  a brain aneurysm and die. END";
        TPend = "You teleport to safety. Nice job. END";
        KEY = "You pick up the keys. Do you 'craft' a key sword with them or 'scratch' the glass walls with the keys?";
        CKH = "You craft a key hammer. Do you 'flex' your muscles for being awesome or 'break' the glass with the hammer?";
        Scrend = "You scratch the glass walls with the keys. You really showed them. You feel good about what you've done. END";
        Genend = "You eventually die of boredom and exhaustion. But mostly boredom. END";
        PUK = "You pick up the knife. Do you want to do a 'trick' with the knife or 'find' some monsters?";
        PUKend = "You do some awesome tricks. You slit your own throat by accident. You die. END";
        FSM = "You find a really cool monster. Do you want to 'fight' it or 'run'?";
        FSMend1 = "You stab it in the throat. Congratulations. You won. END";
        FSMend2 = "You have no weapon. It mauls you to death and you die. END";
        FSMend3 = "You run away. It doesn't matter what happens afterwards; you eventually die and are branded as a coward forever.";
        CH = "You enter the creepy hallway. Do you want to 'find' some monsters or go to the 'front' door?";
        FD = "You go to the front door. Do you 'knock' on it or just 'open' it?";
        OD = "You open the door. You are now outside. Do you 'walk' off into the distance or 'contemplate' your existence thus far?";
        WO = "You walk off into the distance. You look awesome. Congratulations. END";
        CL = "You contemplate your life.";
        Knend = "You knock on the door. Why would you do that? You're on the inside of the house. You die of your own stupidity. END";
        System.out.println( start );
        System.out.print( ">>   " );
        action = keyboard.next();
        if ( action.equals( "break" ) )
        {
            System.out.println( BG );
            System.out.print( ">>   " );
            action = keyboard.next();
            if ( action.equals( "creepy" ) )
            {
                System.out.println( CH );
                System.out.print( ">>   " );
                action = keyboard.next();
                if ( action.equals( "find" ) )
                {
                    System.out.println( FSM );
                    System.out.print( ">>   " );
                    action = keyboard.next();
                    if ( action.equals( "fight" ) )
                    {
                        System.out.println( FSMend2 );
                    }
                    if ( action.equals( "run" ) )
                    {
                        System.out.println( FSMend3 );
                    }
                }
                if ( action.equals( "front" ) )
                {
                    System.out.println( FD );
                    System.out.print( ">>   " );
                    action = keyboard.next();
                    if ( action.equals( "knock" ) )
                    {
                        System.out.println( Knend );
                    }
                    if ( action.equals( "open" ) )
                    {
                        System.out.println( OD );
                        System.out.print( ">>   " );
                        action = keyboard.next();
                        if ( action.equals( "walk" ) )
                        {
                            System.out.println( WO );
                        }
                        if ( action.equals( "contemplate" ) )
                        {
                            System.out.println( CL );
                            System.out.print( Genend );
                        }
                    }
                }
            }
            if ( action.equals( "metal" ) )
            {
                System.out.println( MD );
                System.out.print( ">>   " );
                action = keyboard.next();
                if ( action.equals( "knife" ) )
                {
                    System.out.println( PUK );
                    System.out.print( ">>   " );
                    action = keyboard.next();
                    if ( action.equals ( "trick" ) )
                    {
                        System.out.println( PUKend );
                    }
                    if ( action.equals ( "find" ) )
                    {
                        System.out.println( FSM );
                        System.out.print( ">>   " );
                        action = keyboard.next();
                        if ( action.equals( "fight" ) )
                        {
                            System.out.println( FSMend1 );
                        }
                        if ( action.equals( "run" ) )
                        {
                            System.out.println( FSMend3 );
                        }
                    }
                        
                }
                if ( action.equals( "search" ) )
                {
                    System.out.println( SAM );
                    System.out.print( ">>   " );
                    action = keyboard.next();
                    if ( action.equals( "search" ) )
                    {
                        System.out.println( KS );
                        System.out.println( Genend );
                    }
                    if ( action.equals( "cat" ) )
                    {
                        System.out.println( CWE );
                        System.out.print( ">>   " );
                        action = keyboard.next();
                        if ( action.equals( "throw" ) )
                        {
                            System.out.println( TCend );
                        }
                        if ( action.equals( "ride" ) )
                        {
                            System.out.println( RCend );
                        }
                        if ( action.equals( "rip" ) )
                        {
                            System.out.println( ROTend );
                        }
                    }
                    
                }
                
            }
        }
        if ( action.equals( "sit" ) )
        {
            System.out.println( Genend );
        }
        if ( action.equals( "look" ) )
        {
            System.out.println( LA );
            System.out.print( ">>   " );
            action = keyboard.next();
            if ( action.equals( "wait" ) )
            {
                System.out.println( W8 );
                System.out.print( Genend );
            }
            if ( action.equals( "keys" ) )
            {
                System.out.println( KEY );
                System.out.print( ">>   " );
                action = keyboard.next();
                if ( action.equals( "scratch" ) )
                {
                    System.out.println( Scrend );
                }
                if ( action.equals( "craft" ) )
                {
                    System.out.println( CKH );
                    System.out.print( ">>   " );
                    action = keyboard.next();
                    if ( action.equals( "flex" ) )
                    { 
                        System.out.println( FLX );
                        System.out.print( ">>   " );
                        action = keyboard.next();
                        if ( action.equals( "flex" ) )
                        {
                            System.out.println( FLXend );
                        }
                        if ( action.equals( "teleport" ) )
                        {
                            System.out.println( TPend );
                        }
                        
                    }
                }
            }
        }
    }
}
        
        
        

Picture of the output

Assignment P1