Pathfinder is a D&D-esque game, enough said. The link will take you over to the website that I use to gain most of my information on the game.
Anyway, me and a bunch of friends used to love to play the game. Them a tad more than me, but still. I love the way that everything in the game is so based around simple little numbers, and the manipulation of those numbers. I took the obvious step and nerded up the nerdy to make a character generator for it.
As you'll see, it's nothing fancy. It's just basic c++ that makes a pretty simple generator. It's not very commented, but if you want some explanation of why I did something feel free to ask.
Show/Hide
Anyway, me and a bunch of friends used to love to play the game. Them a tad more than me, but still. I love the way that everything in the game is so based around simple little numbers, and the manipulation of those numbers. I took the obvious step and nerded up the nerdy to make a character generator for it.
As you'll see, it's nothing fancy. It's just basic c++ that makes a pretty simple generator. It's not very commented, but if you want some explanation of why I did something feel free to ask.
Show/Hide
/*
Character Generator
This generator is built to be used by the
role-playing game Pathfinder.
Designed and Built by Linell Bonnette
Version 1.2 - 2/4/2011
*/
#include <cstdlib>
#include <ctime>
#include <iostream>
#include <string>
#include <fstream>
using namespace std;
// Function Prototypes
void AbilityScore();
void AddRaceStats(int);
int DieRoll(int, int);
void GetClass();
void GetRace();
void GetStats();
void PrintFile();
void PrintStats();
// Global Vars
int bab, fs, rs, will_save, size, speed, hit_points, cmb, cmd;
int fortitude, reflex, will, initiative;
int mchar_stats[] = {0,0,0,0,0,0};
int mabil_score[] = {0,0,0,0,0,0};
int size_mod;
int skills[39][3];
string spells;
string char_name;
int char_race;
int char_class;
// Main Function
int main()
{
// Initalizes skills to zero
for (int row=0; row<39; row++){
for (int col=0; col<3; col++){
skills[row][col] = 0;
}
}
srand(time(NULL)); // Seeds the time
cout << " Welcome to the Character Generator \n"; // Prints the welcome screen
cout << " by Linell Bonnette \n"; // and prompts for name.
cout << "\n\n\n";
cout << "Please enter a characters name (no spaces please): ";
cin >> char_name;
cout << "Hello " << char_name << ", we will continue with the creation process.\n"; // Welcoms character
cout << "I am currently generating your stats. Please don't move. I'm quick like a ninja.\n\n"; // and adds humor
GetStats(); // Gets and prints stats
PrintStats();
cout << "\n\nThose are your stats. Cool, right? I'm so smart.\n"; // MORE HUMOR!
cout << "Now comes the fun stuff. " << char_name << ", what race are you? (enter the number)\n\n"; // Prompts for class
GetRace(); // Prints avaliable classes
cin >> char_race; //selects race
AddRaceStats(char_race); // calls function to add race benefits
PrintStats(); // prints out
cout << endl;
AbilityScore(); // Finds
cout << "\nThis next step kicks ass. You pick your class!\n";
cout << "You know the drill. Select a number: \n\n";
GetClass(); // Gets the class
// Fortitude, reflex, and will stuff is put here
fortitude = (fs + mabil_score[2]);
reflex = (rs + mabil_score[1]);
will = (will_save + mabil_score[4]);
cmb = (bab + mabil_score[0] - size);
cmd = (bab + mabil_score[0] + mabil_score[1] - size + 10);
initiative = mabil_score[1];
cout << "\nYour information will now be sent to a file. Thank you for creating a character!";
PrintFile();
cout << "======program ends now, fucktard======";
return 0;
}
void AbilityScore() // Finds ability modifiers
{
int ability_score;
for(int i=0; i<6; i++){
ability_score = (mchar_stats[i] - 10) % 2;
mabil_score[i] = ability_score;
}
}
void AddRaceStats(int race) // Adds the race's special stats
{
int selection;
switch (race) {
case 1:
mchar_stats[2] += 2;
mchar_stats[4] += 2;
mchar_stats[5] -= 2;
size = 0;
speed = 20;
break;
case 2:
mchar_stats[1] += 2;
mchar_stats[3] += 2;
mchar_stats[2] -= 2;
size = 0;
speed = 30;
skills[26][2] += 2;
break;
case 3:
mchar_stats[2] += 2;
mchar_stats[5] += 2;
mchar_stats[0] -= 2;
size = 1;
speed = 20;
skills[35][2] += 4;
skills[26][2] += 2;
break;
case 4:
cout << "\nDue to your varied nature, you may pick which ability to augment.";
cout << "\nPlease select an ability: ";
PrintStats();
cin >> selection;
switch(selection){
case 1:
mchar_stats[0] += 2;
break;
case 2:
mchar_stats[1] += 2;
break;
case 3:
mchar_stats[2] += 2;
break;
case 4:
mchar_stats[3] += 2;
break;
case 5:
mchar_stats[4] += 2;
break;
case 6:
mchar_stats[5] +=2;
break;
}
size = 0;
speed = 30;
skills[26][2] += 2;
break;
case 5:
mchar_stats[2] += 2;
mchar_stats[5] += 2;
mchar_stats[0] -= 2;
size = 1;
speed = 20;
skills[35][2] += 4;
skills[26][2] += 2;
skills[1][2] += 2;
skills[3][2] += 2;
case 6:
cout << "\nDue to your varied nature, you may pick which ability to augment.";
cout << "\nPlease select an ability: ";
PrintStats();
cin >> selection;
switch(selection){
case 1:
mchar_stats[0] += 2;
break;
case 2:
mchar_stats[1] += 2;
break;
case 3:
mchar_stats[2] += 2;
break;
case 4:
mchar_stats[3] += 2;
break;
case 5:
mchar_stats[4] += 2;
break;
case 6:
mchar_stats[5] +=2;
break;
}
size = 0;
speed = 30;
skills[14][2] += 2;
break;
case 7:
cout << "\nDue to your varied nature, you may pick which ability to augment.";
cout << "\nPlease select an ability: ";
PrintStats();
cin >> selection;
switch(selection){
case 1:
mchar_stats[0] += 2;
break;
case 2:
mchar_stats[1] += 2;
break;
case 3:
mchar_stats[2] += 2;
break;
case 4:
mchar_stats[3] += 2;
break;
case 5:
mchar_stats[4] += 2;
break;
case 6:
mchar_stats[5] +=2;
break;
}
size = 0;
speed = 30;
break;
}
}
int DieRoll(int nLow, int nHigh) // Roles a dice dumass
{
int roll = 0;
roll = (rand() % (nHigh - nLow +1)) + nLow;
return roll;
}
void GetClass() // Prompts for and recieves a class. It also
// fixes the skills and junk
{
int selection;
cout << "\n 1 Barbarian";
cout << "\n 2 Bard";
cout << "\n 3 Cleric";
cout << "\n 4 Druid";
cout << "\n 5 Fighter";
cout << "\n 6 Monk";
cout << "\n 7 Palidan";
cout << "\n 8 Ranger";
cout << "\n 9 Rogue";
cout << "\n10 Sorcerer";
cout << "\n11 Wizard";
cout << "\n\nPlease select the class: ";
cin >> selection;
char_class = selection;
switch(selection){
case 1:
skills[0][2] = 3;
skills[3][2] = 3;
skills[4][2] = 3;
skills[12][2] = 3;
skills[14][2] = 3;
skills[21][2] = 3;
skills[26][2] = 3;
skills[31][2] = 3;
skills[36][2] = 3;
skills[37][2] = 3;
bab = 1;
fs = 2;
rs = 0;
will_save = 0;
spells = " NONE ";
hit_points = mabil_score[2] + 12;
break;
case 2:
skills[0][2] = 3;
skills[1][2] = 3;
skills[2][2] = 3;
skills[3][2] = 3;
skills[4][2] = 3;
skills[7][2] = 3;
skills[9][2] = 3;
skills[10][2] = 3;
skills[14][2] = 3;
skills[15][2] = 3;
skills[16][2] = 3;
skills[17][2] = 3;
skills[18][2] = 3;
skills[19][2] = 3;
skills[20][2] = 3;
skills[21][2] = 3;
skills[22][2] = 3;
skills[23][2] = 3;
skills[24][2] = 3;
skills[25][2] = 3;
skills[26][2] = 3;
skills[27][2] = 3;
skills[29][2] = 3;
skills[32][2] = 3;
skills[33][2] = 3;
skills[34][2] = 3;
skills[35][2] = 3;
skills[38][2] = 3;
bab = 0;
fs = 0;
rs = 2;
will_save = 2;
spells = " 1 1st level spell ";
hit_points = mabil_score[2] + 8;
break;
case 3:
skills[1][2] = 3;
skills[4][2] = 3;
skills[7][2] = 3;
skills[13][2] = 3;
skills[15][2] = 3;
skills[19][2] = 3;
skills[22][2] = 3;
skills[23][2] = 3;
skills[24][2] = 3;
skills[25][2] = 3;
skills[29][2] = 3;
skills[32][2] = 3;
skills[34][2] = 3;
bab = 0;
fs = 2;
rs = 0;
will_save = 2;
spells = " 3 oth spells, 1+1 1st level spells ";
hit_points = mabil_score[2] + 8;
break;
case 4:
skills[3][2] = 3;
skills[4][2] = 3;
skills[11][2] = 3;
skills[12][2] = 3;
skills[13][2] = 3;
skills[18][2] = 3;
skills[21][2] = 3;
skills[26][2] = 3;
skills[29][2] = 3;
skills[31][2] = 3;
skills[34][2] = 3;
skills[36][2] = 3;
skills[37][2] = 3;
bab = 0;
fs = 2;
rs = 0;
will_save = 2;
spells = " 3 oth, 1 1st level spell ";
hit_points = mabil_score[2] + 8;
break;
case 5:
skills[3][2] = 3;
skills[6][2] = 3;
skills[12][2] = 3;
skills[14][2] = 3;
skills[16][2] = 3;
skills[17][2] = 3;
skills[29][2] = 3;
skills[31][2] = 3;
skills[36][2] = 3;
skills[37][2] = 3;
bab = 1;
fs = 2;
rs = 0;
will_save = 0;
spells = " NONE ";
hit_points = mabil_score[2] + 10;
break;
case 6:
skills[0][2] = 3;
skills[3][2] = 3;
skills[4][2] = 3;
skills[10][2] = 3;
skills[14][2] = 3;
skills[19][2] = 3;
skills[24][2] = 3;
skills[26][2] = 3;
skills[27][2] = 3;
skills[29][2] = 3;
skills[31][2] = 3;
skills[32][2] = 3;
skills[35][2] = 3;
skills[37][2] = 3;
bab = 0;
fs = 2;
rs = 2;
will_save = 2;
spells = " NONE ";
hit_points = mabil_score[2] + 8;
break;
case 7:
skills[6][2] = 3;
skills[7][2] = 3;
skills[12][2] = 3;
skills[13][2] = 3;
skills[22][2] = 3;
skills[24][2] = 3;
skills[29][2] = 3;
skills[31][2] = 3;
skills[32][2] = 3;
skills[34][2] = 3;
bab = 1;
fs = 2;
rs = 0;
will_save = 2;
spells = " NONE ";
hit_points = mabil_score[2] + 10;
break;
case 8:
skills[3][2] = 3;
skills[4][2] = 3;
skills[12][2] = 3;
skills[13][2] = 3;
skills[14][2] = 3;
skills[16][2] = 3;
skills[18][2] = 3;
skills[21][2] = 3;
skills[26][2] = 3;
skills[29][2] = 3;
skills[31][2] = 3;
skills[34][2] = 3;
skills[35][2] = 3;
skills[36][2] = 3;
skills[37][2] = 3;
bab = 1;
fs = 2;
rs = 2;
will_save = 0;
spells = " NONE ";
hit_points = mabil_score[2] + 10;
break;
case 9:
skills[0][2] = 3;
skills[1][2] = 3;
skills[2][2] = 3;
skills[3][2] = 3;
skills[4][2] = 3;
skills[7][2] = 3;
skills[8][2] = 3;
skills[9][2] = 3;
skills[10][2] = 3;
skills[14][2] = 3;
skills[16][2] = 3;
skills[20][2] = 3;
skills[25][2] = 3;
skills[26][2] = 3;
skills[27][2] = 3;
skills[29][2] = 3;
skills[32][2] = 3;
skills[33][2] = 3;
skills[35][2] = 3;
skills[37][2] = 3;
skills[38][2] = 3;
bab = 0;
fs = 0;
rs = 2;
will_save = 0;
spells = " NONE ";
hit_points = mabil_score[2] + 8;
break;
case 10:
skills[1][2] = 3;
skills[2][2] = 3;
skills[4][2] = 3;
skills[11][2] = 3;
skills[14][2] = 3;
skills[15][2] = 3;
skills[29][2] = 3;
skills[34][2] = 3;
skills[38][2] = 3;
bab = 0;
fs = 0;
rs = 0;
will_save = 2;
spells = " 3 1st level spells ";
hit_points = mabil_score[2] + 6;
break;
case 11:
skills[1][2] = 3;
skills[6][2] = 3;
skills[11][2] = 3;
skills[15][2] = 3;
skills[16][2] = 3;
skills[17][2] = 3;
skills[18][2] = 3;
skills[19][2] = 3;
skills[20][2] = 3;
skills[21][2] = 3;
skills[22][2] = 3;
skills[23][2] = 3;
skills[24][2] = 3;
skills[25][2] = 3;
skills[29][2] = 3;
skills[34][2] = 3;
bab = 0;
fs = 0;
rs = 0;
will_save = 0;
spells = " 3 oth spells, 1 1st level spell ";
hit_points = mabil_score[2] + 6;
break;
}
}
void GetRace() // Selects the race
{
cout << "1 Dwarf\n";
cout << "2 Elf\n";
cout << "3 Gnome\n";
cout << "4 Half Elf\n";
cout << "5 Halfling\n";
cout << "6 Half Orc\n";
cout << "7 Human\n\n";
cout << "Enter race here: ";
}
void GetStats() // Does the rolling and gets the stats
{
for (int i=0; i<6; i++)
{
int total = 0;
int roll = 0;
for (int j=0; j<3; j++)
{
roll = DieRoll(1,6);
total += roll;
}
mchar_stats[i] = (total);
}
}
void PrintFile() // Prints everything to file
{
int counter = 0;
ofstream outfile;
outfile.open("charactersheet.txt");
outfile << " Character Sheet \n";
outfile << "\nThis sheet is to be used to fill out a Pathfinder character sheet.";
outfile << "\nInformation found within should be checked for accuracy! If you are";
outfile << "\nbeaten to death by a GM for having effed up stuff, don't blame me.";
outfile << "\nThanks for using the program!";
outfile << "\n\n Character Name: " << char_name;
outfile << "\n Race: ";
if (char_race == 1)
outfile << "Dwarf";
else if (char_race == 2)
outfile << "Elf";
else if (char_race == 3)
outfile << "Gnome";
else if (char_race == 4)
outfile << "Half Elf";
else if (char_race == 5)
outfile << "Halfling";
else if (char_race == 6)
outfile << "Half Orc";
else
outfile << "Human";
outfile << "\n Class:";
// YOU ARE NOW INSERTING A ELSE IF THING TO
// PRING OUT THE CHARACTERS CLASS.
cout << "\n 1 Barbarian";
cout << "\n 2 Bard";
cout << "\n 3 Cleric";
cout << "\n 4 Druid";
cout << "\n 5 Fighter";
cout << "\n 6 Monk";
cout << "\n 7 Palidan";
cout << "\n 8 Ranger";
cout << "\n 9 Rogue";
cout << "\n10 Sorcerer";
cout << "\n11 Wizard";
outfile << "\n Stats:";
outfile << "\n Strength: " << mchar_stats[0];
outfile << "\n Dexterity: " << mchar_stats[1];
outfile << "\nConstitution: " << mchar_stats[2];
outfile << "\nIntelligence: " << mchar_stats[3];
outfile << "\n Wisdom: " << mchar_stats[4];
outfile << "\n Charisma: " << mchar_stats[5];
outfile << "\n Hit Points: " << hit_points;
outfile << "\n Speed: " << speed;
outfile << "\n Initiative: " << initiative;
outfile << "\n Fortitude: " << fortitude;
outfile << "\n Reflex: " << reflex;
outfile << "\n Will: " << will_save;
outfile << "\nBase Attack Bonus: " << bab;
outfile << "\n CMB: " << cmb;
outfile << "\n CMD: " << cmd;
outfile << "\n Spells: ";
outfile << "\n " << spells;
outfile << "\n Skills: \n";
for (int row=0; row<39; row++){
for (int col=0; col<3; col++){
outfile << skills[row][col];
counter += 1;
if(counter % 3 == 0)
outfile << "\n";
}
}
}
void PrintStats() // Prints the current stats
{
cout << "\n1 Strength: " << mchar_stats[0];
cout << "\n2 Dexterity: " << mchar_stats[1];
cout << "\n3 Constitution: " << mchar_stats[2];
cout << "\n4 Intelligence: " << mchar_stats[3];
cout << "\n5 Wisdom: " << mchar_stats[4];
cout << "\n6 Charisma: " << mchar_stats[5];
}
Character Generator
This generator is built to be used by the
role-playing game Pathfinder.
Designed and Built by Linell Bonnette
Version 1.2 - 2/4/2011
*/
#include <cstdlib>
#include <ctime>
#include <iostream>
#include <string>
#include <fstream>
using namespace std;
// Function Prototypes
void AbilityScore();
void AddRaceStats(int);
int DieRoll(int, int);
void GetClass();
void GetRace();
void GetStats();
void PrintFile();
void PrintStats();
// Global Vars
int bab, fs, rs, will_save, size, speed, hit_points, cmb, cmd;
int fortitude, reflex, will, initiative;
int mchar_stats[] = {0,0,0,0,0,0};
int mabil_score[] = {0,0,0,0,0,0};
int size_mod;
int skills[39][3];
string spells;
string char_name;
int char_race;
int char_class;
// Main Function
int main()
{
// Initalizes skills to zero
for (int row=0; row<39; row++){
for (int col=0; col<3; col++){
skills[row][col] = 0;
}
}
srand(time(NULL)); // Seeds the time
cout << " Welcome to the Character Generator \n"; // Prints the welcome screen
cout << " by Linell Bonnette \n"; // and prompts for name.
cout << "\n\n\n";
cout << "Please enter a characters name (no spaces please): ";
cin >> char_name;
cout << "Hello " << char_name << ", we will continue with the creation process.\n"; // Welcoms character
cout << "I am currently generating your stats. Please don't move. I'm quick like a ninja.\n\n"; // and adds humor
GetStats(); // Gets and prints stats
PrintStats();
cout << "\n\nThose are your stats. Cool, right? I'm so smart.\n"; // MORE HUMOR!
cout << "Now comes the fun stuff. " << char_name << ", what race are you? (enter the number)\n\n"; // Prompts for class
GetRace(); // Prints avaliable classes
cin >> char_race; //selects race
AddRaceStats(char_race); // calls function to add race benefits
PrintStats(); // prints out
cout << endl;
AbilityScore(); // Finds
cout << "\nThis next step kicks ass. You pick your class!\n";
cout << "You know the drill. Select a number: \n\n";
GetClass(); // Gets the class
// Fortitude, reflex, and will stuff is put here
fortitude = (fs + mabil_score[2]);
reflex = (rs + mabil_score[1]);
will = (will_save + mabil_score[4]);
cmb = (bab + mabil_score[0] - size);
cmd = (bab + mabil_score[0] + mabil_score[1] - size + 10);
initiative = mabil_score[1];
cout << "\nYour information will now be sent to a file. Thank you for creating a character!";
PrintFile();
cout << "======program ends now, fucktard======";
return 0;
}
void AbilityScore() // Finds ability modifiers
{
int ability_score;
for(int i=0; i<6; i++){
ability_score = (mchar_stats[i] - 10) % 2;
mabil_score[i] = ability_score;
}
}
void AddRaceStats(int race) // Adds the race's special stats
{
int selection;
switch (race) {
case 1:
mchar_stats[2] += 2;
mchar_stats[4] += 2;
mchar_stats[5] -= 2;
size = 0;
speed = 20;
break;
case 2:
mchar_stats[1] += 2;
mchar_stats[3] += 2;
mchar_stats[2] -= 2;
size = 0;
speed = 30;
skills[26][2] += 2;
break;
case 3:
mchar_stats[2] += 2;
mchar_stats[5] += 2;
mchar_stats[0] -= 2;
size = 1;
speed = 20;
skills[35][2] += 4;
skills[26][2] += 2;
break;
case 4:
cout << "\nDue to your varied nature, you may pick which ability to augment.";
cout << "\nPlease select an ability: ";
PrintStats();
cin >> selection;
switch(selection){
case 1:
mchar_stats[0] += 2;
break;
case 2:
mchar_stats[1] += 2;
break;
case 3:
mchar_stats[2] += 2;
break;
case 4:
mchar_stats[3] += 2;
break;
case 5:
mchar_stats[4] += 2;
break;
case 6:
mchar_stats[5] +=2;
break;
}
size = 0;
speed = 30;
skills[26][2] += 2;
break;
case 5:
mchar_stats[2] += 2;
mchar_stats[5] += 2;
mchar_stats[0] -= 2;
size = 1;
speed = 20;
skills[35][2] += 4;
skills[26][2] += 2;
skills[1][2] += 2;
skills[3][2] += 2;
case 6:
cout << "\nDue to your varied nature, you may pick which ability to augment.";
cout << "\nPlease select an ability: ";
PrintStats();
cin >> selection;
switch(selection){
case 1:
mchar_stats[0] += 2;
break;
case 2:
mchar_stats[1] += 2;
break;
case 3:
mchar_stats[2] += 2;
break;
case 4:
mchar_stats[3] += 2;
break;
case 5:
mchar_stats[4] += 2;
break;
case 6:
mchar_stats[5] +=2;
break;
}
size = 0;
speed = 30;
skills[14][2] += 2;
break;
case 7:
cout << "\nDue to your varied nature, you may pick which ability to augment.";
cout << "\nPlease select an ability: ";
PrintStats();
cin >> selection;
switch(selection){
case 1:
mchar_stats[0] += 2;
break;
case 2:
mchar_stats[1] += 2;
break;
case 3:
mchar_stats[2] += 2;
break;
case 4:
mchar_stats[3] += 2;
break;
case 5:
mchar_stats[4] += 2;
break;
case 6:
mchar_stats[5] +=2;
break;
}
size = 0;
speed = 30;
break;
}
}
int DieRoll(int nLow, int nHigh) // Roles a dice dumass
{
int roll = 0;
roll = (rand() % (nHigh - nLow +1)) + nLow;
return roll;
}
void GetClass() // Prompts for and recieves a class. It also
// fixes the skills and junk
{
int selection;
cout << "\n 1 Barbarian";
cout << "\n 2 Bard";
cout << "\n 3 Cleric";
cout << "\n 4 Druid";
cout << "\n 5 Fighter";
cout << "\n 6 Monk";
cout << "\n 7 Palidan";
cout << "\n 8 Ranger";
cout << "\n 9 Rogue";
cout << "\n10 Sorcerer";
cout << "\n11 Wizard";
cout << "\n\nPlease select the class: ";
cin >> selection;
char_class = selection;
switch(selection){
case 1:
skills[0][2] = 3;
skills[3][2] = 3;
skills[4][2] = 3;
skills[12][2] = 3;
skills[14][2] = 3;
skills[21][2] = 3;
skills[26][2] = 3;
skills[31][2] = 3;
skills[36][2] = 3;
skills[37][2] = 3;
bab = 1;
fs = 2;
rs = 0;
will_save = 0;
spells = " NONE ";
hit_points = mabil_score[2] + 12;
break;
case 2:
skills[0][2] = 3;
skills[1][2] = 3;
skills[2][2] = 3;
skills[3][2] = 3;
skills[4][2] = 3;
skills[7][2] = 3;
skills[9][2] = 3;
skills[10][2] = 3;
skills[14][2] = 3;
skills[15][2] = 3;
skills[16][2] = 3;
skills[17][2] = 3;
skills[18][2] = 3;
skills[19][2] = 3;
skills[20][2] = 3;
skills[21][2] = 3;
skills[22][2] = 3;
skills[23][2] = 3;
skills[24][2] = 3;
skills[25][2] = 3;
skills[26][2] = 3;
skills[27][2] = 3;
skills[29][2] = 3;
skills[32][2] = 3;
skills[33][2] = 3;
skills[34][2] = 3;
skills[35][2] = 3;
skills[38][2] = 3;
bab = 0;
fs = 0;
rs = 2;
will_save = 2;
spells = " 1 1st level spell ";
hit_points = mabil_score[2] + 8;
break;
case 3:
skills[1][2] = 3;
skills[4][2] = 3;
skills[7][2] = 3;
skills[13][2] = 3;
skills[15][2] = 3;
skills[19][2] = 3;
skills[22][2] = 3;
skills[23][2] = 3;
skills[24][2] = 3;
skills[25][2] = 3;
skills[29][2] = 3;
skills[32][2] = 3;
skills[34][2] = 3;
bab = 0;
fs = 2;
rs = 0;
will_save = 2;
spells = " 3 oth spells, 1+1 1st level spells ";
hit_points = mabil_score[2] + 8;
break;
case 4:
skills[3][2] = 3;
skills[4][2] = 3;
skills[11][2] = 3;
skills[12][2] = 3;
skills[13][2] = 3;
skills[18][2] = 3;
skills[21][2] = 3;
skills[26][2] = 3;
skills[29][2] = 3;
skills[31][2] = 3;
skills[34][2] = 3;
skills[36][2] = 3;
skills[37][2] = 3;
bab = 0;
fs = 2;
rs = 0;
will_save = 2;
spells = " 3 oth, 1 1st level spell ";
hit_points = mabil_score[2] + 8;
break;
case 5:
skills[3][2] = 3;
skills[6][2] = 3;
skills[12][2] = 3;
skills[14][2] = 3;
skills[16][2] = 3;
skills[17][2] = 3;
skills[29][2] = 3;
skills[31][2] = 3;
skills[36][2] = 3;
skills[37][2] = 3;
bab = 1;
fs = 2;
rs = 0;
will_save = 0;
spells = " NONE ";
hit_points = mabil_score[2] + 10;
break;
case 6:
skills[0][2] = 3;
skills[3][2] = 3;
skills[4][2] = 3;
skills[10][2] = 3;
skills[14][2] = 3;
skills[19][2] = 3;
skills[24][2] = 3;
skills[26][2] = 3;
skills[27][2] = 3;
skills[29][2] = 3;
skills[31][2] = 3;
skills[32][2] = 3;
skills[35][2] = 3;
skills[37][2] = 3;
bab = 0;
fs = 2;
rs = 2;
will_save = 2;
spells = " NONE ";
hit_points = mabil_score[2] + 8;
break;
case 7:
skills[6][2] = 3;
skills[7][2] = 3;
skills[12][2] = 3;
skills[13][2] = 3;
skills[22][2] = 3;
skills[24][2] = 3;
skills[29][2] = 3;
skills[31][2] = 3;
skills[32][2] = 3;
skills[34][2] = 3;
bab = 1;
fs = 2;
rs = 0;
will_save = 2;
spells = " NONE ";
hit_points = mabil_score[2] + 10;
break;
case 8:
skills[3][2] = 3;
skills[4][2] = 3;
skills[12][2] = 3;
skills[13][2] = 3;
skills[14][2] = 3;
skills[16][2] = 3;
skills[18][2] = 3;
skills[21][2] = 3;
skills[26][2] = 3;
skills[29][2] = 3;
skills[31][2] = 3;
skills[34][2] = 3;
skills[35][2] = 3;
skills[36][2] = 3;
skills[37][2] = 3;
bab = 1;
fs = 2;
rs = 2;
will_save = 0;
spells = " NONE ";
hit_points = mabil_score[2] + 10;
break;
case 9:
skills[0][2] = 3;
skills[1][2] = 3;
skills[2][2] = 3;
skills[3][2] = 3;
skills[4][2] = 3;
skills[7][2] = 3;
skills[8][2] = 3;
skills[9][2] = 3;
skills[10][2] = 3;
skills[14][2] = 3;
skills[16][2] = 3;
skills[20][2] = 3;
skills[25][2] = 3;
skills[26][2] = 3;
skills[27][2] = 3;
skills[29][2] = 3;
skills[32][2] = 3;
skills[33][2] = 3;
skills[35][2] = 3;
skills[37][2] = 3;
skills[38][2] = 3;
bab = 0;
fs = 0;
rs = 2;
will_save = 0;
spells = " NONE ";
hit_points = mabil_score[2] + 8;
break;
case 10:
skills[1][2] = 3;
skills[2][2] = 3;
skills[4][2] = 3;
skills[11][2] = 3;
skills[14][2] = 3;
skills[15][2] = 3;
skills[29][2] = 3;
skills[34][2] = 3;
skills[38][2] = 3;
bab = 0;
fs = 0;
rs = 0;
will_save = 2;
spells = " 3 1st level spells ";
hit_points = mabil_score[2] + 6;
break;
case 11:
skills[1][2] = 3;
skills[6][2] = 3;
skills[11][2] = 3;
skills[15][2] = 3;
skills[16][2] = 3;
skills[17][2] = 3;
skills[18][2] = 3;
skills[19][2] = 3;
skills[20][2] = 3;
skills[21][2] = 3;
skills[22][2] = 3;
skills[23][2] = 3;
skills[24][2] = 3;
skills[25][2] = 3;
skills[29][2] = 3;
skills[34][2] = 3;
bab = 0;
fs = 0;
rs = 0;
will_save = 0;
spells = " 3 oth spells, 1 1st level spell ";
hit_points = mabil_score[2] + 6;
break;
}
}
void GetRace() // Selects the race
{
cout << "1 Dwarf\n";
cout << "2 Elf\n";
cout << "3 Gnome\n";
cout << "4 Half Elf\n";
cout << "5 Halfling\n";
cout << "6 Half Orc\n";
cout << "7 Human\n\n";
cout << "Enter race here: ";
}
void GetStats() // Does the rolling and gets the stats
{
for (int i=0; i<6; i++)
{
int total = 0;
int roll = 0;
for (int j=0; j<3; j++)
{
roll = DieRoll(1,6);
total += roll;
}
mchar_stats[i] = (total);
}
}
void PrintFile() // Prints everything to file
{
int counter = 0;
ofstream outfile;
outfile.open("charactersheet.txt");
outfile << " Character Sheet \n";
outfile << "\nThis sheet is to be used to fill out a Pathfinder character sheet.";
outfile << "\nInformation found within should be checked for accuracy! If you are";
outfile << "\nbeaten to death by a GM for having effed up stuff, don't blame me.";
outfile << "\nThanks for using the program!";
outfile << "\n\n Character Name: " << char_name;
outfile << "\n Race: ";
if (char_race == 1)
outfile << "Dwarf";
else if (char_race == 2)
outfile << "Elf";
else if (char_race == 3)
outfile << "Gnome";
else if (char_race == 4)
outfile << "Half Elf";
else if (char_race == 5)
outfile << "Halfling";
else if (char_race == 6)
outfile << "Half Orc";
else
outfile << "Human";
outfile << "\n Class:";
// YOU ARE NOW INSERTING A ELSE IF THING TO
// PRING OUT THE CHARACTERS CLASS.
cout << "\n 1 Barbarian";
cout << "\n 2 Bard";
cout << "\n 3 Cleric";
cout << "\n 4 Druid";
cout << "\n 5 Fighter";
cout << "\n 6 Monk";
cout << "\n 7 Palidan";
cout << "\n 8 Ranger";
cout << "\n 9 Rogue";
cout << "\n10 Sorcerer";
cout << "\n11 Wizard";
outfile << "\n Stats:";
outfile << "\n Strength: " << mchar_stats[0];
outfile << "\n Dexterity: " << mchar_stats[1];
outfile << "\nConstitution: " << mchar_stats[2];
outfile << "\nIntelligence: " << mchar_stats[3];
outfile << "\n Wisdom: " << mchar_stats[4];
outfile << "\n Charisma: " << mchar_stats[5];
outfile << "\n Hit Points: " << hit_points;
outfile << "\n Speed: " << speed;
outfile << "\n Initiative: " << initiative;
outfile << "\n Fortitude: " << fortitude;
outfile << "\n Reflex: " << reflex;
outfile << "\n Will: " << will_save;
outfile << "\nBase Attack Bonus: " << bab;
outfile << "\n CMB: " << cmb;
outfile << "\n CMD: " << cmd;
outfile << "\n Spells: ";
outfile << "\n " << spells;
outfile << "\n Skills: \n";
for (int row=0; row<39; row++){
for (int col=0; col<3; col++){
outfile << skills[row][col];
counter += 1;
if(counter % 3 == 0)
outfile << "\n";
}
}
}
void PrintStats() // Prints the current stats
{
cout << "\n1 Strength: " << mchar_stats[0];
cout << "\n2 Dexterity: " << mchar_stats[1];
cout << "\n3 Constitution: " << mchar_stats[2];
cout << "\n4 Intelligence: " << mchar_stats[3];
cout << "\n5 Wisdom: " << mchar_stats[4];
cout << "\n6 Charisma: " << mchar_stats[5];
}
No comments:
Post a Comment