forked from HugoN259/gitlabspring24
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgame.c
More file actions
2256 lines (2028 loc) · 80.4 KB
/
game.c
File metadata and controls
2256 lines (2028 loc) · 80.4 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
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
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
//contributors
//Suave714
// Subject 0023
//jingle
//Dom I.
//Andre J Leos
//Elias Dawarpana
//Patrick Polanco
//AK
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#include <time.h>
#include <stdio.h>
#include <stdbool.h>
#include <unistd.h>
#include <math.h>
void randomTreasure();
void ajlSpace();
void coinFlip();
void JanKenPon();
void drawStraws();
void numberGuess();
void blackJack();
int cardPull();
void rollTheDice_Highest();
void rollTheDice_Race();
void FinalArea(int level);
bool trap_d10();
int selectRandom(int lower, int upper, int count);
char* pullLever(int seed);
void processRoom23();
void chooseDoor();
void chooseWeapon();
void chooseKey();
void chooseCake();
void chooseEnding();
// Vars for choices
int doorChoice;
int weaponChoice;
int cakeChoice;
int finalChoice;
// Array to store choices
char choices[5][100];
// Player health
int health = 100;
void generateGold();
int main(int argc, char *argv[])
{
int choice = 0;
char name[30] = "bob";
srand(time(NULL));
printf("Please enter your name: ");
scanf("%s",name);
printf("Hello %s welcome to the RPG Game!\n",name);
while(choice != 99)
{
puts("You find yourself in a dark room and you are not sure how you got here.");
puts("As you look around you see the room has 55 doors, each labeled with a number.");
puts("The room starts filling with water and you must choose a door to open or you will likely drown. you may quit anytime by selecting option 99.");
puts("What door do you choose?");
scanf("%d",&choice);
switch(choice)
{
case 1:
{
puts("room1");
int again = 1;
char animals[3][6] = {"Dog", "Cat", "Turtle"};
puts("You open the door and enter a room with another 5 doors.");
while(again)
{
printf("Choose one of the 5 doors. ");
scanf("%d", &choice);
switch(choice)
{
case 1:
puts("You open the door and found a treasure chest!");
randomTreasure();
break;
case 2:
puts("The door is locked.");
break;
case 3:
puts("You open the door and get attacked!");
printf("You were bitten by a %s\n", animals[rand() % 3]);
break;
case 4:
puts("You open the door and find a friendly animal!");
printf("you walk up and pet the %s\n", animals[rand() % 3]);
break;
case 5:
puts("You open the door and find nothing.");
break;
default:
puts("....");
}
printf("Do you want to open another door? (1 for yes, 0 for no): ");
scanf("%d", &again);
}
break;
}
case 2:
{
puts("room2");
break;
}
case 3:
{
puts("room3");
break;
}
case 4:
{
puts("room4");
srand(time(NULL));
int choice;
int napChoice;
int goBack;
char *inventory[4];
puts("You hurry to close the door behind you, in hopes of keeping the water isolated to the previous room.");
puts("For a moment everything looks like a blur from all the commotion; finally, your eyes adjust.");
puts("You look around the room and see an old dresser, a mattress on the floor with papers scattered around it and a wooden desk.");
puts("What would you like to do:\n 1) Search the dresser for clues\n 2) Check the mattress\n 3) Go through the papers");
puts("4) Search the desk for clues\n 5) Go back through the door you came through");
puts("What do you decide?");
scanf("%d", &choice);
while (choice != 0)
if (choice == 1) {
puts("You walk across the room to the dresser and hear something scurrying underneath it.");
puts("You drop to your knees to catch a peek at whatever that was.");
puts("Staring at me with its beady eyes and little hands, was a raccoon the size of a kaola.");
puts("It lunges at you from under the dresser and hisses angrily.");
puts("You raise your arm in defense and get scratched by the raccoon's dirty paws.");
puts("You jump up and climb on to the dresser. As you sit on the dresser, you check your wound.");
puts("The raccoon got you pretty good; you're bleeding quite a lot. You begin to rummage through the drawers of the dresser.");
puts("You find the following items: a rag, a taser, a blanket and a key.");
inventory[3] = "key";
inventory[2] = "blanket";
inventory[1] = "taser";
inventory[0] = "rag";
puts("You wrap your arm with the rag that you found. The bleeding seems to have slowed. Though you're feeling a little light headed.");
inventory[0] = "empty";
puts("You check to see if the taser is functioning, and with a little bit of luck, it is!");
puts("You descend from the dresser top, carefully, so as to not trigger the raccoon's wrath.");
puts("Immediately the raccoon is upon you and you are waving your arms through to defend yourself. The taser!");
puts("Thus the fight begins between you and the raccoon!");
int health = 100;
for (int i = 0; i < 10; i++) {
int damage = selectRandom(1, 10, 10);
health -= damage;
}
inventory[1] = "empty";
printf("Your remaining health is: %d\n", health);
if (health <= 0) {
puts("You've been badly damaged by the raccoon. You slowly begin to lose consciousness.");
break;
}
puts("Congratulations! You killed the raccoon.");
puts("What would you like to do?");
scanf("%d", &choice);
} else if (choice == 2) {
puts("You walk across the room to the mattress. Do you want to take a 30 minute nap? 1) Yes \n 2) No \n");
scanf("%d", &napChoice);
if (napChoice == 1) {
puts("*You take a 30 minute nap and your health is restored to 100%*");
puts("Your health is now 100%.");
inventory[2] = "empty";
} else if (napChoice == 2) {
puts("You skip the nap.");
}
puts("You begin to look around the mattress. You observe there is a stain that looks like blood near the head of the mattress.");
puts("What would you like to do?");
scanf("%d", &choice);
} else if (choice == 3) {
puts("You walk across the room to the search the papers scattered on the bed. You noticed some of the papers have blood on them.");
puts("You begin to pick up the pieces of paper, scanning them for any information on what's going on.");
puts("You notice some wrote help me in what seems to be blood. The tips of the page are wet. Did they try to push this message to the previous room you was in?");
puts("You collect that paper and two other pieces of paper with information about a man named Del on it.");
inventory[0] = "help";
inventory[1] = "del";
inventory[2] = "info";
puts("What would you like to do?");
scanf("%d", &choice);
} else if (choice == 4) {
puts("You walk across the room to the old wooden desk. There's two drawers and a crack through the writing desk. You look into the crack and notice a piece of paper stuffed inside.");
puts("You read the note and it tells you that Del was trapped in the room with the raccoon who has rabies. The raccoon wasn't edible because of the rabies so Del slowly wasted away due to malnutrition.");
puts("The paper also tells you about the key in your inventory. It unlocks the door you came in from. Del kept the door locked because the previous room randomly fills with water.");
puts("What would you like to do?");
scanf("%d", &choice);
} else if (choice == 5) {
if (strcmp("key", inventory[3]) == 0) {
puts("You walk across the room to the door you came from. You put your ear to the door. Nothing. Odd. You need to get help for the rabies infection.");
puts("Do you want to go back? 1) Yes \n 2) No \n");
scanf("%d", &goBack);
if (goBack == 1) {
break;
} else {
puts("What would you like to do?");
scanf("%d", &choice);
}
} else {
puts("Would you like to return to the previous room? 1) Yes \n 2) No \n");
scanf("%d", &goBack);
if (goBack == 1) {
break;
} else {
puts("What would you like to do?");
scanf("%d", &choice);
}
}
}
break;
}
case 5:
{
puts("room5");
break;
}
case 6:
{
// Intro
printf("You enter through the first door you see, there's no logic behind it, just pure panic and instinct taking over.\n");
printf("You're shocked by the immediate darkness, the sudden change in lighting catching you off guard. It takes a few seconds for your eyes "
"to adjust, but as they do you notice 2 more doors in front of you. \n\n");
printf("The left one is a dark, warped metal, with large scratches gouged into it as if some large beast was trying to break its way in.\n\n");
printf("The second appears to be marble, though in its current weathered state it's hard to tell. It was likely very ornate at one point "
"though, you wonder how long it's been down here for.\n\n");
printf("Not sure where to proceed from here but with seemingly no other option, you decide to pick a door and continue forward.\n"
" Which door do you choose? (1: Left, 2: Right)\n");
// First choice
chooseDoor();
// Door text
printf("You walk through the door, afraid of what you'll find, but to your surprise it's simply an altar with 2 ancient-looking "
"weapons laying upon it.\n\n");
printf("On the left is what appears to be a battleaxe, one of great size and seemingly still very sharp despite its age. It has a very"
" intricate design, you wouldn't be surprised if it belonged to some sort of Norse royalty. \n\n");
printf("On the right is a traditional Japanese katana, which also appears to be in very good condition despite its obvious age. You bet "
"you could still cleave a person or two in half with that, better be cautious of it.\n\n");
printf("Once again stuck with a choice with no obvious path forward, you decide to grab a weapon and advance through this maze."
"\nWhich do you take? (1: Norse Axe, 2: Japanese Katana) \n");
// Second choice
chooseWeapon();
// Next room text
printf("Proceeding past the weapons you cross a threshold into a new room, this one containing a wooden chest with a padlock on it. "
"There is a simple stone door at the end, though it appears to be locked.\n\n");
printf("There are 5 keys placed on the floor around this chest, all seemingly identical. Assumedly you are supposed to guess which key"
" fits, but why place them all here if only one works? Something isn't adding up, and you begin to worry about what will happen if you get "
"it wrong...\n\n");
printf("And as fate would have it, your suspicions are proven correct. The room immediately starts to flood with a green gas, your vision already "
"starting to turn fuzzy. You likely only have enough breath saved up to try a few of the keys before you run out of time, and you don't want to"
" think about what happens when that time runs out.\n\n");
// Third choice
chooseKey();
// Cake text
printf("Leaving the room through the newly unlocked door (you don't know how it unlocked itself but you're too afraid to theorize on "
"how it happened), you enter into a seemingly endless stone hallway. \n\n");
printf("Sitting on the floor is something you never would have expected in a place like this, a piece of pink frosted birthday cake.\n\n");
printf("Obviously suspicious of something so out of place, you aren't sure how to proceed. You've been down here for who knows how long"
" and are famished, but on the other hand this could be another trap, or maybe it's poisoned. \n\n");
printf("Either way you've got a choice to make, do you eat it, or simply walk past? (1: Eat, 2: Ignore)\n");
// Fourth choice
chooseCake();
// Entering throne room text
printf("Eventually you begin to see a light in the distance. It's dim, but even that small light gives you hope that your journey might"
" soon be over\n\n");
printf("As you get closer you see it's an open door, and as you finally reach it you realize the scale of the room in front of you. \n\n");
printf("You've just entered in what appears to be a throne room, one so grand and regal it looks straight out of a castle. The roof rises"
" what must be nearly 100 feet into the air, far too large to exist in a place like this. The walls are lined with ornate tapestries and"
" suits of armor, and at the very back is a throne so massive it would be fit for a giant straight out of a fantasy novel.\n\n");
printf("You take your time taking in the sights, but eventually you move deeper into the room. As you approach the throne, an altar appears "
"out of nowhere in front of you. Engraved into the stone is a sentence in a foreign language, one you don't recognize. But somehow deep in"
" your soul you know exactly what it means.\n\n");
printf("'Place your weapon here, and receive your gift'\n\n");
printf("Your journey has been long, and far from easy, but the idea of a gift certainly raises your morale. Maybe this was all worth it"
" after all. \n\n");
// Fifth (final) choice
chooseEnding();
// Loop to print user choices
printf("Congratulations on finishing the journey! Here are all your choices:\n");
for (int i = 0; i < 5; i++)
{
printf("%s\n", choices[i]);
}
// Exit text
printf("\nSuddenly as soon as it started, your journey is over. You are back where you started, but things are different now. You await going "
"back home with baited breath, with both fear and excitement mingling together. Things will be different, only time will tell how though. \n\n");
break;
}
case 7:
{
puts("room7");
break;
}
case 8:
{
puts("room8");
break;
}
case 9:
{
puts("room9");
break;
}
case 10:
{
puts("room10");
break;
}
case 11:
{
puts("room11");
break;
}
case 12:
{
puts("room12");
break;
}
case 13:
{
puts("room13");
break;
}
case 14:
{
puts("room14");
break;
}
case 15:
{
puts("room15");
break;
}
case 16:
{
puts("room16");
break;
}
case 17:
{
puts("room17");
break;
}
case 18:
{
puts("room18");
break;
}
case 19:
{
puts("room19");
break;
}
case 20:
{
puts("room20");
break;
}
case 21:
{
puts("room21");
break;
}
case 22:
{
puts("room22");
break;
}
case 23:
{
puts("room23");
processRoom23();
break;
}
case 24:
{
puts("room24");
break;
}
case 25:
{
puts("room25");
break;
}
case 26:
{
puts("room26");
break;
}
case 27:
{
puts("room27");
break;
}
case 28:
{
puts("room28");
break;
}
case 29:
{
puts("room29");
bool survived = trap_d10();
if(!survived)
{
puts("You Died.");
return EXIT_SUCCESS;
}
else
{
puts("You escaped the trap unharmed.");
}
break;
}
case 30:
{
puts("room30");
break;
}
case 31:
{
puts("room31");
srand(time(NULL));
//INFINITE HALLWAY
puts("\nROOM 31 SELECTED\n");
//alz is user input
int alz = 0;
//alx is fatigue counter
int alx = 0;
//aly is condition of closet door
int aly = 0;
//alr is the choice for searching the room
int alr = rand() % 5 + 1;
//alc is the condition of the crowbar
int alc = 0;
//alm is the condition of the creature
int alm = 0;
//alt is whether player traversed the hallway without running into the creature
int alt = 0;
int eswc = 0;
//simple array w/ that doesn't allow dupes / Fisher-Yates shuffle
int arr[15];
int used[10] = {0};
for (int ali = 0; ali < 15; ali++) {
arr[ali] = ali + 1;
}
for (int ali = 14; ali > 0; ali--) {
int alj = rand() % (ali + 1);
int temp = arr[ali];
arr[ali] = arr[alj];
arr[alj] = temp;
}
while (alx < 100) {
puts("NOTICE: Beyond this point, please use the Enter key to continue the story.");
//This statement stops the user from being flooded with text
ajlSpace();
printf("\nYour eyes lock onto the door marked with the number 31 as water continues to flood the room around you, your hands grasp the cold and ominous knob. You turn the handle and yank the door open.\n");
ajlSpace();
printf("On the other side of the door a blinding bright flash of light hits your eyes and without thinking you brazenly step through the door realize you are in a closet.\n");
ajlSpace();
printf("You give a quick look around the room and realize the door behind you is now gone, it seems you can only go forward.\n");
ajlSpace();
printf("Your heart pulses as you realize you might be in more danger than the last room...\n");
ajlSpace();
printf("Enter a number to make a choice: \n1: Check your phone.\n2: Cry out for help.\n3: Look around.\n");
printf("\n");
scanf("%d", &alz);
while (alz < 1 || alz > 3)
{
alx += 1;
printf("You take a minute to breathe, and then you consider your options... \n");
while(getchar() != '\n');
printf("Enter a number to make a choice: \n1: Check your phone.\n2: Cry out for help.\n3: Look around.\n");
printf("\n");
scanf("%d", &alz);
}
switch(alz)
{
ajlSpace();
case 1:
printf("You check your phone and realize water got into it... it doesn't seem to work.\n");
ajlSpace();
break;
case 2:
printf("You yell for help in the closet... but nothing happens.\n");
ajlSpace();
break;
case 3:
printf("You look around in the closet, there is a bright light above you illuminating the room, there seems to be a bunch of junk around here.");
ajlSpace();
break;
default:
printf("You feel yourself lose hope...\n");
ajlSpace();
}
printf("You feel you must do something.\n");
ajlSpace();
printf("Enter a number to make a choice: \n1: Conquer your fear, kick open the door! \n2: Gently open the door and peek into the next room.\n3: Observe the closet closely.\n");
printf("\n");
scanf("%d", &alz);
while (alz < 1 || alz > 3)
{
alx += 1;
printf("You decide to stare vacantly at the door, several moments pass and you realize you only have a few options. \n");
while(getchar() != '\n');
printf("1: Conquer your fear, kick open the door! \n2: Gently open the door and peek into the next room.\n3: Observe the closet closely.\n");
printf("\n");
scanf("%d", &alz);
}
printf("\n");
while(getchar() != '\n');
//Generates result of choice
switch(alz)
{
case 1:
printf("You violently kick the door open, it breaks the latch on the door, making it now impossible to close, you walk into the hallway and have a look around.\n");
alx += 2;
aly += 1;
ajlSpace();
break;
case 2:
printf("You slowly peek through the door, and realize it's a hallway, you decide to have a look around...\n");
alx += 1;
ajlSpace();
break;
case 3:
printf("You decide to closely observe the closet and search meticulously...");
alx += 3;
if (alr == 1)
{
printf(" unfortunately you find nothing. The closet is filled with trash, you decided you had enough and kick open the door into the hallway and have a look around.\n");
aly += 1;
}
else if (alr == 2)
{
printf(" you find only a granola bar, you are hungry so you decide to eat it. After having a snack, you decided you had enough and kick open the door into the hallway and have a look around...\n");
alx -= 3;
aly += 1;
}
else if (alr == 3)
{
printf(" you find only a granola bar, you are hungry so you decide to eat it. After having a snack, you decided you had enough and slowly peek through the door, and realize it's a hallway, you decide to have a look around...\n");
alx -= 3;
}
else if (alr == 4)
{
printf(" you find a sturdy and practical looking crowbar. You decide to take it with you, after looking further through the closet, you find nothing else and decided you had enough and kick open the door into the hallway and have a look around... \n");
aly += 1;
alc += 1;
}
else if (alr == 5)
{
printf(" you find a sturdy and practical looking crowbar. You decide to take it with you, after looking further through the closet, you find nothing else and you decided you had enough and slowly peek through the door, and realize it's a hallway, you decide to have a look around... \n");
alc += 1;
}
ajlSpace();
break;
default:
printf("You manage to warp pass the door... this is impossible, but you did it!\n");
break;
}
alz = 0;
printf("You realize you are in what seems like a hospital hallway that only goes either left or right, seemingly forever. The hallway feels hot and humid, and the dim light makes you feel uncomfortably alone.\n");
ajlSpace();
if (alc == 1)
{
printf("You firmly grasp the crowbar in your hand, making you feel a little more confident about your predicament.\n");
ajlSpace();
}
printf("When looking left into the hallway, you see dirty walls, floors littered with miscellaneous medical waste, and doors down the hallway that could lead into other rooms. You almost feel like someone is staring at you at the end of it.\n");
ajlSpace();
printf("When looking right into the hallway, it seems cleaner, and the hallway isn't as dim, bullet holes and, and pools of blackish red fluid stain the floor, there also seems to be doors down this hallway that could also lead into other rooms. You feel an indescribable sadness looking in this direction.\n");
ajlSpace();
printf("You decide you have to go one way or another... enter a number to make a choice: \n1: Go left. \n2: Go right.\n");
printf("\n");
scanf("%d", &alz);
while (alz < 1 || alz > 2)
{
alx += 10;
printf("%d", alx);
printf("Your body feels like it doesn't want to move, yet several moments pass and you realize you only have a few options. \n");
while(getchar() != '\n');
printf("1: Go left. \n2: Go right.\n");
printf("\n");
scanf("%d", &alz);
}
//HALLWAY LEFT
alr = 0;
switch(alz)
case 1:
{
printf("\n");
ajlSpace();
while ((alr != 1 && alr != 10) || alt != 7)
{
alr = arr[rand() % 10] % 10 + 1;
if (used[alr - 1] == 0)
{
used[alr - 1] = 1;
if (alr == 2)
{
printf("The smell in the hallway is offensive, yet you continue to march on through.\n");
alx++;
alt++;
ajlSpace();
}
else if (alr == 3)
{
printf("You hear something from afar hit the ground, chills rush up your spine as you tread faster.\n");
alx++;
alt++;
ajlSpace();
}
else if (alr == 4)
{
printf("The nearby hum from an indistant machine hurts your head. As you walk along the hallway.\n");
alx++;
alt++;
ajlSpace();
}
else if (alr == 5)
{
printf("You kick over a box, the noise startles you, yet you continue to tread onward.\n");
alx++;
alt++;
ajlSpace();
}
else if (alr == 6)
{
printf("The dripping of liquid nearby reminds you of the drowned room you were just trapped within. Reminding you, you need to escape. \n");
alx++;
alt++;
ajlSpace();
}
else if (alr == 7)
{
printf("You notice a door, you try the handle, yet it's locked... \n");
alx++;
alt++;
if (alc == 1)
{
printf("You try the crowbar on the door, and...");
alr = rand() % 2;
if (alr == 0)
{
printf("It doesn't budge. What a bummer.\n");
}
if (alr == 1)
{
printf("The door cracks open, you look around, but there actually doesn't seem to be anything of value inside... What a bummer.\n");
}
}
ajlSpace();
}
else if (alr == 8)
{
printf("A cute drawing sits in filth on the floor, you wonder what happened here, best get a move on...\n");
alx++;
alt++;
ajlSpace();
}
else if (alr == 9)
{
printf("Something in the pipes above you rattle... Is something following you? You dare not look up.\n");
alx++;
alt++;
ajlSpace();
}
if (alr == 1 || alr == 10 || alt == 7)
{
break;
}
}
}
if (alt == 7)
{
printf("You finally make it to the end of the hallway.\n");
ajlSpace();
printf("You see a number written on the wall. Weird.\n");
ajlSpace();
break;
}
else if (alr == 1)
{
printf("Even after you knew there were eyes hunting you in that side of the hallway, yet you went that way anyways. Your body screams to run. And you can't help but oblige.\n");
if (alc == 1)
{
printf("Your hands shake in fear and you drop your crowbar at your feet.\n");
alc--;
}
ajlSpace();
printf("You turn and bolt the other way, your heart beats fast, you know you are being chased but you don't want to look back. \n");
ajlSpace();
alx += 20;
alz += 1;
alm++;
}
else if (alr == 10)
{
printf("You knew there were eyes hunting in that side of the hallway, yet you went that way anyways. Your body screams to run. But you can't oblige.\n");
if (alc == 1)
{
printf("Your hands shake in fear and you grip your crowbar ready to attack.\n");
ajlSpace();
}
printf("The creature bolts at you, your heart beats fast... \n");
ajlSpace();
printf("You decide in a split second... : \n1: Fight. \n2: Flee.\n");
scanf("%d", &alz);
while (alz < 1 || alz > 2)
{
printf("Your body doesn't react in time... \n");
while(getchar() != '\n');
alx+= 100;
printf("The creature delivers a massive blow to your body. \n");
alm++;
break;
}
alr = rand() % 10;
if (alc == 1)
{
printf("You try the crowbar on the door, and...");
alr = rand() % 2;
if (alr == 0)
{
printf("It doesn't budge. What a bummer.\n");
}
if (alr == 1)
{
printf("The door cracks open, you look around, but there actually doesn't seem to be anything of value inside... What a bummer.\n");
}
}
alx += 20;
break;
}
if(alz == 1)
{
break;
}
//HALLWAY RIGHT
case 2:
if (alm == 1)
{
printf("You run, and somehow you manage to elude the monster in the hallway, you know\n");
}
ajlSpace();
while ((alr != 1 && alr != 10) || alt != 7)
{
alr = arr[rand() % 10] % 10 + 1;
if (used[alr - 1] == 0)
{
used[alr - 1] = 1;
if (alr == 2)
{
printf("As you wander through the hallway, you wonder what lead to the events that transpired here.\n");
alx++;
alt++;
ajlSpace();
}
else if (alr == 3)
{
printf("You hear something indistance voices, is someone following you?\n");
alx++;
alt++;
ajlSpace();
}
else if (alr == 4)
{
printf("The hallway feels timeless, as if you've been there before...\n");
alx++;
alt++;
ajlSpace();
}
else if (alr == 5)
{
printf("You feel groggy, but no time to rest!\n");
alx++;
alt++;
ajlSpace();
}
else if (alr == 6)
{
printf("The air feels crusty and stale. Is there any way out? \n");
alx++;
alt++;
ajlSpace();
}
else if (alr == 7)
{
printf("You notice a door, you try the handle, yet it's locked... \n");
alx++;
alt++;
if (alc == 1)
{
printf("You try the crowbar on the door, and...");
alr = rand() % 2;
if (alr == 0)
{
printf("It doesn't budge. What a bummer.\n");
}
if (alr == 1)
{
printf("The door cracks open, you look around, but there actually doesn't seem to be anything of value inside... What a bummer.\n");
}
}
ajlSpace();
}
else if (alr == 8)
{
printf("A cute drawing is written on the wall, who could have done that...\n");
alx++;
alt++;
ajlSpace();
}
else if (alr == 9)
{
printf("Something in the pipes above you rattle... Is something following you? You dare not look up.\n");
alx++;
alt++;
ajlSpace();
}
if (alr == 1 || alr == 10 || alt <= 7)
{
break;
}
}
}
if (alt <= 7)
{
printf("You finally make it to the end of the hallway.\n");
ajlSpace();
printf("You see a door with a keypad, a white light glows on the opposite side of the door.\n");
ajlSpace();
if (alc == 1)
{
printf("Thankfully you don't need to know the passcode, your crowbar breaks the door open,\n");
ajlSpace();
eswc++;
break;
}
printf("You don't know the code... It can be pryed open with a bar or something.\n");
ajlSpace();
printf("You could try to guess it, but it seems to accept a 7 number code... You may be here all day.\n");
ajlSpace();
printf("You decide you have make a choice: \n1: Try to guess. \n2: Go back to the other side of the hallway.\n");
printf("\n");
scanf("%d", &alz);
while (alz < 1 || alz > 2)
{
alx += 10;
printf("%d", alx);
printf("You try the third option and try to bust down the door, but after tiring yourself out... You realize you can either:\n");
while(getchar() != '\n');
printf("1: Try to guess. \n2: Go back to the other side of the hallway.\n");
printf("\n");
scanf("%d", &alz);
}
switch(alz)
{
ajlSpace();
case 1:
printf("Time to guess, hopefully you can get lucky.\n");
ajlSpace();
printf("After several minutes, you give up.\n");
ajlSpace();
printf("Keep trying? \"1\" for yes, \"2\" for no.\n");
ajlSpace();
while (alz < 1 || alz > 2)
{
alx += 10;
printf("%d", alx);
printf("You try the third option and try to bust down the door, but after tiring yourself out... You realize you can either:\n");
while(getchar() != '\n');
printf("1: Try to guess. \n2: Go back to the other side of the hallway.\n");
printf("\n");
scanf("%d", &alz);
}
if (alz == 1){
printf("After several hours, you give up.\n");
alx += 100;
ajlSpace();
break;
}
if(alz == 2){
}
case 2:
printf("You head down the hallway to the other side.\n");
ajlSpace();
printf ("You find yourself getting the strangest sense of deja vu.\n");
ajlSpace();
break;
default:
printf("You feel yourself lose hope...\n");
ajlSpace();
break;
}
}
else if (alr == 1)
{
printf("Even after you knew there were eyes hunting you in that side of the hallway, yet you went that way anyways. Your body screams to run. And you can't help but oblige.\n");
if (alc == 1)
{
printf("Your hands shake in fear and you drop your crowbar at your feet.\n");
alc--;
}
ajlSpace();
printf("You turn and bolt the other way, your heart beats fast, you know you are being chased but you don't want to look back. \n");
ajlSpace();
alx += 20;
alz += 1;
alm++;
}
else if (alr == 10)
{
printf("You knew there were eyes hunting in that side of the hallway, yet you went that way anyways. Your body screams to run. But you can't oblige.\n");
if (alc == 1)
{
printf("Your hands shake in fear and you grip your crowbar ready to attack.\n");
ajlSpace();
}
printf("The creature bolts at you, your heart beats fast... \n");
ajlSpace();
printf("You decide in a split second... : \n1: Fight. \n2: Flee.\n");
scanf("%d", &alz);
while (alz < 1 || alz > 2)
{
printf("Your body doesn't react in time... \n");
while(getchar() != '\n');
alx+= 100;
printf("The creature delivers a massive blow to your body. \n");
alm++;
break;
}
alr = rand() % 10;
if (alc == 1)
{
alr += 3;
}
if (alr < 5)