-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
74 lines (61 loc) · 2.51 KB
/
main.cpp
File metadata and controls
74 lines (61 loc) · 2.51 KB
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
#include <iostream>
#include <string>
#include <iomanip>
#include "dungeon.h"
//Character Classes
#include "adventurer.h"
#include "assassin.h"
#include "alcoholic.h"
using namespace std;
int main() {
int choice;
Character* cPtr = nullptr;
bool valid;
cout << "Welcome to DUNGEON EXPLORER, hero!" << endl;
cout << "Your job will be to traverse through 10 dangerous floors and make it to the top of the dungeon" << endl;
cout << "But beware, the top of the dungeon is home to a very dangerous monster..." << endl;
cout << "\n\tpress any key to continue";
cin.get();
cout << "-------------------------------------------" << endl;
cout << "Your job will be to search around every floor to find the ladder to the next floor" << endl;
cout << "While searching, you may find chests containing goodies!" << endl;
cout << "You may also find monsters that aren't so happy you bumped into them" << endl;
cout << "Monsters may be difficult to take on at first, but when you beat them, they will drop gold!" << endl;
cout << "You can spend gold at Grendel's Shop, once you find it, to heal or power yourself up." << endl;
cout << "\n\tpress any key to continue";
cin.get();
cout << "-------------------------------------------" << endl;
cout << "Now I can sit here and bore you to death, or you can get started on your daring quest!" << endl;
cout << "Just make sure you are strong enough to take on the final boss.\nIt certainly would be a shame to go all that way just to die..." << endl;
cout << "\n\tpress any key to continue";
cin.get();
cout << "-------------------------------------------" << endl;
cout << "Now then! Pick your class below and let the journey begin!" << endl;
cout << "-------------------------------------------" << endl;
do {
valid = true;
cout << "1) Adventurer - basic stats, upgrade weapons more quickly" << endl;
cout << "2) Assassin - chance to deal double damage when attacking and chance to dodge attacks" << endl;
cout << "3) Alcoholic - take % reduced damage and gain a special ability" << endl;
cin >> choice;
if (choice == 1) {
cPtr = new Adventurer();
}
else if (choice == 2) {
cPtr = new Assassin();
}
else if (choice == 3) {
cPtr = new Alcoholic();
}
else {
valid = false;
cin.clear();
cin.ignore(1000, '\n');
cout << "\nI'm not sure what class that is. Try entering the number next to the class\n";
}
cout << endl;
} while (!valid);
Dungeon d(cPtr);
d.play();
delete cPtr;
}