i have been working on this code forever now, i tried taking a break and coming back, that didn't work im getting very frusturated with it here's the codeI know posting all your code is frowned upon, but i dont know where the problem is i get crazy parse errors, and also i know the system commands are frowned upon also, but that was something my friend did when he tried to work on it, and i like the clear effect anyways anyways any help anyone can give me would be appreciated.... i know im gonna get flamed for thisCode:#include <fstream>
#include <iostream>
#include <string>
#include <stdlib.h>
using namespace std;
int Login();
int Ability();
int Magic();
int Weapons();
int SkillsMenu();
int AbilityMenu();
int Player();
int RaceMenu();
int CreateFinal();
//declare functions
string PlayerFullName, CharacterName, Class, Race, stop = "yes", Password, Skills, SpecialAbilitys, Racials, whattheytype, endloop;
int hp, xp, sp = 20, mana, SwitchRace, done, SwitchAbility, WeaponSwitch, MagicSwitch, AblilitySwitch;
//declare variables
int skillmenuchoice;
int CreateFinal()
{
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;
Playerfile.close();
cin.get();
return Login();
}
//create player text file and print stats to screen
int Login()
{
sp = 20;
cout<<"\nEnter the DM Password or you shall be smited: ";
cin>>Password;
cin.ignore();
if (Password == "god") {
stop = "";
cout<<"\n\nyou truly are an evil gm\n\n Would you like to create a Player?(yes or no): ";
cin>>stop;
cin.ignore();
if (stop == "yes")
return Player();
cout<<"WITH DARKNESS I CAUSE DEATH!!!!!!!!\n\n\n\n (this is where you die)\n";
system("exit");
}
//log in to use prog.
int Player()
{
system("cls");
cout<<"\nEnter Player Full Name: ";
cin>>PlayerFullName;
cin.ignore();
//player name
cout<<"\nEnter Character Name: ";
cin>>CharacterName;
cin.ignore();
//character name
cout<<"\nEnter Class: ";
cin>>Class;
cin.ignore();
//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();
return RaceMenu();
}
int RaceMenu()
{
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 += 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 += 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 += 2;
sp = 12;
break;
case 12:
cout<<"\n you chose Unseelie Fae +2 mana";
Race = "Unseelie Fae";
mana += 2;
sp = 12;
break;
default:
cout<<"\n that is not a Race! try again: ";
cin>>SwitchRace;
cin.ignore();
break;
}
return AbilityMenu();
}
//race selection
int AbilityMenu()
{
system("cls");
cout<<"\n You have "<<sp<<" skill points to spend on Skills, Abilitys, Mana, and hit points\n type (skills) to see a list of skills: ";
string checkifstring;
cin>>checkifstring;
if (checkifstring == "skills"){
return SkillsMenu();
}
int SkillsMenu()
{
cout<<"\n(1)Weapon skills\n(2)Magic skills\n(3)Abilitys\nType the number to access the Skills menu of your choice, you have "<<sp<<" Skill Points left: ";
cin>>skillmenuchoice;
switch ( skillmenuchoice )
{
case 1:
return Weapons();
break;
case 2:
return Magic();
break;
case 3:
return Ability();
break;
default:
cout<<"Wrong Choice, Try Again";
return SkillsMenu();
break;
}
//skill menu
int Weapons()
{
system("cls");
cout<<"\nweapon skills are\n___________________\n(1)Dagger cost = 2 sp\n(2)Short sword = 3 sp\n(3)Long Sword = 4 sp\n(4)Two Handed Sword = 5 sp\n(5)lub = 2 sp\n(6)Staff = 3 sp\n(7)Thrown = 2 sp\n(8)Shield = 2 sp\n(9)Ambidexterous = 3 sp\n(10)Strong = 5 sp\n(11)Sneak Attack = 4 sp\n(12)Sap(waylay) = 4 sp\n(13)Extra Damage = 12 sp\n(14)Archery = 3 sp\ntype the number of the skill you want: ";
cin>>WeaponSwitch;
switch ( WeaponSwitch )
{
case 1:
sp -= 2;//dagger
break;
case 2:
sp -= 3;//short sword
break;
case 3:
sp -= 4;//long sword
break;
case 4:
sp -= 5;//two handed sword
break;
case 5:
sp -= 2;//club
break;
case 6:
sp -= 3;//staff
break;
case 7:
sp -= 2;//thrown
break;
case 8:
sp -= 2;//shield
break;
case 9:
sp -= 3;//ambidexturous
break;
case 10:
sp -= 5;//strong
break;
case 11:
sp -=4;//sneak attack
break;
case 12:
sp -=4;//sap (waylay)
break;
case 13:
sp -=12;//extra dammage
break;
case 14:
sp -=2;//archery
break;
default:
cout<<"That is not a Weapon skill, type a weapon skill: ";
return Weapons();
break;
}
//weapons skills
int Magic()
{
system("cls");
}
//magic skills
int Ability()
{
system("cls");
}
//abilitys
if ( sp < 1)
{
return CreateFinal();
}
int main()
{
system("color 0a");
system("cls");
return Login();
}