2 #if defined(TARGET_X11)
4 /* second part of synchro.
6 * game logic for monsters.
8 * one giant switch statement to process everything.
10 * this whole thing is a major bottleneck. the compiler must use registers. compilers suck.
18 extern unsigned int screen_x;
19 extern unsigned int screen_y;
23 register unsigned int x = 0;
24 register unsigned int y = 1;
25 register unsigned long random = Random;
26 register unsigned short *cave_cache = Cave[y]; /* might be a win */
27 unsigned long score = 0;
29 unsigned int temp = 0; /* initialized to make compilers happy */
30 unsigned int left = screen_x / TILEX; /* only needed for sounds */
31 unsigned int top = screen_y / TILEY;
32 unsigned int dx; /* only needed to find closest player */
35 #define RANDOM (random = random << 31 | random >> 1)
36 #define PLAY(sample) { if((unsigned int)(y - top) <= 12 && (unsigned int)(x - left) <= 20) play[sample] = 1; }
39 switch(cave_cache[++x]) {
42 /* ---------------------------------------------------------------------- */
45 switch(Cave[y][x+1]) {
58 Cave[y][x] = Ystone_eB;
59 Cave[y][x+1] = Ystone_e;
61 Next[y][x+1] = Xstone_pause;
65 switch(Cave[y][x-1]) {
78 Cave[y][x] = Ystone_wB;
79 Cave[y][x-1] = Ystone_w;
81 Next[y][x-1] = Xstone_pause;
85 switch(Cave[y][x+1]) {
99 Cave[y][x+1] = Ynut_e;
101 Next[y][x+1] = Xnut_pause;
105 switch(Cave[y][x-1]) {
118 Cave[y][x] = Ynut_wB;
119 Cave[y][x-1] = Ynut_w;
121 Next[y][x-1] = Xnut_pause;
124 case Xspring_force_e:
125 switch(Cave[y][x+1]) {
134 Cave[y][x] = Xspring;
135 Next[y][x] = Xspring;
138 Cave[y][x] = Yspring_eB;
139 Cave[y][x+1] = Yspring_e;
142 Next[y][x+1] = Xspring_e;
144 Next[y][x+1] = Xspring_pause;
148 case Xspring_force_w:
149 switch(Cave[y][x-1]) {
158 Cave[y][x] = Xspring;
159 Next[y][x] = Xspring;
162 Cave[y][x] = Yspring_wB;
163 Cave[y][x-1] = Yspring_w;
166 Next[y][x-1] = Xspring_w;
168 Next[y][x-1] = Xspring_pause;
172 case Xemerald_force_e:
173 switch(Cave[y][x+1]) {
182 Cave[y][x] = Xemerald;
183 Next[y][x] = Xemerald;
186 Cave[y][x] = Yemerald_eB;
187 Cave[y][x+1] = Yemerald_e;
189 Next[y][x+1] = Xemerald_pause;
192 case Xemerald_force_w:
193 switch(Cave[y][x-1]) {
202 Cave[y][x] = Xemerald;
203 Next[y][x] = Xemerald;
206 Cave[y][x] = Yemerald_wB;
207 Cave[y][x-1] = Yemerald_w;
209 Next[y][x-1] = Xemerald_pause;
212 case Xdiamond_force_e:
213 switch(Cave[y][x+1]) {
222 Cave[y][x] = Xdiamond;
223 Next[y][x] = Xdiamond;
226 Cave[y][x] = Ydiamond_eB;
227 Cave[y][x+1] = Ydiamond_e;
229 Next[y][x+1] = Xdiamond_pause;
232 case Xdiamond_force_w:
233 switch(Cave[y][x-1]) {
242 Cave[y][x] = Xdiamond;
243 Next[y][x] = Xdiamond;
246 Cave[y][x] = Ydiamond_wB;
247 Cave[y][x-1] = Ydiamond_w;
249 Next[y][x-1] = Xdiamond_pause;
253 switch(Cave[y][x+1]) {
266 Cave[y][x] = Ybomb_eB;
267 Cave[y][x+1] = Ybomb_e;
269 Next[y][x+1] = Xbomb_pause;
273 switch(Cave[y][x-1]) {
286 Cave[y][x] = Ybomb_wB;
287 Cave[y][x-1] = Ybomb_w;
289 Next[y][x-1] = Xbomb_pause;
293 /* ---------------------------------------------------------------------- */
295 switch(Cave[y+1][x]) {
304 Cave[y][x] = Ystone_sB;
305 if(Cave[y][x+1] == Xblank) Cave[y][x+1] = Yacid_splash_eB;
306 if(Cave[y][x-1] == Xblank) Cave[y][x-1] = Yacid_splash_wB;
311 case Yacid_splash_eB:
312 case Yacid_splash_wB:
315 Cave[y][x] = Ystone_sB;
316 Cave[y+1][x] = Ystone_s;
318 Next[y+1][x] = Xstone_fall;
321 Cave[y][x] = Xsand_stonein_1;
322 Cave[y+1][x] = Xsand_sandstone_1;
323 Next[y][x] = Xsand_stonein_2;
324 Next[y+1][x] = Xsand_sandstone_2;
373 if(tab_blank[Cave[y][x+1]] && tab_acid[Cave[y+1][x+1]]) {
374 Cave[y][x] = Ystone_eB;
375 Cave[y][x+1] = Ystone_e;
377 Next[y][x+1] = Xstone_pause;
380 if(tab_blank[Cave[y][x-1]] && tab_acid[Cave[y+1][x-1]]) {
381 Cave[y][x] = Ystone_wB;
382 Cave[y][x-1] = Ystone_w;
384 Next[y][x-1] = Xstone_pause;
388 if(tab_blank[Cave[y][x-1]] && tab_acid[Cave[y+1][x-1]]) {
389 Cave[y][x] = Ystone_wB;
390 Cave[y][x-1] = Ystone_w;
392 Next[y][x-1] = Xstone_pause;
395 if(tab_blank[Cave[y][x+1]] && tab_acid[Cave[y+1][x+1]]) {
396 Cave[y][x] = Ystone_eB;
397 Cave[y][x+1] = Ystone_e;
399 Next[y][x+1] = Xstone_pause;
406 /* ---------------------------------------------------------------------- */
408 switch(Cave[y+1][x]) {
417 Cave[y][x] = Ystone_sB;
418 if(Cave[y][x+1] == Xblank) Cave[y][x+1] = Yacid_splash_eB;
419 if(Cave[y][x-1] == Xblank) Cave[y][x-1] = Yacid_splash_wB;
424 case Yacid_splash_eB:
425 case Yacid_splash_wB:
426 Cave[y][x] = Ystone_sB;
427 Cave[y+1][x] = Ystone_s;
429 Next[y+1][x] = Xstone_fall;
436 /* ---------------------------------------------------------------------- */
438 switch(Cave[y+1][x]) {
447 Cave[y][x] = Ystone_sB;
448 if(Cave[y][x+1] == Xblank) Cave[y][x+1] = Yacid_splash_eB;
449 if(Cave[y][x-1] == Xblank) Cave[y][x-1] = Yacid_splash_wB;
454 case Yacid_splash_eB:
455 case Yacid_splash_wB:
457 Cave[y][x] = Ystone_sB;
458 Cave[y+1][x] = Ystone_s;
460 Next[y+1][x] = Xstone_fall;
464 Cave[y+1][x] = Yemerald_stone;
466 Next[y+1][x] = Xemerald;
467 play[SAMPLE_crack] = 1;
468 score += lev.nut_score;
478 Cave[y][x] = Ystone_sB;
479 Cave[y+1][x] = Ybug_stone;
480 Next[y+1][x] = Znormal;
481 Boom[y][x-1] = Xemerald;
482 Boom[y][x] = Xemerald;
483 Boom[y][x+1] = Xemerald;
484 Boom[y+1][x-1] = Xemerald;
485 Boom[y+1][x] = Xdiamond;
486 Boom[y+1][x+1] = Xemerald;
487 Boom[y+2][x-1] = Xemerald;
488 Boom[y+2][x] = Xemerald;
489 Boom[y+2][x+1] = Xemerald;
490 score += lev.bug_score;
500 Cave[y][x] = Ystone_sB;
501 Cave[y+1][x] = Ytank_stone;
502 Next[y+1][x] = Znormal;
503 Boom[y][x-1] = Xblank;
505 Boom[y][x+1] = Xblank;
506 Boom[y+1][x-1] = Xblank;
507 Boom[y+1][x] = Xblank;
508 Boom[y+1][x+1] = Xblank;
509 Boom[y+2][x-1] = Xblank;
510 Boom[y+2][x] = Xblank;
511 Boom[y+2][x+1] = Xblank;
512 score += lev.tank_score;
516 switch(Cave[y+1][x+1]) {
518 case Yacid_splash_eB:
519 case Yacid_splash_wB:
522 Cave[y+1][x] = Xspring_e; break;
524 Cave[y+1][x] = Xspring_w; break;
527 switch(Cave[y+1][x-1]) {
529 case Yacid_splash_eB:
530 case Yacid_splash_wB:
533 Cave[y+1][x] = Xspring_w; break;
535 Cave[y+1][x] = Xspring_e; break;
544 Cave[y][x] = Ystone_sB;
545 Cave[y+1][x] = Yeater_stone;
546 Next[y+1][x] = Znormal;
547 Boom[y][x-1] = lev.eater_array[lev.eater_pos][0];
548 Boom[y][x] = lev.eater_array[lev.eater_pos][1];
549 Boom[y][x+1] = lev.eater_array[lev.eater_pos][2];
550 Boom[y+1][x-1] = lev.eater_array[lev.eater_pos][3];
551 Boom[y+1][x] = lev.eater_array[lev.eater_pos][4];
552 Boom[y+1][x+1] = lev.eater_array[lev.eater_pos][5];
553 Boom[y+2][x-1] = lev.eater_array[lev.eater_pos][6];
554 Boom[y+2][x] = lev.eater_array[lev.eater_pos][7];
555 Boom[y+2][x+1] = lev.eater_array[lev.eater_pos][8];
556 lev.eater_pos = (lev.eater_pos + 1) & 7;
557 score += lev.eater_score;
561 Cave[y][x] = Ystone_sB;
562 Cave[y+1][x] = Yalien_stone;
563 Next[y+1][x] = Znormal;
564 Boom[y][x-1] = Xblank;
566 Boom[y][x+1] = Xblank;
567 Boom[y+1][x-1] = Xblank;
568 Boom[y+1][x] = Xblank;
569 Boom[y+1][x+1] = Xblank;
570 Boom[y+2][x-1] = Xblank;
571 Boom[y+2][x] = Xblank;
572 Boom[y+2][x+1] = Xblank;
573 score += lev.alien_score;
577 switch(Cave[y+2][x]) {
579 case Yacid_splash_eB:
580 case Yacid_splash_wB:
628 Cave[y][x] = Ystone_sB;
629 Cave[y+1][x] = Ydiamond_stone;
631 Next[y+1][x] = Xstone_pause;
632 play[SAMPLE_squash] = 1;
636 Cave[y+1][x] = Ybomb_eat;
637 Next[y+1][x] = Znormal;
638 Boom[y][x-1] = Xblank;
640 Boom[y][x+1] = Xblank;
641 Boom[y+1][x-1] = Xblank;
642 Boom[y+1][x] = Xblank;
643 Boom[y+1][x+1] = Xblank;
644 Boom[y+2][x-1] = Xblank;
645 Boom[y+2][x] = Xblank;
646 Boom[y+2][x+1] = Xblank;
649 if(lev.wonderwall_time) {
650 lev.wonderwall_state = 1;
651 Cave[y][x] = Ystone_sB;
652 if(tab_blank[Cave[y+2][x]]) {
653 Cave[y+2][x] = Yemerald_s;
654 Next[y+2][x] = Xemerald_fall;
657 play[SAMPLE_squash] = 1;
666 /* ---------------------------------------------------------------------- */
668 switch(Cave[y+1][x]) {
677 Cave[y][x] = Ynut_sB;
678 if(Cave[y][x+1] == Xblank) Cave[y][x+1] = Yacid_splash_eB;
679 if(Cave[y][x-1] == Xblank) Cave[y][x-1] = Yacid_splash_wB;
684 case Yacid_splash_eB:
685 case Yacid_splash_wB:
686 Cave[y][x] = Ynut_sB;
687 Cave[y+1][x] = Ynut_s;
689 Next[y+1][x] = Xnut_fall;
736 if(tab_blank[Cave[y][x+1]] && tab_acid[Cave[y+1][x+1]]) {
737 Cave[y][x] = Ynut_eB;
738 Cave[y][x+1] = Ynut_e;
740 Next[y][x+1] = Xnut_pause;
743 if(tab_blank[Cave[y][x-1]] && tab_acid[Cave[y+1][x-1]]) {
744 Cave[y][x] = Ynut_wB;
745 Cave[y][x-1] = Ynut_w;
747 Next[y][x-1] = Xnut_pause;
751 if(tab_blank[Cave[y][x-1]] && tab_acid[Cave[y+1][x-1]]) {
752 Cave[y][x] = Ynut_wB;
753 Cave[y][x-1] = Ynut_w;
755 Next[y][x-1] = Xnut_pause;
758 if(tab_blank[Cave[y][x+1]] && tab_acid[Cave[y+1][x+1]]) {
759 Cave[y][x] = Ynut_eB;
760 Cave[y][x+1] = Ynut_e;
762 Next[y][x+1] = Xnut_pause;
769 /* ---------------------------------------------------------------------- */
771 switch(Cave[y+1][x]) {
780 Cave[y][x] = Ynut_sB;
781 if(Cave[y][x+1] == Xblank) Cave[y][x+1] = Yacid_splash_eB;
782 if(Cave[y][x-1] == Xblank) Cave[y][x-1] = Yacid_splash_wB;
787 case Yacid_splash_eB:
788 case Yacid_splash_wB:
789 Cave[y][x] = Ynut_sB;
790 Cave[y+1][x] = Ynut_s;
792 Next[y+1][x] = Xnut_fall;
799 /* ---------------------------------------------------------------------- */
801 switch(Cave[y+1][x]) {
810 Cave[y][x] = Ynut_sB;
811 if(Cave[y][x+1] == Xblank) Cave[y][x+1] = Yacid_splash_eB;
812 if(Cave[y][x-1] == Xblank) Cave[y][x-1] = Yacid_splash_wB;
817 case Yacid_splash_eB:
818 case Yacid_splash_wB:
820 Cave[y][x] = Ynut_sB;
821 Cave[y+1][x] = Ynut_s;
823 Next[y+1][x] = Xnut_fall;
831 /* ---------------------------------------------------------------------- */
833 if(tab_ameuba[Cave[y-1][x]] || tab_ameuba[Cave[y][x+1]] || tab_ameuba[Cave[y+1][x]] || tab_ameuba[Cave[y][x-1]]) goto bug_boom;
834 switch(Cave[y][x+1]) {
836 case Yacid_splash_eB:
837 case Yacid_splash_wB:
849 Cave[y][x] = Ybug_n_e;
850 Next[y][x] = Xbug_goe;
857 if(tab_ameuba[Cave[y-1][x]] || tab_ameuba[Cave[y][x+1]] || tab_ameuba[Cave[y+1][x]] || tab_ameuba[Cave[y][x-1]]) goto bug_boom;
859 switch(Cave[y-1][x]) {
868 Cave[y][x] = Ybug_nB;
869 if(Cave[y-2][x+1] == Xblank) Cave[y-2][x+1] = Yacid_splash_eB;
870 if(Cave[y-2][x-1] == Xblank) Cave[y-2][x-1] = Yacid_splash_wB;
875 case Yacid_splash_eB:
876 case Yacid_splash_wB:
880 Cave[y][x] = Ybug_nB;
881 Cave[y-1][x] = Ybug_n;
883 Next[y-1][x] = Xbug_n;
887 Cave[y][x] = Ybug_n_w;
888 Next[y][x] = Xbug_gow;
892 /* ---------------------------------------------------------------------- */
894 if(tab_ameuba[Cave[y-1][x]] || tab_ameuba[Cave[y][x+1]] || tab_ameuba[Cave[y+1][x]] || tab_ameuba[Cave[y][x-1]]) goto bug_boom;
895 switch(Cave[y+1][x]) {
897 case Yacid_splash_eB:
898 case Yacid_splash_wB:
910 Cave[y][x] = Ybug_e_s;
911 Next[y][x] = Xbug_gos;
918 if(tab_ameuba[Cave[y-1][x]] || tab_ameuba[Cave[y][x+1]] || tab_ameuba[Cave[y+1][x]] || tab_ameuba[Cave[y][x-1]]) goto bug_boom;
920 switch(Cave[y][x+1]) {
929 Cave[y][x] = Ybug_eB;
930 if(Cave[y-1][x+2] == Xblank) Cave[y-1][x+2] = Yacid_splash_eB;
931 if(Cave[y-1][x] == Xblank) Cave[y-1][x] = Yacid_splash_wB;
936 case Yacid_splash_eB:
937 case Yacid_splash_wB:
941 Cave[y][x] = Ybug_eB;
942 Cave[y][x+1] = Ybug_e;
944 Next[y][x+1] = Xbug_e;
948 Cave[y][x] = Ybug_e_n;
949 Next[y][x] = Xbug_gon;
953 /* ---------------------------------------------------------------------- */
955 if(tab_ameuba[Cave[y-1][x]] || tab_ameuba[Cave[y][x+1]] || tab_ameuba[Cave[y+1][x]] || tab_ameuba[Cave[y][x-1]]) goto bug_boom;
956 switch(Cave[y][x-1]) {
958 case Yacid_splash_eB:
959 case Yacid_splash_wB:
971 Cave[y][x] = Ybug_s_w;
972 Next[y][x] = Xbug_gow;
979 if(tab_ameuba[Cave[y-1][x]] || tab_ameuba[Cave[y][x+1]] || tab_ameuba[Cave[y+1][x]] || tab_ameuba[Cave[y][x-1]]) goto bug_boom;
981 switch(Cave[y+1][x]) {
990 Cave[y][x] = Ybug_sB;
991 if(Cave[y][x+1] == Xblank) Cave[y][x+1] = Yacid_splash_eB;
992 if(Cave[y][x-1] == Xblank) Cave[y][x-1] = Yacid_splash_wB;
997 case Yacid_splash_eB:
998 case Yacid_splash_wB:
1002 Cave[y][x] = Ybug_sB;
1003 Cave[y+1][x] = Ybug_s;
1004 Next[y][x] = Xblank;
1005 Next[y+1][x] = Xbug_s;
1009 Cave[y][x] = Ybug_s_e;
1010 Next[y][x] = Xbug_goe;
1014 /* ---------------------------------------------------------------------- */
1016 if(tab_ameuba[Cave[y-1][x]] || tab_ameuba[Cave[y][x+1]] || tab_ameuba[Cave[y+1][x]] || tab_ameuba[Cave[y][x-1]]) goto bug_boom;
1017 switch(Cave[y-1][x]) {
1019 case Yacid_splash_eB:
1020 case Yacid_splash_wB:
1032 Cave[y][x] = Ybug_w_n;
1033 Next[y][x] = Xbug_gon;
1040 if(tab_ameuba[Cave[y-1][x]] || tab_ameuba[Cave[y][x+1]] || tab_ameuba[Cave[y+1][x]] || tab_ameuba[Cave[y][x-1]]) goto bug_boom;
1042 switch(Cave[y][x-1]) {
1051 Cave[y][x] = Ybug_wB;
1052 if(Cave[y-1][x] == Xblank) Cave[y-1][x] = Yacid_splash_eB;
1053 if(Cave[y-1][x-2] == Xblank) Cave[y-1][x-2] = Yacid_splash_wB;
1054 Next[y][x] = Xblank;
1058 case Yacid_splash_eB:
1059 case Yacid_splash_wB:
1063 Cave[y][x] = Ybug_wB;
1064 Cave[y][x-1] = Ybug_w;
1065 Next[y][x] = Xblank;
1066 Next[y][x-1] = Xbug_w;
1070 Cave[y][x] = Ybug_w_s;
1071 Next[y][x] = Xbug_gos;
1075 /* ---------------------------------------------------------------------- */
1077 if(tab_ameuba[Cave[y-1][x]] || tab_ameuba[Cave[y][x+1]] || tab_ameuba[Cave[y+1][x]] || tab_ameuba[Cave[y][x-1]]) goto tank_boom;
1078 switch(Cave[y][x-1]) {
1080 case Yacid_splash_eB:
1081 case Yacid_splash_wB:
1093 Cave[y][x] = Ytank_n_w;
1094 Next[y][x] = Xtank_gow;
1101 if(tab_ameuba[Cave[y-1][x]] || tab_ameuba[Cave[y][x+1]] || tab_ameuba[Cave[y+1][x]] || tab_ameuba[Cave[y][x-1]]) goto tank_boom;
1103 switch(Cave[y-1][x]) {
1112 Cave[y][x] = Ytank_nB;
1113 if(Cave[y-2][x+1] == Xblank) Cave[y-2][x+1] = Yacid_splash_eB;
1114 if(Cave[y-2][x-1] == Xblank) Cave[y-2][x-1] = Yacid_splash_wB;
1115 Next[y][x] = Xblank;
1119 case Yacid_splash_eB:
1120 case Yacid_splash_wB:
1124 Cave[y][x] = Ytank_nB;
1125 Cave[y-1][x] = Ytank_n;
1126 Next[y][x] = Xblank;
1127 Next[y-1][x] = Xtank_n;
1131 Cave[y][x] = Ytank_n_e;
1132 Next[y][x] = Xtank_goe;
1136 /* ---------------------------------------------------------------------- */
1138 if(tab_ameuba[Cave[y-1][x]] || tab_ameuba[Cave[y][x+1]] || tab_ameuba[Cave[y+1][x]] || tab_ameuba[Cave[y][x-1]]) goto tank_boom;
1139 switch(Cave[y-1][x]) {
1141 case Yacid_splash_eB:
1142 case Yacid_splash_wB:
1154 Cave[y][x] = Ytank_e_n;
1155 Next[y][x] = Xtank_gon;
1162 if(tab_ameuba[Cave[y-1][x]] || tab_ameuba[Cave[y][x+1]] || tab_ameuba[Cave[y+1][x]] || tab_ameuba[Cave[y][x-1]]) goto tank_boom;
1164 switch(Cave[y][x+1]) {
1173 Cave[y][x] = Ytank_eB;
1174 if(Cave[y-1][x+2] == Xblank) Cave[y-1][x+2] = Yacid_splash_eB;
1175 if(Cave[y-1][x] == Xblank) Cave[y-1][x] = Yacid_splash_wB;
1176 Next[y][x] = Xblank;
1180 case Yacid_splash_eB:
1181 case Yacid_splash_wB:
1185 Cave[y][x] = Ytank_eB;
1186 Cave[y][x+1] = Ytank_e;
1187 Next[y][x] = Xblank;
1188 Next[y][x+1] = Xtank_e;
1192 Cave[y][x] = Ytank_e_s;
1193 Next[y][x] = Xtank_gos;
1197 /* ---------------------------------------------------------------------- */
1199 if(tab_ameuba[Cave[y-1][x]] || tab_ameuba[Cave[y][x+1]] || tab_ameuba[Cave[y+1][x]] || tab_ameuba[Cave[y][x-1]]) goto tank_boom;
1200 switch(Cave[y][x+1]) {
1202 case Yacid_splash_eB:
1203 case Yacid_splash_wB:
1215 Cave[y][x] = Ytank_s_e;
1216 Next[y][x] = Xtank_goe;
1223 if(tab_ameuba[Cave[y-1][x]] || tab_ameuba[Cave[y][x+1]] || tab_ameuba[Cave[y+1][x]] || tab_ameuba[Cave[y][x-1]]) goto tank_boom;
1225 switch(Cave[y+1][x]) {
1234 Cave[y][x] = Ytank_sB;
1235 if(Cave[y][x+1] == Xblank) Cave[y][x+1] = Yacid_splash_eB;
1236 if(Cave[y][x-1] == Xblank) Cave[y][x-1] = Yacid_splash_wB;
1237 Next[y][x] = Xblank;
1241 case Yacid_splash_eB:
1242 case Yacid_splash_wB:
1246 Cave[y][x] = Ytank_sB;
1247 Cave[y+1][x] = Ytank_s;
1248 Next[y][x] = Xblank;
1249 Next[y+1][x] = Xtank_s;
1253 Cave[y][x] = Ytank_s_w;
1254 Next[y][x] = Xtank_gow;
1258 /* ---------------------------------------------------------------------- */
1260 if(tab_ameuba[Cave[y-1][x]] || tab_ameuba[Cave[y][x+1]] || tab_ameuba[Cave[y+1][x]] || tab_ameuba[Cave[y][x-1]]) goto tank_boom;
1261 switch(Cave[y+1][x]) {
1263 case Yacid_splash_eB:
1264 case Yacid_splash_wB:
1276 Cave[y][x] = Ytank_w_s;
1277 Next[y][x] = Xtank_gos;
1284 if(tab_ameuba[Cave[y-1][x]] || tab_ameuba[Cave[y][x+1]] || tab_ameuba[Cave[y+1][x]] || tab_ameuba[Cave[y][x-1]]) goto tank_boom;
1286 switch(Cave[y][x-1]) {
1295 Cave[y][x] = Ytank_wB;
1296 if(Cave[y-1][x] == Xblank) Cave[y-1][x] = Yacid_splash_eB;
1297 if(Cave[y-1][x-2] == Xblank) Cave[y-1][x-2] = Yacid_splash_wB;
1298 Next[y][x] = Xblank;
1302 case Yacid_splash_eB:
1303 case Yacid_splash_wB:
1307 Cave[y][x] = Ytank_wB;
1308 Cave[y][x-1] = Ytank_w;
1309 Next[y][x] = Xblank;
1310 Next[y][x-1] = Xtank_w;
1314 Cave[y][x] = Ytank_w_n;
1315 Next[y][x] = Xtank_gon;
1319 /* ---------------------------------------------------------------------- */
1322 if(lev.android_clone_cnt == 0) {
1323 if(Cave[y-1][x-1] != Xblank && Cave[y-1][x] != Xblank &&
1324 Cave[y-1][x+1] != Xblank && Cave[y][x-1] != Xblank &&
1325 Cave[y][x+1] != Xblank && Cave[y+1][x-1] != Xblank &&
1326 Cave[y+1][x] != Xblank && Cave[y+1][x+1] != Xblank) goto android_move;
1328 switch(RANDOM & 7) { /* randomly find an object to clone */
1329 case 0: /* S,NE,W,NW,SE,E,SW,N */
1330 temp = lev.android_array[Cave[y+1][x]]; if(temp != Xblank) break;
1331 temp = lev.android_array[Cave[y-1][x+1]]; if(temp != Xblank) break;
1332 temp = lev.android_array[Cave[y][x-1]]; if(temp != Xblank) break;
1333 temp = lev.android_array[Cave[y-1][x-1]]; if(temp != Xblank) break;
1334 temp = lev.android_array[Cave[y+1][x+1]]; if(temp != Xblank) break;
1335 temp = lev.android_array[Cave[y][x+1]]; if(temp != Xblank) break;
1336 temp = lev.android_array[Cave[y+1][x-1]]; if(temp != Xblank) break;
1337 temp = lev.android_array[Cave[y-1][x]]; if(temp != Xblank) break;
1339 case 1: /* NW,SE,N,S,NE,SW,E,W */
1340 temp = lev.android_array[Cave[y-1][x-1]]; if(temp != Xblank) break;
1341 temp = lev.android_array[Cave[y+1][x+1]]; if(temp != Xblank) break;
1342 temp = lev.android_array[Cave[y-1][x]]; if(temp != Xblank) break;
1343 temp = lev.android_array[Cave[y+1][x]]; if(temp != Xblank) break;
1344 temp = lev.android_array[Cave[y-1][x+1]]; if(temp != Xblank) break;
1345 temp = lev.android_array[Cave[y+1][x-1]]; if(temp != Xblank) break;
1346 temp = lev.android_array[Cave[y][x+1]]; if(temp != Xblank) break;
1347 temp = lev.android_array[Cave[y][x-1]]; if(temp != Xblank) break;
1349 case 2: /* SW,E,S,W,N,NW,SE,NE */
1350 temp = lev.android_array[Cave[y+1][x-1]]; if(temp != Xblank) break;
1351 temp = lev.android_array[Cave[y][x+1]]; if(temp != Xblank) break;
1352 temp = lev.android_array[Cave[y+1][x]]; if(temp != Xblank) break;
1353 temp = lev.android_array[Cave[y][x-1]]; if(temp != Xblank) break;
1354 temp = lev.android_array[Cave[y-1][x]]; if(temp != Xblank) break;
1355 temp = lev.android_array[Cave[y-1][x-1]]; if(temp != Xblank) break;
1356 temp = lev.android_array[Cave[y+1][x+1]]; if(temp != Xblank) break;
1357 temp = lev.android_array[Cave[y-1][x+1]]; if(temp != Xblank) break;
1359 case 3: /* N,SE,NE,E,W,S,NW,SW */
1360 temp = lev.android_array[Cave[y-1][x]]; if(temp != Xblank) break;
1361 temp = lev.android_array[Cave[y+1][x+1]]; if(temp != Xblank) break;
1362 temp = lev.android_array[Cave[y-1][x+1]]; if(temp != Xblank) break;
1363 temp = lev.android_array[Cave[y][x+1]]; if(temp != Xblank) break;
1364 temp = lev.android_array[Cave[y][x-1]]; if(temp != Xblank) break;
1365 temp = lev.android_array[Cave[y+1][x]]; if(temp != Xblank) break;
1366 temp = lev.android_array[Cave[y-1][x-1]]; if(temp != Xblank) break;
1367 temp = lev.android_array[Cave[y+1][x-1]]; if(temp != Xblank) break;
1369 case 4: /* SE,NW,E,NE,SW,W,N,S */
1370 temp = lev.android_array[Cave[y+1][x+1]]; if(temp != Xblank) break;
1371 temp = lev.android_array[Cave[y-1][x-1]]; if(temp != Xblank) break;
1372 temp = lev.android_array[Cave[y][x+1]]; if(temp != Xblank) break;
1373 temp = lev.android_array[Cave[y-1][x+1]]; if(temp != Xblank) break;
1374 temp = lev.android_array[Cave[y+1][x-1]]; if(temp != Xblank) break;
1375 temp = lev.android_array[Cave[y][x-1]]; if(temp != Xblank) break;
1376 temp = lev.android_array[Cave[y-1][x]]; if(temp != Xblank) break;
1377 temp = lev.android_array[Cave[y+1][x]]; if(temp != Xblank) break;
1379 case 5: /* NE,W,SE,SW,S,N,E,NW */
1380 temp = lev.android_array[Cave[y-1][x+1]]; if(temp != Xblank) break;
1381 temp = lev.android_array[Cave[y][x-1]]; if(temp != Xblank) break;
1382 temp = lev.android_array[Cave[y+1][x+1]]; if(temp != Xblank) break;
1383 temp = lev.android_array[Cave[y+1][x-1]]; if(temp != Xblank) break;
1384 temp = lev.android_array[Cave[y+1][x]]; if(temp != Xblank) break;
1385 temp = lev.android_array[Cave[y-1][x]]; if(temp != Xblank) break;
1386 temp = lev.android_array[Cave[y][x+1]]; if(temp != Xblank) break;
1387 temp = lev.android_array[Cave[y-1][x-1]]; if(temp != Xblank) break;
1389 case 6: /* E,N,SW,S,NW,NE,SE,W */
1390 temp = lev.android_array[Cave[y][x+1]]; if(temp != Xblank) break;
1391 temp = lev.android_array[Cave[y-1][x]]; if(temp != Xblank) break;
1392 temp = lev.android_array[Cave[y+1][x-1]]; if(temp != Xblank) break;
1393 temp = lev.android_array[Cave[y+1][x]]; if(temp != Xblank) break;
1394 temp = lev.android_array[Cave[y-1][x-1]]; if(temp != Xblank) break;
1395 temp = lev.android_array[Cave[y-1][x+1]]; if(temp != Xblank) break;
1396 temp = lev.android_array[Cave[y+1][x+1]]; if(temp != Xblank) break;
1397 temp = lev.android_array[Cave[y][x-1]]; if(temp != Xblank) break;
1399 case 7: /* W,SW,NW,N,E,SE,NE,S */
1400 temp = lev.android_array[Cave[y][x-1]]; if(temp != Xblank) break;
1401 temp = lev.android_array[Cave[y+1][x-1]]; if(temp != Xblank) break;
1402 temp = lev.android_array[Cave[y-1][x-1]]; if(temp != Xblank) break;
1403 temp = lev.android_array[Cave[y-1][x]]; if(temp != Xblank) break;
1404 temp = lev.android_array[Cave[y][x+1]]; if(temp != Xblank) break;
1405 temp = lev.android_array[Cave[y+1][x+1]]; if(temp != Xblank) break;
1406 temp = lev.android_array[Cave[y-1][x+1]]; if(temp != Xblank) break;
1407 temp = lev.android_array[Cave[y+1][x]]; if(temp != Xblank) break;
1410 Next[y][x] = temp; /* the item we chose to clone */
1411 play[SAMPLE_android] = 1;
1412 switch(RANDOM & 7) { /* randomly find a direction to move */
1413 case 0: /* S,NE,W,NW,SE,E,SW,N */
1414 if(Cave[y+1][x] == Xblank) goto android_s;
1415 if(Cave[y-1][x+1] == Xblank) goto android_ne;
1416 if(Cave[y][x-1] == Xblank) goto android_w;
1417 if(Cave[y-1][x-1] == Xblank) goto android_nw;
1418 if(Cave[y+1][x+1] == Xblank) goto android_se;
1419 if(Cave[y][x+1] == Xblank) goto android_e;
1420 if(Cave[y+1][x-1] == Xblank) goto android_sw;
1421 if(Cave[y-1][x] == Xblank) goto android_n;
1423 case 1: /* NW,SE,N,S,NE,SW,E,W */
1424 if(Cave[y-1][x-1] == Xblank) goto android_nw;
1425 if(Cave[y+1][x+1] == Xblank) goto android_se;
1426 if(Cave[y-1][x] == Xblank) goto android_n;
1427 if(Cave[y+1][x] == Xblank) goto android_s;
1428 if(Cave[y-1][x+1] == Xblank) goto android_ne;
1429 if(Cave[y+1][x-1] == Xblank) goto android_sw;
1430 if(Cave[y][x+1] == Xblank) goto android_e;
1431 if(Cave[y][x-1] == Xblank) goto android_w;
1433 case 2: /* SW,E,S,W,N,NW,SE,NE */
1434 if(Cave[y+1][x-1] == Xblank) goto android_sw;
1435 if(Cave[y][x+1] == Xblank) goto android_e;
1436 if(Cave[y+1][x] == Xblank) goto android_s;
1437 if(Cave[y][x-1] == Xblank) goto android_w;
1438 if(Cave[y-1][x] == Xblank) goto android_n;
1439 if(Cave[y-1][x-1] == Xblank) goto android_nw;
1440 if(Cave[y+1][x+1] == Xblank) goto android_se;
1441 if(Cave[y-1][x+1] == Xblank) goto android_ne;
1443 case 3: /* N,SE,NE,E,W,S,NW,SW */
1444 if(Cave[y-1][x] == Xblank) goto android_n;
1445 if(Cave[y+1][x+1] == Xblank) goto android_se;
1446 if(Cave[y-1][x+1] == Xblank) goto android_ne;
1447 if(Cave[y][x+1] == Xblank) goto android_e;
1448 if(Cave[y][x-1] == Xblank) goto android_w;
1449 if(Cave[y+1][x] == Xblank) goto android_s;
1450 if(Cave[y-1][x-1] == Xblank) goto android_nw;
1451 if(Cave[y+1][x-1] == Xblank) goto android_sw;
1453 case 4: /* SE,NW,E,NE,SW,W,N,S */
1454 if(Cave[y+1][x+1] == Xblank) goto android_se;
1455 if(Cave[y-1][x-1] == Xblank) goto android_nw;
1456 if(Cave[y][x+1] == Xblank) goto android_e;
1457 if(Cave[y-1][x+1] == Xblank) goto android_ne;
1458 if(Cave[y+1][x-1] == Xblank) goto android_sw;
1459 if(Cave[y][x-1] == Xblank) goto android_w;
1460 if(Cave[y-1][x] == Xblank) goto android_n;
1461 if(Cave[y+1][x] == Xblank) goto android_s;
1463 case 5: /* NE,W,SE,SW,S,N,E,NW */
1464 if(Cave[y-1][x+1] == Xblank) goto android_ne;
1465 if(Cave[y][x-1] == Xblank) goto android_w;
1466 if(Cave[y+1][x+1] == Xblank) goto android_se;
1467 if(Cave[y+1][x-1] == Xblank) goto android_sw;
1468 if(Cave[y+1][x] == Xblank) goto android_s;
1469 if(Cave[y-1][x] == Xblank) goto android_n;
1470 if(Cave[y][x+1] == Xblank) goto android_e;
1471 if(Cave[y-1][x-1] == Xblank) goto android_nw;
1473 case 6: /* E,N,SW,S,NW,NE,SE,W */
1474 if(Cave[y][x+1] == Xblank) goto android_e;
1475 if(Cave[y-1][x] == Xblank) goto android_n;
1476 if(Cave[y+1][x-1] == Xblank) goto android_sw;
1477 if(Cave[y+1][x] == Xblank) goto android_s;
1478 if(Cave[y-1][x-1] == Xblank) goto android_nw;
1479 if(Cave[y-1][x+1] == Xblank) goto android_ne;
1480 if(Cave[y+1][x+1] == Xblank) goto android_se;
1481 if(Cave[y][x-1] == Xblank) goto android_w;
1483 case 7: /* W,SW,NW,N,E,SE,NE,S */
1484 if(Cave[y][x-1] == Xblank) goto android_w;
1485 if(Cave[y+1][x-1] == Xblank) goto android_sw;
1486 if(Cave[y-1][x-1] == Xblank) goto android_nw;
1487 if(Cave[y-1][x] == Xblank) goto android_n;
1488 if(Cave[y][x+1] == Xblank) goto android_e;
1489 if(Cave[y+1][x+1] == Xblank) goto android_se;
1490 if(Cave[y-1][x+1] == Xblank) goto android_ne;
1491 if(Cave[y+1][x] == Xblank) goto android_s;
1496 if(lev.android_move_cnt == 0) {
1497 if(Cave[y-1][x-1] == Zplayer || Cave[y-1][x] == Zplayer ||
1498 Cave[y-1][x+1] == Zplayer || Cave[y][x-1] == Zplayer ||
1499 Cave[y][x+1] == Zplayer || Cave[y+1][x-1] == Zplayer ||
1500 Cave[y+1][x] == Zplayer || Cave[y+1][x+1] == Zplayer) goto android_still;
1502 if(ply1.alive && ply2.alive) {
1503 if( (ply1.x > x ? ply1.x - x : x - ply1.x) + (ply1.y > y ? ply1.y - y : y - ply1.y) < (ply2.x > x ? ply2.x - x : x - ply2.x) + (ply2.y > y ? ply2.y - y : y - ply2.y) ) {
1510 } else if(ply1.alive) {
1513 } else if(ply2.alive) {
1520 Next[y][x] = Xblank; /* assume we will move */
1521 temp = ((x < dx) + 1 - (x > dx)) + ((y < dy) + 1 - (y > dy)) * 3;
1523 switch(temp) { /* attempt clockwise move first if direct path is blocked */
1524 case 0: /* north west */
1525 if(tab_android_move[Cave[y-1][x-1]]) goto android_nw;
1526 if(tab_android_move[Cave[y-1][x]]) goto android_n;
1527 if(tab_android_move[Cave[y][x-1]]) goto android_w;
1530 if(tab_android_move[Cave[y-1][x]]) goto android_n;
1531 if(tab_android_move[Cave[y-1][x+1]]) goto android_ne;
1532 if(tab_android_move[Cave[y-1][x-1]]) goto android_nw;
1534 case 2: /* north east */
1535 if(tab_android_move[Cave[y-1][x+1]]) goto android_ne;
1536 if(tab_android_move[Cave[y][x+1]]) goto android_e;
1537 if(tab_android_move[Cave[y-1][x]]) goto android_n;
1540 if(tab_android_move[Cave[y][x-1]]) goto android_w;
1541 if(tab_android_move[Cave[y-1][x-1]]) goto android_nw;
1542 if(tab_android_move[Cave[y+1][x-1]]) goto android_sw;
1544 case 4: /* nowhere */
1547 if(tab_android_move[Cave[y][x+1]]) goto android_e;
1548 if(tab_android_move[Cave[y+1][x+1]]) goto android_se;
1549 if(tab_android_move[Cave[y-1][x+1]]) goto android_ne;
1551 case 6: /* south west */
1552 if(tab_android_move[Cave[y+1][x-1]]) goto android_sw;
1553 if(tab_android_move[Cave[y][x-1]]) goto android_w;
1554 if(tab_android_move[Cave[y+1][x]]) goto android_s;
1557 if(tab_android_move[Cave[y+1][x]]) goto android_s;
1558 if(tab_android_move[Cave[y+1][x-1]]) goto android_sw;
1559 if(tab_android_move[Cave[y+1][x+1]]) goto android_se;
1561 case 8: /* south east */
1562 if(tab_android_move[Cave[y+1][x+1]]) goto android_se;
1563 if(tab_android_move[Cave[y+1][x]]) goto android_s;
1564 if(tab_android_move[Cave[y][x+1]]) goto android_e;
1568 switch(temp) { /* attempt counter clockwise move first if direct path is blocked */
1569 case 0: /* north west */
1570 if(tab_android_move[Cave[y-1][x-1]]) goto android_nw;
1571 if(tab_android_move[Cave[y][x-1]]) goto android_w;
1572 if(tab_android_move[Cave[y-1][x]]) goto android_n;
1575 if(tab_android_move[Cave[y-1][x]]) goto android_n;
1576 if(tab_android_move[Cave[y-1][x-1]]) goto android_nw;
1577 if(tab_android_move[Cave[y-1][x+1]]) goto android_ne;
1579 case 2: /* north east */
1580 if(tab_android_move[Cave[y-1][x+1]]) goto android_ne;
1581 if(tab_android_move[Cave[y-1][x]]) goto android_n;
1582 if(tab_android_move[Cave[y][x+1]]) goto android_e;
1585 if(tab_android_move[Cave[y][x-1]]) goto android_w;
1586 if(tab_android_move[Cave[y+1][x-1]]) goto android_sw;
1587 if(tab_android_move[Cave[y-1][x-1]]) goto android_nw;
1589 case 4: /* nowhere */
1592 if(tab_android_move[Cave[y][x+1]]) goto android_e;
1593 if(tab_android_move[Cave[y-1][x+1]]) goto android_ne;
1594 if(tab_android_move[Cave[y+1][x+1]]) goto android_se;
1596 case 6: /* south west */
1597 if(tab_android_move[Cave[y+1][x-1]]) goto android_sw;
1598 if(tab_android_move[Cave[y+1][x]]) goto android_s;
1599 if(tab_android_move[Cave[y][x-1]]) goto android_w;
1602 if(tab_android_move[Cave[y+1][x]]) goto android_s;
1603 if(tab_android_move[Cave[y+1][x+1]]) goto android_se;
1604 if(tab_android_move[Cave[y+1][x-1]]) goto android_sw;
1606 case 8: /* south east */
1607 if(tab_android_move[Cave[y+1][x+1]]) goto android_se;
1608 if(tab_android_move[Cave[y][x+1]]) goto android_e;
1609 if(tab_android_move[Cave[y+1][x]]) goto android_s;
1615 Next[y][x] = Xandroid;
1618 Cave[y][x] = Yandroid_nB;
1619 Cave[y-1][x] = Yandroid_n;
1620 Next[y-1][x] = Xandroid;
1624 Cave[y][x] = Yandroid_neB;
1625 Cave[y-1][x+1] = Yandroid_ne;
1626 Next[y-1][x+1] = Xandroid;
1630 Cave[y][x] = Yandroid_eB;
1631 Cave[y][x+1] = Yandroid_e;
1632 Next[y][x+1] = Xandroid;
1636 Cave[y][x] = Yandroid_seB;
1637 Cave[y+1][x+1] = Yandroid_se;
1638 Next[y+1][x+1] = Xandroid;
1642 Cave[y][x] = Yandroid_sB;
1643 Cave[y+1][x] = Yandroid_s;
1644 Next[y+1][x] = Xandroid;
1648 Cave[y][x] = Yandroid_swB;
1649 Cave[y+1][x-1] = Yandroid_sw;
1650 Next[y+1][x-1] = Xandroid;
1654 Cave[y][x] = Yandroid_wB;
1655 Cave[y][x-1] = Yandroid_w;
1656 Next[y][x-1] = Xandroid;
1660 Cave[y][x] = Yandroid_nwB;
1661 Cave[y-1][x-1] = Yandroid_nw;
1662 Next[y-1][x-1] = Xandroid;
1665 /* ---------------------------------------------------------------------- */
1667 switch(Cave[y-1][x]) {
1676 Cave[y][x] = Yandroid_nB;
1677 if(Cave[y-2][x+1] == Xblank) Cave[y-2][x+1] = Yacid_splash_eB;
1678 if(Cave[y-2][x-1] == Xblank) Cave[y-2][x-1] = Yacid_splash_wB;
1679 Next[y][x] = Xblank;
1683 case Yacid_splash_eB:
1684 case Yacid_splash_wB:
1685 Cave[y][x] = Yandroid_nB;
1686 Cave[y-1][x] = Yandroid_n;
1687 Next[y][x] = Xblank;
1688 Next[y-1][x] = Xandroid;
1695 switch(Cave[y-1][x]) {
1704 Cave[y][x] = Yandroid_nB;
1705 if(Cave[y-2][x+1] == Xblank) Cave[y-2][x+1] = Yacid_splash_eB;
1706 if(Cave[y-2][x-1] == Xblank) Cave[y-2][x-1] = Yacid_splash_wB;
1707 Next[y][x] = Xblank;
1711 case Yacid_splash_eB:
1712 case Yacid_splash_wB:
1713 Cave[y][x] = Yandroid_nB;
1714 Cave[y-1][x] = Yandroid_n;
1715 Next[y][x] = Xblank;
1716 Next[y-1][x] = Xandroid_1_n;
1722 /* ---------------------------------------------------------------------- */
1724 switch(Cave[y][x+1]) {
1733 Cave[y][x] = Yandroid_eB;
1734 if(Cave[y-1][x+2] == Xblank) Cave[y-1][x+2] = Yacid_splash_eB;
1735 if(Cave[y-1][x] == Xblank) Cave[y-1][x] = Yacid_splash_wB;
1736 Next[y][x] = Xblank;
1740 case Yacid_splash_eB:
1741 case Yacid_splash_wB:
1742 Cave[y][x] = Yandroid_eB;
1743 Cave[y][x+1] = Yandroid_e;
1744 Next[y][x] = Xblank;
1745 Next[y][x+1] = Xandroid;
1752 switch(Cave[y][x+1]) {
1761 Cave[y][x] = Yandroid_eB;
1762 if(Cave[y-1][x+2] == Xblank) Cave[y-1][x+2] = Yacid_splash_eB;
1763 if(Cave[y-1][x] == Xblank) Cave[y-1][x] = Yacid_splash_wB;
1764 Next[y][x] = Xblank;
1768 case Yacid_splash_eB:
1769 case Yacid_splash_wB:
1770 Cave[y][x] = Yandroid_eB;
1771 Cave[y][x+1] = Yandroid_e;
1772 Next[y][x] = Xblank;
1773 Next[y][x+1] = Xandroid_1_e;
1779 /* ---------------------------------------------------------------------- */
1781 switch(Cave[y+1][x]) {
1790 Cave[y][x] = Yandroid_sB;
1791 if(Cave[y][x+1] == Xblank) Cave[y][x+1] = Yacid_splash_eB;
1792 if(Cave[y][x-1] == Xblank) Cave[y][x-1] = Yacid_splash_wB;
1793 Next[y][x] = Xblank;
1797 case Yacid_splash_eB:
1798 case Yacid_splash_wB:
1799 Cave[y][x] = Yandroid_sB;
1800 Cave[y+1][x] = Yandroid_s;
1801 Next[y][x] = Xblank;
1802 Next[y+1][x] = Xandroid;
1809 switch(Cave[y+1][x]) {
1818 Cave[y][x] = Yandroid_sB;
1819 if(Cave[y][x+1] == Xblank) Cave[y][x+1] = Yacid_splash_eB;
1820 if(Cave[y][x-1] == Xblank) Cave[y][x-1] = Yacid_splash_wB;
1821 Next[y][x] = Xblank;
1825 case Yacid_splash_eB:
1826 case Yacid_splash_wB:
1827 Cave[y][x] = Yandroid_sB;
1828 Cave[y+1][x] = Yandroid_s;
1829 Next[y][x] = Xblank;
1830 Next[y+1][x] = Xandroid_1_s;
1836 /* ---------------------------------------------------------------------- */
1838 switch(Cave[y][x-1]) {
1847 Cave[y][x] = Yandroid_wB;
1848 if(Cave[y-1][x] == Xblank) Cave[y-1][x] = Yacid_splash_eB;
1849 if(Cave[y-1][x-2] == Xblank) Cave[y-1][x-2] = Yacid_splash_wB;
1850 Next[y][x] = Xblank;
1854 case Yacid_splash_eB:
1855 case Yacid_splash_wB:
1856 Cave[y][x] = Yandroid_wB;
1857 Cave[y][x-1] = Yandroid_w;
1858 Next[y][x] = Xblank;
1859 Next[y][x-1] = Xandroid;
1866 switch(Cave[y][x-1]) {
1875 Cave[y][x] = Yandroid_wB;
1876 if(Cave[y-1][x] == Xblank) Cave[y-1][x] = Yacid_splash_eB;
1877 if(Cave[y-1][x-2] == Xblank) Cave[y-1][x-2] = Yacid_splash_wB;
1878 Next[y][x] = Xblank;
1882 case Yacid_splash_eB:
1883 case Yacid_splash_wB:
1884 Cave[y][x] = Yandroid_wB;
1885 Cave[y][x-1] = Yandroid_w;
1886 Next[y][x] = Xblank;
1887 Next[y][x-1] = Xandroid_1_w;
1893 /* ---------------------------------------------------------------------- */
1895 switch(Cave[y+1][x]) {
1904 Cave[y][x] = Yspring_sB;
1905 if(Cave[y][x+1] == Xblank) Cave[y][x+1] = Yacid_splash_eB;
1906 if(Cave[y][x-1] == Xblank) Cave[y][x-1] = Yacid_splash_wB;
1907 Next[y][x] = Xblank;
1911 case Yacid_splash_eB:
1912 case Yacid_splash_wB:
1915 Cave[y][x] = Yspring_sB;
1916 Cave[y+1][x] = Yspring_s;
1917 Next[y][x] = Xblank;
1918 Next[y+1][x] = Xspring_fall;
1936 case Xemerald_pause:
1938 case Xdiamond_pause:
1965 if(tab_blank[Cave[y][x+1]] && tab_acid[Cave[y+1][x+1]]) {
1966 Cave[y][x] = Yspring_eB;
1967 Cave[y][x+1] = Yspring_e;
1968 if(Cave[y+1][x] == Xbumper) Cave[y+1][x] = XbumperB;
1969 Next[y][x] = Xblank;
1971 Next[y][x+1] = Xspring_e;
1973 Next[y][x+1] = Xspring_pause;
1977 if(tab_blank[Cave[y][x-1]] && tab_acid[Cave[y+1][x-1]]) {
1978 Cave[y][x] = Yspring_wB;
1979 Cave[y][x-1] = Yspring_w;
1980 if(Cave[y+1][x] == Xbumper) Cave[y+1][x] = XbumperB;
1981 Next[y][x] = Xblank;
1983 Next[y][x-1] = Xspring_w;
1985 Next[y][x-1] = Xspring_pause;
1990 if(tab_blank[Cave[y][x-1]] && tab_acid[Cave[y+1][x-1]]) {
1991 Cave[y][x] = Yspring_wB;
1992 Cave[y][x-1] = Yspring_w;
1993 if(Cave[y+1][x] == Xbumper) Cave[y+1][x] = XbumperB;
1994 Next[y][x] = Xblank;
1996 Next[y][x-1] = Xspring_w;
1998 Next[y][x-1] = Xspring_pause;
2002 if(tab_blank[Cave[y][x+1]] && tab_acid[Cave[y+1][x+1]]) {
2003 Cave[y][x] = Yspring_eB;
2004 Cave[y][x+1] = Yspring_e;
2005 if(Cave[y+1][x] == Xbumper) Cave[y+1][x] = XbumperB;
2006 Next[y][x] = Xblank;
2008 Next[y][x+1] = Xspring_e;
2010 Next[y][x+1] = Xspring_pause;
2018 /* ---------------------------------------------------------------------- */
2020 switch(Cave[y+1][x]) {
2029 Cave[y][x] = Yspring_sB;
2030 if(Cave[y][x+1] == Xblank) Cave[y][x+1] = Yacid_splash_eB;
2031 if(Cave[y][x-1] == Xblank) Cave[y][x-1] = Yacid_splash_wB;
2032 Next[y][x] = Xblank;
2036 case Yacid_splash_eB:
2037 case Yacid_splash_wB:
2038 Cave[y][x] = Yspring_sB;
2039 Cave[y+1][x] = Yspring_s;
2040 Next[y][x] = Xblank;
2041 Next[y+1][x] = Xspring_fall;
2044 Cave[y][x] = Xspring;
2045 Next[y][x] = Xspring;
2048 /* ---------------------------------------------------------------------- */
2050 switch(Cave[y+1][x]) {
2059 Cave[y][x] = Yspring_sB;
2060 if(Cave[y][x+1] == Xblank) Cave[y][x+1] = Yacid_splash_eB;
2061 if(Cave[y][x-1] == Xblank) Cave[y][x-1] = Yacid_splash_wB;
2062 Next[y][x] = Xblank;
2066 case Yacid_splash_eB:
2067 case Yacid_splash_wB:
2068 Cave[y][x] = Yspring_sB;
2069 Cave[y+1][x] = Yspring_s;
2070 Next[y][x] = Xblank;
2071 Next[y+1][x] = Xspring_fall;
2074 Cave[y+1][x] = XbumperB;
2076 switch(Cave[y][x+1]) {
2085 Cave[y][x] = Yspring_eB;
2086 if(Cave[y-1][x+2] == Xblank) Cave[y-1][x+2] = Yacid_splash_eB;
2087 if(Cave[y-1][x] == Xblank) Cave[y-1][x] = Yacid_splash_wB;
2088 Next[y][x] = Xblank;
2092 case Yacid_splash_eB:
2093 case Yacid_splash_wB:
2098 Cave[y][x] = Yspring_eB;
2099 Cave[y][x+1] = Yspring_e;
2100 Next[y][x] = Xblank;
2101 Next[y][x+1] = Xspring_e;
2109 Cave[y][x] = Yspring_kill_eB;
2110 Cave[y][x+1] = Yspring_kill_e;
2111 Next[y][x] = Xblank;
2112 Next[y][x+1] = Xspring_e;
2113 play[SAMPLE_slurp] = 1;
2114 score += lev.slurp_score;
2118 Cave[y][x+1] = XbumperB;
2119 Next[y][x] = Xspring_w;
2120 PLAY(SAMPLE_spring);
2123 Cave[y][x] = Xspring;
2124 Next[y][x] = Xspring;
2125 PLAY(SAMPLE_spring);
2128 /* ---------------------------------------------------------------------- */
2130 switch(Cave[y+1][x]) {
2139 Cave[y][x] = Yspring_sB;
2140 if(Cave[y][x+1] == Xblank) Cave[y][x+1] = Yacid_splash_eB;
2141 if(Cave[y][x-1] == Xblank) Cave[y][x-1] = Yacid_splash_wB;
2142 Next[y][x] = Xblank;
2146 case Yacid_splash_eB:
2147 case Yacid_splash_wB:
2148 Cave[y][x] = Yspring_sB;
2149 Cave[y+1][x] = Yspring_s;
2150 Next[y][x] = Xblank;
2151 Next[y+1][x] = Xspring_fall;
2154 Cave[y+1][x] = XbumperB;
2156 switch(Cave[y][x-1]) {
2165 Cave[y][x] = Yspring_wB;
2166 if(Cave[y-1][x] == Xblank) Cave[y-1][x] = Yacid_splash_eB;
2167 if(Cave[y-1][x-2] == Xblank) Cave[y-1][x-2] = Yacid_splash_wB;
2168 Next[y][x] = Xblank;
2172 case Yacid_splash_eB:
2173 case Yacid_splash_wB:
2178 Cave[y][x] = Yspring_wB;
2179 Cave[y][x-1] = Yspring_w;
2180 Next[y][x] = Xblank;
2181 Next[y][x-1] = Xspring_w;
2189 Cave[y][x] = Yspring_kill_wB;
2190 Cave[y][x-1] = Yspring_kill_w;
2191 Next[y][x] = Xblank;
2192 Next[y][x-1] = Xspring_w;
2193 play[SAMPLE_slurp] = 1;
2194 score += lev.slurp_score;
2198 Cave[y][x-1] = XbumperB;
2199 Next[y][x] = Xspring_e;
2200 PLAY(SAMPLE_spring);
2203 Cave[y][x] = Xspring;
2204 Next[y][x] = Xspring;
2205 PLAY(SAMPLE_spring);
2208 /* ---------------------------------------------------------------------- */
2210 switch(Cave[y+1][x]) {
2219 Cave[y][x] = Yspring_sB;
2220 if(Cave[y][x+1] == Xblank) Cave[y][x+1] = Yacid_splash_eB;
2221 if(Cave[y][x-1] == Xblank) Cave[y][x-1] = Yacid_splash_wB;
2222 Next[y][x] = Xblank;
2226 case Yacid_splash_eB:
2227 case Yacid_splash_wB:
2229 Cave[y][x] = Yspring_sB;
2230 Cave[y+1][x] = Yspring_s;
2231 Next[y][x] = Xblank;
2232 Next[y+1][x] = Xspring_fall;
2236 Cave[y+1][x] = Ybomb_eat;
2237 Next[y+1][x] = Znormal;
2238 Boom[y][x-1] = Xblank;
2239 Boom[y][x] = Xblank;
2240 Boom[y][x+1] = Xblank;
2241 Boom[y+1][x-1] = Xblank;
2242 Boom[y+1][x] = Xblank;
2243 Boom[y+1][x+1] = Xblank;
2244 Boom[y+2][x-1] = Xblank;
2245 Boom[y+2][x] = Xblank;
2246 Boom[y+2][x+1] = Xblank;
2256 Cave[y][x] = Yspring_sB;
2257 Cave[y+1][x] = Ybug_spring;
2258 Next[y+1][x] = Znormal;
2259 Boom[y][x-1] = Xemerald;
2260 Boom[y][x] = Xemerald;
2261 Boom[y][x+1] = Xemerald;
2262 Boom[y+1][x-1] = Xemerald;
2263 Boom[y+1][x] = Xdiamond;
2264 Boom[y+1][x+1] = Xemerald;
2265 Boom[y+2][x-1] = Xemerald;
2266 Boom[y+2][x] = Xemerald;
2267 Boom[y+2][x+1] = Xemerald;
2268 score += lev.bug_score;
2278 Cave[y][x] = Yspring_sB;
2279 Cave[y+1][x] = Ytank_spring;
2280 Next[y+1][x] = Znormal;
2281 Boom[y][x-1] = Xblank;
2282 Boom[y][x] = Xblank;
2283 Boom[y][x+1] = Xblank;
2284 Boom[y+1][x-1] = Xblank;
2285 Boom[y+1][x] = Xblank;
2286 Boom[y+1][x+1] = Xblank;
2287 Boom[y+2][x-1] = Xblank;
2288 Boom[y+2][x] = Xblank;
2289 Boom[y+2][x+1] = Xblank;
2290 score += lev.tank_score;
2296 Cave[y][x] = Yspring_sB;
2297 Cave[y+1][x] = Yeater_spring;
2298 Next[y+1][x] = Znormal;
2299 Boom[y][x-1] = lev.eater_array[lev.eater_pos][0];
2300 Boom[y][x] = lev.eater_array[lev.eater_pos][1];
2301 Boom[y][x+1] = lev.eater_array[lev.eater_pos][2];
2302 Boom[y+1][x-1] = lev.eater_array[lev.eater_pos][3];
2303 Boom[y+1][x] = lev.eater_array[lev.eater_pos][4];
2304 Boom[y+1][x+1] = lev.eater_array[lev.eater_pos][5];
2305 Boom[y+2][x-1] = lev.eater_array[lev.eater_pos][6];
2306 Boom[y+2][x] = lev.eater_array[lev.eater_pos][7];
2307 Boom[y+2][x+1] = lev.eater_array[lev.eater_pos][8];
2308 lev.eater_pos = (lev.eater_pos + 1) & 7;
2309 score += lev.eater_score;
2313 Cave[y][x] = Yspring_sB;
2314 Cave[y+1][x] = Yalien_spring;
2315 Next[y+1][x] = Znormal;
2316 Boom[y][x-1] = Xblank;
2317 Boom[y][x] = Xblank;
2318 Boom[y][x+1] = Xblank;
2319 Boom[y+1][x-1] = Xblank;
2320 Boom[y+1][x] = Xblank;
2321 Boom[y+1][x+1] = Xblank;
2322 Boom[y+2][x-1] = Xblank;
2323 Boom[y+2][x] = Xblank;
2324 Boom[y+2][x+1] = Xblank;
2325 score += lev.alien_score;
2328 Cave[y][x] = Xspring;
2329 Next[y][x] = Xspring;
2330 PLAY(SAMPLE_spring);
2333 /* ---------------------------------------------------------------------- */
2335 if(Cave[y][x+1] == Xdiamond) {
2336 Cave[y][x+1] = Ydiamond_eat;
2337 Next[y][x+1] = Xblank;
2338 play[SAMPLE_eater] = 1;
2341 if(Cave[y+1][x] == Xdiamond) {
2342 Cave[y+1][x] = Ydiamond_eat;
2343 Next[y+1][x] = Xblank;
2344 play[SAMPLE_eater] = 1;
2347 if(Cave[y][x-1] == Xdiamond) {
2348 Cave[y][x-1] = Ydiamond_eat;
2349 Next[y][x-1] = Xblank;
2350 play[SAMPLE_eater] = 1;
2353 if(Cave[y-1][x] == Xdiamond) {
2354 Cave[y-1][x] = Ydiamond_eat;
2355 Next[y-1][x] = Xblank;
2356 play[SAMPLE_eater] = 1;
2359 switch(Cave[y-1][x]) {
2368 Cave[y][x] = Yeater_nB;
2369 if(Cave[y-2][x+1] == Xblank) Cave[y-2][x+1] = Yacid_splash_eB;
2370 if(Cave[y-2][x-1] == Xblank) Cave[y-2][x-1] = Yacid_splash_wB;
2371 Next[y][x] = Xblank;
2375 case Yacid_splash_eB:
2376 case Yacid_splash_wB:
2380 Cave[y][x] = Yeater_nB;
2381 Cave[y-1][x] = Yeater_n;
2382 Next[y][x] = Xblank;
2383 Next[y-1][x] = Xeater_n;
2386 Next[y][x] = RANDOM & 1 ? Xeater_e : Xeater_w;
2390 /* ---------------------------------------------------------------------- */
2392 if(Cave[y+1][x] == Xdiamond) {
2393 Cave[y+1][x] = Ydiamond_eat;
2394 Next[y+1][x] = Xblank;
2395 play[SAMPLE_eater] = 1;
2398 if(Cave[y][x-1] == Xdiamond) {
2399 Cave[y][x-1] = Ydiamond_eat;
2400 Next[y][x-1] = Xblank;
2401 play[SAMPLE_eater] = 1;
2404 if(Cave[y-1][x] == Xdiamond) {
2405 Cave[y-1][x] = Ydiamond_eat;
2406 Next[y-1][x] = Xblank;
2407 play[SAMPLE_eater] = 1;
2410 if(Cave[y][x+1] == Xdiamond) {
2411 Cave[y][x+1] = Ydiamond_eat;
2412 Next[y][x+1] = Xblank;
2413 play[SAMPLE_eater] = 1;
2416 switch(Cave[y][x+1]) {
2425 Cave[y][x] = Yeater_eB;
2426 if(Cave[y-1][x+2] == Xblank) Cave[y-1][x+2] = Yacid_splash_eB;
2427 if(Cave[y-1][x] == Xblank) Cave[y-1][x] = Yacid_splash_wB;
2428 Next[y][x] = Xblank;
2432 case Yacid_splash_eB:
2433 case Yacid_splash_wB:
2437 Cave[y][x] = Yeater_eB;
2438 Cave[y][x+1] = Yeater_e;
2439 Next[y][x] = Xblank;
2440 Next[y][x+1] = Xeater_e;
2443 Next[y][x] = RANDOM & 1 ? Xeater_n : Xeater_s;
2447 /* ---------------------------------------------------------------------- */
2449 if(Cave[y][x-1] == Xdiamond) {
2450 Cave[y][x-1] = Ydiamond_eat;
2451 Next[y][x-1] = Xblank;
2452 play[SAMPLE_eater] = 1;
2455 if(Cave[y-1][x] == Xdiamond) {
2456 Cave[y-1][x] = Ydiamond_eat;
2457 Next[y-1][x] = Xblank;
2458 play[SAMPLE_eater] = 1;
2461 if(Cave[y][x+1] == Xdiamond) {
2462 Cave[y][x+1] = Ydiamond_eat;
2463 Next[y][x+1] = Xblank;
2464 play[SAMPLE_eater] = 1;
2467 if(Cave[y+1][x] == Xdiamond) {
2468 Cave[y+1][x] = Ydiamond_eat;
2469 Next[y+1][x] = Xblank;
2470 play[SAMPLE_eater] = 1;
2473 switch(Cave[y+1][x]) {
2482 Cave[y][x] = Yeater_sB;
2483 if(Cave[y][x+1] == Xblank) Cave[y][x+1] = Yacid_splash_eB;
2484 if(Cave[y][x-1] == Xblank) Cave[y][x-1] = Yacid_splash_wB;
2485 Next[y][x] = Xblank;
2489 case Yacid_splash_eB:
2490 case Yacid_splash_wB:
2494 Cave[y][x] = Yeater_sB;
2495 Cave[y+1][x] = Yeater_s;
2496 Next[y][x] = Xblank;
2497 Next[y+1][x] = Xeater_s;
2500 Next[y][x] = RANDOM & 1 ? Xeater_e : Xeater_w;
2504 /* ---------------------------------------------------------------------- */
2506 if(Cave[y-1][x] == Xdiamond) {
2507 Cave[y-1][x] = Ydiamond_eat;
2508 Next[y-1][x] = Xblank;
2509 play[SAMPLE_eater] = 1;
2512 if(Cave[y][x+1] == Xdiamond) {
2513 Cave[y][x+1] = Ydiamond_eat;
2514 Next[y][x+1] = Xblank;
2515 play[SAMPLE_eater] = 1;
2518 if(Cave[y+1][x] == Xdiamond) {
2519 Cave[y+1][x] = Ydiamond_eat;
2520 Next[y+1][x] = Xblank;
2521 play[SAMPLE_eater] = 1;
2524 if(Cave[y][x-1] == Xdiamond) {
2525 Cave[y][x-1] = Ydiamond_eat;
2526 Next[y][x-1] = Xblank;
2527 play[SAMPLE_eater] = 1;
2530 switch(Cave[y][x-1]) {
2539 Cave[y][x] = Yeater_wB;
2540 if(Cave[y-1][x] == Xblank) Cave[y-1][x] = Yacid_splash_eB;
2541 if(Cave[y-1][x-2] == Xblank) Cave[y-1][x-2] = Yacid_splash_wB;
2542 Next[y][x] = Xblank;
2546 case Yacid_splash_eB:
2547 case Yacid_splash_wB:
2551 Cave[y][x] = Yeater_wB;
2552 Cave[y][x-1] = Yeater_w;
2553 Next[y][x] = Xblank;
2554 Next[y][x-1] = Xeater_w;
2557 Next[y][x] = RANDOM & 1 ? Xeater_n : Xeater_s;
2561 /* ---------------------------------------------------------------------- */
2566 } else if(ply1.alive && ply2.alive) {
2567 if( (ply1.x > x ? ply1.x - x : x - ply1.x) + (ply1.y > y ? ply1.y - y : y - ply1.y) < (ply2.x > x ? ply2.x - x : x - ply2.x) + (ply2.y > y ? ply2.y - y : y - ply2.y) ) {
2574 } else if(ply1.alive) {
2577 } else if(ply2.alive) {
2586 switch(Cave[y-1][x]) {
2595 Cave[y][x] = Yalien_nB;
2596 if(Cave[y-2][x+1] == Xblank) Cave[y-2][x+1] = Yacid_splash_eB;
2597 if(Cave[y-2][x-1] == Xblank) Cave[y-2][x-1] = Yacid_splash_wB;
2598 Next[y][x] = Xblank;
2602 case Yacid_splash_eB:
2603 case Yacid_splash_wB:
2607 Cave[y][x] = Yalien_nB;
2608 Cave[y-1][x] = Yalien_n;
2609 Next[y][x] = Xblank;
2610 Next[y-1][x] = Xalien_pause;
2615 switch(Cave[y+1][x]) {
2624 Cave[y][x] = Yalien_sB;
2625 Next[y][x] = Xblank;
2626 if(Cave[y][x+1] == Xblank) Cave[y][x+1] = Yacid_splash_eB;
2627 if(Cave[y][x-1] == Xblank) Cave[y][x-1] = Yacid_splash_wB;
2631 case Yacid_splash_eB:
2632 case Yacid_splash_wB:
2636 Cave[y][x] = Yalien_sB;
2637 Cave[y+1][x] = Yalien_s;
2638 Next[y][x] = Xblank;
2639 Next[y+1][x] = Xalien_pause;
2646 switch(Cave[y][x+1]) {
2655 Cave[y][x] = Yalien_eB;
2656 if(Cave[y-1][x+2] == Xblank) Cave[y-1][x+2] = Yacid_splash_eB;
2657 if(Cave[y-1][x] == Xblank) Cave[y-1][x] = Yacid_splash_wB;
2658 Next[y][x] = Xblank;
2662 case Yacid_splash_eB:
2663 case Yacid_splash_wB:
2667 Cave[y][x] = Yalien_eB;
2668 Cave[y][x+1] = Yalien_e;
2669 Next[y][x] = Xblank;
2670 Next[y][x+1] = Xalien_pause;
2675 switch(Cave[y][x-1]) {
2684 Cave[y][x] = Yalien_wB;
2685 if(Cave[y-1][x] == Xblank) Cave[y-1][x] = Yacid_splash_eB;
2686 if(Cave[y-1][x-2] == Xblank) Cave[y-1][x-2] = Yacid_splash_wB;
2687 Next[y][x] = Xblank;
2691 case Yacid_splash_eB:
2692 case Yacid_splash_wB:
2696 Cave[y][x] = Yalien_wB;
2697 Cave[y][x-1] = Yalien_w;
2698 Next[y][x] = Xblank;
2699 Next[y][x-1] = Xalien_pause;
2707 Next[y][x] = Xalien;
2709 /* ---------------------------------------------------------------------- */
2711 switch(Cave[y+1][x]) {
2720 Cave[y][x] = Yemerald_sB;
2721 if(Cave[y][x+1] == Xblank) Cave[y][x+1] = Yacid_splash_eB;
2722 if(Cave[y][x-1] == Xblank) Cave[y][x-1] = Yacid_splash_wB;
2723 Next[y][x] = Xblank;
2727 case Yacid_splash_eB:
2728 case Yacid_splash_wB:
2729 Cave[y][x] = Yemerald_sB;
2730 Cave[y+1][x] = Yemerald_s;
2731 Next[y][x] = Xblank;
2732 Next[y+1][x] = Xemerald_fall;
2750 case Xemerald_pause:
2752 case Xdiamond_pause:
2788 if(tab_blank[Cave[y][x+1]] && tab_acid[Cave[y+1][x+1]]) {
2789 Cave[y][x] = Yemerald_eB;
2790 Cave[y][x+1] = Yemerald_e;
2791 Next[y][x] = Xblank;
2792 Next[y][x+1] = Xemerald_pause;
2795 if(tab_blank[Cave[y][x-1]] && tab_acid[Cave[y+1][x-1]]) {
2796 Cave[y][x] = Yemerald_wB;
2797 Cave[y][x-1] = Yemerald_w;
2798 Next[y][x] = Xblank;
2799 Next[y][x-1] = Xemerald_pause;
2803 if(tab_blank[Cave[y][x-1]] && tab_acid[Cave[y+1][x-1]]) {
2804 Cave[y][x] = Yemerald_wB;
2805 Cave[y][x-1] = Yemerald_w;
2806 Next[y][x] = Xblank;
2807 Next[y][x-1] = Xemerald_pause;
2810 if(tab_blank[Cave[y][x+1]] && tab_acid[Cave[y+1][x+1]]) {
2811 Cave[y][x] = Yemerald_eB;
2812 Cave[y][x+1] = Yemerald_e;
2813 Next[y][x] = Xblank;
2814 Next[y][x+1] = Xemerald_pause;
2819 if(++lev.shine_cnt > 50) {
2820 lev.shine_cnt = RANDOM & 7;
2821 Cave[y][x] = Xemerald_shine;
2825 /* ---------------------------------------------------------------------- */
2826 case Xemerald_pause:
2827 switch(Cave[y+1][x]) {
2836 Cave[y][x] = Yemerald_sB;
2837 if(Cave[y][x+1] == Xblank) Cave[y][x+1] = Yacid_splash_eB;
2838 if(Cave[y][x-1] == Xblank) Cave[y][x-1] = Yacid_splash_wB;
2839 Next[y][x] = Xblank;
2843 case Yacid_splash_eB:
2844 case Yacid_splash_wB:
2845 Cave[y][x] = Yemerald_sB;
2846 Cave[y+1][x] = Yemerald_s;
2847 Next[y][x] = Xblank;
2848 Next[y+1][x] = Xemerald_fall;
2851 Cave[y][x] = Xemerald;
2852 Next[y][x] = Xemerald;
2855 /* ---------------------------------------------------------------------- */
2857 switch(Cave[y+1][x]) {
2866 Cave[y][x] = Yemerald_sB;
2867 if(Cave[y][x+1] == Xblank) Cave[y][x+1] = Yacid_splash_eB;
2868 if(Cave[y][x-1] == Xblank) Cave[y][x-1] = Yacid_splash_wB;
2869 Next[y][x] = Xblank;
2873 case Yacid_splash_eB:
2874 case Yacid_splash_wB:
2876 Cave[y][x] = Yemerald_sB;
2877 Cave[y+1][x] = Yemerald_s;
2878 Next[y][x] = Xblank;
2879 Next[y+1][x] = Xemerald_fall;
2882 if(lev.wonderwall_time) {
2883 lev.wonderwall_state = 1;
2884 Cave[y][x] = Yemerald_sB;
2885 if(tab_blank[Cave[y+2][x]]) {
2886 Cave[y+2][x] = Ydiamond_s;
2887 Next[y+2][x] = Xdiamond_fall;
2889 Next[y][x] = Xblank;
2890 play[SAMPLE_squash] = 1;
2894 Cave[y][x] = Xemerald;
2895 Next[y][x] = Xemerald;
2896 PLAY(SAMPLE_diamond);
2899 /* ---------------------------------------------------------------------- */
2901 switch(Cave[y+1][x]) {
2910 Cave[y][x] = Ydiamond_sB;
2911 if(Cave[y][x+1] == Xblank) Cave[y][x+1] = Yacid_splash_eB;
2912 if(Cave[y][x-1] == Xblank) Cave[y][x-1] = Yacid_splash_wB;
2913 Next[y][x] = Xblank;
2917 case Yacid_splash_eB:
2918 case Yacid_splash_wB:
2919 Cave[y][x] = Ydiamond_sB;
2920 Cave[y+1][x] = Ydiamond_s;
2921 Next[y][x] = Xblank;
2922 Next[y+1][x] = Xdiamond_fall;
2940 case Xemerald_pause:
2942 case Xdiamond_pause:
2978 if(tab_blank[Cave[y][x+1]] && tab_acid[Cave[y+1][x+1]]) {
2979 Cave[y][x] = Ydiamond_eB;
2980 Cave[y][x+1] = Ydiamond_e;
2981 Next[y][x] = Xblank;
2982 Next[y][x+1] = Xdiamond_pause;
2985 if(tab_blank[Cave[y][x-1]] && tab_acid[Cave[y+1][x-1]]) {
2986 Cave[y][x] = Ydiamond_wB;
2987 Cave[y][x-1] = Ydiamond_w;
2988 Next[y][x] = Xblank;
2989 Next[y][x-1] = Xdiamond_pause;
2993 if(tab_blank[Cave[y][x-1]] && tab_acid[Cave[y+1][x-1]]) {
2994 Cave[y][x] = Ydiamond_wB;
2995 Cave[y][x-1] = Ydiamond_w;
2996 Next[y][x] = Xblank;
2997 Next[y][x-1] = Xdiamond_pause;
3000 if(tab_blank[Cave[y][x+1]] && tab_acid[Cave[y+1][x+1]]) {
3001 Cave[y][x] = Ydiamond_eB;
3002 Cave[y][x+1] = Ydiamond_e;
3003 Next[y][x] = Xblank;
3004 Next[y][x+1] = Xdiamond_pause;
3009 if(++lev.shine_cnt > 50) {
3010 lev.shine_cnt = RANDOM & 7;
3011 Cave[y][x] = Xdiamond_shine;
3015 /* ---------------------------------------------------------------------- */
3016 case Xdiamond_pause:
3017 switch(Cave[y+1][x]) {
3026 Cave[y][x] = Ydiamond_sB;
3027 if(Cave[y][x+1] == Xblank) Cave[y][x+1] = Yacid_splash_eB;
3028 if(Cave[y][x-1] == Xblank) Cave[y][x-1] = Yacid_splash_wB;
3029 Next[y][x] = Xblank;
3033 case Yacid_splash_eB:
3034 case Yacid_splash_wB:
3035 Cave[y][x] = Ydiamond_sB;
3036 Cave[y+1][x] = Ydiamond_s;
3037 Next[y][x] = Xblank;
3038 Next[y+1][x] = Xdiamond_fall;
3041 Cave[y][x] = Xdiamond;
3042 Next[y][x] = Xdiamond;
3045 /* ---------------------------------------------------------------------- */
3047 switch(Cave[y+1][x]) {
3056 Cave[y][x] = Ydiamond_sB;
3057 if(Cave[y][x+1] == Xblank) Cave[y][x+1] = Yacid_splash_eB;
3058 if(Cave[y][x-1] == Xblank) Cave[y][x-1] = Yacid_splash_wB;
3059 Next[y][x] = Xblank;
3063 case Yacid_splash_eB:
3064 case Yacid_splash_wB:
3066 Cave[y][x] = Ydiamond_sB;
3067 Cave[y+1][x] = Ydiamond_s;
3068 Next[y][x] = Xblank;
3069 Next[y+1][x] = Xdiamond_fall;
3072 if(lev.wonderwall_time) {
3073 lev.wonderwall_state = 1;
3074 Cave[y][x] = Ydiamond_sB;
3075 if(tab_blank[Cave[y+2][x]]) {
3076 Cave[y+2][x] = Ystone_s;
3077 Next[y+2][x] = Xstone_fall;
3079 Next[y][x] = Xblank;
3080 play[SAMPLE_squash] = 1;
3084 Cave[y][x] = Xdiamond;
3085 Next[y][x] = Xdiamond;
3086 PLAY(SAMPLE_diamond);
3089 /* ---------------------------------------------------------------------- */
3091 switch(Cave[y+1][x]) {
3100 Cave[y][x] = Ydrip_s1B;
3101 if(Cave[y][x+1] == Xblank) Cave[y][x+1] = Yacid_splash_eB;
3102 if(Cave[y][x-1] == Xblank) Cave[y][x-1] = Yacid_splash_wB;
3103 Next[y][x] = Xdrip_stretchB;
3107 case Yacid_splash_eB:
3108 case Yacid_splash_wB:
3112 Cave[y][x] = Ydrip_s1B;
3113 Cave[y+1][x] = Ydrip_s1;
3114 Next[y][x] = Xdrip_stretchB;
3115 Next[y+1][x] = Xdrip_stretch;
3118 switch(RANDOM & 7) {
3119 case 0: temp = Xameuba_1; break;
3120 case 1: temp = Xameuba_2; break;
3121 case 2: temp = Xameuba_3; break;
3122 case 3: temp = Xameuba_4; break;
3123 case 4: temp = Xameuba_5; break;
3124 case 5: temp = Xameuba_6; break;
3125 case 6: temp = Xameuba_7; break;
3126 case 7: temp = Xameuba_8; break;
3130 play[SAMPLE_drip] = 1;
3133 /* ---------------------------------------------------------------------- */
3135 Cave[y][x] = Ydrip_s2;
3136 Next[y][x] = Xdrip_fall;
3138 case Xdrip_stretchB:
3139 Cave[y][x] = Ydrip_s2B;
3140 Next[y][x] = Xblank;
3143 Next[y][x] = Xdrip_fall;
3145 /* ---------------------------------------------------------------------- */
3147 switch(Cave[y+1][x]) {
3156 Cave[y][x] = Ybomb_sB;
3157 if(Cave[y][x+1] == Xblank) Cave[y][x+1] = Yacid_splash_eB;
3158 if(Cave[y][x-1] == Xblank) Cave[y][x-1] = Yacid_splash_wB;
3159 Next[y][x] = Xblank;
3163 case Yacid_splash_eB:
3164 case Yacid_splash_wB:
3165 Cave[y][x] = Ybomb_sB;
3166 Cave[y+1][x] = Ybomb_s;
3167 Next[y][x] = Xblank;
3168 Next[y+1][x] = Xbomb_fall;
3186 case Xemerald_pause:
3188 case Xdiamond_pause:
3215 if(tab_blank[Cave[y][x+1]] && tab_acid[Cave[y+1][x+1]]) {
3216 Cave[y][x] = Ybomb_eB;
3217 Cave[y][x+1] = Ybomb_e;
3218 Next[y][x] = Xblank;
3219 Next[y][x+1] = Xbomb_pause;
3222 if(tab_blank[Cave[y][x-1]] && tab_acid[Cave[y+1][x-1]]) {
3223 Cave[y][x] = Ybomb_wB;
3224 Cave[y][x-1] = Ybomb_w;
3225 Next[y][x] = Xblank;
3226 Next[y][x-1] = Xbomb_pause;
3230 if(tab_blank[Cave[y][x-1]] && tab_acid[Cave[y+1][x-1]]) {
3231 Cave[y][x] = Ybomb_wB;
3232 Cave[y][x-1] = Ybomb_w;
3233 Next[y][x] = Xblank;
3234 Next[y][x-1] = Xbomb_pause;
3237 if(tab_blank[Cave[y][x+1]] && tab_acid[Cave[y+1][x+1]]) {
3238 Cave[y][x] = Ybomb_eB;
3239 Cave[y][x+1] = Ybomb_e;
3240 Next[y][x] = Xblank;
3241 Next[y][x+1] = Xbomb_pause;
3248 /* ---------------------------------------------------------------------- */
3250 switch(Cave[y+1][x]) {
3259 Cave[y][x] = Ybomb_sB;
3260 if(Cave[y][x+1] == Xblank) Cave[y][x+1] = Yacid_splash_eB;
3261 if(Cave[y][x-1] == Xblank) Cave[y][x-1] = Yacid_splash_wB;
3262 Next[y][x] = Xblank;
3266 case Yacid_splash_eB:
3267 case Yacid_splash_wB:
3268 Cave[y][x] = Ybomb_sB;
3269 Cave[y+1][x] = Ybomb_s;
3270 Next[y][x] = Xblank;
3271 Next[y+1][x] = Xbomb_fall;
3278 /* ---------------------------------------------------------------------- */
3280 switch(Cave[y+1][x]) {
3289 Cave[y][x] = Ybomb_sB;
3290 if(Cave[y][x+1] == Xblank) Cave[y][x+1] = Yacid_splash_eB;
3291 if(Cave[y][x-1] == Xblank) Cave[y][x-1] = Yacid_splash_wB;
3292 Next[y][x] = Xblank;
3296 case Yacid_splash_eB:
3297 case Yacid_splash_wB:
3298 Cave[y][x] = Ybomb_sB;
3299 Cave[y+1][x] = Ybomb_s;
3300 Next[y][x] = Xblank;
3301 Next[y+1][x] = Xbomb_fall;
3304 Cave[y][x] = Ybomb_eat;
3305 Next[y][x] = Znormal;
3306 Boom[y-1][x-1] = Xblank;
3307 Boom[y-1][x] = Xblank;
3308 Boom[y-1][x+1] = Xblank;
3309 Boom[y][x-1] = Xblank;
3310 Boom[y][x] = Xblank;
3311 Boom[y][x+1] = Xblank;
3312 Boom[y+1][x-1] = Xblank;
3313 Boom[y+1][x] = Xblank;
3314 Boom[y+1][x+1] = Xblank;
3317 /* ---------------------------------------------------------------------- */
3319 if(lev.wind_cnt == 0) goto loop;
3320 switch(lev.wind_direction) {
3322 switch(Cave[y-1][x]) {
3331 Cave[y][x] = Yballoon_nB;
3332 if(Cave[y-2][x+1] == Xblank) Cave[y-2][x+1] = Yacid_splash_eB;
3333 if(Cave[y-2][x-1] == Xblank) Cave[y-2][x-1] = Yacid_splash_wB;
3334 Next[y][x] = Xblank;
3338 case Yacid_splash_eB:
3339 case Yacid_splash_wB:
3340 Cave[y][x] = Yballoon_nB;
3341 Cave[y-1][x] = Yballoon_n;
3342 Next[y][x] = Xblank;
3343 Next[y-1][x] = Xballoon;
3349 switch(Cave[y][x+1]) {
3358 Cave[y][x] = Yballoon_eB;
3359 if(Cave[y-1][x+2] == Xblank) Cave[y-1][x+2] = Yacid_splash_eB;
3360 if(Cave[y-1][x] == Xblank) Cave[y-1][x] = Yacid_splash_wB;
3361 Next[y][x] = Xblank;
3365 case Yacid_splash_eB:
3366 case Yacid_splash_wB:
3367 Cave[y][x] = Yballoon_eB;
3368 Cave[y][x+1] = Yballoon_e;
3369 Next[y][x] = Xblank;
3370 Next[y][x+1] = Xballoon;
3376 switch(Cave[y+1][x]) {
3385 Cave[y][x] = Yballoon_sB;
3386 if(Cave[y][x+1] == Xblank) Cave[y][x+1] = Yacid_splash_eB;
3387 if(Cave[y][x-1] == Xblank) Cave[y][x-1] = Yacid_splash_wB;
3388 Next[y][x] = Xblank;
3392 case Yacid_splash_eB:
3393 case Yacid_splash_wB:
3394 Cave[y][x] = Yballoon_sB;
3395 Cave[y+1][x] = Yballoon_s;
3396 Next[y][x] = Xblank;
3397 Next[y+1][x] = Xballoon;
3403 switch(Cave[y][x-1]) {
3412 Cave[y][x] = Yballoon_wB;
3413 if(Cave[y-1][x] == Xblank) Cave[y-1][x] = Yacid_splash_eB;
3414 if(Cave[y-1][x-2] == Xblank) Cave[y-1][x-2] = Yacid_splash_wB;
3415 Next[y][x] = Xblank;
3419 case Yacid_splash_eB:
3420 case Yacid_splash_wB:
3421 Cave[y][x] = Yballoon_wB;
3422 Cave[y][x-1] = Yballoon_w;
3423 Next[y][x] = Xblank;
3424 Next[y][x-1] = Xballoon;
3430 /* ---------------------------------------------------------------------- */
3432 Next[y][x] = Xacid_2;
3435 Next[y][x] = Xacid_3;
3438 Next[y][x] = Xacid_4;
3441 Next[y][x] = Xacid_5;
3444 Next[y][x] = Xacid_6;
3447 Next[y][x] = Xacid_7;
3450 Next[y][x] = Xacid_8;
3453 Next[y][x] = Xacid_1;
3455 /* ---------------------------------------------------------------------- */
3457 if(lev.ball_state == 0) goto loop;
3458 Cave[y][x] = Xball_1B;
3459 Next[y][x] = Xball_2;
3460 if(lev.ball_cnt) goto loop;
3463 if(lev.ball_state == 0) goto loop;
3464 Cave[y][x] = Xball_2B;
3465 Next[y][x] = Xball_1;
3466 if(lev.ball_cnt) goto loop;
3469 play[SAMPLE_ball] = 1;
3470 if(lev.ball_random) {
3471 switch(RANDOM & 7) {
3473 if(lev.ball_array[lev.ball_pos][0] != Xblank && tab_blank[Cave[y-1][x-1]]) {
3474 Cave[y-1][x-1] = Yball_eat;
3475 Next[y-1][x-1] = lev.ball_array[lev.ball_pos][0];
3479 if(lev.ball_array[lev.ball_pos][1] != Xblank && tab_blank[Cave[y-1][x]]) {
3480 Cave[y-1][x] = Yball_eat;
3481 Next[y-1][x] = lev.ball_array[lev.ball_pos][1];
3485 if(lev.ball_array[lev.ball_pos][2] != Xblank && tab_blank[Cave[y-1][x+1]]) {
3486 Cave[y-1][x+1] = Yball_eat;
3487 Next[y-1][x+1] = lev.ball_array[lev.ball_pos][2];
3491 if(lev.ball_array[lev.ball_pos][3] != Xblank && tab_blank[Cave[y][x-1]]) {
3492 Cave[y][x-1] = Yball_eat;
3493 Next[y][x-1] = lev.ball_array[lev.ball_pos][3];
3497 if(lev.ball_array[lev.ball_pos][4] != Xblank && tab_blank[Cave[y][x+1]]) {
3498 Cave[y][x+1] = Yball_eat;
3499 Next[y][x+1] = lev.ball_array[lev.ball_pos][4];
3503 if(lev.ball_array[lev.ball_pos][5] != Xblank && tab_blank[Cave[y+1][x-1]]) {
3504 Cave[y+1][x-1] = Yball_eat;
3505 Next[y+1][x-1] = lev.ball_array[lev.ball_pos][5];
3509 if(lev.ball_array[lev.ball_pos][6] != Xblank && tab_blank[Cave[y+1][x]]) {
3510 Cave[y+1][x] = Yball_eat;
3511 Next[y+1][x] = lev.ball_array[lev.ball_pos][6];
3515 if(lev.ball_array[lev.ball_pos][7] != Xblank && tab_blank[Cave[y+1][x+1]]) {
3516 Cave[y+1][x+1] = Yball_eat;
3517 Next[y+1][x+1] = lev.ball_array[lev.ball_pos][7];
3522 if(lev.ball_array[lev.ball_pos][0] != Xblank && tab_blank[Cave[y-1][x-1]]) {
3523 Cave[y-1][x-1] = Yball_eat;
3524 Next[y-1][x-1] = lev.ball_array[lev.ball_pos][0];
3526 if(lev.ball_array[lev.ball_pos][1] != Xblank && tab_blank[Cave[y-1][x]]) {
3527 Cave[y-1][x] = Yball_eat;
3528 Next[y-1][x] = lev.ball_array[lev.ball_pos][1];
3530 if(lev.ball_array[lev.ball_pos][2] != Xblank && tab_blank[Cave[y-1][x+1]]) {
3531 Cave[y-1][x+1] = Yball_eat;
3532 Next[y-1][x+1] = lev.ball_array[lev.ball_pos][2];
3534 if(lev.ball_array[lev.ball_pos][3] != Xblank && tab_blank[Cave[y][x-1]]) {
3535 Cave[y][x-1] = Yball_eat;
3536 Next[y][x-1] = lev.ball_array[lev.ball_pos][3];
3538 if(lev.ball_array[lev.ball_pos][4] != Xblank && tab_blank[Cave[y][x+1]]) {
3539 Cave[y][x+1] = Yball_eat;
3540 Next[y][x+1] = lev.ball_array[lev.ball_pos][4];
3542 if(lev.ball_array[lev.ball_pos][5] != Xblank && tab_blank[Cave[y+1][x-1]]) {
3543 Cave[y+1][x-1] = Yball_eat;
3544 Next[y+1][x-1] = lev.ball_array[lev.ball_pos][5];
3546 if(lev.ball_array[lev.ball_pos][6] != Xblank && tab_blank[Cave[y+1][x]]) {
3547 Cave[y+1][x] = Yball_eat;
3548 Next[y+1][x] = lev.ball_array[lev.ball_pos][6];
3550 if(lev.ball_array[lev.ball_pos][7] != Xblank && tab_blank[Cave[y+1][x+1]]) {
3551 Cave[y+1][x+1] = Yball_eat;
3552 Next[y+1][x+1] = lev.ball_array[lev.ball_pos][7];
3555 lev.ball_pos = (lev.ball_pos + 1) & 7;
3557 /* ---------------------------------------------------------------------- */
3559 if(tab_blank[Cave[y-1][x]]) {
3560 Cave[y-1][x] = Ygrow_ns_eat;
3561 Next[y-1][x] = Xgrow_ns;
3562 play[SAMPLE_grow] = 1;
3564 if(tab_blank[Cave[y+1][x]]) {
3565 Cave[y+1][x] = Ygrow_ns_eat;
3566 Next[y+1][x] = Xgrow_ns;
3567 play[SAMPLE_grow] = 1;
3571 if(tab_blank[Cave[y][x+1]]) {
3572 Cave[y][x+1] = Ygrow_ew_eat;
3573 Next[y][x+1] = Xgrow_ew;
3574 play[SAMPLE_grow] = 1;
3576 if(tab_blank[Cave[y][x-1]]) {
3577 Cave[y][x-1] = Ygrow_ew_eat;
3578 Next[y][x-1] = Xgrow_ew;
3579 play[SAMPLE_grow] = 1;
3582 /* ---------------------------------------------------------------------- */
3584 if(lev.wonderwall_time && lev.wonderwall_state) {
3585 Cave[y][x] = XwonderwallB;
3586 play[SAMPLE_wonder] = 1;
3589 /* ---------------------------------------------------------------------- */
3591 if(lev.required > 0) goto loop;
3594 Cave[y][x] = Xexit_1;
3595 Next[y][x] = Xexit_2;
3596 } else if(temp < 42) {
3597 Cave[y][x] = Xexit_2;
3598 Next[y][x] = Xexit_3;
3600 Cave[y][x] = Xexit_3;
3601 Next[y][x] = Xexit_1;
3605 Next[y][x] = Xexit_2;
3608 Next[y][x] = Xexit_3;
3611 Next[y][x] = Xexit_1;
3613 /* ---------------------------------------------------------------------- */
3615 play[SAMPLE_tick] = 1;
3616 Next[y][x] = Xdynamite_2;
3619 play[SAMPLE_tick] = 1;
3620 Next[y][x] = Xdynamite_3;
3623 play[SAMPLE_tick] = 1;
3624 Next[y][x] = Xdynamite_4;
3627 play[SAMPLE_tick] = 1;
3628 Next[y][x] = Zdynamite;
3629 Boom[y-1][x-1] = Xblank;
3630 Boom[y-1][x] = Xblank;
3631 Boom[y-1][x+1] = Xblank;
3632 Boom[y][x-1] = Xblank;
3633 Boom[y][x] = Xblank;
3634 Boom[y][x+1] = Xblank;
3635 Boom[y+1][x-1] = Xblank;
3636 Boom[y+1][x] = Xblank;
3637 Boom[y+1][x+1] = Xblank;
3639 /* ---------------------------------------------------------------------- */
3641 if(lev.wheel_cnt && x == lev.wheel_x && y == lev.wheel_y) Cave[y][x] = XwheelB;
3643 /* ---------------------------------------------------------------------- */
3645 if(lev.ball_state) Cave[y][x] = XswitchB;
3647 /* ---------------------------------------------------------------------- */
3649 switch(Cave[y+1][x]) {
3658 Cave[y][x] = Xsand_stonesand_3;
3659 if(Cave[y][x+1] == Xblank) Cave[y][x+1] = Yacid_splash_eB;
3660 if(Cave[y][x-1] == Xblank) Cave[y][x-1] = Yacid_splash_wB;
3661 Next[y][x] = Xsand_stonesand_4;
3665 case Yacid_splash_eB:
3666 case Yacid_splash_wB:
3667 Cave[y][x] = Xsand_stonesand_3;
3668 Cave[y+1][x] = Xsand_stoneout_1;
3669 Next[y][x] = Xsand_stonesand_4;
3670 Next[y+1][x] = Xsand_stoneout_2;
3673 Cave[y][x] = Xsand_stonesand_1;
3674 Cave[y+1][x] = Xsand_sandstone_1;
3675 Next[y][x] = Xsand_stonesand_2;
3676 Next[y+1][x] = Xsand_sandstone_2;
3681 case Xsand_stonein_1:
3682 Next[y][x] = Xsand_stonein_2;
3684 case Xsand_stonein_2:
3685 Next[y][x] = Xsand_stonein_3;
3687 case Xsand_stonein_3:
3688 Next[y][x] = Xsand_stonein_4;
3690 case Xsand_stonein_4:
3691 Next[y][x] = Xblank;
3693 case Xsand_stonesand_1:
3694 Next[y][x] = Xsand_stonesand_2;
3696 case Xsand_stonesand_2:
3697 Next[y][x] = Xsand_stonesand_3;
3699 case Xsand_stonesand_3:
3700 Next[y][x] = Xsand_stonesand_4;
3702 case Xsand_stonesand_4:
3705 case Xsand_stoneout_1:
3706 Next[y][x] = Xsand_stoneout_2;
3708 case Xsand_stoneout_2:
3709 Next[y][x] = Xstone_fall;
3711 case Xsand_sandstone_1:
3712 Next[y][x] = Xsand_sandstone_2;
3714 case Xsand_sandstone_2:
3715 Next[y][x] = Xsand_sandstone_3;
3717 case Xsand_sandstone_3:
3718 Next[y][x] = Xsand_sandstone_4;
3720 case Xsand_sandstone_4:
3721 Next[y][x] = Xsand_stone;
3723 /* ---------------------------------------------------------------------- */
3725 if(lev.lenses_cnt) Cave[y][x] = XdripperB;
3727 /* ---------------------------------------------------------------------- */
3729 if(lev.lenses_cnt) Cave[y][x] = Xfake_blankB;
3731 /* ---------------------------------------------------------------------- */
3733 if(lev.magnify_cnt) Cave[y][x] = Xfake_grassB;
3735 /* ---------------------------------------------------------------------- */
3737 if(lev.magnify_cnt) Cave[y][x] = Xdoor_1;
3740 if(lev.magnify_cnt) Cave[y][x] = Xdoor_2;
3743 if(lev.magnify_cnt) Cave[y][x] = Xdoor_3;
3746 if(lev.magnify_cnt) Cave[y][x] = Xdoor_4;
3749 if(lev.magnify_cnt) Cave[y][x] = Xdoor_5;
3752 if(lev.magnify_cnt) Cave[y][x] = Xdoor_6;
3755 if(lev.magnify_cnt) Cave[y][x] = Xdoor_7;
3758 if(lev.magnify_cnt) Cave[y][x] = Xdoor_8;
3760 /* ---------------------------------------------------------------------- */
3763 Next[y][x] = Znormal;
3764 Boom[y-1][x-1] = Xemerald;
3765 Boom[y-1][x] = Xemerald;
3766 Boom[y-1][x+1] = Xemerald;
3767 Boom[y][x-1] = Xemerald;
3768 Boom[y][x] = Xdiamond;
3769 Boom[y][x+1] = Xemerald;
3770 Boom[y+1][x-1] = Xemerald;
3771 Boom[y+1][x] = Xemerald;
3772 Boom[y+1][x+1] = Xemerald;
3776 Next[y][x] = Znormal;
3777 Boom[y-1][x-1] = Xblank;
3778 Boom[y-1][x] = Xblank;
3779 Boom[y-1][x+1] = Xblank;
3780 Boom[y][x-1] = Xblank;
3781 Boom[y][x] = Xblank;
3782 Boom[y][x+1] = Xblank;
3783 Boom[y+1][x-1] = Xblank;
3784 Boom[y+1][x] = Xblank;
3785 Boom[y+1][x+1] = Xblank;
3789 Next[y][x] = Xboom_2;
3790 play[SAMPLE_boom] = 1;
3793 Next[y][x] = Boom[y][x];
3795 /* ---------------------------------------------------------------------- */
3797 if(++y < HEIGHT - 1) {
3799 cave_cache = Cave[y];
3810 if(ply1.alive || ply2.alive) lev.score += score; /* only get a score if someone is alive */
3813 void *temp = Cave; Cave = Next; Next = Draw; Draw = temp; /* triple buffering */