Advertisement
Guest User

Java TSI Game

a guest
Sep 16th, 2019
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 54.24 KB | None | 0 0
  1. import java.util.*;
  2. public class SemProject1
  3. {
  4.     public static void main(String[] args)
  5.     {
  6.          Scanner scan = new Scanner(System.in);
  7.          System.out.println("What is your name?");
  8.          String name = scan.nextLine();
  9.          int strength =0;
  10.          int health = 100;
  11.          int magic =100;
  12.          int attackSpeed =5;
  13.          Random Warriorcombat = new Random ();
  14.          Random Magecombat = new Random();
  15.          Random Rougecombat = new Random();
  16.          Random Bowmencombat = new Random();
  17.          while (name.equals(name))
  18.          {
  19.              System.out.println("Welcome to the game: " +name);
  20.              System.out.println("The rules for this game is as follows:  \n"
  21.              + "I will give you the options you can choose. Type the number that corresponds to the option you want. "
  22.              +"You can make your own path to this game");
  23.              System.out.println("==================================================================================================="
  24.              + "=========================================");
  25.              System.out.println();
  26.              System.out.println();            
  27.              System.out.println("You awake at a cell. You have no idea how you got there or who you are.");
  28.              System.out.println("Suddenly, you meet a strange, lonely man. The strange man approaches you");
  29.              System.out.println("He says to you, \"The invasion has started. Are you ready for it?\"");
  30.              Scanner Class = new Scanner(System.in);
  31.              System.out.println("Suddenly, a strange light approaches you. You got blinded by the light and fall in deep sleep again.");
  32.              System.out.println("Out of game: What class do you want to be?");
  33.              System.out.println("1: Warrior");
  34.              System.out.println("2: Mage");
  35.              System.out.println("3. Rouge");
  36.              System.out.println("4. Bowmen");
  37.              int number = Class.nextInt();
  38.              System.out.println("As you wake up, you see that the old man has dissapeared and left you some equipment for your class");
  39.              if (number ==1)
  40.              {   System.out.println("You chose to be a Warrior.");
  41.                  System.out.println("You see a sword, heavy armor, shield. You have: " +(strength + 20) + " Strength, " + ( health + 20) + " Health, " +( magic -50) + " Magic, "+ ( attackSpeed) + " Attack Speed");
  42.                 }
  43.              else if (number==2)
  44.              {
  45.                  System.out.println("You chose to be a Mage");
  46.                  System.out.println("You see a staff, robes, book. You have: " +(strength + 5) + " Strength, " + ( health + -25) + " Health, " +( magic+ 100) + " Magic, "+ ( attackSpeed - 2) +" Attack Speed");                
  47.                 }
  48.              else if (number==3)
  49.              {
  50.                  System.out.println("You chose to be a Rouge");
  51.                  System.out.println("You see 2 daggers, light armor and a cloak. You have: "+(strength +10) + " Strength, " +(health -50) + " Health, "+(magic +20) + " Magic, "+ (attackSpeed + 5) +" Attack Speed");
  52.                 }
  53.              else
  54.              {
  55.                  System.out.println("You chose to be a Bowman");
  56.                  System.out.println("You see a bow, light armor and a quiver of arrows. You have: "+(strength +15) + " Strength, " +(health -60) + " Health, "+(magic-30) + " Magic, "+ (attackSpeed + 13) +" Attack Speed");                
  57.                 }
  58.              System.out.println("As you stand up, you hear a zombie-like voice. As you look where the voice is coming from, a boney like figure is approcuhing you with a sword aimed at your heart.");
  59.              System.out.println("What will you do?");
  60.              System.out.println("1. Raise your weapons and attack back");
  61.              System.out.println("2. Put your weapons down and try to talk with him.");
  62.              int question1=scan.nextInt();      
  63.              if (number==1 && question1 ==1)
  64.              {
  65.                  System.out.println("You raise your sword and kill the goblin warrior.");
  66.                  System.out.println("As you kill him, you feel stronger. Almost as if you've leveled up.");
  67. ;
  68.                  
  69.                 }
  70.              else if (number==2 && question1==1)
  71.              {
  72.                  System.out.println("You raise your staff and wack the goblin warrior at the back of his head and kill him");
  73.                  System.out.println("As you kill him, you feel stronger. Almost as if you've leveled up.");
  74.                    
  75.                 }
  76.              else if (number==3 && question1==1)
  77.              {
  78.                  System.out.println("You raise your dagger and stab the goblin warrior at the back of his head and kill him");
  79.                  System.out.println("As you kill him, you feel stronger. Almost as if you've leveled up.");
  80.                                
  81.             }
  82.              else if (number==4 && question1==1)
  83.              {
  84.                  System.out.println("You raise your bow,  grab an arrow from your quiver and kill th the goblin warrior");
  85.                  System.out.println("As you kill him, you feel stronger. Almost as if you've leveled up.");
  86.                              
  87.             }
  88.             else
  89.             {
  90.               System.out.println("The goblin warrior charges at you and stabs you in the heart. You bleed out and die");
  91.               System.out.println("What'd you expect?");
  92.               health =0;
  93.               if (health ==0)
  94.             {
  95.                 System.out.println("Game over. Try again next time and make sure you pick the right choice.");
  96.                 }
  97.             System.exit(0);
  98. }
  99.            
  100.             System.out.println("You leave the dungeon and open a huge door.");
  101.             System.out.println("You see a stair case going in opposite directions. One leads downward and the other stair case leads upwards. What will you do?");
  102.             System.out.println("1. Go downward");
  103.             System.out.println("2. Go upwards");
  104.             int stair= scan.nextInt();
  105.             if (stair ==1)
  106.             {
  107.             System.out.println("You traverse down the stairs");
  108.             System.out.println("You walk down for 10 minutes and finally reach a door.");
  109.             System.out.println("You open the door and see a bunch of golbin warriors and archers chilling. At the end of the room, you see another door.");
  110.             System.out.println("They don't seem to notice you. Most are asleep or day dreaming. You could easily kill a few before the rest wake up or ignore them and go for the door. Enter the number 1 to stealh kill");
  111.            
  112.             System.out.println("1. Stealth kill a few goblins before they wake up.");
  113.             int killorstealth= scan.nextInt();
  114.            
  115.            
  116.             if (killorstealth == 1)
  117.             {
  118.                 System.out.println("You stealth kill 3 of the 8 goblins");
  119.                 System.out.println("As you grab the 4th goblin, another goblin wakes up and shanks you from the back.");
  120.                 if (number == 1 && killorstealth ==1)
  121.                 {
  122.  
  123.                     System.out.println("You cry out in pain and push the warrior aside. Your cry wakes everyone up.");
  124.                     System.out.println("You realize that you are forced to fight them in order to leave this room alive.");
  125.                     System.out.println("You pick up  your sword and engage in combat.");
  126.                     int WarriorFirstFight = Warriorcombat.nextInt(6) * 1;
  127.                     if (WarriorFirstFight == 1)
  128.                     {
  129.                     System.out.println("You kill all of the goblins without a scratch");
  130.                     System.out.println("You grab a key hanging from a goblin's neck and open the door");
  131.                     System.out.println("As you step outside, you see that everything is in shambles and chaos everywhere.");
  132.                     System.out.println("You also see a purple beam erupting from a castle. As you look at the prple light, a flashback occurs in your mind.");
  133.                     System.out.println("You remember that you were a a loyal knight for this kingdom that is now in ruins. You recently found out that someone from far away planned to overtake"
  134.                     + " the kingdom ");
  135.                     System.out.println("When you told the king that, he felt furiated and threw you into the dungeon.");
  136.                     System.out.println("Even though you felt backstabbed, you realize that you have a duty to fulfill and to protect the king at all costs. So you begin traveling to reach the castle.");
  137.                    
  138.                 }
  139.                 if (WarriorFirstFight == 3)
  140.                 {
  141.                     System.out.println("You kill all of the goblins without a scratch");
  142.                     System.out.println("You grab a key hanging from a goblin's neck and open the door");
  143.                     System.out.println("As you step outside, you see that everything is in shambles and chaos everywhere.");
  144.                     System.out.println("You also see a purple beam erupting from a castle. As you look at the prple light, a flashback occurs in your mind.");
  145.                     System.out.println("You remember that you were a a loyal knight for this kingdom that is now in ruins. You recently found out that someone from far away planned to overtake"
  146.                     + " the kingdom ");
  147.                     System.out.println("When you told the king that, he felt furiated and threw you into the dungeon.");
  148.                     System.out.println("Even though you felt backstabbed, you realize that you have a duty to fulfill and to protect the king at all costs. So you begin traveling to reach the castle.");
  149.                 }
  150.                 if (WarriorFirstFight == 4)
  151.                 {
  152.                     System.out.println("You kill all of the goblins without a scratch");
  153.                     System.out.println("You grab a key hanging from a goblin's neck and open the door");
  154.                     System.out.println("As you step outside, you see that everything is in shambles and chaos everywhere.");
  155.                     System.out.println("You also see a purple beam erupting from a castle. As you look at the prple light, a flashback occurs in your mind.");
  156.                     System.out.println("You remember that you were a a loyal knight for this kingdom that is now in ruins. You recently found out that someone from far away planned to overtake"
  157.                     + " the kingdom ");
  158.                     System.out.println("When you told the king that, he felt furiated and threw you into the dungeon.");
  159.                     System.out.println("Even though you felt backstabbed, you realize that you have a duty to fulfill and to protect the king at all costs. So you begin traveling to reach the castle.");
  160.  
  161.                 }
  162.                 if (WarriorFirstFight == 5)
  163.                 {
  164.                     System.out.println("You kill all of the goblins without a scratch");
  165.                     System.out.println("You grab a key hanging from a goblin's neck and open the door");
  166.                     System.out.println("As you step outside, you see that everything is in shambles and chaos everywhere.");
  167.                     System.out.println("You also see a purple beam erupting from a castle. As you look at the prple light, a flashback occurs in your mind.");
  168.                     System.out.println("You remember that you were a a loyal knight for this kingdom that is now in ruins. You recently found out that someone from far away planned to overtake"
  169.                     + " the kingdom");
  170.                     System.out.println("When you told the king that, he felt furiated and threw you into the dungeon.");
  171.                     System.out.println("Even though you felt backstabbed, you realize that you have a duty to fulfill and to protect the king at all costs. So you begin traveling to reach the castle.");
  172.                 }
  173.                 if (WarriorFirstFight ==2)
  174.                 {
  175.                     System.out.println("You grab a key hanging from a goblin's neck and open the door");
  176.                     System.out.println("As you step outside, you see that everything is in shambles and chaos everywhere.");
  177.                     System.out.println("You also see a purple beam erupting from a castle. As you look at the prple light, a flashback occurs in your mind.");
  178.                     System.out.println("You remember that you were a a loyal knight for this kingdom that is now in ruins. You recently found out that someone from far away planned to overtake"
  179.                     + " the kingdom ");
  180.                     System.out.println("When you told the king that, he felt furiated and threw you into the dungeon.");
  181.                     System.out.println("Even though you felt backstabbed, you realize that you have a duty to fulfill and to protect the king at all costs. So you begin traveling to reach the castle.");
  182.                 }
  183.                 if (WarriorFirstFight ==6)
  184.                 {
  185.                     System.out.println("You grab a key hanging from a goblin's neck and open the door");
  186.                     System.out.println("As you step outside, you see that everything is in shambles and chaos everywhere.");
  187.                     System.out.println("You also see a purple beam erupting from a castle. As you look at the prple light, a flashback occurs in your mind.");
  188.                     System.out.println("You remember that you were a a loyal knight for this kingdom that is now in ruins. You recently found out that someone from far away planned to overtake"
  189.                     + " the kingdom");
  190.                     System.out.println("When you told the king that, he felt furiated and threw you into the dungeon.");
  191.                     System.out.println("Even though you felt backstabbed, you realize that you have a duty to fulfill and to protect the king at all costs. So you begin traveling to reach the castle.");
  192.                 }
  193.                 System.out.println("You see a big goblin with 2 axes.");
  194.                 System.out.println("The goblin charges at you. You are forced to fight.");
  195.             }      
  196.              if (number ==2 && killorstealth ==1)
  197.                 {
  198.                     System.out.println("You cry out in pain and push the warrior aside. Your cry wakes everyone up.");
  199.                     System.out.println("You realize that you are forced to fight them in order to leave this room alive.");
  200.                     System.out.println("You pick up your staff and start fighting.");
  201.  
  202.                     int MageFirstFight = Magecombat.nextInt(6) * 1;
  203.                     if (MageFirstFight == 1)
  204.                     {
  205.                     System.out.println("You kill all of the goblins without a scratch");
  206.                     System.out.println("You grab a key hanging from a goblin's neck and open the door");
  207.                     System.out.println("As you step outside, you see that everything is in shambles and chaos everywhere.");
  208.                     System.out.println("You also see a purple beam erupting from a castle. As you look at the prple light, a flashback occurs in your mind.");
  209.                     System.out.println("You remember that you were a a loyal knight for this kingdom that is now in ruins. You recently found out that someone from far away planned to overtake"
  210.                     + " the kingdom");
  211.                     System.out.println("When you told the king that, he felt furiated and threw you into the dungeon.");
  212.                     System.out.println("Even though you felt backstabbed, you realize that you have a duty to fulfill and to protect the king at all costs. So you begin traveling to reach the castle.");
  213.                
  214.                 }
  215.                      if (MageFirstFight == 2)
  216.                     {
  217.                     System.out.println("You kill all of the goblins without a scratch");
  218.                     System.out.println("You grab a key hanging from a goblin's neck and open the door");
  219.                     System.out.println("As you step outside, you see that everything is in shambles and chaos everywhere.");
  220.                     System.out.println("You also see a purple beam erupting from a castle. As you look at the prple light, a flashback occurs in your mind.");
  221.                     System.out.println("You remember that you were a a loyal knight for this kingdom that is now in ruins. You recently found out that someone from far away planned to overtake"
  222.                     + " the kingdom ");
  223.                     System.out.println("When you told the king that, he felt furiated and threw you into the dungeon.");
  224.                     System.out.println("Even though you felt backstabbed, you realize that you have a duty to fulfill and to protect the king at all costs. So you begin traveling to reach the castle.");
  225.                
  226.                 }
  227.                     if (MageFirstFight == 3)
  228.                     {
  229.                     System.out.println("You kill all of the goblins without a scratch");
  230.                     System.out.println("You grab a key hanging from a goblin's neck and open the door");
  231.                     System.out.println("As you step outside, you see that everything is in shambles and chaos everywhere.");
  232.                     System.out.println("You also see a purple beam erupting from a castle. As you look at the prple light, a flashback occurs in your mind.");
  233.                     System.out.println("You remember that you were a a loyal knight for this kingdom that is now in ruins. You recently found out that someone from far away planned to overtake"
  234.                     + " the kingdom ");
  235.                     System.out.println("When you told the king that, he felt furiated and threw you into the dungeon.");
  236.                     System.out.println("Even though you felt backstabbed, you realize that you have a duty to fulfill and to protect the king at all costs. So you begin traveling to reach the castle.");
  237.                
  238.                 }
  239.                      if (MageFirstFight == 4)
  240.                     {
  241.                     System.out.println("You kill all of the goblins without a scratch");
  242.                     System.out.println("You grab a key hanging from a goblin's neck and open the door");
  243.                     System.out.println("As you step outside, you see that everything is in shambles and chaos everywhere.");
  244.                     System.out.println("You also see a purple beam erupting from a castle. As you look at the prple light, a flashback occurs in your mind.");
  245.                     System.out.println("You remember that you were a a loyal knight for this kingdom that is now in ruins. You recently found out that someone from far away planned to overtake"
  246.                     + " the kingdom ");
  247.                     System.out.println("When you told the king that, he felt furiated and threw you into the dungeon.");
  248.                     System.out.println("Even though you felt backstabbed, you realize that you have a duty to fulfill and to protect the king at all costs. So you begin traveling to reach the castle.");
  249.                
  250.                 }
  251.                      if (MageFirstFight == 5)
  252.                     {
  253.                     System.out.println("You kill all of the goblins without a scratch");
  254.                     System.out.println("You grab a key hanging from a goblin's neck and open the door");
  255.                     System.out.println("As you step outside, you see that everything is in shambles and chaos everywhere.");
  256.                     System.out.println("You also see a purple beam erupting from a castle. As you look at the prple light, a flashback occurs in your mind.");
  257.                     System.out.println("You remember that you were a a loyal knight for this kingdom that is now in ruins. You recently found out that someone from far away planned to overtake"
  258.                     + " the kingdom");
  259.                     System.out.println("When you told the king that, he felt furiated and threw you into the dungeon.");
  260.                     System.out.println("Even though you felt backstabbed, you realize that you have a duty to fulfill and to protect the king at all costs. So you begin traveling to reach the castle.");
  261.                
  262.                 }
  263.                 if (MageFirstFight ==2)
  264.                 {
  265.                     System.out.println("You kill all of the goblins without a scratch");
  266.                     System.out.println("You grab a key hanging from a goblin's neck and open the door");
  267.                     System.out.println("As you step outside, you see that everything is in shambles and chaos everywhere.");
  268.                     System.out.println("You also see a purple beam erupting from a castle. As you look at the prple light, a flashback occurs in your mind.");
  269.                     System.out.println("You remember that you were a a loyal knight for this kingdom that is now in ruins. You recently found out that someone from far away planned to overtake"
  270.                     + " the kingdom with the help of the king's son");
  271.                     System.out.println("When you told the king that, he felt furiated and threw you into the dungeon.");
  272.                     System.out.println("Even though you felt backstabbed, you realize that you have a duty to fulfill and to protect the king at all costs. So you begin traveling to reach the castle.");
  273.                 }
  274.                 if (MageFirstFight ==6)
  275.                 {
  276.  
  277.                  System.out.println("You kill all of the goblins without a scratch ");
  278.                     System.out.println("You grab a key hanging from a goblin's neck and open the door");
  279.                     System.out.println("As you step outside, you see that everything is in shambles and chaos everywhere.");
  280.                     System.out.println("You also see a purple beam erupting from a castle. As you look at the prple light, a flashback occurs in your mind.");
  281.                     System.out.println("You remember that you were a a loyal knight for this kingdom that is now in ruins. You recently found out that someone from far away planned to overtake"
  282.                     + " the kingdom with the help of the king's son");
  283.                     System.out.println("When you told the king that, he felt furiated and threw you into the dungeon.");
  284.                     System.out.println("Even though you felt backstabbed, you realize that you have a duty to fulfill and to protect the king at all costs. So you begin traveling to reach the castle.");
  285.                
  286.                 }
  287.                       System.out.println("You see a big goblin with 2 axes.");
  288.                 System.out.println("The goblin charges at you. You are forced to fight.");
  289.             }
  290.               if (number ==3 && killorstealth == 1)
  291.                 {
  292.                        System.out.println("You cry out in pain and push the warrior aside. Your cry wakes everyone up.");
  293.                     System.out.println("You realize that you are forced to fight them in order to leave this room alive.");
  294.                     System.out.println("You pick up your daggers and start fighting.");
  295.                  int RougeFirstfight =Rougecombat.nextInt(6)*1;
  296.                  if (RougeFirstfight ==2)
  297.                 {
  298.                     System.out.println("You kill all of the goblins");
  299.                     System.out.println("You grab a key hanging from a goblin's neck and open the door");
  300.                     System.out.println("As you step outside, you see that everything is in shambles and chaos everywhere.");
  301.                     System.out.println("You also see a purple beam erupting from a castle. As you look at the prple light, a flashback occurs in your mind.");
  302.                     System.out.println("You remember that you were a a loyal knight for this kingdom that is now in ruins. You recently found out that someone from far away planned to overtake"
  303.                     + " the kingdom with the help of the king's son");
  304.                     System.out.println("When you told the king that, he felt furiated and threw you into the dungeon.");
  305.                     System.out.println("Even though you felt backstabbed, you realize that you have a duty to fulfill and to protect the king at all costs. So you begin traveling to reach the castle.");
  306.                 }
  307.                 if (RougeFirstfight ==6)
  308.                 {
  309.                     System.out.println("You kill all of the goblins");
  310.                     System.out.println("You grab a key hanging from a goblin's neck and open the door");
  311.                     System.out.println("As you step outside, you see that everything is in shambles and chaos everywhere.");
  312.                     System.out.println("You also see a purple beam erupting from a castle. As you look at the prple light, a flashback occurs in your mind.");
  313.                     System.out.println("You remember that you were a a loyal knight for this kingdom that is now in ruins. You recently found out that someone from far away planned to overtake"
  314.                     + " the kingdom with the help of the king's son");
  315.                     System.out.println("When you told the king that, he felt furiated and threw you into the dungeon.");
  316.                     System.out.println("Even though you felt backstabbed, you realize that you have a duty to fulfill and to protect the king at all costs. So you begin traveling to reach the castle.");
  317.                 }
  318.                       if (RougeFirstfight == 1)
  319.                     {
  320.                     System.out.println("You kill all of the goblins without a scratch");
  321.                     System.out.println("You grab a key hanging from a goblin's neck and open the door");
  322.                     System.out.println("As you step outside, you see that everything is in shambles and chaos everywhere.");
  323.                     System.out.println("You also see a purple beam erupting from a castle. As you look at the prple light, a flashback occurs in your mind.");
  324.                     System.out.println("You remember that you were a a loyal knight for this kingdom that is now in ruins. You recently found out that someone from far away planned to overtake"
  325.                     + " the kingdom with the help of the king's son");
  326.                     System.out.println("When you told the king that, he felt furiated and threw you into the dungeon.");
  327.                     System.out.println("Even though you felt backstabbed, you realize that you have a duty to fulfill and to protect the king at all costs. So you begin traveling to reach the castle.");
  328.                 }
  329.                       if (RougeFirstfight == 3)
  330.                     {
  331.                     System.out.println("You kill all of the goblins without a scratch");
  332.                     System.out.println("You grab a key hanging from a goblin's neck and open the door");
  333.                     System.out.println("As you step outside, you see that everything is in shambles and chaos everywhere.");
  334.                     System.out.println("You also see a purple beam erupting from a castle. As you look at the prple light, a flashback occurs in your mind.");
  335.                     System.out.println("You remember that you were a a loyal knight for this kingdom that is now in ruins. You recently found out that someone from far away planned to overtake"
  336.                     + " the kingdom");
  337.                     System.out.println("When you told the king that, he felt furiated and threw you into the dungeon.");
  338.                     System.out.println("Even though you felt backstabbed, you realize that you have a duty to fulfill and to protect the king at all costs. So you begin traveling to reach the castle.");
  339.                
  340.                 }
  341.                        if (RougeFirstfight == 4)
  342.                     {
  343.                     System.out.println("You kill all of the goblins without a scratch");
  344.                     System.out.println("You grab a key hanging from a goblin's neck and open the door");
  345.                     System.out.println("As you step outside, you see that everything is in shambles and chaos everywhere.");
  346.                     System.out.println("You also see a purple beam erupting from a castle. As you look at the prple light, a flashback occurs in your mind.");
  347.                     System.out.println("You remember that you were a a loyal knight for this kingdom that is now in ruins. You recently found out that someone from far away planned to overtake"
  348.                     + " the kingdom");
  349.                     System.out.println("When you told the king that, he felt furiated and threw you into the dungeon.");
  350.                     System.out.println("Even though you felt backstabbed, you realize that you have a duty to fulfill and to protect the king at all costs. So you begin traveling to reach the castle.");
  351.                
  352.                 }
  353.                        if (RougeFirstfight == 5)
  354.                     {
  355.                     System.out.println("You kill all of the goblins without a scratch");
  356.                     System.out.println("You grab a key hanging from a goblin's neck and open the door");
  357.                     System.out.println("As you step outside, you see that everything is in shambles and chaos everywhere.");
  358.                     System.out.println("You also see a purple beam erupting from a castle. As you look at the prple light, a flashback occurs in your mind.");
  359.                     System.out.println("You remember that you were a a loyal knight for this kingdom that is now in ruins. You recently found out that someone from far away planned to overtake"
  360.                     + " the kingdom");
  361.                     System.out.println("When you told the king that, he felt furiated and threw you into the dungeon.");
  362.                     System.out.println("Even though you felt backstabbed, you realize that you have a duty to fulfill and to protect the king at all costs. So you begin traveling to reach the castle.");
  363.                
  364.                 }
  365.                       System.out.println("You see a big goblin with 2 axes.");
  366.                 System.out.println("The goblin charges at you. You are forced to fight.");
  367.             }
  368.                 if (number ==4 && killorstealth ==1)
  369.                 {
  370.                       System.out.println("You cry out in pain and push the warrior aside. Your cry wakes everyone up.");
  371.                     System.out.println("You realize that you are forced to fight them in order to leave this room alive.");
  372.                     System.out.println("You pick up your bow and start fighting.");
  373.                 int BowmanFirstFight = Bowmencombat.nextInt(6) * 1;
  374.                     if (BowmanFirstFight== 1)
  375.                     {
  376.                     System.out.println("You kill all of the goblins without a scratch");
  377.                     System.out.println("You grab a key hanging from a goblin's neck and open the door");
  378.                     System.out.println("As you step outside, you see that everything is in shambles and chaos everywhere.");
  379.                     System.out.println("You also see a purple beam erupting from a castle. As you look at the prple light, a flashback occurs in your mind.");
  380.                     System.out.println("You remember that you were a a loyal knight for this kingdom that is now in ruins. You recently found out that someone from far away planned to overtake"
  381.                     + " the kingdom");
  382.                     System.out.println("When you told the king that, he felt furiated and threw you into the dungeon.");
  383.                     System.out.println("Even though you felt backstabbed, you realize that you have a duty to fulfill and to protect the king at all costs. So you begin traveling to reach the castle.");
  384.                
  385.                 }
  386.                      if (BowmanFirstFight == 3)
  387.                     {
  388.                     System.out.println("You kill all of the goblins without a scratch");
  389.                     System.out.println("You grab a key hanging from a goblin's neck and open the door");
  390.                     System.out.println("As you step outside, you see that everything is in shambles and chaos everywhere.");
  391.                     System.out.println("You also see a purple beam erupting from a castle. As you look at the prple light, a flashback occurs in your mind.");
  392.                     System.out.println("You remember that you were a a loyal knight for this kingdom that is now in ruins. You recently found out that someone from far away planned to overtake"
  393.                     + " the kingdom");
  394.                     System.out.println("When you told the king that, he felt furiated and threw you into the dungeon.");
  395.                     System.out.println("Even though you felt backstabbed, you realize that you have a duty to fulfill and to protect the king at all costs. So you begin traveling to reach the castle.");
  396.                
  397.                 }
  398.                     if (BowmanFirstFight == 4)
  399.                     {
  400.                                             System.out.println("You kill all of the goblins");
  401.  
  402.                     System.out.println("You grab a key hanging from a goblin's neck and open the door");
  403.                     System.out.println("As you step outside, you see that everything is in shambles and chaos everywhere.");
  404.                     System.out.println("You also see a purple beam erupting from a castle. As you look at the prple light, a flashback occurs in your mind.");
  405.                     System.out.println("You remember that you were a a loyal knight for this kingdom that is now in ruins. You recently found out that someone from far away planned to overtake"
  406.                     + " the kingdom");
  407.                     System.out.println("When you told the king that, he felt furiated and threw you into the dungeon.");
  408.                     System.out.println("Even though you felt backstabbed, you realize that you have a duty to fulfill and to protect the king at all costs. So you begin traveling to reach the castle.");
  409.                
  410.                 }
  411.                      if (BowmanFirstFight == 5)
  412.                     {
  413.                                             System.out.println("You kill all of the goblins");
  414.  
  415.                    System.out.println("You grab a key hanging from a goblin's neck and open the door");
  416.                     System.out.println("As you step outside, you see that everything is in shambles and chaos everywhere.");
  417.                     System.out.println("You also see a purple beam erupting from a castle. As you look at the prple light, a flashback occurs in your mind.");
  418.                     System.out.println("You remember that you were a a loyal knight for this kingdom that is now in ruins. You recently found out that someone from far away planned to overtake"
  419.                     + " the kingdom");
  420.                     System.out.println("When you told the king that, he felt furiated and threw you into the dungeon.");
  421.                     System.out.println("Even though you felt backstabbed, you realize that you have a duty to fulfill and to protect the king at all costs. So you begin traveling to reach the castle.");
  422.                
  423.                 }
  424.                 if (BowmanFirstFight ==2)
  425.                 {
  426.                                            System.out.println("You kill all of the goblins");
  427.                System.out.println("You grab a key hanging from a goblin's neck and open the door");
  428.                     System.out.println("As you step outside, you see that everything is in shambles and chaos everywhere.");
  429.                     System.out.println("You also see a purple beam erupting from a castle. As you look at the prple light, a flashback occurs in your mind.");
  430.                     System.out.println("You remember that you were a a loyal knight for this kingdom that is now in ruins. You recently found out that someone from far away planned to overtake"
  431.                     + " the kingdom");
  432.                     System.out.println("When you told the king that, he felt furiated and threw you into the dungeon.");
  433.                     System.out.println("Even though you felt backstabbed, you realize that you have a duty to fulfill and to protect the king at all costs. So you begin traveling to reach the castle.");
  434.                 }
  435.                 if (BowmanFirstFight ==6)
  436.                 {
  437.                     System.out.println("You kill all of the goblins");
  438.  
  439.                     System.out.println("You grab a key hanging from a goblin's neck and open the door");
  440.                     System.out.println("As you step outside, you see that everything is in shambles and chaos everywhere.");
  441.                     System.out.println("You also see a purple beam erupting from a castle. As you look at the prple light, a flashback occurs in your mind.");
  442.                     System.out.println("You remember that you were a a loyal knight for this kingdom that is now in ruins. You recently found out that someone from far away planned to overtake"
  443.                     + " the kingdom");
  444.                     System.out.println("When you told the king that, he felt furiated and threw you into the dungeon.");
  445.                     System.out.println("Even though you felt backstabbed, you realize that you have a duty to fulfill and to protect the king at all costs. So you begin traveling to reach the castle.");
  446.                 }
  447.                       System.out.println("You see a big goblin with 2 axes.");
  448.                 System.out.println("The goblin charges at you. You are forced to fight.");
  449.  
  450.             }
  451.             }
  452.         }
  453.    
  454.      
  455.  
  456.  
  457.  
  458. health =100;
  459.                int goblinhealth=700;
  460.                while (goblinhealth >0 && goblinhealth <=700)
  461.                {
  462.  
  463.                    if (number==1)
  464.                    {
  465.                                                             int WarriorSecondFight = Warriorcombat.nextInt (6)*1;        
  466.                        health = 100;
  467.                  if (WarriorSecondFight == 1 || WarriorSecondFight == 3 || WarriorSecondFight ==5)
  468.                  { System.out.println("You damage the big goblin for 100 health");
  469.                      System.out.println("Goblins remaiing health: "+goblinhealth);
  470.                      goblinhealth -=100;
  471.                      if (goblinhealth==0)
  472.                      { System.out.println("You just beat the game. GJ.");
  473.                          System.exit(0);
  474.                          }
  475.  
  476.                      
  477.                      }
  478.                  if (WarriorSecondFight == 2 || WarriorSecondFight == 4 || WarriorSecondFight ==6)
  479.                  { System.out.println("The goblin evades your attacks and damages you.");
  480.                      health-= 10;
  481.                      System.out.println("Your remaining health: "+health);
  482.                        if (health ==0)
  483.                     { System.out.println("You died.");
  484.                       System.exit(0);
  485.                         }
  486.                        
  487.             }
  488.         }
  489.         if (number ==2)
  490.                 {
  491.                  int MageSecondFight = Magecombat.nextInt (4)*1;
  492.                  health = 90;
  493.                  if (MageSecondFight == 1 || MageSecondFight == 3 || MageSecondFight ==4)
  494.                  { System.out.println("You damage the big goblin for 20 health");
  495.                      goblinhealth -=20;
  496.                      System.out.println("Goblins remaiing health: "+goblinhealth);
  497.  
  498.  
  499.                      if (goblinhealth ==0 )
  500.                      {
  501.                                               System.out.println("Congrats you won.");
  502.                          System.exit(0);
  503.                          }
  504.                      }
  505.                  if (MageSecondFight == 2)
  506.                  { System.out.println("The goblin evades your attacks and damages you.");
  507.                      health-= 10;
  508.                      System.out.println("Your remaining health: "+health);
  509.                    if (health ==0)
  510.                     { System.out.println("You died.");
  511.                       System.exit(0);
  512.                         }
  513.                     }
  514.                 }
  515.                 if (number ==3)
  516.                 {
  517.                  int RougeSecondFight = Rougecombat.nextInt (6)*1;
  518.                  health = 80;
  519.                  if (RougeSecondFight == 1 || RougeSecondFight == 3 || RougeSecondFight ==4 || RougeSecondFight ==5)
  520.                  { System.out.println("You damage the big goblin for 25 health");
  521.                      goblinhealth -=25;
  522.                      System.out.println("Goblins remaiing health: "+goblinhealth);
  523.  
  524.  
  525.                      if (goblinhealth ==0 )
  526.                      {
  527.                                               System.out.println("Congrats you won.");
  528.                          System.exit(0);
  529.                          }
  530.                      }
  531.                  if (RougeSecondFight == 2 || RougeSecondFight == 6)
  532.                  { System.out.println("The goblin evades your attacks and damages you.");
  533.                      health-= 10;
  534.                      System.out.println("Your remaining health: "+health);
  535.                    if (health ==0)
  536.                     { System.out.println("You died.");
  537.                       System.exit(0);
  538.                         }
  539.                      }
  540.                     }
  541.                                         if (number ==4)
  542.                 {
  543.                  int BowmenSecondFight = Bowmencombat.nextInt (5)*1;
  544.                  health = 60;
  545.                  if (BowmenSecondFight == 1 || BowmenSecondFight == 3 || BowmenSecondFight ==4)
  546.                  { System.out.println("You damage the big goblin for 50 health");
  547.                      goblinhealth -=50;
  548.                      System.out.println("Goblins remaiing health: "+goblinhealth);
  549.  
  550.  
  551.                      if (goblinhealth ==0 )
  552.                      {
  553.                                               System.out.println("Congrats you won.");
  554.                          System.exit(0);
  555.                          }
  556.                      }
  557.                  if ( BowmenSecondFight== 2 || BowmenSecondFight==5)
  558.                  { System.out.println("The goblin evades your attacks and damages you.");
  559.                      health-= 10;
  560.                      System.out.println("Your remaining health: "+health);
  561.                    if (health ==0)
  562.                     { System.out.println("You died.");
  563.                       System.exit(0);
  564.                         }
  565.                      }    
  566.             }
  567.         }
  568.        
  569. if (stair ==2)
  570.             {
  571.                 System.out.println("You went up the stairs");
  572.                 System.out.println("As you go up the stairs, you see that everything is in shambles and chaos everywhere.");
  573.                 System.out.println("You also see a purple beam erupting from a castle. As you look at the prple light, a flashback occurs in your mind.");
  574.                 System.out.println("You remember that you were a a loyal solider for this kingdom that is now in ruins. You recently found out that someone from far away planned to overtake"
  575.                     + " the kingdom with the help of the king's son");
  576.                 System.out.println("When you told the king that, he felt furiated and threw you into the dungeon.");
  577.                 System.out.println("Even though you felt backstabbed, you realize that you have a duty to fulfill and to protect the king at all costs. So you begin traveling to reach the castle.");
  578.                 System.out.println("At the corner of your eye, you see a tiny music box that only looks like it can be played once. You take it and store it in your pockets");
  579.                 System.out.println("You jump down and start to head to the purple beam.");
  580.                 System.out.println ("You start to walk for an hour. You are really close to reaching the castle and the purple beam. Suddenly, you are stopped by a large goblin holding 2 axes.");
  581.                 System.out.println("He notices you, so there is no way out and starts charging at you");
  582.                 System.out.println("You remember that old music box you found. Do you want to use it?. ");
  583.                 System.out.println("1. Yes.");
  584.                 System.out.println("2. No.");
  585.                 int answer=scan.nextInt();
  586.                  
  587.                 if (answer==1)
  588.                 {
  589.                     System.out.println("The goblin shrieks in pain. You damage it for 200 health. Total goblin health: 300");
  590.                      goblinhealth =300;
  591.                     System.out.println("The goblin wakes up from the pain and starts to furiously attacking you.");
  592.                     System.out.println("You engage combat with the big goblin.");
  593.                        while (goblinhealth >0 && goblinhealth<=300)
  594.                 {
  595.                 if (number ==1)
  596.                 {
  597.                  int WarriorSecondFight = Warriorcombat.nextInt (6)*1;        
  598.                        health = 100;
  599.                  if (WarriorSecondFight == 1 || WarriorSecondFight == 3 || WarriorSecondFight ==5)
  600.                  { System.out.println("You damage the big goblin for 100 health");
  601.                      goblinhealth -=100;
  602.                      System.out.println("Goblins remaiing health: "+goblinhealth);
  603.  
  604.  
  605.                      if (goblinhealth ==0 )
  606.                      {
  607.                          System.out.println("Congrats you won.");
  608.                       System.exit(0);
  609.                          }
  610.                      }
  611.                  if (WarriorSecondFight == 2 || WarriorSecondFight == 4 || WarriorSecondFight ==6)
  612.                  { System.out.println("The goblin evades your attacks and damages you.");
  613.                      health-= 10;
  614.                      System.out.println("Your remaining health: "+health);
  615.                    if (health ==0)
  616.                     { System.out.println("You died.");
  617.                       System.exit(0);
  618.                         }
  619.                      }    
  620.             }
  621.                             if (number ==2)
  622.                 {
  623.                  int MageSecondFight = Magecombat.nextInt (4)*1;
  624.                  health = 90;
  625.                  if (MageSecondFight == 1 || MageSecondFight == 3 || MageSecondFight ==4)
  626.                  { System.out.println("You damage the big goblin for 20 health");
  627.                      goblinhealth -=20;
  628.                      System.out.println("Goblins remaiing health: "+goblinhealth);
  629.  
  630.  
  631.                      if (goblinhealth ==0 )
  632.                      {
  633.                                               System.out.println("Congrats you won.");
  634.                       System.exit(0);
  635.                          }
  636.                      }
  637.                  if (MageSecondFight == 2)
  638.                  { System.out.println("The goblin evades your attacks and damages you.");
  639.                      health-= 10;
  640.                      System.out.println("Your remaining health: "+health);
  641.                    if (health ==0)
  642.                     { System.out.println("You died.");
  643.                       System.exit(0);
  644.                         }
  645.                      }    
  646.             }
  647.                        if (number ==3)
  648.                 {
  649.                  int RougeSecondFight = Rougecombat.nextInt (6)*1;
  650.                  health = 80;
  651.                  if (RougeSecondFight == 1 || RougeSecondFight == 3 || RougeSecondFight ==4 || RougeSecondFight==5)
  652.                  { System.out.println("You damage the big goblin for 25 health");
  653.                      goblinhealth -=25;
  654.                      System.out.println("Goblins remaiing health: "+goblinhealth);
  655.  
  656.  
  657.                      if (goblinhealth ==0 )
  658.                      {
  659.                                               System.out.println("Congrats you won.");
  660.                       System.exit(0);
  661.                          }
  662.                      }
  663.                  if (RougeSecondFight == 2 || RougeSecondFight ==6)
  664.                  { System.out.println("The goblin evades your attacks and damages you.");
  665.                      health-= 10;
  666.                      System.out.println("Your remaining health: "+health);
  667.                    if (health ==0)
  668.                     { System.out.println("You died.");
  669.                       System.exit(0);
  670.                         }
  671.                      }    
  672.             }
  673.                        if (number ==4)
  674.                 {
  675.                  int BowmenSecondFight = Bowmencombat.nextInt (5)*1;
  676.                  health = 60;
  677.                  if (BowmenSecondFight == 1 || BowmenSecondFight == 3 || BowmenSecondFight ==4)
  678.                  { System.out.println("You damage the big goblin for 50 health");
  679.                      goblinhealth -=50;
  680.                      System.out.println("Goblins remaiing health: "+goblinhealth);
  681.  
  682.  
  683.                      if (goblinhealth ==0 )
  684.                      {
  685.                                               System.out.println("Congrats you won.");
  686.                       System.exit(0);
  687.                          }
  688.                      }
  689.                  if (BowmenSecondFight == 2 || BowmenSecondFight == 5)
  690.                  { System.out.println("The goblin evades your attacks and damages you.");
  691.                      health-= 10;
  692.                      System.out.println("Your remaining health: "+health);
  693.                    if (health ==0)
  694.                     { System.out.println("You died.");
  695.                       System.exit(0);
  696.                         }
  697.                      }    
  698.             }
  699.            }
  700.            
  701.  
  702.         }
  703.                    if (answer ==2)
  704.            {
  705.                System.out.println("The goblin charges at you.");
  706.  
  707.                 goblinhealth=500;
  708.                while (goblinhealth >0 && goblinhealth <=500)
  709.                {
  710.                                      int WarriorSecondFight = Warriorcombat.nextInt (6)*1;
  711.                                      
  712.                    if (number==1)
  713.  
  714.                  if (WarriorSecondFight == 1 || WarriorSecondFight == 3 || WarriorSecondFight ==5)
  715.                  { System.out.println("You damage the big goblin for 100 health");
  716.                      System.out.println("Goblins remaiing health: "+goblinhealth);
  717.                      goblinhealth -=100;
  718.  
  719.                      
  720.                      }
  721.                  if (WarriorSecondFight == 2 || WarriorSecondFight == 4 || WarriorSecondFight ==6)
  722.                  { System.out.println("The goblin evades your attacks and damages you.");
  723.                      health-= 10;
  724.                      System.out.println("Your remaining health: "+health);
  725.                        if (health ==0)
  726.                     { System.out.println("You died.");
  727.                       System.exit(0);
  728.                         }
  729.                      }
  730.                              if (number ==2)
  731.                 {
  732.                  int MageSecondFight = Magecombat.nextInt (4)*1;
  733.                  health = 90;
  734.                  if (MageSecondFight == 1 || MageSecondFight == 3 || MageSecondFight ==4)
  735.                  { System.out.println("You damage the big goblin for 20 health");
  736.                      goblinhealth -=20;
  737.                      System.out.println("Goblins remaiing health: "+goblinhealth);
  738.  
  739.  
  740.                      if (goblinhealth ==0 )
  741.                      {
  742.                                               System.out.println("Congrats you won.");
  743.                          System.exit(0);
  744.                          }
  745.                      }
  746.                  if (MageSecondFight == 2)
  747.                  { System.out.println("The goblin evades your attacks and damages you.");
  748.                      health-= 10;
  749.                      System.out.println("Your remaining health: "+health);
  750.                    if (health ==0)
  751.                     { System.out.println("You died.");
  752.                       System.exit(0);
  753.                         }
  754.                      }    
  755.             }
  756.                        if (number ==3)
  757.                 {
  758.                  int RougeSecondFight = Rougecombat.nextInt (6)*1;
  759.                  health = 80;
  760.                  if (RougeSecondFight == 1 || RougeSecondFight == 3 || RougeSecondFight ==4 || RougeSecondFight ==5)
  761.                  { System.out.println("You damage the big goblin for 25 health");
  762.                      goblinhealth -=25;
  763.                      System.out.println("Goblins remaiing health: "+goblinhealth);
  764.  
  765.  
  766.                      if (goblinhealth ==0 )
  767.                      {
  768.                                               System.out.println("Congrats you won.");
  769.                          System.exit(0);
  770.                          }
  771.                      }
  772.                  if (RougeSecondFight == 2 || RougeSecondFight == 6)
  773.                  { System.out.println("The goblin evades your attacks and damages you.");
  774.                      health-= 10;
  775.                      System.out.println("Your remaining health: "+health);
  776.                    if (health ==0)
  777.                     { System.out.println("You died.");
  778.                       System.exit(0);
  779.                         }
  780.                      }    
  781.             }
  782.                        if (number ==4)
  783.                 {
  784.                  int BowmenSecondFight = Bowmencombat.nextInt (5)*1;
  785.                  health = 60;
  786.                  if (BowmenSecondFight == 1 || BowmenSecondFight == 3 || BowmenSecondFight ==4)
  787.                  { System.out.println("You damage the big goblin for 50 health");
  788.                      goblinhealth -=50;
  789.                      System.out.println("Goblins remaiing health: "+goblinhealth);
  790.  
  791.  
  792.                      if (goblinhealth ==0 )
  793.                      {
  794.                                               System.out.println("Congrats you won.");
  795.                          System.exit(0);
  796.                          }
  797.                      }
  798.                  if ( BowmenSecondFight== 2 || BowmenSecondFight==5)
  799.                  { System.out.println("The goblin evades your attacks and damages you.");
  800.                      health-= 10;
  801.                      System.out.println("Your remaining health: "+health);
  802.                    if (health ==0)
  803.                     { System.out.println("You died.");
  804.                       System.exit(0);
  805.                         }
  806.                      }    
  807.             }
  808.             }
  809.                            if (goblinhealth ==0)
  810.            {
  811.         System.out.println("Congrats you just beat the Goblin. You beat the game.");
  812.         System.exit(0);
  813.     }
  814.    
  815.             }
  816.            
  817. }
  818. }
  819. }
  820. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement