Hi guys, im new to these forums and new to C++. I love games (mainly RPG's) so I figured I would learn C++ by making a little text based RPG. Anyways, I read through a few tutorials and an olc C++ for dummies book and this is what I cam up with so far. I know this is far from good, but it's a start :)
So basically, I want to learn C++ and learn good codding practices with it, and I know that OOP is the way I shold be headed. I was told before that I need to make my Character information all in a class, and make my battle system (If i can ever figure it out) a class as well. But I am honestly not understanding the concept and uses of turning the code present into classes. SO any advice on how I can properly and effectively use Classes better, and where I can improve elsewhere on what I have please let me know :)
Thank you guys very much for your time and help. Oh and if this is being posted in the wrong spot please let me know, I do appologize in advance if so.
#include <cstdlib>
#include <iostream>
#include <string>
using namespace std;
class playerClass {
public:
void coolSaying(){
cout << "Class output" << endl;
}
};
//<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>//
////////////////////////////////////////////////////////////////////////////////
////////////////////////////// Variables ///////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
//<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>//
//<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>//
//Misc
//<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>//
char characterCreation;
char Selection;
int playerDirection;
string playerInput;
//<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>//
//Character information
//<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>//
string playerName;
string playerClass;
int playerCon;
int playerStr;
int playerDex;
int playerIntel;
int playerWis;
long playerStartingHp = 10;
long playerStartingPhysicalDmg = 5;
long playerStartingInitiative = 5;
long playerStartingPhysicalDefense = 5;
long playerStartingMagicDefense = 5;
long playerStartingSpellPower = 5;
long playerCoins = 50;
long playerEXP = 0;
long playerLevelUp;
long playerCurrentHp = (playerCon + playerStartingHp);
long playerCurrentDmg = (playerStr + playerStartingPhysicalDmg);
long playerCurrentSpellPower = (playerIntel + playerStartingSpellPower);
long playerCurrentDefense = (playerCon + playerStartingPhysicalDefense);
long playerCurrentMagicDefense = (playerIntel + playerStartingMagicDefense);
long playerCurrentInitiative = (playerDex + playerStartingInitiative);
//<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>//
//Character Classes
//<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>//
string Fighter;
string Thief;
string Mage;
string Cleric;
//<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>//
//Weapons
//<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>//
int dagger = 1;
int shortSword = 2;
int longSword = 3;
//Armor
int paddedArmor = 1;
int leatherArmor = 2;
int ringMailArmor = 3;
//Accessories
//<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>//
//NPC's (Mobs)
//<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>//
int mobCon;
int mobStr;
int mobDex;
int mobIntel;
int mobWis;
long mobHp = 10;
long mobPhysicalDmg = 5;
long mobInitiative = 5;
long mobPhysicalDefense = 5;
long mobMagicDefense = 5;
long mobSpellPower = 5;
long mobCoins = 50;
long mobEXP = 0;
string mobName;
string mobClass;
//<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>//
////////////////////////////////////////////////////////////////////////////////
////////////////////////////// Functions ///////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
//<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>//
void battleFunc();
void playerAttackFunc();
void playerFlee();
void mobAttackFunc();
void playerDeathFunc();
void playerWinFunc();
void playerLevelUpFunc();
void playerHealInnFunc();
void playerShopPurchaseFunc();
void playerShopSellFunc();
void playerStatMenuFunc()
{
cout << "Con - " << playerCon << "\n";
cout << "Str - " << playerStr << "\n";
cout << "Dex - " << playerDex << "\n";
cout << "Int - " << playerIntel << "\n";
cout << "Wis - " << playerWis << "\n\n";
cout << "Hp - " << playerCurrentHp << "\t";
cout << "Defense - " << playerCurrentDefense << "\t";
cout << "Magic Defense - " << playerCurrentMagicDefense << "\n\n";
cout << "Attack - " << playerCurrentDmg << "\t";
cout << "Spell Power - " << playerCurrentSpellPower << "\t";
cout << "Initiative - " << playerCurrentInitiative << "\n";
cout << "Wealth - " << playerCoins << " Coins\n\n";
}
//<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>//
// Game Map Index //
// -------------- //
// //
// To use the map index, hit 'ctrl + f' and enter the ind # to skip straight //
// to the desired map location function. //
// //
// //
//----------------------------------------------------------------------------//
// Ind# Streets |Pirantha| Notes //
//----------------------------------------------------------------------------//
// p01 - Center of Town | Game starting location //
// //
// p02 - North Road 1 | //
// p03 - North Road 2 | //
// p04 - North Road 3 | //
// p05 - North Road 4 | //
// p06 - North Gate | City Guard //
// //
// p07 - South Road 1 | //
// p08 - South Road 2 | //
// p09 - South Road 3 | //
// p10 - South Road 4 | //
// p11 - South Gate | City Guard //
// //
// p12 - East Road 1 | //
// p13 - East Road 2 | //
// p14 - East Road 3 | //
// p15 - East Road 3 | //
// p16 - East Gate | City Guard //
// //
// p17 - West Road 1 | //
// p18 - West Road 2 | //
// p19 - West Road 3 | //
// p20 - West Road 4 | //
// p21 - West Gate | City Guard //
// //
// p22 - Weapon Shop | NPC ran shop, buy, sell, view items //
// p23 - Armor Shop | NPC ran shop, buy, sell, view items //
// p24 - Item Shop | NPC ran shop, buy, sell, view items //
// p25 - Inn | NPC ran business, Pay to rest and heal //
// //
// p26 - Fighter Guild | Pick up class related quests //
// p27 - Thief Guild | Pick up class related quests //
// p28 - Mage Guild | Pick up class related quests //
// p29 - Cleric Guild | Pick up class related quests //
// //
//----------------------------------------------------------------------------//
// //
// //
//<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>//
//<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>//
//City of Pirithia - Begin //
//Notes: Main city in the game. Want to have an armor shop, weapon shop, inn //
//for resting and healing lost hp for a fee, a class trainer. //
//<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>//
//<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>//
void pirithaNorthRoad1Func();
void pirithaNorthRoad2Func();
void pirithaNorthRoad3Func();
void pirithaNorthRoad4Func();
void pirithaNorthGateFunc();
void pirithaSouthRoad1Func();
void pirithaSouthRoad2Func();
void pirithaSouthRoad3Func();
void pirithaSouthRoad4Func();
void pirithaSouthGateFunc();
void pirithaEastRoad1Func();
void pirithaEastRoad2Func();
void pirithaEastRoad3Func();
void pirithaEastRoad4Func();
void pirithaEastGateFunc();
void pirithaWestRoad1Func();
void pirithaWestRoad2Func();
void pirithaWestRoad3Func();
void pirithaWestRoad4Func();
void pirithaWestGateFunc();
void pirithaWeaponShopFunc();
void pirithaArmorShopFunc();
void pirithaItemShopFunc();
void pirithaInnFunc();
void pirithaFighterGuildFunc();
void pirithaThiefGuildFunc();
void pirithaClericGuildFunc();
void pirithaMageGuildFunc();
// p01 - Pirithia Center of Town
void pirithaCOTFunc()
{
system ("cls");
cout << "\n";
cout << " ---------------\n";
cout << " Center of Town\n";
cout << " ---------------\n\n";
cout << " You are standing in the center of downtown Piritha. \n";
cout << " You notice that all the store and street lights are \n";
cout << " completly out. The only noticable light you see is coming from the well lit\n";
cout << " clock tower at City Hall. \n\n";
cout << " Obvious exits are:\n";
cout << " (N)orth --> \t North Raod (City of Piritha)\n";
cout << " (S)outh --> \t South Raod (City of Piritha)\n";
cout << " (E)ast --> \t East Raod (City of Piritha)\n";
cout << " (W)est --> \t West Raod (City of Piritha)\n\n";
cout << " Direction of travel: ";
cin >> Selection;
switch (Selection)
{
case 'N':
pirithaNorthRoad1Func();
break;
case 'S':
pirithaSouthRoad1Func();
break;
case 'E':
pirithaEastRoad1Func();
break;
case 'W':
pirithaWestRoad1Func();
break;
default:
cout << "\n\n";
cout << "You can not go that way!\n";
pirithaCOTFunc();
break;
}
return;
}
// p02 - North Road 1.
void pirithaNorthRoad1Func()
{
system ("cls");
cout << "\n";
cout << " ---------------\n";
cout << " North Road 1:\n";
cout << " ---------------\n\n";
cout << " This is a smoothly paved and well traveled road within the city \n";
cout << " walls of Pirithia. The street is lined with lamps, that light up\n";
cout << " the streets on even the darkest of nights. There are houses to the\n";
cout << " east and west, and the road to the south and north.\n\n";
cout << " Obvious exits are:\n";
cout << " (N)orth --> \t North Raod 2 (City of Piritha)\n";
cout << " (S)outh --> \t Center of Town (City of Piritha)\n\n";
cout << " Direction of travel: ";
cin >> Selection;
switch (Selection)
{
case 'N':
pirithaNorthRoad2Func();
break;
case 'S':
pirithaCOTFunc();
break;
case 'E':
pirithaInnFunc();
break;
case 'W':
pirithaWeaponShopFunc();
break;
default:
cout << "\n\n";
cout << "You can not go that way!\n";
pirithaNorthRoad1Func();
break;
}
return;
}
// p03 - North Road 2.
void pirithaNorthRoad2Func()
{
system ("cls");
cout << "\n";
cout << " ---------------\n";
cout << " North Road 2:\n";
cout << " ---------------\n\n";
cout << " This is a smoothly paved and well traveled road within the city \n";
cout << " walls of Pirithia. The street is lined with lamps, that light up\n";
cout << " the streets on even the darkest of nights. There are houses to the\n";
cout << " east and west, and the road to the south and north.\n\n";
cout << " Obvious exits are:\n";
cout << " (N)orth --> \t North Road 3 (City of Piritha)\n";
cout << " (S)outh --> \t North Road 2 (City of Piritha)\n\n";
cout << " Direction of travel: ";
cin >> Selection;
switch (Selection)
{
case 'N':
pirithaNorthRoad3Func();
break;
case 'S':
pirithaNorthRoad1Func();
break;
default:
cout << "\n\n";
cout << "You can not go that way!\n";
pirithaNorthRoad2Func();
break;
}
return;
}
// p04 - North Road 3.
void pirithaNorthRoad3Func()
{
system ("cls");
cout << "\n";
cout << " ---------------\n";
cout << " North Road 3:\n";
cout << " ---------------\n\n";
cout << " This is a smoothly paved and well traveled road within the city \n";
cout << " walls of Pirithia. The street is lined with lamps, that light up\n";
cout << " the streets on even the darkest of nights. There are houses to the\n";
cout << " east and west, and the road to the south and north.\n\n";
cout << " Obvious exits are:\n";
cout << " (N)orth --> \t North Road 4 (City of Piritha)\n";
cout << " (S)outh --> \t North Road 2 (City of Piritha)\n\n";
cout << " Direction of travel: ";
cin >> Selection;
switch (Selection)
{
case 'N':
pirithaNorthRoad4Func();
break;
case 'S':
pirithaNorthRoad2Func();
break;
default:
cout << "\n\n";
cout << "You can not go that way!\n";
pirithaNorthRoad3Func();
break;
}
return;
}
// p05 - North Road 4.
void pirithaNorthRoad4Func()
{
system ("cls");
cout << "\n";
cout << " ---------------\n";
cout << " North Road 4:\n";
cout << " ---------------\n\n";
cout << " This is a smoothly paved and well traveled road within the city \n";
cout << " walls of Pirithia. The street is lined with lamps, that light up\n";
cout << " the streets on even the darkest of nights. There are houses to the\n";
cout << " east and west, and the road to the south and north.\n\n";
cout << " Obvious exits are:\n";
cout << " (N)orth --> \t North Gate (City of Piritha)\n";
cout << " (S)outh --> \t North Road 3 (City of Piritha)\n\n";
cout << " Direction of travel: ";
cin >> Selection;
switch (Selection)
{
case 'N':
pirithaNorthGateFunc();
break;
case 'S':
pirithaNorthRoad3Func();
break;
case 'E':
pirithaThiefGuildFunc();
break;
default:
cout << "\n\n";
cout << "You can not go that way!\n";
pirithaNorthRoad4Func();
break;
}
return;
}
// p06 - North Gate.
void pirithaNorthGateFunc()
{
system ("cls");
cout << "\n";
cout << " ---------------\n";
cout << " North Gate:\n";
cout << " ---------------\n\n";
cout << " This is a smoothly paved and well traveled road within the city \n";
cout << " walls of Pirithia. The street is lined with lamps, that light up\n";
cout << " the streets on even the darkest of nights. There are houses to the\n";
cout << " east and west, and the road to the south and north.\n\n";
cout << " Standing between you and the gates is a heavily armored City Guard.\n\n";
cout << " Obvious exits are:\n";
cout << " (N)orth --> \t North Forest 1 (North Woods)\n";
cout << " (S)outh --> \t North Road 3 (City of Piritha)\n\n";
cout << " Direction of travel: ";
cin >> Selection;
switch (Selection)
{
case 'N':
cout << "\n\n";
cout << "The City Guard prevents you from leaving and says - The gates are closed for the evening. Come back in the morning.\n\n";
pirithaNorthGateFunc();
break;
case 'S':
pirithaNorthRoad4Func();
break;
default:
cout << "\n\n";
cout << "You can not go that way!\n";
pirithaNorthGateFunc();
break;
}
return;
}
// p07 - South Road 1.
void pirithaSouthRoad1Func()
{
system ("cls");
cout << "\n";
cout << " ---------------\n";
cout << " South Road 1:\n";
cout << " ---------------\n\n";
cout << " This is a smoothly paved and well traveled road within the city \n";
cout << " walls of Pirithia. The street is lined with lamps, that light up\n";
cout << " the streets on even the darkest of nights. There are houses to the\n";
cout << " east and west, and the road to the south and north.\n\n";
cout << " Obvious exits are:\n";
cout << " (N)orth --> \t Center of Town (City of Piritha)\n";
cout << " (S)outh --> \t South Road 2 (City of Piritha)\n\n";
cout << " Direction of travel: ";
cin >> Selection;
switch (Selection)
{
case 'N':
pirithaCOTFunc();
break;
case 'S':
pirithaSouthRoad2Func();
break;
case 'E':
pirithaItemShopFunc();
break;
case 'W':
pirithaArmorShopFunc();
break;
default:
cout << "\n\n";
cout << "You can not go that way!\n";
pirithaSouthRoad1Func();
break;
}
return;
}
// p08 - South Road 2.
void pirithaSouthRoad2Func()
{
system ("cls");
cout << "\n";
cout << " ---------------\n";
cout << " South Road 2:\n";
cout << " ---------------\n\n";
cout << " This is a smoothly paved and well traveled road within the city \n";
cout << " walls of Pirithia. The street is lined with lamps, that light up\n";
cout << " the streets on even the darkest of nights. There are houses to the\n";
cout << " east and west, and the road to the south and north.\n\n";
cout << " Obvious exits are:\n";
cout << " (N)orth --> \t South Road 1 (City of Piritha)\n";
cout << " (S)outh --> \t South Road 3 (City of Piritha)\n\n";
cout << " Direction of travel: ";
cin >> Selection;
switch (Selection)
{
case 'N':
pirithaSouthRoad1Func();
break;
case 'S':
pirithaSouthRoad3Func();
break;
default:
cout << "\n\n";
cout << "You can not go that way!\n";
pirithaSouthRoad2Func();
break;
}
return;
}
// p09 - South Road 3.
void pirithaSouthRoad3Func()
{
system ("cls");
cout << "\n";
cout << " ---------------\n";
cout << " South Road 3:\n";
cout << " ---------------\n\n";
cout << " This is a smoothly paved and well traveled road within the city \n";
cout << " walls of Pirithia. The street is lined with lamps, that light up\n";
cout << " the streets on even the darkest of nights. There are houses to the\n";
cout << " east and west, and the road to the south and north.\n\n";
cout << " Obvious exits are:\n";
cout << " (N)orth --> \t South Road 2 (City of Piritha)\n";
cout << " (S)outh --> \t South Road 4 (City of Piritha)\n\n";
cout << " Direction of travel: ";
cin >> Selection;
switch (Selection)
{
case 'N':
pirithaSouthRoad2Func();
break;
case 'S':
pirithaSouthRoad4Func();
break;
default:
cout << "\n\n";
cout << "You can not go that way!\n";
pirithaSouthRoad3Func();
break;
}
return;
}
// p10 - South Road 4.
void pirithaSouthRoad4Func()
{
system ("cls");
cout << "\n";
cout << " ---------------\n";
cout << " South Road 4:\n";
cout << " ---------------\n\n";
cout << " This is a smoothly paved and well traveled road within the city \n";
cout << " walls of Pirithia. The street is lined with lamps, that light up\n";
cout << " the streets on even the darkest of nights. There are houses to the\n";
cout << " east and west, and the road to the south and north.\n\n";
cout << " Obvious exits are:\n";
cout << " (N)orth --> \t South Road 3 (City of Piritha)\n";
cout << " (S)outh --> \t South Gate (City of Piritha)\n\n";
cout << " Direction of travel: ";
cin >> Selection;
switch (Selection)
{
case 'N':
pirithaSouthRoad3Func();
break;
case 'S':
pirithaSouthGateFunc();
break;
case 'W':
pirithaFighterGuildFunc();
break;
default:
cout << "\n\n";
cout << "You can not go that way!\n";
pirithaSouthRoad4Func();
break;
}
return;
}
// p11 - South Gate.
void pirithaSouthGateFunc()
{
system ("cls");
cout << "\n";
cout << " ---------------\n";
cout << " South Gate:\n";
cout << " ---------------\n\n";
cout << " This is a smoothly paved and well traveled road within the city \n";
cout << " walls of Pirithia. The street is lined with lamps, that light up\n";
cout << " the streets on even the darkest of nights. There are houses to the\n";
cout << " east and west, and the road to the south and north.\n\n";
cout << " Obvious exits are:\n";
cout << " (N)orth --> \t South Road 4 (City of Piritha)\n";
cout << " (S)outh --> \t South Woods (City of Piritha)\n\n";
cout << " Direction of travel: ";
cin >> Selection;
switch (Selection)
{
case 'N':
pirithaSouthRoad4Func();
break;
case 'S':
cout << "\n\n";
cout << "The City Guard prevents you from leaving and says - The gates are closed for the evening. Come back in the morning.\n\n";
pirithaSouthGateFunc();
break;
default:
cout << "\n\n";
cout << "You can not go that way!\n";
pirithaSouthGateFunc();
break;
}
return;
}
// p12 - East Road 1.
void pirithaEastRoad1Func()
{
system ("cls");
cout << "\n";
cout << " ---------------\n";
cout << " East Road 1:\n";
cout << " ----------------\n\n";
cout << " This is a smoothly paved and well traveled road within the city \n";
cout << " walls of Pirithia. The street is lined with lamps, that light up\n";
cout << " the streets on even the darkest of nights. There are houses to the\n";
cout << " north and south, and the road to the east and west.\n\n";
cout << " Obvious exits are:\n";
cout << " (E)ast --> \t East Road 2 (City of Piritha)\n";
cout << " (W)est --> \t Center of Town (City of Piritha)\n\n";
cout << " Direction of travel: ";
cin >> Selection;
switch (Selection)
{
case 'E':
pirithaEastRoad2Func();
break;
case 'W':
pirithaCOTFunc();
break;
case 'N':
pirithaInnFunc();
break;
case 'S':
pirithaItemShopFunc();
break;
default:
cout << "\n\n";
cout << "You can not go that way!\n";
pirithaEastRoad1Func();
break;
}
return;
}
// p13 - East Road 2.
void pirithaEastRoad2Func()
{
system ("cls");
cout << "\n";
cout << " ---------------\n";
cout << " East Road 2:\n";
cout << " ----------------\n\n";
cout << " This is a smoothly paved and well traveled road within the city \n";
cout << " walls of Pirithia. The street is lined with lamps, that light up\n";
cout << " the streets on even the darkest of nights. There are houses to the\n";
cout << " north and south, and the road to the east and west.\n\n";
cout << " Obvious exits are:\n";
cout << " (E)ast --> \t East Road 3 (City of Piritha)\n";
cout << " (W)est --> \t East Road 1 (City of Piritha)\n\n";
cout << " Direction of travel: ";
cin >> Selection;
switch (Selection)
{
case 'W':
pirithaEastRoad3Func();
break;
case 'E':
pirithaEastRoad1Func();
break;
default:
cout << "\n\n";
cout << "You can not go that way!\n";
pirithaEastRoad2Func();
break;
}
return;
}
// p14 - East Road 3.
void pirithaEastRoad3Func()
{
system ("cls");
cout << "\n";
cout << " ---------------\n";
cout << " East Road 3:\n";
cout << " ----------------\n\n";
cout << " This is a smoothly paved and well traveled road within the city \n";
cout << " walls of Pirithia. The street is lined with lamps, that light up\n";
cout << " the streets on even the darkest of nights. There are houses to the\n";
cout << " north and south, and the road to the east and west.\n\n";
cout << " Obvious exits are:\n";
cout << " (E)ast --> \t East Road 3 (City of Piritha)\n";
cout << " (W)est --> \t East Road 1 (City of Piritha)\n\n";
cout << " Direction of travel: ";
cin >> Selection;
switch (Selection)
{
case 'E':
pirithaEastRoad4Func();
break;
case 'W':
pirithaEastRoad2Func();
break;
default:
cout << "\n\n";
cout << "You can not go that way!\n";
pirithaEastRoad3Func();
break;
}
return;
}
// p15 - East Road 4.
void pirithaEastRoad4Func()
{
system ("cls");
cout << "\n";
cout << " ---------------\n";
cout << " East Road 4:\n";
cout << " ----------------\n\n";
cout << " This is a smoothly paved and well traveled road within the city \n";
cout << " walls of Pirithia. The street is lined with lamps, that light up\n";
cout << " the streets on even the darkest of nights. There are houses to the\n";
cout << " north and south, and the road to the east and west.\n\n";
cout << " Obvious exits are:\n";
cout << " (E)ast --> \t East Road 3 (City of Piritha)\n";
cout << " (W)est --> \t East Road 1 (City of Piritha)\n\n";
cout << " Direction of travel: ";
cin >> Selection;
switch (Selection)
{
case 'E' | 'e':
pirithaEastGateFunc();
break;
case 'W':
pirithaEastRoad3Func();
break;
case 'N':
pirithaClericGuildFunc();
break;
default:
cout << "\n\n";
cout << "You can not go that way!\n";
pirithaEastRoad4Func();
break;
}
return;
}
// p16 - East Gate.
void pirithaEastGateFunc()
{
system ("cls");
cout << "\n";
cout << " ---------------\n";
cout << " East Gate:\n";
cout << " ----------------\n\n";
cout << " This is a smoothly paved and well traveled road within the city \n";
cout << " walls of Pirithia. The street is lined with lamps, that light up\n";
cout << " the streets on even the darkest of nights. There are houses to the\n";
cout << " north and south, and the road to the east and west.\n\n";
cout << " Obvious exits are:\n";
cout << " (E)ast --> \t East Woods (City of Piritha)\n";
cout << " (W)est --> \t East Road 1 (City of Piritha)\n\n";
cout << " Direction of travel: ";
cin >> Selection;
switch (Selection)
{
case 'E':
cout << "\n\n";
cout << "The City Guard prevents you from leaving and says - The gates are closed for the evening. Come back in the morning.\n\n";
pirithaEastGateFunc();
break;
case 'W':
pirithaEastRoad4Func();
break;
default:
cout << "\n\n";
cout << "You can not go that way!\n";
pirithaEastGateFunc();
break;
}
return;
}
// p17 - West Road 1.
void pirithaWestRoad1Func()
{
system ("cls");
cout << "\n";
cout << " ---------------\n";
cout << " West Road 1:\n";
cout << " ----------------\n\n";
cout << " This is a smoothly paved and well traveled road within the city \n";
cout << " walls of Pirithia. The street is lined with lamps, that light up\n";
cout << " the streets on even the darkest of nights. There are houses to the\n";
cout << " north and south, and the road to the east and west.\n\n";
cout << " Obvious exits are:\n";
cout << " (E)ast --> \t Center of Town (City of Piritha)\n";
cout << " (W)est --> \t West Road 2 (City of Piritha)\n\n";
cout << " Direction of travel: ";
cin >> Selection;
switch (Selection)
{
case 'E':
pirithaCOTFunc();
break;
case 'W':
pirithaWestRoad2Func();
break;
case 'N':
pirithaWeaponShopFunc();
break;
case 'S':
pirithaArmorShopFunc();
break;
default:
cout << "\n\n";
cout << "You can not go that way!\n";
pirithaWestRoad1Func();
break;
}
return;
}
// p18 - West Road 2.
void pirithaWestRoad2Func()
{
system ("cls");
cout << "\n";
cout << " ---------------\n";
cout << " West Road 2:\n";
cout << " ----------------\n\n";
cout << " This is a smoothly paved and well traveled road within the city \n";
cout << " walls of Pirithia. The street is lined with lamps, that light up\n";
cout << " the streets on even the darkest of nights. There are houses to the\n";
cout << " north and south, and the road to the east and west.\n\n";
cout << " Obvious exits are:\n";
cout << " (E)ast --> \t West Road 1 (City of Piritha)\n";
cout << " (W)est --> \t West Road 3 (City of Piritha)\n\n";
cout << " Direction of travel: ";
cin >> Selection;
switch (Selection)
{
case 'E':
pirithaWestRoad1Func();
break;
case 'W':
pirithaWestRoad3Func();
break;
default:
cout << "\n\n";
cout << "You can not go that way!\n";
pirithaEastRoad2Func();
break;
}
return;
}
// p19 - West Road 3.
void pirithaWestRoad3Func()
{
system ("cls");
cout << "\n";
cout << " ---------------\n";
cout << " West Road 3:\n";
cout << " ----------------\n\n";
cout << " This is a smoothly paved and well traveled road within the city \n";
cout << " walls of Pirithia. The street is lined with lamps, that light up\n";
cout << " the streets on even the darkest of nights. There are houses to the\n";
cout << " north and south, and the road to the east and west.\n\n";
cout << " Obvious exits are:\n";
cout << " (E)ast --> \t West Road 2 (City of Piritha)\n";
cout << " (W)est --> \t West Road 4 (City of Piritha)\n\n";
cout << " Direction of travel: ";
cin >> Selection;
switch (Selection)
{
case 'E':
pirithaWestRoad2Func();
break;
case 'W':
pirithaWestRoad4Func();
break;
default:
cout << "\n\n";
cout << "You can not go that way!\n";
pirithaWestRoad3Func();
break;
}
return;
}
// p20 - West Road 4.
void pirithaWestRoad4Func()
{
system ("cls");
cout << "\n";
cout << " ---------------\n";
cout << " West Road 4:\n";
cout << " ----------------\n\n";
cout << " This is a smoothly paved and well traveled road within the city \n";
cout << " walls of Pirithia. The street is lined with lamps, that light up\n";
cout << " the streets on even the darkest of nights. There are houses to the\n";
cout << " north and south, and the road to the east and west.\n\n";
cout << " Obvious exits are:\n";
cout << " (E)ast --> \t East Road 3 (City of Piritha)\n";
cout << " (W)est --> \t East Road 1 (City of Piritha)\n\n";
cout << " Direction of travel: ";
cin >> Selection;
switch (Selection)
{
case 'E':
pirithaWestRoad3Func();
break;
case 'W':
pirithaWestGateFunc();
break;
case 'N':
pirithaMageGuildFunc();
break;
default:
cout << "\n\n";
cout << "You can not go that way!\n";
pirithaWestRoad4Func();
break;
}
return;
}
// p21 - West Gate.
void pirithaWestGateFunc()
{
system ("cls");
cout << "\n";
cout << " ---------------\n";
cout << " West Gate:\n";
cout << " ----------------\n\n";
cout << " This is a smoothly paved and well traveled road within the city \n";
cout << " walls of Pirithia. The street is lined with lamps, that light up\n";
cout << " the streets on even the darkest of nights. There are houses to the\n";
cout << " north and south, and the road to the east and west.\n\n";
cout << " Obvious exits are:\n";
cout << " (E)ast --> \t West Road 4 (City of Piritha)\n";
cout << " (W)est --> \t West Woods (City of Piritha)\n\n";
cout << " Direction of travel: ";
cin >> Selection;
switch (Selection)
{
case 'W':
cout << "\n\n";
cout << "The City Guard prevents you from leaving and says - The gates are closed for the evening. Come back in the morning.\n\n";
pirithaWestGateFunc();
break;
case 'E':
pirithaWestRoad4Func();
break;
default:
cout << "\n\n";
cout << "You can not go that way!\n";
pirithaWestGateFunc();
break;
}
return;
}
// p22 - Pirithia Weapon shop
void pirithaWeaponShopFunc()
{
system ("cls");
cout << "\n";
cout << " --------------------\n";
cout << " Piritha Weapon Shop\n";
cout << " --------------------\n\n";
cout << " Welcome to the Piritha Weapon Shop!\n";
cout << " We sell weapons and stuff :) \n";
cout << " \n";
cout << " . \n\n";
cout << " Obvious exits are:\n";
cout << " (S)outh --> \t West Road 1 (City of Piritha)\n";
cout << " (E)ast --> \t North Road 1 (City of Piritha)\n";
cout << " Direction of travel: ";
cin >> Selection;
switch (Selection)
{
case 'S':
pirithaWestRoad1Func();
break;
case 'E':
pirithaNorthRoad1Func();
break;
default:
cout << "\n\n";
cout << "You can not go that way!\n";
pirithaWeaponShopFunc();
break;
}
return;
}
// p23 - Pirithia Armor shop
void pirithaArmorShopFunc()
{
system ("cls");
cout << "\n";
cout << " -------------------\n";
cout << " Piritha Armor Shop\n";
cout << " -------------------\n\n";
cout << " Welcome to the Piritha Armor Shop!\n";
cout << " We sell Armor and stuff :) \n";
cout << " \n";
cout << " . \n\n";
cout << " Obvious exits are:\n";
cout << " (N)orth --> \t West Road 1 (City of Piritha)\n";
cout << " (E)ast --> \t South Road 1 (City of Piritha)\n";
cout << " Direction of travel: ";
cin >> Selection;
switch (Selection)
{
case 'N':
pirithaWestRoad1Func();
break;
case 'E':
pirithaSouthRoad1Func();
break;
default:
cout << "\n\n";
cout << "You can not go that way!\n";
pirithaArmorShopFunc();
break;
}
return;
}
// p24 - Pirithia Item Shop
void pirithaItemShopFunc()
{
system ("cls");
cout << "\n";
cout << " ------------------\n";
cout << " Piritha Item Shop\n";
cout << " ------------------\n\n";
cout << " Welcome to the Piritha Item Shop!\n";
cout << " We sell items and stuff :) \n";
cout << " \n";
cout << " . \n\n";
cout << " Obvious exits are:\n";
cout << " (N)orth --> \t East Road 1 (City of Piritha)\n";
cout << " (W)est --> \t South Road 1 (City of Piritha)\n";
cout << " Direction of travel: ";
cin >> Selection;
switch (Selection)
{
case 'N':
pirithaEastRoad1Func();
break;
case 'W':
pirithaSouthRoad1Func();
break;
default:
cout << "\n\n";
cout << "You can not go that way!\n";
pirithaItemShopFunc();
break;
}
return;
}
// p25 - Pirithia Inn
void pirithaInnFunc()
{
system ("cls");
cout << "\n";
cout << " ------------\n";
cout << " Piritha Inn\n";
cout << " ------------\n\n";
cout << " Welcome to the Piritha Inn Shop!\n";
cout << " Come here to res and heal lost HP :) \n";
cout << " \n";
cout << " . \n\n";
cout << " Obvious exits are:\n";
cout << " (S)outh --> \t East Road 1 (City of Piritha)\n";
cout << " (W)est --> \t North Road 1 (City of Piritha)\n";
cout << " Direction of travel: ";
cin >> Selection;
switch (Selection)
{
case 'S':
pirithaEastRoad1Func();
break;
case 'W':
pirithaNorthRoad1Func();
break;
default:
cout << "\n\n";
cout << "You can not go that way!\n";
pirithaInnFunc();
break;
}
return;
}
// p26 - Pirithia Fighter Guild
void pirithaFighterGuildFunc()
{
system ("cls");
cout << "\n";
cout << " ----------------------\n";
cout << " Piritha Fighter Guild\n";
cout << " ----------------------\n\n";
cout << " Welcome to the Piritha Fighter Guild!\n";
cout << " Come here to pick up class specific quests. :) \n";
cout << " \n";
cout << " . \n\n";
cout << " Obvious exits are:\n";
cout << " (E)ast --> \t South Road 4 (City of Piritha)\n";
cout << " Direction of travel: ";
cin >> Selection;
switch (Selection)
{
case 'E':
pirithaSouthRoad4Func();
break;
default:
cout << "\n\n";
cout << "You can not go that way!\n";
pirithaFighterGuildFunc();
break;
}
return;
}
// p27 - Pirithia Thief Guild
void pirithaThiefGuildFunc()
{
system ("cls");
cout << "\n";
cout << " ----------------------\n";
cout << " Piritha Thief Guild\n";
cout << " ----------------------\n\n";
cout << " Welcome to the Piritha Thief Guild!\n";
cout << " Come here to pick up class specific quests. :) \n";
cout << " \n";
cout << " . \n\n";
cout << " Obvious exits are:\n";
cout << " (W)est --> \t North Road 4 (City of Piritha)\n";
cout << " Direction of travel: ";
cin >> Selection;
switch (Selection)
{
case 'W':
pirithaNorthRoad4Func();
break;
default:
cout << "\n\n";
cout << "You can not go that way!\n";
pirithaThiefGuildFunc();
break;
}
return;
}
// p28 - Pirithia Mage Guild
void pirithaMageGuildFunc()
{
system ("cls");
cout << "\n";
cout << " ----------------------\n";
cout << " Piritha Mage Guild\n";
cout << " ----------------------\n\n";
cout << " Welcome to the Piritha Mage Guild!\n";
cout << " Come here to pick up class specific quests. :) \n";
cout << " \n";
cout << " . \n\n";
cout << " Obvious exits are:\n";
cout << " (S)outh --> \t West Road 4 (City of Piritha)\n";
cout << " Direction of travel: ";
cin >> Selection;
switch (Selection)
{
case 'S':
pirithaWestRoad4Func();
break;
default:
cout << "\n\n";
cout << "You can not go that way!\n";
pirithaMageGuildFunc();
break;
}
return;
}
// p29 - Pirithia Cleric Guild
void pirithaClericGuildFunc()
{
system ("cls");
cout << "\n";
cout << " ----------------------\n";
cout << " Piritha Cleric Guild\n";
cout << " ----------------------\n\n";
cout << " Welcome to the Piritha Cleric Guild!\n";
cout << " Come here to pick up class specific quests. :) \n";
cout << " \n";
cout << " . \n\n";
cout << " Obvious exits are:\n";
cout << " (S)outh --> \t South Road 4 (City of Piritha)\n";
cout << " Direction of travel: ";
cin >> Selection;
switch (Selection)
{
case 'S':
pirithaEastRoad4Func();
break;
default:
cout << "\n\n";
cout << "You can not go that way!\n";
pirithaClericGuildFunc();
break;
}
return;
}
//<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>//
//<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>//
//City of Pirithia - end //
//<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>//
//<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>//
// 1 - Title Screen ////////////////////////////////////////////////////////////
void titleScreenFunc ()
{
cout << "\n";
cout << "\n";
cout << "\n";
cout << "\t\t\t\t<*><*><*><*><*><*><*>\n";
cout << "\t\t\t\t<*><*><*><*><*><*><*>\n";
cout << "\t\t\t\t<*><*><*><*><*><*><*>\n";
cout << "\t\t\t\t<*><*> M <*><*>\n";
cout << "\t\t\t\t<*><*> E <*><*>\n";
cout << "\t\t\t\t<*><*> R <*><*>\n";
cout << "\t\t\t\t<*><*> C <*><*>\n";
cout << "\t\t\t\t<*><*> <*><*>\n";
cout << "\t\t\t\t<*><*> C <*><*>\n";
cout << "\t\t\t\t<*><*> I <*><*>\n";
cout << "\t\t\t\t<*><*> T <*><*>\n";
cout << "\t\t\t\t<*><*> Y <*><*>\n";
cout << "\t\t\t\t<*><*><*><*><*><*><*>\n";
cout << "\t\t\t\t<*><*><*><*><*><*><*>\n";
cout << "\t\t\t\t<*><*><*><*><*><*><*>\n\n\n"; // Display the title
cout << "\t\t\t 1: Create New Character\n"; // Display the options
cin >> playerInput;
return;
}
// 2 - Game Start //////////////////////////////////////////////////////////////
void gameStartFunc ()
{
system("cls");
}
// 1 - Character Creation //////////////////////////////////////////////////////
void characterCreationFunc ()
{
system("cls");
cout << "What's your name?: ";
cin >> playerName;
system("cls");
cout << "So, " << playerName << " youve come to help us out huh?\n\n";
cout << "And what is your profession?: \n\n";
cout << "Available Classes:\n";
cout << "(F)ighter \n";
cout << "(M)age \n";
cout << "(T)hief \n";
cout << "(C)leric \n\n";
cin >> Selection;
switch (Selection)
{
case 'F':
playerClass = "Fighter";
playerCon = 16; playerStr = 18; playerDex = 14; playerIntel = 8; playerWis = 8;
break;
case 'M':
playerClass = "Mage";
playerCon = 8; playerStr = 8; playerDex = 14; playerIntel = 18; playerWis = 16;
break;
case 'T':
playerClass = "Thief";
playerCon = 8; playerStr = 14; playerDex = 18; playerIntel = 16; playerWis = 8;
break;
case 'C':
playerClass = "Cleric";
playerCon = 16; playerStr = 14; playerDex = 8; playerIntel = 8; playerWis = 18;
break;
default:
characterCreationFunc();
break;
}
system ("cls");
cout << "Okay, " << playerName << ", now as a " << playerClass;
cout << " your starting stats are:\n\n";
playerStatMenuFunc();
cout << "Are you ready to proceed?\n(Y) / (N): ";
cin >> Selection;
switch (Selection)
{
case 'Y':
gameStartFunc();
break;
default:
characterCreationFunc();
break;
}
}
int main(int argc, char *argv[])
{
titleScreenFunc();
characterCreationFunc();
gameStartFunc();
////////////////////////////////////////////////////////////////////////////////
//////Downtown//////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
//Center of Town Hampton//Main
pirithaCOTFunc();
system("PAUSE");
return EXIT_SUCCESS;
}