+ next[x][y] = Xblank;
+}
+
+static void Lamoeba(int x, int y)
+{
+ switch (cave[x][y])
+ {
+ case Xblank:
+ case Xsplash_e:
+ case Xsplash_w:
+ case Xfake_acid_1:
+ case Xfake_acid_2:
+ case Xfake_acid_3:
+ case Xfake_acid_4:
+ case Xfake_acid_5:
+ case Xfake_acid_6:
+ case Xfake_acid_7:
+ case Xfake_acid_8:
+ case Xplant:
+ case Yplant:
+ case Xgrass:
+ case Xdirt:
+ case Xsand:
+ if (is_amoeba[cave[x][y-1]] ||
+ is_amoeba[cave[x+1][y]] ||
+ is_amoeba[cave[x][y+1]] ||
+ is_amoeba[cave[x-1][y]])
+ cave[x][y] = Xdrip;
+ }
+}
+
+static void Lboom_one(int x, int y, boolean by_dynamite)
+{
+ switch (cave[x][y])
+ {
+ case Zborder:
+ case Zbug:
+ case Ztank:
+ case Zeater:
+ case Zdynamite:
+ case Zboom:
+ case Xchain:
+ case Xboom_bug:
+ case Xboom_tank:
+ case Xboom_android:
+ case Xacid_1:
+ case Xacid_2:
+ case Xacid_3:
+ case Xacid_4:
+ case Xacid_5:
+ case Xacid_6:
+ case Xacid_7:
+ case Xacid_8:
+ case Xplant:
+ case Yplant:
+ case Xdoor_1:
+ case Xdoor_2:
+ case Xdoor_3:
+ case Xdoor_4:
+ case Xdoor_5:
+ case Xdoor_6:
+ case Xdoor_7:
+ case Xdoor_8:
+ case Xfake_door_1:
+ case Xfake_door_2:
+ case Xfake_door_3:
+ case Xfake_door_4:
+ case Xfake_door_5:
+ case Xfake_door_6:
+ case Xfake_door_7:
+ case Xfake_door_8:
+ case Xacid_ne:
+ case Xacid_nw:
+ case Xacid_s:
+ case Xacid_se:
+ case Xacid_sw:
+ case Xsteel_1:
+ case Xsteel_2:
+ case Xsteel_3:
+ case Xsteel_4:
+ return;
+
+ 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:
+ if (by_dynamite)
+ cave[x][y] = Xboom_android;
+ 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] = Xboom_bug;
+ Lboom_bug_new(x, y, TRUE);
+ return;
+
+ case Xbomb:
+ case Xbomb_pause:
+ case Xbomb_fall:
+ cave[x][y] = Xboom_tank;
+ Lboom_tank_new(x, y, TRUE);
+ return;
+
+ default:
+ cave[x][y] = Xboom_1;
+ return;
+ }
+}
+
+static void Lboom_nine(int x, int y, boolean by_dynamite)
+{
+ Lboom_one(x, y-1, by_dynamite);
+ Lboom_one(x-1, y, by_dynamite);
+ Lboom_one(x+1, y, by_dynamite);
+ Lboom_one(x, y+1, by_dynamite);
+ Lboom_one(x-1, y-1, by_dynamite);
+ Lboom_one(x+1, y-1, by_dynamite);
+ Lboom_one(x-1, y+1, by_dynamite);
+ Lboom_one(x+1, y+1, by_dynamite);
+
+ cave[x][y] = Xboom_1;
+}
+
+static void Lexplode(int x, int y)
+{
+ switch (cave[x][y])
+ {
+ case Zbug:
+ Lboom_bug_new(x, y, FALSE);
+ Lboom_nine(x, y, FALSE);
+ break;
+
+ case Ztank:
+ Lboom_tank_new(x, y, FALSE);
+ Lboom_nine(x, y, FALSE);
+ break;
+
+ case Zeater:
+ Lboom_eater_new(x, y, FALSE);
+ Lboom_nine(x, y, FALSE);
+ break;
+
+ case Zdynamite:
+ Lboom_nine(x, y, TRUE);
+ break;
+
+ case Zboom:
+ Lboom_nine(x, y, FALSE);
+ break;
+ }