I've fixed that, and taken some time to at capabilities to the program, but now there's a minor bug on when I select the Dragon option in create(), then select the Main Menu option in the same function. When I choose to exit (type e) at that point, it repeats the main menu text, and requires me to enter it again to exit. Weird. Here's my updated code:
Code:
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
void create();
int main () {
string select;
cout << "Welcome to Link's Grand Quest!\n";
cout << "Select an option:" << endl << endl;
cout << "Create Character (press c)\n";
cout << "Load Character (press l)\n";
cout << "Creator (press r)\n";
cout << "Exit (press e)\n";
cin >> select;
if (select == "c" || select == "C")
{
create();
main();
}
else if (select == "l" || select == "L")
{
cout << "I'm sorry, this feature is not available yet.\n\n";
main();
}
else if (select == "r" || select == "R")
{
cout << "Creator: linkofazeroth\n\n";
main();
}
else if (select == "e" || select == "E")
{
cout << endl;
}
else
{
while (select != "c" || select != "C" || select != "l" || select != "L" || select != "r" || select != "R" || select != "e" || select != "E")
{
cout << "I'm sorry, you did not select an option. Please select from below:\n\n";
cout << "Create Character (press c)\n";
cout << "Load Character (press l)\n";
cout << "Creator (press r)\n";
cout << "Exit (press e)\n";
cin >> select;
if (select == "c" || select == "C")
{
create();
}
else if (select == "l" || select == "L")
{
cout << "I'm sorry, this feature is not available yet.\n\n";
main();
}
else if (select == "r" || select == "R")
{
cout << "Creator: linkofazeroth\n\n";
main();
}
else if (select == "e" || select == "E")
{
}
}
}
}
void create() {
string rac;
cout << "Which race do you wish to be?\n\n";
cout << "Dragon (press d) WARNING! Level 10 must be attained to become a Dragon.\n";
cout << "Elf (press e)\n";
cout << "Human (press h)\n";
cout << "Dwarf (press w)\n";
cout << "Gnome (press g)\n";
cout << "Main Menu (press m)\n";
cin >> rac;
cout << endl;
if (rac == "d" || rac == "D")
{
cout << "Dragons are the most powerful race on Couria, and require you to be level 10" << endl << "before being useable.\n";
cout << "Dragons have the best vision, and with their specially fit DragonBows, only" << endl << "Elves come close to their mastery of archery.\n";
cout << "The claws of a dragon, when properly taken care of, are the hardest substance" << endl << "found anywhere. Only the warhammers of the dwarves are more powerful.\n";
cout << "Dragon scales are nearly as hard as dragon claws, and provide defense that is" << endl << "second-to-none.\n";
cout << "With the power of flight, Dragons are so agile that only the Gnomes, with their mechanical creations, can keep up.\n\n";
cin.get();
create();
}
else if (rac == "e" || rac == "E")
{
cout << "Elves are the smartest race on Couria, being masterful archers and mages.\n";
cout << "Elves have keen sight, better than a cat's, and thus their archery is second" << endl << "only to the Dragon's.\n";
cout << "Unfortunately, as Elves are very slim, they're lacking in brute force. The same condition makes them easy prey when off guard.\n";
cout << "The agility of the Elves are enviable by lesser races, but the Dragons, with" << endl << "their wings, and Gnomes, with their mechanical contraptions, are faster.\n\n";
cin.get();
create();
}
else if (rac == "m" || rac == "M")
{
main();
}
else
{
main();
}
}