-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathifte_room_functions5.h
7349 lines (6790 loc) · 437 KB
/
ifte_room_functions5.h
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
/*
IF: The Else (ifte_room_functions5.h Header File) Interactive fiction game written in C
Copyright (C) 2024 stringzzz, Ghostwarez Co.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/*
IF: The Else (Interactive Fiction Game)
Full version (Room Functions Header)
Start date: 08-02-2024
Complete date: 08-27-2024
By stringzzz, Ghostwarez Co.
*/
#ifndef ifte_room_functions
void printInvalid() {
char invalid_messages[10][128] = {
"You cannot do that here!",
"Not happening here...",
"This is not possible here.",
"That action cannot be done here!",
"Sorry, won't work here.",
"Doesn't work, at least not here.",
"That won't work.",
"You try, but it doesn't do anything here.",
"Not possible here.",
"It might work, but not right here."
};
printf("%s\n\n", invalid_messages[rand() % 10]);
}
bool room_CELL(char name[], int *current_location, bool actions[], int *coins) {
if (!actions[INTRO]) {
printf("You wake up to find yourself in a murky cell, confused as to how you got there.\n\n");
actions[INTRO] = 1;
}
printf("You see a CHAMBER POT, and a raggedy BLANKET, NORTH is the cell DOOR.\n\n");
char chosen_action[64];
int check = getChoiceAndSave(chosen_action, name, *current_location, actions, *coins);
if (check == -1) {
return 0;
} else if (check == 0) {
return 1;
}
if (strcmp(chosen_action, "check blanket") == 0 || strcmp(chosen_action, "examine blanket") == 0 || strcmp(chosen_action, "look at blanket") == 0 || strcmp(chosen_action, "investigate blanket") == 0 || strcmp(chosen_action, "view blanket") == 0) {
if (!actions[GET_KEY]) {
printf("You lift the blanket to find a key, which you grab!\n\n");
actions[GET_KEY] = 1;
} else {
printf("There is nothing under the blanket now that you have the key.\n\n");
}
} else if (strcmp(chosen_action, "use chamber pot") == 0 || strcmp(chosen_action, "utilize chamber pot") == 0 || strcmp(chosen_action, "employ chamber pot") == 0 || strcmp(chosen_action, "wield chamber pot") == 0 || strcmp(chosen_action, "try chamber pot") == 0 || strcmp(chosen_action, "attempt chamber pot") == 0) {
printf("You relieve yourself in the chamber pot, much better!\n\n");
} else if (strcmp(chosen_action, "get chamber pot") == 0 || strcmp(chosen_action, "pick up chamber pot") == 0 || strcmp(chosen_action, "grab chamber pot") == 0 || strcmp(chosen_action, "take chamber pot") == 0 || strcmp(chosen_action, "acquire chamber pot") == 0 || strcmp(chosen_action, "obtain chamber pot") == 0) {
printf("You think about getting the chamber pot, until you are hit with a terribly foul smell.\n\n");
} else if (strcmp(chosen_action, "get blanket") == 0 || strcmp(chosen_action, "pick up blanket") == 0 || strcmp(chosen_action, "grab blanket") == 0 || strcmp(chosen_action, "take blanket") == 0 || strcmp(chosen_action, "acquire blanket") == 0 || strcmp(chosen_action, "obtain blanket") == 0) {
printf("You don't need the blanket, the cell isn't cold.\n\n");
}else if (strcmp(chosen_action, "unlock door") == 0) {
if (actions[GET_KEY]) {
printf("You used the key to unlock the door, and it worked!\n\n");
actions[UNLOCK_CELL] = 1;
} else {
printf("You have no key...\n\n");
}
} else if (strcmp(chosen_action, "go north") == 0 || strcmp(chosen_action, "head north") == 0 || strcmp(chosen_action, "walk north") == 0 || strcmp(chosen_action, "travel north") == 0 || strcmp(chosen_action, "move north") == 0 || strcmp(chosen_action, "proceed north") == 0 || strcmp(chosen_action, "advance north") == 0 || strcmp(chosen_action, "leave north") == 0) {
if (actions[UNLOCK_CELL]) {
printf("You exit the cell.\n\n");
*current_location = OUTSIDE_CELL;
} else {
printf("You shake the cell door, but it is locked tight!\n\n");
}
} else {
printInvalid();
}
return 1;
}
bool room_OUTSIDE_CELL(char name[], int *current_location, bool actions[], int *coins) {
printf("Outside of the cell you see a CABINET, there is a lit CANDLE attached to the wall bathing the room in a dim light, SOUTH is the cell, EAST is a corridor.\n\n");
char chosen_action[64];
int check = getChoiceAndSave(chosen_action, name, *current_location, actions, *coins);
if (check == -1) {
return 0;
} else if (check == 0) {
return 1;
}
if (strcmp(chosen_action, "open cabinet") == 0) {
if (!actions[BATS_OUT]) {
printf("You open the cabinet and a bunch of bats fly out! You quickly close it.\n\n");
actions[BATS_OUT] = 1;
} else {
if (!actions[MICE_OUT]) {
printf("You open the cabinet and a swarm of mice come pouring out! You quickly close it.\n\n");
actions[MICE_OUT] = 1;
} else {
if (!actions[GET_TORCH]) {
printf("You open the cabinet and find a torch, which you grab, then close the cabinet.\n\n");
actions[GET_TORCH] = 1;
} else {
printf("You open the cabinet and find nothing, so you close it.\n\n");
}
}
}
} else if (strcmp(chosen_action, "use candle") == 0 || strcmp(chosen_action, "utilize candle") == 0 || strcmp(chosen_action, "employ candle") == 0 || strcmp(chosen_action, "wield candle") == 0 || strcmp(chosen_action, "try candle") == 0 || strcmp(chosen_action, "attempt candle") == 0) {
if (actions[GET_TORCH] && !actions[LIT_TORCH]) {
printf("You light the torch with the candle.\n\n");
actions[LIT_TORCH] = 1;
} else {
if (!actions[LIT_TORCH]) {
printf("You have nothing to use the candle with.\n\n");
} else {
printf("The torch is already lit.\n\n");
}
}
} else if (strcmp(chosen_action, "get candle") == 0 || strcmp(chosen_action, "pick up candle") == 0 || strcmp(chosen_action, "grab candle") == 0 || strcmp(chosen_action, "take candle") == 0 || strcmp(chosen_action, "acquire candle") == 0 || strcmp(chosen_action, "obtain candle") == 0) {
printf("The candle is firmly attached to the wall.\n\n");
} else if (strcmp(chosen_action, "go south") == 0 || strcmp(chosen_action, "head south") == 0 || strcmp(chosen_action, "walk south") == 0 || strcmp(chosen_action, "travel south") == 0 || strcmp(chosen_action, "move south") == 0 || strcmp(chosen_action, "proceed south") == 0 || strcmp(chosen_action, "advance south") == 0 || strcmp(chosen_action, "leave south") == 0) {
printf("You go back into the cell.\n\n");
*current_location = CELL;
} else if (strcmp(chosen_action, "go east") == 0 || strcmp(chosen_action, "head east") == 0 || strcmp(chosen_action, "walk east") == 0 || strcmp(chosen_action, "travel east") == 0 || strcmp(chosen_action, "move east") == 0 || strcmp(chosen_action, "proceed east") == 0 || strcmp(chosen_action, "advance east") == 0 || strcmp(chosen_action, "leave east") == 0) {
if (actions[LIT_TORCH]) {
printf("Your torch now lights the way through the corridor, so you walk through it.\n\n");
*current_location = TREASURE_ROOM;
} else {
printf("The corridor is too dark to see anything, you dare not enter it.\n\n");
}
} else {
printInvalid();
}
return 1;
}
bool room_TREASURE_ROOM(char name[], int *current_location, bool actions[], int *coins) {
printf("You make it through the corridor, and come across a pile of treasure with a large CHEST sitting on top! WEST is back to the room outside the cell.\n\n");
char chosen_action[64];
int check = getChoiceAndSave(chosen_action, name, *current_location, actions, *coins);
if (check == -1) {
return 0;
} else if (check == 0) {
return 1;
}
if (strcmp(chosen_action, "open chest") == 0) {
printf("The rusty hinges of the chest creak as you slowly open it. You peer inside to find... a dark void?\nYou are consumed by the darkness as it pulls you in, transporting you elsewhere...\n\n");
*current_location = FOREST1;
} else if (strcmp(chosen_action, "go west") == 0 || strcmp(chosen_action, "head west") == 0 || strcmp(chosen_action, "walk west") == 0 || strcmp(chosen_action, "travel west") == 0 || strcmp(chosen_action, "move west") == 0 || strcmp(chosen_action, "proceed west") == 0 || strcmp(chosen_action, "advance west") == 0 || strcmp(chosen_action, "leave west") == 0) {
printf("You go back to outside the cell.\n\n");
*current_location = OUTSIDE_CELL;
} else {
printInvalid();
}
return 1;
}
bool room_FOREST1(char name[], int *current_location, bool actions[], int *coins) {
if (!actions[FOREST_INTRO]) {
printf("You fall into the darkness, falling...\nYou land with surprising gentleness, and the darkness mysteriously drifts away, leaving you in a forest.\n\n");
actions[FOREST_INTRO] = 1;
}
printf("You see a BUSH, and some VINES hanging off of a tree. NORTH, EAST, and SOUTH have clearings between the dense trees.\n\n");
char chosen_action[64];
int check = getChoiceAndSave(chosen_action, name, *current_location, actions, *coins);
if (check == -1) {
return 0;
} else if (check == 0) {
return 1;
}
if (strcmp(chosen_action, "check bush") == 0 || strcmp(chosen_action, "examine bush") == 0 || strcmp(chosen_action, "look at bush") == 0 || strcmp(chosen_action, "investigate bush") == 0 || strcmp(chosen_action, "view bush") == 0) {
if (!actions[BUSH1]) {
printf("You check the bush and some birds fly out of it.\n\n");
actions[BUSH1] = 1;
} else {
printf("There's nothing in the bush.\n\n");
}
} else if (strcmp(chosen_action, "pull vines") == 0 || strcmp(chosen_action, "tug vines") == 0 || strcmp(chosen_action, "yank vines") == 0) {
printf("You pull on the longest vine, only to find out it's a snake!\nAfter biting you, you drift off into unconsciousness as the snake devours you.\nGAME OVER\n\n");
return 0;
} else if (strcmp(chosen_action, "go north") == 0 || strcmp(chosen_action, "head north") == 0 || strcmp(chosen_action, "walk north") == 0 || strcmp(chosen_action, "travel north") == 0 || strcmp(chosen_action, "move north") == 0 || strcmp(chosen_action, "proceed north") == 0 || strcmp(chosen_action, "advance north") == 0 || strcmp(chosen_action, "leave north") == 0) {
printf("You go north through the clearing.\n\n");
*current_location = FOREST2;
} else if (strcmp(chosen_action, "go south") == 0 || strcmp(chosen_action, "head south") == 0 || strcmp(chosen_action, "walk south") == 0 || strcmp(chosen_action, "travel south") == 0 || strcmp(chosen_action, "move south") == 0 || strcmp(chosen_action, "proceed south") == 0 || strcmp(chosen_action, "advance south") == 0 || strcmp(chosen_action, "leave south") == 0) {
printf("You head south through the openings of the trees.\n\n");
*current_location = FOREST3;
} else if (strcmp(chosen_action, "go east") == 0 || strcmp(chosen_action, "head east") == 0 || strcmp(chosen_action, "walk east") == 0 || strcmp(chosen_action, "travel east") == 0 || strcmp(chosen_action, "move east") == 0 || strcmp(chosen_action, "proceed east") == 0 || strcmp(chosen_action, "advance east") == 0 || strcmp(chosen_action, "leave east") == 0) {
printf("You travel east into another open area.\n\n");
*current_location = FOREST5;
} else {
printInvalid();
}
return 1;
}
bool room_FOREST2(char name[], int *current_location, bool actions[], int *coins) {
printf("You enter the clearing in the north.\n");
if (!actions[GET_LONG_STICK]) {
printf("You see a LONG STICK on the ground.\n");
}
if (!actions[GET_PURPLE_MUSHROOM]) {
printf("There is a deeply PURPLE MUSHROOM that stands out.\n");
}
printf("The only exit is SOUTH.\n\n");
char chosen_action[64];
int check = getChoiceAndSave(chosen_action, name, *current_location, actions, *coins);
if (check == -1) {
return 0;
} else if (check == 0) {
return 1;
}
if (strcmp(chosen_action, "get long stick") == 0 || strcmp(chosen_action, "pick up long stick") == 0 || strcmp(chosen_action, "grab long stick") == 0 || strcmp(chosen_action, "take long stick") == 0 || strcmp(chosen_action, "acquire long stick") == 0 || strcmp(chosen_action, "obtain long stick") == 0) {
if (!actions[GET_LONG_STICK]) {
printf("You pick up the long stick.\n\n");
actions[GET_LONG_STICK] = 1;
} else {
printf("You already have the long stick!\n\n");
}
} else if (strcmp(chosen_action, "get purple mushroom") == 0 || strcmp(chosen_action, "pick up purple mushroom") == 0 || strcmp(chosen_action, "grab purple mushroom") == 0 || strcmp(chosen_action, "take purple mushroom") == 0 || strcmp(chosen_action, "acquire purple mushroom") == 0 || strcmp(chosen_action, "obtain purple mushroom") == 0) {
if (!actions[GET_PURPLE_MUSHROOM]) {
printf("You pick up the purple mushroom, it has a distinctly toxic odor.\n\n");
actions[GET_PURPLE_MUSHROOM] = 1;
} else {
printf("You've already obtained the purple mushroom!\n\n");
}
} else if (strcmp(chosen_action, "go south") == 0 || strcmp(chosen_action, "head south") == 0 || strcmp(chosen_action, "walk south") == 0 || strcmp(chosen_action, "travel south") == 0 || strcmp(chosen_action, "move south") == 0 || strcmp(chosen_action, "proceed south") == 0 || strcmp(chosen_action, "advance south") == 0 || strcmp(chosen_action, "leave south") == 0) {
printf("You head south back to the first clearing.\n\n");
*current_location = FOREST1;
} else {
printInvalid();
}
return 1;
}
bool room_FOREST3(char name[], int *current_location, bool actions[], int *coins) {
printf("You enter the clearing south of your origin.\n");
if (!actions[GET_STICK]) {
printf("You see a STICK among the grass.\n");
}
if (!actions[GET_RED_MUSHROOM]) {
printf("There is a crimson RED MUSHROOM growing from the ground.\n");
}
printf("The only exits are NORTH and EAST.\n\n");
char chosen_action[64];
int check = getChoiceAndSave(chosen_action, name, *current_location, actions, *coins);
if (check == -1) {
return 0;
} else if (check == 0) {
return 1;
}
if (strcmp(chosen_action, "get stick") == 0 || strcmp(chosen_action, "pick up stick") == 0 || strcmp(chosen_action, "grab stick") == 0 || strcmp(chosen_action, "take stick") == 0 || strcmp(chosen_action, "acquire stick") == 0 || strcmp(chosen_action, "obtain stick") == 0) {
if (!actions[GET_STICK]) {
printf("You pick up the stick from the grass.\n\n");
actions[GET_STICK] = 1;
} else {
printf("You already got the stick!\n\n");
}
} else if (strcmp(chosen_action, "get red mushroom") == 0 || strcmp(chosen_action, "pick up red mushroom") == 0 || strcmp(chosen_action, "grab red mushroom") == 0 || strcmp(chosen_action, "take red mushroom") == 0 || strcmp(chosen_action, "acquire red mushroom") == 0 || strcmp(chosen_action, "obtain red mushroom") == 0) {
if (!actions[GET_RED_MUSHROOM]) {
printf("You pocket the red mushroom, it has quite the savory scent to it.\n\n");
actions[GET_RED_MUSHROOM] = 1;
} else {
printf("You have the red mushroom already!\n\n");
}
} else if (strcmp(chosen_action, "go north") == 0 || strcmp(chosen_action, "head north") == 0 || strcmp(chosen_action, "walk north") == 0 || strcmp(chosen_action, "travel north") == 0 || strcmp(chosen_action, "move north") == 0 || strcmp(chosen_action, "proceed north") == 0 || strcmp(chosen_action, "advance north") == 0 || strcmp(chosen_action, "leave north") == 0) {
printf("You head north back to the first clearing.\n\n");
*current_location = FOREST1;
} else if (strcmp(chosen_action, "go east") == 0 || strcmp(chosen_action, "head east") == 0 || strcmp(chosen_action, "walk east") == 0 || strcmp(chosen_action, "travel east") == 0 || strcmp(chosen_action, "move east") == 0 || strcmp(chosen_action, "proceed east") == 0 || strcmp(chosen_action, "advance east") == 0 || strcmp(chosen_action, "leave east") == 0) {
printf("You step through the trees to the east.\n\n");
*current_location = FOREST4;
} else {
printInvalid();
}
return 1;
}
bool room_FOREST4(char name[], int *current_location, bool actions[], int *coins) {
printf("You enter the clearing diagonal to your origin.\nThe only exits are NORTH and WEST.\nIn the center is a pit of quicksand!\n\n");
if (!actions[GET_AMULET]) {
printf("You see an emerald AMULET floating on the quicksand.\n\n");
}
char chosen_action[64];
int check = getChoiceAndSave(chosen_action, name, *current_location, actions, *coins);
if (check == -1) {
return 0;
} else if (check == 0) {
return 1;
}
if (strcmp(chosen_action, "get amulet") == 0 || strcmp(chosen_action, "pick up amulet") == 0 || strcmp(chosen_action, "grab amulet") == 0 || strcmp(chosen_action, "take amulet") == 0 || strcmp(chosen_action, "acquire amulet") == 0 || strcmp(chosen_action, "obtain amulet") == 0) {
if (!actions[GET_AMULET]) {
printf("You want to get the amulet, but you can't reach.\n\n");
} else {
printf("You have the amulet already!\n\n");
}
} else if (strcmp(chosen_action, "use stick") == 0 || strcmp(chosen_action, "utilize stick") == 0 || strcmp(chosen_action, "employ stick") == 0 || strcmp(chosen_action, "wield stick") == 0 || strcmp(chosen_action, "try stick") == 0 || strcmp(chosen_action, "attempt stick") == 0) {
if (actions[GET_STICK]) {
printf("You reach out with the stick, it's a stretch.\nYou accidentally stumble forward while leaning and fall into the quicksand.\nYou hear laughter as you sink into the quicksand...\nGAME OVER\n\n");
return 0;
} else {
printf("You don't have a stick!\n\n");
}
} else if (strcmp(chosen_action, "use long stick") == 0 || strcmp(chosen_action, "utilize long stick") == 0 || strcmp(chosen_action, "employ long stick") == 0 || strcmp(chosen_action, "wield long stick") == 0 || strcmp(chosen_action, "try long stick") == 0 || strcmp(chosen_action, "attempt long stick") == 0) {
if (actions[GET_LONG_STICK] && !actions[GET_AMULET]) {
printf("You try to get the amulet with the long stick, it looks like you can reach.\nYou got the amulet!\nThe long stick fell into the quicksand.\n\n");
actions[GET_AMULET] = 1;
} else if (actions[GET_LONG_STICK] && actions[GET_AMULET]) {
printf("You already lost the long stick!\n\n");
} else {
printf("You don't have a long stick! (Laughter is heard amongst the trees)\n\n");
}
} else if (strcmp(chosen_action, "go north") == 0 || strcmp(chosen_action, "head north") == 0 || strcmp(chosen_action, "walk north") == 0 || strcmp(chosen_action, "travel north") == 0 || strcmp(chosen_action, "move north") == 0 || strcmp(chosen_action, "proceed north") == 0 || strcmp(chosen_action, "advance north") == 0 || strcmp(chosen_action, "leave north") == 0) {
printf("You head north.\n\n");
*current_location = FOREST5;
} else if (strcmp(chosen_action, "go west") == 0 || strcmp(chosen_action, "head west") == 0 || strcmp(chosen_action, "walk west") == 0 || strcmp(chosen_action, "travel west") == 0 || strcmp(chosen_action, "move west") == 0 || strcmp(chosen_action, "proceed west") == 0 || strcmp(chosen_action, "advance west") == 0 || strcmp(chosen_action, "leave west") == 0) {
printf("You climb around the trees headed west.\n\n");
*current_location = FOREST3;
} else {
printInvalid();
}
return 1;
}
bool room_FOREST5(char name[], int *current_location, bool actions[], int *coins) {
printf("You enter the clearing east of your origin.\nYou see a statue with emerald eyes wearing a ridiculous smile.\nThere is a BUSH in the corner.\nThe paths out are WEST, SOUTH.\n\n");
if (actions[USE_AMULET]) {
printf("The eyes of the statue glow green, with an opening through the trees now in the EAST.\n\n");
}
char chosen_action[64];
int check = getChoiceAndSave(chosen_action, name, *current_location, actions, *coins);
if (check == -1) {
return 0;
} else if (check == 0) {
return 1;
}
if (strcmp(chosen_action, "use amulet") == 0 || strcmp(chosen_action, "utilize amulet") == 0 || strcmp(chosen_action, "employ amulet") == 0 || strcmp(chosen_action, "wield amulet") == 0 || strcmp(chosen_action, "try amulet") == 0 || strcmp(chosen_action, "attempt amulet") == 0) {
if (actions[GET_AMULET] && !actions[USE_AMULET]) {
printf("You place the amulet around the neck of the statue.\nIt's eyes begin glowing green, and suddenly the trees to the EAST move apart, creating an opening!\n\n");
actions[USE_AMULET] = 1;
} else if (actions[GET_AMULET] && actions[USE_AMULET]) {
printf("The amulet is already on the statue!\n\n");
} else {
printf("You don't have anything like that!\n\n");
}
} else if (strcmp(chosen_action, "go west") == 0 || strcmp(chosen_action, "head west") == 0 || strcmp(chosen_action, "walk west") == 0 || strcmp(chosen_action, "travel west") == 0 || strcmp(chosen_action, "move west") == 0 || strcmp(chosen_action, "proceed west") == 0 || strcmp(chosen_action, "advance west") == 0 || strcmp(chosen_action, "leave west") == 0) {
printf("You head west back to the first clearing.\n\n");
*current_location = FOREST1;
} else if (strcmp(chosen_action, "go south") == 0 || strcmp(chosen_action, "head south") == 0 || strcmp(chosen_action, "walk south") == 0 || strcmp(chosen_action, "travel south") == 0 || strcmp(chosen_action, "move south") == 0 || strcmp(chosen_action, "proceed south") == 0 || strcmp(chosen_action, "advance south") == 0 || strcmp(chosen_action, "leave south") == 0) {
printf("You head southward.\n\n");
*current_location = FOREST4;
} else if (strcmp(chosen_action, "go east") == 0 || strcmp(chosen_action, "head east") == 0 || strcmp(chosen_action, "walk east") == 0 || strcmp(chosen_action, "travel east") == 0 || strcmp(chosen_action, "move east") == 0 || strcmp(chosen_action, "proceed east") == 0 || strcmp(chosen_action, "advance east") == 0 || strcmp(chosen_action, "leave east") == 0) {
if (actions[USE_AMULET]) {
printf("You step through the trees to the east.\n\n");
*current_location = FOREST6;
} else {
printf("Trees are blocking your path to the east...\n\n");
}
} else if (strcmp(chosen_action, "check bush") == 0 || strcmp(chosen_action, "examine bush") == 0 || strcmp(chosen_action, "look at bush") == 0 || strcmp(chosen_action, "investigate bush") == 0 || strcmp(chosen_action, "view bush") == 0) {
if (!actions[BUSH2]) {
printf("You check the bush and a giant beetle crawls out from it, going up a tree.\n\n");
actions[BUSH2] = 1;
} else {
printf("There's nothing in this bush.\n\n");
}
} else {
printInvalid();
}
return 1;
}
bool room_FOREST6(char name[], int *current_location, bool actions[], int *coins) {
printf("You enter another clearing.\nThe paths out are WEST and EAST.\n\n");
if (!actions[FED_CREATURE]) {
printf("A strange creature resembling a giant squirrel is staring at you.\n\n");
}
char chosen_action[64];
int check = getChoiceAndSave(chosen_action, name, *current_location, actions, *coins);
if (check == -1) {
return 0;
} else if (check == 0) {
return 1;
}
if (strcmp(chosen_action, "give red mushroom") == 0 || strcmp(chosen_action, "present red mushroom") == 0 || strcmp(chosen_action, "provide red mushroom") == 0) {
if (actions[GET_RED_MUSHROOM] && !actions[FED_CREATURE]) {
printf("You hand the red mushroom to the creature.\nIt happily eats it, then scurries away.\n\n");
actions[FED_CREATURE] = 1;
} else if (actions[GET_RED_MUSHROOM] && actions[FED_CREATURE]) {
printf("The creature already ate the mushroom and left.\n\n");
} else {
printf("You don't have that!\n\n");
}
} else if (strcmp(chosen_action, "give purple mushroom") == 0 || strcmp(chosen_action, "present purple mushroom") == 0 || strcmp(chosen_action, "provide purple mushroom") == 0) {
if (actions[GET_PURPLE_MUSHROOM] && !actions[FED_CREATURE]) {
printf("You hand the purple mushroom to the creature.\nIt happily eats it, then starts shaking.\nIt turns into a massive behemoth of a creature, charging at you!\nIt tears you to shreds as if you were paper!\nGAME OVER\n\n");
return 0;
} else if (actions[GET_PURPLE_MUSHROOM] && actions[FED_CREATURE]) {
printf("The creature is already gone...\n\n");
} else {
printf("You don't have that!\n\n");
}
} else if (strcmp(chosen_action, "go west") == 0 || strcmp(chosen_action, "head west") == 0 || strcmp(chosen_action, "walk west") == 0 || strcmp(chosen_action, "travel west") == 0 || strcmp(chosen_action, "move west") == 0 || strcmp(chosen_action, "proceed west") == 0 || strcmp(chosen_action, "advance west") == 0 || strcmp(chosen_action, "leave west") == 0) {
printf("You go west closer to your origin.\n\n");
*current_location = FOREST5;
} else if (strcmp(chosen_action, "go east") == 0 || strcmp(chosen_action, "head east") == 0 || strcmp(chosen_action, "walk east") == 0 || strcmp(chosen_action, "travel east") == 0 || strcmp(chosen_action, "move east") == 0 || strcmp(chosen_action, "proceed east") == 0 || strcmp(chosen_action, "advance east") == 0 || strcmp(chosen_action, "leave east") == 0) {
if (actions[FED_CREATURE]) {
printf("You step through the trees to the east, leaving the forest.\n\n");
*current_location = OUTSIDE_HUT;
} else {
printf("The creature blocks your path, and points at its mouth.\nIts eyes look desperate, and you notice how skinny it appears.\n\n");
}
} else {
printInvalid();
}
return 1;
}
bool room_OUTSIDE_HUT(char name[], int *current_location, bool actions[], int *coins) {
printf("Outside the forest to the WEST,\nyou see a small hut to the EAST with smoke billowing out from the chimney,\nsurrounded on all sides by a steep cliff.\n\n");
char chosen_action[64];
int check = getChoiceAndSave(chosen_action, name, *current_location, actions, *coins);
if (check == -1) {
return 0;
} else if (check == 0) {
return 1;
}
if (strcmp(chosen_action, "go west") == 0 || strcmp(chosen_action, "head west") == 0 || strcmp(chosen_action, "walk west") == 0 || strcmp(chosen_action, "travel west") == 0 || strcmp(chosen_action, "move west") == 0 || strcmp(chosen_action, "proceed west") == 0 || strcmp(chosen_action, "advance west") == 0 || strcmp(chosen_action, "leave west") == 0) {
printf("You go west back into the forest.\n\n");
*current_location = FOREST6;
} else if (strcmp(chosen_action, "go east") == 0 || strcmp(chosen_action, "head east") == 0 || strcmp(chosen_action, "walk east") == 0 || strcmp(chosen_action, "travel east") == 0 || strcmp(chosen_action, "move east") == 0 || strcmp(chosen_action, "proceed east") == 0 || strcmp(chosen_action, "advance east") == 0 || strcmp(chosen_action, "leave east") == 0) {
printf("You go east into the hut.\n\n");
*current_location = WITCH_HUT;
} else {
printInvalid();
}
return 1;
}
bool room_WITCH_HUT(char name[], int *current_location, bool actions[], int *coins) {
printf("In the hut you see a WITCH stirring a bubbling cauldron, next to a black CAT. The exit from the hut is WEST.\n\n");
char chosen_action[64];
int check = getChoiceAndSave(chosen_action, name, *current_location, actions, *coins);
if (check == -1) {
return 0;
} else if (check == 0) {
return 1;
}
if (strcmp(chosen_action, "talk to witch") == 0 || strcmp(chosen_action, "speak to witch") == 0 || strcmp(chosen_action, "chat with witch") == 0 || strcmp(chosen_action, "talk with witch") == 0 || strcmp(chosen_action, "converse with witch") == 0) {
if (!actions[GIVE_PURPLE_MUSHROOM]) {
printf("WITCH: 'I need something pungent...'\n\n");
}
if (!actions[GIVE_STICK]) {
printf("WITCH: 'I could use something brown and sticky...'\n\n");
}
if (actions[GIVE_PURPLE_MUSHROOM] && actions[GIVE_STICK]) {
printf("WITCH: 'I brewed up a PURPLE POTION, would you like to drink it? *cackles*'\n\n");
}
} else if (strcmp(chosen_action, "talk to cat") == 0 || strcmp(chosen_action, "speak to cat") == 0 || strcmp(chosen_action, "chat with cat") == 0 || strcmp(chosen_action, "talk with cat") == 0 || strcmp(chosen_action, "converse with cat") == 0) {
printf("You try talking to the cat, but it just stares back at you.\n\n");
} else if (strcmp(chosen_action, "give purple mushroom") == 0 || strcmp(chosen_action, "present purple mushroom") == 0 || strcmp(chosen_action, "provide purple mushroom") == 0) {
if (actions[GET_PURPLE_MUSHROOM] && !actions[GIVE_PURPLE_MUSHROOM]) {
printf("You hand the witch the purple mushroom, she drops it into the cauldron.\n\n");
actions[GIVE_PURPLE_MUSHROOM] = 1;
} else if (actions[GET_PURPLE_MUSHROOM] && actions[GIVE_PURPLE_MUSHROOM]) {
printf("You already gave the witch the purple mushroom!\n\n");
} else if (!actions[GET_PURPLE_MUSHROOM]) {
printf("You don't have a purple mushroom!\n\n");
}
} else if (strcmp(chosen_action, "give stick") == 0 || strcmp(chosen_action, "present stick") == 0 || strcmp(chosen_action, "provide stick") == 0) {
if (actions[GET_STICK] && !actions[GIVE_STICK]) {
printf("You give the witch the stick, she tosses it in the cauldron.\n\n");
actions[GIVE_STICK] = 1;
} else if (actions[GET_STICK] && actions[GIVE_STICK]) {
printf("The witch already has the stick!\n\n");
} else if (!actions[GET_STICK]) {
printf("You aren't carrying a stick!\n\n");
}
} else if (strcmp(chosen_action, "drink purple potion") == 0 || strcmp(chosen_action, "swallow purple potion") == 0 || strcmp(chosen_action, "gulp down purple potion") == 0 || strcmp(chosen_action, "consume purple potion") == 0 || strcmp(chosen_action, "down purple potion") == 0) {
if (actions[GIVE_PURPLE_MUSHROOM] && actions[GIVE_STICK]) {
printf("You drink the purple potion. Suddenly everything around you appears to be growing...\nNo... You are shrinking!\n\n");
*current_location = SHRUNK_HUT;
} else {
printf("The potion isn't ready yet.\n\n");
}
} else if (strcmp(chosen_action, "go west") == 0 || strcmp(chosen_action, "head west") == 0 || strcmp(chosen_action, "walk west") == 0 || strcmp(chosen_action, "travel west") == 0 || strcmp(chosen_action, "move west") == 0 || strcmp(chosen_action, "proceed west") == 0 || strcmp(chosen_action, "advance west") == 0 || strcmp(chosen_action, "leave west") == 0) {
printf("You go west outside the hut.\n\n");
*current_location = OUTSIDE_HUT;
} else {
printInvalid();
}
return 1;
}
bool room_SHRUNK_HUT(char name[], int *current_location, bool actions[], int *coins) {
printf("Now tiny, you see a cat to the NORTH, and a mouse hole to the EAST.\n\n");
char chosen_action[64];
int check = getChoiceAndSave(chosen_action, name, *current_location, actions, *coins);
if (check == -1) {
return 0;
} else if (check == 0) {
return 1;
}
if (strcmp(chosen_action, "go north") == 0 || strcmp(chosen_action, "head north") == 0 || strcmp(chosen_action, "walk north") == 0 || strcmp(chosen_action, "travel north") == 0 || strcmp(chosen_action, "move north") == 0 || strcmp(chosen_action, "proceed north") == 0 || strcmp(chosen_action, "advance north") == 0 || strcmp(chosen_action, "leave north") == 0) {
printf("You go north towards the cat.\n\n");
*current_location = SHRUNK_CAT;
} else if (strcmp(chosen_action, "go east") == 0 || strcmp(chosen_action, "head east") == 0 || strcmp(chosen_action, "walk east") == 0 || strcmp(chosen_action, "travel east") == 0 || strcmp(chosen_action, "move east") == 0 || strcmp(chosen_action, "proceed east") == 0 || strcmp(chosen_action, "advance east") == 0 || strcmp(chosen_action, "leave east") == 0) {
printf("You go east into the mouse hole.\n\n");
*current_location = SHRUNK_MOUSE;
} else {
printInvalid();
}
return 1;
}
bool room_SHRUNK_CAT(char name[], int *current_location, bool actions[], int *coins) {
printf("The cat speaks to you: 'Cats have nine lives, but you don't. A wise person saves often...'.\nSOUTH is where you came from.\n\n");
char chosen_action[64];
int check = getChoiceAndSave(chosen_action, name, *current_location, actions, *coins);
if (check == -1) {
return 0;
} else if (check == 0) {
return 1;
}
if (strcmp(chosen_action, "go south") == 0 || strcmp(chosen_action, "head south") == 0 || strcmp(chosen_action, "walk south") == 0 || strcmp(chosen_action, "travel south") == 0 || strcmp(chosen_action, "move south") == 0 || strcmp(chosen_action, "proceed south") == 0 || strcmp(chosen_action, "advance south") == 0 || strcmp(chosen_action, "leave south") == 0) {
printf("You go south back from where you came.\n\n");
*current_location = SHRUNK_HUT;
} else {
printInvalid();
}
return 1;
}
bool room_SHRUNK_MOUSE(char name[], int *current_location, bool actions[], int *coins) {
printf("You see a mouse sitting at a table eating a piece of cheese. WEST is the exit, EAST is the entrance to a hole.\n\n");
if (!actions[MOUSE_SPOKE]) {
printf("The mouse spoke: 'The burrow there leads to a labrynth filled with strange magic. You may find yourself going in circles.\nJust remember: Grass burns until it's doused with water...'\n\n");
actions[MOUSE_SPOKE] = 1;
}
char chosen_action[64];
int check = getChoiceAndSave(chosen_action, name, *current_location, actions, *coins);
if (check == -1) {
return 0;
} else if (check == 0) {
return 1;
}
if (strcmp(chosen_action, "go west") == 0 || strcmp(chosen_action, "head west") == 0 || strcmp(chosen_action, "walk west") == 0 || strcmp(chosen_action, "travel west") == 0 || strcmp(chosen_action, "move west") == 0 || strcmp(chosen_action, "proceed west") == 0 || strcmp(chosen_action, "advance west") == 0 || strcmp(chosen_action, "leave west") == 0) {
printf("You leave the mouse hole.\n\n");
*current_location = SHRUNK_HUT;
} else if (strcmp(chosen_action, "go east") == 0 || strcmp(chosen_action, "head east") == 0 || strcmp(chosen_action, "walk east") == 0 || strcmp(chosen_action, "travel east") == 0 || strcmp(chosen_action, "move east") == 0 || strcmp(chosen_action, "proceed east") == 0 || strcmp(chosen_action, "advance east") == 0 || strcmp(chosen_action, "leave east") == 0) {
printf("You go into the hole at the east, and find yourself falling!\nYou land in a dimly lit room.\n\n");
*current_location = LAB1;
} else {
printInvalid();
}
return 1;
}
bool room_LAB1(char name[], int *current_location, bool actions[], int *coins) {
printf("Looking around, you see three candles hanging from the ceiling.\nThere are doorways NORTH, EAST, WEST, and SOUTH.\n\n");
char chosen_action[64];
int check = getChoiceAndSave(chosen_action, name, *current_location, actions, *coins);
if (check == -1) {
return 0;
} else if (check == 0) {
return 1;
}
if (strcmp(chosen_action, "go north") == 0 || strcmp(chosen_action, "head north") == 0 || strcmp(chosen_action, "walk north") == 0 || strcmp(chosen_action, "travel north") == 0 || strcmp(chosen_action, "move north") == 0 || strcmp(chosen_action, "proceed north") == 0 || strcmp(chosen_action, "advance north") == 0 || strcmp(chosen_action, "leave north") == 0) {
printf("You go north through a doorway.\n\n");
*current_location = LAB2;
} else if (strcmp(chosen_action, "go east") == 0 || strcmp(chosen_action, "head east") == 0 || strcmp(chosen_action, "walk east") == 0 || strcmp(chosen_action, "travel east") == 0 || strcmp(chosen_action, "move east") == 0 || strcmp(chosen_action, "proceed east") == 0 || strcmp(chosen_action, "advance east") == 0 || strcmp(chosen_action, "leave east") == 0) {
printf("You go east through a doorway.\n\n");
*current_location = LAB5;
} else if (strcmp(chosen_action, "go west") == 0 || strcmp(chosen_action, "head west") == 0 || strcmp(chosen_action, "walk west") == 0 || strcmp(chosen_action, "travel west") == 0 || strcmp(chosen_action, "move west") == 0 || strcmp(chosen_action, "proceed west") == 0 || strcmp(chosen_action, "advance west") == 0 || strcmp(chosen_action, "leave west") == 0) {
printf("You go west through a doorway.\n\n");
*current_location = LAB1;
} else if (strcmp(chosen_action, "go south") == 0 || strcmp(chosen_action, "head south") == 0 || strcmp(chosen_action, "walk south") == 0 || strcmp(chosen_action, "travel south") == 0 || strcmp(chosen_action, "move south") == 0 || strcmp(chosen_action, "proceed south") == 0 || strcmp(chosen_action, "advance south") == 0 || strcmp(chosen_action, "leave south") == 0) {
printf("You go south through a doorway.\n\n");
*current_location = LAB1;
} else {
printInvalid();
}
return 1;
}
bool room_LAB2(char name[], int *current_location, bool actions[], int *coins) {
printf("Looking around, you see four candles hanging from the ceiling.\nThere are doorways NORTH, EAST, WEST, and SOUTH.\n\n");
char chosen_action[64];
int check = getChoiceAndSave(chosen_action, name, *current_location, actions, *coins);
if (check == -1) {
return 0;
} else if (check == 0) {
return 1;
}
if (strcmp(chosen_action, "go north") == 0 || strcmp(chosen_action, "head north") == 0 || strcmp(chosen_action, "walk north") == 0 || strcmp(chosen_action, "travel north") == 0 || strcmp(chosen_action, "move north") == 0 || strcmp(chosen_action, "proceed north") == 0 || strcmp(chosen_action, "advance north") == 0 || strcmp(chosen_action, "leave north") == 0) {
printf("You go north through a doorway.\n\n");
*current_location = LAB1;
} else if (strcmp(chosen_action, "go east") == 0 || strcmp(chosen_action, "head east") == 0 || strcmp(chosen_action, "walk east") == 0 || strcmp(chosen_action, "travel east") == 0 || strcmp(chosen_action, "move east") == 0 || strcmp(chosen_action, "proceed east") == 0 || strcmp(chosen_action, "advance east") == 0 || strcmp(chosen_action, "leave east") == 0) {
printf("You go east through a doorway.\n\n");
*current_location = LAB1;
} else if (strcmp(chosen_action, "go west") == 0 || strcmp(chosen_action, "head west") == 0 || strcmp(chosen_action, "walk west") == 0 || strcmp(chosen_action, "travel west") == 0 || strcmp(chosen_action, "move west") == 0 || strcmp(chosen_action, "proceed west") == 0 || strcmp(chosen_action, "advance west") == 0 || strcmp(chosen_action, "leave west") == 0) {
printf("You go west through a doorway.\n\n");
*current_location = LAB3;
} else if (strcmp(chosen_action, "go south") == 0 || strcmp(chosen_action, "head south") == 0 || strcmp(chosen_action, "walk south") == 0 || strcmp(chosen_action, "travel south") == 0 || strcmp(chosen_action, "move south") == 0 || strcmp(chosen_action, "proceed south") == 0 || strcmp(chosen_action, "advance south") == 0 || strcmp(chosen_action, "leave south") == 0) {
printf("You go south through a doorway.\n\n");
*current_location = LAB1;
} else {
printInvalid();
}
return 1;
}
bool room_LAB3(char name[], int *current_location, bool actions[], int *coins) {
printf("Looking around, you see five candles hanging from the ceiling.\nThere are doorways NORTH, EAST, WEST, and SOUTH.\n\n");
char chosen_action[64];
int check = getChoiceAndSave(chosen_action, name, *current_location, actions, *coins);
if (check == -1) {
return 0;
} else if (check == 0) {
return 1;
}
if (strcmp(chosen_action, "go north") == 0 || strcmp(chosen_action, "head north") == 0 || strcmp(chosen_action, "walk north") == 0 || strcmp(chosen_action, "travel north") == 0 || strcmp(chosen_action, "move north") == 0 || strcmp(chosen_action, "proceed north") == 0 || strcmp(chosen_action, "advance north") == 0 || strcmp(chosen_action, "leave north") == 0) {
printf("You go north through a doorway.\n\n");
*current_location = LAB1;
} else if (strcmp(chosen_action, "go east") == 0 || strcmp(chosen_action, "head east") == 0 || strcmp(chosen_action, "walk east") == 0 || strcmp(chosen_action, "travel east") == 0 || strcmp(chosen_action, "move east") == 0 || strcmp(chosen_action, "proceed east") == 0 || strcmp(chosen_action, "advance east") == 0 || strcmp(chosen_action, "leave east") == 0) {
printf("You go east through a doorway.\n\n");
*current_location = LAB2;
} else if (strcmp(chosen_action, "go west") == 0 || strcmp(chosen_action, "head west") == 0 || strcmp(chosen_action, "walk west") == 0 || strcmp(chosen_action, "travel west") == 0 || strcmp(chosen_action, "move west") == 0 || strcmp(chosen_action, "proceed west") == 0 || strcmp(chosen_action, "advance west") == 0 || strcmp(chosen_action, "leave west") == 0) {
printf("You go west through a doorway.\n\n");
*current_location = LAB1;
} else if (strcmp(chosen_action, "go south") == 0 || strcmp(chosen_action, "head south") == 0 || strcmp(chosen_action, "walk south") == 0 || strcmp(chosen_action, "travel south") == 0 || strcmp(chosen_action, "move south") == 0 || strcmp(chosen_action, "proceed south") == 0 || strcmp(chosen_action, "advance south") == 0 || strcmp(chosen_action, "leave south") == 0) {
printf("You go south through a doorway.\n\n");
*current_location = LAB4;
} else {
printInvalid();
}
return 1;
}
bool room_LAB4(char name[], int *current_location, bool actions[], int *coins) {
printf("Looking around, you see six candles hanging from the ceiling.\nThere are doorways NORTH, EAST, WEST, and SOUTH.\n\n");
char chosen_action[64];
int check = getChoiceAndSave(chosen_action, name, *current_location, actions, *coins);
if (check == -1) {
return 0;
} else if (check == 0) {
return 1;
}
if (strcmp(chosen_action, "go north") == 0 || strcmp(chosen_action, "head north") == 0 || strcmp(chosen_action, "walk north") == 0 || strcmp(chosen_action, "travel north") == 0 || strcmp(chosen_action, "move north") == 0 || strcmp(chosen_action, "proceed north") == 0 || strcmp(chosen_action, "advance north") == 0 || strcmp(chosen_action, "leave north") == 0) {
printf("You go north through a doorway.\n\n");
*current_location = LAB3;
} else if (strcmp(chosen_action, "go east") == 0 || strcmp(chosen_action, "head east") == 0 || strcmp(chosen_action, "walk east") == 0 || strcmp(chosen_action, "travel east") == 0 || strcmp(chosen_action, "move east") == 0 || strcmp(chosen_action, "proceed east") == 0 || strcmp(chosen_action, "advance east") == 0 || strcmp(chosen_action, "leave east") == 0) {
printf("You go east through a doorway.\n\n");
*current_location = LAB1;
} else if (strcmp(chosen_action, "go west") == 0 || strcmp(chosen_action, "head west") == 0 || strcmp(chosen_action, "walk west") == 0 || strcmp(chosen_action, "travel west") == 0 || strcmp(chosen_action, "move west") == 0 || strcmp(chosen_action, "proceed west") == 0 || strcmp(chosen_action, "advance west") == 0 || strcmp(chosen_action, "leave west") == 0) {
printf("You go west through a doorway.\n\n");
*current_location = LAB8;
} else if (strcmp(chosen_action, "go south") == 0 || strcmp(chosen_action, "head south") == 0 || strcmp(chosen_action, "walk south") == 0 || strcmp(chosen_action, "travel south") == 0 || strcmp(chosen_action, "move south") == 0 || strcmp(chosen_action, "proceed south") == 0 || strcmp(chosen_action, "advance south") == 0 || strcmp(chosen_action, "leave south") == 0) {
printf("You go south through a doorway.\n\n");
*current_location = LAB1;
} else {
printInvalid();
}
return 1;
}
bool room_LAB5(char name[], int *current_location, bool actions[], int *coins) {
printf("Looking around, you see four candles hanging from the ceiling.\nThere are doorways NORTH, EAST, WEST, and SOUTH.\n\n");
char chosen_action[64];
int check = getChoiceAndSave(chosen_action, name, *current_location, actions, *coins);
if (check == -1) {
return 0;
} else if (check == 0) {
return 1;
}
if (strcmp(chosen_action, "go north") == 0 || strcmp(chosen_action, "head north") == 0 || strcmp(chosen_action, "walk north") == 0 || strcmp(chosen_action, "travel north") == 0 || strcmp(chosen_action, "move north") == 0 || strcmp(chosen_action, "proceed north") == 0 || strcmp(chosen_action, "advance north") == 0 || strcmp(chosen_action, "leave north") == 0) {
printf("You go north through a doorway.\n\n");
*current_location = LAB1;
} else if (strcmp(chosen_action, "go east") == 0 || strcmp(chosen_action, "head east") == 0 || strcmp(chosen_action, "walk east") == 0 || strcmp(chosen_action, "travel east") == 0 || strcmp(chosen_action, "move east") == 0 || strcmp(chosen_action, "proceed east") == 0 || strcmp(chosen_action, "advance east") == 0 || strcmp(chosen_action, "leave east") == 0) {
printf("You go east through a doorway.\n\n");
*current_location = LAB6;
} else if (strcmp(chosen_action, "go west") == 0 || strcmp(chosen_action, "head west") == 0 || strcmp(chosen_action, "walk west") == 0 || strcmp(chosen_action, "travel west") == 0 || strcmp(chosen_action, "move west") == 0 || strcmp(chosen_action, "proceed west") == 0 || strcmp(chosen_action, "advance west") == 0 || strcmp(chosen_action, "leave west") == 0) {
printf("You go west through a doorway.\n\n");
*current_location = LAB1;
} else if (strcmp(chosen_action, "go south") == 0 || strcmp(chosen_action, "head south") == 0 || strcmp(chosen_action, "walk south") == 0 || strcmp(chosen_action, "travel south") == 0 || strcmp(chosen_action, "move south") == 0 || strcmp(chosen_action, "proceed south") == 0 || strcmp(chosen_action, "advance south") == 0 || strcmp(chosen_action, "leave south") == 0) {
printf("You go south through a doorway.\n\n");
*current_location = LAB1;
} else {
printInvalid();
}
return 1;
}
bool room_LAB6(char name[], int *current_location, bool actions[], int *coins) {
printf("Looking around, you see five candles hanging from the ceiling.\nThere are doorways NORTH, EAST, WEST, and SOUTH.\n\n");
char chosen_action[64];
int check = getChoiceAndSave(chosen_action, name, *current_location, actions, *coins);
if (check == -1) {
return 0;
} else if (check == 0) {
return 1;
}
if (strcmp(chosen_action, "go north") == 0 || strcmp(chosen_action, "head north") == 0 || strcmp(chosen_action, "walk north") == 0 || strcmp(chosen_action, "travel north") == 0 || strcmp(chosen_action, "move north") == 0 || strcmp(chosen_action, "proceed north") == 0 || strcmp(chosen_action, "advance north") == 0 || strcmp(chosen_action, "leave north") == 0) {
printf("You go north through a doorway.\n\n");
*current_location = LAB7;
} else if (strcmp(chosen_action, "go east") == 0 || strcmp(chosen_action, "head east") == 0 || strcmp(chosen_action, "walk east") == 0 || strcmp(chosen_action, "travel east") == 0 || strcmp(chosen_action, "move east") == 0 || strcmp(chosen_action, "proceed east") == 0 || strcmp(chosen_action, "advance east") == 0 || strcmp(chosen_action, "leave east") == 0) {
printf("You go east through a doorway.\n\n");
*current_location = LAB1;
} else if (strcmp(chosen_action, "go west") == 0 || strcmp(chosen_action, "head west") == 0 || strcmp(chosen_action, "walk west") == 0 || strcmp(chosen_action, "travel west") == 0 || strcmp(chosen_action, "move west") == 0 || strcmp(chosen_action, "proceed west") == 0 || strcmp(chosen_action, "advance west") == 0 || strcmp(chosen_action, "leave west") == 0) {
printf("You go west through a doorway.\n\n");
*current_location = LAB5;
} else if (strcmp(chosen_action, "go south") == 0 || strcmp(chosen_action, "head south") == 0 || strcmp(chosen_action, "walk south") == 0 || strcmp(chosen_action, "travel south") == 0 || strcmp(chosen_action, "move south") == 0 || strcmp(chosen_action, "proceed south") == 0 || strcmp(chosen_action, "advance south") == 0 || strcmp(chosen_action, "leave south") == 0) {
printf("You go south through a doorway.\n\n");
*current_location = LAB1;
} else {
printInvalid();
}
return 1;
}
bool room_LAB7(char name[], int *current_location, bool actions[], int *coins) {
printf("Looking around, you see six candles hanging from the ceiling.\nThere are three pedestals in the center of the room, and a LEVER on one of the walls.\nThere are doorways NORTH, EAST, WEST, and SOUTH.\n\n");
if (!actions[LEFT_PEDESTAL_SET]) {
printf("The pedestal on the LEFT is empty.\n");
} else {
if (actions[RED_ORB_LEFT]) {
printf("The RED ORB is on the LEFT pedestal.\n");
} else if (actions[BLUE_ORB_LEFT]) {
printf("The BLUE ORB is on the LEFT pedestal.\n");
} else if (actions[GREEN_ORB_LEFT]) {
printf("The GREEN ORB is on the LEFT pedestal.\n");
}
}
if (!actions[MIDDLE_PEDESTAL_SET]) {
printf("The pedestal on the MIDDLE is empty.\n");
} else {
if (actions[RED_ORB_MIDDLE]) {
printf("The RED ORB is on the MIDDLE pedestal.\n");
} else if (actions[BLUE_ORB_MIDDLE]) {
printf("The BLUE ORB is on the MIDDLE pedestal.\n");
} else if (actions[GREEN_ORB_MIDDLE]) {
printf("The GREEN ORB is on the MIDDLE pedestal.\n");
}
}
if (!actions[RIGHT_PEDESTAL_SET]) {
printf("The pedestal on the RIGHT is empty.\n");
} else {
if (actions[RED_ORB_RIGHT]) {
printf("The RED ORB is on the RIGHT pedestal.\n");
} else if (actions[BLUE_ORB_RIGHT]) {
printf("The BLUE ORB is on the RIGHT pedestal.\n");
} else if (actions[GREEN_ORB_RIGHT]) {
printf("The GREEN ORB is on the RIGHT pedestal.\n");
}
}
printf("\n");
char chosen_action[64];
int check = getChoiceAndSave(chosen_action, name, *current_location, actions, *coins);
if (check == -1) {
return 0;
} else if (check == 0) {
return 1;
}
if (strcmp(chosen_action, "go north") == 0 || strcmp(chosen_action, "head north") == 0 || strcmp(chosen_action, "walk north") == 0 || strcmp(chosen_action, "travel north") == 0 || strcmp(chosen_action, "move north") == 0 || strcmp(chosen_action, "proceed north") == 0 || strcmp(chosen_action, "advance north") == 0 || strcmp(chosen_action, "leave north") == 0) {
printf("You go north through a doorway.\n\n");
*current_location = LAB1;
} else if (strcmp(chosen_action, "go east") == 0 || strcmp(chosen_action, "head east") == 0 || strcmp(chosen_action, "walk east") == 0 || strcmp(chosen_action, "travel east") == 0 || strcmp(chosen_action, "move east") == 0 || strcmp(chosen_action, "proceed east") == 0 || strcmp(chosen_action, "advance east") == 0 || strcmp(chosen_action, "leave east") == 0) {
printf("You go east through a doorway.\n\n");
*current_location = LAB1;
} else if (strcmp(chosen_action, "go west") == 0 || strcmp(chosen_action, "head west") == 0 || strcmp(chosen_action, "walk west") == 0 || strcmp(chosen_action, "travel west") == 0 || strcmp(chosen_action, "move west") == 0 || strcmp(chosen_action, "proceed west") == 0 || strcmp(chosen_action, "advance west") == 0 || strcmp(chosen_action, "leave west") == 0) {
printf("You go west through a doorway.\n\n");
*current_location = LAB1;
} else if (strcmp(chosen_action, "go south") == 0 || strcmp(chosen_action, "head south") == 0 || strcmp(chosen_action, "walk south") == 0 || strcmp(chosen_action, "travel south") == 0 || strcmp(chosen_action, "move south") == 0 || strcmp(chosen_action, "proceed south") == 0 || strcmp(chosen_action, "advance south") == 0 || strcmp(chosen_action, "leave south") == 0) {
printf("You go south through a doorway.\n\n");
*current_location = LAB6;
} else if (strcmp(chosen_action, "set red orb left") == 0 || strcmp(chosen_action, "place red orb left") == 0 || strcmp(chosen_action, "put red orb left") == 0) {
if (actions[GET_RED_ORB] && !actions[LEFT_PEDESTAL_SET]) {
printf("You place the red orb on the left pedestal.\n\n");
actions[GET_RED_ORB] = 0;
actions[RED_ORB_LEFT] = 1;
actions[LEFT_PEDESTAL_SET] = 1;
} else if (actions[GET_RED_ORB] && actions[LEFT_PEDESTAL_SET]) {
printf("There is already an orb on the left pedestal!\n\n");
} else if (!actions[GET_RED_ORB]) {
printf("You don't have the red orb!\n\n");
}
} else if (strcmp(chosen_action, "set blue orb left") == 0 || strcmp(chosen_action, "place blue orb left") == 0 || strcmp(chosen_action, "put blue orb left") == 0) {
if (actions[GET_BLUE_ORB] && !actions[LEFT_PEDESTAL_SET]) {
printf("You place the blue orb on the left pedestal.\n\n");
actions[GET_BLUE_ORB] = 0;
actions[BLUE_ORB_LEFT] = 1;
actions[LEFT_PEDESTAL_SET] = 1;
} else if (actions[GET_BLUE_ORB] && actions[LEFT_PEDESTAL_SET]) {
printf("There is already an orb on the left pedestal!\n\n");
} else if (!actions[GET_BLUE_ORB]) {
printf("You don't have the blue orb!\n\n");
}
} else if (strcmp(chosen_action, "set green orb left") == 0 || strcmp(chosen_action, "place green orb left") == 0 || strcmp(chosen_action, "put green orb left") == 0) {
if (actions[GET_GREEN_ORB] && !actions[LEFT_PEDESTAL_SET]) {
printf("You place the green orb on the left pedestal.\n\n");
actions[GET_GREEN_ORB] = 0;
actions[GREEN_ORB_LEFT] = 1;
actions[LEFT_PEDESTAL_SET] = 1;
} else if (actions[GET_GREEN_ORB] && actions[LEFT_PEDESTAL_SET]) {
printf("There is already an orb on the left pedestal!\n\n");
} else if (!actions[GET_GREEN_ORB]) {
printf("You don't have the green orb!\n\n");
}
} else if (strcmp(chosen_action, "set red orb middle") == 0 || strcmp(chosen_action, "place red orb middle") == 0 || strcmp(chosen_action, "put red orb middle") == 0) {
if (actions[GET_RED_ORB] && !actions[MIDDLE_PEDESTAL_SET]) {
printf("You place the red orb on the middle pedestal.\n\n");
actions[GET_RED_ORB] = 0;
actions[RED_ORB_MIDDLE] = 1;
actions[MIDDLE_PEDESTAL_SET] = 1;
} else if (actions[GET_RED_ORB] && actions[MIDDLE_PEDESTAL_SET]) {
printf("There is already an orb on the middle pedestal!\n\n");
} else if (!actions[GET_RED_ORB]) {
printf("You don't have the red orb!\n\n");
}
} else if (strcmp(chosen_action, "set blue orb middle") == 0 || strcmp(chosen_action, "place blue orb middle") == 0 || strcmp(chosen_action, "put blue orb middle") == 0) {
if (actions[GET_BLUE_ORB] && !actions[MIDDLE_PEDESTAL_SET]) {
printf("You place the blue orb on the middle pedestal.\n\n");
actions[GET_BLUE_ORB] = 0;
actions[BLUE_ORB_MIDDLE] = 1;
actions[MIDDLE_PEDESTAL_SET] = 1;
} else if (actions[GET_BLUE_ORB] && actions[MIDDLE_PEDESTAL_SET]) {
printf("There is already an orb on the middle pedestal!\n\n");
} else if (!actions[GET_BLUE_ORB]) {
printf("You don't have the blue orb!\n\n");
}
} else if (strcmp(chosen_action, "set green orb middle") == 0 || strcmp(chosen_action, "place green orb middle") == 0 || strcmp(chosen_action, "put green orb middle") == 0) {
if (actions[GET_GREEN_ORB] && !actions[MIDDLE_PEDESTAL_SET]) {
printf("You place the green orb on the middle pedestal.\n\n");
actions[GET_GREEN_ORB] = 0;
actions[GREEN_ORB_MIDDLE] = 1;
actions[MIDDLE_PEDESTAL_SET] = 1;
} else if (actions[GET_GREEN_ORB] && actions[MIDDLE_PEDESTAL_SET]) {
printf("There is already an orb on the middle pedestal!\n\n");
} else if (!actions[GET_GREEN_ORB]) {
printf("You don't have the green orb!\n\n");
}
} else if (strcmp(chosen_action, "set red orb right") == 0 || strcmp(chosen_action, "place red orb right") == 0 || strcmp(chosen_action, "put red orb right") == 0) {
if (actions[GET_RED_ORB] && !actions[RIGHT_PEDESTAL_SET]) {
printf("You place the red orb on the right pedestal.\n\n");
actions[GET_RED_ORB] = 0;
actions[RED_ORB_RIGHT] = 1;
actions[RIGHT_PEDESTAL_SET] = 1;
} else if (actions[GET_RED_ORB] && actions[RIGHT_PEDESTAL_SET]) {
printf("There is already an orb on the right pedestal!\n\n");
} else if (!actions[GET_RED_ORB]) {
printf("You don't have the red orb!\n\n");
}
} else if (strcmp(chosen_action, "set blue orb right") == 0 || strcmp(chosen_action, "place blue orb right") == 0 || strcmp(chosen_action, "put blue orb right") == 0) {
if (actions[GET_BLUE_ORB] && !actions[RIGHT_PEDESTAL_SET]) {
printf("You place the blue orb on the right pedestal.\n\n");
actions[GET_BLUE_ORB] = 0;
actions[BLUE_ORB_RIGHT] = 1;
actions[RIGHT_PEDESTAL_SET] = 1;
} else if (actions[GET_BLUE_ORB] && actions[RIGHT_PEDESTAL_SET]) {
printf("There is already an orb on the right pedestal!\n\n");
} else if (!actions[GET_BLUE_ORB]) {
printf("You don't have the blue orb!\n\n");
}
} else if (strcmp(chosen_action, "set green orb right") == 0 || strcmp(chosen_action, "place green orb right") == 0 || strcmp(chosen_action, "put green orb right") == 0) {
if (actions[GET_GREEN_ORB] && !actions[RIGHT_PEDESTAL_SET]) {
printf("You place the green orb on the right pedestal.\n\n");
actions[GET_GREEN_ORB] = 0;
actions[GREEN_ORB_RIGHT] = 1;
actions[RIGHT_PEDESTAL_SET] = 1;
} else if (actions[GET_GREEN_ORB] && actions[RIGHT_PEDESTAL_SET]) {
printf("There is already an orb on the right pedestal!\n\n");
} else if (!actions[GET_GREEN_ORB]) {
printf("You don't have the green orb!\n\n");
}
} else if (strcmp(chosen_action, "get red orb") == 0 || strcmp(chosen_action, "pick up red orb") == 0 || strcmp(chosen_action, "grab red orb") == 0 || strcmp(chosen_action, "take red orb") == 0 || strcmp(chosen_action, "acquire red orb") == 0 || strcmp(chosen_action, "obtain red orb") == 0) {
if (!actions[GET_RED_ORB] && !actions[ORB_PUZZLE_SOLVED]) {
printf("You pick up the red orb.\n\n");
actions[GET_RED_ORB] = 1;
if (actions[RED_ORB_LEFT]) {
actions[RED_ORB_LEFT] = 0;
actions[LEFT_PEDESTAL_SET] = 0;
} else if (actions[RED_ORB_MIDDLE]) {
actions[RED_ORB_MIDDLE] = 0;
actions[MIDDLE_PEDESTAL_SET] = 0;
} else if (actions[RED_ORB_RIGHT]) {
actions[RED_ORB_RIGHT] = 0;
actions[RIGHT_PEDESTAL_SET] = 0;
}
} else if (!actions[GET_RED_ORB] && actions[ORB_PUZZLE_SOLVED]) {
printf("You don't need the red orb anymore.\n\n");
} else if (actions[GET_RED_ORB]) {
printf("You already have the red orb!\n\n");
}
} else if (strcmp(chosen_action, "get blue orb") == 0 || strcmp(chosen_action, "pick up blue orb") == 0 || strcmp(chosen_action, "grab blue orb") == 0 || strcmp(chosen_action, "take blue orb") == 0 || strcmp(chosen_action, "acquire blue orb") == 0 || strcmp(chosen_action, "obtain blue orb") == 0) {
if (!actions[GET_BLUE_ORB] && !actions[ORB_PUZZLE_SOLVED]) {
printf("You pick up the blue orb.\n\n");
actions[GET_BLUE_ORB] = 1;
if (actions[BLUE_ORB_LEFT]) {
actions[BLUE_ORB_LEFT] = 0;
actions[LEFT_PEDESTAL_SET] = 0;
} else if (actions[BLUE_ORB_MIDDLE]) {
actions[BLUE_ORB_MIDDLE] = 0;
actions[MIDDLE_PEDESTAL_SET] = 0;
} else if (actions[BLUE_ORB_RIGHT]) {
actions[BLUE_ORB_RIGHT] = 0;
actions[RIGHT_PEDESTAL_SET] = 0;
}
} else if (!actions[GET_BLUE_ORB] && actions[ORB_PUZZLE_SOLVED]) {
printf("You don't need the blue orb anymore.\n\n");
} else if (actions[GET_BLUE_ORB]) {
printf("You already have the blue orb!\n\n");
}
} else if (strcmp(chosen_action, "get green orb") == 0 || strcmp(chosen_action, "pick up green orb") == 0 || strcmp(chosen_action, "grab green orb") == 0 || strcmp(chosen_action, "take green orb") == 0 || strcmp(chosen_action, "acquire green orb") == 0 || strcmp(chosen_action, "obtain green orb") == 0) {
if (!actions[GET_GREEN_ORB] && !actions[ORB_PUZZLE_SOLVED]) {
printf("You pick up the green orb.\n\n");
actions[GET_GREEN_ORB] = 1;
if (actions[GREEN_ORB_LEFT]) {
actions[GREEN_ORB_LEFT] = 0;
actions[LEFT_PEDESTAL_SET] = 0;
} else if (actions[GREEN_ORB_MIDDLE]) {
actions[GREEN_ORB_MIDDLE] = 0;
actions[MIDDLE_PEDESTAL_SET] = 0;