forked from faedy2/RPG-Project
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrpg.cpp
110 lines (69 loc) · 1.47 KB
/
rpg.cpp
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
107
108
109
110
/*
*/
#include<iostream>
#include<string>
#include<iomanip>
#include<ctime>
#include<cstdlib>
#include<fstream>
using namespace std;
//Prototypes:
void quit();
void menu();
void game();
void human(int& points);
void ogre(int& points);
void elf(int& points);
int main() {
game();
return 0;
}
void game() {
int choice = 0, points = 0;
do {
cout << setw(30) << right << "Welcome to RPG Adventures!\n" << endl;
cout << "Please Select an Option: \n" <<
"\t1. See Rules.\n" <<
"\t2. PLAY Game!\n" <<
"\t3. Quit/n" << endl;
cin >> choice;
switch (choice) {
case 1:
menu();
break;
case 2:
break;
case 3:
quit();
}
} while (choice != 3);
return;
}
void quit() {
cout << "\n\tThank you for Playing! \n";
exit(EXIT_SUCCESS);
return;
}
void menu(){
cout << "Rules: Pick your Character: \n"
<< "\tHuman\n"
<< "\t Ogre\n"
<< "\t Elf\n\n";
cout << "Next you will Pick from three Weapons: \n"
<< "\t1. Flame Thrower \n"
<< "\t2. Bow and Arrow \n"
<< "\t3. Magic Potion \n" << endl;
cout << "You will fight and gain scores based on which\n"
<< "race you picked and you will accumulate points depending"
<< " on how well you do accumulating points.\n" << endl;
return;
}
void human(int& points) {
points = 100;
}
void ogre(int& points) {
points = 200;
}
void elf(int& points) {
points = 300;
}