skorm909 0 Junior Poster

I started this game a few months ago and I decided to finish it up, but a problem im having is with my arena. basically the "Arena" is the final thing to the game.
If you beat the arena you win the game.

whats wrong with it, is that when i get to the arena, and you start to fight the first person, it doesn't let you do anything else.

I know the code is pretty brutal but most of it is when I just started up c++ programming.

heres the full code so you can run it:

# include <iostream>
# include <cmath>
# include <ctime>
# include <conio.h>



using namespace std;

    int WeakHPotion;
    int LesserHPotion;
    int HealthPotion;
    int GreaterHPotion;
    int currentlvl;
    int exptolvl;
    int currentexp;
    int healing;
    int maxhealth;
    int arenamonsterhealth1;
    int arenamonsterhealth2;
    int arenamonsterhealth3;
    int arenamonsterhealth4;
    int arenaboss;
    int points = 3;
    int loot = 0;
    int money = 100;
    int dmg;
    int mdmg;
    int yourclass;
    string name;     
    int choice;
    int goblin = 25; 
    int dwarf = 50;
    int troll = 75;
    int giant = 100;
    int glvl = 1; 
    int dlvl = 2;
    int tlvl = 3;
    int Glvl = 4;
    int typeofclass;
    int health;
    int mana;
    int str;
    int def;
    int texp;
    int expe;
    int lvl = 1; 


void arenafight();
void exit ();
void attpoints();
void mainmenu();
void shop ();
void invin ();
void arena ();
void heal();
void gmelee();
void gspell();
void gmagic();
void gclasshealing();
void gsuperstrike();
void glightningbolt();
void glightningstrike();
void gfrostbolt();
void gfirebolt();
void gfireball();
void dmelee();
void dspell();
void dmagic();
void dclasshealing();
void dsuperstrike();
void dlightningbolt();
void dlightningstrike();
void dfrostbolt();
void dfirebolt();
void dfireball();
void tmelee();
void tspell();
void tmagic();
void tclasshealing();
void tsuperstrike();
void tlightningbolt();
void tlightningstrike();
void tfrostbolt();
void tfirebolt();
void tfireball();
void Gmelee();
void Gspell();
void Gmagic();
void Gclasshealing();
void Gsuperstrike();
void Glightningbolt();
void Glightningstrike();
void Gfrostbolt();
void Gfirebolt();
void Gfireball();


void bossmelee();
void bossspell();
void bossmagic();
void bossclasshealing();
void bosssuperstrike();
void bosslightningbolt();
void bosslightningstrike();
void bossfrostbolt();
void bossfirebolt();
void bossfireball();

void A1melee();
void A1spell();
void A1magic();
void A1classhealing();
void A1superstrike();
void A1lightningbolt();
void A1lightningstrike();
void A1frostbolt();
void A1firebolt();
void A1fireball();

void A2melee();
void A2spell();
void A2magic();
void A2classhealing();
void A2superstrike();
void A2lightningbolt();
void A2lightningstrike();
void A2frostbolt();
void A2firebolt();
void A2fireball();

void A3melee();
void A3spell();
void A3magic();
void A3classhealing();
void A3superstrike();
void A3lightningbolt();
void A3lightningstrike();
void A3frostbolt();
void A3firebolt();
void A3fireball();

void A4melee();
void A4spell();
void A4magic();
void A4classhealing();
void A4superstrike();
void A4lightningbolt();
void A4lightningstrike();
void A4frostbolt();
void A4firebolt();
void A4fireball();


 void fightg (){
      
             srand(static_cast<unsigned>(time(0)));
             bool done = false;
             goblin = 25;

             is <= 0
              system ("cls");
                  
                    
                    
                         do {
                             
                         dmg = 0;
                         mdmg = 0;
                         
                         if (health <= 0){
                         cout << "You have died." << endl << endl; 
                         cout << "Press Enter to return to the Main Menu.\n\n";
                         health = maxhealth;
                         cin.ignore();
                         cin.get();
                         mainmenu();
                    }
                               
                         system ("cls");
                         cout << "Your health is: " << health << endl << endl;
                         cout << "The Goblin's heath is: " << goblin << endl << endl << endl;
                         cout << "Do you want to: " << endl << endl;
                         cout << "1. Attack." << endl << endl;
                         cout << "2. Heal." << endl << endl;
                         cout << "3. Go to Main menu." << endl << endl;
                         cin >> choice;
                           if (choice == 1){
                              do {
                              
                              system ("cls");
                              cout << "What type of attack do you want to use?\n\n";
                              cout << "1. Melee.\n\n";
                              cout << "2. A Spell.\n\n";

                              
                              cin >> choice;
                              if (choice == 1){
                                          done = true;
                                          gmelee();
                                          }
                                     else if (yourclass == 2 || 3 & choice == 2){
                                          done = true;
                                          gspell();
                                          }
                                     else{
                                          system("cls");
                                          cout << "That is not a choice.\n\n";
                                          cout << "Press Enter to continue.\n\n";
                                          cin.ignore();
                                          cin.get();
                                          }
                                     
                                     } while (done != true);
                                     }
                               
                           else if (choice == 2){
                               system("cls"); 
                               cout << "Which Potion Do You Want To Use?\n\n";   
                               if (WeakHPotion > 0){
                                               cout << "1. Weak Healing Potion.         + 10 Health.\n\n";
                                               }
                                               
                               if (LesserHPotion > 0){
                                               cout << "2. Lesser Healing Potion.       + 25 Health.\n\n";
                                               }
                                               
                               if (HealthPotion > 0){
                                               cout << "3. Health Potion.               + 50 Health.\n\n";
                                               }
                               if (GreaterHPotion > 0){
                                               cout << "4. Greater Healing Potion.      + 100 Health.\n\n";
                                               }
                               cin >> choice;
                               if (choice == 1 && WeakHPotion > 0){
                                          system("cls"); 
                                          cout << "Your Health Has Increased by 10.\n\n";
                                          health = health + 10;
                                          if (health > maxhealth)
                                             health = maxhealth;
                                          }  
                                          
                               else if (choice == 2 && LesserHPotion > 0){
                                          system("cls");     
                                          cout << "Your Health Has Increased by 25.\n\n";
                                          health = health + 25;
                                          if (health > maxhealth)
                                             health = maxhealth;
                                          }   
                                                      
                               else if (choice == 3 && HealthPotion > 0){
                                          system("cls"); 
                                          cout << "Your Health Has Increased by 50.\n\n";
                                          health = health + 50;
                                          if (health > maxhealth)
                                             health = maxhealth;
                                          }   
                                                      
                               else if (choice == 4 && GreaterHPotion > 0){
                                          system("cls"); 
                                          cout << "Your Health Has Increased by 100.\n\n";
                                          health = health + 100;
                                          if (health > maxhealth)
                                             health = maxhealth;
                                          }               
                               
                               cout << "To continue fighing press Enter." << endl;
                               cin.ignore();
                               cin.get();
                               
                              
                       
                                  
                                }
                           else if (choice == 3){mainmenu ();}
                           else {
                                cout << "That is not a choice. please try again." << endl;
                                cout << "To continue fighing press Enter." << endl;
                                cin.ignore();
                                cin.get();
                                }
                            } while (goblin > 0);
                                 
                          
                          system("cls");
                          
               if (goblin <= 0){ // after you killed a monster you got random exp depending on the monsters lvl
                          expe = 0; // ok .... umm hol on a sec I'm going to come off team viewer for like 5 min 
                          expe = rand() % 10 + 1; // i have to do something sry. kk
                          expe = expe * glvl;
                          currentexp = currentexp + expe;
                          loot = rand() % 100 + 1;
                          loot = loot * glvl;
                          cout << "You have killed a Goblin!\n";
                          cout << "\nYour loot is: ";
                          cout << loot << " Gold\n\n";
                          cout << "You also got: " << expe << " experience.\n\n";
                          cout << "Your total experience is: " << currentexp << ".\n\n";
                          cout << "\nPress Enter to continue.\n\n";
                          money = money + loot;
                          cin.ignore();
                          cin.get();
                            if    (currentexp >= lvl * 50){
                                      system ("cls");
                                      currentexp = currentexp - (lvl * 50);
                                      lvl = lvl + 1;
                                      points = points + 3;
                                      cout << "Congratulations " << name << "\n\n";
                                      cout << "You have Leveled up!\n\n";
                                      cout << "You are now level: " << lvl << "\n\n";
                                      cout << "You have Gained 3 Attribute points and 50 gold!\n\n";
                                      cin.ignore();
                                      cout << "\nPress Enter to continue.\n\n";
                                      cin.get();
                                      }
                              }
                          
                          
                          health = maxhealth;
                          mainmenu();
                          
                          }
                          


