-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathUpdatedPseudoDrageCodeGenTest.c
More file actions
451 lines (315 loc) · 11.6 KB
/
UpdatedPseudoDrageCodeGenTest.c
File metadata and controls
451 lines (315 loc) · 11.6 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
#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();}
void DEFINED_LOCATION_Start();
void DEFINED_LOCATION_Lokale();
void DEFINED_LOCATION_TheFuckeNing();
void DEFINED_LOCATION_Slottet();
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;
};
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;}
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_MwzTapGF = COMPILER_TOOL_GET_INPUT(2);
if (USER_CHOICE_INPUT_MwzTapGF == 1){
PLAYER_STRUCT.joints+=1;
}
if (USER_CHOICE_INPUT_MwzTapGF == 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_jQ65w0EN = COMPILER_TOOL_GET_INPUT(4);
if (USER_CHOICE_INPUT_jQ65w0EN == 1){
DEFINED_LOCATION_TheFuckeNing();
}
if (PLAYER_STRUCT.gotDealer == false){
if (USER_CHOICE_INPUT_jQ65w0EN == 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_jQ65w0EN == 2) { USER_CHOICE_INPUT_jQ65w0EN = 3; }
if (PLAYER_STRUCT.gotDealer){
if (USER_CHOICE_INPUT_jQ65w0EN == 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_CPRHfG9S = COMPILER_TOOL_GET_INPUT(2);
if (USER_CHOICE_INPUT_CPRHfG9S == 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_CPRHfG9S == 2){
COMPILER_TOOL_PRINT_TUI();
printf("%s", "Cool. you ");
COMPILER_TOOL_WAIT_FOR_INPUT();
}
}
} else if (USER_CHOICE_INPUT_jQ65w0EN == 3) { USER_CHOICE_INPUT_jQ65w0EN = 4; }
if (USER_CHOICE_INPUT_jQ65w0EN == 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_F5S6BqaY = COMPILER_TOOL_GET_INPUT(2);
if (USER_CHOICE_INPUT_F5S6BqaY == 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_4Kt4Ux0X = COMPILER_TOOL_GET_INPUT(4);
if (USER_CHOICE_INPUT_4Kt4Ux0X == 1){
i+=1;
COMPILER_TOOL_PRINT_TUI();
printf("%s", "*BOING*");
COMPILER_TOOL_WAIT_FOR_INPUT();
}
if (USER_CHOICE_INPUT_4Kt4Ux0X == 2){
i+=1;
COMPILER_TOOL_PRINT_TUI();
printf("%s", "*YAP*");
COMPILER_TOOL_WAIT_FOR_INPUT();
}
if (USER_CHOICE_INPUT_4Kt4Ux0X == 3){
i+=1;
COMPILER_TOOL_PRINT_TUI();
printf("%s", "*DAP*");
COMPILER_TOOL_WAIT_FOR_INPUT();
}
if (USER_CHOICE_INPUT_4Kt4Ux0X == 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_F5S6BqaY == 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_2JnmvStO = COMPILER_TOOL_GET_INPUT(3);
if (USER_CHOICE_INPUT_2JnmvStO == 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_2JnmvStO == 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_2JnmvStO == 2) { USER_CHOICE_INPUT_2JnmvStO = 3; }
if (PLAYER_STRUCT.hasSword){
if (USER_CHOICE_INPUT_2JnmvStO == 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_2JnmvStO == 3) { USER_CHOICE_INPUT_2JnmvStO = 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_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. level up troll");
printf("\n5. level down troll");
printf("\n6. get jay");
printf("\n7. lose jay");
printf("\n8. Goto Lokale");
int USER_CHOICE_INPUT_N4wkkJMJ = COMPILER_TOOL_GET_INPUT(8);
if (USER_CHOICE_INPUT_N4wkkJMJ == 1){
PLAYER_STRUCT.health=1;
}
if (USER_CHOICE_INPUT_N4wkkJMJ == 2){
PLAYER_STRUCT.health=Random_Int_Num(2, 100);
}
if (USER_CHOICE_INPUT_N4wkkJMJ == 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_N4wkkJMJ == 4){
PLAYER_STRUCT.trollLevel+=1;
}
if (USER_CHOICE_INPUT_N4wkkJMJ == 5){
PLAYER_STRUCT.trollLevel-=1;
}
if (USER_CHOICE_INPUT_N4wkkJMJ == 6){
PLAYER_STRUCT.joints+=1;
}
if (USER_CHOICE_INPUT_N4wkkJMJ == 7){
PLAYER_STRUCT.joints-=1;
}
if (USER_CHOICE_INPUT_N4wkkJMJ == 8){
DEFINED_LOCATION_Lokale();
}
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;
}