i thought of that.... maybe i shouild post all of my code but forgive me i started making alterations to it when i found this problem and the code got kind of messy anyways here it is
Code:
#include <fstream>
#include <iostream>
#include <string>
using namespace std;
int main()
{
string PlayerFullName, CharacterName, Class, Race, stop = "yes", Password, Skills, SpecialAbilitys, Racials, whattheytype;
int hp, xp, sp = 12, mana, SwitchRace, done, SwitchAbility, WeaponSwitch, MagicSwitch, AblilitySwitch;
//declare variables
cout<<"enter dm password or you shall be smited!: ";
cin>>Password;
cin.ignore();
if (Password == "god")
//password protected
{
cout<<"\n\nyou truly are an evil gm\n\n Would you like to create a Player?(yes or no): ";
cin>>stop;
cin.ignore();
while (stop == "yes")
//main loop
{
cout<<"\nEnter Player Full Name: ";
getline(cin, PlayerFullName, '\n');
}
//player name
{
cout<<"\nEnter Character Name: ";
getline(cin, CharacterName, '\n');
}
//character name
{
cout<<"\nEnter Class: ";
getline(cin, Class, '\n');
}
//class name
{
cout<<"\nHow much Experience?: ";
cin>>xp;
cin.ignore();
}
//experience
{
cout<<"\nplayable races\n Good Aligned\n________\n(1)Human\n(2)Gnome\n(3)Halfling\n(4)Dwarf\n(5)Elf\n(6)Animal Folk\n(7)Seelie Fae\n\nEvil Aligned\n________\n(1)Human\n(8)Kobold\n(9)Goblin\n(10)Orc\n(11)Dark Elf\n(6)Animal Folk\n(12)Unseelie Fae \ntype the numbers that are next to the race name, to select that race.\n";
cout<<"\nEnter Race: ";
cin>>SwitchRace;
cin.ignore();
}
switch ( SwitchRace )
{
case 1:
cout<<"\n you chose Human +2 ability points";
Race = "Human";
sp = sp + 2;
break;
case 2:
cout<<"\n you chose Gnome 1/2 cost craft";
Race = "Gnome";
Racials = "1/2 cost craft";
break;
case 3:
cout<<"\n you chose Halfling 1/2 cost thrown weapons";
Race = "Halfling";
Racials = "1/2 cost thrown weapons";
break;
case 4:
cout<<"\n you chose Dwarf +2 hp";
Race = "Dwarf";
hp = hp + 2;
sp = 12;
break;
case 5:
cout<<"\n you chose Elf +2 mana";
Race = "Elf";
mana = mana + 2;
sp = 12;
break;
case 6:
cout<<"\n you chose Animal Folk";
Race = "Animal Folk";
Racials = "See Dm";
break;
case 7:
cout<<"\n you chose Seelie Fae +2 mana";
Race = "Seelie Fae";
mana = mana + 2;
sp = 12;
break;
case 8:
cout<<"\n you chose Kobold 1/2 cost trap making";
Race = "Kobold";
Racials = "1/2 cost trap making";
break;
case 9:
cout<<"\n you chose Goblin 1/2 Cost Spear";
Race = "Goblin";
Racials = "1/2 Cost Spear";
break;
case 10:
cout<<"\n you chose Orc 1/2 Cost Two-Handed";
Race = "Orc";
Racials = "1/2 Cost Two-Handed";
break;
case 11:
cout<<"\n you chose Dark Elf +2 mana";
Race = "Dark Elf";
mana = mana + 2;
sp = 12;
break;
case 12:
cout<<"\n you chose Unseelie Fae +2 mana";
Race = "Unseelie Fae";
mana = mana + 2;
sp = 12;
break;
default:
cout<<"\n that is not a Race! try again: ";
cin>>SwitchRace;
cin.ignore();
break;
}
//races
{
cout<<"\n You have "<<sp<<" skill points to spend on skills, abilitys, mana, and hit points type (skills) to see a list of skills: ";
cin>>whattheytype;
cin.ignore();
}
if (whattheytype == "skills")
{
cout<<"\n(1)Weapon skills\n(2)Magic skills\n(3)Abilitys\n";
switch ( SwitchAbility )
case 1:
{
cout<<"\nweapon skills are\n___________________\nDagger cost = 2 sp\nShort sword = 3 sp\nLong Sword = 4 sp\nTwo Handed Sword = 5 sp\nClub = 2 sp\nStaff = 3 sp\nThrown = 2 sp\nShield = 2 sp\nAmbidexterous = 3 sp\nStrong = 5 sp\nSneak Attack = 4 sp\nSap(waylay) = 4 sp\nExtra Damage = 12 sp\nArchery = 3 sp\n";
switch ( WeaponSwitch )
{
case 1:
{
sp - 2;
break;
}
case 2:
{
sp - 3;
break;
}
case 3:
{
sp - 4;
break;
}
case 4:
{
sp - 5;
break;
}
case 5:
{
sp - 2;
break;
}
case 6:
{
sp - 3;
break;
}
case 7:
{
sp - 2;
break;
}
case 8:
{
sp - 2;
break;
}
case 9:
{
sp - 3;
break;
}
case 10:
{
sp - 5;
break;
}
case 11:
{
sp - 4;
break;
}
case 12:
{
sp - 4;
break;
}
case 13:
{
sp - 12;
break;
}
case 14:
{
sp - 2;
break;
}
cout<<"\nSpend More points? you have "<<sp<<" Points left(yes or no): ";
cin>>whattheytype;
cin.ignore();
break;
}
//weapon skills
case 2:
{
cout<<"\nMagic skills are\n___________________\nMana Points = 2 sp\nRitual = 4 sp\nRead Magic = 1 sp\nMass Heal = 9 sp";
break;
}
case 3:
{
cout<<"\nAbilitys are\n___________________\nHeal = 2 sp\nRead/Write = 1 sp\nLock Pick = 3 sp\nDisable Trap = 3 sp\nArmor Craft = 3 sp\nLore = 1 sp\nThrown = 2 sp\nHit Points = 1 sp\nDodge = 5 sp\nSneak Attackv = 4 sp\nCreate Potion = 4 sp\nCraftsman = 2 sp sp\n";
break;
}
default:
{
cout<<"\nThat is not a skill try again: ";
cin>>whattheytype;
cin.ignore();
break;
}
if (whattheytype != "skills")
{
cout<<"\nYou have "<<sp<<" Skill points left to spend!";
}
// skill spending
{
cout<<"\nyour player is.... \n \n \n\n\n\n\n";
cout<<"Player Name: "<<PlayerFullName<<"\nCharacter Name: "<<CharacterName<<"\nclass: "<<Class<<"\nRace: "<<Race<<"\nRacials: "<<Racials<<"\nSkill Points: "<<sp<<"\nSkills\n _______________________________________________\n "<<Skills<<"\nSpecial ablilitys\n _______________________________________________\n"<<SpecialAbilitys<<"\nHitpoints: "<<hp<<"\nmana: "<<mana<<"\nExperience: "<<xp;
string filename = PlayerFullName + ".txt";
ofstream Playerfile ( filename.c_str() );
Playerfile<<"Player Name: "<<PlayerFullName<<"\nCharacter Name: "<<CharacterName<<"\nclass: "<<Class<<"\nRace: "<<Race<<"\nRacials: "<<Racials<<"\nSkill Points: "<<sp<<"\nSkills\n _______________________________________________\n "<<Skills<<"\nSpecial ablilitys\n _______________________________________________\n"<<SpecialAbilitys<<"\nHitpoints: "<<hp<<"\nmana: "<<mana<<"\nExperience: "<<xp;
cout << "\nCreate another Character?(yes or no): ";
cin>>stop;
cin.ignore();
}
// player file
if (Password != "god")
{
cout<<"WITH DARKNESS I CAUSE DEATH!!!!!!!!\n\n\n\n (this is where you die)";
//wrong password
}
{
cout<<"\n\n\n\n\n\n\n\nGoodBye!";
cin.get();
return 0;
}
thats it forgive me on how messy it is