Commit afe1d2bb authored by Kameron Kinsey's avatar Kameron Kinsey
Browse files

Initialize repository

parent 58ef1a8c
// Random Stat Generator // Random Stat Generator
#include <cstring> #include <cstring>
// #include <std.lib> #include <cstdlib>
#include <iostream> #include <iostream>
using namespace std; using namespace std;
...@@ -16,28 +16,35 @@ using namespace std; ...@@ -16,28 +16,35 @@ using namespace std;
// int setStats(Stats); // int setStats(Stats);
// }; // };
void setStats(int&, int&, int&, int&, int&, int&, int&, int&);
int main() { int main() {
int fight, int seed,
flee, fight, fightMod,
think, flee, fleeMod,
talk, think, thinkMod,
talk, talkMod,
health = 100; health = 100;
string playerName; string playerName;
cin >> seed;
srand(seed);
cout << "Enter Player Name: "; cout << "Enter Player Name: ";
cin >> playerName; cin >> playerName;
setStats(fight, flee, think, talk, fightMod, fleeMod, thinkMod, talkMod);
cout << playerName << "'s stats" << endl cout << playerName << "'s stats" << endl
<< "========================" << endl << "========================" << endl
<< "Health: " << health << endl << "Health: " << health << endl
<< "Fight: " << fight << endl << "Fight: " << fight << " " << fightMod << endl
<< "Flee: " << flee << endl << "Flee: " << flee << " " << fleeMod << endl
<< "Think: " << think << endl << "Think: " << think << " " << thinkMod << endl
<< "Talk: " << talk << endl; << "Talk: " << talk << " " << talkMod << endl;
...@@ -56,11 +63,36 @@ int main() { ...@@ -56,11 +63,36 @@ int main() {
// return // 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; 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; 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; think = rand() % 20 + 5;
// Set Talk Stat and Modifier
talk = rand() % 20 + 5; talk = rand() % 20 + 5;
} }
\ No newline at end of file
Supports Markdown
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