Commit afe1d2bb authored by Kameron Kinsey's avatar Kameron Kinsey

Initialize repository

parent 58ef1a8c
// Random Stat Generator
#include <cstring>
// #include <std.lib>
#include <cstdlib>
#include <iostream>
using namespace std;
......@@ -16,28 +16,35 @@ using namespace std;
// int setStats(Stats);
// };
void setStats(int&, int&, int&, int&, int&, int&, int&, int&);
int main() {
int fight,
flee,
think,
talk,
int seed,
fight, fightMod,
flee, fleeMod,
think, thinkMod,
talk, talkMod,
health = 100;
string playerName;
cin >> seed;
srand(seed);
cout << "Enter Player Name: ";
cin >> playerName;
setStats(fight, flee, think, talk, fightMod, fleeMod, thinkMod, talkMod);
cout << playerName << "'s stats" << endl
<< "========================" << endl
<< "Health: " << health << endl
<< "Fight: " << fight << endl
<< "Flee: " << flee << endl
<< "Think: " << think << endl
<< "Talk: " << talk << endl;
<< "Fight: " << fight << " " << fightMod << endl
<< "Flee: " << flee << " " << fleeMod << endl
<< "Think: " << think << " " << thinkMod << endl
<< "Talk: " << talk << " " << talkMod << endl;
......@@ -56,11 +63,36 @@ int main() {
// return
// }
void setStats(int &fight, int &flee, int &think, int &talk) {
void setStats(int &fight, int &flee, int &think, int &talk, int &fightMod, int &fleeMod, int &thinkMod, int &talkMod) {
// Set Fight Stat and Modifier
fight = rand() % 20 + 5;
if (fight == 5) fightMod = -3;
else if (fight == 6 || 7) fightMod = -2;
else if (fight == 8 || 9) fightMod = -1;
else if (fight == 12 || 13) fightMod = 1;
else if (fight == 14 || 15) fightMod = 2;
else if (fight == 16 || 17) fightMod = 3;
else if (fight == 18 || 19) fightMod = 4;
else if (fight < 20) fightMod = 5;
else fightMod = 0;
// Set Flee Stat and Modifier
flee = rand() % 20 + 5;
if (fight == 5) fightMod = -3;
else if (fight == 6 || 7) fightMod = -2;
else if (fight == 8 || 9) fightMod = -1;
else if (fight == 12 || 13) fightMod = 1;
else if (fight == 14 || 15) fightMod = 2;
else if (fight == 16 || 17) fightMod = 3;
else if (fight == 18 || 19) fightMod = 4;
else if (fight < 20) fightMod = 5;
else fightMod = 0;
// Set Think Stat and Modifier
think = rand() % 20 + 5;
// Set Talk Stat and Modifier
talk = rand() % 20 + 5;
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment