-
Notifications
You must be signed in to change notification settings - Fork 46
/
Copy pathgame.c
5675 lines (4975 loc) · 209 KB
/
game.c
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
//Paul JR Ngwoke
// Dedman
// Subject 0023
//jingle
//Dom I.
//Andre J Leos
//Elias Dawarpana
//Gretel Castillo
//Jesus Ruiz
//Eddie Licea-Martinez
//Patrick Polanco
//Jose A. Ruiz
//Joshua F.
//AK
//Carlos
//AK
// dailycrocs
#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 exploreRoom(int roomNo);
void eyeGame(void);
void exploreLocation(int locationChoice);
void randomTreasure();
void playGame();
void ajlSpace();
void coinFlip();
void JanKenPon();
void drawStraws();
void numberGuess();
void blackJack();
int cardPull();
void rollTheDice_Highest();
void rollTheDice_Race();
int randomNumRoom41();
void doorChoice();
int positionGenerator();
int diceResult(int user, int cpu);
int swordAttack();
int bowAttack();
int hammerAttack();
int daggerAttack();
int axeAttack();
void game_Start(void);
int attemptPurchase();
void findFlower(void);
double areaRec(int len, int h);
double areaT(int b, int h);
int factorial(int n);
// Global variables for room 17
char inputComputerSymbol = ' ';
char inputPlayerSymbol = ' ';
void chooseRoomFor17();
void room17RoomOneLevelOne();
void room17RoomOneLevelTwo();
void room17RoomTwoLevelOne();
void room17RoomTwoLevelTwo();
void room17RoomThreeLevelOne();
void room17RoomThreeLevelTwo();
void room17RoomFourLevelOne();
void room17RoomFiveLevelOne();
void printBoard(char board[3][3]);
char getChosenSymbol(char c);
void playerTurn(char board[3][3]);
void placeMove(char board[3][3], int position, char symbol);
bool isValidMove(char board[3][3], int position);
bool isGameFinished(char board[3][3]);
bool hasContestantWon(char board[3][3], char symbol);
void FinalArea(int level);
bool trap_d10();
int selectRandom(int lower, int upper, int count);
void randomEffect(int potionIndex);
int selectRandom(int lower, int upper, int count);
char* pullLever(int seed);
char* SkelStare();
void processRoom23();
int healthBar(bool damage, int currentHealth);
void characterSelection(int num);
void chooseDoor();
void chooseWeapon();
void chooseKey();
void chooseCake();
void chooseEnding();
// Vars for choices
int doorChoice1;
int weaponChoice;
int cakeChoice;
int finalChoice;
// Array to store choices
char choices[5][100];
// Player health
int health = 100;
void generateGold();
void multiplicationGame();
void dragonbarrowChoices();
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:
{
printf("\n There are subtle hints to follow as you explore, but this is your warning that your decisions have dire consequences... \n");
printf("\n Dragonbarrow Castle \n\n");
printf(" As you face the fortress, you notice three pathways: \n 1. Left, towards the Gardens \n 2. Forward, to the Castle Gate corridor \n 3. Right, up the stairs towards the East Tower\n");
int x = 0;
printf("\n Which path will you take?: \n\n");
scanf(" %d",&x);
while(x == 1)
{
printf("\n Gardens \n\n");
printf("\n As you enter the gardens, you notice a cultist statue, and a side entrance into the West Tower.\n");
int y = 0;
printf(" Where will you go?\n");
printf(" 1. Examine the cultist statue\n");
printf(" 2. Enter the West Tower entrance\n\n");
scanf(" %d", &y);
if(y == 1)
{
printf("\n The cultist statue contained a lethal curse.\n");
printf("\n The curse sends you back... \n\n");
break;
}
else if(y == 2)
{
printf("\n West Tower \n\n");
printf(" As you open the door, a suspicious masked peddler is seen looting decayed corpses.\n");
printf(" The masked peddler notices you standing in the doorway, and throws a sac over you.\n");
printf(" You feel yourself being moved, and hear the sound of rushing water.\n");
printf(" You realize you are back in the corridor full of doors...\n\n");
break;
}
else
{
printf(" This is not an option\n ");
}
}
while(x == 2)
{
printf("\n Castle Gate corridor \n\n");
printf(" The Castle Gate corridor leads to an open courtyard of steps with two large doors to head through.\n ");
printf(" One door seems to lead to the inner chambers, the other seems to lead to a dining hall.\n");
int z = 0;
printf(" Where will you go?\n");
printf(" 1. Inner chambers\n");
printf(" 2. Dining Hall\n\n");
scanf(" %d", &z);
if(z == 1)
{
dragonbarrowChoices();
break;
}
else if(z == 2)
{
dragonbarrowChoices();
break;
}
else
{
printf(" This is not an option \n");
}
}
while(x == 3)
{
printf("\n East Tower Entrance \n\n");
printf(" The East Tower courtyard is filled with undead domestic servants covered in Rot.\n");
printf(" However, if you are able to make your way past these undead, there are two paths available for you...\n");
int eastTower = 0;
printf(" Pick your path\n");
printf(" 1. Corridor past the undead\n");
printf(" 2. Climb stairs to the Battlement\n\n");
scanf(" %d", &eastTower);
if(eastTower == 1)
{
dragonbarrowChoices();
break;
}
else if(eastTower == 2)
{
printf(" At the top of the battlement, you notice a shiny stone.\n");
printf(" As you pick up the shiny stone, a giant crow descends upon you and brings you back to the corridor of doors...\n\n");
break;
}
else
{
printf(" This is not an option \n");
}
}
break;
}
case 11:
{
puts("room11");
printf("You have entered the chest room! 5 chests are guarded by a monster.\n");
printf("Your health is at 100 HP.\n");
printf("Open each chest one by one and try to guess the one integer passcode.\n");
printf("You will have five tries to guess the passcode that is between 0 & 9.\n");
printf("Each incorrect guess is a 20 HP blow by the monster.\n");
printf("Goodluck!\n");
srand(time(NULL));
int numChests[] = {1, 2, 3, 4, 5};
int currentHealth = 100;
int choice = 0;
for(int i = 0; i < sizeof(numChests) / sizeof(numChests[0]); i++)
{
bool damage = false;
for(int j = 0; j < 5; j++)
{
int randNum = rand() % 10;
printf("\nGuess Chest %d's passcode: \n", i + 1);
scanf("%d", &choice);
while(choice != randNum)
{
damage = true;
currentHealth = healthBar(damage, currentHealth);
printf("STRUCK! You have lost 20 HP. Your current health is %d \n", currentHealth);
if(currentHealth <= 0)
{
printf("You have died. Game over.");
return EXIT_SUCCESS;
}
if(choice < randNum)
{
printf("Your guess is too low.\n");
}
else if (choice > randNum)
{
printf("Your guess is too high.\n");
}
printf("Try again: ");
scanf("%d", &choice);
}
printf("\nYou guessed the correct passcode!\nHealth restored!\n");
currentHealth = 100;
break;
}
}
printf("\n\nCongratualtions traveler! You have survived the chest room!\n");
break;
break;
}
case 12:
{
int room = 1;
int win = 0;
char password[5] = "AVOID";
char guess[6];
int pick = 0;
int maxChoices[6] = {6, 3, 5, 3, 4, 2};
puts("You open the door. A rat scurries past as the door slams shut and locks behind you. You get this sinking feeling that you want to brush up on your abstract puzzle skills. Otherwise, this was a very, very poor idea.");
while(win == 0)
{
exploreRoom(room);
scanf("%d",&pick);
while (pick < 1 || pick > maxChoices[room-1])
{
printf("NOT A VALID CHOICE. PLEASE CHOOSE AGAIN.\n");
exploreRoom(room);
scanf("%d",&pick);
}
if (room == 1)
{
if (pick == 1)
{
room = 2;
}
else if (pick == 2)
{
room = 5;
}
else if (pick == 3)
{
room = 4;
}
else if (pick == 4)
{
room = 3;
}
else if (pick == 5)
{
puts("\nUnder the cover is an even weirder painting. It appears to depict Ouroboros surrounding a minotaur in the center of the image. The painting is unfnished, but it is marked in the bottom left corner with 'M;13'. You think it's best to not touch the painting.\n");
}
else if (pick == 6)
{
puts("\nYou've paced these few rooms for a while now and cannot make heads or tails of this puzzle. You bang on the door to try and force it back open, deciding to give up on finding anything of value in this cursed place. After 74 hours and 46 minutes, a rat in a jester's cap slowly waltz past. They look up at you, shake their head, and scurry under the door. THe door re-opens. You leave more hollow than when you entered.\n");
win = 46;
break;
}
}
else if (room == 2)
{
if (pick == 1)
{
room = 1;
}
else if (pick == 2)
{
room = 3;
}
else if (pick == 3)
{
puts("\nYou look inside the pots and find something odd. The blue ones are filled with poker chips and playing cards. The white ones are filled with various sports balls. You think this might mean something, or it might not. Your inner thoughts don't seem very helpful right now.\n");
}
}
else if (room == 3)
{
if (pick == 1)
{
room = 5;
}
else if (pick == 2)
{
room = 1;
}
else if (pick == 3)
{
room = 2;
}
else if (pick == 4)
{
puts("\nIt reads as follows: 'Stellae sint dux vester'. Also from this distance you notice the statue's staff has tow snakes crossing paths on it. You feel like someone's watching you.\n");
}
else if (pick == 5)
{
puts("\nPulling the chain flips off the light, dipping the room in darkness. You notice a bunch of tiny gemstones scattered across the room start to glow. You think you can hear a faint whispering in the distance. You turn the light back on for your own saftey.\n");
}
}
else if (room == 4)
{
if (pick == 1)
{
room = 2;
}
else if (pick == 2)
{
puts("The scroll reads as follows:\n'Find the point drawn in the lines\nStuck above space, living beside the sea\nIt marks no spots unless you have two\n1105, 23, 5, 86, 22\nA single key is all you need to make it appear.'\n");
}
else if (pick == 3)
{
puts("You try to play the record player. Most of the records are covered in glue, causing them to not play. However, two records seem to work. One is a record of 'Goodnight my Beautiful' by Russ Morgan. The other is a complete record of 'Peer Gynt, Op. 23' by Edvard Grieg. You listen to both. You feel a little better.");
}
}
else if (room == 5)
{
if (pick == 1)
{
room = 4;
}
else if (pick == 2)
{
room = 1;
}
else if (pick == 3)
{
room = 6;
}
else if (pick == 4)
{
puts("ENTER THE PASSWORD:");
scanf("%s",guess);
if (guess[0] == password[0] && guess[1] == password[1] && guess[2] == password[2] && guess[3] == password[3] && guess[4] == password[4])
{
win = (rand() % 5) + 1;
puts("CORRECT!");
}
else
{
puts("WRONG WRONG WRONG WRONG WRONG WRONG! SO VERY WRONG!");
}
}
}
else if (room == 6)
{
if (pick == 1)
{
room = 5;
}
else if (pick == 2)
{
eyeGame();
}
}
}
if(win != 46 && win > 0)
{
puts("The great vault swing open wide, revealing your prize: ");
switch(win)
{
case 1:
{
puts("The Jewel of Masquerade!");
break;
}
case 2:
{
puts("The Golden Eye of Pob!");
break;
}
case 3:
{
puts("The Casque of the Zodiac!");
break;
}
case 4:
{
puts("The Last Glazed Maggufins!");
break;
}
case 5:
{
puts("A big bowl of rigatoni with parmesan cheese!");
break;
}
}
puts("You go to grab your prize, but at the last second a rat wearing a jesters cap runs out from behind you and grabs the treasure. You give chase. The pesky rodent runs all the way back to the parlor room and you follow after. It scurries under the entrance door, breaking the lock as it does so. It seems like that rat ran off into one of the other 54 rooms with your treasure. You need to pick a new door to try and find it...You Escaped?\n");
}
break;
}
case 13:
{
puts("room13");
break;
}
case 14:
{
puts("room14");
break;
}
case 15:
{
int choice = 0;
int galacticDate = rand() % 3000 + 7000;
char exploreAgain = 'y';
printf("Welcome to the Infinite Frontier! Galactic date: %d\n", galacticDate);
printf("\nIn the vast expanse of the cosmos, humanity's thirst for exploration knows no bounds. ");
printf("Our story begins aboard the ISS Explorer, a state-of-the-art spacecraft embarking ");
printf("on a daring mission to chart uncharted territories and uncover the mysteries of the universe.\n");
printf("\nAs a member of the crew, you play a crucial role in this epic journey. ");
printf("Your mission is to explore the Infinite Frontier, a region of space teeming with exotic worlds, ");
printf("cosmic anomalies, and enigmatic phenomena waiting to be discovered.\n");
printf("\nAre you ready to embark on an adventure of a lifetime? Let's begin!\n");
while (tolower(exploreAgain) != 'n')
{
puts("\nChoose a location to explore:");
puts("\t1. Unknown Planet");
puts("\t2. Stellar Anomaly");
puts("\t3. Rogue Asteroid Belt");
puts("\t4. Enigmatic Black Hole");
puts("\t5. Cosmic Mirage\n");
puts("Enter your choice: ");
scanf("%d", &choice);
exploreLocation(choice);
puts("\nDo you want to explore another location? (y/n):");
scanf(" %c", &exploreAgain);
}
printf("Thanks %s for exploring the Infinite Frontier!\n", name);
printf("\n");
break;
}
case 16:
{
puts("room16");
srand(time(NULL));
int money = (rand() % 20000);
int randNum = (rand() % 10) +1;
char entities[3][20] = {"Dire Wolfs", "Giant Venus Flytraps", "Igris the Blood Red"};
char items[4][20] = {"Health Potions","Elucidator","Shadow Spells","Dark Repulsor"};
bool flag = true;
int itemChoice;
int itemP;
int logH;
int hilsC;
int choice;
int rubyC;
int pneumaF;
printf("LINK START!!!\nWelcome to Aincrad, your adventure begins here.\n");
while (flag == true)
{
printf("\nPlease choose the floor you wish to follow:\n\n");
printf("1. The Town of Beginnings\n2. The Log House\n3. Wolf Plains\n4. Hill of Memories\n5. Ruby Palace\n6. Exit Game\n\nChoice:");
scanf("%d", &choice);
//check if choice is valid
if(choice < 1 || choice > 6)
{
printf("\nThat wasn't one of the options. Please choose a valid path\n\n");
}
//option 1
else if (choice == 1)
{
printf("\nWelcome to the Town of Beginnings. Here you can buy your items to help on your adventure and be tutored on the dangers that lay outside the town.\n");
printf("\nDo you wish to buy an item?\n1. Yes\n2. No\n\nChoice:");
scanf("%d", &itemChoice);
printf("\n");
if(itemChoice == 1)
{
for(int i = 0; i < 4; i++)
{
printf("%d. %s\n",i+1, items[i]);
}
printf("\nWhich item do you wish to purchase!\n\nChoice:");
scanf("%d", &itemP);
money = attemptPurchase(money);
printf("Let's head back for now!");
}
else
{
printf("Okay! Lets head back!");
}
printf("\n");
}
//option 2
else if(choice == 2)
{
printf("\nYou made your way to the Log House. This house is currently on sale and gives you an amazing view to the vibrant lake of this floor alongside the lovely pine forest.\n");
printf("\nIt seems that this house it actually for sale! Do you want to purchase it?\n1. yes\n2. no\n\nChoice:");
scanf("%d", &logH);
if(logH == 1)
{
money = attemptPurchase(money);
}
else
{
printf("Aw okay, maybe next time. Let's head back for now.\n\n");
}
}
//option 3
else if(choice == 3)
{
printf("\nThis is the Wolf Plains, here the terrain consists mainly of grassy hills and stone ruins. As the name suggests, this floor is filled with %s that attack players on sight.\n", entities[0]);
printf("\nDo you wish to take the risk and move forward knowing these risks?");
printf("\n1. Yes\n2. No\n\nChoice:");
scanf("%d", &hilsC);
if(hilsC == 1)
{
printf("\nYou chose to go further in. Watch out!! a whole pack of wolves are approaching you!! ");
printf("You don't have enough strength to defeat them, let's run away for the time being! You have been teleported back to the beginning..");
}
else
{
printf("\nGood Choice! You got saved from a pack of wolves that would have hunted you down!\nLet's head back for now.");
}
printf("\n");
}
//option 4
else if(choice == 4)
{
printf("\nThis is the Hills of Memories, here the terrain consists mainly for floral fields and stone paths. Tons of people come to visit this area for the beautiful view that it offers.\nHowever safe it appears, there is a hidden danger that lies deeper within this floor.\n");
printf("If you continue forward, at random intervals of distance Giant Venus Flytraps will appear.\n");
printf("\nPeople take the risk to try and find the hidden Pneuma flower, this flower is said to bloom only once per year and has the power to revive deceased pets within a certain time frame.\n");
printf("\nDo you want to make an attempt at finding the Pneuma flower?\n1. Yes\n2. No\n\nChoice:");
scanf("%d", &pneumaF);
if(pneumaF == 1)
{
findFlower();
}
else
{
printf("\nIf there's nothing you're looking for, let's head back for now.");
}
printf("\n");
}
//option 5
else if (choice == 5)
{
printf("\nThe final floor, the Ruby Palace. This is the final floor of Aincrad that allows you to become king of the land. Here lies the chance of unearthing the Ruby Weeping Blade.\n");
printf("\nLegend has it that Ruby Palace is guarded by a powerful knight of the Bloods Oath, %s\n", entities[2]);
printf("\nDo you wish to unearth the Ruby Weeping Blade?\nOnly the chosen one is granted it.\nEnter a number from 1-10 to test your luck!:\n");
scanf("%d", &rubyC);
//checking if you unearth ruby blade
if(rubyC == randNum)
{
printf("\nYou are the chosen one! You are the lost king of Aincrad. You have gained the Ruby Weeping Blade. You are now the ruler of this land!\n ");
printf("\n");
}
else
{
printf("\nHow unfortunate, but it was to be expected. No one can unearth the Ruby Weeping Blade.");
printf("\n");
}
printf("\n");
}
//end of game
else if (choice == 6)
{
printf("\nYou left with $%d remaining, pretty rich if you ask me!", money);
printf("\nThank you for playing!\n\n");
flag = false;
}
}
break;
}
case 17:
{
puts("room17");
srand(time(NULL));
// Number User Chose
int num = 0;
// Number for room chosen
int roomNum = 0;
printf("WELCOME TO SUPERNATURAL FINDINGS! A FANTASY RPG GAME WHERE YOUR TASK IS TO FIND THE GOLEM AND DEFEAT IT BY COMPLETEING CERTAIN LEVELS\n");
printf("BUT BEFORE YOU START THE GAME YOU MUST FIRST BE ASSIGNED A SUPPERNATURAL CHARACTER TO PLAY\n");
printf("IT'S A VERY SIMPLE TASK! PICK A NUMBER BETWEEN 1 - 20: \n");
scanf("%d", &num);
while (num < 1 || num > 20)
{
printf("INVALID NUMBER. PICK A NUMBER BETWEEN 1 - 20: \n");
scanf("%d", &num);