-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathSWAEBetaTest.c
More file actions
784 lines (555 loc) · 21.9 KB
/
SWAEBetaTest.c
File metadata and controls
784 lines (555 loc) · 21.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <ctype.h>
#include <stdbool.h>
#ifdef _WIN32
#include <conio.h>
#else// do Unix-specific stuff
#include <termios.h>
#include <unistd.h>
int getch (void){ int ch; struct termios oldt, newt; tcgetattr(STDIN_FILENO, &oldt); newt = oldt; newt.c_lflag &= ~(ICANON|ECHO);
tcsetattr(STDIN_FILENO, TCSANOW, &newt); ch = getchar(); tcsetattr(STDIN_FILENO, TCSANOW, &oldt); return ch;}
#endif
#define clrscr() printf("\e[1;1H\e[2J")
int Random_Int_Num(int from, int to){ return (rand() % (to + 1 - from)) + from;}
void COMPILER_TOOL_PRINT_TUI(){
clrscr();
printf("##| SWAE TEST |##################################################################\n");
printf("#################################################################################\n\n");}
int COMPILER_TOOL_GET_INPUT(int max){
char pwd; int num; int m = max; printf("\n");
while (1) {pwd = getch(); if (isdigit(pwd)) {num = (int)pwd - 48; /* b/c ASCII: nums start at 48.*/if (num <= max && num > 0) return num;} pwd = '\0';}}
void COMPILER_TOOL_WAIT_FOR_INPUT(){ printf("\n"); char c = getch();}
char* COMPILER_TOOL_GET_STRING_INPUT(char * buf){
char name[50];
fgets(name, 50, stdin);
name[strcspn(name, "\r\n")] = 0;
strncpy(buf, name, 50);
return name;
}
void DEFINED_LOCATION_Start();
void DEFINED_LOCATION_Lokale();
void DEFINED_LOCATION_TheFuckeNing();
void DEFINED_LOCATION_Slottet();
void DEFINED_LOCATION_DragonFight();
void DEFINED_LOCATION_Hvidovre();
void DEFINED_LOCATION_END_POINT();
struct GENERATED_PLAYER_STRUCT {
char name[256] ;
int health;
int joints;
bool hasSword ;
bool gotDealer ;
int trollLevel;
bool regular_sword ;
int regular_sword_damage;
bool THE_GREAT_SWORD_OF_THE_OLD_ONE ;
int THE_GREAT_SWORD_OF_THE_OLD_ONE_DAMAGE;
bool GreatSwordReady ;
bool Boost_of_internal_power_for_one_attack ;
int The_dragon_of_smaguron_health;
int The_dragon_of_smaguron_damage;
};
struct GENERATED_PLAYER_STRUCT PLAYER_STRUCT;
void COMPILER_PLAYER_STRUCT_INIT(){
strcpy(PLAYER_STRUCT.name, "Herp");
PLAYER_STRUCT.health =30;
PLAYER_STRUCT.joints =0;
PLAYER_STRUCT.hasSword = false;
PLAYER_STRUCT.gotDealer = false;
PLAYER_STRUCT.trollLevel =0;
PLAYER_STRUCT.regular_sword = false;
PLAYER_STRUCT.regular_sword_damage =10;
PLAYER_STRUCT.THE_GREAT_SWORD_OF_THE_OLD_ONE = false;
PLAYER_STRUCT.THE_GREAT_SWORD_OF_THE_OLD_ONE_DAMAGE =50;
PLAYER_STRUCT.GreatSwordReady = false;
PLAYER_STRUCT.Boost_of_internal_power_for_one_attack = false;
PLAYER_STRUCT.The_dragon_of_smaguron_health =1000;
PLAYER_STRUCT.The_dragon_of_smaguron_damage =10;}
void DEFINED_LOCATION_Start(){
COMPILER_TOOL_PRINT_TUI();
printf("%s", "You just arrived in the city, the night is comming.");
COMPILER_TOOL_WAIT_FOR_INPUT();
COMPILER_TOOL_PRINT_TUI();
printf("%s", " ~ Hello there traveler! How was the journey? My name is Aslan.\n A bro-ass hippie in the street looks at you\n\n ~ ...wanna get high?");
COMPILER_TOOL_WAIT_FOR_INPUT();
printf("\n1. fuck. yeah. (+1 joint)");
printf("\n2. nah");
int USER_CHOICE_INPUT_HjcwMWrk = COMPILER_TOOL_GET_INPUT(2);
if (USER_CHOICE_INPUT_HjcwMWrk == 1){
PLAYER_STRUCT.joints+=1;
}
if (USER_CHOICE_INPUT_HjcwMWrk == 2){
COMPILER_TOOL_PRINT_TUI();
printf("%s", "..aight cool. Goodnight then.\n\n If you need a bed try Hvidovre");
COMPILER_TOOL_WAIT_FOR_INPUT();
DEFINED_LOCATION_Hvidovre();
}
COMPILER_TOOL_PRINT_TUI();
printf("%s", "Cool! let's go to the bar over there. Looks like they are smoking inside.");
COMPILER_TOOL_WAIT_FOR_INPUT();
COMPILER_TOOL_PRINT_TUI();
printf("%s", "The bar is lively, people are cheering.\n The hippie goes towards the bar while lighting one.\n You see a women of the night standing in a door.");
COMPILER_TOOL_WAIT_FOR_INPUT();
DEFINED_LOCATION_Lokale();
DEFINED_LOCATION_Start();
}
void DEFINED_LOCATION_Lokale(){
printf("\n1. Go to the lady");
if (PLAYER_STRUCT.gotDealer == false) printf("\n2. Find the Hippie in the bar");
if (PLAYER_STRUCT.gotDealer) printf("\n3. Smoke with Hippie");
printf("\n4. See what the noise in the back is.");
int USER_CHOICE_INPUT_LCdwuNc3 = COMPILER_TOOL_GET_INPUT(4);
if (USER_CHOICE_INPUT_LCdwuNc3 == 1){
DEFINED_LOCATION_TheFuckeNing();
}
if (PLAYER_STRUCT.gotDealer == false){
if (USER_CHOICE_INPUT_LCdwuNc3 == 2){
PLAYER_STRUCT.gotDealer = true;
COMPILER_TOOL_PRINT_TUI();
printf("%s", "You find the Hippie in the bar.\n ~ hey friend, I got some joints when you are ready");
COMPILER_TOOL_WAIT_FOR_INPUT();
}
} else if (USER_CHOICE_INPUT_LCdwuNc3 == 2) { USER_CHOICE_INPUT_LCdwuNc3 = 3; }
if (PLAYER_STRUCT.gotDealer){
if (USER_CHOICE_INPUT_LCdwuNc3 == 3){
COMPILER_TOOL_PRINT_TUI();
printf("%s", "The Hippie sees you.\n ~ yo, the deal is blood for ju\n you in?");
COMPILER_TOOL_WAIT_FOR_INPUT();
printf("\n1. sure");
printf("\n2. nah im good");
int USER_CHOICE_INPUT_tipbcS9u = COMPILER_TOOL_GET_INPUT(2);
if (USER_CHOICE_INPUT_tipbcS9u == 1){
PLAYER_STRUCT.health-=5;
PLAYER_STRUCT.joints+=1;
COMPILER_TOOL_PRINT_TUI();
printf("%s", "He grabs your arm and bites you!\n ~ Thanks man, here you go\n\nHe hands you a ju");
COMPILER_TOOL_WAIT_FOR_INPUT();
}
if (USER_CHOICE_INPUT_tipbcS9u == 2){
COMPILER_TOOL_PRINT_TUI();
printf("%s", "Cool. you ");
COMPILER_TOOL_WAIT_FOR_INPUT();
}
}
} else if (USER_CHOICE_INPUT_LCdwuNc3 == 3) { USER_CHOICE_INPUT_LCdwuNc3 = 4; }
if (USER_CHOICE_INPUT_LCdwuNc3 == 4){
COMPILER_TOOL_PRINT_TUI();
printf("%s", "Welp its a troll.");
COMPILER_TOOL_WAIT_FOR_INPUT();
DEFINED_LOCATION_Slottet();
}
DEFINED_LOCATION_Lokale();
}
void DEFINED_LOCATION_TheFuckeNing(){
int i=0;
COMPILER_TOOL_PRINT_TUI();
printf("%s", "A large women stands in the doorway\n ~ Hello there boo\nShe stares at you. ");
COMPILER_TOOL_WAIT_FOR_INPUT();
printf("\n1. ma'lady ;)");
printf("\n2. uhm.. what?");
int USER_CHOICE_INPUT_nxXmGkN = COMPILER_TOOL_GET_INPUT(2);
if (USER_CHOICE_INPUT_nxXmGkN == 1){
COMPILER_TOOL_PRINT_TUI();
printf("%s", "She drags you in..");
COMPILER_TOOL_WAIT_FOR_INPUT();
COMPILER_TOOL_PRINT_TUI();
printf("%s", "Throws herself on the bed");
COMPILER_TOOL_WAIT_FOR_INPUT();
while(i<=4) {
printf("\n1. Spank");
printf("\n2. Slap");
printf("\n3. Dap");
printf("\n4. Nap");
int USER_CHOICE_INPUT_nIWIpi1S = COMPILER_TOOL_GET_INPUT(4);
if (USER_CHOICE_INPUT_nIWIpi1S == 1){
i+=1;
COMPILER_TOOL_PRINT_TUI();
printf("%s", "*BOING*");
COMPILER_TOOL_WAIT_FOR_INPUT();
}
if (USER_CHOICE_INPUT_nIWIpi1S == 2){
i+=1;
COMPILER_TOOL_PRINT_TUI();
printf("%s", "*YAP*");
COMPILER_TOOL_WAIT_FOR_INPUT();
}
if (USER_CHOICE_INPUT_nIWIpi1S == 3){
i+=1;
COMPILER_TOOL_PRINT_TUI();
printf("%s", "*DAP*");
COMPILER_TOOL_WAIT_FOR_INPUT();
}
if (USER_CHOICE_INPUT_nIWIpi1S == 4){
i+=1;
PLAYER_STRUCT.health+=1;
COMPILER_TOOL_PRINT_TUI();
printf("%s", "You nap beside the women. You regain 1 Hp");
COMPILER_TOOL_WAIT_FOR_INPUT();
}
}
COMPILER_TOOL_PRINT_TUI();
printf("%s", "She start peeing and you rush out into the bar..\n\n...On the way out you grab a sword from behind a dresser.");
COMPILER_TOOL_WAIT_FOR_INPUT();
PLAYER_STRUCT.hasSword = true;
}
if (USER_CHOICE_INPUT_nxXmGkN == 2){
COMPILER_TOOL_PRINT_TUI();
printf("%s", " ~ Not a man of the night, I see. \nShe turn around..");
COMPILER_TOOL_WAIT_FOR_INPUT();
}
DEFINED_LOCATION_Lokale();
DEFINED_LOCATION_TheFuckeNing();
}
void DEFINED_LOCATION_Slottet(){
int enemy_health=42+PLAYER_STRUCT.trollLevel*5;
bool flag = true;
while(flag) {
COMPILER_TOOL_PRINT_TUI();
printf("%s%d%s%d%s%d", "Your HP: ", PLAYER_STRUCT.health, "(jays:", PLAYER_STRUCT.joints, ") Troll HP: ", enemy_health);
COMPILER_TOOL_WAIT_FOR_INPUT();
int roll=Random_Int_Num(6, 14);
int lroll=roll+6;
printf("\n1. Attack with Staff");
if (PLAYER_STRUCT.joints > 0) printf("\n2. Smoke Health Potion");
if (PLAYER_STRUCT.hasSword) printf("\n3. Swing your Sword!");
int USER_CHOICE_INPUT_In5G4hFV = COMPILER_TOOL_GET_INPUT(3);
if (USER_CHOICE_INPUT_In5G4hFV == 1){
enemy_health-=roll;
COMPILER_TOOL_PRINT_TUI();
printf("%s%d%s", "You attack for ", roll, " damage.");
COMPILER_TOOL_WAIT_FOR_INPUT();
}
if (PLAYER_STRUCT.joints > 0){
if (USER_CHOICE_INPUT_In5G4hFV == 2){
PLAYER_STRUCT.health+=15;
PLAYER_STRUCT.joints-=1;
COMPILER_TOOL_PRINT_TUI();
printf("%s", "420 baby! 15 Health healed");
COMPILER_TOOL_WAIT_FOR_INPUT();
}
} else if (USER_CHOICE_INPUT_In5G4hFV == 2) { USER_CHOICE_INPUT_In5G4hFV = 3; }
if (PLAYER_STRUCT.hasSword){
if (USER_CHOICE_INPUT_In5G4hFV == 3){
enemy_health-=lroll;
COMPILER_TOOL_PRINT_TUI();
printf("%s%d%s", "You attack for ", lroll, " damage.");
COMPILER_TOOL_WAIT_FOR_INPUT();
}
} else if (USER_CHOICE_INPUT_In5G4hFV == 3) { USER_CHOICE_INPUT_In5G4hFV = 4; }
if (enemy_health<=0) {
COMPILER_TOOL_PRINT_TUI();
printf("%s", "The troll falls over, it is done.");
COMPILER_TOOL_WAIT_FOR_INPUT();
COMPILER_TOOL_PRINT_TUI();
printf("%s", "A GLORIUS WIN for you! The Troll had 6 jays in his stash, score!");
COMPILER_TOOL_WAIT_FOR_INPUT();
PLAYER_STRUCT.joints+=6;
DEFINED_LOCATION_Hvidovre();
}
int enemychoice=Random_Int_Num(1, 2);
if (enemychoice == 1) {
int enemyDamage=Random_Int_Num(8+PLAYER_STRUCT.trollLevel*2, 15+PLAYER_STRUCT.trollLevel*2);
COMPILER_TOOL_PRINT_TUI();
printf("%s%d%s", "The Enemy attacks you with his greatclub for ", enemyDamage, " damage!");
COMPILER_TOOL_WAIT_FOR_INPUT();
PLAYER_STRUCT.health-=enemyDamage;
}
else if (enemychoice == 2) {
int enemyHeals=Random_Int_Num(4+PLAYER_STRUCT.trollLevel*2, 8+PLAYER_STRUCT.trollLevel*2);
COMPILER_TOOL_PRINT_TUI();
printf("%s%d%s", "The enemy heals for ", enemyHeals, " health");
COMPILER_TOOL_WAIT_FOR_INPUT();
enemy_health+=enemyHeals;
}
if (PLAYER_STRUCT.health<=0) {
COMPILER_TOOL_PRINT_TUI();
printf("%s", "you dead boi");
COMPILER_TOOL_WAIT_FOR_INPUT();
PLAYER_STRUCT.health=1;
DEFINED_LOCATION_Lokale();
}
}
DEFINED_LOCATION_Slottet();
}
void DEFINED_LOCATION_DragonFight(){
int dragonLevel=0;
bool flag = true;
while(flag) {
COMPILER_TOOL_PRINT_TUI();
printf("%s%d%s%d", "Your HP: ", PLAYER_STRUCT.health, " Dragon HP: ", PLAYER_STRUCT.The_dragon_of_smaguron_health);
COMPILER_TOOL_WAIT_FOR_INPUT();
int roll=0;
printf("\n1. Leave ->");
printf("\n2. Bonk with stick!");
if (PLAYER_STRUCT.regular_sword) printf("\n3. Swing your Sword!");
if (PLAYER_STRUCT.THE_GREAT_SWORD_OF_THE_OLD_ONE && PLAYER_STRUCT.GreatSwordReady == false) printf("\n4. Ready the Great Old Sword.");
if (PLAYER_STRUCT.THE_GREAT_SWORD_OF_THE_OLD_ONE && PLAYER_STRUCT.GreatSwordReady == true) printf("\n5. Attack with the Great old Sword!");
int USER_CHOICE_INPUT_RyrKwtqP = COMPILER_TOOL_GET_INPUT(5);
if (USER_CHOICE_INPUT_RyrKwtqP == 1){
DEFINED_LOCATION_Hvidovre();
}
if (USER_CHOICE_INPUT_RyrKwtqP == 2){
roll=Random_Int_Num(3, 8);
PLAYER_STRUCT.The_dragon_of_smaguron_health-=roll;
COMPILER_TOOL_PRINT_TUI();
printf("%s%d%s", "You Bonk the *Dragon* for ", roll, " damage.");
COMPILER_TOOL_WAIT_FOR_INPUT();
PLAYER_STRUCT.GreatSwordReady = false;
}
if (PLAYER_STRUCT.regular_sword){
if (USER_CHOICE_INPUT_RyrKwtqP == 3){
roll=Random_Int_Num(PLAYER_STRUCT.regular_sword_damage-3, PLAYER_STRUCT.regular_sword_damage+3);
PLAYER_STRUCT.The_dragon_of_smaguron_health-=roll;
COMPILER_TOOL_PRINT_TUI();
printf("%s%d%s", "You Swing your Sword for ", roll, " damage.");
COMPILER_TOOL_WAIT_FOR_INPUT();
PLAYER_STRUCT.GreatSwordReady = false;
}
} else if (USER_CHOICE_INPUT_RyrKwtqP == 3) { USER_CHOICE_INPUT_RyrKwtqP = 4; }
if (PLAYER_STRUCT.THE_GREAT_SWORD_OF_THE_OLD_ONE && PLAYER_STRUCT.GreatSwordReady == false){
if (USER_CHOICE_INPUT_RyrKwtqP == 4){
COMPILER_TOOL_PRINT_TUI();
printf("%s%s", "When hand comes to hilt, question comes to heart, from soul is given heaven's answer\n via either divine balancing scale or sword.", "For there is either hope, or there is not,\n and one way or another, suffering must end.");
COMPILER_TOOL_WAIT_FOR_INPUT();
PLAYER_STRUCT.GreatSwordReady = true;
}
} else if (USER_CHOICE_INPUT_RyrKwtqP == 4) { USER_CHOICE_INPUT_RyrKwtqP = 5; }
if (PLAYER_STRUCT.THE_GREAT_SWORD_OF_THE_OLD_ONE && PLAYER_STRUCT.GreatSwordReady == true){
if (USER_CHOICE_INPUT_RyrKwtqP == 5){
roll=Random_Int_Num(PLAYER_STRUCT.THE_GREAT_SWORD_OF_THE_OLD_ONE_DAMAGE-13, PLAYER_STRUCT.THE_GREAT_SWORD_OF_THE_OLD_ONE_DAMAGE+13);
PLAYER_STRUCT.The_dragon_of_smaguron_health-=roll;
COMPILER_TOOL_PRINT_TUI();
printf("%s%s%d%s", "You wield the Sword with might!\nand it slices through the dragon like a hot knife through butter.\n\n", "You attack for ", roll, " damage.");
COMPILER_TOOL_WAIT_FOR_INPUT();
PLAYER_STRUCT.GreatSwordReady = false;
}
} else if (USER_CHOICE_INPUT_RyrKwtqP == 5) { USER_CHOICE_INPUT_RyrKwtqP = 6; }
if (PLAYER_STRUCT.The_dragon_of_smaguron_health<=0) {
COMPILER_TOOL_PRINT_TUI();
printf("%s", "The deed is done.");
COMPILER_TOOL_WAIT_FOR_INPUT();
COMPILER_TOOL_PRINT_TUI();
printf("%s", "A GLORIUS WIN for you!");
COMPILER_TOOL_WAIT_FOR_INPUT();
DEFINED_LOCATION_Hvidovre();
}
if (PLAYER_STRUCT.The_dragon_of_smaguron_health < 200 && Random_Int_Num(1, 3) == 3) {
COMPILER_TOOL_PRINT_TUI();
printf("%s", "The Dragon gets angry, it is fighing for its life.");
COMPILER_TOOL_WAIT_FOR_INPUT();
printf("\n1. Go for the Execute.");
printf("\n2. Not yet");
int USER_CHOICE_INPUT_MhpjEvG9 = COMPILER_TOOL_GET_INPUT(2);
if (USER_CHOICE_INPUT_MhpjEvG9 == 1){
if (PLAYER_STRUCT.THE_GREAT_SWORD_OF_THE_OLD_ONE) {
COMPILER_TOOL_PRINT_TUI();
printf("%s", "You rush towards the dragon\n\nIt fears you.");
COMPILER_TOOL_WAIT_FOR_INPUT();
COMPILER_TOOL_PRINT_TUI();
printf("%s", "You Slice your Great Old Sword through the dragons skull.\nIt screams.");
COMPILER_TOOL_WAIT_FOR_INPUT();
PLAYER_STRUCT.The_dragon_of_smaguron_health=0;
}
else if (Random_Int_Num(1, 4) == 4) {
COMPILER_TOOL_PRINT_TUI();
printf("%s", "You rush towards the dragon\n\nIt gets ready.");
COMPILER_TOOL_WAIT_FOR_INPUT();
COMPILER_TOOL_PRINT_TUI();
printf("%s", "By a true miracle you piece the dragons scales.\n\nYou got it good.");
COMPILER_TOOL_WAIT_FOR_INPUT();
PLAYER_STRUCT.The_dragon_of_smaguron_health=0;
}
else {
roll=Random_Int_Num(PLAYER_STRUCT.The_dragon_of_smaguron_damage, PLAYER_STRUCT.The_dragon_of_smaguron_damage+15+dragonLevel);
COMPILER_TOOL_PRINT_TUI();
printf("%s", "You rush towards the beast!");
COMPILER_TOOL_WAIT_FOR_INPUT();
COMPILER_TOOL_PRINT_TUI();
printf("%s%d%s", "You hit it but the scales stopped your weapon.\n\nIt spits fire at you for ", roll, " damage.");
COMPILER_TOOL_WAIT_FOR_INPUT();
PLAYER_STRUCT.health-=roll;
}
}
if (USER_CHOICE_INPUT_MhpjEvG9 == 2){
PLAYER_STRUCT.The_dragon_of_smaguron_health-=1;
}
}
else if (Random_Int_Num(1, 5) == 5) {
roll=Random_Int_Num(PLAYER_STRUCT.regular_sword_damage+5, PLAYER_STRUCT.regular_sword_damage+10);
COMPILER_TOOL_PRINT_TUI();
printf("%s", "The Dragon turns its back. you see your chance\n\nDo you take it?");
COMPILER_TOOL_WAIT_FOR_INPUT();
printf("\n1. Run and jump onto the back of the dragon!");
printf("\n2. Catch your breath instead");
int USER_CHOICE_INPUT_Y4LQhrPR = COMPILER_TOOL_GET_INPUT(2);
if (USER_CHOICE_INPUT_Y4LQhrPR == 1){
COMPILER_TOOL_PRINT_TUI();
printf("%s%d%s", "You slice open a fresh wound and deal ", roll, " damage");
COMPILER_TOOL_WAIT_FOR_INPUT();
PLAYER_STRUCT.The_dragon_of_smaguron_health-=roll;
}
if (USER_CHOICE_INPUT_Y4LQhrPR == 2){
COMPILER_TOOL_PRINT_TUI();
printf("%s", "You catch your breath and feel the second wind.\n\nJust in time for the dragon again facing you");
COMPILER_TOOL_WAIT_FOR_INPUT();
PLAYER_STRUCT.The_dragon_of_smaguron_health-=1;
}
}
if (PLAYER_STRUCT.The_dragon_of_smaguron_health<=0) {
COMPILER_TOOL_PRINT_TUI();
printf("%s", "The deed is done.");
COMPILER_TOOL_WAIT_FOR_INPUT();
COMPILER_TOOL_PRINT_TUI();
printf("%s", "A GLORIUS WIN for you!");
COMPILER_TOOL_WAIT_FOR_INPUT();
DEFINED_LOCATION_Hvidovre();
}
int enemychoice=Random_Int_Num(1, 3);
int enemyRoll;
if (enemychoice == 1) {
enemyRoll=Random_Int_Num(PLAYER_STRUCT.The_dragon_of_smaguron_damage-10, PLAYER_STRUCT.The_dragon_of_smaguron_damage+10);
COMPILER_TOOL_PRINT_TUI();
printf("%s%d%s", "The Dragon bites you for ", enemyRoll, " damage!");
COMPILER_TOOL_WAIT_FOR_INPUT();
PLAYER_STRUCT.health-=enemyRoll;
}
else if (enemychoice == 2) {
enemyRoll=Random_Int_Num(PLAYER_STRUCT.The_dragon_of_smaguron_damage-PLAYER_STRUCT.The_dragon_of_smaguron_damage*2, 8+PLAYER_STRUCT.The_dragon_of_smaguron_damage*2)+dragonLevel*3;
COMPILER_TOOL_PRINT_TUI();
printf("%s%d%s", "The Dragon recites an ancient melody\nIts lifeforce has changed by ", enemyRoll, " health");
COMPILER_TOOL_WAIT_FOR_INPUT();
PLAYER_STRUCT.The_dragon_of_smaguron_health+=enemyRoll;
}
else if (enemychoice == 3) {
enemyRoll=Random_Int_Num(PLAYER_STRUCT.The_dragon_of_smaguron_damage, PLAYER_STRUCT.The_dragon_of_smaguron_damage+5)+dragonLevel*2;
COMPILER_TOOL_PRINT_TUI();
printf("%s%d%s", "The Dragon spits fire in a cone\n\nYou are hit for ", enemyRoll, " damage");
COMPILER_TOOL_WAIT_FOR_INPUT();
PLAYER_STRUCT.health-=enemyRoll;
}
if (PLAYER_STRUCT.health<=0) {
COMPILER_TOOL_PRINT_TUI();
printf("%s", "you dead boi");
COMPILER_TOOL_WAIT_FOR_INPUT();
PLAYER_STRUCT.health=1;
DEFINED_LOCATION_Hvidovre();
}
if (PLAYER_STRUCT.The_dragon_of_smaguron_health<=0) {
COMPILER_TOOL_PRINT_TUI();
printf("%s", "The deed is done.");
COMPILER_TOOL_WAIT_FOR_INPUT();
COMPILER_TOOL_PRINT_TUI();
printf("%s", "A GLORIUS WIN for you!");
COMPILER_TOOL_WAIT_FOR_INPUT();
DEFINED_LOCATION_Hvidovre();
}
}
DEFINED_LOCATION_DragonFight();
}
void DEFINED_LOCATION_Hvidovre(){
COMPILER_TOOL_PRINT_TUI();
printf("%s%s%s%d%s%d%s%d", "Congratulations, ", PLAYER_STRUCT.name, " you managed to get to the debug menu!\nHp: ", PLAYER_STRUCT.health, " Jays: ", PLAYER_STRUCT.joints, " TrollLvl: ", PLAYER_STRUCT.trollLevel);
COMPILER_TOOL_WAIT_FOR_INPUT();
printf("\n1. Set health to 1");
printf("\n2. Reroll Health");
printf("\n3. Toggle Sword");
printf("\n4. change name");
printf("\n5. get jay");
printf("\n6. lose jay");
printf("\n7. Goto Lokale");
printf("\n8. dragonfight Menu");
int USER_CHOICE_INPUT_MUhyMsKn = COMPILER_TOOL_GET_INPUT(8);
if (USER_CHOICE_INPUT_MUhyMsKn == 1){
PLAYER_STRUCT.health=1;
}
if (USER_CHOICE_INPUT_MUhyMsKn == 2){
PLAYER_STRUCT.health=Random_Int_Num(2, 100);
}
if (USER_CHOICE_INPUT_MUhyMsKn == 3){
if (PLAYER_STRUCT.hasSword == false) {
PLAYER_STRUCT.hasSword = true;
COMPILER_TOOL_PRINT_TUI();
printf("%s", "Sword gained yay");
COMPILER_TOOL_WAIT_FOR_INPUT();
}
else {
PLAYER_STRUCT.hasSword = false;
COMPILER_TOOL_PRINT_TUI();
printf("%s", "Aaaand its gone...");
COMPILER_TOOL_WAIT_FOR_INPUT();
}
}
if (USER_CHOICE_INPUT_MUhyMsKn == 4){
printf("%s", "Type new name..");
printf("\n\n /> ");
memset(PLAYER_STRUCT.name, 0, 51);
COMPILER_TOOL_GET_STRING_INPUT(PLAYER_STRUCT.name);
}
if (USER_CHOICE_INPUT_MUhyMsKn == 5){
PLAYER_STRUCT.joints+=1;
}
if (USER_CHOICE_INPUT_MUhyMsKn == 6){
PLAYER_STRUCT.joints-=1;
}
if (USER_CHOICE_INPUT_MUhyMsKn == 7){
DEFINED_LOCATION_Lokale();
}
if (USER_CHOICE_INPUT_MUhyMsKn == 8){
printf("\n1. <- back");
printf("\n2. Toggle regular sword");
printf("\n3. Toggle Great Sword");
printf("\n4. Goto DragonFight");
int USER_CHOICE_INPUT_7PFMeyl = COMPILER_TOOL_GET_INPUT(4);
if (USER_CHOICE_INPUT_7PFMeyl == 1){
int i=0;
}
if (USER_CHOICE_INPUT_7PFMeyl == 2){
if (PLAYER_STRUCT.regular_sword == false) {
PLAYER_STRUCT.regular_sword = true;
COMPILER_TOOL_PRINT_TUI();
printf("%s", "Regular Sword gained yay");
COMPILER_TOOL_WAIT_FOR_INPUT();
}
else {
PLAYER_STRUCT.regular_sword = false;
COMPILER_TOOL_PRINT_TUI();
printf("%s", "Aaaand its gone...");
COMPILER_TOOL_WAIT_FOR_INPUT();
}
}
if (USER_CHOICE_INPUT_7PFMeyl == 3){
if (PLAYER_STRUCT.THE_GREAT_SWORD_OF_THE_OLD_ONE == false) {
PLAYER_STRUCT.THE_GREAT_SWORD_OF_THE_OLD_ONE = true;
COMPILER_TOOL_PRINT_TUI();
printf("%s", "Great Sword gained yay");
COMPILER_TOOL_WAIT_FOR_INPUT();
}
else {
PLAYER_STRUCT.THE_GREAT_SWORD_OF_THE_OLD_ONE = false;
COMPILER_TOOL_PRINT_TUI();
printf("%s", "Aaaand its gone...");
COMPILER_TOOL_WAIT_FOR_INPUT();
}
}
if (USER_CHOICE_INPUT_7PFMeyl == 4){
DEFINED_LOCATION_DragonFight();
}
}
DEFINED_LOCATION_Hvidovre();
}
void DEFINED_LOCATION_END_POINT(){
COMPILER_TOOL_PRINT_TUI();
printf("%s", "END");
COMPILER_TOOL_WAIT_FOR_INPUT();
DEFINED_LOCATION_END_POINT();
}
int main(int argc, char const *argv[]){
time_t t;
srand((unsigned)time(&t));
COMPILER_PLAYER_STRUCT_INIT();
DEFINED_LOCATION_Start();
return 0;
}