-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgcolon_Final_term.cpp
358 lines (183 loc) · 14.5 KB
/
gcolon_Final_term.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
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
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
//Gerardo Colon
//Final programming project
//4/28/2020
//This is a story based trial and error game. You have to pick the right options to win, if you do not pick the right options you will have to start over. Only by picking the correct options in the correct order will you be able to beat the game.
#include <iostream>
using namespace std;
int main()
{
//Story line begins here.
cout << "Hey! Hey you, you're finally awake." << endl;
//This is just to separate each dialouge box, as they tend to cluster up and look confusing.
cout << "------------------------------------------------------------------------------" << endl;
cout << "Stranger: You were trying to cross the border, walked into that imperial ambush right? It was the same with me. These Imperials have no class." << endl;
cout << "------------------------------------------------------------------------------" << endl;
cout << "Guard: Quite, prisoners!" << endl;
cout << "------------------------------------------------------------------------------" << endl;
cout << "Stranger: Say, I don't recall ever seeing you in battle. Are you new around here?" <<endl;
//This is the function that helps keep your name in check for usage in all the dialouges.
char name[50];
cout << "What is your name, stranger?" << endl;
//This is to actually get your name.
cin.getline(name, 50);
cout << "------------------------------------------------------------------------------" << endl;
cout << "Well then " << name << " how about we work together, get out of here?" << endl;
//This function is used to start separate paths to take for the story line
int choiceOne_Path;
cout << "------------------------------------------------------------------------------" << endl;
cout << "* What will you do? *" << endl;
cout << "------------------------------------------------------------------------------" << endl;
cout << "* Type in '1' to help the Stranger escape. *" << endl;
cout << "------------------------------------------------------------------------------" << endl;
cout << "* Type in '2' to do nothing. *" << endl;
cout << "------------------------------------------------------------------------------" << endl;
//If you type in the wrong answer, it will retry and ask the same question.
retry:
cout << "* Type in your choice, then press Enter to continue: *" << endl;
cout << "------------------------------------------------------------------------------" << endl;
cin >> choiceOne_Path;
//Here we have the first choice to pick for the path.
if(choiceOne_Path == 1)
{
cout << "------------------------------------------------------------------------------" << endl;
cout << "Stranger: Perfect, I knew I could count on you " << name << "! I have a plan, so get ready..." << endl;
cout << "------------------------------------------------------------------------------" << endl;
cout << "Guard: I thought I told you to shut up!" << endl;
cout << "------------------------------------------------------------------------------" << endl;
cout << "You see the guard get close to you and the Stranger. The Stranger suddenly rushes the guard and tackles him to the ground." << endl;
cout << "------------------------------------------------------------------------------" << endl;
cout << "Stanger: Now " << name << "! Get his weapon!" << endl;
}
//Make an else statement for the second path to choose.
else if(choiceOne_Path == 2)
{
cout << "------------------------------------------------------------------------------" << endl;
cout << "Stanger: What! Do you not want to get out of here! This is insane!" << endl;
cout << "------------------------------------------------------------------------------" << endl;
cout << "Guard, hey I though I told you to shut up! " << endl;
cout << "------------------------------------------------------------------------------" << endl;
cout << "You see the guard approach the Stranger. The Stranger tries to rush down the guard, but fails." << endl;
cout << "------------------------------------------------------------------------------" << endl;
cout << "Guard: You slippery little worm!" << endl;
cout << "------------------------------------------------------------------------------" << endl;
cout << "The guard knocks down the Stranger, and begins to try and contain the struggling man." << endl;
cout << "------------------------------------------------------------------------------" << endl;
cout << "After some more struggling the Stranger finally gets subdued, seemingly knocked out. The guard throws the Stranger back into the cell you are in." << endl;
cout << "------------------------------------------------------------------------------" << endl;
cout << "Guard: You two will be here for a long time..." << endl;
cout << "------------------------------------------------------------------------------" << endl;
cout << "You stay in the cell for god knows how long, until eventually, you wither away into nothingness." << endl;
cout << "------------------------------------------------------------------------------" << endl;
cout << "You have lost..." << endl;
cout << "------------------------------------------------------------------------------" << endl;\
//Game ends since you lost
return 0;
}
//This else is just in case the player types in the wrong answer. It will bring them back to the right answers.
else
{
cout << "You can't type that! Press '1' or '2', nothing else works." << endl;
goto retry;
}
//The switch here is used to go to be able to keep branching the paths from the different choices that are made.
switch(choiceOne_Path)
{
//Choices in correlation to choice 1
case 1: cout << "* What will you do? *" << endl;
int choiceOne_Path;
cout << "------------------------------------------------------------------------------" << endl;
cout << "* Type in '1' to get the weapon. *" << endl;
cout << "------------------------------------------------------------------------------" << endl;
cout << "* Type in '2' to do nothing. *" << endl;
cout << "------------------------------------------------------------------------------" << endl;
cin >> choiceOne_Path;
if(choiceOne_Path == 1)
{
cout << "------------------------------------------------------------------------------" << endl;
cout << "You pick up the weapon, a standard sword, and use the blunt end of the blade to hit the guards head and knock him out." << endl;
cout << "------------------------------------------------------------------------------" << endl;
cout << "Stranger: Phew, nice work there " << name << ", Let's see if there's an exit to this place." << endl;
cout << "------------------------------------------------------------------------------" << endl;
cout << "You look around and do not see any clear exists, just a a lot of doors. The stone walls surrounding you are old, moss growing all over them." << endl;
cout << "------------------------------------------------------------------------------" << endl;
cout << "Stranger: Oh right, where are my manners? The name's Aaron, and don't you forget it." << endl;
cout << "------------------------------------------------------------------------------" << endl;
}
else if(choiceOne_Path == 2)
{
cout << "------------------------------------------------------------------------------" << endl;
cout << "Stranger: What are you doing!" << name << ", get the weapon! Help me here!" << endl;
cout << "------------------------------------------------------------------------------" << endl;
cout << "After some more struggling the Stranger finally gets subdued, seemingly knocked out. The guard throws the Stranger back into the cell you are in." << endl;
cout << "------------------------------------------------------------------------------" << endl;
cout << "Guard: You two will be here for a long time..." << endl;
cout << "------------------------------------------------------------------------------" << endl;
cout << "You stay in the cell for god knows how long, until eventually, you wither away into nothingness." << endl;
cout << "------------------------------------------------------------------------------" << endl;
cout << "You have lost..." << endl;
cout << "------------------------------------------------------------------------------" << endl;
return 0;
}
else
{
cout << "You can't type that! Press '1' or '2', nothing else works." << endl;
goto retry;
}
//Since with picking option 2 you would've lost, then there is techniacally no branching path, so just continue.
cout << "Aaron: So, now that we have taken out the guard, we have to find a way out. Follow me, I think I remember the way." << endl;
cout << "------------------------------------------------------------------------------" << endl;
cout << "* What will you do? *" << endl;
cout << "------------------------------------------------------------------------------" << endl;
cout << "* Type '1' to follow Aaron. *" << endl;
cout << "------------------------------------------------------------------------------" << endl;
cout << "* Type '2' to go find your own way out. *" << endl;
cout << "------------------------------------------------------------------------------" << endl;
cout << "* What is your choice? *";
cin >> choiceOne_Path;
if(choiceOne_Path == 1)
{
cout << "------------------------------------------------------------------------------" << endl;
cout << "Aaron: Alright, I'm pretty the guard brought us in from the 3rd door to the right over there. Let us go." << endl;
cout << "------------------------------------------------------------------------------" << endl;
cout << "You and Aaron enter the door, to see that it leads to a long and barely lit hallway " << endl;
cout << "------------------------------------------------------------------------------" << endl;
cout << "Aaron: Ooooooohhh, Chilling! Well, let's go!" << endl;
cout << "------------------------------------------------------------------------------" << endl;
cout << "You've been walking for a while, no ending in site for the long corridor you cureently reside in. Then out of nowhere you hear a rumbling coming from behind." << endl;
cout << "------------------------------------------------------------------------------" << endl;
cout << "Aaron: Hey, that wouldn't happen to be your stomache, now wouldn't it?" << endl;
cout << "------------------------------------------------------------------------------" << endl;
cout << "The rumbling got closer, soon sounding like a large amount of footsteps." << endl;
cout << "------------------------------------------------------------------------------" << endl;
cout << "Guard: There they are! Get them!" << endl;
cout << "------------------------------------------------------------------------------" << endl;
cout << "Aaron: RUUUUUUUUUNNNNN!!!!!" << endl;
cout << "------------------------------------------------------------------------------" << endl;
cout << "You bolt forward, not wanting to get caught by the gaurds again. Soon enough you see Aaron trip besides you. He calls for help." << endl;
cout << "------------------------------------------------------------------------------" << endl;
}
else if(choiceOne_Path == 2)
{
cout << "Aaron: You sure there " << name << "? Well suit yourself, I'll be going over there if you change your mind." << endl;
cout << "------------------------------------------------------------------------------" << endl;
cout << "You see Aaron enter a seemingly random door, he looks back once more before fully exiting your sight. You look around to see if there is any easy way out. You see two immediate options." << endl;
cout << "------------------------------------------------------------------------------" << endl;
cout << "First, you see a window above you that is radiating light, probably leading outside whatever prison/dungeon you are currently in." << endl;
cout << "------------------------------------------------------------------------------" << endl;
cout << "Second, you see that there is a sizeable crack in a wall near you, it looks unstable enough for you to break it with a heavy object." << endl;
cout << "------------------------------------------------------------------------------" << endl;
cout << "But as soon as you were going think about your options, a army of guards come in and swarm you, ending your escape. They shove you back into your cell and interrogate you for Aaron's location. you sadly give in after much pain and you pass out." << endl;
cout << "------------------------------------------------------------------------------" << endl;
cout << "You stay in the cell for god knows how long, until eventually, you wither away into nothingness." << endl;
cout << "------------------------------------------------------------------------------" << endl;
cout << "You have lost..." << endl;
cout << "------------------------------------------------------------------------------" << endl;
return 0;
}
else
{
cout << "You can't type that! Press '1' or '2', nothing else works." << endl;
goto retry;
}
}
}