Tweeted twitter.com/StackCodeReview/status/788787917674147840
    Post Reopened by forsvarir, 200_success
3 deleted 79 characters in body; edited tags; edited title; edited tags
source | link

How can I implement other methods/classes Battle game in my code?one 900-line class

Thanks again!

How can I implement other methods/classes in my code?

Thanks again!

Battle game in one 900-line class

2 added 3700 characters in body
source | link
import java.util.Scanner;

import java.util.Random;

public class Class1

{

@SuppressWarnings("unused")
public static void main(String[] args)import java.util.Random;

{public class Class1 

    // Main objects{

    Scanner console = new Scanner@SuppressWarnings(System.in"unused");
    Random randpublic =static newvoid Randommain(String[] args); 

    // Game variables{

    String[] enemies = { "Kobold", "Kobold Warrior", "Kobold Archer", "Kobold Overseer" };
    String[] shopItems = { "Silver Sword", "Steel Sword", "Iron Helmet", "Iron Chestplate", "Iron Boots", "Iron Gauntlets", "Steel Helmet", "Steel Chestplate", "Steel Boots", "Steel Gauntlets", "Illbane" };
    String randomItem// =Main null;objects

    int enemyAttackDamage   Scanner console = 25;new Scanner(System.in);
    int enemyHealth   Random rand = 0;new Random();

        // BossGame Variablesvariables

        String[] bossListenemies = { "Red"Kobold", Drake""Kobold Warrior", "Kobold Archer", "Kobold Overseer" };
        String[] shopItems = { "Silver Sword", "Steel Sword", "Iron Helmet", "Iron Chestplate", "Iron Boots", "Iron Gauntlets", "Steel Helmet", "Steel Chestplate", "Steel Boots", "Steel Gauntlets", "Illbane" };
        String randomItem = null;

    int redDrakeArmor = 20;
    int redDrakeAttackenemyAttackDamage = 75;25;
        int redDrakeSpecialAttackValueenemyHealth = 200;0;

        // PlayerBoss variablesVariables

    int playerHealth = 100;
    int playerAttackDamage = 50;
    intString[] initialPlayerAttackbossList = playerAttackDamage;
    int{ playerArmorValue"Red =Drake" 0;};

    int numHealthPotions = 5;                                       // How many potions the player will start with.
    int healthPotionEffectredDrakeArmor = 30;                                    // How much20;
 each potion will heal.
    int healthPotionDropChanceredDrakeAttack = 50;                         75;
       // Percentageint dropredDrakeSpecialAttackValue from= enemies.200;

    int numStrengthPotions = 0;
    int strengthPotionEffect = (rand.nextInt(3) + 1);             // Player variables

    int goldDropChance = 75;                     int playerHealth = 100;
        int playerAttackDamage = 50;
     // Percentage drop ofint goldinitialPlayerAttack from= enemies.playerAttackDamage;
    int goldDropAmount;
    int goldAmountplayerArmorValue = 1000;0;

        int crimsonSwordDropChancenumHealthPotions = 25;5;                                       // How many potions the player will start with.
        int healthPotionEffect = 30;                                    // How much each potion will heal.
        int healthPotionDropChance = 50;                                // Percentage drop from enemies.

        int buyStrengthPotion;numStrengthPotions = 0;
        int buyHealthPotion;strengthPotionEffect = (rand.nextInt(3) + 1);               

        int illbaneCountgoldDropChance = 4;75;                                        // Percentage drop of gold from enemies.
        int goldDropAmount;
        int goldAmount = 1000;

    boolean running   int crimsonSwordDropChance = true;25;

    System.out.println("Now entering the Kobolds Lair...");int buyStrengthPotion;
        int buyHealthPotion;

    GAME:
    while(running)int illbaneCount = 4;

    {    boolean running = true;

        System.out.println("-------------------------------------------------"Now entering the Kobolds Lair...");

        String enemy = enemies[rand.nextInt(enemies.length)];GAME:
       // Enemywhile(running) Spawning.

        System.out.println("\t# " + enemy + " appears! #\n");{

        if ("Kobold".equals(enemy))                                 // Enemy stat settingSystem.out.println("-------------------------------------------------");

        {    String enemy = enemies[rand.nextInt(enemies.length)];       // Enemy Spawning.

            enemyHealth = randSystem.nextIntout.println(100)"\t# " + 50;enemy + " appears! #\n");

            enemyAttackDamageif =("Kobold".equals(enemy)) 25;                                // Enemy stat setting.

        }    {

        else if ("Kobold Archer"     enemyHealth = rand.equalsnextInt(enemy)100) + 50;

        {        enemyAttackDamage = 25;

            enemyHealth = rand.nextInt(150) + 70;}

            enemyAttackDamageelse =if 30;("Kobold Archer".equals(enemy))

        }    {

        else if ("Kobold Warrior"     enemyHealth = rand.equalsnextInt(enemy)150) + 70;

        {        enemyAttackDamage = 30;

            enemyHealth = rand.nextInt(200) + 90;}

            enemyAttackDamageelse =if 40;("Kobold Warrior".equals(enemy))

        }    {

        else if ("Kobold Overseer"     enemyHealth = rand.equalsnextInt(enemy)200) + 90;

        {        enemyAttackDamage = 40;

            enemyHealth = rand.nextInt(250) + 150;}

            enemyAttackDamageelse =if 50;("Kobold Overseer".equals(enemy))

        }    {

        while(        enemyHealth >= 0rand.nextInt(250) + 150;

        {
            // Enemy introduction and presentationenemyAttackDamage of= options.50;

            System.out.println("\tYour HP is: " + playerHealth);
            System.out.println("\t" + enemy + "'s HP: " + enemyHealth);
            System.out.println("\n\tWhat would you like to do?");}

            //while(enemyHealth Player> options0)

            System.out.println("\t1. Attack");
            System.out.println("\t2. Drink health potion");{
            System.out.println("\t3. Run!");
      // Enemy introduction and presentation of System.out.println("\t4options. Drink strength potion");

            String input = console System.nextLineout.println("\tYour HP is: " + playerHealth);
                System.out.println("\t" + enemy + "'s HP: " + enemyHealth);
                System.out.println("\n\tWhat would you like to do?");

            if (input.equals("1"))   // Player options

            {    System.out.println("\t1. Attack");
                System.out.println("\t2. Drink health potion");
                System.out.println("\t3. Run!");
                System.out.println("\t4. Drink strength potion");

                int damageDealt = rand.nextInt(playerAttackDamage);
                intString damageTakeninput = randconsole.nextInt(enemyAttackDamage) - nextLine(playerArmorValue);

                enemyHealth -= damageDealt;
                playerHealth -=if damageTaken;(input.equals("1"))

                if (damageTaken <= 0)
                {

                    int damageDealt = rand.nextInt(playerAttackDamage);
                    int damageTaken = rand.nextInt(5enemyAttackDamage) +- 5;(playerArmorValue);

                }    enemyHealth -= damageDealt;
                    playerHealth -= damageTaken;

                System.out.println("\t> You strike the " + enemy + " for " + damageDealtif +(damageTaken "<= damage."0);
                System.out.println("\t> You recieve " + damageTaken + " in retaliation!");{

                if(playerHealth < 1      damageTaken = rand.nextInt(5) + 5;

                {    }

                    System.out.println("\t> You havestrike takenthe too" much+ damage,enemy you+ are" toofor weak" to+ godamageDealt on!+ " damage.");
                    break;System.out.println("\t> You recieve " + damageTaken + " in retaliation!");

                }    if(playerHealth < 1)

            }        {

            else if (input          System.equalsout.println("2")"\t> You have taken too much damage, you are too weak to go on!");
                        break;

            {        }

                if(numHealthPotions}

 > 0              else if (input.equals("2")) 

                {

                    if(numHealthPotions > 0)
                    {

                        playerHealth += healthPotionEffect;
                        numHealthPotions--;
                        System.out.println("\t> You drink a health potion and recover " + healthPotionEffect + " health!"
                                           + "\n\t> You now have " + playerHealth + " HP."
                                           + "\n\t> You have " + numHealthPotions + " health potions left.\n)");

                    }

                    else
                    {

                        System.out.println("\t> You have no health potions left! ");

                    }

                }

                else if (input.equals("3"))

                {

                    System.out.println("\t>"\tYou Yourun haveaway nofrom healththe potions" left!+ enemy + "!");
                    continue GAME; 

                }

            }    else if (input.equals("4"))

            else if (input.equals("3"))  {

            {        int playerAttack = playerAttackDamage;

                System.out.println("\tYou run away from the " +if enemy(numStrengthPotions +> "!"0);
                continue GAME; 

            }        playerAttackDamage = playerAttack * strengthPotionEffect;
                    numStrengthPotions--;

            else if (input      System.equalsout.println("4""You drank a strength potion and your attack has multiplied by: " + strengthPotionEffect + " time(s).!");

            {    }

                int playerAttack = playerAttackDamage;

                if (numStrengthPotions > 0)else

                playerAttackDamage = playerAttack * strengthPotionEffect;
                numStrengthPotions--;{

                    System.out.println("You drank a strength potion and your attack has multiplied by: " + strengthPotionEffect + ""\tInvalid time(s)command.!..");

                }

            }

            elseif (playerHealth < 1)

            {

                System.out.println("\tInvalid"\n\tYou command..crawl out of the dungeon to live and fight another day.");
                break;

            }

        }    System.out.println("-------------------------------------------------");
            System.out.println(" # " + enemy + " was defeated! #");
            System.out.println(" # You have " + playerHealth + " HP left. #");

        if (playerHealth < 1) playerAttackDamage = initialPlayerAttack;

        {    if(rand.nextInt(100) < healthPotionDropChance)          // Health Potion drop chance; differs from enemy to enemy.

            System.out.println("\n\tYou crawl out of the dungeon to live and fight another day.");
            break;{

        }        if ("Kobold Archer".equals(enemy))

        System.out.println("-------------------------------------------------");
        System.out.println(" # " + enemy + " was defeated! #");
        System.out.println(" # You have " + playerHealth + " HP left. #");{

        playerAttackDamage            healthPotionDropChance = initialPlayerAttack;55;

        if(rand.nextInt(100) < healthPotionDropChance)          // Health Potion drop chance; differs from enemy to enemy.}

        {        else if ("Kobold Warrior".equals(enemy))

            if ("Kobold Archer".equals(enemy))  {

            {        healthPotionDropChance = 60;

                healthPotionDropChance = 55;}

            }    else if ("Kobold Overseer".equals(enemy))

            else if ("Kobold Warrior".equals(enemy)) {

            {        healthPotionDropChance = 75;

                healthPotionDropChance}

 = 60;              numHealthPotions++;

                System.out.println(" # The " + enemy + " dropped a health potion! # ");
                System.out.println(" # You have " + numHealthPotions + " health potion(s). # ");

            }

            else if ("Kobold Overseer"rand.equalsnextInt(enemy100) < goldDropChance)          // Gold drop chance; also differs from enemy to enemy.

            {

                healthPotionDropChanceif =("Kobold 75;Archer".equals(enemy))

            }    {

            numHealthPotions++;        goldDropChance = 55;

            System.out.println(" # The " + enemy + " dropped a health potion! # ");
            System.out.println(" # You have " + numHealthPotions + " health potion(s). # ");}

        }        else if ("Kobold Warrior".equals(enemy))

        if(rand.nextInt(100) < goldDropChance)          // Gold drop chance; also differs from enemy to enemy.{

        {            goldDropChance = 60;

            if ("Kobold Archer".equals(enemy))  }

            {    else if ("Kobold Overseer".equals(enemy))

                {

                    goldDropChance = 55;75;

                }

                goldDropAmount = rand.nextInt(500) + 1;
                goldAmount += goldDropAmount;

                System.out.println(" # The " + enemy + " dropped " + goldDropAmount + " gold! #");
                System.out.println(" # You now have " + goldAmount + " gold. #");

            }

            elseSystem.out.println("-------------------------------------------------"); if           
            System.out.println("Kobold"What Warrior"to do now?");          // Next set of options;
            System.equalsout.println(enemy"1. Continue fighting");     // 1. Resets loop, keeps progress.
            System.out.println("2. Exit dungeon");          // 2. Breaks loop, progress lost; game over.
            System.out.println("3. Visit the shop");        // 3. Triggers shop sequence.
            System.out.println("4. Sacrifice Illbane...");  // 4. Triggers hard battle.

            String input = console.nextLine();


            while(!input.equals("1") && !input.equals("2") && !input.equals("3") && !input.equals("4"))
            {

                goldDropChanceSystem.out.println("Invalid command...");
                input = 60;console.nextLine();

            }

            else if ("Kobold Overseer"input.equals(enemy"1"))

            {

                goldDropChanceSystem.out.println("You =continue 75;on your trek through the dungeon.");

                continue GAME;

            }

            goldDropAmountelse =if rand(input.nextIntequals(500"2") + 1;
            goldAmount += goldDropAmount;)

            System.out.println(" # The " + enemy + " dropped " + goldDropAmount + " gold! #");
            System.out.println(" # You now have " + goldAmount + " gold. #");{

        }        System.out.println("You exit the dungeon.");
                break;

        System.out.println("-------------------------------------------------");            
        System.out.println("What to do now?");          // Next set of options;
        System.out.println("1. Continue fighting");     // 1. Resets loop, keeps progress.
        System.out.println("2. Exit dungeon");          // 2. Breaks loop, progress lost; game over.
        System.out.println("3. Visit the shop");        // 3. Triggers shop sequence.
        System.out.println("4. Sacrifice Illbane...");  // 4. Triggers hard battle.}

        String input = console else if (input.nextLineequals("4"); && illbaneCount >= 4)        // Boss Battle Sequence, few special rules...

            {
                    illbaneCount -= 4;

        while(!input.equals("1") && !input.equals("2") && !input.equals("3") && !input      System.equalsout.println("4")"-------------------------------------------------");
        {            System.out.println("\t# A great beast stirs! #");

            System.out.println("Invalid command...");       int redDrakeHealth = 2500;
            input        String enemyBoss = console.nextLine();bossList[0];

        }            System.out.println("\t# " + enemyBoss + " appears! #\n");

        if (input.equals           while("1")redDrakeHealth > 0)

                    {
                        // Enemy introduction and presentation of options.

                        System.out.println("You"\tYour continueHP onis: your" trek+ throughplayerHealth);
 the dungeon                      System.out.println("\t" + enemyBoss + "'s HP: " + redDrakeHealth);
                        System.out.println("\n\tWhat would you like to do?");

            continue GAME;           // Player options

        }                System.out.println("\t1. Attack");
                        System.out.println("\t2. Drink health potion");
                        System.out.println("\t3. Run!");
                        System.out.println("\t4. Drink strength potion");

        else if (input              String inputBossFight = console.equalsnextLine("2"));

        {                if (inputBossFight.equals("1"))

            System.out.println("You exit the dungeon.");
            break;{

        }                    int bossDamageDealt = rand.nextInt(playerAttackDamage) - (redDrakeArmor);
                            int bossDamageTaken = rand.nextInt(redDrakeAttack) - (playerArmorValue);

        else if (input.equals("4") && illbaneCount >= 4)        // Boss Battle Sequence, few special rules...redDrakeHealth -= bossDamageDealt;
                            playerHealth -= bossDamageTaken;

        {                    if (bossDamageTaken <= 0)
                illbaneCount -= 4;          {

                System.out.println("-------------------------------------------------");
                System.out.println("\t# AbossDamageTaken great= beastrand.nextInt(20) stirs!+ #");10;

                int redDrakeHealth = 2500;
                String enemyBoss = bossList[0];}

                            System.out.println("\t#"\t> You strike the " + enemyBoss + " appears!for #\n"" + bossDamageDealt + " damage.");
                            System.out.println("\t> You recieve " + bossDamageTaken + " in retaliation!");

                while            if(redDrakeHealthplayerHealth >< 01)

                {
                    // Enemy introduction and presentation of options.{

                    System.out.println("\tYour HP is: " + playerHealth);
        System.out.println("\t> You have taken too much damage, you are too weak to System.out.println("\t"go +on!");
 enemyBoss + "'s HP: " + redDrakeHealth);
                    System.out.println("\n\tWhat would you like to do?");break;

                    // Player options      }

                    System.out.println("\t1. Attack");
                    System.out.println("\t2. Drink health potion");
                    System.out.println("\t3. Run!");
                    System.out.println("\t4. Drink strength potion");}

                    String inputBossFight = console else if (inputBossFight.nextLineequals("2");)

                    if (inputBossFight.equals("1"))   {

                            if(numHealthPotions > 0)
                            {

                        int bossDamageDealt = rand.nextInt(playerAttackDamage) - (redDrakeArmor)   playerHealth += healthPotionEffect;
                                numHealthPotions--;
                        int bossDamageTaken = rand     System.nextIntout.println(redDrakeAttack)"\t> -You (playerArmorValuedrink a health potion and recover " + healthPotionEffect + " health!"
                                                   + "\n\t> You now have " + playerHealth + " HP."
                                                   + "\n\t> You have " + numHealthPotions + " health potions left.\n)");

                        redDrakeHealth -= bossDamageDealt;
                        playerHealth -= bossDamageTaken;}

                        if (bossDamageTaken <= 0) else
                            {

                            bossDamageTaken = rand  System.nextIntout.println(20)"\t> +You 10;have no health potions left! ");

                            }

                        System.out.println("\t> You strike the " + enemyBoss + " for " + bossDamageDealt + " damage.");
                        System.out.println("\t> You recieve " + bossDamageTaken + " in retaliation!");}

                        if(playerHealthelse <if 1(inputBossFight.equals("3"))

                        {

                            System.out.println("\t> You have taken too"\tYou muchrun damage,away youfrom arethe too" weak+ toenemy go+ on"!");
                            break;continue GAME; 

                        }

                    }    else if (input.equals("4"))

                    else if (inputBossFight.equals("2"))  {

                    {        int playerAttack = playerAttackDamage;

                        if(numHealthPotions > 0)
                     if (numStrengthPotions > {0)

                            playerHealthplayerAttackDamage +== healthPotionEffect;playerAttack * strengthPotionEffect;
                            numHealthPotionsnumStrengthPotions--; 

                            System.out.println("\t> You"You drinkdrank a healthstrength potion and recover " + healthPotionEffect + " health!"
                                               + "\n\t> You now have " + playerHealth + " HP."
                                              your +attack "\n\t>has Youmultiplied haveby: " + numHealthPotionsstrengthPotionEffect + " health potions left.\ntime(s).!");

                        }
 

                        else
 
                        {

                            System.out.println("\t> You have no health potions left!"\tInvalid command...");

                        }

                    }

                    else if (inputBossFight.equals("3")playerHealth < 1)

                    {

                        System.out.println("\tYou"\n\tYou runcrawl awayout fromof the "dungeon +to enemylive +and "!fight another day.");
                        continue GAME; break;

                    }

                    else if (input.equals("4")redDrakeHealth <= 100)

                    {

                        int playerAttack = playerAttackDamage;

                   System.out.println("\n\t!!!# The Red Drake unleashes ifit's (numStrengthPotionsspecial >attack 0#!!!");

                        playerAttackDamageplayerHealth -= playerAttack * strengthPotionEffect;
                        numStrengthPotions--;redDrakeSpecialAttackValue;

                        System.out.println("You drank"\t>!!!# aYou strengthrecieve potion" and+ yourredDrakeSpecialAttackValue attack+ has" multipliedin by:retaliation "from +the strengthPotionEffectDrake's +fiery "breath! time(s).#!!!");

                    }

                    System.out.println("-------------------------------------------------");
                    System.out.println(" # " + enemyBoss + " was defeated! #");
                    System.out.println(" # You have " + playerHealth + " HP left. #");

                    playerAttackDamage = initialPlayerAttack;

                    elseif(rand.nextInt(100) < healthPotionDropChance)

                    {

                        System.out.println("\tInvalidnumHealthPotions++;
 command...");                       numStrengthPotions++;

                        System.out.println(" # The " + enemyBoss + " dropped a health potion, and a strength potion! # ");
                        System.out.println(" # You have " + numHealthPotions + " health potion(s), and " + numStrengthPotions + "! #");

                    }

                }    if(rand.nextInt(100) < goldDropChance)

                if (playerHealth < 1) {

                {        goldDropAmount = rand.nextInt(500) + 1000;
                        goldAmount += goldDropAmount;

                        System.out.println("\n\tYou" crawl# outThe of" the+ dungeonenemyBoss to+ live" anddropped fight" another+ day.goldDropAmount + " gold! #");
                    break;    System.out.println(" # You now have " + goldAmount + " gold. #");

                    }

                    if (redDrakeHealthrand.nextInt(100) <=< 100crimsonSwordDropChance)

                    {

                        System.out.println("\n\t!!!# The fearsome Red Drake unleasheshas it'sdropped speciala ruby sword of power, your attack has increased five fold! #!!!");

                    playerHealth -= redDrakeSpecialAttackValue;  playerAttackDamage *= 5;

                    System.out.println("\t>!!!# You recieve " + redDrakeSpecialAttackValue + " in retaliation from the Drake's fiery breath! #!!!");}

                }    else if (illbaneCount != 4)

                System.out.println("-------------------------------------------------");
                System.out.println(" # " + enemyBoss + " was defeated! #");
                System.out.println(" # You have " + playerHealth + " HP left. #");{

                playerAttackDamage = initialPlayerAttack;      System.out.println("You do not have enough illbane to make a worthy sacrifice!");

                if(rand.nextInt(100) < healthPotionDropChance)      continue GAME;

                {    }

                    numHealthPotions++;
                    numStrengthPotions++;}

                    System.out.println(" # The " + enemyBoss + " dropped a health potion, and a strength potion! # ");
                    System.out.println(" # You have " + numHealthPotions + " health potion(s), and " + numStrengthPotions + "! #");

                }

               else if (randinput.nextIntequals(100"3")) < goldDropChance)       // Shop Sequence

                {

                  System.out.println("\nWelcome to goldDropAmountthe =sshhop randoutssider.nextInt(500..") + 1000;;
                 System.out.println("What would you goldAmountlike +=to goldDropAmount;buy?");

                    System.out.println(" # The " + enemyBoss + " dropped " + goldDropAmount + " gold! #");
                  randomItem = System.outshopItems[rand.printlnnextInt(" # You now have " + goldAmount + " goldshopItems. #"length);];

                }SHOP:
                System.out.println("\nWould to like to buy a(n): " + randomItem + "?");

                if (randrandomItem.nextIntequals(100) <"Silver crimsonSwordDropChanceSword"))

                {

                    System.out.println("\n\t!!!# The fearsome Red Drake has dropped a ruby sword of power, your attack has increased five fold! #!!!");

                    playerAttackDamageSystem.out.println("\nThat *=will 5;be 1000 gold.");

                }

                else if (illbaneCount !=randomItem.equals("Steel 4Sword"))

                {

                    System.out.println("You do not have enough illbane to"\nThat makewill abe worthy250 sacrifice!gold.");

                    continue GAME;

                }

        }



        else if (input.equals("3"))         // Shop Sequence

        {

            System.out.println("\nWelcome to the sshhop outssider...");
            System.out.println("What would you like to buy?");

            randomItem = shopItems[rand.nextInt(shopItems.length)];

            SHOP:
            System.out.println("\nWould to like to buy a(n): " + randomItem + "?");

            if (randomItem.equals("Silver Sword"))

            {

                System.out.println("\nThat will be 1000 gold.");

            }

            else if (randomItem.equals("Steel"Iron Sword"Helmet"))

            {

                System.out.println("\nThat will be 250 gold.");{

            }        System.out.println("\nThat will be 150 gold.");

            else if (randomItem.equals("Iron Helmet")) }

            {    else if (randomItem.equals("Iron Chestplate"))

                System.out.println("\nThat will be 150 gold.");{

            }        System.out.println("\nThat will be 200 gold.");

            else if (randomItem.equals("Iron Chestplate")) }

            {    else if (randomItem.equals("Iron Boots"))

                System.out.println("\nThat will be 200 gold.");{

            }        System.out.println("\nThat will be 100 gold.");

            else if (randomItem.equals("Iron Boots")) }

            {    else if (randomItem.equals("Iron Gauntlets"))

                System.out.println("\nThat will be 100 gold.");{

            }        System.out.println("\nThat will be 75 gold.");

            else if (randomItem.equals("Iron Gauntlets")) }

            {    else if (randomItem.equals("Steel Helmet"))

                System.out.println("\nThat will be 75 gold.");{

            }        System.out.println("\nThat will be 400 gold.");

            else if (randomItem.equals("Steel Helmet")) }

            {    else if (randomItem.equals("Steel Chestplate"))

                System.out.println("\nThat will be 400 gold.");{

            }        System.out.println("\nThat will be 600 gold.");

            else if (randomItem.equals("Steel Chestplate")) }

            {    else if (randomItem.equals("Steel Boots"))

                System.out.println("\nThat will be 600 gold.");{

            }        System.out.println("\nThat will be 300 gold.");

            else if (randomItem.equals("Steel Boots")) }

            {    else if (randomItem.equals("Steel Gauntlets"))

                System.out.println("\nThat will be 300 gold.");{

            }        System.out.println("\nThat will be 250 gold.");

            else if (randomItem.equals("Steel Gauntlets")) }

            {    else if (randomItem.equals("Illbane"))

                System.out.println("\nThat will be 250 gold.");{

            }        System.out.println("\nThat will be 2500 gold. Interesting...");

            else if (randomItem.equals("Illbane"))  }

            {    System.out.println("1. Yes");
                System.out.println("2. No");

                System.out.println("\nThat will beString 2500input1 gold.= Interesting..console."nextLine();

            }    if (input1.equals("1") && randomItem.equals("Silver Sword"))

            System.out.println("1. Yes");
            System.out.println("2. No");{

            String input1 = console     System.nextLineout.println("Thank you for your purchase.");

            if (input1.equals("1") && randomItem.equals("Silver Sword"))    goldAmount -= 1000;
                    playerAttackDamage += 100;

            {        shopItems[0] = "Empty";

                System.out.println("Thank you for your purchase.");continue GAME;

                goldAmount -= 1000;
                playerAttackDamage += 100;}

                shopItems[0]else =if "Empty";(input1.equals("1") && randomItem.equals("Steel Sword"))

                continue GAME;{

            }        System.out.println("Thank you for your purchase.");

            else if (input1.equals("1") && randomItem.equals("Steel Sword"))   goldAmount -= 250;
                    playerAttackDamage += 25;

            {        shopItems[1] = "Empty";

                System.out.println("Thank you for your purchase.");continue GAME;

                goldAmount -= 250;
                playerAttackDamage += 25;}

                shopItems[1]else =if "Empty";(input1.equals("1") && randomItem.equals("Iron Helmet"))

                continue GAME;{

            }        System.out.println("Thank you for your purchase.");

            else if (input1.equals("1") && randomItem.equals("Iron Helmet"))   goldAmount -= 150;
                    playerArmorValue += 10;

            {        shopItems[2] = "Empty";

                System.out.println("Thank you for your purchase.");continue GAME;

                goldAmount -= 150;
                playerArmorValue += 10;}

                shopItems[2]else =if "Empty";(input1.equals("1") && randomItem.equals("Iron Chestplate"))

                continue GAME;{

            }        System.out.println("Thank you for your purchase.");

            else if (input1.equals("1") && randomItem.equals("Iron Chestplate"))   goldAmount -= 200;
                    playerArmorValue += 18;

            {        shopItems[3] = "Empty";

                System.out.println("Thank you for your purchase.");continue GAME;

                goldAmount -= 200;
                playerArmorValue += 18;}

                shopItems[3]else =if "Empty";(input1.equals("1") && randomItem.equals("Iron Boots"))

                continue GAME;{

            }        System.out.println("Thank you for your purchase.");

            else if (input1.equals("1") && randomItem.equals("Iron Boots"))   goldAmount -= 100;
                    playerArmorValue += 8;

            {        shopItems[4] = "Empty";

                System.out.println("Thank you for your purchase.");continue GAME;

                goldAmount -= 100;
                playerArmorValue += 8;}

                shopItems[4]else =if "Empty";(input1.equals("1") && randomItem.equals("Iron Gauntlets"))

                continue GAME;{

            }        System.out.println("Thank you for your purchase.");

            else if (input1.equals("1") && randomItem.equals("Iron Gauntlets"))   goldAmount -= 75;
                    playerArmorValue += 5;

            {        shopItems[5] = "Empty";

                System.out.println("Thank you for your purchase.");continue GAME;

                goldAmount -= 75;
                playerArmorValue += 5;}

                shopItems[5]else =if "Empty";(input1.equals("1") && randomItem.equals("Steel Helmet"))

                continue GAME;{

            }        System.out.println("Thank you for your purchase.");

            else if (input1.equals("1") && randomItem.equals("Steel Helmet"))   goldAmount -= 300;
                    playerArmorValue += 15 - 10;

            {        shopItems[6] = "Empty";

                System.out.println("Thank you for your purchase.");continue GAME;

                goldAmount -= 300;
                playerArmorValue += 15 - 10;}

                shopItems[6]else =if "Empty";(input1.equals("1") && randomItem.equals("Steel Chestplate"))

                continue GAME;{

            }        System.out.println("Thank you for your purchase.");

            else if (input1.equals("1") && randomItem.equals("Steel Chestplate"))   goldAmount -= 600;
                    playerArmorValue += 30 - 20;

            {        shopItems[7] = "Empty";

                System.out.println("Thank you for your purchase.");continue GAME;

                goldAmount -= 600;
                playerArmorValue += 30 - 20;}

                shopItems[7]else =if "Empty";(input1.equals("1") && randomItem.equals("Steel Boots"))

                continue GAME;{

            }        System.out.println("Thank you for your purchase.");

            else if (input1.equals("1") && randomItem.equals("Steel Boots"))   goldAmount -= 300;
                    playerArmorValue += 18 - 8;

            {        shopItems[8] = "Empty";

                System.out.println("Thank you for your purchase.");continue GAME;

                goldAmount -= 300;
                playerArmorValue += 18 - 8;}

                shopItems[8]else =if "Empty";(input1.equals("1") && randomItem.equals("Steel Gauntlets"))

                continue GAME;{

            }        System.out.println("Thank you for your purchase.");

            else if (input1.equals("1") && randomItem.equals("Steel Gauntlets"))   goldAmount -= 250;
                    playerArmorValue += 12 - 5;

            {        shopItems[9] = "Empty";

                System.out.println("Thank you for your purchase.");continue GAME;

                goldAmount -= 250;
                playerArmorValue += 12 - 5;}

                shopItems[9]else =if "Empty";(input1.equals("1") && randomItem.equals("Illbane"))

                continue GAME;{

            }        System.out.println("Thank you for your purchase. See what you can do with a couple more of those...");

            else if (input1.equals("1") && randomItem.equals("Illbane"))    goldAmount -= 2500;
                    illbaneCount++;

            {        shopItems[10] = "Empty";

                System.out.println("Thank you for your purchase. See what you can do with a couple more ofcontinue those...");GAME;

                goldAmount -= 2500;
                illbaneCount++;}

                shopItems[10]else =if "Empty";(input1.equals("2"))

                continue GAME;{

            }        System.out.println("\nWould you like to buy some potions atleast?");
                    System.out.println("1. Yes");
                    System.out.println("2. No!");

            else if (input1      String input2 = console.equalsnextLine("2"));

            {

                System.out.println("\nWould you like to buy some potions atleast?");
                System.out.println("1. Yes");
                System.out.println("2. No!");

                String input2 = console.nextLine(); POTIONCHOICE:

                    if (input2.equals("2"))

                    {

                POTIONCHOICE:        System.out.println("\nAlrighty.");

                if (input2.equals("2"))       continue GAME;

                {    }

                    System.out.printlnif ("\nAlrightyinput2."equals("1");)

                    continue GAME;{

                }        System.out.println("\nHealth Potions or Strength Potions?");
                        System.out.println("1. Health Potions: 100 gold");
                        System.out.println("2. Strength Potions: 500 gold");
                        System.out.println("3. Nevermind!");

                if (input2       String input3 = console.equalsnextLine("1"));

                {        if (input2.equals("3"))

                    System.out.println("\nHealth Potions or Strength Potions?");
                    System.out.println("1. Health Potions: 100 gold");
                    System.out.println("2. Strength Potions: 500 gold");
                    System.out.println("3. Nevermind!");{

                    String input3 = console     System.nextLineout.println("Then get on wiv' it!");

                    if (input2.equals("3"))       continue GAME;

                    {    }

                        System.out.println("Then get onelse wiv'if it!"(input3.equals("1");)

                        continue GAME;{

                    }        System.out.println("How many would you like to buy?");
                            int inputNumH = console.nextInt();

                    else if (input3.equals("1"))      goldAmount -= inputNumH * 100;
                            numHealthPotions += inputNumH;

                    {        System.out.println("Here you are: " + inputNumH + " health potions.");

                        System.out.println("How many would you like to buy?");
                        int inputNumH =continue console.nextInt();GAME;

                        goldAmount -= inputNumH * 100;
                        numHealthPotions += inputNumH;}

                        System.out.println("Here you are: " + inputNumH + "else healthif potions(input3."equals("2");)

                        continue GAME;{

                    }         System.out.println("How many would you like to buy?");
                             int inputNumS = console.nextInt();

                     else if (input3.equals("2"))      goldAmount -= inputNumS * 500;
                             numStrengthPotions += inputNumS;

                     {        System.out.println("Here you are: " + inputNumS + " strength potions.");

                         System.out.println("How many would you like to buy?");
                         int inputNumS =continue console.nextInt();GAME;

                         goldAmount -= inputNumS * 500;
                         numStrengthPotions += inputNumS;}

                         System.out.println("Here you are: " + inputNumS + "else strengthif potions(input3."equals("3");)

                         continue GAME;{

                     }        System.out.println("Stop wasting my time!");

                     else if (input3.equals("3"))      continue GAME;

                     {    }

                         System.out.println("Stop wasting my time!");else

                         continue GAME;{

                     }        System.out.println("What are you trying to say?!");

                     else        continue GAME;

                     {    }

                         System.out.println("What are you trying to say?!");

                         continue GAME;

                        }



                    }

                System.out.println("\n\t# THANKS FOR PLAYING! # ");

                break;

            }

            System.out.println("\n\t# THANKS FOR PLAYING! # ");

            break;

        }

    }

 }

}

import java.util.Scanner;

import java.util.Random;

public class Class1

{

@SuppressWarnings("unused")
public static void main(String[] args) 

{

    // Main objects

    Scanner console = new Scanner(System.in);
    Random rand = new Random();

    // Game variables

    String[] enemies = { "Kobold", "Kobold Warrior", "Kobold Archer", "Kobold Overseer" };
    String[] shopItems = { "Silver Sword", "Steel Sword", "Iron Helmet", "Iron Chestplate", "Iron Boots", "Iron Gauntlets", "Steel Helmet", "Steel Chestplate", "Steel Boots", "Steel Gauntlets", "Illbane" };
    String randomItem = null;

    int enemyAttackDamage = 25;
    int enemyHealth = 0;

    // Boss Variables

    String[] bossList = { "Red Drake" };

    int redDrakeArmor = 20;
    int redDrakeAttack = 75;
    int redDrakeSpecialAttackValue = 200;

    // Player variables

    int playerHealth = 100;
    int playerAttackDamage = 50;
    int initialPlayerAttack = playerAttackDamage;
    int playerArmorValue = 0;

    int numHealthPotions = 5;                                       // How many potions the player will start with.
    int healthPotionEffect = 30;                                    // How much each potion will heal.
    int healthPotionDropChance = 50;                                // Percentage drop from enemies.

    int numStrengthPotions = 0;
    int strengthPotionEffect = (rand.nextInt(3) + 1);               

    int goldDropChance = 75;                                        // Percentage drop of gold from enemies.
    int goldDropAmount;
    int goldAmount = 1000;

    int crimsonSwordDropChance = 25;

    int buyStrengthPotion;
    int buyHealthPotion;

    int illbaneCount = 4;

    boolean running = true;

    System.out.println("Now entering the Kobolds Lair...");

    GAME:
    while(running) 

    {

        System.out.println("-------------------------------------------------");

        String enemy = enemies[rand.nextInt(enemies.length)];       // Enemy Spawning.

        System.out.println("\t# " + enemy + " appears! #\n");

        if ("Kobold".equals(enemy))                                 // Enemy stat setting.

        {

            enemyHealth = rand.nextInt(100) + 50;

            enemyAttackDamage = 25;

        }

        else if ("Kobold Archer".equals(enemy))

        {

            enemyHealth = rand.nextInt(150) + 70;

            enemyAttackDamage = 30;

        }

        else if ("Kobold Warrior".equals(enemy))

        {

            enemyHealth = rand.nextInt(200) + 90;

            enemyAttackDamage = 40;

        }

        else if ("Kobold Overseer".equals(enemy))

        {

            enemyHealth = rand.nextInt(250) + 150;

            enemyAttackDamage = 50;

        }

        while(enemyHealth > 0)

        {
            // Enemy introduction and presentation of options.

            System.out.println("\tYour HP is: " + playerHealth);
            System.out.println("\t" + enemy + "'s HP: " + enemyHealth);
            System.out.println("\n\tWhat would you like to do?");

            // Player options

            System.out.println("\t1. Attack");
            System.out.println("\t2. Drink health potion");
            System.out.println("\t3. Run!");
            System.out.println("\t4. Drink strength potion");

            String input = console.nextLine();

            if (input.equals("1"))

            {

                int damageDealt = rand.nextInt(playerAttackDamage);
                int damageTaken = rand.nextInt(enemyAttackDamage) - (playerArmorValue);

                enemyHealth -= damageDealt;
                playerHealth -= damageTaken;

                if (damageTaken <= 0)
                {

                    damageTaken = rand.nextInt(5) + 5;

                }

                System.out.println("\t> You strike the " + enemy + " for " + damageDealt + " damage.");
                System.out.println("\t> You recieve " + damageTaken + " in retaliation!");

                if(playerHealth < 1)

                {

                    System.out.println("\t> You have taken too much damage, you are too weak to go on!");
                    break;

                }

            }

            else if (input.equals("2"))

            {

                if(numHealthPotions > 0)
                {

                    playerHealth += healthPotionEffect;
                    numHealthPotions--;
                    System.out.println("\t> You drink a health potion and recover " + healthPotionEffect + " health!"
                                       + "\n\t> You now have " + playerHealth + " HP."
                                       + "\n\t> You have " + numHealthPotions + " health potions left.\n)");

                }

                else
                {

                    System.out.println("\t> You have no health potions left! ");

                }

            }

            else if (input.equals("3"))

            {

                System.out.println("\tYou run away from the " + enemy + "!");
                continue GAME; 

            }

            else if (input.equals("4"))

            {

                int playerAttack = playerAttackDamage;

                if (numStrengthPotions > 0)

                playerAttackDamage = playerAttack * strengthPotionEffect;
                numStrengthPotions--;

                System.out.println("You drank a strength potion and your attack has multiplied by: " + strengthPotionEffect + " time(s).!");

            }


            else

            {

                System.out.println("\tInvalid command...");

            }

        }

        if (playerHealth < 1)

        {

            System.out.println("\n\tYou crawl out of the dungeon to live and fight another day.");
            break;

        }

        System.out.println("-------------------------------------------------");
        System.out.println(" # " + enemy + " was defeated! #");
        System.out.println(" # You have " + playerHealth + " HP left. #");

        playerAttackDamage = initialPlayerAttack;

        if(rand.nextInt(100) < healthPotionDropChance)          // Health Potion drop chance; differs from enemy to enemy.

        {

            if ("Kobold Archer".equals(enemy))

            {

                healthPotionDropChance = 55;

            }

            else if ("Kobold Warrior".equals(enemy))

            {

                healthPotionDropChance = 60;

            }

            else if ("Kobold Overseer".equals(enemy))

            {

                healthPotionDropChance = 75;

            }

            numHealthPotions++;

            System.out.println(" # The " + enemy + " dropped a health potion! # ");
            System.out.println(" # You have " + numHealthPotions + " health potion(s). # ");

        }

        if(rand.nextInt(100) < goldDropChance)          // Gold drop chance; also differs from enemy to enemy.

        {

            if ("Kobold Archer".equals(enemy))

            {

                goldDropChance = 55;

            }

            else if ("Kobold Warrior".equals(enemy))

            {

                goldDropChance = 60;

            }

            else if ("Kobold Overseer".equals(enemy))

            {

                goldDropChance = 75;

            }

            goldDropAmount = rand.nextInt(500) + 1;
            goldAmount += goldDropAmount;

            System.out.println(" # The " + enemy + " dropped " + goldDropAmount + " gold! #");
            System.out.println(" # You now have " + goldAmount + " gold. #");

        }

        System.out.println("-------------------------------------------------");            
        System.out.println("What to do now?");          // Next set of options;
        System.out.println("1. Continue fighting");     // 1. Resets loop, keeps progress.
        System.out.println("2. Exit dungeon");          // 2. Breaks loop, progress lost; game over.
        System.out.println("3. Visit the shop");        // 3. Triggers shop sequence.
        System.out.println("4. Sacrifice Illbane...");  // 4. Triggers hard battle.

        String input = console.nextLine();


        while(!input.equals("1") && !input.equals("2") && !input.equals("3") && !input.equals("4"))
        {

            System.out.println("Invalid command...");
            input = console.nextLine();

        }

        if (input.equals("1"))

        {

            System.out.println("You continue on your trek through the dungeon.");

            continue GAME;

        }

        else if (input.equals("2"))

        {

            System.out.println("You exit the dungeon.");
            break;

        }

        else if (input.equals("4") && illbaneCount >= 4)        // Boss Battle Sequence, few special rules...

        {
                illbaneCount -= 4;

                System.out.println("-------------------------------------------------");
                System.out.println("\t# A great beast stirs! #");

                int redDrakeHealth = 2500;
                String enemyBoss = bossList[0];

                System.out.println("\t# " + enemyBoss + " appears! #\n");

                while(redDrakeHealth > 0)

                {
                    // Enemy introduction and presentation of options.

                    System.out.println("\tYour HP is: " + playerHealth);
                    System.out.println("\t" + enemyBoss + "'s HP: " + redDrakeHealth);
                    System.out.println("\n\tWhat would you like to do?");

                    // Player options

                    System.out.println("\t1. Attack");
                    System.out.println("\t2. Drink health potion");
                    System.out.println("\t3. Run!");
                    System.out.println("\t4. Drink strength potion");

                    String inputBossFight = console.nextLine();

                    if (inputBossFight.equals("1"))

                    {

                        int bossDamageDealt = rand.nextInt(playerAttackDamage) - (redDrakeArmor);
                        int bossDamageTaken = rand.nextInt(redDrakeAttack) - (playerArmorValue);

                        redDrakeHealth -= bossDamageDealt;
                        playerHealth -= bossDamageTaken;

                        if (bossDamageTaken <= 0)
                        {

                            bossDamageTaken = rand.nextInt(20) + 10;

                        }

                        System.out.println("\t> You strike the " + enemyBoss + " for " + bossDamageDealt + " damage.");
                        System.out.println("\t> You recieve " + bossDamageTaken + " in retaliation!");

                        if(playerHealth < 1)

                        {

                            System.out.println("\t> You have taken too much damage, you are too weak to go on!");
                            break;

                        }

                    }

                    else if (inputBossFight.equals("2"))

                    {

                        if(numHealthPotions > 0)
                        {

                            playerHealth += healthPotionEffect;
                            numHealthPotions--;
                            System.out.println("\t> You drink a health potion and recover " + healthPotionEffect + " health!"
                                               + "\n\t> You now have " + playerHealth + " HP."
                                               + "\n\t> You have " + numHealthPotions + " health potions left.\n)");

                        }

                        else
                        {

                            System.out.println("\t> You have no health potions left! ");

                        }

                    }

                    else if (inputBossFight.equals("3"))

                    {

                        System.out.println("\tYou run away from the " + enemy + "!");
                        continue GAME; 

                    }

                    else if (input.equals("4"))

                    {

                        int playerAttack = playerAttackDamage;

                        if (numStrengthPotions > 0)

                        playerAttackDamage = playerAttack * strengthPotionEffect;
                        numStrengthPotions--;

                        System.out.println("You drank a strength potion and your attack has multiplied by: " + strengthPotionEffect + " time(s).!");

                    }


                    else

                    {

                        System.out.println("\tInvalid command...");

                    }

                }

                if (playerHealth < 1)

                {

                    System.out.println("\n\tYou crawl out of the dungeon to live and fight another day.");
                    break;

                }

                if (redDrakeHealth <= 100)

                {

                    System.out.println("\n\t!!!# The Red Drake unleashes it's special attack #!!!");

                    playerHealth -= redDrakeSpecialAttackValue;

                    System.out.println("\t>!!!# You recieve " + redDrakeSpecialAttackValue + " in retaliation from the Drake's fiery breath! #!!!");

                }

                System.out.println("-------------------------------------------------");
                System.out.println(" # " + enemyBoss + " was defeated! #");
                System.out.println(" # You have " + playerHealth + " HP left. #");

                playerAttackDamage = initialPlayerAttack;

                if(rand.nextInt(100) < healthPotionDropChance)

                {

                    numHealthPotions++;
                    numStrengthPotions++;

                    System.out.println(" # The " + enemyBoss + " dropped a health potion, and a strength potion! # ");
                    System.out.println(" # You have " + numHealthPotions + " health potion(s), and " + numStrengthPotions + "! #");

                }

                if(rand.nextInt(100) < goldDropChance)

                {

                    goldDropAmount = rand.nextInt(500) + 1000;
                    goldAmount += goldDropAmount;

                    System.out.println(" # The " + enemyBoss + " dropped " + goldDropAmount + " gold! #");
                    System.out.println(" # You now have " + goldAmount + " gold. #");

                }

                if (rand.nextInt(100) < crimsonSwordDropChance)

                {

                    System.out.println("\n\t!!!# The fearsome Red Drake has dropped a ruby sword of power, your attack has increased five fold! #!!!");

                    playerAttackDamage *= 5;

                }

                else if (illbaneCount != 4)

                {

                    System.out.println("You do not have enough illbane to make a worthy sacrifice!");

                    continue GAME;

                }

        }



        else if (input.equals("3"))         // Shop Sequence

        {

            System.out.println("\nWelcome to the sshhop outssider...");
            System.out.println("What would you like to buy?");

            randomItem = shopItems[rand.nextInt(shopItems.length)];

            SHOP:
            System.out.println("\nWould to like to buy a(n): " + randomItem + "?");

            if (randomItem.equals("Silver Sword"))

            {

                System.out.println("\nThat will be 1000 gold.");

            }

            else if (randomItem.equals("Steel Sword"))

            {

                System.out.println("\nThat will be 250 gold.");

            }

            else if (randomItem.equals("Iron Helmet"))

            {

                System.out.println("\nThat will be 150 gold.");

            }

            else if (randomItem.equals("Iron Chestplate"))

            {

                System.out.println("\nThat will be 200 gold.");

            }

            else if (randomItem.equals("Iron Boots"))

            {

                System.out.println("\nThat will be 100 gold.");

            }

            else if (randomItem.equals("Iron Gauntlets"))

            {

                System.out.println("\nThat will be 75 gold.");

            }

            else if (randomItem.equals("Steel Helmet"))

            {

                System.out.println("\nThat will be 400 gold.");

            }

            else if (randomItem.equals("Steel Chestplate"))

            {

                System.out.println("\nThat will be 600 gold.");

            }

            else if (randomItem.equals("Steel Boots"))

            {

                System.out.println("\nThat will be 300 gold.");

            }

            else if (randomItem.equals("Steel Gauntlets"))

            {

                System.out.println("\nThat will be 250 gold.");

            }

            else if (randomItem.equals("Illbane"))

            {

                System.out.println("\nThat will be 2500 gold. Interesting...");

            }

            System.out.println("1. Yes");
            System.out.println("2. No");

            String input1 = console.nextLine();

            if (input1.equals("1") && randomItem.equals("Silver Sword"))

            {

                System.out.println("Thank you for your purchase.");

                goldAmount -= 1000;
                playerAttackDamage += 100;

                shopItems[0] = "Empty";

                continue GAME;

            }

            else if (input1.equals("1") && randomItem.equals("Steel Sword"))

            {

                System.out.println("Thank you for your purchase.");

                goldAmount -= 250;
                playerAttackDamage += 25;

                shopItems[1] = "Empty";

                continue GAME;

            }

            else if (input1.equals("1") && randomItem.equals("Iron Helmet"))

            {

                System.out.println("Thank you for your purchase.");

                goldAmount -= 150;
                playerArmorValue += 10;

                shopItems[2] = "Empty";

                continue GAME;

            }

            else if (input1.equals("1") && randomItem.equals("Iron Chestplate"))

            {

                System.out.println("Thank you for your purchase.");

                goldAmount -= 200;
                playerArmorValue += 18;

                shopItems[3] = "Empty";

                continue GAME;

            }

            else if (input1.equals("1") && randomItem.equals("Iron Boots"))

            {

                System.out.println("Thank you for your purchase.");

                goldAmount -= 100;
                playerArmorValue += 8;

                shopItems[4] = "Empty";

                continue GAME;

            }

            else if (input1.equals("1") && randomItem.equals("Iron Gauntlets"))

            {

                System.out.println("Thank you for your purchase.");

                goldAmount -= 75;
                playerArmorValue += 5;

                shopItems[5] = "Empty";

                continue GAME;

            }

            else if (input1.equals("1") && randomItem.equals("Steel Helmet"))

            {

                System.out.println("Thank you for your purchase.");

                goldAmount -= 300;
                playerArmorValue += 15 - 10;

                shopItems[6] = "Empty";

                continue GAME;

            }

            else if (input1.equals("1") && randomItem.equals("Steel Chestplate"))

            {

                System.out.println("Thank you for your purchase.");

                goldAmount -= 600;
                playerArmorValue += 30 - 20;

                shopItems[7] = "Empty";

                continue GAME;

            }

            else if (input1.equals("1") && randomItem.equals("Steel Boots"))

            {

                System.out.println("Thank you for your purchase.");

                goldAmount -= 300;
                playerArmorValue += 18 - 8;

                shopItems[8] = "Empty";

                continue GAME;

            }

            else if (input1.equals("1") && randomItem.equals("Steel Gauntlets"))

            {

                System.out.println("Thank you for your purchase.");

                goldAmount -= 250;
                playerArmorValue += 12 - 5;

                shopItems[9] = "Empty";

                continue GAME;

            }

            else if (input1.equals("1") && randomItem.equals("Illbane"))

            {

                System.out.println("Thank you for your purchase. See what you can do with a couple more of those...");

                goldAmount -= 2500;
                illbaneCount++;

                shopItems[10] = "Empty";

                continue GAME;

            }

            else if (input1.equals("2"))

            {

                System.out.println("\nWould you like to buy some potions atleast?");
                System.out.println("1. Yes");
                System.out.println("2. No!");

                String input2 = console.nextLine();



                POTIONCHOICE:

                if (input2.equals("2"))

                {

                    System.out.println("\nAlrighty.");

                    continue GAME;

                }

                if (input2.equals("1"))

                {

                    System.out.println("\nHealth Potions or Strength Potions?");
                    System.out.println("1. Health Potions: 100 gold");
                    System.out.println("2. Strength Potions: 500 gold");
                    System.out.println("3. Nevermind!");

                    String input3 = console.nextLine();

                    if (input2.equals("3"))

                    {

                        System.out.println("Then get on wiv' it!");

                        continue GAME;

                    }

                    else if (input3.equals("1"))

                    {

                        System.out.println("How many would you like to buy?");
                        int inputNumH = console.nextInt();

                        goldAmount -= inputNumH * 100;
                        numHealthPotions += inputNumH;

                        System.out.println("Here you are: " + inputNumH + " health potions.");

                        continue GAME;

                    }

                     else if (input3.equals("2"))

                     {

                         System.out.println("How many would you like to buy?");
                         int inputNumS = console.nextInt();

                         goldAmount -= inputNumS * 500;
                         numStrengthPotions += inputNumS;

                         System.out.println("Here you are: " + inputNumS + " strength potions.");

                         continue GAME;

                     }

                     else if (input3.equals("3"))

                     {

                         System.out.println("Stop wasting my time!");

                         continue GAME;

                     }

                     else

                     {

                         System.out.println("What are you trying to say?!");

                         continue GAME;

                     }



                    }



            }

            System.out.println("\n\t# THANKS FOR PLAYING! # ");

            break;

        }

    }

 }

}

import java.util.Scanner;
import java.util.Random;

public class Class1 

{

    @SuppressWarnings("unused")
    public static void main(String[] args) 

    {

        // Main objects

        Scanner console = new Scanner(System.in);
        Random rand = new Random();

        // Game variables

        String[] enemies = { "Kobold", "Kobold Warrior", "Kobold Archer", "Kobold Overseer" };
        String[] shopItems = { "Silver Sword", "Steel Sword", "Iron Helmet", "Iron Chestplate", "Iron Boots", "Iron Gauntlets", "Steel Helmet", "Steel Chestplate", "Steel Boots", "Steel Gauntlets", "Illbane" };
        String randomItem = null;

        int enemyAttackDamage = 25;
        int enemyHealth = 0;

        // Boss Variables

        String[] bossList = { "Red Drake" };

        int redDrakeArmor = 20;
        int redDrakeAttack = 75;
        int redDrakeSpecialAttackValue = 200;

        // Player variables

        int playerHealth = 100;
        int playerAttackDamage = 50;
        int initialPlayerAttack = playerAttackDamage;
        int playerArmorValue = 0;

        int numHealthPotions = 5;                                       // How many potions the player will start with.
        int healthPotionEffect = 30;                                    // How much each potion will heal.
        int healthPotionDropChance = 50;                                // Percentage drop from enemies.

        int numStrengthPotions = 0;
        int strengthPotionEffect = (rand.nextInt(3) + 1);               

        int goldDropChance = 75;                                        // Percentage drop of gold from enemies.
        int goldDropAmount;
        int goldAmount = 1000;

        int crimsonSwordDropChance = 25;

        int buyStrengthPotion;
        int buyHealthPotion;

        int illbaneCount = 4;

        boolean running = true;

        System.out.println("Now entering the Kobolds Lair...");

        GAME:
        while(running) 

        {

            System.out.println("-------------------------------------------------");

            String enemy = enemies[rand.nextInt(enemies.length)];       // Enemy Spawning.

            System.out.println("\t# " + enemy + " appears! #\n");

            if ("Kobold".equals(enemy))                                 // Enemy stat setting.

            {

                enemyHealth = rand.nextInt(100) + 50;

                enemyAttackDamage = 25;

            }

            else if ("Kobold Archer".equals(enemy))

            {

                enemyHealth = rand.nextInt(150) + 70;

                enemyAttackDamage = 30;

            }

            else if ("Kobold Warrior".equals(enemy))

            {

                enemyHealth = rand.nextInt(200) + 90;

                enemyAttackDamage = 40;

            }

            else if ("Kobold Overseer".equals(enemy))

            {

                enemyHealth = rand.nextInt(250) + 150;

                enemyAttackDamage = 50;

            }

            while(enemyHealth > 0)

            {
                // Enemy introduction and presentation of options.

                System.out.println("\tYour HP is: " + playerHealth);
                System.out.println("\t" + enemy + "'s HP: " + enemyHealth);
                System.out.println("\n\tWhat would you like to do?");

                // Player options

                System.out.println("\t1. Attack");
                System.out.println("\t2. Drink health potion");
                System.out.println("\t3. Run!");
                System.out.println("\t4. Drink strength potion");

                String input = console.nextLine();

                if (input.equals("1"))

                {

                    int damageDealt = rand.nextInt(playerAttackDamage);
                    int damageTaken = rand.nextInt(enemyAttackDamage) - (playerArmorValue);

                    enemyHealth -= damageDealt;
                    playerHealth -= damageTaken;

                    if (damageTaken <= 0)
                    {

                        damageTaken = rand.nextInt(5) + 5;

                    }

                    System.out.println("\t> You strike the " + enemy + " for " + damageDealt + " damage.");
                    System.out.println("\t> You recieve " + damageTaken + " in retaliation!");

                    if(playerHealth < 1)

                    {

                        System.out.println("\t> You have taken too much damage, you are too weak to go on!");
                        break;

                    }

                }

                else if (input.equals("2")) 

                {

                    if(numHealthPotions > 0)
                    {

                        playerHealth += healthPotionEffect;
                        numHealthPotions--;
                        System.out.println("\t> You drink a health potion and recover " + healthPotionEffect + " health!"
                                           + "\n\t> You now have " + playerHealth + " HP."
                                           + "\n\t> You have " + numHealthPotions + " health potions left.\n)");

                    }

                    else
                    {

                        System.out.println("\t> You have no health potions left! ");

                    }

                }

                else if (input.equals("3"))

                {

                    System.out.println("\tYou run away from the " + enemy + "!");
                    continue GAME; 

                }

                else if (input.equals("4"))

                {

                    int playerAttack = playerAttackDamage;

                    if (numStrengthPotions > 0)

                    playerAttackDamage = playerAttack * strengthPotionEffect;
                    numStrengthPotions--;

                    System.out.println("You drank a strength potion and your attack has multiplied by: " + strengthPotionEffect + " time(s).!");

                }


                else

                {

                    System.out.println("\tInvalid command...");

                }

            }

            if (playerHealth < 1)

            {

                System.out.println("\n\tYou crawl out of the dungeon to live and fight another day.");
                break;

            }

            System.out.println("-------------------------------------------------");
            System.out.println(" # " + enemy + " was defeated! #");
            System.out.println(" # You have " + playerHealth + " HP left. #");

            playerAttackDamage = initialPlayerAttack;

            if(rand.nextInt(100) < healthPotionDropChance)          // Health Potion drop chance; differs from enemy to enemy.

            {

                if ("Kobold Archer".equals(enemy))

                {

                    healthPotionDropChance = 55;

                }

                else if ("Kobold Warrior".equals(enemy))

                {

                    healthPotionDropChance = 60;

                }

                else if ("Kobold Overseer".equals(enemy))

                {

                    healthPotionDropChance = 75;

                }

                numHealthPotions++;

                System.out.println(" # The " + enemy + " dropped a health potion! # ");
                System.out.println(" # You have " + numHealthPotions + " health potion(s). # ");

            }

            if(rand.nextInt(100) < goldDropChance)          // Gold drop chance; also differs from enemy to enemy.

            {

                if ("Kobold Archer".equals(enemy))

                {

                    goldDropChance = 55;

                }

                else if ("Kobold Warrior".equals(enemy))

                {

                    goldDropChance = 60;

                }

                else if ("Kobold Overseer".equals(enemy))

                {

                    goldDropChance = 75;

                }

                goldDropAmount = rand.nextInt(500) + 1;
                goldAmount += goldDropAmount;

                System.out.println(" # The " + enemy + " dropped " + goldDropAmount + " gold! #");
                System.out.println(" # You now have " + goldAmount + " gold. #");

            }

            System.out.println("-------------------------------------------------");            
            System.out.println("What to do now?");          // Next set of options;
            System.out.println("1. Continue fighting");     // 1. Resets loop, keeps progress.
            System.out.println("2. Exit dungeon");          // 2. Breaks loop, progress lost; game over.
            System.out.println("3. Visit the shop");        // 3. Triggers shop sequence.
            System.out.println("4. Sacrifice Illbane...");  // 4. Triggers hard battle.

            String input = console.nextLine();


            while(!input.equals("1") && !input.equals("2") && !input.equals("3") && !input.equals("4"))
            {

                System.out.println("Invalid command...");
                input = console.nextLine();

            }

            if (input.equals("1"))

            {

                System.out.println("You continue on your trek through the dungeon.");

                continue GAME;

            }

            else if (input.equals("2"))

            {

                System.out.println("You exit the dungeon.");
                break;

            }

            else if (input.equals("4") && illbaneCount >= 4)        // Boss Battle Sequence, few special rules...

            {
                    illbaneCount -= 4;

                    System.out.println("-------------------------------------------------");
                    System.out.println("\t# A great beast stirs! #");

                    int redDrakeHealth = 2500;
                    String enemyBoss = bossList[0];

                    System.out.println("\t# " + enemyBoss + " appears! #\n");

                    while(redDrakeHealth > 0)

                    {
                        // Enemy introduction and presentation of options.

                        System.out.println("\tYour HP is: " + playerHealth);
                        System.out.println("\t" + enemyBoss + "'s HP: " + redDrakeHealth);
                        System.out.println("\n\tWhat would you like to do?");

                        // Player options

                        System.out.println("\t1. Attack");
                        System.out.println("\t2. Drink health potion");
                        System.out.println("\t3. Run!");
                        System.out.println("\t4. Drink strength potion");

                        String inputBossFight = console.nextLine();

                        if (inputBossFight.equals("1"))

                        {

                            int bossDamageDealt = rand.nextInt(playerAttackDamage) - (redDrakeArmor);
                            int bossDamageTaken = rand.nextInt(redDrakeAttack) - (playerArmorValue);

                            redDrakeHealth -= bossDamageDealt;
                            playerHealth -= bossDamageTaken;

                            if (bossDamageTaken <= 0)
                            {

                                bossDamageTaken = rand.nextInt(20) + 10;

                            }

                            System.out.println("\t> You strike the " + enemyBoss + " for " + bossDamageDealt + " damage.");
                            System.out.println("\t> You recieve " + bossDamageTaken + " in retaliation!");

                            if(playerHealth < 1)

                            {

                                System.out.println("\t> You have taken too much damage, you are too weak to go on!");
                                break;

                            }

                        }

                        else if (inputBossFight.equals("2"))

                        {

                            if(numHealthPotions > 0)
                            {

                                playerHealth += healthPotionEffect;
                                numHealthPotions--;
                                System.out.println("\t> You drink a health potion and recover " + healthPotionEffect + " health!"
                                                   + "\n\t> You now have " + playerHealth + " HP."
                                                   + "\n\t> You have " + numHealthPotions + " health potions left.\n)");

                            }

                            else
                            {

                                System.out.println("\t> You have no health potions left! ");

                            }

                        }

                        else if (inputBossFight.equals("3"))

                        {

                            System.out.println("\tYou run away from the " + enemy + "!");
                            continue GAME; 

                        }

                        else if (input.equals("4"))

                        {

                            int playerAttack = playerAttackDamage;

                            if (numStrengthPotions > 0)

                            playerAttackDamage = playerAttack * strengthPotionEffect;
                            numStrengthPotions--; 

                            System.out.println("You drank a strength potion and your attack has multiplied by: " + strengthPotionEffect + " time(s).!");

                        }
 

                        else
 
                        {

                            System.out.println("\tInvalid command...");

                        }

                    }

                    if (playerHealth < 1)

                    {

                        System.out.println("\n\tYou crawl out of the dungeon to live and fight another day.");
                        break;

                    }

                    if (redDrakeHealth <= 100)

                    {

                        System.out.println("\n\t!!!# The Red Drake unleashes it's special attack #!!!");

                        playerHealth -= redDrakeSpecialAttackValue;

                        System.out.println("\t>!!!# You recieve " + redDrakeSpecialAttackValue + " in retaliation from the Drake's fiery breath! #!!!");

                    }

                    System.out.println("-------------------------------------------------");
                    System.out.println(" # " + enemyBoss + " was defeated! #");
                    System.out.println(" # You have " + playerHealth + " HP left. #");

                    playerAttackDamage = initialPlayerAttack;

                    if(rand.nextInt(100) < healthPotionDropChance)

                    {

                        numHealthPotions++;
                        numStrengthPotions++;

                        System.out.println(" # The " + enemyBoss + " dropped a health potion, and a strength potion! # ");
                        System.out.println(" # You have " + numHealthPotions + " health potion(s), and " + numStrengthPotions + "! #");

                    }

                    if(rand.nextInt(100) < goldDropChance)

                    {

                        goldDropAmount = rand.nextInt(500) + 1000;
                        goldAmount += goldDropAmount;

                        System.out.println(" # The " + enemyBoss + " dropped " + goldDropAmount + " gold! #");
                        System.out.println(" # You now have " + goldAmount + " gold. #");

                    }

                    if (rand.nextInt(100) < crimsonSwordDropChance)

                    {

                        System.out.println("\n\t!!!# The fearsome Red Drake has dropped a ruby sword of power, your attack has increased five fold! #!!!");

                        playerAttackDamage *= 5;

                    }

                    else if (illbaneCount != 4)

                    {

                        System.out.println("You do not have enough illbane to make a worthy sacrifice!");

                        continue GAME;

                    }

            }



            else if (input.equals("3"))         // Shop Sequence

            {

                System.out.println("\nWelcome to the sshhop outssider...");
                System.out.println("What would you like to buy?");

                randomItem = shopItems[rand.nextInt(shopItems.length)];

                SHOP:
                System.out.println("\nWould to like to buy a(n): " + randomItem + "?");

                if (randomItem.equals("Silver Sword"))

                {

                    System.out.println("\nThat will be 1000 gold.");

                }

                else if (randomItem.equals("Steel Sword"))

                {

                    System.out.println("\nThat will be 250 gold.");

                }

                else if (randomItem.equals("Iron Helmet"))

                {

                    System.out.println("\nThat will be 150 gold.");

                }

                else if (randomItem.equals("Iron Chestplate"))

                {

                    System.out.println("\nThat will be 200 gold.");

                }

                else if (randomItem.equals("Iron Boots"))

                {

                    System.out.println("\nThat will be 100 gold.");

                }

                else if (randomItem.equals("Iron Gauntlets"))

                {

                    System.out.println("\nThat will be 75 gold.");

                }

                else if (randomItem.equals("Steel Helmet"))

                {

                    System.out.println("\nThat will be 400 gold.");

                }

                else if (randomItem.equals("Steel Chestplate"))

                {

                    System.out.println("\nThat will be 600 gold.");

                }

                else if (randomItem.equals("Steel Boots"))

                {

                    System.out.println("\nThat will be 300 gold.");

                }

                else if (randomItem.equals("Steel Gauntlets"))

                {

                    System.out.println("\nThat will be 250 gold.");

                }

                else if (randomItem.equals("Illbane"))

                {

                    System.out.println("\nThat will be 2500 gold. Interesting...");

                }

                System.out.println("1. Yes");
                System.out.println("2. No");

                String input1 = console.nextLine();

                if (input1.equals("1") && randomItem.equals("Silver Sword"))

                {

                    System.out.println("Thank you for your purchase.");

                    goldAmount -= 1000;
                    playerAttackDamage += 100;

                    shopItems[0] = "Empty";

                    continue GAME;

                }

                else if (input1.equals("1") && randomItem.equals("Steel Sword"))

                {

                    System.out.println("Thank you for your purchase.");

                    goldAmount -= 250;
                    playerAttackDamage += 25;

                    shopItems[1] = "Empty";

                    continue GAME;

                }

                else if (input1.equals("1") && randomItem.equals("Iron Helmet"))

                {

                    System.out.println("Thank you for your purchase.");

                    goldAmount -= 150;
                    playerArmorValue += 10;

                    shopItems[2] = "Empty";

                    continue GAME;

                }

                else if (input1.equals("1") && randomItem.equals("Iron Chestplate"))

                {

                    System.out.println("Thank you for your purchase.");

                    goldAmount -= 200;
                    playerArmorValue += 18;

                    shopItems[3] = "Empty";

                    continue GAME;

                }

                else if (input1.equals("1") && randomItem.equals("Iron Boots"))

                {

                    System.out.println("Thank you for your purchase.");

                    goldAmount -= 100;
                    playerArmorValue += 8;

                    shopItems[4] = "Empty";

                    continue GAME;

                }

                else if (input1.equals("1") && randomItem.equals("Iron Gauntlets"))

                {

                    System.out.println("Thank you for your purchase.");

                    goldAmount -= 75;
                    playerArmorValue += 5;

                    shopItems[5] = "Empty";

                    continue GAME;

                }

                else if (input1.equals("1") && randomItem.equals("Steel Helmet"))

                {

                    System.out.println("Thank you for your purchase.");

                    goldAmount -= 300;
                    playerArmorValue += 15 - 10;

                    shopItems[6] = "Empty";

                    continue GAME;

                }

                else if (input1.equals("1") && randomItem.equals("Steel Chestplate"))

                {

                    System.out.println("Thank you for your purchase.");

                    goldAmount -= 600;
                    playerArmorValue += 30 - 20;

                    shopItems[7] = "Empty";

                    continue GAME;

                }

                else if (input1.equals("1") && randomItem.equals("Steel Boots"))

                {

                    System.out.println("Thank you for your purchase.");

                    goldAmount -= 300;
                    playerArmorValue += 18 - 8;

                    shopItems[8] = "Empty";

                    continue GAME;

                }

                else if (input1.equals("1") && randomItem.equals("Steel Gauntlets"))

                {

                    System.out.println("Thank you for your purchase.");

                    goldAmount -= 250;
                    playerArmorValue += 12 - 5;

                    shopItems[9] = "Empty";

                    continue GAME;

                }

                else if (input1.equals("1") && randomItem.equals("Illbane"))

                {

                    System.out.println("Thank you for your purchase. See what you can do with a couple more of those...");

                    goldAmount -= 2500;
                    illbaneCount++;

                    shopItems[10] = "Empty";

                    continue GAME;

                }

                else if (input1.equals("2"))

                {

                    System.out.println("\nWould you like to buy some potions atleast?");
                    System.out.println("1. Yes");
                    System.out.println("2. No!");

                    String input2 = console.nextLine();



                    POTIONCHOICE:

                    if (input2.equals("2"))

                    {

                        System.out.println("\nAlrighty.");

                        continue GAME;

                    }

                    if (input2.equals("1"))

                    {

                        System.out.println("\nHealth Potions or Strength Potions?");
                        System.out.println("1. Health Potions: 100 gold");
                        System.out.println("2. Strength Potions: 500 gold");
                        System.out.println("3. Nevermind!");

                        String input3 = console.nextLine();

                        if (input2.equals("3"))

                        {

                            System.out.println("Then get on wiv' it!");

                            continue GAME;

                        }

                        else if (input3.equals("1"))

                        {

                            System.out.println("How many would you like to buy?");
                            int inputNumH = console.nextInt();

                            goldAmount -= inputNumH * 100;
                            numHealthPotions += inputNumH;

                            System.out.println("Here you are: " + inputNumH + " health potions.");

                            continue GAME;

                        }

                         else if (input3.equals("2"))

                         {

                             System.out.println("How many would you like to buy?");
                             int inputNumS = console.nextInt();

                             goldAmount -= inputNumS * 500;
                             numStrengthPotions += inputNumS;

                             System.out.println("Here you are: " + inputNumS + " strength potions.");

                             continue GAME;

                         }

                         else if (input3.equals("3"))

                         {

                             System.out.println("Stop wasting my time!");

                             continue GAME;

                         }

                         else

                         {

                             System.out.println("What are you trying to say?!");

                             continue GAME;

                         }



                        }



                }

                System.out.println("\n\t# THANKS FOR PLAYING! # ");

                break;

            }

        }

    }
}
    Post Closed as "Off-topic" by Jamal
1
source | link

How can I implement other methods/classes in my code?

A little bit of background; I'm a high school student in my junior year and I attended a tech competition last year when I enrolled in my high school's CS I course. Below is what I submitted to the competition and even though I won in my category, I remember the judges telling me that I could do better by implementing more OOP design and seperate my program into serveral methods/classes.

I don't have much experience with this however, and we are mostly doing review over Java this year in my AP CS course than actually learning new things. Below is my code, and I'd be so thankful if I could get some advice on how to improve it and more specifically, implement methods/classes than having one giant, 900 line class.

import java.util.Scanner;

import java.util.Random;

public class Class1

{

@SuppressWarnings("unused")
public static void main(String[] args) 

{

    // Main objects

    Scanner console = new Scanner(System.in);
    Random rand = new Random();

    // Game variables

    String[] enemies = { "Kobold", "Kobold Warrior", "Kobold Archer", "Kobold Overseer" };
    String[] shopItems = { "Silver Sword", "Steel Sword", "Iron Helmet", "Iron Chestplate", "Iron Boots", "Iron Gauntlets", "Steel Helmet", "Steel Chestplate", "Steel Boots", "Steel Gauntlets", "Illbane" };
    String randomItem = null;

    int enemyAttackDamage = 25;
    int enemyHealth = 0;

    // Boss Variables

    String[] bossList = { "Red Drake" };

    int redDrakeArmor = 20;
    int redDrakeAttack = 75;
    int redDrakeSpecialAttackValue = 200;

    // Player variables

    int playerHealth = 100;
    int playerAttackDamage = 50;
    int initialPlayerAttack = playerAttackDamage;
    int playerArmorValue = 0;

    int numHealthPotions = 5;                                       // How many potions the player will start with.
    int healthPotionEffect = 30;                                    // How much each potion will heal.
    int healthPotionDropChance = 50;                                // Percentage drop from enemies.

    int numStrengthPotions = 0;
    int strengthPotionEffect = (rand.nextInt(3) + 1);               

    int goldDropChance = 75;                                        // Percentage drop of gold from enemies.
    int goldDropAmount;
    int goldAmount = 1000;

    int crimsonSwordDropChance = 25;

    int buyStrengthPotion;
    int buyHealthPotion;

    int illbaneCount = 4;

    boolean running = true;

    System.out.println("Now entering the Kobolds Lair...");

    GAME:
    while(running) 

    {

        System.out.println("-------------------------------------------------");

        String enemy = enemies[rand.nextInt(enemies.length)];       // Enemy Spawning.

        System.out.println("\t# " + enemy + " appears! #\n");

        if ("Kobold".equals(enemy))                                 // Enemy stat setting.

        {

            enemyHealth = rand.nextInt(100) + 50;

            enemyAttackDamage = 25;

        }

        else if ("Kobold Archer".equals(enemy))

        {

            enemyHealth = rand.nextInt(150) + 70;

            enemyAttackDamage = 30;

        }

        else if ("Kobold Warrior".equals(enemy))

        {

            enemyHealth = rand.nextInt(200) + 90;

            enemyAttackDamage = 40;

        }

        else if ("Kobold Overseer".equals(enemy))

        {

            enemyHealth = rand.nextInt(250) + 150;

            enemyAttackDamage = 50;

        }

        while(enemyHealth > 0)

        {
            // Enemy introduction and presentation of options.

            System.out.println("\tYour HP is: " + playerHealth);
            System.out.println("\t" + enemy + "'s HP: " + enemyHealth);
            System.out.println("\n\tWhat would you like to do?");

            // Player options

            System.out.println("\t1. Attack");
            System.out.println("\t2. Drink health potion");
            System.out.println("\t3. Run!");
            System.out.println("\t4. Drink strength potion");

            String input = console.nextLine();

            if (input.equals("1"))

            {

                int damageDealt = rand.nextInt(playerAttackDamage);
                int damageTaken = rand.nextInt(enemyAttackDamage) - (playerArmorValue);

                enemyHealth -= damageDealt;
                playerHealth -= damageTaken;

                if (damageTaken <= 0)
                {

                    damageTaken = rand.nextInt(5) + 5;

                }

                System.out.println("\t> You strike the " + enemy + " for " + damageDealt + " damage.");
                System.out.println("\t> You recieve " + damageTaken + " in retaliation!");

                if(playerHealth < 1)

                {

                    System.out.println("\t> You have taken too much damage, you are too weak to go on!");
                    break;

                }

            }

            else if (input.equals("2"))

            {

                if(numHealthPotions > 0)
                {

                    playerHealth += healthPotionEffect;
                    numHealthPotions--;
                    System.out.println("\t> You drink a health potion and recover " + healthPotionEffect + " health!"
                                       + "\n\t> You now have " + playerHealth + " HP."
                                       + "\n\t> You have " + numHealthPotions + " health potions left.\n)");

                }

                else
                {

                    System.out.println("\t> You have no health potions left! ");

                }

            }

            else if (input.equals("3"))

            {

                System.out.println("\tYou run away from the " + enemy + "!");
                continue GAME; 

            }

            else if (input.equals("4"))

            {

                int playerAttack = playerAttackDamage;

                if (numStrengthPotions > 0)

                playerAttackDamage = playerAttack * strengthPotionEffect;
                numStrengthPotions--;

                System.out.println("You drank a strength potion and your attack has multiplied by: " + strengthPotionEffect + " time(s).!");

            }


            else

            {

                System.out.println("\tInvalid command...");

            }

        }

        if (playerHealth < 1)

        {

            System.out.println("\n\tYou crawl out of the dungeon to live and fight another day.");
            break;

        }

        System.out.println("-------------------------------------------------");
        System.out.println(" # " + enemy + " was defeated! #");
        System.out.println(" # You have " + playerHealth + " HP left. #");

        playerAttackDamage = initialPlayerAttack;

        if(rand.nextInt(100) < healthPotionDropChance)          // Health Potion drop chance; differs from enemy to enemy.

        {

            if ("Kobold Archer".equals(enemy))

            {

                healthPotionDropChance = 55;

            }

            else if ("Kobold Warrior".equals(enemy))

            {

                healthPotionDropChance = 60;

            }

            else if ("Kobold Overseer".equals(enemy))

            {

                healthPotionDropChance = 75;

            }

            numHealthPotions++;

            System.out.println(" # The " + enemy + " dropped a health potion! # ");
            System.out.println(" # You have " + numHealthPotions + " health potion(s). # ");

        }

        if(rand.nextInt(100) < goldDropChance)          // Gold drop chance; also differs from enemy to enemy.

        {

            if ("Kobold Archer".equals(enemy))

            {

                goldDropChance = 55;

            }

            else if ("Kobold Warrior".equals(enemy))

            {

                goldDropChance = 60;

            }

            else if ("Kobold Overseer".equals(enemy))

            {

                goldDropChance = 75;

            }

            goldDropAmount = rand.nextInt(500) + 1;
            goldAmount += goldDropAmount;

            System.out.println(" # The " + enemy + " dropped " + goldDropAmount + " gold! #");
            System.out.println(" # You now have " + goldAmount + " gold. #");

        }

        System.out.println("-------------------------------------------------");            
        System.out.println("What to do now?");          // Next set of options;
        System.out.println("1. Continue fighting");     // 1. Resets loop, keeps progress.
        System.out.println("2. Exit dungeon");          // 2. Breaks loop, progress lost; game over.
        System.out.println("3. Visit the shop");        // 3. Triggers shop sequence.
        System.out.println("4. Sacrifice Illbane...");  // 4. Triggers hard battle.

        String input = console.nextLine();


        while(!input.equals("1") && !input.equals("2") && !input.equals("3") && !input.equals("4"))
        {

            System.out.println("Invalid command...");
            input = console.nextLine();

        }

        if (input.equals("1"))

        {

            System.out.println("You continue on your trek through the dungeon.");

            continue GAME;

        }

        else if (input.equals("2"))

        {

            System.out.println("You exit the dungeon.");
            break;

        }

        else if (input.equals("4") && illbaneCount >= 4)        // Boss Battle Sequence, few special rules...

        {
                illbaneCount -= 4;

                System.out.println("-------------------------------------------------");
                System.out.println("\t# A great beast stirs! #");

                int redDrakeHealth = 2500;
                String enemyBoss = bossList[0];

                System.out.println("\t# " + enemyBoss + " appears! #\n");

                while(redDrakeHealth > 0)

                {
                    // Enemy introduction and presentation of options.

                    System.out.println("\tYour HP is: " + playerHealth);
                    System.out.println("\t" + enemyBoss + "'s HP: " + redDrakeHealth);
                    System.out.println("\n\tWhat would you like to do?");

                    // Player options

                    System.out.println("\t1. Attack");
                    System.out.println("\t2. Drink health potion");
                    System.out.println("\t3. Run!");
                    System.out.println("\t4. Drink strength potion");

                    String inputBossFight = console.nextLine();

                    if (inputBossFight.equals("1"))

                    {

                        int bossDamageDealt = rand.nextInt(playerAttackDamage) - (redDrakeArmor);
                        int bossDamageTaken = rand.nextInt(redDrakeAttack) - (playerArmorValue);

                        redDrakeHealth -= bossDamageDealt;
                        playerHealth -= bossDamageTaken;

                        if (bossDamageTaken <= 0)
                        {

                            bossDamageTaken = rand.nextInt(20) + 10;

                        }

                        System.out.println("\t> You strike the " + enemyBoss + " for " + bossDamageDealt + " damage.");
                        System.out.println("\t> You recieve " + bossDamageTaken + " in retaliation!");

                        if(playerHealth < 1)

                        {

                            System.out.println("\t> You have taken too much damage, you are too weak to go on!");
                            break;

                        }

                    }

                    else if (inputBossFight.equals("2"))

                    {

                        if(numHealthPotions > 0)
                        {

                            playerHealth += healthPotionEffect;
                            numHealthPotions--;
                            System.out.println("\t> You drink a health potion and recover " + healthPotionEffect + " health!"
                                               + "\n\t> You now have " + playerHealth + " HP."
                                               + "\n\t> You have " + numHealthPotions + " health potions left.\n)");

                        }

                        else
                        {

                            System.out.println("\t> You have no health potions left! ");

                        }

                    }

                    else if (inputBossFight.equals("3"))

                    {

                        System.out.println("\tYou run away from the " + enemy + "!");
                        continue GAME; 

                    }

                    else if (input.equals("4"))

                    {

                        int playerAttack = playerAttackDamage;

                        if (numStrengthPotions > 0)

                        playerAttackDamage = playerAttack * strengthPotionEffect;
                        numStrengthPotions--;

                        System.out.println("You drank a strength potion and your attack has multiplied by: " + strengthPotionEffect + " time(s).!");

                    }


                    else

                    {

                        System.out.println("\tInvalid command...");

                    }

                }

                if (playerHealth < 1)

                {

                    System.out.println("\n\tYou crawl out of the dungeon to live and fight another day.");
                    break;

                }

                if (redDrakeHealth <= 100)

                {

                    System.out.println("\n\t!!!# The Red Drake unleashes it's special attack #!!!");

                    playerHealth -= redDrakeSpecialAttackValue;

                    System.out.println("\t>!!!# You recieve " + redDrakeSpecialAttackValue + " in retaliation from the Drake's fiery breath! #!!!");

                }

                System.out.println("-------------------------------------------------");
                System.out.println(" # " + enemyBoss + " was defeated! #");
                System.out.println(" # You have " + playerHealth + " HP left. #");

                playerAttackDamage = initialPlayerAttack;

                if(rand.nextInt(100) < healthPotionDropChance)

                {

                    numHealthPotions++;
                    numStrengthPotions++;

                    System.out.println(" # The " + enemyBoss + " dropped a health potion, and a strength potion! # ");
                    System.out.println(" # You have " + numHealthPotions + " health potion(s), and " + numStrengthPotions + "! #");

                }

                if(rand.nextInt(100) < goldDropChance)

                {

                    goldDropAmount = rand.nextInt(500) + 1000;
                    goldAmount += goldDropAmount;

                    System.out.println(" # The " + enemyBoss + " dropped " + goldDropAmount + " gold! #");
                    System.out.println(" # You now have " + goldAmount + " gold. #");

                }

                if (rand.nextInt(100) < crimsonSwordDropChance)

                {

                    System.out.println("\n\t!!!# The fearsome Red Drake has dropped a ruby sword of power, your attack has increased five fold! #!!!");

                    playerAttackDamage *= 5;

                }

                else if (illbaneCount != 4)

                {

                    System.out.println("You do not have enough illbane to make a worthy sacrifice!");

                    continue GAME;

                }

        }



        else if (input.equals("3"))         // Shop Sequence

        {

            System.out.println("\nWelcome to the sshhop outssider...");
            System.out.println("What would you like to buy?");

            randomItem = shopItems[rand.nextInt(shopItems.length)];

            SHOP:
            System.out.println("\nWould to like to buy a(n): " + randomItem + "?");

            if (randomItem.equals("Silver Sword"))

            {

                System.out.println("\nThat will be 1000 gold.");

            }

            else if (randomItem.equals("Steel Sword"))

            {

                System.out.println("\nThat will be 250 gold.");

            }

            else if (randomItem.equals("Iron Helmet"))

            {

                System.out.println("\nThat will be 150 gold.");

            }

            else if (randomItem.equals("Iron Chestplate"))

            {

                System.out.println("\nThat will be 200 gold.");

            }

            else if (randomItem.equals("Iron Boots"))

            {

                System.out.println("\nThat will be 100 gold.");

            }

            else if (randomItem.equals("Iron Gauntlets"))

            {

                System.out.println("\nThat will be 75 gold.");

            }

            else if (randomItem.equals("Steel Helmet"))

            {

                System.out.println("\nThat will be 400 gold.");

            }

            else if (randomItem.equals("Steel Chestplate"))

            {

                System.out.println("\nThat will be 600 gold.");

            }

            else if (randomItem.equals("Steel Boots"))

            {

                System.out.println("\nThat will be 300 gold.");

            }

            else if (randomItem.equals("Steel Gauntlets"))

            {

                System.out.println("\nThat will be 250 gold.");

            }

            else if (randomItem.equals("Illbane"))

            {

                System.out.println("\nThat will be 2500 gold. Interesting...");

            }

            System.out.println("1. Yes");
            System.out.println("2. No");

            String input1 = console.nextLine();

            if (input1.equals("1") && randomItem.equals("Silver Sword"))

            {

                System.out.println("Thank you for your purchase.");

                goldAmount -= 1000;
                playerAttackDamage += 100;

                shopItems[0] = "Empty";

                continue GAME;

            }

            else if (input1.equals("1") && randomItem.equals("Steel Sword"))

            {

                System.out.println("Thank you for your purchase.");

                goldAmount -= 250;
                playerAttackDamage += 25;

                shopItems[1] = "Empty";

                continue GAME;

            }

            else if (input1.equals("1") && randomItem.equals("Iron Helmet"))

            {

                System.out.println("Thank you for your purchase.");

                goldAmount -= 150;
                playerArmorValue += 10;

                shopItems[2] = "Empty";

                continue GAME;

            }

            else if (input1.equals("1") && randomItem.equals("Iron Chestplate"))

            {

                System.out.println("Thank you for your purchase.");

                goldAmount -= 200;
                playerArmorValue += 18;

                shopItems[3] = "Empty";

                continue GAME;

            }

            else if (input1.equals("1") && randomItem.equals("Iron Boots"))

            {

                System.out.println("Thank you for your purchase.");

                goldAmount -= 100;
                playerArmorValue += 8;

                shopItems[4] = "Empty";

                continue GAME;

            }

            else if (input1.equals("1") && randomItem.equals("Iron Gauntlets"))

            {

                System.out.println("Thank you for your purchase.");

                goldAmount -= 75;
                playerArmorValue += 5;

                shopItems[5] = "Empty";

                continue GAME;

            }

            else if (input1.equals("1") && randomItem.equals("Steel Helmet"))

            {

                System.out.println("Thank you for your purchase.");

                goldAmount -= 300;
                playerArmorValue += 15 - 10;

                shopItems[6] = "Empty";

                continue GAME;

            }

            else if (input1.equals("1") && randomItem.equals("Steel Chestplate"))

            {

                System.out.println("Thank you for your purchase.");

                goldAmount -= 600;
                playerArmorValue += 30 - 20;

                shopItems[7] = "Empty";

                continue GAME;

            }

            else if (input1.equals("1") && randomItem.equals("Steel Boots"))

            {

                System.out.println("Thank you for your purchase.");

                goldAmount -= 300;
                playerArmorValue += 18 - 8;

                shopItems[8] = "Empty";

                continue GAME;

            }

            else if (input1.equals("1") && randomItem.equals("Steel Gauntlets"))

            {

                System.out.println("Thank you for your purchase.");

                goldAmount -= 250;
                playerArmorValue += 12 - 5;

                shopItems[9] = "Empty";

                continue GAME;

            }

            else if (input1.equals("1") && randomItem.equals("Illbane"))

            {

                System.out.println("Thank you for your purchase. See what you can do with a couple more of those...");

                goldAmount -= 2500;
                illbaneCount++;

                shopItems[10] = "Empty";

                continue GAME;

            }

            else if (input1.equals("2"))

            {

                System.out.println("\nWould you like to buy some potions atleast?");
                System.out.println("1. Yes");
                System.out.println("2. No!");

                String input2 = console.nextLine();



                POTIONCHOICE:

                if (input2.equals("2"))

                {

                    System.out.println("\nAlrighty.");

                    continue GAME;

                }

                if (input2.equals("1"))

                {

                    System.out.println("\nHealth Potions or Strength Potions?");
                    System.out.println("1. Health Potions: 100 gold");
                    System.out.println("2. Strength Potions: 500 gold");
                    System.out.println("3. Nevermind!");

                    String input3 = console.nextLine();

                    if (input2.equals("3"))

                    {

                        System.out.println("Then get on wiv' it!");

                        continue GAME;

                    }

                    else if (input3.equals("1"))

                    {

                        System.out.println("How many would you like to buy?");
                        int inputNumH = console.nextInt();

                        goldAmount -= inputNumH * 100;
                        numHealthPotions += inputNumH;

                        System.out.println("Here you are: " + inputNumH + " health potions.");

                        continue GAME;

                    }

                     else if (input3.equals("2"))

                     {

                         System.out.println("How many would you like to buy?");
                         int inputNumS = console.nextInt();

                         goldAmount -= inputNumS * 500;
                         numStrengthPotions += inputNumS;

                         System.out.println("Here you are: " + inputNumS + " strength potions.");

                         continue GAME;

                     }

                     else if (input3.equals("3"))

                     {

                         System.out.println("Stop wasting my time!");

                         continue GAME;

                     }

                     else

                     {

                         System.out.println("What are you trying to say?!");

                         continue GAME;

                     }



                    }



            }

            System.out.println("\n\t# THANKS FOR PLAYING! # ");

            break;

        }

    }

}

}

Thanks again!