+ case Xbomb:
+ case Xbomb_pause:
+ Cave[x][y+1] = Ybomb_blank;
+ Next[x][y+1] = Znormal;
+ Boom[x-1][y] = Xblank;
+ Boom[x][y] = Xblank;
+ Boom[x+1][y] = Xblank;
+ Boom[x-1][y+1] = Xblank;
+ Boom[x][y+1] = Xblank;
+ Boom[x+1][y+1] = Xblank;
+ Boom[x-1][y+2] = Xblank;
+ Boom[x][y+2] = Xblank;
+ Boom[x+1][y+2] = Xblank;
+#if PLAY_ELEMENT_SOUND
+ play_element_sound(x, y, SOUND_boom, Xstone_fall);
+#endif
+ return;
+
+ case Xwonderwall:
+ if (lev.wonderwall_time)
+ {
+ lev.wonderwall_state = 1;
+ Cave[x][y] = Ystone_sB;
+
+ if (tab_blank[Cave[x][y+2]])
+ {
+ Cave[x][y+2] = Yemerald_s;
+ Next[x][y+2] = Xemerald_fall;
+ }
+
+ Next[x][y] = Xblank;
+ play_element_sound(x, y, SOUND_wonderfall, Xwonderwall);
+ return;
+ }
+
+ default:
+ Cave[x][y] = Xstone;
+ Next[x][y] = Xstone;
+ play_element_sound(x, y, SOUND_stone, Xstone);
+ return;
+ }
+}
+
+static void Lbomb(int x, int y)
+{
+ switch (Cave[x][y+1])
+ {
+ case Xacid_1:
+ case Xacid_2:
+ case Xacid_3:
+ case Xacid_4:
+ case Xacid_5:
+ case Xacid_6:
+ case Xacid_7:
+ case Xacid_8:
+ Cave[x][y] = Ybomb_sB;
+ if (Cave[x+1][y] == Xblank)
+ Cave[x+1][y] = Xacid_splash_e;
+ if (Cave[x-1][y] == Xblank)
+ Cave[x-1][y] = Xacid_splash_w;
+ Next[x][y] = Xblank;
+ play_element_sound(x, y, SOUND_acid, Xacid_1);
+ return;
+
+ case Xblank:
+ case Xacid_splash_e:
+ case Xacid_splash_w:
+ Cave[x][y] = Ybomb_sB;
+ Cave[x][y+1] = Ybomb_s;
+ Next[x][y] = Xblank;
+ Next[x][y+1] = Xbomb_fall;
+ return;
+
+ case Xspring:
+ case Xspring_pause:
+ case Xspring_e:
+ case Xspring_w:
+ case Xandroid:
+ case Xandroid_1_n:
+ case Xandroid_2_n:
+ case Xandroid_1_e:
+ case Xandroid_2_e:
+ case Xandroid_1_s:
+ case Xandroid_2_s:
+ case Xandroid_1_w:
+ case Xandroid_2_w:
+ case Xstone:
+ case Xstone_pause:
+ case Xemerald:
+ case Xemerald_pause:
+ case Xdiamond:
+ case Xdiamond_pause:
+ case Xbomb:
+ case Xbomb_pause:
+ case Xballoon:
+ case Xacid_ne:
+ case Xacid_nw:
+ case Xball_1:
+ case Xball_2:
+ case Xnut:
+ case Xnut_pause:
+ case Xslidewall_ns:
+ case Xslidewall_ew:
+ case Xkey_1:
+ case Xkey_2:
+ case Xkey_3:
+ case Xkey_4:
+ case Xkey_5:
+ case Xkey_6:
+ case Xkey_7:
+ case Xkey_8:
+ case Xbumper:
+ case Xswitch:
+ case Xroundwall_1:
+ case Xroundwall_2:
+ case Xroundwall_3:
+ case Xroundwall_4:
+ if (RANDOM(2))
+ {
+ if (tab_blank[Cave[x+1][y]] && tab_acid[Cave[x+1][y+1]])
+ {
+ Cave[x][y] = Ybomb_eB;
+ Cave[x+1][y] = Ybomb_e;
+ Next[x][y] = Xblank;
+ Next[x+1][y] = Xbomb_pause;
+ return;
+ }
+
+ if (tab_blank[Cave[x-1][y]] && tab_acid[Cave[x-1][y+1]])
+ {
+ Cave[x][y] = Ybomb_wB;
+ Cave[x-1][y] = Ybomb_w;
+ Next[x][y] = Xblank;
+ Next[x-1][y] = Xbomb_pause;
+ return;
+ }
+ }
+ else
+ {
+ if (tab_blank[Cave[x-1][y]] && tab_acid[Cave[x-1][y+1]])
+ {
+ Cave[x][y] = Ybomb_wB;
+ Cave[x-1][y] = Ybomb_w;
+ Next[x][y] = Xblank;
+ Next[x-1][y] = Xbomb_pause;
+ return;
+ }
+
+ if (tab_blank[Cave[x+1][y]] && tab_acid[Cave[x+1][y+1]])
+ {
+ Cave[x][y] = Ybomb_eB;
+ Cave[x+1][y] = Ybomb_e;
+ Next[x][y] = Xblank;
+ Next[x+1][y] = Xbomb_pause;
+ return;
+ }
+ }
+ }
+}
+
+static void Lbomb_pause(int x, int y)
+{
+ switch (Cave[x][y+1])
+ {
+ case Xacid_1:
+ case Xacid_2:
+ case Xacid_3:
+ case Xacid_4:
+ case Xacid_5:
+ case Xacid_6:
+ case Xacid_7:
+ case Xacid_8:
+ Cave[x][y] = Ybomb_sB;
+ if (Cave[x+1][y] == Xblank)
+ Cave[x+1][y] = Xacid_splash_e;
+ if (Cave[x-1][y] == Xblank)
+ Cave[x-1][y] = Xacid_splash_w;
+ Next[x][y] = Xblank;
+ play_element_sound(x, y, SOUND_acid, Xacid_1);
+ return;
+
+ case Xblank:
+ case Xacid_splash_e:
+ case Xacid_splash_w:
+ Cave[x][y] = Ybomb_sB;
+ Cave[x][y+1] = Ybomb_s;
+ Next[x][y] = Xblank;
+ Next[x][y+1] = Xbomb_fall;
+ return;
+
+ default:
+ Cave[x][y] = Xbomb;
+ Next[x][y] = Xbomb;
+ return;
+ }
+}
+
+static void Lbomb_fall(int x, int y)
+{
+ switch (Cave[x][y+1])
+ {
+ case Xacid_1:
+ case Xacid_2:
+ case Xacid_3:
+ case Xacid_4:
+ case Xacid_5:
+ case Xacid_6:
+ case Xacid_7:
+ case Xacid_8:
+ Cave[x][y] = Ybomb_sB;
+ if (Cave[x+1][y] == Xblank)
+ Cave[x+1][y] = Xacid_splash_e;
+ if (Cave[x-1][y] == Xblank)
+ Cave[x-1][y] = Xacid_splash_w;
+ Next[x][y] = Xblank;
+ play_element_sound(x, y, SOUND_acid, Xacid_1);
+ return;
+
+ case Xblank:
+ case Xacid_splash_e:
+ case Xacid_splash_w:
+ Cave[x][y] = Ybomb_sB;
+ Cave[x][y+1] = Ybomb_s;
+ Next[x][y] = Xblank;
+ Next[x][y+1] = Xbomb_fall;
+ return;
+
+ default:
+ Cave[x][y] = Ybomb_blank;
+ Next[x][y] = Znormal;
+ Boom[x-1][y-1] = Xblank;
+ Boom[x][y-1] = Xblank;
+ Boom[x+1][y-1] = Xblank;
+ Boom[x-1][y] = Xblank;
+ Boom[x][y] = Xblank;
+ Boom[x+1][y] = Xblank;
+ Boom[x-1][y+1] = Xblank;
+ Boom[x][y+1] = Xblank;
+ Boom[x+1][y+1] = Xblank;
+#if PLAY_ELEMENT_SOUND
+ play_element_sound(x, y, SOUND_boom, Xbomb_fall);
+#endif
+ return;
+ }
+}
+
+static void Lnut(int x, int y)
+{
+ switch (Cave[x][y+1])
+ {
+ case Xacid_1:
+ case Xacid_2:
+ case Xacid_3:
+ case Xacid_4:
+ case Xacid_5:
+ case Xacid_6:
+ case Xacid_7:
+ case Xacid_8:
+ Cave[x][y] = Ynut_sB;
+ if (Cave[x+1][y] == Xblank)
+ Cave[x+1][y] = Xacid_splash_e;
+ if (Cave[x-1][y] == Xblank)
+ Cave[x-1][y] = Xacid_splash_w;
+ Next[x][y] = Xblank;
+ play_element_sound(x, y, SOUND_acid, Xacid_1);
+ return;
+
+ case Xblank:
+ case Xacid_splash_e:
+ case Xacid_splash_w:
+ Cave[x][y] = Ynut_sB;
+ Cave[x][y+1] = Ynut_s;
+ Next[x][y] = Xblank;
+ Next[x][y+1] = Xnut_fall;
+ return;
+
+ case Xspring:
+ case Xspring_pause:
+ case Xspring_e:
+ case Xspring_w:
+ case Xandroid:
+ case Xandroid_1_n:
+ case Xandroid_2_n:
+ case Xandroid_1_e:
+ case Xandroid_2_e:
+ case Xandroid_1_s:
+ case Xandroid_2_s:
+ case Xandroid_1_w:
+ case Xandroid_2_w:
+ case Xstone:
+ case Xstone_pause:
+ case Xemerald:
+ case Xemerald_pause:
+ case Xdiamond:
+ case Xdiamond_pause:
+ case Xbomb:
+ case Xbomb_pause:
+ case Xballoon:
+ case Xacid_ne:
+ case Xacid_nw:
+ case Xball_1:
+ case Xball_2:
+ case Xnut:
+ case Xnut_pause:
+ case Xslidewall_ns:
+ case Xslidewall_ew:
+ case Xkey_1:
+ case Xkey_2:
+ case Xkey_3:
+ case Xkey_4:
+ case Xkey_5:
+ case Xkey_6:
+ case Xkey_7:
+ case Xkey_8:
+ case Xbumper:
+ case Xswitch:
+ case Xroundwall_1:
+ case Xroundwall_2:
+ case Xroundwall_3:
+ case Xroundwall_4:
+ if (RANDOM(2))
+ {
+ if (tab_blank[Cave[x+1][y]] && tab_acid[Cave[x+1][y+1]])
+ {
+ Cave[x][y] = Ynut_eB;
+ Cave[x+1][y] = Ynut_e;
+ Next[x][y] = Xblank;
+ Next[x+1][y] = Xnut_pause;
+ return;
+ }
+
+ if (tab_blank[Cave[x-1][y]] && tab_acid[Cave[x-1][y+1]])
+ {
+ Cave[x][y] = Ynut_wB;
+ Cave[x-1][y] = Ynut_w;
+ Next[x][y] = Xblank;
+ Next[x-1][y] = Xnut_pause;
+ return;
+ }
+ }
+ else
+ {
+ if (tab_blank[Cave[x-1][y]] && tab_acid[Cave[x-1][y+1]])
+ {
+ Cave[x][y] = Ynut_wB;
+ Cave[x-1][y] = Ynut_w;
+ Next[x][y] = Xblank;
+ Next[x-1][y] = Xnut_pause;
+ return;
+ }
+
+ if (tab_blank[Cave[x+1][y]] && tab_acid[Cave[x+1][y+1]])
+ {
+ Cave[x][y] = Ynut_eB;
+ Cave[x+1][y] = Ynut_e;
+ Next[x][y] = Xblank;
+ Next[x+1][y] = Xnut_pause;
+ return;
+ }
+ }
+ }
+}
+
+static void Lnut_pause(int x, int y)
+{
+ switch (Cave[x][y+1])
+ {
+ case Xacid_1:
+ case Xacid_2:
+ case Xacid_3:
+ case Xacid_4:
+ case Xacid_5:
+ case Xacid_6:
+ case Xacid_7:
+ case Xacid_8:
+ Cave[x][y] = Ynut_sB;
+ if (Cave[x+1][y] == Xblank)
+ Cave[x+1][y] = Xacid_splash_e;
+ if (Cave[x-1][y] == Xblank)
+ Cave[x-1][y] = Xacid_splash_w;
+ Next[x][y] = Xblank;
+ play_element_sound(x, y, SOUND_acid, Xacid_1);
+ return;
+
+ case Xblank:
+ case Xacid_splash_e:
+ case Xacid_splash_w:
+ Cave[x][y] = Ynut_sB;
+ Cave[x][y+1] = Ynut_s;
+ Next[x][y] = Xblank;
+ Next[x][y+1] = Xnut_fall;
+ return;
+
+ default:
+ Cave[x][y] = Xnut;
+ Next[x][y] = Xnut;
+ return;
+ }
+}
+
+static void Lnut_fall(int x, int y)
+{
+ switch (Cave[x][y+1])
+ {
+ case Xacid_1:
+ case Xacid_2:
+ case Xacid_3:
+ case Xacid_4:
+ case Xacid_5:
+ case Xacid_6:
+ case Xacid_7:
+ case Xacid_8:
+ Cave[x][y] = Ynut_sB;
+ if (Cave[x+1][y] == Xblank)
+ Cave[x+1][y] = Xacid_splash_e;
+ if (Cave[x-1][y] == Xblank)
+ Cave[x-1][y] = Xacid_splash_w;
+ Next[x][y] = Xblank;
+ play_element_sound(x, y, SOUND_acid, Xacid_1);
+ return;
+
+ case Xblank:
+ case Xacid_splash_e:
+ case Xacid_splash_w:
+ case Zplayer:
+ Cave[x][y] = Ynut_sB;
+ Cave[x][y+1] = Ynut_s;
+ Next[x][y] = Xblank;
+ Next[x][y+1] = Xnut_fall;
+ return;
+
+ default:
+ Cave[x][y] = Xnut;
+ Next[x][y] = Xnut;
+ play_element_sound(x, y, SOUND_nut, Xnut);
+ return;
+ }
+}
+
+static void Lspring(int x, int y)
+{
+ switch (Cave[x][y+1])
+ {
+ case Xacid_1:
+ case Xacid_2:
+ case Xacid_3:
+ case Xacid_4:
+ case Xacid_5:
+ case Xacid_6:
+ case Xacid_7:
+ case Xacid_8:
+ Cave[x][y] = Yspring_sB;
+ if (Cave[x+1][y] == Xblank)
+ Cave[x+1][y] = Xacid_splash_e;
+ if (Cave[x-1][y] == Xblank)
+ Cave[x-1][y] = Xacid_splash_w;
+ Next[x][y] = Xblank;
+ play_element_sound(x, y, SOUND_acid, Xacid_1);
+ return;
+
+ case Xblank:
+ case Xacid_splash_e:
+ case Xacid_splash_w:
+ case Xplant:
+ case Yplant:
+ Cave[x][y] = Yspring_sB;
+ Cave[x][y+1] = Yspring_s;
+ Next[x][y] = Xblank;
+ Next[x][y+1] = Xspring_fall;
+ return;
+
+ case Xspring:
+ case Xspring_pause:
+ case Xspring_e:
+ case Xspring_w:
+ case Xandroid:
+ case Xandroid_1_n:
+ case Xandroid_2_n:
+ case Xandroid_1_e:
+ case Xandroid_2_e:
+ case Xandroid_1_s:
+ case Xandroid_2_s:
+ case Xandroid_1_w:
+ case Xandroid_2_w:
+ case Xstone:
+ case Xstone_pause:
+ case Xemerald:
+ case Xemerald_pause:
+ case Xdiamond:
+ case Xdiamond_pause:
+ case Xbomb:
+ case Xbomb_pause:
+ case Xballoon:
+ case Xacid_ne:
+ case Xacid_nw:
+ case Xball_1:
+ case Xball_2:
+ case Xnut:
+ case Xnut_pause:
+ case Xslidewall_ns:
+ case Xslidewall_ew:
+ case Xkey_1:
+ case Xkey_2:
+ case Xkey_3:
+ case Xkey_4:
+ case Xkey_5:
+ case Xkey_6:
+ case Xkey_7:
+ case Xkey_8:
+ case Xbumper:
+ case Xswitch:
+ case Xroundwall_1:
+ case Xroundwall_2:
+ case Xroundwall_3:
+ case Xroundwall_4:
+ if (RANDOM(2))
+ {
+ if (tab_blank[Cave[x+1][y]] && tab_acid[Cave[x+1][y+1]])
+ {
+ Cave[x][y] = Yspring_eB;
+ Cave[x+1][y] = Yspring_e;
+ if (Cave[x][y+1] == Xbumper)
+ Cave[x][y+1] = XbumperB;
+ Next[x][y] = Xblank;
+
+#ifdef SPRING_ROLL
+ Next[x+1][y] = Xspring_e;
+#else
+ Next[x+1][y] = Xspring_pause;
+#endif
+ return;
+ }
+
+ if (tab_blank[Cave[x-1][y]] && tab_acid[Cave[x-1][y+1]])
+ {
+ Cave[x][y] = Yspring_wB;
+ Cave[x-1][y] = Yspring_w;
+ if (Cave[x][y+1] == Xbumper)
+ Cave[x][y+1] = XbumperB;
+ Next[x][y] = Xblank;
+
+#ifdef SPRING_ROLL
+ Next[x-1][y] = Xspring_w;
+#else
+ Next[x-1][y] = Xspring_pause;
+#endif
+ return;
+ }
+ }
+ else
+ {
+ if (tab_blank[Cave[x-1][y]] && tab_acid[Cave[x-1][y+1]])
+ {
+ Cave[x][y] = Yspring_wB;
+ Cave[x-1][y] = Yspring_w;
+ if (Cave[x][y+1] == Xbumper)
+ Cave[x][y+1] = XbumperB;
+ Next[x][y] = Xblank;
+
+#ifdef SPRING_ROLL
+ Next[x-1][y] = Xspring_w;
+#else
+ Next[x-1][y] = Xspring_pause;
+#endif
+ return;
+ }
+
+ if (tab_blank[Cave[x+1][y]] && tab_acid[Cave[x+1][y+1]])
+ {
+ Cave[x][y] = Yspring_eB;
+ Cave[x+1][y] = Yspring_e;
+ if (Cave[x][y+1] == Xbumper)
+ Cave[x][y+1] = XbumperB;
+ Next[x][y] = Xblank;
+
+#ifdef SPRING_ROLL
+ Next[x+1][y] = Xspring_e;
+#else
+ Next[x+1][y] = Xspring_pause;
+#endif
+ return;
+ }
+ }
+ }
+}
+
+static void Lspring_pause(int x, int y)
+{
+ switch (Cave[x][y+1])
+ {
+ case Xacid_1:
+ case Xacid_2:
+ case Xacid_3:
+ case Xacid_4:
+ case Xacid_5:
+ case Xacid_6:
+ case Xacid_7:
+ case Xacid_8:
+ Cave[x][y] = Yspring_sB;
+ if (Cave[x+1][y] == Xblank)
+ Cave[x+1][y] = Xacid_splash_e;
+ if (Cave[x-1][y] == Xblank)
+ Cave[x-1][y] = Xacid_splash_w;
+ Next[x][y] = Xblank;
+ play_element_sound(x, y, SOUND_acid, Xacid_1);
+ return;
+
+ case Xblank:
+ case Xacid_splash_e:
+ case Xacid_splash_w:
+ Cave[x][y] = Yspring_sB;
+ Cave[x][y+1] = Yspring_s;
+ Next[x][y] = Xblank;
+ Next[x][y+1] = Xspring_fall;
+ return;
+
+ default:
+ Cave[x][y] = Xspring;
+ Next[x][y] = Xspring;
+ return;
+ }
+}
+
+static void Lspring_e(int x, int y)
+{
+ switch (Cave[x][y+1])
+ {
+ case Xacid_1:
+ case Xacid_2:
+ case Xacid_3:
+ case Xacid_4:
+ case Xacid_5:
+ case Xacid_6:
+ case Xacid_7:
+ case Xacid_8:
+ Cave[x][y] = Yspring_sB;
+ if (Cave[x+1][y] == Xblank)
+ Cave[x+1][y] = Xacid_splash_e;
+ if (Cave[x-1][y] == Xblank)
+ Cave[x-1][y] = Xacid_splash_w;
+ Next[x][y] = Xblank;
+ play_element_sound(x, y, SOUND_acid, Xacid_1);
+ return;
+
+ case Xblank:
+ case Xacid_splash_e:
+ case Xacid_splash_w:
+ Cave[x][y] = Yspring_sB;
+ Cave[x][y+1] = Yspring_s;
+ Next[x][y] = Xblank;
+ Next[x][y+1] = Xspring_fall;
+ return;
+
+ case Xbumper:
+ Cave[x][y+1] = XbumperB;
+ }
+
+ switch (Cave[x+1][y])
+ {
+ case Xacid_1:
+ case Xacid_2:
+ case Xacid_3:
+ case Xacid_4:
+ case Xacid_5:
+ case Xacid_6:
+ case Xacid_7:
+ case Xacid_8:
+ Cave[x][y] = Yspring_eB;
+ if (Cave[x+2][y-1] == Xblank)
+ Cave[x+2][y-1] = Xacid_splash_e;
+ if (Cave[x][y-1] == Xblank)
+ Cave[x][y-1] = Xacid_splash_w;
+ Next[x][y] = Xblank;
+ play_element_sound(x, y, SOUND_acid, Xacid_1);
+ return;
+
+ case Xblank:
+ case Xacid_splash_e:
+ case Xacid_splash_w:
+ case Yalien_nB:
+ case Yalien_eB:
+ case Yalien_sB:
+ case Yalien_wB:
+ Cave[x][y] = Yspring_eB;
+ Cave[x+1][y] = Yspring_e;
+ Next[x][y] = Xblank;
+ Next[x+1][y] = Xspring_e;
+ return;
+
+ case Xalien:
+ case Xalien_pause:
+ case Yalien_n:
+ case Yalien_e:
+ case Yalien_s:
+ case Yalien_w:
+ Cave[x][y] = Yspring_alien_eB;
+ Cave[x+1][y] = Yspring_alien_e;
+ Next[x][y] = Xblank;
+ Next[x+1][y] = Xspring_e;
+ play_element_sound(x, y, SOUND_slurp, Xalien);
+ score += lev.slurp_score;
+ return;
+
+ case Xbumper:
+ case XbumperB:
+ Cave[x+1][y] = XbumperB;
+ Next[x][y] = Xspring_w;
+ play_element_sound(x, y, SOUND_spring, Xspring);
+ return;
+
+ default:
+ Cave[x][y] = Xspring;
+ Next[x][y] = Xspring;
+ play_element_sound(x, y, SOUND_spring, Xspring);
+ return;
+ }
+}
+
+static void Lspring_w(int x, int y)
+{
+ switch (Cave[x][y+1])
+ {
+ case Xacid_1:
+ case Xacid_2:
+ case Xacid_3:
+ case Xacid_4:
+ case Xacid_5:
+ case Xacid_6:
+ case Xacid_7:
+ case Xacid_8:
+ Cave[x][y] = Yspring_sB;
+ if (Cave[x+1][y] == Xblank)
+ Cave[x+1][y] = Xacid_splash_e;
+ if (Cave[x-1][y] == Xblank)
+ Cave[x-1][y] = Xacid_splash_w;
+ Next[x][y] = Xblank;
+ play_element_sound(x, y, SOUND_acid, Xacid_1);
+ return;
+
+ case Xblank:
+ case Xacid_splash_e:
+ case Xacid_splash_w:
+ Cave[x][y] = Yspring_sB;
+ Cave[x][y+1] = Yspring_s;
+ Next[x][y] = Xblank;
+ Next[x][y+1] = Xspring_fall;
+ return;
+
+ case Xbumper:
+ Cave[x][y+1] = XbumperB;
+ }
+
+ switch (Cave[x-1][y])
+ {
+ case Xacid_1:
+ case Xacid_2:
+ case Xacid_3:
+ case Xacid_4:
+ case Xacid_5:
+ case Xacid_6:
+ case Xacid_7:
+ case Xacid_8:
+ Cave[x][y] = Yspring_wB;
+ if (Cave[x][y-1] == Xblank)
+ Cave[x][y-1] = Xacid_splash_e;
+ if (Cave[x-2][y-1] == Xblank)
+ Cave[x-2][y-1] = Xacid_splash_w;
+ Next[x][y] = Xblank;
+ play_element_sound(x, y, SOUND_acid, Xacid_1);
+ return;
+
+ case Xblank:
+ case Xacid_splash_e:
+ case Xacid_splash_w:
+ case Yalien_nB:
+ case Yalien_eB:
+ case Yalien_sB:
+ case Yalien_wB:
+ Cave[x][y] = Yspring_wB;
+ Cave[x-1][y] = Yspring_w;
+ Next[x][y] = Xblank;
+ Next[x-1][y] = Xspring_w;
+ return;
+
+ case Xalien:
+ case Xalien_pause:
+ case Yalien_n:
+ case Yalien_e:
+ case Yalien_s:
+ case Yalien_w:
+ Cave[x][y] = Yspring_alien_wB;
+ Cave[x-1][y] = Yspring_alien_w;
+ Next[x][y] = Xblank;
+ Next[x-1][y] = Xspring_w;
+ play_element_sound(x, y, SOUND_slurp, Xalien);
+ score += lev.slurp_score;
+ return;
+
+ case Xbumper:
+ case XbumperB:
+ Cave[x-1][y] = XbumperB;
+ Next[x][y] = Xspring_e;
+ play_element_sound(x, y, SOUND_spring, Xspring);
+ return;
+
+ default:
+ Cave[x][y] = Xspring;
+ Next[x][y] = Xspring;
+ play_element_sound(x, y, SOUND_spring, Xspring);
+ return;
+ }
+}
+
+static void Lspring_fall(int x, int y)
+{
+ switch (Cave[x][y+1])
+ {
+ case Xacid_1:
+ case Xacid_2:
+ case Xacid_3:
+ case Xacid_4:
+ case Xacid_5:
+ case Xacid_6:
+ case Xacid_7:
+ case Xacid_8:
+ Cave[x][y] = Yspring_sB;
+ if (Cave[x+1][y] == Xblank)
+ Cave[x+1][y] = Xacid_splash_e;
+ if (Cave[x-1][y] == Xblank)
+ Cave[x-1][y] = Xacid_splash_w;
+ Next[x][y] = Xblank;
+ play_element_sound(x, y, SOUND_acid, Xacid_1);
+ return;
+
+ case Xblank:
+ case Xacid_splash_e:
+ case Xacid_splash_w:
+ case Zplayer:
+ Cave[x][y] = Yspring_sB;
+ Cave[x][y+1] = Yspring_s;
+ Next[x][y] = Xblank;
+ Next[x][y+1] = Xspring_fall;
+ return;
+
+ case Xbomb:
+ case Xbomb_pause:
+ Cave[x][y+1] = Ybomb_blank;
+ Next[x][y+1] = Znormal;
+ Boom[x-1][y] = Xblank;
+ Boom[x][y] = Xblank;
+ Boom[x+1][y] = Xblank;
+ Boom[x-1][y+1] = Xblank;
+ Boom[x][y+1] = Xblank;
+ Boom[x+1][y+1] = Xblank;
+ Boom[x-1][y+2] = Xblank;
+ Boom[x][y+2] = Xblank;
+ Boom[x+1][y+2] = Xblank;
+#if PLAY_ELEMENT_SOUND
+ play_element_sound(x, y, SOUND_boom, Xspring_fall);
+#endif
+ return;
+
+ case Xbug_1_n:
+ case Xbug_1_e:
+ case Xbug_1_s:
+ case Xbug_1_w:
+ case Xbug_2_n:
+ case Xbug_2_e:
+ case Xbug_2_s:
+ case Xbug_2_w:
+ Cave[x][y] = Yspring_sB;
+ Cave[x][y+1] = Ybug_spring;
+ Next[x][y+1] = Znormal;
+ Boom[x-1][y] = Xemerald;
+ Boom[x][y] = Xemerald;
+ Boom[x+1][y] = Xemerald;
+ Boom[x-1][y+1] = Xemerald;
+ Boom[x][y+1] = Xdiamond;
+ Boom[x+1][y+1] = Xemerald;
+ Boom[x-1][y+2] = Xemerald;
+ Boom[x][y+2] = Xemerald;
+ Boom[x+1][y+2] = Xemerald;
+#if PLAY_ELEMENT_SOUND
+ play_element_sound(x, y, SOUND_boom, Xspring_fall);
+#endif
+ score += lev.bug_score;
+ return;
+
+ case Xtank_1_n:
+ case Xtank_1_e:
+ case Xtank_1_s:
+ case Xtank_1_w:
+ case Xtank_2_n:
+ case Xtank_2_e:
+ case Xtank_2_s:
+ case Xtank_2_w:
+ Cave[x][y] = Yspring_sB;
+ Cave[x][y+1] = Ytank_spring;
+ Next[x][y+1] = Znormal;
+ Boom[x-1][y] = Xblank;
+ Boom[x][y] = Xblank;
+ Boom[x+1][y] = Xblank;
+ Boom[x-1][y+1] = Xblank;
+ Boom[x][y+1] = Xblank;
+ Boom[x+1][y+1] = Xblank;
+ Boom[x-1][y+2] = Xblank;
+ Boom[x][y+2] = Xblank;
+ Boom[x+1][y+2] = Xblank;
+#if PLAY_ELEMENT_SOUND
+ play_element_sound(x, y, SOUND_boom, Xspring_fall);
+#endif
+ score += lev.tank_score;
+ return;
+
+ case Xeater_n:
+ case Xeater_e:
+ case Xeater_s:
+ case Xeater_w:
+ Cave[x][y] = Yspring_sB;
+ Cave[x][y+1] = Yeater_spring;
+ Next[x][y+1] = Znormal;
+ Boom[x-1][y] = lev.eater_array[lev.eater_pos][0];
+ Boom[x][y] = lev.eater_array[lev.eater_pos][1];
+ Boom[x+1][y] = lev.eater_array[lev.eater_pos][2];
+ Boom[x-1][y+1] = lev.eater_array[lev.eater_pos][3];
+ Boom[x][y+1] = lev.eater_array[lev.eater_pos][4];
+ Boom[x+1][y+1] = lev.eater_array[lev.eater_pos][5];
+ Boom[x-1][y+2] = lev.eater_array[lev.eater_pos][6];
+ Boom[x][y+2] = lev.eater_array[lev.eater_pos][7];
+ Boom[x+1][y+2] = lev.eater_array[lev.eater_pos][8];
+#if PLAY_ELEMENT_SOUND
+ play_element_sound(x, y, SOUND_boom, Xspring_fall);
+#endif
+ lev.eater_pos = (lev.eater_pos + 1) & 7;
+ score += lev.eater_score;
+ return;
+
+ case Xalien:
+ case Xalien_pause:
+ Cave[x][y] = Yspring_sB;
+ Cave[x][y+1] = Yalien_spring;
+ Next[x][y+1] = Znormal;
+ Boom[x-1][y] = Xblank;
+ Boom[x][y] = Xblank;
+ Boom[x+1][y] = Xblank;
+ Boom[x-1][y+1] = Xblank;
+ Boom[x][y+1] = Xblank;
+ Boom[x+1][y+1] = Xblank;
+ Boom[x-1][y+2] = Xblank;
+ Boom[x][y+2] = Xblank;
+ Boom[x+1][y+2] = Xblank;
+#if PLAY_ELEMENT_SOUND
+ play_element_sound(x, y, SOUND_boom, Xspring_fall);
+#endif
+ score += lev.alien_score;
+ return;
+
+ default:
+ Cave[x][y] = Xspring;
+ Next[x][y] = Xspring;
+ play_element_sound(x, y, SOUND_spring, Xspring);
+ return;
+ }
+}
+
+static void Lpush_emerald_e(int x, int y)
+{
+ switch (Cave[x+1][y])
+ {
+ case Zborder:
+ case Znormal:
+ case Zdynamite:
+ case Xboom_bug:
+ case Xboom_bomb:
+ case Xboom_android:
+ case Xboom_1:
+ case Zplayer:
+ Cave[x][y] = Xemerald;
+ Next[x][y] = Xemerald;
+ return;
+
+ default:
+ Cave[x][y] = Yemerald_eB;
+ Cave[x+1][y] = Yemerald_e;
+ Next[x][y] = Xblank;
+ Next[x+1][y] = Xemerald_pause;
+ return;
+ }
+}
+
+static void Lpush_emerald_w(int x, int y)
+{
+ switch (Cave[x-1][y])
+ {
+ case Zborder:
+ case Znormal:
+ case Zdynamite:
+ case Xboom_bug:
+ case Xboom_bomb:
+ case Xboom_android:
+ case Xboom_1:
+ case Zplayer:
+ Cave[x][y] = Xemerald;
+ Next[x][y] = Xemerald;
+ return;
+
+ default:
+ Cave[x][y] = Yemerald_wB;
+ Cave[x-1][y] = Yemerald_w;
+ Next[x][y] = Xblank;
+ Next[x-1][y] = Xemerald_pause;
+ return;
+ }
+}
+
+static void Lpush_diamond_e(int x, int y)
+{
+ switch (Cave[x+1][y])
+ {
+ case Zborder:
+ case Znormal:
+ case Zdynamite:
+ case Xboom_bug:
+ case Xboom_bomb:
+ case Xboom_android:
+ case Xboom_1:
+ case Zplayer:
+ Cave[x][y] = Xdiamond;
+ Next[x][y] = Xdiamond;
+ return;
+
+ default:
+ Cave[x][y] = Ydiamond_eB;
+ Cave[x+1][y] = Ydiamond_e;
+ Next[x][y] = Xblank;
+ Next[x+1][y] = Xdiamond_pause;
+ return;
+ }
+}
+
+static void Lpush_diamond_w(int x, int y)
+{
+ switch (Cave[x-1][y])
+ {
+ case Zborder:
+ case Znormal:
+ case Zdynamite:
+ case Xboom_bug:
+ case Xboom_bomb:
+ case Xboom_android:
+ case Xboom_1:
+ case Zplayer:
+ Cave[x][y] = Xdiamond;
+ Next[x][y] = Xdiamond;
+ return;
+
+ default:
+ Cave[x][y] = Ydiamond_wB;
+ Cave[x-1][y] = Ydiamond_w;
+ Next[x][y] = Xblank;
+ Next[x-1][y] = Xdiamond_pause;
+ return;
+ }
+}
+
+static void Lpush_stone_e(int x, int y)
+{
+ switch (Cave[x+1][y])
+ {
+ case Zborder:
+ case Znormal:
+ case Zdynamite:
+ case Xboom_bug:
+ case Xboom_bomb:
+ case Xboom_android:
+ case Xboom_1:
+ case Zplayer:
+ Cave[x][y] = Xstone;
+ Next[x][y] = Xstone;
+ return;
+
+ default:
+ Cave[x][y] = Ystone_eB;
+ Cave[x+1][y] = Ystone_e;
+ Next[x][y] = Xblank;
+ Next[x+1][y] = Xstone_pause;
+ return;
+ }
+}
+
+static void Lpush_stone_w(int x, int y)
+{
+ switch (Cave[x-1][y])
+ {
+ case Zborder:
+ case Znormal:
+ case Zdynamite:
+ case Xboom_bug:
+ case Xboom_bomb:
+ case Xboom_android:
+ case Xboom_1:
+ case Zplayer:
+ Cave[x][y] = Xstone;
+ Next[x][y] = Xstone;
+ return;
+
+ default:
+ Cave[x][y] = Ystone_wB;
+ Cave[x-1][y] = Ystone_w;
+ Next[x][y] = Xblank;
+ Next[x-1][y] = Xstone_pause;
+ return;
+ }
+}
+
+static void Lpush_bomb_e(int x, int y)
+{
+ switch (Cave[x+1][y])
+ {
+ case Zborder:
+ case Znormal:
+ case Zdynamite:
+ case Xboom_bug:
+ case Xboom_bomb:
+ case Xboom_android:
+ case Xboom_1:
+ case Zplayer:
+ Cave[x][y] = Xbomb;
+ Next[x][y] = Xbomb;
+ return;
+
+ default:
+ Cave[x][y] = Ybomb_eB;
+ Cave[x+1][y] = Ybomb_e;
+ Next[x][y] = Xblank;
+ Next[x+1][y] = Xbomb_pause;
+ return;
+ }
+}
+
+static void Lpush_bomb_w(int x, int y)
+{
+ switch (Cave[x-1][y])
+ {
+ case Zborder:
+ case Znormal:
+ case Zdynamite:
+ case Xboom_bug:
+ case Xboom_bomb:
+ case Xboom_android:
+ case Xboom_1:
+ case Zplayer:
+ Cave[x][y] = Xbomb;
+ Next[x][y] = Xbomb;
+ return;
+
+ default:
+ Cave[x][y] = Ybomb_wB;
+ Cave[x-1][y] = Ybomb_w;
+ Next[x][y] = Xblank;
+ Next[x-1][y] = Xbomb_pause;
+ return;
+ }
+}