-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
210 lines (153 loc) · 3.77 KB
/
main.cpp
File metadata and controls
210 lines (153 loc) · 3.77 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
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
#include "global.h"
using namespace std;
string playerNames[2];
int playerProfile[12];
/*
/***DEFINING THE NAMES FOR CELLS IN PLAYER'S PROFILE TABLE****/
/*
typedef gender playerProfile[0];
typedef numberPlayerName playerProfile[1];
typedef numberPlayerAlias playerProfile[2];
typedef speciality playerProfile[3];
typedef weapon playerProfile[4];
typedef playerBasicAttack playerProfile[5];
typedef playerSpecialAttack playerProfile[6];
typedef playerHealth playerProfile[7];
typedef playerMana playerProfile[8];
typedef playerStamina playerProfile[9];
typedef playerWill playerProfile[10];
typedef playerMight playerProfile[11];
/****DEFINIG THE NAMES FOR CELLS IN PLAYER'S NAMES TABLE****/
/*
typedef playerName playerNames[0];
typedef playerAlias playerNames[1]; */
/*
struct
{
string name; //the names of the character
string alias; //the nicknames of the character
int numberName;
int numberAlias;
bool gender; //the gender of the character
int speciality; //the class of the character
int weapon; //the special skill of the character
int basicAttack; //the points of basic attack of the character
int specialAttack; //the points of special attack
int health; //health points
int mana; //mana points
int stamina; //stamina points
int will; //will pojnts
int might; //might points
} profile;
profile avatar; */
int lottery(int first, int last) //just random numbers generator
{
return rand()%(1 + last - first) + first;
}
void playerGenerator(int *t, string *p) //this is the place where the hero here is born
{
/****CHOOSING PLAYER'S GENDER****/
cout << "Are you female or male?";
cin >> t[0];
/****CHOOSING PLAYER'S CLASS****/
cout << "Who are you?";
cin >> t[3];
if (t[3] == 1){
cout << "Warrior";
t[5] = 10;
t[7] = 200;
t[8] = 0;
t[9] = 50;
t[10] = 10;
t[11] = 20;
}
else if (t[3] == 2){
cout << "Archer";
t[5] = 15;
t[7] = 150;
t[8] = 0;
t[9] = 200;
t[10] = 10;
t[11] = 10;
}
else if (t[3] == 3){
cout << "Mage";
t[5] = 20;
t[7] = 100;
t[8] = 200;
t[9] = 100;
t[10] = 20;
t[11] = 10;
}
else {
cout << "You idiot!";
}
/****CHOOSING PLAYER'S WEAPON****/
cout << "Who are you?";
cin >> t[4];
if (t[4] == 1){
cout << "SWORD";
}
else if (t[4] == 2){
cout << "MAGIC";
}
else if (t[4] == 3){
cout << "";
}
else {
cout << "You idiot!";
}
/****GENERATING PLAYER'S NAME****/
if (t[0] == 0){
cout << "Female";
p[0] = "Kotek";
p[1] = "De";
}
else if (t[0] == 1){
cout << "Male";
p[0] = "Piesek";
p[1] = "The";
}
else {
cout << "You idiot!";
}
string avatarFemaleNameCollection[99];
string avatarMaleNameCollection[99];
string avatarAliasCollection[99];
}
void menu()
{
int x;
cout << "//// MENU ////" << endl;
cout << "1. New Game\n2. About\n3. Quit" << endl << endl;
cout << "To continue, type the number... \n";
cin >> x;
switch(x)
{
case 1:
{
system("cls");
playerGenerator(playerProfile, playerNames);
break;
}
case 2:
{
system("cls");
cout << "//// ABOUT ////" << endl;
cout << "Irrgarten is a classical, text-based console game in fantasy world with RPG elements. Coded by JabWik." << endl << endl;
menu();
break;
}
case 3:
{
exit(0);
break;
}
}
}
int main()
{
srand(time(NULL));
menu();
return 0;
}