void fightd () {
     
            dwarf = 50;
     
             bool done = false;

              system ("cls");
                  
                    
                    
                         do {
                             
                         dmg = 0;
                         mdmg = 0;
                         
                         if (health <= 0){
                         cout << "You have died." << endl << endl; 
                         cout << "Press Enter to return to the Main Menu.\n\n";
                         health = maxhealth;
                         cin.ignore();
                         cin.get();
                         mainmenu();
                    }
                               
                         system ("cls");
                         cout << "Your health is: " << health << endl << endl;
                         cout << "The Dwarf's heath is: " << dwarf << endl << endl << endl;
                         cout << "Do you want to: " << endl << endl;
                         cout << "1. Attack." << endl << endl;
                         cout << "2. Heal." << endl << endl;
                         cout << "3. Go to Main menu." << endl << endl;
                         cin >> choice;
                           if (choice == 1){
                              do {
                              
                              system ("cls");
                              
                              cout << "What type of attack do you want to use?\n\n";
                              cout << "1. Melee.\n\n";
                              cout << "2. A Spell.\n\n";
                              cin >> choice;
                              switch (choice){
                                     case 1:
                                          done = true;
                                          dmelee();
                                     break;
                                     case 2:
                                          done = true;
                                          dspell();
                                     break;
                                     default:
                                          cout << "That is not a choice.\n\n";
                                          cout << "Press Enter to continue.\n\n";
                                          cin.ignore();
                                          cin.get();
                                     }
                                     } while (done != true);
                                     }
                               
                           else if (choice == 2){
                                   system("cls"); 
                               cout << "Which Potion Do You Want To Use?\n\n";   
                               if (WeakHPotion > 0){
                                               cout << "1. Weak Healing Potion.         + 10 Health.\n\n";
                                               }
                                               
                               if (LesserHPotion > 0){
                                               cout << "2. Lesser Healing Potion.       + 25 Health.\n\n";
                                               }
                                               
                               if (HealthPotion > 0){
                                               cout << "3. Health Potion.               + 50 Health.\n\n";
                                               }
                               if (GreaterHPotion > 0){
                                               cout << "4. Greater Healing Potion.      + 100 Health.\n\n";
                                               }
                               cin >> choice;
                               if (choice == 1 && WeakHPotion > 0){
                                          system("cls"); 
                                          cout << "Your Health Has Increased by 10.\n\n";
                                          health = health + 10;
                                          if (health > maxhealth)
                                             health = maxhealth;
                                          }  
                                          
                               else if (choice == 2 && LesserHPotion > 0){
                                          system("cls");     
                                          cout << "Your Health Has Increased by 25.\n\n";
                                          health = health + 25;
                                          if (health > maxhealth)
                                             health = maxhealth;
                                          }   
                                                      
                               else if (choice == 3 && HealthPotion > 0){
                                          system("cls"); 
                                          cout << "Your Health Has Increased by 50.\n\n";
                                          health = health + 50;
                                          if (health > maxhealth)
                                             health = maxhealth;
                                          }   
                                                      
                               else if (choice == 4 && GreaterHPotion > 0){
                                          system("cls"); 
                                          cout << "Your Health Has Increased by 100.\n\n";
                                          health = health + 100;
                                          if (health > maxhealth)
                                             health = maxhealth;
                                          }               
                               
                               cout << "To continue fighing press Enter." << endl;
                               cin.ignore();
                               cin.get();
                              
                       
                                  
                                }
                           else if (choice == 3){mainmenu ();}
                           else {
                                cout << "That is not a choice. please try again." << endl;
                                cout << "To continue fighing press Enter." << endl;
                                cin.ignore();
                                cin.get();
                                }
                            } while (dwarf > 0);
                                 
                          
                          system("cls");
                          
               if (dwarf <= 0){
                          expe = 0;
                          expe = rand() % 10 + 1;
                          expe = expe * dlvl;
                          currentexp = currentexp + expe;
                          loot = rand() % 100 + 1;
                          loot = loot * dlvl;
                          cout << "You have killed a Dwarf!\n";
                          cout << "\nYour loot is: ";
                          cout << loot << " Gold\n\n";
                          cout << "You also got: " << expe << " experience.\n\n";
                          cout << "Your total experience is: " << currentexp << ".\n\n";
                          cout << "\nPress Enter to continue.\n\n";
                          money = money + loot;
                          cin.ignore();
                          cin.get();
                            if    (currentexp >= lvl * 50){
                                      system ("cls");
                                      currentexp = currentexp - (lvl * 50);
                                      lvl = lvl + 1;
                                      points = points + 3;
                                      cout << "Congratulations " << name << "\n\n";
                                      cout << "You have Leveled up!\n\n";
                                      cout << "You are now level: " << lvl << "\n\n";
                                      cout << "You have Gained 3 Attribute points and 50 gold!\n\n";
                                      cin.ignore();
                                      cout << "\nPress Enter to continue.\n\n";
                                      cin.get();
                                      }
                              }
                          
                          
                          health = maxhealth;
                          mainmenu();
                          
                          }
               
               
