Advertisement
Guest User

Sean Grady/Billy Winters Computer Science final project 2018

a guest
Jun 14th, 2018
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 19.08 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Final {
  4.  
  5.     public static void main(String[] args) {
  6.         boolean RMC = false;
  7.         boolean RMC2 = false;
  8.         boolean RMC3 = false;
  9.         boolean win = false;
  10.         System.out.println("Enter You Name");
  11.         Scanner input = new Scanner(System.in);
  12.         String name = input.nextLine();
  13.         System.out.println ("Hello " + name + ", Welcome to my testing lab. Good luck");
  14.         System.out.println("You wake up inside a testing lab and noice 3 different doors");
  15.         int RM = 0;
  16.         if (RM == 0)
  17.    
  18.    
  19.         {
  20.             System.out.println("Door 1, Has the face of a serpent on it with a handle to oppen it, Door 2 has no handle but a picture of a dice on it.");
  21.             System.out.println("Door 3 has a slot to place a crystal in it that looks to open it");
  22.             System.out.println("What number door do you pick " + name);
  23.            
  24.            
  25.             int RC1 = input.nextInt();
  26.            
  27.             while (RC1 !=1 || RC1 !=2 || RC1 !=3)
  28.             {
  29.                 if(RC1 == 1)
  30.                 {
  31.                     System.out.println("You are now in the serpents chamber");
  32.                     RM = 1;
  33.                     break;
  34.                 }
  35.                
  36.                 if(RC1 == 2)
  37.                 {
  38.                     System.out.println("The door has no way to open it, try a different one");
  39.                     RC1 = input.nextInt();
  40.                 }
  41.                
  42.                 if(RC1 == 3)
  43.                 {
  44.                     System.out.println("The door requires a crystal to open, Try another one.");
  45.                     RC1 = input.nextInt();
  46.                    
  47.                 }
  48.            
  49.                 else
  50.                 {
  51.                     System.out.println("That is not the number of a door try again");
  52.                     RC1 = input.nextInt();
  53.                    
  54.                 }          
  55.             }
  56.         }
  57.        
  58.         if (RM == 1)
  59.         {
  60.             System.out.println("You have entered into the serpents chamber, He was created as a failed test of the lead scientest");
  61.             System.out.println("He now guards the green gem stone with the promising of his freedom if he is successful");
  62.             System.out.println("Your options are listed");
  63.             System.out.println("1: Battle the serpent");
  64.             System.out.println("2: Run away");
  65.             System.out.println("What do you choose to do?(Select a number)");
  66.             int SC1 = input.nextInt();
  67.             while (SC1 !=1 || SC1 !=2 && RM == 1)
  68.             {
  69.                 if (SC1 == 1 && RM == 1)
  70.                 {
  71.                     System.out.println("You enter the battle arena and are brought to see the serpent sleeping and onto many more decisions");
  72.                     System.out.println("1: Pick up the bloody sword and use it as your weapon");
  73.                     System.out.println("2: Grab a torch off the wall and use it as your weapon");
  74.                     int SC2 = input.nextInt();
  75.                     while(SC2 !=1 || SC2 !=2 && RMC == false)
  76.                     {
  77.                         if (SC2 == 1)
  78.                         {
  79.                             System.out.println("You run to pick up the sword and the sleeping serpent is instantly woken up and attacks");
  80.                             System.out.println("The serpent strikes and you try to raise the sword to stab it but it is stuck in the floor");
  81.                             System.out.println("It strikes and bites you in the back light begins to fade");
  82.                             System.out.println("Game Over");
  83.                             System.exit(0);
  84.                             break;
  85.                         }
  86.                         if (SC2 == 2 && RMC== false)
  87.                         {
  88.                             System.out.println("You run and grab the torch off the wall, as you do this a door opens and the serpent is awaking");
  89.                             System.out.println("The serpent darts to you noticing the torch your holding and quickly halts");
  90.                             System.out.println("It begins to slither backwards as you wave the flame.");
  91.                             System.out.println("You notice the snakes cowardness to the fire and you");
  92.                             System.out.println("1: Keep chasing it with the fire");
  93.                             System.out.println("2: Run for the open door");
  94.                             int SC3 = input.nextInt();
  95.                             while(SC3 !=1 || SC3 !=2)
  96.                             {
  97.                                 if (SC3 == 1 && RMC == false)
  98.                                 {
  99.                                     System.out.println("You push foward with the torch and the serpent falls into a hole in the ground");
  100.                                     System.out.println("There is now to a clear path to the crystal and you follow it");
  101.                                     System.out.println("You walk foward and pick up the crystal, as you pick up you realize you are now back in the starting room");
  102.                                     RMC = true;
  103.                                     RM = 2;
  104.                                     if (RM == 2)
  105.                                     {
  106.                                        
  107.                                         System.out.println("A voice comes over the speaker system");
  108.                                         System.out.println("You have completed my first challenge, you will not complete the next!");
  109.                                         System.out.println("There is now only 2 options for doors, choose the correct one or faced instant death");
  110.                                         System.out.println("1: A Door with a picture of a dice on it");
  111.                                         System.out.println("2: A door with a faded picture of stones on it");
  112.                                         int RC2 = input.nextInt();
  113.                                         while (RC2 !=1 || RC2 !=2)
  114.                                         {
  115.                                             if (RC2 == 1)
  116.                                             {
  117.                                                 System.out.println("You have failed to remember the past, the lights go out");
  118.                                                 System.out.println("Game Over");
  119.                                                 break;                 
  120.                                             }
  121.                                             if (RC2 == 2)
  122.                                             {
  123.                                                 System.out.println("You walk over to the faded stones door and place the crystal in the opening");
  124.                                                 System.out.println("The door swings open and you wander inside, the door instantly lock behinds. You begin to hear a voice");
  125.                                                 System.out.println("You are now in the stone keepers lair, Watch your step");
  126.                                                 System.out.println("The answer to getting across is in the order of how you defeated the serpent");
  127.                                                 System.out.println("The voice fades away and all you can see is 3 stones, The first 2 and the final one, The final one is straight from your starting point, you can only use a stone once");
  128.                                                 System.out.println("1: Use the stone on the left");
  129.                                                 System.out.println("2: Use the stone on the right");
  130.                                                 int R1= input.nextInt();
  131.                                                 while(R1 !=1 || R1 !=2)
  132.                                                 {
  133.                                                     if (R1 == 1)
  134.                                                     {
  135.                                                         System.out.println("You are now on the left path, there are 2 more options for stones");
  136.                                                         System.out.println("1: Stay straight on the left path, 2: Go onto the second stone on the right path");
  137.                                                         int R2 = input.nextInt();
  138.                                                         while (R2 !=1 || R2 !=2)
  139.                                                         {
  140.                                                             if (R2 == 1)
  141.                                                             {
  142.                                                                 System.out.println("You have forgotten the past, Light begins to fade");
  143.                                                                 System.out.println("Game Over");
  144.                                                                 System.exit(0);
  145.                                                                 break;
  146.                                                             }
  147.                                                             if (R2 == 2)
  148.                                                             {
  149.                                                                 System.out.println("You are still on the right path, there is one more choice before you reach the key");
  150.                                                                 System.out.println("1: Stay on the right path, 2: Jump to the 3rd stone on the left path");
  151.                                                                 int RS3 = input.nextInt();
  152.                                                                 while(RS3 !=1 || RS3 !=2)
  153.                                                                 {
  154.                                                                     if(RS3 == 1)
  155.                                                                     {
  156.                                                                         System.out.println("You have cleared the stone path and have collected the key.");
  157.                                                                         System.out.println("You are now teleported back to the starting room");
  158.                                                                         System.out.println("You look around and the door with the dice on it is wide open, you wonder inside");
  159.                                                                         System.out.println("You are now faced with a room of riddles that will lead to a combo");
  160.                                                                         System.out.println("Answer correctly and move on to fight C-Beard the lead scientist of the lab");
  161.                                                                         System.out.println("He holds the key to your escape you have the pieces you just need the door to get in");
  162.                                                                         System.out.println("Remember your answers to the riddles and use them later for the code");
  163.                                                                         System.out.println("Riddle #1 Whats Red, Hard, and really bad for your teeth");
  164.                                                                         System.out.println("1: A Brick, 2: Ketchup 3: Cherry Snow Cone");
  165.                                                                         System.out.println("Riddle #2 Three doors are displayed in a picture which leads to your freedom");
  166.                                                                         System.out.println("1: A jungle filled with very poison plants that will kill you");
  167.                                                                         System.out.println("2: A cerial killer from the 1800's 3: A Scorching sun that will burn you to death");
  168.                                                                         System.out.println("Riddle #3 Whats Red ang Green and going 100 mph");
  169.                                                                         System.out.println("1 A blue racecar, 2 a frog in a blender, 3 a green and red car in a 50mph zone");
  170.                                                                         System.out.println("Guess your 3 digit number with no spaces, if it is correct you will pass if you fail you will be trapped for ever");
  171.                                                                         int CG = input.nextInt();
  172.                                                                         if(CG == 122)
  173.                                                                         {
  174.                                                                             int phealth = 10;
  175.                                                                             int bhealth = 20;
  176.                                                                             System.out.println("You have passed the test, you are worth to fight me, C-Beard, he boss of this lab");
  177.                                                                             System.out.println("A door opens behind you you turn and walk down the long narrow hallway");
  178.                                                                             System.out.println("As you walk down the hallway flames turn on every step you take");
  179.                                                                             System.out.println("You hear a echo of a voice coming down the hallway to tell you to prepare for a battle");
  180.                                                                             System.out.println("You enter the battle arena and C-Beard drops out of the cieling");
  181.                                                                             System.out.println("He starts to run at you and you #1 Jump out of the way #2 Stand as you see his path is not straight");
  182.                                                                             int BF1 = input.nextInt();
  183.                                                                             while(BF1 !=1 || BF1 !=2)
  184.                                                                             {
  185.                                                                                 if(BF1 == 1)
  186.                                                                                 {
  187.                                                                                     System.out.println("You dodge his strike and he runs into the wall and loses 5 health");
  188.                                                                                     bhealth -= 5;
  189.                                                                                     System.out.println("The boss now has " + bhealth + " health, you now have " + phealth + " health");
  190.                                                                                     System.out.println("You turn to see the bosses weakness out of the corner of your eye, shaving cream and a razor");
  191.                                                                                     System.out.println("You #1 Run for the shaving cream first and apply it #2 run for the razor and shave with out cream");
  192.                                                                                     int CB1A = input.nextInt();
  193.                                                                                     while(CB1A !=1 || CB1A !=2)
  194.                                                                                     {
  195.                                                                                         if (CB1A == 1)
  196.                                                                                         {
  197.                                                                                             System.out.println("You apply the shaving cream but as you are doing this C-Beard swipes at you");
  198.                                                                                             System.out.println("The shaving cream melts some of his beard off");
  199.                                                                                             System.out.println("You both lose 5 health");
  200.                                                                                             bhealth -= 5;
  201.                                                                                             phealth -= 5;
  202.                                                                                             System.out.println("The boss now has " + bhealth + " health, you now have " + phealth + " health");
  203.                                                                                             System.out.println("You have angered C-Beard and he begins to charge you again");
  204.                                                                                             System.out.println("You begin to run in a zig zag to distract him");
  205.                                                                                             System.out.println("You buy your self enough to time to notice 2 options");
  206.                                                                                             System.out.println("#1 Guide C-Beard over the edge of the arena, #2 Use the key you have found to attack C-Beard");
  207.                                                                                             int CB2 = input.nextInt();
  208.                                                                                             while (CB2 !=1 || CB2 !=2)
  209.                                                                                             {
  210.                                                                                                 if(CB2 == 1)
  211.                                                                                                 {
  212.                                                                                                     System.out.println("You guide C-Beard to the edge of the map and he falls off");
  213.                                                                                                     System.out.println("As he is falling off he grabs you and pulls you down");
  214.                                                                                                     System.out.println("Light begins to fade");
  215.                                                                                                     System.out.println("Game Over");
  216.                                                                                                     System.exit(0);
  217.                                                                                                    
  218.                                                                                                 }
  219.                                                                                                 if(CB2 == 2)
  220.                                                                                                 {
  221.                                                                                                     System.out.println("You strike C-Beard in the core which grows his beard");
  222.                                                                                                     System.out.println("His entire beard shrivles up and you are victorious");
  223.                                                                                                     System.out.println("Light begins to brighten as you awake in a hospital");
  224.                                                                                                     System.out.println("You Win!");
  225.                                                                                                     win = true;
  226.                                                                                                     if(win = true)
  227.                                                                                                     {
  228.                                                                                                         System.out.println("You Win!");
  229.                                                                                                         System.exit(0);
  230.                                                                                                        
  231.                                                                                                     }
  232.                                                                                                 }
  233.                                                                                                    
  234.                                                                                             }
  235.                                                                                            
  236.                                                                                            
  237.                                                                                            
  238.                                                                                         }
  239.                                                                                         if (CB1A == 2)
  240.                                                                                         {
  241.                                                                                             System.out.println("You grab the razor off the wall and shave part of his beard off");
  242.                                                                                             System.out.println("The razor inflicted a critical hit on him dealing max damage");
  243.                                                                                             System.out.println("C-Beard has lost all of his health and he forfits his key to get out");
  244.                                                                                             System.out.println("Light begins to get brighter as you wake up inside of a hospital");
  245.                                                                                             System.out.println("You Win!");
  246.                                                                                             win = true;
  247.                                                                                             if(win = true)
  248.                                                                                             {
  249.                                                                                                 System.out.println("You Win!");
  250.                                                                                                 System.exit(0);
  251.                                                                                             }
  252.                                                                                            
  253.                                                                                         }
  254.                                                                                         else
  255.                                                                                         {
  256.                                                                                             System.out.println("This is time sensative! Choose again");
  257.                                                                                         }
  258.                                                                                     }
  259.                                                                                 }
  260.                                                                                 if(BF1 == 2)
  261.                                                                                 {
  262.                                                                                     System.out.println("His path straightens out and he rams you into the wall, you lose 5 of your health");
  263.                                                                                     phealth -= 5;
  264.                                                                                     System.out.println("The boss now has " + bhealth + " health, you now have " + phealth + " health");
  265.                                                                                     System.out.println("You turn to see the bosses weakness out of the corner of your eye, shaving cream and a razor");
  266.                                                                                     System.out.println("You #1 Run for the shaving cream first and apply it #2 run for the razor and shave with out cream");
  267.                                                                                     int CB1B = input.nextInt();
  268.                                                                                     while(CB1B !=1 || CB1B !=2)
  269.                                                                                     {
  270.                                                                                         if (CB1B == 1)
  271.                                                                                         {
  272.                                                                                             System.out.println("You apply the shaving cream but as you are doing this C-Beard swipes at you");
  273.                                                                                             System.out.println("The shaving cream melts some of his beard off");
  274.                                                                                             System.out.println("You both lose 5 health");
  275.                                                                                            
  276.                                                                                             bhealth -= 5;
  277.                                                                                             phealth -= 5;
  278.                                                                                             System.out.println("The boss now has " + bhealth + " health, you now have " + phealth + " health");
  279.                                                                                             System.out.println("You have lost all of your health, light begins to fade");
  280.                                                                                             System.out.println("Game Over");
  281.                                                                                             System.exit(0);
  282.                                                                                             break;
  283.                                                                                        
  284.                                                                                         }
  285.                                                                                         if (CB1B == 2)
  286.                                                                                         {
  287.                                                                                             System.out.println("You grab the razor off the wall and shave part of his beard off");
  288.                                                                                             System.out.println("The razor inflicted a critical hit on him dealing max damage");
  289.                                                                                             System.out.println("C-Beard has lost all of his health and he forfits his key to get out");
  290.                                                                                             System.out.println("Light begins to get brighter as you wake up inside of a hospital");
  291.                                                                                             System.out.println("You Win!");
  292.                                                                                             win = true;
  293.                                                                                             if(win = true)
  294.                                                                                             {
  295.                                                                                                 System.out.println("You Win!");
  296.                                                                                                 System.exit(0);
  297.                                                                                             }
  298.                                                                                            
  299.                                                                                         }
  300.                                                                                         else
  301.                                                                                         {
  302.                                                                                             System.out.println("This is time sensative! Choose again");
  303.                                                                                         }
  304.                                                                                     }
  305.                                                                                 }
  306.                                            
  307.                                                                                 else
  308.                                                                                 {
  309.                                                                                     System.out.println("This is time sensative, choose again!");
  310.                                                                                 }
  311.                                                                             }
  312.                                                                         }
  313.                                                                         else
  314.                                                                         {
  315.                                                                             System.out.println("You have failed to show your mental strength, light begins to fade");
  316.                                                                             System.out.println("Game Over");
  317.                                                                             System.exit(0);
  318.                                                                             break;
  319.                                                                         }
  320.                                                                    
  321.                                                                     }
  322.                                                                     if(RS3 == 2)
  323.                                                                     {
  324.                                                                         System.out.println("You have forgotten the past, light begins to fade");
  325.                                                                         System.out.println("Game Over");
  326.                                                                         System.exit(0);
  327.                                                                         break;
  328.                                                                            
  329.                                                                     }
  330.                                                                     else
  331.                                                                     {
  332.                                                                         System.out.println("That is not an avaliable choice, choose again");
  333.                                                                        
  334.                                                                     }
  335.                                                            
  336.                                                                 }
  337.                                                                
  338.                                                                    
  339.                                                             }
  340.                                                             else
  341.                                                             {
  342.                                                                 System.out.println("That is not an option, Choose again");
  343.                                                             }
  344.                                                            
  345.                                                        
  346.                
  347.                                                         }
  348.                                                     }
  349.                                                     if (R1 == 2)
  350.                                                     {
  351.                                                         System.out.println("You have forgotten the past, light begins to fade");
  352.                                                         System.out.println("Game Over");
  353.                                                         System.exit(0);
  354.                                                         break;
  355.                                                        
  356.                                                    
  357.                                                     }
  358.                                                     else
  359.                                                     {
  360.                                                         System.out.println("That is not an option, choose again");
  361.                                                     }
  362.                                                 }
  363.                                                
  364.                                            
  365.                                                
  366.                                                
  367.                                                        
  368.                                             }
  369.                                         }
  370.                                    
  371.                                    
  372.                                 }
  373.                                 if (SC3 == 2)
  374.                                 {
  375.                                     System.out.println("You start to run for the floor but quick trip on a crack on the floor");
  376.                                     System.out.println("The serpent notices this and slithers twords you, he clamps his teeth and everything goes dark");
  377.                                     System.out.println("Game Over");
  378.                                     System.exit(0);
  379.                                     break;
  380.                                 }
  381.                                 else
  382.                                 {
  383.                                     System.out.println("That's not an avaliable option, choose again");
  384.                                     SC3 = input.nextInt();
  385.                                    
  386.                                 }                                                                                                      
  387.                         }                                      
  388.                     } }
  389.                         else
  390.                         {
  391.                             System.out.println("That is not an avalialbe option, choose again");
  392.                             SC2 = input.nextInt();
  393.                         }
  394.                 }
  395.                    
  396.                    
  397.                        
  398.                    
  399.             }
  400.                 if (SC1 == 2)
  401.                 {
  402.                     System.out.println("You attemp to run away but the serpent awakes to see you running");
  403.                     System.out.println("The serpent closes in on you and places its teeth around your head");
  404.                     System.out.println("Everything goes black");
  405.                     System.out.println("Game Over");
  406.                     System.exit(0);
  407.                     break;
  408.                 }
  409.                 else
  410.                 {
  411.                     System.out.println("That is not not an avaliable option, choose again");
  412.                     SC1 = input.nextInt();
  413.                 }
  414.         }
  415.                    
  416.    
  417.     }
  418.        
  419.     }
  420.    
  421. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement