【原创】Bulfly

这里有一个菜鸡的游戏

版权声明:作者系小跳蛙
这个游戏还在调试阶段,如有bug欢迎私信小跳蛙

点击显/隐代码
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
#include<bits/stdc++.h>
#include<windows.h>
#define KEY_DOWN(VK_NONAME) ((GetAsyncKeyState(VK_NONAME)&0x8000)?1:0)
using namespace std;
int N=15,Numk=50,Numl=5,Numd=100,Nan=40,Hp=10,Bebc=15,Bebh=16,Bebb=10,squ=3;
struct node
{
int x,y,vf,bv;
inline void init() {x=rand()%N+1,y=rand()%N+1,bv=rand()%3+1;}
inline void move() {x++;if(x>N) init(),x=1;}
}k[10005],l[10005],d[10005];
int x,y,hp,score,mp[25][25],udf,numc,numh,numb,bulc,bulh,bulb,lanf;
inline void add(int &x,int y) {x+=y,x=max(x,1),x=min(x,N);}
void color(int a) {SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),a);}
inline int read()
{
int r=0;char c=getchar();
while(c>'9'||c<'0') c=getchar();
while(c>='0'&&c<='9') (r*=10)+=c-'0',c=getchar();
return r;
}
inline void print(int x,int y,string s)
{
HANDLE hOut;COORD pos;
hOut=GetStdHandle(STD_OUTPUT_HANDLE),pos.X=y,pos.Y=x;
SetConsoleCursorPosition(hOut,pos),cout<<s;
}
inline char check_press(int x)
{
Sleep(100);
for(int i=1;i<=10;i++) {if(KEY_DOWN(x)) return 1;Sleep(10);}
return 0;
}
inline void set_windows(int x1,int y1,int x2,int y2)
{
HANDLE hOut=GetStdHandle(STD_OUTPUT_HANDLE);SMALL_RECT rc;
rc.Left=x1,rc.Top=y1,rc.Right=x2,rc.Bottom=y2;
SetConsoleWindowInfo(hOut, TRUE, &rc);
}
inline void disap_mouse()
{
ShowCursor(false);
HANDLE hOut=GetStdHandle(STD_OUTPUT_HANDLE);
CONSOLE_CURSOR_INFO cci;
GetConsoleCursorInfo(hOut,&cci);
cci.bVisible=false;
SetConsoleCursorInfo(hOut,&cci);
}
inline char check_die()
{
for(int i=1;i<=Numk;i++) if(k[i].x==x&&k[i].y==y) return k[i].init(),k[i].x=1,0;
return 1;
}
inline char check_luck()
{
for(int i=1;i<=Numl;i++)
if(l[i].x==x&&l[i].y==y)
{
l[i].init(),l[i].x=1;
numc+=(rand()%10+5)*bulc;
numh+=(rand()%5+5)*bulh;
numb+=(rand()%5+5)*bulb;
return 0;
}
return 1;
}
inline char check_dowm()
{
for(int i=1;i<=Numd;i++)
if(d[i].x==x&&d[i].y==y)
{
d[i].init(),d[i].x=1;
numc+=(rand()%10+5)*bulc;
numh+=(rand()%5+5)*bulh;
numb+=(rand()%5+5)*bulb;
return 0;
}
return 1;
}
inline void move_thi()
{
for(int i=1;i<=Numk;i++) if(k[i].vf==0) k[i].move();
for(int i=1;i<=Numl;i++) if(l[i].vf==0) l[i].move();
for(int i=1;i<=Numd;i++) if(d[i].vf==0) d[i].move();
}
inline char move_peo()
{
char c=0;
if(KEY_DOWN(87)&&!udf) add(x,-1),c=1;
if(KEY_DOWN(38)&&!udf) add(x,-1),c=1;
if(KEY_DOWN(104)&&!udf) add(x,-1),c=1;
if(KEY_DOWN(87)||KEY_DOWN(38)||KEY_DOWN(104)) color(112),print(11,N+5,"↑"),color(7);else print(11,N+5,"↑");
if(KEY_DOWN(83)&&!udf) add(x,1),c=1;
if(KEY_DOWN(40)&&!udf) add(x,1),c=1;
if(KEY_DOWN(101)&&!udf) add(x,1),c=1;
if(KEY_DOWN(83)||KEY_DOWN(40)||KEY_DOWN(101)) color(112),print(15,N+5,"↓"),color(7);else print(15,N+5,"↓");
if(KEY_DOWN(65)) add(y,-1),c=1;
if(KEY_DOWN(37)) add(y,-1),c=1;
if(KEY_DOWN(100)) add(y,-1),c=1;
if(KEY_DOWN(65)||KEY_DOWN(37)||KEY_DOWN(100)) color(112),print(13,N+3,"←"),color(7);else print(13,N+3,"←");
if(KEY_DOWN(68)) add(y,1),c=1;
if(KEY_DOWN(39)) add(y,1),c=1;
if(KEY_DOWN(102)) add(y,1),c=1;
if(KEY_DOWN(68)||KEY_DOWN(39)||KEY_DOWN(102)) color(112),print(13,N+7,"→"),color(7);else print(13,N+7,"→");
return c;
}
inline void die()
{
system("cls"),print(0,0,"");
if(lanf==1)
{
puts("YOU DIED!!!\n"),Sleep(1000);
printf("YOU SCORE IS:%d\n\n",score),Sleep(1000);
}
if(lanf==0)
{
puts("你终于知道 死 这个字怎么写了!!!\n"),Sleep(1000);
printf("你的分数是:%d\n\n",score),Sleep(1000);
}
if(lanf==1) puts("TRY AGAIN?\n");
if(lanf==0) puts("再来一局?\n");
}
inline void init()
{
system("cls"),srand(time(0)),printf(" ");
for(int i=1;i<=N;i++) printf("~");
puts("");
for(int i=1;i<=N;i++)
{
printf("|");
for(int i=1;i<=N;i++) printf(" ");
puts("|");
}
printf(" ");
for(int i=1;i<=N;i++) printf("~");
puts(""),x=N,y=N/2,hp=Hp,score=0,numc=Bebc*bulc,numh=Bebh*bulh,numb=Bebb*bulb;
for(int i=1;i<=Numk;i++) k[i].init(),k[i].y=N+1,k[i].vf=k[i].bv-1;
for(int i=1;i<=Numl;i++) l[i].init(),l[i].y=N+1,l[i].vf=l[i].bv-1;
for(int i=1;i<=Numd;i++) d[i].init(),d[i].y=N+1,d[i].vf=d[i].bv-1;
print(1,N+2," "),printf("The bloods you still have");
print(3,N+2," "),printf("The score you have now is");
print(5,N+2," "),printf("The normal bullet you have is");
print(7,N+2," "),printf("The high bullet you have is");
print(9,N+2," "),printf("The big bullet you have is");
for(int i=1;i<=Hp/30;i++)
{
print(16+i,N+2,"-");
for(int i=2;i<=30;i++) printf("-");
}
print(17+Hp/30,N+2,"-");
for(int i=2;i<=Hp%30;i++) printf("-");
print(x,y,"*");
}
inline void Begin()
{
disap_mouse(),set_windows(10,10,89,55),system("cls");
printf("\n"),printf("WELCOME TO THE GAME:\n"),color(14);
printf(
"\n"
"BBBBee U U L FFFFFF L Y Y \n"
"B B U U L F L Y Y \n"
"B B U U L F L Y Y \n"
"BBBBBB U U L FFFFFF L YY \n"
"B B U U L F L YY \n"
"B B U U L F L YY \n"
"BBBB^^ UUUU LLLLLL F LLLLLL YY \n"
"\n"
);
color(12),printf("烤蛙出品,侵权必究!QWQ\n\nBelieve_R_ 赞助开发\n\n");
color(7),Sleep(500),puts("PLEASE PRESS 'Enter' TO CONTINUE");
while(1) {if(KEY_DOWN(13)) break;}
Sleep(200),system("cls"),puts("Your Language?/你的语言?"),lanf=0;
while(1)
{
print(2,0," ");
if(lanf==1) puts(" 中文 ");else color(112),puts(" 中文 "),color(7);
print(3,0," ");
if(lanf==0) puts(" English ");else color(112),puts(" English"),color(7);
if(KEY_DOWN(13)||KEY_DOWN(108)) break;
if(KEY_DOWN(87)||KEY_DOWN(83)||KEY_DOWN(38)||KEY_DOWN(40)||KEY_DOWN(104)||KEY_DOWN(101)) lanf=1-lanf;
Sleep(100);
}
int t=0;
Sleep(200),system("cls");
if(lanf==1) puts("Do you know the rule of the game?");
if(lanf==0) puts("你知道此游戏的规则吗\n");
while(1)
{
if(lanf==1)
{
print(2,0," ");
if(t==1) puts(" Yes ");else color(112),puts(" Yes "),color(7);
print(3,0," ");
if(t==0) puts(" No ");else color(112),puts(" No "),color(7);
}
if(lanf==0)
{
print(2,0," ");
if(t==1) puts(" 是 ");else color(112),puts(" 是 "),color(7);
print(3,0," ");
if(t==0) puts(" 否 ");else color(112),puts(" 否 "),color(7);
}
if(KEY_DOWN(13)||KEY_DOWN(108)) break;
if(KEY_DOWN(87)||KEY_DOWN(83)||KEY_DOWN(38)||KEY_DOWN(40)||KEY_DOWN(104)||KEY_DOWN(101)) t=1-t;
Sleep(100);
}
if(t==1)
{
Sleep(200),system("cls");
if(lanf==1)
{
puts("Before playing this game please read these carefully:\n"),Sleep(500);
puts("\n1. You'll be asked to input 7 game parameters before the game starts.\n"),Sleep(500);
puts("\n2. The symbol '!' is the Upgrade Roadblock. If you didn't shut it off before it get to the botton, your bloods will -1!\n"),Sleep(500);
puts("\n3. The symbol '&' is the obstacle which means you cannot let '*' touch the '#'.\n"),Sleep(500);
puts("\n4. The symbol '+' is the midic which means you can recover by touching the '!'.\n"),Sleep(500);
puts("\n5. At first, you will have some bloods. You must go further before you died!\n"),Sleep(500);
puts("\n6. If you press 'Q', the bullets will be fired. But the bullets was limited, it only can be increased by touching '+'\n"),Sleep(500);
puts("\n7. If you press 'Space', the system will give you a sighting telescope. But it can't earse the Roadblock\n"),Sleep(500);
puts("\n\nHappy Games...... QwQ\n"),Sleep(500);
puts("PLEASE PRESS 'Enter' TO CONTINUE");
}
if(lanf==0)
{
puts("在玩之前,请认真阅读以下提示:\n"),Sleep(500);
puts("\n1. 你将输入7个游戏参数。\n"),Sleep(500);
puts("\n2. 符号'!'是恐怖障碍物。如果你没有在它到达底部之前射掉它,你将会扣一滴血!\n"),Sleep(500);
puts("\n3. 符号'&'是障碍物,一旦你自己('*')碰到障碍物,生命值将会掉1个单位!\n"),Sleep(500);
puts("\n4. 符号'+'可以给你补血,每次你自己('*')碰到'!'会恢复1个单位!\n"),Sleep(500);
puts("\n5. 一开始你会有n个单位的生命,你必须在生命值耗完之前获得最高的分数!\n"),Sleep(500);
puts("\n6. 如果你按下'Q',将会发射子弹。但是子弹的数量是有限的,你有你碰到了'+'才会回血!\n"),Sleep(500);
puts("\n7. 如果你按下'空格',将会调出瞄准镜。但是瞄准镜并不能清除障碍物!\n"),Sleep(500);
puts("\n\nHappy Games...... QwQ\n"),Sleep(500);
puts("请按回车键以继续!");
}
}
while(1) {if(KEY_DOWN(13)) break;}
system("cls");
}
inline void choose()
{
int t=5;
Sleep(200);
if(lanf==1) puts("Please choose the Difficulty: \n");
if(lanf==0) puts("请选择游戏难度:\n");
while(1)
{
if(lanf==1)
{
print(2,0," ");
if(t!=5) puts(" Quick: No bullets ");else color(112),puts(" Quick: No bullets "),color(7);
print(3,0," ");
if(t!=4) puts(" Peaceful: Please play within 'int'! ");else color(112),puts(" Peaceful: Please play within 'int'! "),color(7);
print(4,0," ");
if(t!=3) puts(" Easy: Suitable for the Freshmen ");else color(112),puts(" Easy: Suitable for the Freshmen! "),color(7);
print(5,0," ");
if(t!=2) puts(" Middle: Time to race! ");else color(112),puts(" Middle: Time to race! "),color(7);
print(6,0," ");
if(t!=1) puts(" Hard: Impossible to get 2500! ");else color(112),puts(" Hard: Impossible to get 2500! "),color(7);
print(7,0," ");
if(t!=0) puts(" User-Defined ");else color(112),puts(" User-Defined "),color(7);
}
if(lanf==0)
{
print(2,0," ");
if(t!=5) puts(" 手速 [没有子弹!] ");else color(112),puts(" 手速 [没有子弹!] "),color(7);
print(3,0," ");
if(t!=4) puts(" 和平 [不要把int玩爆呀!] ");else color(112),puts(" 和平 [不要把int玩爆呀!] "),color(7);
print(4,0," ");
if(t!=3) puts(" 简单 [新手建议!] ");else color(112),puts(" 简单 [新手建议!] "),color(7);
print(5,0," ");
if(t!=2) puts(" 普通 [是时候比速度了!] ");else color(112),puts(" 普通 [是时候比速度了!] "),color(7);
print(6,0," ");
if(t!=1) puts(" 困难 [2500? 不可能的!] ");else color(112),puts(" 困难 [2500? 不可能的!] "),color(7);
print(7,0," ");
if(t!=0) puts(" 用户自定义 ");else color(112),puts(" 用户自定义 "),color(7);
}
if(KEY_DOWN(13)||KEY_DOWN(108)) break;
if(KEY_DOWN(38)||KEY_DOWN(87)||KEY_DOWN(104)) t=(t+1)%6;
if(KEY_DOWN(40)||KEY_DOWN(83)||KEY_DOWN(98)) t=(t+5)%6;
Sleep(100);
}
Nan=40;
if(t==5) {N=30,Numk=75,Numl=2,Numd=0,Hp=1,Bebc=Bebh=Bebb=0,bulc=bulh=bulb=0,squ=14;return;}
if(t==4) {N=30,Numk=15,Numl=20,Numd=1,Hp=20,Bebc=500,Bebh=100,Bebb=100,bulc=bulh=bulb=1,squ=10;return;}
if(t==3) {N=30,Numk=25,Numl=10,Numd=1,Hp=15,Bebc=100,Bebh=20,Bebb=20,bulc=bulh=bulb=1,squ=7;return;}
if(t==2) {N=30,Numk=40,Numl=8,Numd=1,Hp=15,Bebc=20,Bebh=4,Bebb=2,bulc=bulh=bulb=1,squ=5;return;}
if(t==1) {N=30,Numk=40,Numl=5,Numd=2,Hp=20,Bebc=10,Bebh=Bebb=0,bulc=bulh=bulb=1,squ=3;return;}
system("cls"),t=0,Sleep(100);
if(lanf==1) puts("Do you want to be able to shoot the bullets?");
if(lanf==0) puts("请选择你能否发射狙击枪子弹!");
while(1)
{
if(lanf==1)
{
print(2,0," ");
if(t==1) puts(" Yes ");else color(112),puts(" Yes "),color(7);
print(3,0," ");
if(t==0) puts(" No ");else color(112),puts(" No "),color(7);
}
if(lanf==0)
{
print(2,0," ");
if(t==1) puts(" 是 ");else color(112),puts(" 是 "),color(7);
print(3,0," ");
if(t==0) puts(" 否 ");else color(112),puts(" 否 "),color(7);
}
if(KEY_DOWN(13)||KEY_DOWN(108)) break;
if(KEY_DOWN(87)||KEY_DOWN(83)||KEY_DOWN(38)||KEY_DOWN(40)||KEY_DOWN(104)||KEY_DOWN(101)) t=1-t;
Sleep(100);
}
bulc=1-t,t=0,system("cls"),Sleep(100);
if(lanf==1) puts("Do you want to be able to shoot the bullets?");
if(lanf==0) puts("请选择你能否发射高射炮子弹!");
while(1)
{
if(lanf==1)
{
print(2,0," ");
if(t==1) puts(" Yes ");else color(112),puts(" Yes "),color(7);
print(3,0," ");
if(t==0) puts(" No ");else color(112),puts(" No "),color(7);
}
if(lanf==0)
{
print(2,0," ");
if(t==1) puts(" 是 ");else color(112),puts(" 是 "),color(7);
print(3,0," ");
if(t==0) puts(" 否 ");else color(112),puts(" 否 "),color(7);
}
if(KEY_DOWN(13)||KEY_DOWN(108)) break;
if(KEY_DOWN(87)||KEY_DOWN(83)||KEY_DOWN(38)||KEY_DOWN(40)||KEY_DOWN(104)||KEY_DOWN(101)) t=1-t;
Sleep(100);
}
bulh=1-t,t=0,system("cls"),Sleep(100);
if(lanf==1) puts("Do you want to be able to shoot the bullets?");
if(lanf==0) puts("请选择你能否发射大炮子弹!");
while(1)
{
if(lanf==1)
{
print(2,0," ");
if(t==1) puts(" Yes ");else color(112),puts(" Yes "),color(7);
print(3,0," ");
if(t==0) puts(" No ");else color(112),puts(" No "),color(7);
}
if(lanf==0)
{
print(2,0," ");
if(t==1) puts(" 是 ");else color(112),puts(" 是 "),color(7);
print(3,0," ");
if(t==0) puts(" 否 ");else color(112),puts(" 否 "),color(7);
}
if(KEY_DOWN(13)||KEY_DOWN(108)) break;
if(KEY_DOWN(87)||KEY_DOWN(83)||KEY_DOWN(38)||KEY_DOWN(40)||KEY_DOWN(104)||KEY_DOWN(101)) t=1-t;
Sleep(100);
}
bulb=1-t,t=0,system("cls"),Sleep(100);
if(lanf==1) puts("Please choose your pattern\nIf you choose Pattern 1, you can go up and down, while Pattern 2 can't!\n");
if(lanf==0) puts("请选择你的模式:\n如果你选择了模式1,你可以上下左右移动;而模式2只能左右移动!\n");
while(1)
{
if(lanf==1)
{
print(3,0," ");
if(t==1) puts(" Pattern 1:←↑↓→ ");else color(112),puts(" Pattern 1:←↑↓→ "),color(7);
print(4,0," ");
if(t==0) puts(" Pattern 2:←→ ");else color(112),puts(" Pattern 2:←→ "),color(7);
}
if(lanf==0)
{
print(3,0," ");
if(t==1) puts(" 模式1:←↑↓→ ");else color(112),puts(" 模式1:←↑↓→ "),color(7);
print(4,0," ");
if(t==0) puts(" 模式2:←→ ");else color(112),puts(" 模式2:←→ "),color(7);
}
if(KEY_DOWN(13)||KEY_DOWN(108)) break;
if(KEY_DOWN(87)||KEY_DOWN(83)||KEY_DOWN(38)||KEY_DOWN(40)||KEY_DOWN(104)||KEY_DOWN(101)) t=1-t;
Sleep(100);
}
udf=t;
system("cls"),t=-1;
while(t<3||t>35)
{
if(lanf==1) puts("Please Input an Integer: The Size of the Game(from 3 to 35):\n");
if(lanf==0) puts("请输入一个整数:游戏界面的大小(3 ~ 35)\n");
print(2,0," "),t=read(),N=t,system("cls");
}
system("cls"),t=-1;
while(t<1||90<t)
{
if(lanf==1) puts("Please Input an Integer: The Number of Bullets(from 1 to 90):\n");
if(lanf==0) puts("请输入一个整数:障碍物的数量(1 ~ 90)\n");
print(2,0," "),t=read(),Numk=t,system("cls");
}
system("cls"),t=-1;
while(t<1||90<t)
{
if(lanf==1) puts("Please Input an Integer: The Number of Backpack(from 1 to 90):\n");
if(lanf==0) puts("请输入一个整数:回血包的数量(1 ~ 90)\n");
print(2,0," "),t=read(),Numl=t,system("cls");
}
system("cls"),t=-1;
while(t<1||90<t)
{
if(lanf==1) puts("Please Input an Integer: The Number of Upgrade Bullets(from 1 to 90):\n");
if(lanf==0) puts("请输入一个整数:恐怖障碍物的数量(1 ~ 90)\n");
print(2,0," "),t=read(),Numd=t,system("cls");
}
system("cls"),t=-1;
while(t<1||t>100)
{
if(lanf==1) puts("Please Imput an Integer: The Total HP of You(from 1 to 100):\n");
if(lanf==0) puts("请输入一个整数:初始生命值(1 ~ 100)\n");
print(2,0," "),t=read(),Hp=t,system("cls");
}
system("cls"),t=-1;
while(t<1||t>100)
{
if(lanf==1) puts("Please Input an Integer: The Bullet You Have at First(from 1 to 100):\n");
if(lanf==0) puts("请输入一个整数:初始狙击枪子弹数(1 ~ 100)\n");
print(2,0," "),t=read(),Bebc=t,system("cls");
}
system("cls"),t=-1;
while(t<1||t>100)
{
if(lanf==1) puts("Please Input an Integer: The Bullet You Have at First(from 1 to 100):\n");
if(lanf==0) puts("请输入一个整数:初始高射炮子弹数(1 ~ 100)\n");
print(2,0," "),t=read(),Bebh=t,system("cls");
}
system("cls"),t=-1;
while(t<1||t>100)
{
if(lanf==1) puts("Please Input an Integer: The Bullet You Have at First(from 1 to 100):\n");
if(lanf==0) puts("请输入一个整数:初始大炮子弹数(1 ~ 100)\n");
print(2,0," "),t=read(),Bebb=t,system("cls");
}
}
inline void work()
{
choose(),init();
int die=1,luck=1,dowm=1,t=1;
while(1)
{
for(int i=1;i<=Numk;i++) (k[i].vf+=1)%=k[i].bv;
for(int i=1;i<=Numl;i++) (l[i].vf+=1)%=l[i].bv;
for(int i=1;i<=Numd;i++) (d[i].vf+=1)%=d[i].bv;
for(int i=1;i<=Numk;i++) if(k[i].y<=N&&k[i].x>0&&k[i].vf==0) print(k[i].x,k[i].y," ");
for(int i=1;i<=Numl;i++) if(l[i].y<=N&&l[i].x>0&&l[i].vf==0) print(l[i].x,l[i].y," ");
for(int i=1;i<=Numd;i++) if(d[i].y<=N&&d[i].x>0&&d[i].vf==0) print(d[i].x,d[i].y," ");t=0;
if(!udf&&(KEY_DOWN(87)||KEY_DOWN(38)||KEY_DOWN(104))) t=1;
if(!udf&&(KEY_DOWN(83)||KEY_DOWN(40)||KEY_DOWN(101))) t=1;
if(KEY_DOWN(65)||KEY_DOWN(37)||KEY_DOWN(100)) t=1;
if(KEY_DOWN(68)||KEY_DOWN(39)||KEY_DOWN(102)) t=1;
if(t) print(x,y," ");move_thi(),t=move_peo();if(t) print(x,y,"*");
for(int i=1;i<=Numk;i++) if(k[i].y<=N&&k[i].x>0&&k[i].vf==0) color(4),print(k[i].x,k[i].y,"&"),color(7);
for(int i=1;i<=Numl;i++) if(l[i].y<=N&&l[i].x>0&&l[i].vf==0) color(2),print(l[i].x,l[i].y,"+"),color(7);
for(int i=1;i<=Numd;i++) if(d[i].y<=N&&d[i].x>0&&d[i].vf==0) color(14),print(d[i].x,d[i].y,"!"),color(7);
die=check_die(),luck=check_luck(),dowm=check_dowm();
if(!luck) print(hp/30+17,N+2+hp%30,"-"),hp++,score+=20,(numc+=rand()%10+5)*=bulc,(numh+=rand()%5+5)*=bulh,(numb+=rand()%5)*=bulb;
if(!die) print((hp-1)/30+17,N+2+(hp-1)%30," "),hp--,score+=10;
if(!dowm) score+=50;
if(!die||!luck||!dowm) print(x,y,"*");
if(hp<=0) return;
int xx=0,xw=1,yy=0,_90=0,_88=0,_67=0,_32=0;
for(int i=1;i<=Numk;i++) if(k[i].y==y&&xx<k[i].x&&k[i].x<x) xx=k[i].x,yy=k[i].y,xw=i;
for(int i=1;i<=Numl;i++) if(l[i].y==y&&xx<l[i].x&&l[i].x<x) xx=l[i].x,yy=l[i].y,xw=i+Numk;
for(int i=1;i<=Numd;i++) if(d[i].y==y&&xx<d[i].x&&d[i].x<x) xx=d[i].x,yy=d[i].y,xw=i+Numk+Numl;
if(KEY_DOWN(32)) {for(int i=x-1;i>xx;i--) print(i,y,"|");_32=1,color(112),print(15,N+8," Space "),color(7);}else print(15,N+8," Space ");
if(KEY_DOWN(90)&&numc>0)
{
numc--,color(112),print(13,N+9," Z "),color(7),_90=1;
if(xx!=0&&numc>0) for(int i=x-1;i>=xx;i--) print(i,y,"|");
}
else print(13,N+9," Z ");
if(KEY_DOWN(88)&&numh>0)
{
numh--,color(112),print(13,N+12," X "),color(9),_88=1;
if(xx!=0&&numc>0) for(int i=x-1;i>=1;i--) print(i,y,"|");
color(7);
}
else print(13,N+12," X ");
if(KEY_DOWN(67)&&numb>0)
{
numb--,color(112),print(13,N+15," C "),color(12),_67=1;
if(xx!=0&&numc>0) for(int i=x-1;i>=xx;i--) print(i,y,"|");
color(7);
}
else print(13,N+15," C ");
for(int i=N+28;i<=N+35;i++) print(1,i," ");
for(int i=N+28;i<=N+35;i++) print(3,i," ");
for(int i=N+33;i<=N+38;i++) print(5,i," ");
for(int i=N+31;i<=N+36;i++) print(7,i," ");
for(int i=N+30;i<=N+36;i++) print(9,i," ");
print(1,N+29,":"),printf("%d",hp);
print(3,N+29,":"),printf("%d",score);
print(5,N+33,":"),printf("%d",numc);
print(7,N+31,":"),printf("%d",numh);
print(9,N+30,":"),printf("%d",numb);
Sleep(Nan);
if(_32==1) {for(int i=x-1;i>xx;i--) print(i,y," ");}
if(xx!=0&&_90)
{
for(int i=x;i>=xx;i--) print(i,y," ");
if(xw<=Numk) k[xw].init(),k[xw].x=0,score++;
else if(xw<=Numk+Numl) l[xw-Numk].init(),l[xw-Numk].x=0,score+=20;
else d[xw-Numk-Numl].init(),d[xw-Numk-Numl].x=0,score++,(numc+=rand()%10+5)*=bulc,(numh+=rand()%5+5)*=bulh,(numb+=rand()%5)*=bulb;
}
if(_88)
{
for(int i=x;i>=1;i--) print(i,y," ");
for(int i=1;i<=Numk;i++) if(k[i].y==y) k[i].init(),k[i].x=0,score++;
for(int i=1;i<=Numl;i++) if(l[i].y==y) l[i].init(),l[i].x=0,score+=20;
for(int i=1;i<=Numd;i++) if(d[i].y==y) d[i].init(),d[i].x=0,score++,(numc+=rand()%10+5)*=bulc,(numh+=rand()%5+5)*=bulh,(numb+=rand()%5)*=bulb;
}
if(xx!=0&&_67)
{
for(int i=x;i>=1;i--) print(i,y," ");
for(int i=1;i<=Numk;i++)
if(k[i].y>=yy-squ&&k[i].y<=yy+squ&&k[i].x>=xx-squ&&k[i].x<=xx+squ&&k[i].x>=1&&k[i].y<=N)
print(k[i].x,k[i].y," "),k[i].init(),k[i].x=0,score++;
for(int i=1;i<=Numl;i++)
if(l[i].y>=yy-squ&&l[i].y<=yy+squ&&l[i].x>=xx-squ&&l[i].x<=xx+squ&&l[i].x>=1&&k[i].y<=N)
print(l[i].x,l[i].y," "),l[i].init(),l[i].x=0,score++;
for(int i=1;i<=Numd;i++)
if(d[i].y>=yy-squ&&d[i].y<=yy+squ&&d[i].x>=xx-squ&&d[i].x<=xx+squ&&d[i].x>=1&&k[i].y<=N)
print(d[i].x,d[i].y," "),d[i].init(),d[i].x=0,score++,(numc+=rand()%10+5)*=bulc,(numh+=rand()%5+5)*=bulh,(numb+=rand()%5)*=bulb;
}
score++;
}
}
int main()
{
Begin();
while(1)
{
work(),die();int t=0;
while(1)
{
if(lanf==1)
{
print(5,0," ");
if(t==1) puts(" Yes ");else color(112),puts(" Yes "),color(7);
print(6,0," ");
if(t==0) puts(" No ");else color(112),puts(" No "),color(7);
}
if(lanf==0)
{
print(5,0," ");
if(t==1) puts(" 是 ");else color(112),puts(" 是 "),color(7);
print(6,0," ");
if(t==0) puts(" 否 ");else color(112),puts(" 否 "),color(7);
}
if(KEY_DOWN(13)||KEY_DOWN(108)) break;
if(KEY_DOWN(87)||KEY_DOWN(83)||KEY_DOWN(38)||KEY_DOWN(40)||KEY_DOWN(104)||KEY_DOWN(101)) t=1-t;
Sleep(100);
}
if(t==1) return 0;
system("cls");
}
}