void fightt () {
     
            troll = 75;
            bool done = false;

              is <= 0
              system ("cls");
                  
                    
                    
                         do {
                             
                         dmg = 0;
                         mdmg = 0;
                         
                         if (health <= 0){
                         cout << "You have died." << endl << endl; 
                         cout << "Press Enter to return to the Main Menu.\n\n";
                         health = maxhealth;
                         cin.ignore();
                         cin.get();
                         mainmenu();
                    }
                               
                         system ("cls");
                         cout << "Your health is: " << health << endl << endl;
                         cout << "The Troll's heath is: " << troll << endl << endl << endl;
                         cout << "Do you want to: " << endl << endl;
                         cout << "1. Attack." << endl << endl;
                         cout << "2. Heal." << endl << endl;
                         cout << "3. Go to Main menu." << endl << endl;
                         cin >> choice;
                           if (choice == 1){
                              do {
                              
                              system ("cls");
                              
                              cout << "What type of attack do you want to use?\n\n";
                              cout << "1. Melee.\n\n";
                              cout << "2. A Spell.\n\n";
                              cin >> choice;
                              switch (choice){
                                     case 1:
                                          done = true;
                                          tmelee();
                                     break;
                                     case 2:
                                          done = true;
                                          tspell();
                                     break;
                                     default:
                                          cout << "That is not a choice.\n\n";
                                          cout << "Press Enter to continue.\n\n";
                                          cin.ignore();
                                          cin.get();
                                     }
                                     } while (done != true);
                                     }
                               
                           else if (choice == 2){
                                    system("cls"); 
                               cout << "Which Potion Do You Want To Use?\n\n";   
                               if (WeakHPotion > 0){
                                               cout << "1. Weak Healing Potion.         + 10 Health.\n\n";
                                               }
                                               
                               if (LesserHPotion > 0){
                                               cout << "2. Lesser Healing Potion.       + 25 Health.\n\n";
                                               }
                                               
                               if (HealthPotion > 0){
                                               cout << "3. Health Potion.               + 50 Health.\n\n";
                                               }
                               if (GreaterHPotion > 0){
                                               cout << "4. Greater Healing Potion.      + 100 Health.\n\n";
                                               }
                               cin >> choice;
                               if (choice == 1 && WeakHPotion > 0){
                                          system("cls"); 
                                          cout << "Your Health Has Increased by 10.\n\n";
                                          health = health + 10;
                                          if (health > maxhealth)
                                             health = maxhealth;
                                          }  
                                          
                               else if (choice == 2 && LesserHPotion > 0){
                                          system("cls");     
                                          cout << "Your Health Has Increased by 25.\n\n";
                                          health = health + 25;
                                          if (health > maxhealth)
                                             health = maxhealth;
                                          }   
                                                      
                               else if (choice == 3 && HealthPotion > 0){
                                          system("cls"); 
                                          cout << "Your Health Has Increased by 50.\n\n";
                                          health = health + 50;
                                          if (health > maxhealth)
                                             health = maxhealth;
                                          }   
                                                      
                               else if (choice == 4 && GreaterHPotion > 0){
                                          system("cls"); 
                                          cout << "Your Health Has Increased by 100.\n\n";
                                          health = health + 100;
                                          if (health > maxhealth)
                                             health = maxhealth;
                                          }               
                               
                               cout << "To continue fighing press Enter." << endl;
                               cin.ignore();
                               cin.get();
                               
                              
                       
                                   // press any key code to go back to the main fighting menu.
                                }
                           else if (choice == 3){mainmenu ();}
                           else {
                                cout << "That is not a choice. please try again." << endl;
                                cout << "To continue fighing press Enter." << endl;
                                cin.ignore();
                                cin.get();
                                }
                            } while (troll> 0);
                                 
                          
                          system("cls");
                          
               if (troll <= 0){
                          expe = 0;
                          expe = rand() % 10 + 1;
                          expe = expe * tlvl;
                          currentexp = currentexp + expe;
                          loot = rand() % 100 + 1;
                          loot = loot * tlvl;
                          cout << "You have killed a Troll!\n";
                          cout << "\nYour loot is: ";
                          cout << loot << " Gold\n\n";
                          cout << "You also got: " << expe << " experience.\n\n";
                          cout << "Your total experience is: " << currentexp << ".\n\n";
                          cout << "\nPress Enter to continue.\n\n";
                          money = money + loot;
                          cin.ignore();
                          cin.get();
                            if    (currentexp >= lvl * 50){
                                      system ("cls");
                                      currentexp = currentexp - (lvl * 50);
                                      lvl = lvl + 1;
                                      points = points + 3;
                                      cout << "Congratulations " << name << "\n\n";
                                      cout << "You have Leveled up!\n\n";
                                      cout << "You are now level: " << lvl << "\n\n";
                                      cout << "You have Gained 3 Attribute points and 50 gold!\n\n";
                                      cin.ignore();
                                      cout << "\nPress Enter to continue.\n\n";
                                      cin.get();
                                      }
                              }
                          
                          
                          health = maxhealth;
                          mainmenu();
                          
                          }
               
               

