Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
#include <iostream>
#include <string>
#include "Character.h"
#include "weapon.h"
#include <windows.h>
#include "functions.h"
#include <cstdlib>
#include <ctime>
using namespace std;
character chooseClass();
weapon chooseWeapon1();
void startScreen();
void theGame();
void gameOver();
int main()
{
startScreen();
cout << "Hello wayward soul.Our records show that you are from the Zorro family of farmers.\n\What is thy name given by thy parents: \n";
string name;
cin >> name;
name = name + " Zorro";
char xch;
int newGold;
int newHealth;
int newStr;
int newDex;
int experience = 0;
system("cls");
character ourHero = chooseClass();
cout << "\n\nPlease press enter to continue...";
cin.ignore();
cin.get();
system("cls");
weapon ourWeapon = chooseWeapon1();
cout << "\n\nPlease press enter to continue...";
cin.ignore();
cin.get();
system("cls");
while(ourHero.getHealth()>0)
{
if(experience > 450 && ourHero.getLevel() <2)
{
cout << "You are level 2! Good job!\n\n";
ourHero.addLevel();
cout << "Please press enter to continue...\n";
cin.ignore();
cin.get();
system("cls");
}
if(experience > 1000 && ourHero.getLevel() <3)
{
cout << "You are level 3! Good job!\n\n";
ourHero.addLevel();
cout << "Please press enter to continue...\n";
cin.ignore();
cin.get();
system("cls");
}
if(experience > 1700 && ourHero.getLevel() <4)
{
cout << "You are level 4! Good job!\n\n";
ourHero.addLevel();
cout << "Please press enter to continue...\n";
cin.ignore();
cin.get();
system("cls");
}
if(experience > 3200 && ourHero.getLevel() <5)
{
cout << "You are level 5! Good job!\n\n";
ourHero.addLevel();
cout << "Please press enter to continue...\n";
cin.ignore();
cin.get();
system("cls");
}
if(experience > 5500 && ourHero.getLevel() <6)
{
cout << "Congratulations!!! You're one of the few warriors to make it to level 6!\n\n";
ourHero.addLevel();
cout << "Please press enter to continue...\n";
cin.ignore();
cin.get();
system("cls");
}
cout << "Please make a selection:\n\n[1]The Workshop\n\n[2]The Enchanted Forest\n\n[3]The MYsterious Merchent\n\n[4]Stats\n\n[5]Be a Coward & Quit Game\n";
int menuSelect;
srand(time(0));
cin >> menuSelect;
system("cls");
switch(menuSelect)
{
case 1: // work shop
{
system("cls");
cout << "Welcome to the black smith\n";
cout << "You currently have " << ourHero.getGold() << " gold.\n\n";
cout << "What would you like to do?\n\n[1]Upgrade Main Weapon - 40g\n\n[2]Upgrade Secondary Weapon - 25g\n\n[3]Exit\n";
int choice;
cin >> choice;
system("cls");
switch(choice)
{
case 1:
{
if(ourHero.getGold()>49)
{
ourWeapon.sharpenWeapon1();
newGold = ourHero.getGold()-50;
ourHero.setGold(newGold);
cout << "Primary Weapon got a boost......in killing stuff!";
cin.ignore();
cin.get();
system("cls");
break;
}
else
{
cout << "Oi! Oi! What is this,an empty purse.Try to come back when you get some gold!";
cin.ignore();
cin.get();
system("cls");
break;
}
}
case 2:
{
if(ourWeapon.getDamageMultiplier2()>0)
{
if(ourHero.getGold()>24)
{
ourWeapon.sharpenWeapon2();
newGold = ourHero.getGold()-25;
ourHero.setGold(newGold);
cout << "Secondary weapon is so sharp....i can hear my enemies scream!";
cin.ignore();
cin.get();
system("cls");
break;
}
else
{
cout << "Oi! Oi! What is this,an empty purse.Try to come back when you get some gold!";
cin.ignore();
cin.get();
system("cls");
break;
}
}
else
{
cout << "No weapon to upgrade.";
cin.ignore();
cin.get();
system("cls");
break;
}
}
case 3:
{
break;
}
default:
{
cout << "Wrong selection.(Seriously?)\n\n";
cout << "Please press enter to continue...\n";
cin.ignore();
cin.get();
system("cls");
}
}
break;
}
case 2: // The Forest where stuff goes down
{
int ForestChoice;
if(ourHero.getLevel()<6)
{
cout << "YOU HAVE ENTERED THE CREEPY FOREST(I wanna go back to momma...)\nChoose your opponent:\n\n[1] The Murky pool\n\n[2] Dark pathway\n\n[3] Abandoned Fort \n\n[4] Dark Cemetery\n";
cin >> ForestChoice;
}
if(ourHero.getLevel()==6)
{
cout <<"You find a Rune stone at the begining of the path \"" << name << "...\nAfter defeating the Igni Elementas, I think you're finally ready" <<
" to fight at \nthe Gladitorial pits. I will be waiting for you there. Make sure you are prepared \nfor your FINAL COUNTDOWN!.........wait I meant SHOWDOWN\"\n\n" <<
"Are you sure you're ready?(Press y or else...)\n[Y]es or [n]o?";
cin >> xch;
}
int combatChoice;
int theHit;
int currentHealth;
system("cls");
if(ourHero.getLevel() == 1)
switch(ForestChoice)
{
case 1:
{
cout << "A Naga enters The Pool.I must have interrupted its bath.\n";
character naga("naga", 45, 13, 10, 1, 0, 0);
while(naga.getHealth()>0)
{
cout << "Which action would you like to take?\n\n[1]Attack\n\n[2]Beg for mercy.Guess you are not well versed\n";
cin >> combatChoice;
system("cls");
switch(combatChoice)
{
case 1:
{
if((ourHero.getStr()+(rand()%11))>(naga.getDex()+(rand()%11)))
{
theHit=ourHero.getStr()*(ourWeapon.getDamageMultiplier1()+ourWeapon.getDamageMultiplier2());
cout << "You have hit the naga for " << theHit << "!\n\n";
currentHealth=naga.getHealth()-theHit;
naga.setHealth(currentHealth);
if(1 > naga.getHealth())
{
cout << "You have slain a naga and receive 30 gold and 20 experience!\n\nPlease press enter to continue...\n";
newGold = ourHero.getGold()+30;
ourHero.setGold(newGold);
experience = experience +20;
naga.setHealth(0);
}
}
else
{
cout << "The naga has dodged your swing!\n\n";
}
if(naga.getHealth()>0)
{
if((naga.getStr()+(rand()%11))>(ourHero.getDex()+(rand()%11)))
{
theHit=naga.getStr()*0.95;
theHit=theHit*ourHero.getArmor();
cout << "The naga has hit you for " << theHit << "!\n\n";
currentHealth=ourHero.getHealth()-theHit;
ourHero.setHealth(currentHealth);
}
else
{
cout << "You have dodged the naga's attack!";
}
}
cin.ignore();
cin.get();
system("cls");
break;
}
case 2:
{
if((rand()%3)<2)
{
cout << "For some odd reason, the naga allows you to keep your life.\n";
cout << "Please press enter to continue...\n";
cin.ignore();
cin.get();
system("cls");
naga.setHealth(0);
break;
}
else
{
cout << "Poor decision. The naga executes you!";
Sleep(3000);
system("cls");
ourHero.setHealth(0);
naga.setHealth(0);
break;
}
break;
}
default:
{
cout << "Invalid selection.\n\n";
cout << "Please press enter to continue...\n";
cin.ignore();
cin.get();
system("cls");
}
}
if(ourHero.getHealth()<1)
{
cout << "You are dead.Finito.Its over.Should have stayed at the farm.";
Sleep(500);
system("cls");
break;
}
}
break;
}
case 2:
{
cout << "A warg enters The Pathway.Its trying to find meal.You are it.\n";
character warg("warg", 45, 13, 12, 1, 0, 0);
while(warg.getHealth()>0)
{
cout << "Which action would you like to take?\n\n[1]Attack\n\n[2]Beg for mercy\n";
cin >> combatChoice;
system("cls");
switch(combatChoice)
{
case 1:
{
if((ourHero.getStr()+(rand()%11))>(warg.getDex()+(rand()%11)))
{
theHit=ourHero.getStr()*(ourWeapon.getDamageMultiplier1()+ourWeapon.getDamageMultiplier2());
cout << "You have hit the warg for " << theHit << "!\n\n";
currentHealth=warg.getHealth()-theHit;
warg.setHealth(currentHealth);
if(1 > warg.getHealth())
{
cout << "Ora!Ora!Ora!You have slain a warg and receive 45 gold and 30 experience!\n\nPlease press enter to continue...\n";
newGold = ourHero.getGold()+45;
ourHero.setGold(newGold);
experience = experience +30;
warg.setHealth(0);
}
}
else
{
cout << "The warg has dodged your swing!Muda!Muda!Muda!\n\n";
}
if(warg.getHealth()>0)
{
if((warg.getStr()+(rand()%11))>(ourHero.getDex()+(rand()%11)))
{
theHit=warg.getStr()*1.5;
theHit=theHit*ourHero.getArmor();
cout << "The warg has hit you for " << theHit << "!\n\n";
currentHealth=ourHero.getHealth()-theHit;
ourHero.setHealth(currentHealth);
}
else
{
cout << "You have dodged the warg's attack!(Proceeds to taunt)";
}
}
cin.ignore();
cin.get();
system("cls");
break;
}
case 2:
{
if((rand()%3)<2)
{
cout << "For some odd reason, the warg allows you to keep your life.Must be looking for some meal with muscles\n";
cout << "Please press enter to continue...\n";
cin.ignore();
cin.get();
system("cls");
warg.setHealth(0);
break;
}
else
{
cout << "Poor decision. The warg executes you!";
Sleep(3000);
system("cls");
ourHero.setHealth(0);
warg.setHealth(0);
break;
}
break;
}
default:
{
cout << "Invalid selection.\n\n";
cout << "Please press enter to continue...\n";
cin.ignore();
cin.get();
system("cls");
}
}
if(ourHero.getHealth()<1)
{
cout << "You are dead.Finito.Its over.Should have stayed at the farm.";
Sleep(1700);
system("cls");
break;
}
}
break;
}
case 3:
{
cout << "An orkboy enters The Fort.Oh boy,be ready for an ass-whooping\n";
character orkboy("orkboy", 70, 13, 12, 1, 0, 0);
while(orkboy.getHealth()>0)
{
cout << "Which action would you like to take?\n\n[1]Attack\n\n[2]Beg for mercy(You will be known as guy who tried to appease an ork)\n";
cin >> combatChoice;
system("cls");
switch(combatChoice)
{
case 1:
{
if((ourHero.getStr()+(rand()%11))>(orkboy.getDex()+(rand()%11)))
{
theHit=ourHero.getStr()*(ourWeapon.getDamageMultiplier1()+ourWeapon.getDamageMultiplier2());
cout << "You have hit the orkboy for " << theHit << "!\n\n";
currentHealth=orkboy.getHealth()-theHit;
orkboy.setHealth(currentHealth);
if(1 > orkboy.getHealth())
{
cout << "Booyah!You have slain a orkboy and receive 65 gold and 40 experience!\n\nPlease press enter to continue...\n";
newGold = ourHero.getGold()+65;
experience = experience +40;
ourHero.setGold(newGold);
orkboy.setHealth(0);
}
}
else
{
cout << "The orkboy has dodged your swing!He is a nimble boy!\n\n";
}
if(orkboy.getHealth()>0)
{
if((orkboy.getStr()+(rand()%11))>(ourHero.getDex()+(rand()%11)))
{
theHit=orkboy.getStr()*2.3;
theHit=theHit*ourHero.getArmor();
cout << "The orkboy has hit you for " << theHit << "!\n\n";
currentHealth=ourHero.getHealth()-theHit;
ourHero.setHealth(currentHealth);
}
else
{
cout << "You have dodged the orkboy's attack!";
}
}
cin.ignore();
cin.get();
system("cls");
break;
}
case 2:
{
if((rand()%3)<2)
{
cout << "For some odd reason, the orkboy allows you to keep your life.You just dont register on his radar as a threat\n";
cout << "Please press enter to continue...\n";
cin.ignore();
cin.get();
system("cls");
orkboy.setHealth(0);
break;
}
else
{
cout << "Poor decision. The orkboy executes you!What did you actually expect?";
Sleep(500);
system("cls");
ourHero.setHealth(0);
orkboy.setHealth(0);
break;
}
break;
}
default:
{
cout << "Invalid selection.\n\n";
cout << "Please press enter to continue...\n";
cin.ignore();
cin.get();
system("cls");
}
}
if(ourHero.getHealth()<1)
{
cout << "You are dead.Finito.Its over.Should have stayed at the farm.";
Sleep(1700);
system("cls");
break;
}
}
break;
}
case 4:
{
cout << "A dragon menecingly approaches.Boss music starts playing\n";
character dragon("dragon", 100, 16, 12, 1, 0, 0);
while(dragon.getHealth()>0)
{
cout << "Which action would you like to take?\n\n[1]Attack\n\n[2]Beg for mercy\n";
cin >> combatChoice;
system("cls");
switch(combatChoice)
{
case 1:
{
if((ourHero.getStr()+(rand()%11))>(dragon.getDex()+(rand()%11)))
{
theHit=ourHero.getStr()*(ourWeapon.getDamageMultiplier1()+ourWeapon.getDamageMultiplier2());
cout << "You have hit the dragon for " << theHit << "!\n\n";
currentHealth=dragon.getHealth()-theHit;
dragon.setHealth(currentHealth);
if(1 > dragon.getHealth())
{
cout << "You have slain the dragon and receive 175 gold and 105 experience!Must have some dragon slayer blood in you\n\nPlease press enter to continue...\n";
newGold = ourHero.getGold()+175;
ourHero.setGold(newGold);
experience = experience +105;
dragon.setHealth(0);
}
}
else
{
cout << "The dragon has dodged your swing!He got wings you know......\n\n";
}
if(dragon.getHealth()>0)
{
if((dragon.getStr()+(rand()%11))>(ourHero.getDex()+(rand()%11)))
{
theHit=dragon.getStr()*1.8;
theHit=theHit*ourHero.getArmor();
cout << "The dragon's fire hits you for " << theHit;
int dragonHit;
dragonHit=theHit*.65;
cout << ", also giving it " << dragonHit << " health!\n\n";
currentHealth=ourHero.getHealth()-theHit;
ourHero.setHealth(currentHealth);
newHealth = theHit + dragon.getHealth();
dragon.setHealth(newHealth);
}
else
{
cout << "You have dodged the dragon's attack!";
}
}
cin.ignore();
cin.get();
system("cls");
break;
}
case 2:
{
cout << "Very poor decision...Dragons dont take prisoners(Ask daenerys targaryen if you want proof)\n";
Sleep(1500);
cout << "A dragon absorbs in your soul!";
Sleep(3000);
system("cls");
ourHero.setHealth(0);
dragon.setHealth(0);
break;
}
default:
{
cout << "Invalid selection.\n\n";
cout << "Please press enter to continue...\n";
cin.ignore();
cin.get();
system("cls");
}
}
if(ourHero.getHealth()<1)
{
cout << "You are dead.Finito.Its over.Should have stayed at the farm.";
Sleep(1700);
system("cls");
break;
}
}
break;
}
default:
{
cout << "Invalid selection.\n\n";
cout << "Please press enter to continue...\n";
cin.ignore();
cin.get();
system("cls");
}
}
if(ourHero.getLevel() == 2)
switch(ForestChoice)
{
case 1:
{
cout << "An orkboy enters The fort.\n";
character orkboy("orkboy", 70, 18, 16, 1, 0, 0);
while(orkboy.getHealth()>0)
{
cout << "Which action would you like to take?\n\n[1]Attack\n\n[2]Beg for mercy\n";
cin >> combatChoice;
system("cls");
switch(combatChoice)
{
case 1:
{
if((ourHero.getStr()+(rand()%11))>(orkboy.getDex()+(rand()%11)))
{
theHit=ourHero.getStr()*(ourWeapon.getDamageMultiplier1()+ourWeapon.getDamageMultiplier2());
cout << "You have hit the orkboy for " << theHit << "!\n\n";
currentHealth=orkboy.getHealth()-theHit;
orkboy.setHealth(currentHealth);
if(1 > orkboy.getHealth())
{
cout << "You have slain an orkboy and receive 75 gold and 50 experience!\n\nPlease press enter to continue...\n";
newGold = ourHero.getGold()+75;
ourHero.setGold(newGold);
experience = experience +50;
orkboy.setHealth(0);
}
}
else
{
cout << "The orkboy has dodged your swing!\n\n";
}
if(orkboy.getHealth()>0)
{
if((orkboy.getStr()+(rand()%11))>(ourHero.getDex()+(rand()%11)))
{
theHit=orkboy.getStr()*1.85;
theHit=theHit*ourHero.getArmor();
cout << "The orkboy has hit you for " << theHit << "!\n\n";
currentHealth=ourHero.getHealth()-theHit;
ourHero.setHealth(currentHealth);
}
else
{
cout << "You have dodged the orkboy's attack!";
}
}
cin.ignore();
cin.get();
system("cls");
break;
}
case 2:
{
if((rand()%3)<2)
{
cout << "For some odd reason, the orkboy allows you to keep your life.\n";
cout << "Please press enter to continue...\n";
cin.ignore();
cin.get();
system("cls");
orkboy.setHealth(0);
break;
}
else
{
cout << "Poor decision. The orkboy executes you!";
Sleep(3000);
system("cls");
ourHero.setHealth(0);
orkboy.setHealth(0);
break;
}
break;
}
default:
{
cout << "Invalid selection.\n\n";
cout << "Please press enter to continue...\n";
cin.ignore();
cin.get();
system("cls");
}
}
if(ourHero.getHealth()<1)
{
cout << "You are dead.Finito.Its over.Should have stayed at the farm.";
Sleep(1700);
system("cls");
break;
}
}
break;
}
case 2:
{
cout << "An ogre enters The fort.\n";
character ogre("ogre", 90, 19, 17, 1, 0, 0);
while(ogre.getHealth()>0)
{
cout << "Which action would you like to take?\n\n[1]Attack\n\n[2]Beg for mercy\n";
cin >> combatChoice;
system("cls");
switch(combatChoice)
{
case 1:
{
if((ourHero.getStr()+(rand()%11))>(ogre.getDex()+(rand()%11)))
{
theHit=ourHero.getStr()*(ourWeapon.getDamageMultiplier1()+ourWeapon.getDamageMultiplier2());
cout << "You have hit the ogre for " << theHit << "!\n\n";
currentHealth=ogre.getHealth()-theHit;
ogre.setHealth(currentHealth);
if(1 > ogre.getHealth())
{
cout << "You have slain an ogre and receive 90 gold and 60 experience!\n\nPlease press enter to continue...\n";
newGold = ourHero.getGold()+90;
ourHero.setGold(newGold);
experience = experience +60;
ogre.setHealth(0);
}
}
else
{
cout << "The ogre has dodged your swing!\n\n";
}
if(ogre.getHealth()>0)
{
if((ogre.getStr()+(rand()%11))>(ourHero.getDex()+(rand()%11)))
{
theHit=ogre.getStr()*2;
theHit=theHit*ourHero.getArmor();
cout << "The ogre has hit you for " << theHit << "!\n\n";
currentHealth=ourHero.getHealth()-theHit;
ourHero.setHealth(currentHealth);
}
else
{
cout << "You have dodged the ogre's attack!";
}
}
cin.ignore();
cin.get();
system("cls");
break;
}
case 2:
{
if((rand()%3)<2)
{
cout << "For some odd reason, the ogre allows you to keep your life.\n";
cout << "Please press enter to continue...\n";
cin.ignore();
cin.get();
system("cls");
ogre.setHealth(0);
break;
}
else
{
cout << "Poor decision. The ogre executes you!";
Sleep(3000);
system("cls");
ourHero.setHealth(0);
ogre.setHealth(0);
break;
}
break;
}
default:
{
cout << "Invalid selection.\n\n";
cout << "Please press enter to continue...\n";
cin.ignore();
cin.get();
system("cls");
}
}
if(ourHero.getHealth()<1)
{
cout << "You are dead.Finito.Its over.Should have stayed at the farm.";
Sleep(1700);
system("cls");
break;
}
}
break;
}
case 3:
{
cout << "A frosttroll enters The fort.\n";
character frosttroll("frosttroll", 110, 21, 19, 1, 0, 0);
while(frosttroll.getHealth()>0)
{
cout << "Which action would you like to take?\n\n[1]Attack\n\n[2]Beg for mercy\n";
cin >> combatChoice;
system("cls");
switch(combatChoice)
{
case 1:
{
if((ourHero.getStr()+(rand()%11))>(frosttroll.getDex()+(rand()%11)))
{
theHit=ourHero.getStr()*(ourWeapon.getDamageMultiplier1()+ourWeapon.getDamageMultiplier2());
cout << "You have hit the frosttroll for " << theHit << "!\n\n";
currentHealth=frosttroll.getHealth()-theHit;
frosttroll.setHealth(currentHealth);
if(1 > frosttroll.getHealth())
{
cout << "You have slain a frosttroll. You receive 105 gold and 65 experience!\n\nPlease press enter to continue...\n";
newGold = ourHero.getGold()+105;
experience = experience +65;
ourHero.setGold(newGold);
frosttroll.setHealth(0);
}
}
else
{
cout << "The frosttroll has dodged your swing!\n\n";
}
if(frosttroll.getHealth()>0)
{
if((frosttroll.getStr()+(rand()%11))>(ourHero.getDex()+(rand()%11)))
{
theHit=frosttroll.getStr()*2.4;
theHit=theHit*ourHero.getArmor();
cout << "The frosttroll has hit you for " << theHit << "!\n\n";
currentHealth=ourHero.getHealth()-theHit;
ourHero.setHealth(currentHealth);
}
else
{
cout << "You have dodged the frosttroll's attack!";
}
}
cin.ignore();
cin.get();
system("cls");
break;
}
case 2:
{
if((rand()%3)<2)
{
cout << "For some odd reason, the frosttroll allows you to keep your life.\n";
cout << "Please press enter to continue...\n";
cin.ignore();
cin.get();
system("cls");
frosttroll.setHealth(0);
break;
}
else
{
cout << "Poor decision. The frosttroll executes you!";
Sleep(3000);
system("cls");
ourHero.setHealth(0);
frosttroll.setHealth(0);
break;
}
break;
}
default:
{
cout << "Invalid selection.\n\n";
cout << "Please press enter to continue...\n";
cin.ignore();
cin.get();
system("cls");
}
}
if(ourHero.getHealth()<1)
{
cout << "You are dead.Finito.Its over.Should have stayed at the farm.";
Sleep(1700);
system("cls");
break;
}
}
break;
}
case 4:
{
character battlemage("battle mage", 150, 22, 20, 1, 0, 0);
cout << "You hear a gate from bexchd creak open, from within emerging a tall, slim \nfigure.\n\n";
Sleep(2450);
cout << "As the figure enters in the mild, sunlight you hear a whisper...\n\n";
cout << "Please press enter to continue...\n";
cin.ignore();
cin.get();
system("cls");
cout << "\"PSSSssst!Intensifies! Over hear!\"\n\nYou lean forward and see two beady eyes staring back at you.\n\n";
Sleep(4000);
cout << "\"Help me!\"\n\n";
Sleep(1700);
system("cls");
cout <<"As you look up, you find The fort fighter's foot infront of your face.\n\n";
if((battlemage.getStr()+(rand()%11))>(ourHero.getDex()+(rand()%11)))
{
theHit=battlemage.getStr()*2.7;
theHit=theHit*ourHero.getArmor();
cout << "The fort fighter has hit you for " << theHit << "!\n\n";
currentHealth=ourHero.getHealth()-theHit;
ourHero.setHealth(currentHealth);
}
else
{
cout << "You have dodged The fort fighter's foot!\n";
}
while(battlemage.getHealth()>0)
{
cout << "Which action would you like to take?\n\n[1]Attack\n\n[2]Beg for mercy\n";
cin >> combatChoice;
system("cls");
switch(combatChoice)
{
case 1:
{
if((ourHero.getStr()+(rand()%11))>(battlemage.getDex()+(rand()%11)))
{
theHit=ourHero.getStr()*(ourWeapon.getDamageMultiplier1()+ourWeapon.getDamageMultiplier2());
cout << "You have hit The fort fighter for " << theHit << "!\n\n";
currentHealth=battlemage.getHealth()-theHit;
battlemage.setHealth(currentHealth);
if(1 > battlemage.getHealth())
{
cout << "You have slain The fort fighter and receive 200 gold and 120 experience!\n\nPlease press enter to continue...\n";
newGold = ourHero.getGold()+200;
ourHero.setGold(newGold);
experience = experience +120;
battlemage.setHealth(0);
}
}
else
{
cout << "The fort fighter has dodged your swing!\n\n";
}
if(battlemage.getHealth()>0)
{
if((battlemage.getStr()+(rand()%11))>(ourHero.getDex()+(rand()%11)))
{
theHit=battlemage.getStr()*3;
theHit=theHit*ourHero.getArmor();
cout << "The fort fighter has hit you for " << theHit << "!\n\n";
currentHealth=ourHero.getHealth()-theHit;
ourHero.setHealth(currentHealth);
}
else
{
cout << "You have dodged The fort fighter's attack!";
}
}
cin.ignore();
cin.get();
system("cls");
break;
}
case 2:
{
cout << "Very poor decision. The The fort fighter executes you!\n";
Sleep(1500);
cout << "BEHEADED!!!";
Sleep(3000);
system("cls");
ourHero.setHealth(0);
battlemage.setHealth(0);
break;
}
default:
{
cout << "Invalid selection.\n\n";
cout << "Please press enter to continue...\n";
cin.ignore();
cin.get();
system("cls");
}
}
if(ourHero.getHealth()<1)
{
cout << "You are dead.Finito.Its over.Should have stayed at the farm.";
Sleep(1700);
system("cls");
break;
}
}
break;
}
default:
{
cout << "Invalid selection.\n\n";
cout << "Please press enter to continue...\n";
cin.ignore();
cin.get();
system("cls");
}
}
if(ourHero.getLevel() == 3)
switch(ForestChoice)
{
case 1:
{
cout << "A frosttroll enters The fort.\n";
character frosttroll("frosttroll", 130, 21, 20, 1, 0, 0);
while(frosttroll.getHealth()>0)
{
cout << "Which action would you like to take?\n\n[1]Attack\n\n[2]Beg for mercy\n";
cin >> combatChoice;
system("cls");
switch(combatChoice)
{
case 1:
{
if((ourHero.getStr()+(rand()%11))>(frosttroll.getDex()+(rand()%11)))
{
theHit=ourHero.getStr()*(ourWeapon.getDamageMultiplier1()+ourWeapon.getDamageMultiplier2());
cout << "You have hit the frosttroll for " << theHit << "!\n\n";
currentHealth=frosttroll.getHealth()-theHit;
frosttroll.setHealth(currentHealth);
if(1 > frosttroll.getHealth())
{
cout << "You have slain a frosttroll and receive 115 gold and 80 experience!\n\nPlease press enter to continue...\n";
newGold = ourHero.getGold()+115;
ourHero.setGold(newGold);
experience = experience +80;
frosttroll.setHealth(0);
}
}
else
{
cout << "The frosttroll has dodged your swing!\n\n";
}
if(frosttroll.getHealth()>0)
{
if((frosttroll.getStr()+(rand()%11))>(ourHero.getDex()+(rand()%11)))
{
theHit=frosttroll.getStr()*2.8;
theHit=theHit*ourHero.getArmor();
cout << "The frosttroll has hit you for " << theHit << "!\n\n";
currentHealth=ourHero.getHealth()-theHit;
ourHero.setHealth(currentHealth);
}
else
{
cout << "You have dodged the frosttroll's attack!";
}
}
cin.ignore();
cin.get();
system("cls");
break;
}
case 2:
{
if((rand()%3)<2)
{
cout << "For some odd reason, the frosttroll allows you to keep your life.\n";
cout << "Please press enter to continue...\n";
cin.ignore();
cin.get();
system("cls");
frosttroll.setHealth(0);
break;
}
else
{
cout << "Poor decision. The frosttroll executes you!";
Sleep(3000);
system("cls");
ourHero.setHealth(0);
frosttroll.setHealth(0);
break;
}
break;
}
default:
{
cout << "Invalid selection.\n\n";
cout << "Please press enter to continue...\n";
cin.ignore();
cin.get();
system("cls");
}
}
if(ourHero.getHealth()<1)
{
cout << "You are dead.Finito.Its over.Should have stayed at the farm.";
Sleep(1700);
system("cls");
break;
}
}
break;
}
case 2:
{
cout << "An icefiend enters The fort.\n";
character icefiend("icefiend", 130, 24, 23, 1, 0, 0);
while(icefiend.getHealth()>0)
{
cout << "Which action would you like to take?\n\n[1]Attack\n\n[2]Beg for mercy\n";
cin >> combatChoice;
system("cls");
switch(combatChoice)
{
case 1:
{
if((ourHero.getStr()+(rand()%11))>(icefiend.getDex()+(rand()%11)))
{
theHit=ourHero.getStr()*(ourWeapon.getDamageMultiplier1()+ourWeapon.getDamageMultiplier2());
cout << "You have hit the icefiend for " << theHit << "!\n\n";
currentHealth=icefiend.getHealth()-theHit;
icefiend.setHealth(currentHealth);
if(1 > icefiend.getHealth())
{
cout << "You have slain an icefiend and receive 135 gold and 90 experience!\n\nPlease press enter to continue...\n";
newGold = ourHero.getGold()+135;
ourHero.setGold(newGold);
experience = experience +90;
icefiend.setHealth(0);
}
}
else
{
cout << "The icefiend has dodged your swing!\n\n";
}
if(icefiend.getHealth()>0)
{
if((icefiend.getStr()+(rand()%11))>(ourHero.getDex()+(rand()%11)))
{
theHit=icefiend.getStr()*2.5;
theHit=theHit*ourHero.getArmor();
cout << "The icefiend has hit you for " << theHit << "!\n\n";
currentHealth=ourHero.getHealth()-theHit;
ourHero.setHealth(currentHealth);
if((rand()%4)<2)
{
cout << "The icefiend has chilled you, causing you to be freeze where you stand.\n\n";
Sleep(1800);
if((icefiend.getStr()+(rand()%11))>(ourHero.getDex()+(rand()%11)))
{
theHit=icefiend.getStr()*2.3;
theHit=theHit*ourHero.getArmor();
cout << "The icefiend has hit you for " << theHit << "!\n\nYou have unthawed.";
currentHealth=ourHero.getHealth()-theHit;
ourHero.setHealth(currentHealth);
}
else
{
cout << "You have dodged the icefiend's attack!\n\nYou have unthawed.";
}
}
}
else
{
cout << "You have dodged the icefiend's attack!";
}
}
cin.ignore();
cin.get();
system("cls");
break;
}
case 2:
{
if((rand()%3)<2)
{
cout << "For some odd reason, the icefiend allows you to keep your life.\n";
cout << "Please press enter to continue...\n";
cin.ignore();
cin.get();
system("cls");
icefiend.setHealth(0);
break;
}
else
{
cout << "Poor decision. The icefiend executes you!";
Sleep(3000);
system("cls");
ourHero.setHealth(0);
icefiend.setHealth(0);
break;
}
break;
}
default:
{
cout << "Invalid selection.\n\n";
cout << "Please press enter to continue...\n";
cin.ignore();
cin.get();
system("cls");
}
}
if(ourHero.getHealth()<1)
{
cout << "You are dead.Finito.Its over.Should have stayed at the farm.";
Sleep(1700);
system("cls");
break;
}
}
break;
}
case 3:
{
cout << "A minotaur enters The fort.You wet your pants\n";
character minotaur("minotaur", 180, 25, 23, 1, 0, 0);
while(minotaur.getHealth()>0)
{
cout << "Which action would you like to take?\n\n[1]Attack\n\n[2]Beg for mercy\n";
cin >> combatChoice;
system("cls");
switch(combatChoice)
{
case 1:
{
if((ourHero.getStr()+(rand()%11))>(minotaur.getDex()+(rand()%11)))
{
theHit=ourHero.getStr()*(ourWeapon.getDamageMultiplier1()+ourWeapon.getDamageMultiplier2());
cout << "You have hit the minotaur for " << theHit << "!\n\n";
currentHealth=minotaur.getHealth()-theHit;
minotaur.setHealth(currentHealth);
if(1 > minotaur.getHealth())
{
cout << "You have slain a minotaur and receive 170 gold and 110 experience!\n\nPlease press enter to continue...\n";
newGold = ourHero.getGold()+170;
experience = experience +110;
ourHero.setGold(newGold);
minotaur.setHealth(0);
}
}
else
{
cout << "The minotaur has dodged your swing!\n\n";
}
if(minotaur.getHealth()>0)
{
if((minotaur.getStr()+(rand()%11))>(ourHero.getDex()+(rand()%11)))
{
theHit=minotaur.getStr()*2.5;
theHit=theHit*ourHero.getArmor();
cout << "The minotaur has hit you for " << theHit << "!\n\n";
currentHealth=ourHero.getHealth()-theHit;
ourHero.setHealth(currentHealth);
}
else
{
cout << "You have dodged the minotaur's attack!";
}
}
cin.ignore();
cin.get();
system("cls");
break;
}
case 2:
{
if((rand()%3)<2)
{
cout << "For some odd reason, the minotaur allows you to keep your life.\n";
cout << "Please press enter to continue...\n";
cin.ignore();
cin.get();
system("cls");
minotaur.setHealth(0);
break;
}
else
{
cout << "Poor decision. The minotaur executes you!";
Sleep(3000);
system("cls");
ourHero.setHealth(0);
minotaur.setHealth(0);
break;
}
break;
}
default:
{
cout << "Invalid selection.\n\n";
cout << "Please press enter to continue...\n";
cin.ignore();
cin.get();
system("cls");
}
}
if(ourHero.getHealth()<1)
{
cout << "You are dead.Finito.Its over.Should have stayed at the farm.";
Sleep(1700);
system("cls");
break;
}
}
break;
}
case 4:
{
cout << "You open the gates to find it empty.\n\nConfused, you turn around to find a leather wrapped man behind you.\n\n";
Sleep(3800);
cout << "\"You have done quite well for yourself in this pit, " << name << ", the\n" << ourHero.getClass() << "\".\n\n";
cout << "Please press enter to continue...\n";
cin.ignore();
cin.get();
system("cls");
cout << "\"I am Jorsarg, the weapon master. If you can defeat me, I may have a spot for\n you as a gladiator in the Ishgar Kingdom" <<
" Arena...";
Sleep(4000);
cout << " if you can defeat me\"\n\n";
Sleep(2000);
character weaponMaster("weapon master", 250, 27, 27, 1, 0, 0);
while(weaponMaster.getHealth()>0)
{
cout << "Which action would you like to take?\n\n[1]Attack\n\n[2]Beg for mercy\n";
cin >> combatChoice;
system("cls");
switch(combatChoice)
{
case 1:
{
if((ourHero.getStr()+(rand()%11))>(weaponMaster.getDex()+(rand()%11)))
{
theHit=ourHero.getStr()*(ourWeapon.getDamageMultiplier1()+ourWeapon.getDamageMultiplier2());
cout << "You have hit the weapon master for " << theHit << "!\n\n";
currentHealth=weaponMaster.getHealth()-theHit;
weaponMaster.setHealth(currentHealth);
if(1 > weaponMaster.getHealth())
{
cout << "You're not quite ready, but you are a promising combatant! I will be watching \nyour progress, so keep" <<
" your enemies beneath you.\n\n";
cout << "Please press enter to continue...\n";
cin.ignore();
cin.get();
system("cls");
cout << "You have earned 275 gold and 180 experience\n\nPlease press enter to continue...\n";
newGold = ourHero.getGold()+275;
ourHero.setGold(newGold);
experience=1701;
weaponMaster.setHealth(0);
}
}
else
{
cout << "The weapon master has dodged your swing!\n\n";
}
if(weaponMaster.getHealth()>0)
{
if((weaponMaster.getStr()+(rand()%11))>(ourHero.getDex()+(rand()%11)))
{
theHit=weaponMaster.getStr()*2.5;
theHit=theHit*ourHero.getArmor();
cout << "The weapon master's axe hits you for " << theHit << ".";
currentHealth=ourHero.getHealth()-theHit;
ourHero.setHealth(currentHealth);
}
else
{
cout << "You have dodged the weapon master's attack!";
}
}
cin.get();
cin.ignore();
system("cls");
break;
}
case 2:
{
cout << "Very disappointing...\n";
Sleep(1500);
cout << "The weapon master gives you a warrior's death!";
Sleep(3000);
system("cls");
ourHero.setHealth(0);
weaponMaster.setHealth(0);
break;
}
default:
{
cout << "Invalid selection.\n\n";
cout << "Please press enter to continue...\n";
cin.ignore();
cin.get();
system("cls");
}
}
if(ourHero.getHealth()<1)
{
cout << "You are dead.Finito.Its over.Should have stayed at the farm.";
Sleep(1700);
system("cls");
break;
}
}
break;
}
default:
{
cout << "Invalid selection.\n\n";
cout << "Please press enter to continue...\n";
cin.ignore();
cin.get();
system("cls");
}
}
if(ourHero.getLevel() == 4)
switch(ForestChoice)
{
case 1:
{
cout << "A minotaur enters The fort.\n";
character minotaur("minotaur", 200, 27, 26, 1, 0, 0);
while(minotaur.getHealth()>0)
{
cout << "Which action would you like to take?\n\n[1]Attack\n\n[2]Beg for mercy\n";
cin >> combatChoice;
system("cls");
switch(combatChoice)
{
case 1:
{
if((ourHero.getStr()+(rand()%11))>(minotaur.getDex()+(rand()%11)))
{
theHit=ourHero.getStr()*(ourWeapon.getDamageMultiplier1()+ourWeapon.getDamageMultiplier2());
cout << "You have hit the minotaur for " << theHit << "!\n\n";
currentHealth=minotaur.getHealth()-theHit;
minotaur.setHealth(currentHealth);
if(1 > minotaur.getHealth())
{
cout << "You have slain a minotaur and receive 200 gold and 140 experience!\n\nPlease press enter to continue...\n";
newGold = ourHero.getGold()+200;
experience = experience +140;
ourHero.setGold(newGold);
minotaur.setHealth(0);
}
}
else
{
cout << "The minotaur has dodged your swing!\n\n";
}
if(minotaur.getHealth()>0)
{
if((minotaur.getStr()+(rand()%11))>(ourHero.getDex()+(rand()%11)))
{
theHit=minotaur.getStr()*2.5;
theHit=theHit*ourHero.getArmor();
cout << "The minotaur has hit you for " << theHit << "!\n\n";
currentHealth=ourHero.getHealth()-theHit;
ourHero.setHealth(currentHealth);
}
else
{
cout << "You have dodged the minotaur's attack!";
}
}
cin.ignore();
cin.get();
system("cls");
break;
}
case 2:
{
if((rand()%3)<2)
{
cout << "For some odd reason, the minotaur allows you to keep your life.\n";
cout << "Please press enter to continue...\n";
cin.ignore();
cin.get();
system("cls");
minotaur.setHealth(0);
break;
}
else
{
cout << "Poor decision. The minotaur executes you!";
Sleep(3000);
system("cls");
ourHero.setHealth(0);
minotaur.setHealth(0);
break;
}
break;
}
default:
{
cout << "Invalid selection.\n\n";
cout << "Please press enter to continue...\n";
cin.ignore();
cin.get();
system("cls");
}
}
if(ourHero.getHealth()<1)
{
cout << "You are dead.Finito.Its over.Should have stayed at the farm.";
Sleep(1700);
system("cls");
break;
}
}
break;
}
case 2:
{
cout << "An enchanter enters The fort.\n";
character enchanter("enchanter", 210, 26, 24, 1, 0, 0);
while(enchanter.getHealth()>0)
{
cout << "Which action would you like to take?\n\n[1]Attack\n\n[2]Beg for mercy\n";
cin >> combatChoice;
system("cls");
switch(combatChoice)
{
case 1:
{
if((ourHero.getStr()+(rand()%11))>(enchanter.getDex()+(rand()%11)))
{
theHit=ourHero.getStr()*(ourWeapon.getDamageMultiplier1()+ourWeapon.getDamageMultiplier2());
cout << "You have hit the enchanter for " << theHit << "!\n\n";
currentHealth=enchanter.getHealth()-theHit;
enchanter.setHealth(currentHealth);
if(1 > enchanter.getHealth())
{
cout << "You have slain an enchanter and receive 230 gold and 165 experience!\n\nPlease press enter to continue...\n";
newGold = ourHero.getGold()+230;
ourHero.setGold(newGold);
experience = experience +150;
enchanter.setHealth(0);
}
}
else
{
cout << "The enchanter has dodged your swing!\n\n";
}
if(enchanter.getHealth()>0)
{
if((enchanter.getStr()+(rand()%11))>(ourHero.getDex()+(rand()%11)))
{
theHit=enchanter.getStr()*2.0;
theHit=theHit*ourHero.getArmor();
cout << "The enchanter has hit you for " << theHit << "!\n\n";
currentHealth=ourHero.getHealth()-theHit;
ourHero.setHealth(currentHealth);
if((rand()%4)<3)
{
cout << "You are enchanted! You awkwardly fight yourself.\n\n";
for(int x = 1;x < 3;x = rand()%6)
{
Sleep(1800);
if((enchanter.getStr()+(rand()%11))>(ourHero.getDex()+(rand()%11)))
{
theHit=enchanter.getStr()*2.0;
theHit=theHit*ourHero.getArmor();
cout << "You have hit yourself for " << theHit << "!\n\n";
currentHealth=ourHero.getHealth()-theHit;
ourHero.setHealth(currentHealth);
}
else
{
cout << "You have managed to miss yourself!\n\n";
}
}
cout << "The enchanter's spell has worn away.";
}
}
else
{
cout << "You have dodged the enchanter's attack!";
}
}
cin.ignore();
cin.get();
system("cls");
break;
}
case 2:
{
if((rand()%3)<2)
{
cout << "For some odd reason, the enchanter allows you to keep your life.\n";
cout << "Please press enter to continue...\n";
cin.ignore();
cin.get();
system("cls");
enchanter.setHealth(0);
break;
}
else
{
cout << "Poor decision. The enchanter executes you!";
Sleep(3000);
system("cls");
ourHero.setHealth(0);
enchanter.setHealth(0);
break;
}
break;
}
default:
{
cout << "Invalid selection.\n\n";
cout << "Please press enter to continue...\n";
cin.ignore();
cin.get();
system("cls");
}
}
if(ourHero.getHealth()<1)
{
cout << "You are dead.Finito.Its over.Should have stayed at the farm.";
Sleep(1700);
system("cls");
break;
}
}
break;
}
case 3:
{
cout << "Animated steel armour enters The fort.\n";
character steelArmour("animated steel armour", 220, 29, 26, 1, 0, 0);
while(steelArmour.getHealth()>0)
{
cout << "Which action would you like to take?\n\n[1]Attack\n\n[2]Beg for mercy\n";
cin >> combatChoice;
system("cls");
switch(combatChoice)
{
case 1:
{
if((ourHero.getStr()+(rand()%11))>(steelArmour.getDex()+(rand()%11)))
{
theHit=ourHero.getStr()*(ourWeapon.getDamageMultiplier1()+ourWeapon.getDamageMultiplier2());
cout << "You have hit the animated steel armour for " << theHit << "!\n\n";
currentHealth=steelArmour.getHealth()-theHit;
steelArmour.setHealth(currentHealth);
if(1 > steelArmour.getHealth())
{
cout << "The suit of armour collapses. You receive 250 gold and 160 experience!\n\nPlease press enter to continue...\n";
newGold = ourHero.getGold()+250;
experience = experience +160;
ourHero.setGold(newGold);
steelArmour.setHealth(0);
}
}
else
{
cout << "Your swing goes right through the animated steel armour!\n\n";
}
if(steelArmour.getHealth()>0)
{
if((steelArmour.getStr()+(rand()%11))>(ourHero.getDex()+(rand()%11)))
{
theHit=steelArmour.getStr()*2.5;
theHit=theHit*ourHero.getArmor();
cout << "The animated steel armour has hit you for " << theHit << "!\n\n";
currentHealth=ourHero.getHealth()-theHit;
ourHero.setHealth(currentHealth);
}
else
{
cout << "You have dodged the animated steel armour's attack!";
}
}
cin.ignore();
cin.get();
system("cls");
break;
}
case 2:
{
if((rand()%3)<2)
{
cout << "For some odd reason, the animated steel armour allows you to keep your life.\n";
cout << "Please press enter to continue...\n";
cin.ignore();
cin.get();
system("cls");
steelArmour.setHealth(0);
break;
}
else
{
cout << "Poor decision. The animated steel armour executes you!";
Sleep(3000);
system("cls");
ourHero.setHealth(0);
steelArmour.setHealth(0);
break;
}
break;
}
default:
{
cout << "Invalid selection.\n\n";
cout << "Please press enter to continue...\n";
cin.ignore();
cin.get();
system("cls");
}
}
if(ourHero.getHealth()<1)
{
cout << "You are dead.Finito.Its over.Should have stayed at the farm.";
Sleep(1700);
system("cls");
break;
}
}
break;
}
case 4:
{
cout << "A " << ourHero.getClass() << " enters the The fort.\n";
Sleep(2000);
system("cls");
cout << "As the " << ourHero.getClass() << " walks closer, you realize it's not just another opponent.\n";
Sleep(2500);
cout << "It's you, " << name << " !\n\n";
cout << "Please press enter to continue...\n";
cin.ignore();
cin.get();
cout << "How can this be?";
Sleep(2200);
system("cls");
character yourself("yourself", ourHero.getHealth()-50, ourHero.getStr(), ourHero.getDex()-2, 1, 0, 0);
while(yourself.getHealth()>0)
{
cout << "Which action would you like to take?\n\n[1]Attack\n\n[2]Beg for mercy\n";
cin >> combatChoice;
system("cls");
switch(combatChoice)
{
case 1:
{
if((ourHero.getStr()+(rand()%11))>(yourself.getDex()+(rand()%11)))
{
theHit=ourHero.getStr()*(ourWeapon.getDamageMultiplier1()+ourWeapon.getDamageMultiplier2());
cout << "You have hit the yourself for " << theHit << "!\n\n";
currentHealth=yourself.getHealth()-theHit;
yourself.setHealth(currentHealth);
if(1 > yourself.getHealth())
{
cout << "You have slain a yourself and receive 300 gold and 190 experience! You are still unsure what just happened." <<
"\n\nPlease press enter to continue...\n";
newGold = ourHero.getGold()+300;
ourHero.setGold(newGold);
experience = experience +190;
yourself.setHealth(0);
}
}
else
{
cout << name << " has dodged your swing!\n\n";
}
if(yourself.getHealth()>0)
{
if((yourself.getStr()+(rand()%11))>(ourHero.getDex()+(rand()%11)))
{
theHit=yourself.getStr()*(ourWeapon.getDamageMultiplier1()+ourWeapon.getDamageMultiplier2());
theHit=theHit*ourHero.getArmor();
cout << name << " has hit you for " << theHit << "!\n\n";
currentHealth=ourHero.getHealth()-theHit;
ourHero.setHealth(currentHealth);
}
else
{
cout << "You have dodged the " << name <<"'s attack!";
}
}
cin.ignore();
cin.get();
system("cls");
break;
}
case 2:
{
if((rand()%3)<2)
{
cout << "For some odd reason, you.. you opponent allows you to keep your life.\n";
cout << "Please press enter to continue...\n";
cin.ignore();
cin.get();
system("cls");
yourself.setHealth(0);
break;
}
else
{
cout << "Poor decision. " << name << " executes you!";
Sleep(3000);
system("cls");
ourHero.setHealth(0);
yourself.setHealth(0);
break;
}
break;
}
default:
{
cout << "Invalid selection.\n\n";
cout << "Please press enter to continue...\n";
cin.ignore();
cin.get();
system("cls");
}
}
if(ourHero.getHealth()<1)
{
cout << "You are dead.Finito.Its over.Should have stayed at the farm.";
Sleep(1700);
system("cls");
break;
}
}
break;
}
default:
{
cout << "Invalid selection.\n\n";
cout << "Please press enter to continue...\n";
cin.ignore();
cin.get();
system("cls");
}
}
if(ourHero.getLevel() == 5)
switch(ForestChoice)
{
case 1:
{
cout << "A dragon appears.";
character dragon("dragon", 275, 34, 32, 1, 0, 0);
while(dragon.getHealth()>0)
{
cout << "Which action would you like to take?\n\n[1]Attack\n\n[2]Beg for mercy\n";
cin >> combatChoice;
system("cls");
switch(combatChoice)
{
case 1:
{
if((ourHero.getStr()+(rand()%11))>(dragon.getDex()+(rand()%11)))
{
theHit=ourHero.getStr()*(ourWeapon.getDamageMultiplier1()+ourWeapon.getDamageMultiplier2());
cout << "You have hit the dragon for " << theHit << "!\n\n";
currentHealth=dragon.getHealth()-theHit;
dragon.setHealth(currentHealth);
if(1 > dragon.getHealth())
{
cout << "You have slain the dragon and receive 250 gold and 160 experience!\n\nPlease press enter to continue...\n";
newGold = ourHero.getGold()+250;
ourHero.setGold(newGold);
experience = experience +160;
dragon.setHealth(0);
}
}
else
{
cout << "The dragon has dodged your swing!\n\n";
}
if(dragon.getHealth()>0)
{
if((dragon.getStr()+(rand()%11))>(ourHero.getDex()+(rand()%11)))
{
theHit=dragon.getStr()*2.5;
theHit=theHit*ourHero.getArmor();
cout << "The dragon's cast hits you for " << theHit;
int dragonHit;
dragonHit=theHit*.65;
cout << ", also giving it " << dragonHit << " health!\n\n";
currentHealth=ourHero.getHealth()-theHit;
ourHero.setHealth(currentHealth);
newHealth = theHit + dragon.getHealth();
dragon.setHealth(newHealth);
}
else
{
cout << "You have dodged the dragon's attack!";
}
}
cin.ignore();
cin.get();
system("cls");
break;
}
case 2:
{
cout << "Very poor decision...\n";
Sleep(1500);
cout << "A dragon breathes in your soul!";
Sleep(3000);
system("cls");
ourHero.setHealth(0);
dragon.setHealth(0);
break;
}
default:
{
cout << "Invalid selection.\n\n";
cout << "Please press enter to continue...\n";
cin.ignore();
cin.get();
system("cls");
}
}
if(ourHero.getHealth()<1)
{
cout << "You are dead.Finito.Its over.Should have stayed at the farm.";
Sleep(1700);
system("cls");
break;
}
}
break;
}
case 2:
{
character battlemage("battle mage", 300, 37, 35, 1, 0, 0);
cout << "You hear a gate from bexchd creak open, from within emerging a tall, slim \nfigure.\n\n";
Sleep(2450);
cout << "As the figure enters in the mild, torch light you hear a whisper...\n\n";
cout << "Please press enter to continue...\n";
cin.ignore();
cin.get();
system("cls");
cout << "\"PSSSssst! Over hear!\"\n\nYou lean forward and see two beady eyes staring back at you.\n\n";
Sleep(4000);
cout << "\"Help me!\"\n\n";
Sleep(1700);
system("cls");
cout <<"As you look up, you find The fort fighter's foot infront of your face.\n\n";
if((battlemage.getStr()+(rand()%11))>(ourHero.getDex()+(rand()%11)))
{
theHit=battlemage.getStr()*2.7;
theHit=theHit*ourHero.getArmor();
cout << "The fort fighter has hit you for " << theHit << "!\n\n";
currentHealth=ourHero.getHealth()-theHit;
ourHero.setHealth(currentHealth);
}
else
{
cout << "You have dodged The fort fighter's foot!\n";
}
while(battlemage.getHealth()>0)
{
cout << "Which action would you like to take?\n\n[1]Attack\n\n[2]Beg for mercy\n";
cin >> combatChoice;
system("cls");
switch(combatChoice)
{
case 1:
{
if((ourHero.getStr()+(rand()%11))>(battlemage.getDex()+(rand()%11)))
{
theHit=ourHero.getStr()*(ourWeapon.getDamageMultiplier1()+ourWeapon.getDamageMultiplier2());
cout << "You have hit The fort fighter for " << theHit << "!\n\n";
currentHealth=battlemage.getHealth()-theHit;
battlemage.setHealth(currentHealth);
if(1 > battlemage.getHealth())
{
cout << "You have slain The fort fighter and receive 300 gold and 200 experience!\n\nPlease press enter to continue...\n";
newGold = ourHero.getGold()+300;
ourHero.setGold(newGold);
experience = experience +200;
battlemage.setHealth(0);
}
}
else
{
cout << "The fort fighter has dodged your swing!\n\n";
}
if(battlemage.getHealth()>0)
{
if((battlemage.getStr()+(rand()%11))>(ourHero.getDex()+(rand()%11)))
{
theHit=battlemage.getStr()*3;
theHit=theHit*ourHero.getArmor();
cout << "The fort fighter has hit you for " << theHit << "!\n\n";
currentHealth=ourHero.getHealth()-theHit;
ourHero.setHealth(currentHealth);
}
else
{
cout << "You have dodged The fort fighter's attack!";
}
}
cin.ignore();
cin.get();
system("cls");
break;
}
case 2:
{
cout << "Very poor decision. The The fort fighter executes you!\n";
Sleep(1500);
cout << "BEHEADED!!!";
Sleep(3000);
system("cls");
ourHero.setHealth(0);
battlemage.setHealth(0);
break;
}
default:
{
cout << "Invalid selection.\n\n";
cout << "Please press enter to continue...\n";
cin.ignore();
cin.get();
system("cls");
}
}
if(ourHero.getHealth()<1)
{
cout << "You are dead.Finito.Its over.Should have stayed at the farm.";
Sleep(1700);
system("cls");
break;
}
}
break;
}
case 3:
{
cout << "An icefiend enters The fort.\n";
character icefiend("icefiend", 330, 40, 40, 1, 0, 0);
while(icefiend.getHealth()>0)
{
cout << "Which action would you like to take?\n\n[1]Attack\n\n[2]Beg for mercy\n";
cin >> combatChoice;
system("cls");
switch(combatChoice)
{
case 1:
{
if((ourHero.getStr()+(rand()%11))>(icefiend.getDex()+(rand()%11)))
{
theHit=ourHero.getStr()*(ourWeapon.getDamageMultiplier1()+ourWeapon.getDamageMultiplier2());
cout << "You have hit the icefiend for " << theHit << "!\n\n";
currentHealth=icefiend.getHealth()-theHit;
icefiend.setHealth(currentHealth);
if(1 > icefiend.getHealth())
{
cout << "You have slain an icefiend and receive 135 gold and 90 experience!\n\nPlease press enter to continue...\n";
newGold = ourHero.getGold()+135;
ourHero.setGold(newGold);
experience = experience +90;
icefiend.setHealth(0);
}
}
else
{
cout << "The icefiend has dodged your swing!\n\n";
}
if(icefiend.getHealth()>0)
{
if((icefiend.getStr()+(rand()%11))>(ourHero.getDex()+(rand()%11)))
{
theHit=icefiend.getStr()*2.5;
theHit=theHit*ourHero.getArmor();
cout << "The icefiend has hit you for " << theHit << "!\n\n";
currentHealth=ourHero.getHealth()-theHit;
ourHero.setHealth(currentHealth);
if((rand()%4)<2)
{
cout << "The icefiend has chilled you, causing you to be freeze where you stand.\n\n";
Sleep(1800);
if((icefiend.getStr()+(rand()%11))>(ourHero.getDex()+(rand()%11)))
{
theHit=icefiend.getStr()*2.3;
theHit=theHit*ourHero.getArmor();
cout << "The icefiend has hit you for " << theHit << "!\n\nYou have unthawed.";
currentHealth=ourHero.getHealth()-theHit;
ourHero.setHealth(currentHealth);
}
else
{
cout << "You have dodged the icefiend's attack!\n\nYou have unthawed.";
}
}
}
else
{
cout << "You have dodged the icefiend's attack!";
}
}
cin.ignore();
cin.get();
system("cls");
break;
}
case 2:
{
if((rand()%3)<2)
{
cout << "For some odd reason, the icefiend allows you to keep your life.\n";
cout << "Please press enter to continue...\n";
cin.ignore();
cin.get();
system("cls");
icefiend.setHealth(0);
break;
}
else
{
cout << "Poor decision. The icefiend executes you!";
Sleep(3000);
system("cls");
ourHero.setHealth(0);
icefiend.setHealth(0);
break;
}
break;
}
default:
{
cout << "Invalid selection.\n\n";
cout << "Please press enter to continue...\n";
cin.ignore();
cin.get();
system("cls");
}
}
if(ourHero.getHealth()<1)
{
cout << "You are dead.Finito.Its over.Should have stayed at the farm.";
Sleep(1700);
system("cls");
break;
}
}
break;
}
case 4:
{
cout << "A fire elemental enters The fort.\n";
character fireElemental("fire elemental", 400, 44, 42, 1, 0, 0);
int slag=0;
while(fireElemental.getHealth()>0)
{
cout << "Which action would you like to take?\n\n[1]Attack\n\n[2]Beg for mercy\n";
cin >> combatChoice;
system("cls");
switch(combatChoice)
{
case 1:
{
if((ourHero.getStr()+(rand()%11))>(fireElemental.getDex()+(rand()%11)))
{
theHit=(ourHero.getStr()*(ourWeapon.getDamageMultiplier1()+ourWeapon.getDamageMultiplier2()))-(slag*4);
cout << "You have hit the fire elemental for " << theHit << "!\n\n";
currentHealth=fireElemental.getHealth()-theHit;
fireElemental.setHealth(currentHealth);
if(1 > fireElemental.getHealth())
{
cout << "You have slain a fire elemental and receive 500 gold and 300 experience!\n\nPlease press enter to continue...\n";
newGold = ourHero.getGold()+500;
ourHero.setGold(newGold);
experience = 5501;
fireElemental.setHealth(0);
}
}
else
{
cout << "The fire elemental has dodged your swing!\n\n";
}
if(fireElemental.getHealth()>0)
{
if((fireElemental.getStr()+(rand()%11))>(ourHero.getDex()+(rand()%11)))
{
theHit=fireElemental.getStr()*2.5;
theHit=theHit*ourHero.getArmor();
cout << "The fire elemental has burned you for " << theHit << "!\n\n";
currentHealth=ourHero.getHealth()-theHit;
ourHero.setHealth(currentHealth);
if((rand()%4)<2)
{
cout << "The fire elemental throws hot slag at you, covering you and your weapons.\n\n";
++slag;
}
}
else
{
cout << "You have dodged the fire elemental's attack!";
}
}
cin.ignore();
cin.get();
system("cls");
break;
}
case 2:
{
if((rand()%3)<2)
{
cout << "For some odd reason, the fire elemental allows you to keep your life.\n";
cout << "Please press enter to continue...\n";
cin.ignore();
cin.get();
system("cls");
fireElemental.setHealth(0);
break;
}
else
{
cout << "Poor decision. The fire elemental executes you!";
Sleep(3000);
system("cls");
ourHero.setHealth(0);
fireElemental.setHealth(0);
break;
}
break;
}
default:
{
cout << "Invalid selection.\n\n";
cout << "Please press enter to continue...\n";
cin.ignore();
cin.get();
system("cls");
}
}
if(ourHero.getHealth()<1)
{
cout << "You are dead.Finito.Its over.Should have stayed at the farm.";
Sleep(1700);
system("cls");
break;
}
}
break;
}
default:
{
cout << "Invalid selection.\n\n";
cout << "Please press enter to continue...\n";
cin.ignore();
cin.get();
system("cls");
}
}
if(ourHero.getLevel() == 6)
switch(xch)
{
case 'y':
{
cout << "Weapon master, Jorsarg, appears.";
character weaponMaster("weapon master", 600, 50, 43, 1, 0, 0);
while(weaponMaster.getHealth()>0)
{
cout << "Which action would you like to take?\n\n[1]Attack\n\n[2]Beg for mercy\n";
cin >> combatChoice;
system("cls");
switch(combatChoice)
{
case 1:
{
if((ourHero.getStr()+(rand()%11))>(weaponMaster.getDex()+(rand()%11)))
{
theHit=ourHero.getStr()*(ourWeapon.getDamageMultiplier1()+ourWeapon.getDamageMultiplier2());
cout << "You have hit the weapon master for " << theHit << "!\n\n";
currentHealth=weaponMaster.getHealth()-theHit;
weaponMaster.setHealth(currentHealth);
if(1 > weaponMaster.getHealth())
{
cout << "You have defeated the weapon master!\n\nPlease press enter to continue...\n"
<< "You have beaten The Ishgar Kingdom Pit!";
Sleep (3000);
system("cls");
cout << "Jorsarg congratulates you. \"Well done, " << name <<". You truely are worthy of fighting " <<
"infront of Prince Krism at the colosseum! If you can continue slaying your enemies there, as you did here " <<
"in The fort, by the end, all in Anternia shall know the name " << name << "!\n\n Please press enter " <<
"to continue.";
cin.ignore();
cin.get();
ourHero.setHealth(0);
}
}
else
{
cout << "The weapon master has dodged your swing!\n\n";
}
if(weaponMaster.getHealth()>0)
{
if((weaponMaster.getStr()+(rand()%11))>(ourHero.getDex()+(rand()%11)))
{
theHit=weaponMaster.getStr()*3.3;
theHit=theHit*ourHero.getArmor();
cout << "The weapon master hits you for " << theHit << "." <<
theHit << " health!\n\n";
currentHealth=ourHero.getHealth()-theHit;
ourHero.setHealth(currentHealth);
}
else
{
cout << "You have dodged the weapon master's attack!";
}
}
cin.ignore();
cin.get();
system("cls");
break;
}
case 2:
{
cout << "Very poor decision...\n";
Sleep(1500);
cout << "JORSARG DISMEMBERS YOU!";
Sleep(3000);
system("cls");
ourHero.setHealth(0);
weaponMaster.setHealth(0);
break;
}
default:
{
cout << "Invalid selection.\n\n";
cout << "Please press enter to continue...\n";
cin.ignore();
cin.get();
system("cls");
}
}
if(ourHero.getHealth()<1)
{
cout << "You are dead.Finito.Its over.Should have stayed at the farm.";
Sleep(1700);
system("cls");
break;
}
}
break;
}
default:
{
system("cls");
break;
}
}
break;
}
case 3: // The shady merchant(not original but...)
{
system("cls");
cout << "Welcome to wares of The Myserious Merchant......No I have real name.\n";
cout << "You currently have " << ourHero.getGold() << " gold.\n\n";
cout << "What would you like to buy?\n\n[1]Lesser Potion of Health - 25g\n\n[2]Healing Potion - 45g\n\n[3]Greater Potion of Health - 100g" <<
"\n\n[4]Potion of Buff-me-up(Certainly not steroids) - 65g\n\n[5]Potion of Dexterity(or sugar rush) - 50g\n\n[6]Exit\n";
int choice;
cin >> choice;
system("cls");
switch(choice)
{
case 1:
{
if(ourHero.getGold()>24)
{
newHealth = ourHero.getHealth()+20;
ourHero.setHealth(newHealth);
newGold = ourHero.getGold()-25;
ourHero.setGold(newGold);
cout << "Down the hatch... You feel a little healthier!";
cin.ignore();
cin.get();
system("cls");
break;
}
else
{
cout << "Are you trying to swindle us? Come back when you have the gold!";
cin.ignore();
cin.get();
system("cls");
break;
}
}
case 2:
{
if(ourHero.getGold()>44)
{
newHealth = ourHero.getHealth()+45;
ourHero.setHealth(newHealth);
newGold = ourHero.getGold()-45;
ourHero.setGold(newGold);
cout << "Down the hatch... You feel healthier!";
cin.ignore();
cin.get();
system("cls");
break;
}
else
{
cout << "Are you trying to swindle us? Come back when you have the gold!";
cin.ignore();
cin.get();
system("cls");
break;
}
}
case 3:
{
if(ourHero.getGold()>99)
{
newHealth = ourHero.getHealth()+110;
ourHero.setHealth(newHealth);
newGold = ourHero.getGold()-100;
ourHero.setGold(newGold);
cout << "Down the hatch... You feel really healthy!";
cin.ignore();
cin.get();
system("cls");
break;
}
else
{
cout << "Are you trying to swindle us? Come back when you have the gold!";
cin.ignore();
cin.get();
system("cls");
break;
}
}
case 4:
{
if(ourHero.getGold()>64)
{
newStr = ourHero.getStr()+1;
ourHero.setStr(newStr);
newGold = ourHero.getGold()-65;
ourHero.setGold(newGold);
cout << "Down the hatch... You feel stronger!";
cin.ignore();
cin.get();
system("cls");
break;
}
else
{
cout << "Are you trying to swindle us? Come back when you have the gold!";
cin.ignore();
cin.get();
system("cls");
break;
}
}
case 5:
{
if(ourHero.getGold()>49)
{
newDex = ourHero.getDex()+1;
ourHero.setDex(newDex);
newGold = ourHero.getGold()-50;
ourHero.setGold(newGold);
cout << "Down the hatch... You feel more agile!";
cin.ignore();
cin.get();
system("cls");
break;
}
else
{
cout << "Are you trying to swindle us? Come back when you have the gold!";
cin.ignore();
cin.get();
system("cls");
break;
}
}
case 6:
{
break;
}
default:
{
cout << "Invalid selection.\n\n";
cout << "Please press enter to continue...\n";
cin.ignore();
cin.get();
system("cls");
}
}
break;
}
case 4: // Stats
{
cout << "Here are the stats for our " << ourHero.getClass() << ", " <<
name << "." << endl <<endl;
cout << "Health: " << ourHero.getHealth() << endl << "Strength: " << ourHero.getStr() <<
endl << "Dexterity: " << ourHero.getDex() << endl << endl;
cout << "Weapon stats for " << ourWeapon.getWeaponName() << "." << endl << endl;
cout << "Primary Damage: " << ourWeapon.getDamageMultiplier1() << endl <<
"Secondary Damage: " << ourWeapon.getDamageMultiplier2();
cin.ignore();
cin.get();
system("cls");
break;
}
case 5: // Quit Game
{
cout << "Are you sure you wish to exit The Bizarre Adventures of Zorro?\n[Y]es or [n]o?";
char yes;
cin >> yes;
if(yes == 'y' || yes == 'Y')
ourHero.setHealth(0);
system("cls");
break;
}
default:
{
cout << "Invalid selection.\n\n";
cout << "Please press enter to continue...\n";
cin.ignore();
cin.get();
system("cls");
}
}
}
if (ourHero.getHealth()<1)
{
gameOver();
cout << "You finished with " << experience << " experience.";
cin.get();
cin.ignore();
system("cls");
}
cout << "Play again?\n[Y]es or [n]o?";
cin >> xch;
switch(xch)
{
case 'y':
{
main();
break;
}
case 'Y':
{
main();
break;
}
default:
break;
}
return 0;
}