///////////////////////////////////////////////////////////////
// Program: un-named-game.cpp
// Description: this program will send out a creature
// and battle your opponents creature. The code currently works
// but more is being added to it.
//
// All code is mine unless otherwise stated
///////////////////////////////////////////////////////////////
//NAMESPACE
using namespace std;
//MY VARIABLES
string PlayerAge;
string PlayerName;
string PlayerGender;
string CharacterDetails;
string OpponentCharacterDetails;
string Continue;
string PlayAgain;
long Earnings = 10;
long Money = 0;
long AmountExp = 10;
long TotalExp = 0;
long NewLevel = 0;
long LevelUp = 10;
long SkillPoints = 3;
long TotalSkillPoints = 0;
long Attack = 8;
long Defence = 1;
long Health = 40;
long Damage;
long ODamage;
long OAttack = 8;
long ODefence = 1;
long OHealth = 40;
int TypeOfCharacter;
int Armor;
//CALLS MY FUNCTIONS
void Age();//asks for the players age
void Name();//asks the players name
void Gender();//asks for the players gender
void PlayerCard();//shows the user the thier I'D card
void Program();//introduces them to the program
void CharacterDetail();//decides the character they chose
void Rules();//tells the rules
void YourMonster1();//your-fire-type
void YourMonster2();//your-water-type
void YourMonster3();//your-nature-type
void OpponentMonster1();//opponent-fire-type
void OpponentMonster2();//opponent-water-type
void OpponentMonster3();//opponent-nature-type
void OponentType();//chooses the oponents creature
void Battlephase();//begins the battlephase
void Earned();//states what you earned from combat
void Level();//if you leveled up, what level you are, and exp gained
void pause(int dur);//pauses the program for a set number of seconds
//EXECUTES THE PROGRAM
int main()
{
Name();
Age();
Gender();
PlayerCard();
replay:
Program();
CharacterDetail();
Rules();
OponentType();
Battlephase();
Earned();
Level();
cout << "Would you like to play again? y o n"<< endl;
if(PlayAgain == "y")
{
goto replay;
}
void Program()
{
cout << "Please note this program will only work if you press ENTER after each responce."<< endl;
pause (5);
system("CLS");
}
void CharacterDetail()
{
cout << "What character do you want?" << endl << endl;
cout << "There is a fire type who specializes with fire attacks. (fire)" << endl;
cout << "There is a water type who specializes with water attacks. (water)" << endl;
cout << "There is a nature type who specializes with nature attacks. (nature)" << endl << endl;
cout << "Please enter the type of the monster you would like:";
cin >> CharacterDetails;
system("CLS");
if(CharacterDetails == "fire")
{
YourMonster1();
}
else if(CharacterDetails == "water")
{
YourMonster2();
}
else{
CharacterDetails = "nature";
YourMonster3();
}
pause(10);
system("CLS");
}
void Rules()
{
cout << "Each of your characters battle." << endl;
cout << "You each alternate by taking turns. " << endl;
cout << "Since you are a beginner you will go first." << endl << endl;
pause(5);
system("CLS");
}
void OponentType()
{
/* rand example: guess the number */
#include <stdio.h>
/* initialize random seed: */
srand ( time(NULL) );