void fightG () {
     
            giant = 100;
            
            bool done = false;

              // do loop here, until the monsters health is <= 0
              system ("cls");
                  
                    
                    
                         do {
                             
                         dmg = 0;
                         mdmg = 0;
                         
                         if (health <= 0){
                         cout << "You have died." << endl << endl; // if you died from the fight then it will return to the main menu
                         cout << "Press Enter to return to the Main Menu.\n\n";
                         health = maxhealth;
                         cin.ignore();
                         cin.get();
                         mainmenu();
                    }
                               
                         system ("cls");
                         cout << "Your health is: " << health << endl << endl;
                         cout << "The Giant's heath is: " << giant << endl << endl << endl;
                         cout << "Do you want to: " << endl << endl;
                         cout << "1. Attack." << endl << endl;
                         cout << "2. Heal." << endl << endl;
                         cout << "3. Go to Main menu." << endl << endl;
                         cin >> choice;
                           if (choice == 1){
                              do {
                              
                              system ("cls");
                              
                              cout << "What type of attack do you want to use?\n\n";
                              cout << "1. Melee.\n\n";
                              cout << "2. A Spell.\n\n";
                              cin >> choice;
                              switch (choice){
                                     case 1:
                                          done = true;
                                          Gmelee();
                                     break;
                                     case 2:
                                          done = true;
                                          Gspell();
                                     break;
                                     default:
                                          cout << "That is not a choice.\n\n";
                                          cout << "Press Enter to continue.\n\n";
                                          cin.ignore();
                                          cin.get();
                                     }
                                     } while (done != true);
                                     }
                               
                           else if (choice == 2){
                                    system("cls"); 
                               cout << "Which Potion Do You Want To Use?\n\n";   
                               if (WeakHPotion > 0){
                                               cout << "1. Weak Healing Potion.         + 10 Health.\n\n";
                                               }
                                               
                               if (LesserHPotion > 0){
                                               cout << "2. Lesser Healing Potion.       + 25 Health.\n\n";
                                               }
                                               
                               if (HealthPotion > 0){
                                               cout << "3. Health Potion.               + 50 Health.\n\n";
                                               }
                               if (GreaterHPotion > 0){
                                               cout << "4. Greater Healing Potion.      + 100 Health.\n\n";
                                               }
                               cin >> choice;
                               if (choice == 1 && WeakHPotion > 0){
                                          system("cls"); 
                                          cout << "Your Health Has Increased by 10.\n\n";
                                          health = health + 10;
                                          if (health > maxhealth)
                                             health = maxhealth;
                                          }  
                                          
                               else if (choice == 2 && LesserHPotion > 0){
                                          system("cls");     
                                          cout << "Your Health Has Increased by 25.\n\n";
                                          health = health + 25;
                                          if (health > maxhealth)
                                             health = maxhealth;
                                          }   
                                                      
                               else if (choice == 3 && HealthPotion > 0){
                                          system("cls"); 
                                          cout << "Your Health Has Increased by 50.\n\n";
                                          health = health + 50;
                                          if (health > maxhealth)
                                             health = maxhealth;
                                          }   
                                                      
                               else if (choice == 4 && GreaterHPotion > 0){
                                          system("cls"); 
                                          cout << "Your Health Has Increased by 100.\n\n";
                                          health = health + 100;
                                          if (health > maxhealth)
                                             health = maxhealth;
                                          }               
                               
                               cout << "To continue fighing press Enter." << endl;
                               cin.ignore();
                               cin.get();
                               
                              
                       
                                   // press any key code to go back to the main fighting menu.
                                }
                           else if (choice == 3){mainmenu ();}
                           else {
                                cout << "That is not a choice. please try again." << endl;
                                cout << "To continue fighing press Enter." << endl;
                                cin.ignore();
                                cin.get();
                                }
                            } while (giant > 0);
                                 
                          
                          system("cls");
                          
               if (giant <= 0){
                          expe = 0;
                          expe = rand() % 10 + 1;
                          expe = expe * Glvl;
                          currentexp = currentexp + expe;
                          loot = rand() % 100 + 1;
                          loot = loot * Glvl;
                          cout << "You have killed a Giant!\n";
                          cout << "\nYour loot is: ";
                          cout << loot << " Gold\n\n";
                          cout << "You also got: " << expe << " experience.\n\n";
                          cout << "Your total experience is: " << currentexp << ".\n\n";
                          cout << "\nPress Enter to continue.\n\n";
                          money = money + loot;
                          cin.ignore();
                          cin.get();
                            if    (currentexp >= lvl * 50){
                                      system ("cls");
                                      currentexp = currentexp - (lvl * 50);
                                      lvl = lvl + 1;
                                      points = points + 3;
                                      cout << "Congratulations " << name << "\n\n";
                                      cout << "You have Leveled up!\n\n";
                                      cout << "You are now level: " << lvl << "\n\n";
                                      cout << "You have Gained 3 Attribute points and 50 gold!\n\n";
                                      cin.ignore();
                                      cout << "\nPress Enter to continue.\n\n";
                                      cin.get();
                                      }
                              }
                          
                          
                          health = maxhealth;
                          mainmenu();
                          
                          }


void mainmenu (){
     
    bool done = false;
    int choice;
    int goblin = 25; // monsters health.
    int dwarf = 50;
    int troll = 75;
    int giant = 100;
    int glvl = 1; // monsters level
    int dlvl = 2;
    int tlvl = 3;
    int Glvl = 4;
    
    do {

    system ("cls");
    cout << "Main menu." << endl << endl; // Main menu
    cout << "Your health is: " << health << "\n\n";
    cout << "You have: " << money << " Gold.\n\n";
    cout << "You have: " << points << " Attribute points.\n\n";
    cout << "You have: " << currentexp << " Experience.\n\n";
    cout << "You need: " << (lvl * 50) - currentexp << " Experience to level up\n\n";
    cout << "What would you like to do " << name << "?" << endl << endl;
    cout << "1. Fight." << endl << endl;
    cout << "2. Go to the Shop." << endl << endl;
    cout << "3. Go to the Arena." << endl << endl;
    cout << "4. Check Your Invintory.\n\n";
    if (points > 0){
    cout << "5. Spend Attribute Points.\n\n";
}
    if (health != maxhealth){
    cout << "6. Heal.\n\n";
}
    cout << "7. Exit.\n\n";
    cin >> choice;
    if (choice == 1){
               do {
               system ("cls");
               cout << "You have chosen to fight." << endl << endl; // who they choose to fight
               cout << "Who would you like to fight?" << endl << endl;
               cout << "1. Goblin." << endl << endl;
               cout << "2. Dwarf." << endl << endl;
               cout << "3. Troll." << endl << endl;
               cout << "4. Giant." << endl << endl;
               cin >> choice;
               
                   if (choice == 1){
                         fightg();
                                 }
                                 
                   else if (choice == 2){
                         fightd();
                                 }
                                 
                   else if (choice == 3){
                         fightt();
                                 }
                                 
                   else if (choice == 4){
                         fightG();
                         }
                   
                   else {
                        cout << "That is not a choice. please try again." << endl << endl;
                        cout <<  "\nPress Enter to retry.\n\n";
                        cin.ignore();
                        cin.get();
                        
                        }
                 }  while (choice != 1 || 2 || 3 || 4);
          }
    else if (choice == 2) {
         shop();
         }
    else if (choice == 3) {
         arena();
         }
    else if (choice == 4){
         invin();
         }
    else if (points > 0 & choice == 5){
      attpoints();
         }
    else if (health < maxhealth & choice == 6){
         heal();
         }
    else if (choice == 7){
         exit();
         done = true;
         }
    else {
                        system("cls");
                        cout << "\nThat is not a choice. please try again." << endl << endl;
                        cout <<  "Press Enter to continue.\n \n";
                        cin.ignore();
                        cin.get();
                        }
                        

} while (done != true);
}




