#include "stdafx.h"
#include "boxer.h"
#include <vector>
#include <string>
using namespace std;
boxer::boxer() {
vector<string> femaleNames = { "Tonya","Jane","Jessica","Amy","Susan","Tammy","Erica", "Joselyn","Veronica","Laura","Betsy" };
vector<string> maleNames = { "James","Jason","Michael","Christoper","Eric","Cameron","Ralph","Tony","John","Timothy","Craig" };
vector<string> familyNames = { "Jones","Smith","Malloy","Potter","Miller","Doe","Simmons","Johnson","Conner","Monk","Simpson","Mars" };
int gender =rand() % 2;
cout << gender ;
mHP = 100;
tournaments = 0;
offset = false;
stats = { 100,10,10,10,10,10,10 };
baseStats = stats;
if (gender) {
fName = maleNames[rand() % maleNames.size()];
}
else {
fName = femaleNames[rand() % femaleNames.size()];
}
lName = familyNames[rand() % familyNames.size()];
};
boxer::boxer(boxer father, boxer mother) {
vector<string> femaleNames = { "Tonya","Jane","Jessica","Amy","Susan","Tammy","Erica", "Joselyn","Veronica","Laura","Betsy" };
vector<string> maleNames = { "James","Jason","Michael","Christoper","Eric","Cameron","Ralph","Tony","John","Timothy","Craig" };
int gender = rand() % 2;
offset = false;
mHP = 100;
tournaments = 0;
bonus = false;
int statCap = 150;
if (gender) {
fName = maleNames[rand() % maleNames.size()];
}
else {
fName = femaleNames[rand() % femaleNames.size()];
}
lName = father.getLast(); //male parent
offset = !mother.getOffset();
stats = { 100,10,10,10,10,10,10 };
baseStats = stats;
for (int i = 1; i < stats.size() - 1; i++) {
if ((father.getStats()[i] + mother.getStats()[i]) / 2 < statCap) {
if (offset) {
stats[i] = ((father.getStats()[i] + mother.getStats()[i]) / 2)+1;
offset = !offset;
}
else{
stats[i] = (father.getStats()[i] + mother.getStats()[i]) / 2;
offset = !offset;
}
}
else {
stats[i] = statCap;
offset = !offset;
}
}
if (rand() % 5 == 3) {
int index = rand() % 6;
if (stats[index] < statCap - 1) {
stats[index] += 2;
}
//delete index;
}
};
void boxer::Rejuvenate() {
stats[0] = mHP;
};
bool boxer::getOffset() {
return offset;
};
vector<int> boxer:: getStats() {
return stats;
};
void boxer::setStats(vector<int> newStats) {
stats = newStats;
};
string boxer::getName() {
return fName + " " + lName;
};
string boxer::getLast() {
return lName;
};
int boxer::getSex() {
return gender;
};
void boxer::roundRevive() {
if (stats[0] + stats[5] / 4 <= mHP) {
stats[0] += stats[5] / 4;
}
else {
stats[0] = mHP;
}
};
boxer::~boxer()
{
};
vector<int> boxer:: baseStatsReturn() {
return baseStats;
};