Assignment #45

Code

    /// Name: Ian Stanko
    /// Period: 5
    /// Program Name: Adventure
    /// File Name: Adventure.java
    /// Date Finished: 10/30/2015
    
    import java.util.Scanner;
    
    public class Adventure
    {
        public static void main(String[] args)
        {
            Scanner keyboard = new Scanner(System.in);
            
            String r1="", r2="", r3="",r4="", r5="", r6="", r7="";
            
            System.out.println( "Hello and welcome to the Mansion!" );
            System.out.println( "" );
            System.out.println( "There is only one posability for you to survie. Have fun!" );
            System.out.println( "" );
            System.out.println( "You open the menacing front door to find two sets of stairs! Would you like to go onto the second floor or basement? ( up or down ) " );
            System.out.print( ">" );
            r1 = keyboard.next();
            System.out.println( "" );
            
           
            if ( r1.equals("up"))
            {
                System.out.println( "You walk upstairs and you can either go right or left. To the left you can hear faint but sinister screeching. To the right there is a long hallway with                        mushroom carcasses scattered up and down it. Which one do you go to? ( left or right ) " );
                System.out.print( ">" );
                r2 =keyboard.next();
                System.out.println( "" );
                
                if ( r2.equals("right"))
                {
                    System.out.println( "You walk down the hall to find the mushroom king has become zombified. You can either confront him and try and defeat him, or you can walk into the room                        right next to you and hide. What do you do? ( fight or hide )" );
                    System.out.print( ">" );
                    r4 =keyboard.next();
                     System.out.println( "" );
                }
                    if ( r4.equals("fight"))
                       
                    {
                        System.out.println( "You grab a torch from the wall and find a can of gasoline on the floor and throw them at the zombie mushroom king thinking he doesnt like fire but                              instead he eats them and can now breathe fire. Now your screwed!");
                    }
                    else if ( r4.equals("hide"))
                       
                    {
                        System.out.println( "You quickly hide in the room to the right of you only to find its not a room at all. It is actually a portal to the fiery pits of hell that the                                 infliction must have come from! You slip and fall into the abyss of lava and die" );
                    }
            }
               
            
                    else if ( r2.equals("left"))
                {
                    System.out.println( "You walk to the left and see the door that the sounds must be coming from. Inside you find what looks like a mutated falcon with four bloody wings and its                      claws are as big as softballs. Do you stomp on the bird and kill it, or do you pick it up and see what's wrong with it. ( stomp or pick )" );
                    System.out.print( ">" );
                    r5 =keyboard.next();
                    System.out.println( "" );
                }
                        if ( r5.equals("stomp"))
                        {
                            System.out.println( "nothing happened." );
                        }
                        else if ( r5.equals("pick"))
                        {
                            System.out.println( "As you're reaching down to pick it up the falcon quickly bites off both your arms and proceeds to eat the rest of your body. " );
                        }
            
            else if( r1.equals("down"))
            {
                System.out.println( "You walk downstairs into the really spooky basement. There is a trapdoor with a lot of thumping on it to your left. To the right there is a room that has a                     distinct marking that vaguely resembles a star. Do you go through the trapdoor or do you go to the room? ( trap or room )" );
                System.out.print( ">" );
                r3 =keyboard.next();
                System.out.println( "" );
            }
                if ( r3.equals("room"))
                {
                    System.out.println( "You walk over to the room and you see a demon that must have escaped from hell and is inhabiting the mansion. Right next to you there is a machete. Do you                      run or pick up the machete and kill the demon? ( run or kill )" );
                    System.out.print( ">" );
                    r6 =keyboard.next();
                }
                    if ( r6.equals("run"))
                    {
                        System.out.println( "You try to run, but the demon closes the door and eats your face. You're now dead. " );
                    }
                    else if (r6.equals("kill"))
                    {
                        System.out.println( "You pick up the machete, but the demon spits acid onto the machete and melts it. It then eats you whole. " );
                    }
                
                else if ( r3.equals("trap"))
                {
                    System.out.println( "You go down into the trapdoor. You see an old man who is chained to a wall anad he looks very skinny. ( run or help )" );
                    System.out.print( ">" );
                    r7 =keyboard.next();
                    System.out.println( "" );
                }
                        if ( r7.equals("run"))
                        {
                            System.out.println( "You try and run, but the man looks up with astonishing speed and stares into your soul with his reptilian green eyes. You're frozen in place and                                eventually die from starvation. " );
                        }
                        else if ( r7.equals("help"))
                        {
                            System.out.println( "You walk over and see that this was once the owner of this mansion and that he must have been locked away because he treated his servants badly...                              Just kidding he's actually a cannibal and he eats your face. " );
                        }
          
    }
    }

    

Picture of the output

Assignment 45