int main (){

     cout << "Hello, Welcome." <<  endl << endl; // title screen


     cout << "What do you want your name to be?" << endl << endl;
     getline(cin,name);
     system ("cls");
     cout << "Congratulations " << name << " What do you want your class to be?"  <<  endl << endl; // this will determine base stats
     cout << "1. Warrior" <<  endl << endl;
     cout <<  "2. Mage" <<  endl << endl;
     cout <<  "3. Healer" <<  endl << endl;
     cin >>  typeofclass;
     
        
  
         if (typeofclass == 1){
            maxhealth = 50;
            system ("cls");
            yourclass = 1;
            cout <<  "You have chosen to be a Warrior.\n" <<  endl << endl; // gives stats for this person
            health = 50;
            mana = 1;
            str = 3;
            def = 3;
            }
         else if (typeofclass == 2){
            maxhealth = 25;
            system ("cls");
            yourclass = 2;
            cout <<  "You have chosen to be a Mage.\n" <<  endl << endl;
            cout << "A note for mages: \n\n";
            cout << "The higher your Mana, the more Spells you get to use.\n\n";
            health = 25;
            mana = 5;
            str = 1;
            def = 1;
            }
         else if (typeofclass == 3){
            maxhealth = 25;
            system ("cls");
            yourclass = 3;      
            cout <<  "You have chosen to be a Healer.\n";
            health = 25;
            mana = 4;
            str = 1;
            def = 1;
            }
         else {
            cout <<  "Sorry, thats not a right number, please try again." <<  endl;
}

      
          
      cout << "Your Stats are:" << endl << endl;
      cout << "Health " << health << endl << endl << "Mana " << mana << endl << endl;
      cout << "Strength " << str << endl << endl << "Defense " << def << endl << endl;
      cout <<  "Press Enter to continue.\n \n";
      cin.ignore();
      cin.get();
      
      mainmenu();
      
      
cin.ignore();
cin.get();





}



