1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106
|
#include<iostream>
#include<string>
#include<limits>
#include<Windows.h>
#include"Quests.h"
#include"QuestA.h"
using namespace std;
string Class[6]
{
"Warrior",
"Wizard",
"Rogue",
"Priest",
"Paladin",
"Mage"
};
bool IsClass = false;
void Quest::PlayQuest();
int main()
{
string CharacterName;
int age;
cout << "What is your name?" << endl;
getline(cin, CharacterName);
system("CLS");
cout << endl;
cout << "Greetings to you, " << CharacterName << ". And what, pray, may be your age?" << endl;
cin >> age;
system("CLS");
cout << endl;
cout << "Ahh..." << age << "... A fine age to be certain, " << CharacterName << ". And do tell, what is your class?" << endl;
cout << "You may Choose from the following by typing the number" << endl;
cout << endl;
for (int i = 0; i < (sizeof(Class) / sizeof(*Class)); i++) // Note: (sizeof(Class) / sizeof(*Class)) determines the correct size of the array (in case you want to change the array later)
{
cout << i + 1 << ") " << Class[i] << endl;
switch (i)
{
case 0:
IsWarrior = true;
break;
case 1:
IsWizard = true;
break;
case 2:
IsRogue = true;
break;
case 3:
IsPriest = true;
break;
case 4:
IsPaladin = true;
break;
case 5:
IsMage = true;
break;
default:
cout << endl;
cout << "Thatis NOT acceptable! Try again!" << endl;
break;
}
}
int i;
cin >> i;
system("CLS");
cout << endl;
cout << "All hail " << CharacterName << ", age: " << age << ", the brave and migty " << Class[i - 1] << endl; // Note: -1 due to the previous + 1
cout << endl;
bool IsClass = true;
const string Charactername = CharacterName;
Sleep(2000);
system("CLS");
cout << "Congratulations, you've Completed the Introduction" << endl;
Sleep(2000);
system("CLS");
system("pause");
}
|