void shop(){
     system ("cls");
     if (money <= 0){
                     cout << "You Have No Money!\n\n";
                     cout << "Press Enter To Return To the Main Menu.\n";
                     cin.ignore();
                     cin.get();
                     mainmenu();
                     }
     bool done;
     done = false;
     cout << "Welcome to the Shop.\n\n\n";
     cout << "You Have: " << money << " Gold.\n\n\n";
     cout << "1. Weak Health Potion.              $50\n\n";
     cout << "2. Lesser Health Potion.            $100\n\n";
     cout << "3. Health Potion.                   $200\n\n";
     cout << "4. Greater Health Potion.           $300\n\n";
     cout << "5. Add 10 to Max Health.            $250\n\n";
     cout << "6. Add 1 to Mana.                   $250\n\n";
     cout << "7. Add 1 to Strength.               $250\n\n";
     cout << "8. Add 1 to Defense.                $250\n\n";
     cout << "9. Go to the Main Menu.\n\n";
     cin >> choice;
     while (done != true){
     if (choice == 1 && money >= 50){
                system("cls");
                money = money - 50;
                WeakHPotion = WeakHPotion + 1;
                cout << "You Just Bought A Weak Healing Potion.\n\n";
                cout << "Now You Have: " << WeakHPotion << " Weak Healing Potions.\n\n";
                cout << "Press Enter To Return To the Shop.\n";
                cin.ignore();
                cin.get();
                shop();
                }
     else if (choice == 2 && money >= 100){
                system("cls");
                money = money - 100;
                LesserHPotion = LesserHPotion + 1;
                cout << "You Just Bought A Lesser Healing Potion.\n\n";
                cout << "Now You Have: " << LesserHPotion << " Lesser Healing Potions.\n\n";
                cout << "Press Enter To Return To the Shop.\n";
                cin.ignore();
                cin.get();
                shop();
                }
     else if (choice == 3 && money >= 200){
                system("cls");
                money = money - 200;
                HealthPotion = HealthPotion + 1;
                cout << "You Just Bought A Health Potion.\n\n";
                cout << "Now You Have: " << HealthPotion << " Health Potions.\n\n";
                cout << "Press Enter To Return To the Shop.\n";
                cin.ignore();
                cin.get();
                shop();
                }
     else if (choice == 4 && money >= 300){
                system("cls");
                money = money - 300;
                GreaterHPotion = GreaterHPotion + 1;
                cout << "You Just Bought A Greater Healing Potion.\n\n";
                cout << "Now You Have: " << GreaterHPotion << " Greater Healing Potions.\n\n";
                cout << "Press Enter To Return To the Shop.\n";
                cin.ignore();
                cin.get();
                shop();
                }
     else if (choice == 5 && money >= 250){
                system("cls");
                money = money - 250;
                maxhealth = maxhealth + 10;
                cout << "You Just Added 10 To Your Max Health.\n\n";
                cout << "Your Max Health is now: " << maxhealth << ".\n\n";
                cout << "Press Enter To Return To the Shop.\n";
                cin.ignore();
                cin.get();
                shop();
                }
     else if (choice == 6 && money >= 250){
                system("cls");
                money = money - 250;
                mana = mana + 1;
                cout << "You Just Bought A Mana Point.\n\n";
                cout << "Now You Have: " << mana << " Mana.\n\n";
                cout << "Press Enter To Return To the Shop.\n";
                cin.ignore();
                cin.get();
                shop();
                }
     else if (choice == 7 && money >= 250){
                system("cls");
                money = money - 250;
                str = str + 1;
                cout << "You Just Bought A Strength Point.\n\n";
                cout << "Now You Have: " << str << " Strength.\n\n";
                cout << "Press Enter To Return To the Shop.\n";
                cin.ignore();
                cin.get();
                shop();
                }
     else if (choice == 8 && money >= 250){
                system("cls");
                money = money - 250;
                def = def + 1;
                cout << "You Just Bought A Defense Point.\n\n";
                cout << "Now You Have: " << def << " Defense.\n\n";
                cout << "Press Enter To Return To the Shop.\n";
                cin.ignore();
                cin.get();
                shop();
                }
     else if (choice == 9){
                done = true;
                system("cls");
                cout << "To Return To the Main Menu Press Enter.\n";
                cin.ignore();
                cin.get();
                mainmenu();
                }
                
                
     
     if (choice == 1 && money < 50){
                done = true;
                system("cls");
                cout << "You Dont Have Enough Money.\n\n";
                cout << "Press Enter To Continue.\n";
                cin.ignore();
                cin.get();
                }
                
     else if (choice == 2 && money < 100){
                done = true;
                system("cls");
                cout << "You Dont Have Enough Money.\n\n";
                cout << "Press Enter To Continue.\n";
                cin.ignore();
                cin.get();
                }
                
     else if (choice == 3 && money < 200){
                done = true;
                system("cls");
                cout << "You Dont Have Enough Money.\n\n";
                cout << "Press Enter To Continue.\n";
                cin.ignore();
                cin.get();
                }
                
     else if (choice == 4 && money < 300){
                done = true;      
                system("cls");
                cout << "You Dont Have Enough Money.\n\n";
                cout << "Press Enter To Continue.\n";
                cin.ignore();
                cin.get();
                }
                
     else if (choice == 5 && money < 250){
                done = true;
                system("cls");
                cout << "You Dont Have Enough Money.\n\n";
                cout << "Press Enter To Continue.\n";
                cin.ignore();
                cin.get();
                }
                
     else if (choice == 6 && money < 250){
                done = true;
                system("cls");
                cout << "You Dont Have Enough Money.\n\n";
                cout << "Press Enter To Continue.\n";
                cin.ignore();
                cin.get();
                }
                
     else if (choice == 7 && money < 250){
                done = true;
                system("cls");
                cout << "You Dont Have Enough Money.\n\n";
                cout << "Press Enter To Continue.\n";
                cin.ignore();
                cin.get();
                }
                
     else if (choice == 8 && money < 250){
                done = true;
                system("cls");
                cout << "You Dont Have Enough Money.\n\n";
                cout << "Press Enter To Continue.\n";
                cin.ignore();
                cin.get();
                }
     }
     cout << "Press Enter To Return To the Main Menu.\n";
     cin.ignore();
     cin.get();
     mainmenu();
     }
     
void invin() {
     system ("cls");
     cout << "Your Invintory: \n\n";
     cout << "Weak Health Potions: " << WeakHPotion << ".\n\n";
     cout << "Lesser Health Potions: " << LesserHPotion << ".\n\n";
     cout << "Health Potions: " << HealthPotion << ".\n\n";
     cout << "Greater Health Potions: " << GreaterHPotion << ".\n\n";
     cout << "Press Enter to Return To The Main Menu.\n";
     cin.ignore();
     cin.get();
     mainmenu();
     }
     
     
void arena() {
     system ("cls");
     cout << "This Is the Arena.\n\n";
     cout << "You Will Have To fight And Beat 5 Random Monsters To Beat the Game...\n\n";
     cout << "But Be Warned... The Final Boss May Be Very Hard To Beat...\n\n";
     cout << "1. Continue... I'm Not Scared.\n\n";
     cout << "2. Take Me Back to the Main Menu! I'm Not Ready!\n";
     cin >> choice;
     while (choice != 1 || 2){
     if (choice == 1){
                arenafight();
                }
     else if (choice == 2){
          mainmenu();
          }
          }
     
     }
     
     
void arenafight(){
     bool done;
     done = false;
     system("cls");
     cout << "Welcome " << name;
     cout << "\n\nThis Arena Will Test Your Skill.\n\n";
     cout << "Press Enter To Start the Battles.\n";
     cin.ignore();
     cin.get();
     system("cls");
     
     arenamonsterhealth1 = health * 2;
     cout << "Your Health is: " << health << "\n\n";
     cout << "Your Enemies Health is: " << arenamonsterhealth1 << "\n\n";
     cout << "Do You Want To: \n\n";
     cout << "1. Attack.\n\n";
     cout << "2. heal.\n\n";
     cout << "3. Return To the Main Menu.\n\n";
     
     
      cin >> choice;
                           if (choice == 1){
                              
                              do{
                              system ("cls");
                              cout << "What type of attack do you want to use?\n\n";
                              cout << "1. Melee.\n\n";
                              cout << "2. A Spell.\n\n";
                              cin >> choice;
                              switch (choice){
                                     
                                     case 1:
                                          done = true;
                                          A1melee();
                                     break;
                                     case 2:
                                          done = true;
                                          A1spell();
                                     break;
                                     default:
                                          cout << "That is not a choice.\n\n";
                                          cout << "Press Enter to continue.\n\n";
                                          cin.ignore();
                                          cin.get();
                                     
                                     }
                                     } while (done != true);
                                     }
                               
                           else if (choice == 2){
                                    system("cls"); 
                               cout << "Which Potion Do You Want To Use?\n\n";   
                               if (WeakHPotion > 0){
                                               cout << "1. Weak Healing Potion.         + 10 Health.\n\n";
                                               }
                                               
                               if (LesserHPotion > 0){
                                               cout << "2. Lesser Healing Potion.       + 25 Health.\n\n";
                                               }
                                               
                               if (HealthPotion > 0){
                                               cout << "3. Health Potion.               + 50 Health.\n\n";
                                               }
                               if (GreaterHPotion > 0){
                                               cout << "4. Greater Healing Potion.      + 100 Health.\n\n";
                                               }
                               cin >> choice;
                               if (choice == 1 && WeakHPotion > 0){
                                          system("cls"); 
                                          cout << "Your Health Has Increased by 10.\n\n";
                                          health = health + 10;
                                          if (health > maxhealth)
                                             health = maxhealth;
                                          }  
                                          
                               else if (choice == 2 && LesserHPotion > 0){
                                          system("cls");     
                                          cout << "Your Health Has Increased by 25.\n\n";
                                          health = health + 25;
                                          if (health > maxhealth)
                                             health = maxhealth;
                                          }   
                                                      
                               else if (choice == 3 && HealthPotion > 0){
                                          system("cls"); 
                                          cout << "Your Health Has Increased by 50.\n\n";
                                          health = health + 50;
                                          if (health > maxhealth)
                                             health = maxhealth;
                                          }   
                                                      
                               else if (choice == 4 && GreaterHPotion > 0){
                                          system("cls"); 
                                          cout << "Your Health Has Increased by 100.\n\n";
                                          health = health + 100;
                                          if (health > maxhealth){
                                             health = maxhealth;
                                          }               
                               
                               cout << "To continue fighing press Enter." << endl;
                               cin.ignore();
                               cin.get();
                               
                              
                       
                                   // press any key code to go back to the main fighting menu.
                                }
                           else if (choice == 3){
                                mainmenu();
                                }
                           else {
                                cout << "That is not a choice. please try again." << endl;
                                cout << "To continue fighing press Enter." << endl;
                                cin.ignore();
                                cin.get();
                                }
                            } while (arenamonsterhealth1 > 0);
                                 
                          
                          system("cls");
                          
               if (arenamonsterhealth1 <= 0){
                          expe = 0;
                          expe = rand() % 250 + 1;
                          currentexp = currentexp + expe;
                          loot = rand() % 1000 + 1;
                          cout << "You have killed a Giant!\n";
                          cout << "\nYour loot is: ";
                          cout << loot << " Gold\n\n";
                          cout << "You also got: " << expe << " experience.\n\n";
                          cout << "Your total experience is: " << currentexp << ".\n\n";
                          cout << "\nPress Enter to continue.\n\n";
                          money = money + loot;
                          cin.ignore();
                          cin.get();
                            if    (currentexp >= lvl * 50){
                                      system ("cls");
                                      currentexp = currentexp - (lvl * 50);
                                      lvl = lvl + 1;
                                      points = points + 3;
                                      cout << "Congratulations " << name << "\n\n";
                                      cout << "You have Leveled up!\n\n";
                                      cout << "You are now level: " << lvl << "\n\n";
                                      cout << "You have Gained 3 Attribute points and 50 gold!\n\n";
                                      cin.ignore();
                                      cout << "\nPress Enter to continue.\n\n";
                                      cin.get();
                                      }
                              }
                          
                          
                          health = maxhealth;
                          
                          
     if (arenamonsterhealth1 <= 0){
                             system ("cls");
                             cout << "You Have Defeated Your First Arena Monster.\n\n";
                             cout << "To Continue Fighting The Monsters Press Enter.\n\n";
                             cin.ignore();
                             cin.get();
                              
                              
                              
                              do {
                              arenamonsterhealth1 = health * 2;
                              cout << "Your Health is: " << health << "\n\n";
                              cout << "Your Enemies Health is: " << arenamonsterhealth1 << "\n\n";
                              cout << "Do You Want To: \n\n";
                              cout << "1. Attack.\n\n"