added using some more game element tables in EM engine
[rocksndiamonds.git] / src / game_em / logic.c
index 5c9a6cb9aa9f36039283d2aa016b1c4314c288e4..a465bbe3354dc7e83a9be5f646affe3b4240258e 100644 (file)
@@ -18,6 +18,86 @@ static short **cave, **next, **boom;
 static unsigned int seed;
 static int score;
 
+static const byte is_blank[TILE_MAX] =
+{
+  [Xblank]             = 1,
+  [Xsplash_e]          = 1,
+  [Xsplash_w]          = 1,
+  [Xfake_acid_1]       = 1,
+  [Xfake_acid_2]       = 1,
+  [Xfake_acid_3]       = 1,
+  [Xfake_acid_4]       = 1,
+  [Xfake_acid_5]       = 1,
+  [Xfake_acid_6]       = 1,
+  [Xfake_acid_7]       = 1,
+  [Xfake_acid_8]       = 1
+};
+
+static const byte is_blank_or_acid[TILE_MAX] =
+{
+  [Xblank]             = 1,
+  [Xsplash_e]          = 1,
+  [Xsplash_w]          = 1,
+  [Xfake_acid_1]       = 1,
+  [Xfake_acid_2]       = 1,
+  [Xfake_acid_3]       = 1,
+  [Xfake_acid_4]       = 1,
+  [Xfake_acid_5]       = 1,
+  [Xfake_acid_6]       = 1,
+  [Xfake_acid_7]       = 1,
+  [Xfake_acid_8]       = 1,
+  [Xacid_1]            = 1,
+  [Xacid_2]            = 1,
+  [Xacid_3]            = 1,
+  [Xacid_4]            = 1,
+  [Xacid_5]            = 1,
+  [Xacid_6]            = 1,
+  [Xacid_7]            = 1,
+  [Xacid_8]            = 1
+};
+
+static const byte is_fake_acid[TILE_MAX] =
+{
+  [Xfake_acid_1]       = 1,
+  [Xfake_acid_2]       = 1,
+  [Xfake_acid_3]       = 1,
+  [Xfake_acid_4]       = 1,
+  [Xfake_acid_5]       = 1,
+  [Xfake_acid_6]       = 1,
+  [Xfake_acid_7]       = 1,
+  [Xfake_acid_8]       = 1
+};
+
+static const byte is_amoeba[TILE_MAX] =
+{
+  [Xfake_amoeba]       = 1,
+  [Xfake_amoebaB]      = 1,
+  [Xamoeba_1]          = 1,
+  [Xamoeba_2]          = 1,
+  [Xamoeba_3]          = 1,
+  [Xamoeba_4]          = 1,
+  [Xamoeba_5]          = 1,
+  [Xamoeba_6]          = 1,
+  [Xamoeba_7]          = 1,
+  [Xamoeba_8]          = 1
+};
+
+static const byte is_android_walkable[TILE_MAX] =
+{
+  [Xblank]             = 1,
+  [Xsplash_e]          = 1,
+  [Xsplash_w]          = 1,
+  [Xfake_acid_1]       = 1,
+  [Xfake_acid_2]       = 1,
+  [Xfake_acid_3]       = 1,
+  [Xfake_acid_4]       = 1,
+  [Xfake_acid_5]       = 1,
+  [Xfake_acid_6]       = 1,
+  [Xfake_acid_7]       = 1,
+  [Xfake_acid_8]       = 1,
+  [Xplant]             = 1
+};
+
 static void Lboom_generic(int x, int y, int element, int element_middle)
 {
   boom[x-1][y-1] = element;
@@ -172,8 +252,8 @@ static boolean player_killed(struct PLAYER *ply)
   switch (cave[x][y])
   {
     case Xblank:
-    case Xacid_splash_e:
-    case Xacid_splash_w:
+    case Xsplash_e:
+    case Xsplash_w:
     case Xfake_acid_1:
     case Xfake_acid_2:
     case Xfake_acid_3:
@@ -359,8 +439,8 @@ static boolean player_digfield(struct PLAYER *ply, int dx, int dy)
     {
       /* fire is released */
       case Xblank:
-      case Xacid_splash_e:
-      case Xacid_splash_w:
+      case Xsplash_e:
+      case Xsplash_w:
        cave[x][y] = Zplayer;
        next[x][y] = Zplayer;
       case Xfake_acid_1:
@@ -387,9 +467,9 @@ static boolean player_digfield(struct PLAYER *ply, int dx, int dy)
       case Xacid_7:
       case Xacid_8:
        if (cave[x+1][y-1] == Xblank)
-         cave[x+1][y-1] = Xacid_splash_e;
+         cave[x+1][y-1] = Xsplash_e;
        if (cave[x-1][y-1] == Xblank)
-         cave[x-1][y-1] = Xacid_splash_w;
+         cave[x-1][y-1] = Xsplash_w;
        play_element_sound(x, y, SOUND_acid, Xacid_1);
 #endif
 
@@ -563,8 +643,8 @@ static boolean player_digfield(struct PLAYER *ply, int dx, int dy)
        switch (cave[x+dx][y])
        {
           case Xblank:
-          case Xacid_splash_e:
-          case Xacid_splash_w:
+          case Xsplash_e:
+          case Xsplash_w:
          case Xfake_acid_1:
          case Xfake_acid_2:
          case Xfake_acid_3:
@@ -586,9 +666,9 @@ static boolean player_digfield(struct PLAYER *ply, int dx, int dy)
           case Xacid_7:
           case Xacid_8:
            if (cave[x+dx+1][y-1] == Xblank)
-             cave[x+dx+1][y-1] = Xacid_splash_e;
+             cave[x+dx+1][y-1] = Xsplash_e;
            if (cave[x+dx-1][y-1] == Xblank)
-             cave[x+dx-1][y-1] = Xacid_splash_w;
+             cave[x+dx-1][y-1] = Xsplash_w;
            play_element_sound(x, y, SOUND_acid, Xacid_1);
 
           stone_walk:
@@ -610,8 +690,8 @@ static boolean player_digfield(struct PLAYER *ply, int dx, int dy)
        switch (cave[x+dx][y])
        {
          case Xblank:
-          case Xacid_splash_e:
-          case Xacid_splash_w:
+          case Xsplash_e:
+          case Xsplash_w:
          case Xfake_acid_1:
          case Xfake_acid_2:
          case Xfake_acid_3:
@@ -633,9 +713,9 @@ static boolean player_digfield(struct PLAYER *ply, int dx, int dy)
           case Xacid_7:
           case Xacid_8:
            if (cave[x+dx+1][y-1] == Xblank)
-             cave[x+dx+1][y-1] = Xacid_splash_e;
+             cave[x+dx+1][y-1] = Xsplash_e;
            if (cave[x+dx-1][y-1] == Xblank)
-             cave[x+dx-1][y-1] = Xacid_splash_w;
+             cave[x+dx-1][y-1] = Xsplash_w;
            play_element_sound(x, y, SOUND_acid, Xacid_1);
 
           bomb_walk:
@@ -657,8 +737,8 @@ static boolean player_digfield(struct PLAYER *ply, int dx, int dy)
        switch (cave[x+dx][y])
        {
           case Xblank:
-          case Xacid_splash_e:
-          case Xacid_splash_w:
+          case Xsplash_e:
+          case Xsplash_w:
          case Xfake_acid_1:
          case Xfake_acid_2:
          case Xfake_acid_3:
@@ -680,9 +760,9 @@ static boolean player_digfield(struct PLAYER *ply, int dx, int dy)
           case Xacid_7:
           case Xacid_8:
            if (cave[x+dx+1][y-1] == Xblank)
-             cave[x+dx+1][y-1] = Xacid_splash_e;
+             cave[x+dx+1][y-1] = Xsplash_e;
            if (cave[x+dx-1][y-1] == Xblank)
-             cave[x+dx-1][y-1] = Xacid_splash_w;
+             cave[x+dx-1][y-1] = Xsplash_w;
            play_element_sound(x, y, SOUND_acid, Xacid_1);
 
           nut_walk:
@@ -704,8 +784,8 @@ static boolean player_digfield(struct PLAYER *ply, int dx, int dy)
        switch (cave[x+dx][y])
        {
           case Xblank:
-          case Xacid_splash_e:
-          case Xacid_splash_w:
+          case Xsplash_e:
+          case Xsplash_w:
          case Xfake_acid_1:
          case Xfake_acid_2:
          case Xfake_acid_3:
@@ -727,9 +807,9 @@ static boolean player_digfield(struct PLAYER *ply, int dx, int dy)
           case Xacid_7:
           case Xacid_8:
            if (cave[x+dx+1][y-1] == Xblank)
-             cave[x+dx+1][y-1] = Xacid_splash_e;
+             cave[x+dx+1][y-1] = Xsplash_e;
            if (cave[x+dx-1][y-1] == Xblank)
-             cave[x+dx-1][y-1] = Xacid_splash_w;
+             cave[x+dx-1][y-1] = Xsplash_w;
            play_element_sound(x, y, SOUND_acid, Xacid_1);
 
          spring_walk:
@@ -773,8 +853,8 @@ static boolean player_digfield(struct PLAYER *ply, int dx, int dy)
        switch (cave[x+dx][y+dy])
        {
           case Xblank:
-          case Xacid_splash_e:
-          case Xacid_splash_w:
+          case Xsplash_e:
+          case Xsplash_w:
          case Xfake_acid_1:
          case Xfake_acid_2:
          case Xfake_acid_3:
@@ -797,9 +877,9 @@ static boolean player_digfield(struct PLAYER *ply, int dx, int dy)
           case Xacid_7:
           case Xacid_8:
            if (cave[x+dx+1][y+dy-1] == Xblank)
-             cave[x+dx+1][y+dy-1] = Xacid_splash_e;
+             cave[x+dx+1][y+dy-1] = Xsplash_e;
            if (cave[x+dx-1][y+dy-1] == Xblank)
-             cave[x+dx-1][y+dy-1] = Xacid_splash_w;
+             cave[x+dx-1][y+dy-1] = Xsplash_w;
            play_element_sound(x, y, SOUND_acid, Xacid_1);
 
          balloon_walk:
@@ -828,8 +908,8 @@ static boolean player_digfield(struct PLAYER *ply, int dx, int dy)
        switch (cave[x+dx][y+dy])
        {
           case Xblank:
-          case Xacid_splash_e:
-          case Xacid_splash_w:
+          case Xsplash_e:
+          case Xsplash_w:
          case Xfake_acid_1:
          case Xfake_acid_2:
          case Xfake_acid_3:
@@ -853,9 +933,9 @@ static boolean player_digfield(struct PLAYER *ply, int dx, int dy)
           case Xacid_7:
           case Xacid_8:
            if (cave[x+dx+1][y+dy-1] == Xblank)
-             cave[x+dx+1][y+dy-1] = Xacid_splash_e;
+             cave[x+dx+1][y+dy-1] = Xsplash_e;
            if (cave[x+dx-1][y+dy-1] == Xblank)
-             cave[x+dx-1][y+dy-1] = Xacid_splash_w;
+             cave[x+dx-1][y+dy-1] = Xsplash_w;
            play_element_sound(x, y, SOUND_acid, Xacid_1);
 
          android_walk:
@@ -930,10 +1010,10 @@ static boolean player_digfield(struct PLAYER *ply, int dx, int dy)
 
       door_walk:
 
-       if (!tab_blank[cave[x+dx][y+dy]])
+       if (!is_blank[cave[x+dx][y+dy]])
          break;
 
-       if (!tab_fake_acid[cave[x+dx][y+dy]])
+       if (!is_fake_acid[cave[x+dx][y+dy]])
        {
          cave[x+dx][y+dy] = Zplayer;
          next[x+dx][y+dy] = Zplayer;
@@ -1386,14 +1466,14 @@ static void Landroid(int x, int y)
 
   if (lev.android_clone_cnt == 0)
   {
-    if (cave[x-1][y-1] != Xblank &&
-       cave[x][y-1]   != Xblank &&
-       cave[x+1][y-1] != Xblank &&
-       cave[x-1][y]   != Xblank &&
-       cave[x+1][y]   != Xblank &&
-       cave[x-1][y+1] != Xblank &&
-       cave[x][y+1]   != Xblank &&
-       cave[x+1][y+1] != Xblank)
+    if (!is_blank[cave[x-1][y-1]] &&
+       !is_blank[cave[x][y-1]]   &&
+       !is_blank[cave[x+1][y-1]] &&
+       !is_blank[cave[x-1][y]]   &&
+       !is_blank[cave[x+1][y]]   &&
+       !is_blank[cave[x-1][y+1]] &&
+       !is_blank[cave[x][y+1]]   &&
+       !is_blank[cave[x+1][y+1]])
       goto android_move;
 
     switch (RANDOM(8))
@@ -1497,91 +1577,91 @@ static void Landroid(int x, int y)
       /* randomly find a direction to move */
 
       case 0: /* S,NE,W,NW,SE,E,SW,N */
-       if (cave[x][y+1] == Xblank)   goto android_s;
-       if (cave[x+1][y-1] == Xblank) goto android_ne;
-       if (cave[x-1][y] == Xblank)   goto android_w;
-       if (cave[x-1][y-1] == Xblank) goto android_nw;
-       if (cave[x+1][y+1] == Xblank) goto android_se;
-       if (cave[x+1][y] == Xblank)   goto android_e;
-       if (cave[x-1][y+1] == Xblank) goto android_sw;
-       if (cave[x][y-1] == Xblank)   goto android_n;
+       if (is_blank[cave[x][y+1]])   goto android_s;
+       if (is_blank[cave[x+1][y-1]]) goto android_ne;
+       if (is_blank[cave[x-1][y]])   goto android_w;
+       if (is_blank[cave[x-1][y-1]]) goto android_nw;
+       if (is_blank[cave[x+1][y+1]]) goto android_se;
+       if (is_blank[cave[x+1][y]])   goto android_e;
+       if (is_blank[cave[x-1][y+1]]) goto android_sw;
+       if (is_blank[cave[x][y-1]])   goto android_n;
        goto android_move;
 
       case 1: /* NW,SE,N,S,NE,SW,E,W */
-       if (cave[x-1][y-1] == Xblank) goto android_nw;
-       if (cave[x+1][y+1] == Xblank) goto android_se;
-       if (cave[x][y-1] == Xblank)   goto android_n;
-       if (cave[x][y+1] == Xblank)   goto android_s;
-       if (cave[x+1][y-1] == Xblank) goto android_ne;
-       if (cave[x-1][y+1] == Xblank) goto android_sw;
-       if (cave[x+1][y] == Xblank)   goto android_e;
-       if (cave[x-1][y] == Xblank)   goto android_w;
+       if (is_blank[cave[x-1][y-1]]) goto android_nw;
+       if (is_blank[cave[x+1][y+1]]) goto android_se;
+       if (is_blank[cave[x][y-1]])   goto android_n;
+       if (is_blank[cave[x][y+1]])   goto android_s;
+       if (is_blank[cave[x+1][y-1]]) goto android_ne;
+       if (is_blank[cave[x-1][y+1]]) goto android_sw;
+       if (is_blank[cave[x+1][y]])   goto android_e;
+       if (is_blank[cave[x-1][y]])   goto android_w;
        goto android_move;
 
       case 2: /* SW,E,S,W,N,NW,SE,NE */
-       if (cave[x-1][y+1] == Xblank) goto android_sw;
-       if (cave[x+1][y] == Xblank)   goto android_e;
-       if (cave[x][y+1] == Xblank)   goto android_s;
-       if (cave[x-1][y] == Xblank)   goto android_w;
-       if (cave[x][y-1] == Xblank)   goto android_n;
-       if (cave[x-1][y-1] == Xblank) goto android_nw;
-       if (cave[x+1][y+1] == Xblank) goto android_se;
-       if (cave[x+1][y-1] == Xblank) goto android_ne;
+       if (is_blank[cave[x-1][y+1]]) goto android_sw;
+       if (is_blank[cave[x+1][y]])   goto android_e;
+       if (is_blank[cave[x][y+1]])   goto android_s;
+       if (is_blank[cave[x-1][y]])   goto android_w;
+       if (is_blank[cave[x][y-1]])   goto android_n;
+       if (is_blank[cave[x-1][y-1]]) goto android_nw;
+       if (is_blank[cave[x+1][y+1]]) goto android_se;
+       if (is_blank[cave[x+1][y-1]]) goto android_ne;
        goto android_move;
 
       case 3: /* N,SE,NE,E,W,S,NW,SW */
-       if (cave[x][y-1] == Xblank)   goto android_n;
-       if (cave[x+1][y+1] == Xblank) goto android_se;
-       if (cave[x+1][y-1] == Xblank) goto android_ne;
-       if (cave[x+1][y] == Xblank)   goto android_e;
-       if (cave[x-1][y] == Xblank)   goto android_w;
-       if (cave[x][y+1] == Xblank)   goto android_s;
-       if (cave[x-1][y-1] == Xblank) goto android_nw;
-       if (cave[x-1][y+1] == Xblank) goto android_sw;
+       if (is_blank[cave[x][y-1]])   goto android_n;
+       if (is_blank[cave[x+1][y+1]]) goto android_se;
+       if (is_blank[cave[x+1][y-1]]) goto android_ne;
+       if (is_blank[cave[x+1][y]])   goto android_e;
+       if (is_blank[cave[x-1][y]])   goto android_w;
+       if (is_blank[cave[x][y+1]])   goto android_s;
+       if (is_blank[cave[x-1][y-1]]) goto android_nw;
+       if (is_blank[cave[x-1][y+1]]) goto android_sw;
        goto android_move;
 
       case 4: /* SE,NW,E,NE,SW,W,N,S */
-       if (cave[x+1][y+1] == Xblank) goto android_se;
-       if (cave[x-1][y-1] == Xblank) goto android_nw;
-       if (cave[x+1][y] == Xblank)   goto android_e;
-       if (cave[x+1][y-1] == Xblank) goto android_ne;
-       if (cave[x-1][y+1] == Xblank) goto android_sw;
-       if (cave[x-1][y] == Xblank)   goto android_w;
-       if (cave[x][y-1] == Xblank)   goto android_n;
-       if (cave[x][y+1] == Xblank)   goto android_s;
+       if (is_blank[cave[x+1][y+1]]) goto android_se;
+       if (is_blank[cave[x-1][y-1]]) goto android_nw;
+       if (is_blank[cave[x+1][y]])   goto android_e;
+       if (is_blank[cave[x+1][y-1]]) goto android_ne;
+       if (is_blank[cave[x-1][y+1]]) goto android_sw;
+       if (is_blank[cave[x-1][y]])   goto android_w;
+       if (is_blank[cave[x][y-1]])   goto android_n;
+       if (is_blank[cave[x][y+1]])   goto android_s;
        goto android_move;
 
       case 5: /* NE,W,SE,SW,S,N,E,NW */
-       if (cave[x+1][y-1] == Xblank) goto android_ne;
-       if (cave[x-1][y] == Xblank)   goto android_w;
-       if (cave[x+1][y+1] == Xblank) goto android_se;
-       if (cave[x-1][y+1] == Xblank) goto android_sw;
-       if (cave[x][y+1] == Xblank)   goto android_s;
-       if (cave[x][y-1] == Xblank)   goto android_n;
-       if (cave[x+1][y] == Xblank)   goto android_e;
-       if (cave[x-1][y-1] == Xblank) goto android_nw;
+       if (is_blank[cave[x+1][y-1]]) goto android_ne;
+       if (is_blank[cave[x-1][y]])   goto android_w;
+       if (is_blank[cave[x+1][y+1]]) goto android_se;
+       if (is_blank[cave[x-1][y+1]]) goto android_sw;
+       if (is_blank[cave[x][y+1]])   goto android_s;
+       if (is_blank[cave[x][y-1]])   goto android_n;
+       if (is_blank[cave[x+1][y]])   goto android_e;
+       if (is_blank[cave[x-1][y-1]]) goto android_nw;
        goto android_move;
 
       case 6: /* E,N,SW,S,NW,NE,SE,W */
-       if (cave[x+1][y] == Xblank)   goto android_e;
-       if (cave[x][y-1] == Xblank)   goto android_n;
-       if (cave[x-1][y+1] == Xblank) goto android_sw;
-       if (cave[x][y+1] == Xblank)   goto android_s;
-       if (cave[x-1][y-1] == Xblank) goto android_nw;
-       if (cave[x+1][y-1] == Xblank) goto android_ne;
-       if (cave[x+1][y+1] == Xblank) goto android_se;
-       if (cave[x-1][y] == Xblank)   goto android_w;
+       if (is_blank[cave[x+1][y]])   goto android_e;
+       if (is_blank[cave[x][y-1]])   goto android_n;
+       if (is_blank[cave[x-1][y+1]]) goto android_sw;
+       if (is_blank[cave[x][y+1]])   goto android_s;
+       if (is_blank[cave[x-1][y-1]]) goto android_nw;
+       if (is_blank[cave[x+1][y-1]]) goto android_ne;
+       if (is_blank[cave[x+1][y+1]]) goto android_se;
+       if (is_blank[cave[x-1][y]])   goto android_w;
        goto android_move;
 
       case 7: /* W,SW,NW,N,E,SE,NE,S */
-       if (cave[x-1][y] == Xblank)   goto android_w;
-       if (cave[x-1][y+1] == Xblank) goto android_sw;
-       if (cave[x-1][y-1] == Xblank) goto android_nw;
-       if (cave[x][y-1] == Xblank)   goto android_n;
-       if (cave[x+1][y] == Xblank)   goto android_e;
-       if (cave[x+1][y+1] == Xblank) goto android_se;
-       if (cave[x+1][y-1] == Xblank) goto android_ne;
-       if (cave[x][y+1] == Xblank)   goto android_s;
+       if (is_blank[cave[x-1][y]])   goto android_w;
+       if (is_blank[cave[x-1][y+1]]) goto android_sw;
+       if (is_blank[cave[x-1][y-1]]) goto android_nw;
+       if (is_blank[cave[x][y-1]])   goto android_n;
+       if (is_blank[cave[x+1][y]])   goto android_e;
+       if (is_blank[cave[x+1][y+1]]) goto android_se;
+       if (is_blank[cave[x+1][y-1]]) goto android_ne;
+       if (is_blank[cave[x][y+1]])   goto android_s;
        goto android_move;
     }
   }
@@ -1611,54 +1691,54 @@ static void Landroid(int x, int y)
        /* attempt clockwise move first if direct path is blocked */
 
        case 0: /* north west */
-         if (tab_android_move[cave[x-1][y-1]]) goto android_nw;
-         if (tab_android_move[cave[x][y-1]])   goto android_n;
-         if (tab_android_move[cave[x-1][y]])   goto android_w;
+         if (is_android_walkable[cave[x-1][y-1]]) goto android_nw;
+         if (is_android_walkable[cave[x][y-1]])   goto android_n;
+         if (is_android_walkable[cave[x-1][y]])   goto android_w;
          break;
 
        case 1: /* north */
-         if (tab_android_move[cave[x][y-1]])   goto android_n;
-         if (tab_android_move[cave[x+1][y-1]]) goto android_ne;
-         if (tab_android_move[cave[x-1][y-1]]) goto android_nw;
+         if (is_android_walkable[cave[x][y-1]])   goto android_n;
+         if (is_android_walkable[cave[x+1][y-1]]) goto android_ne;
+         if (is_android_walkable[cave[x-1][y-1]]) goto android_nw;
          break;
 
        case 2: /* north east */
-         if (tab_android_move[cave[x+1][y-1]]) goto android_ne;
-         if (tab_android_move[cave[x+1][y]])   goto android_e;
-         if (tab_android_move[cave[x][y-1]])   goto android_n;
+         if (is_android_walkable[cave[x+1][y-1]]) goto android_ne;
+         if (is_android_walkable[cave[x+1][y]])   goto android_e;
+         if (is_android_walkable[cave[x][y-1]])   goto android_n;
          break;
 
        case 3: /* west */
-         if (tab_android_move[cave[x-1][y]])   goto android_w;
-         if (tab_android_move[cave[x-1][y-1]]) goto android_nw;
-         if (tab_android_move[cave[x-1][y+1]]) goto android_sw;
+         if (is_android_walkable[cave[x-1][y]])   goto android_w;
+         if (is_android_walkable[cave[x-1][y-1]]) goto android_nw;
+         if (is_android_walkable[cave[x-1][y+1]]) goto android_sw;
          break;
 
        case 4: /* nowhere */
          break;
 
        case 5: /* east */
-         if (tab_android_move[cave[x+1][y]])   goto android_e;
-         if (tab_android_move[cave[x+1][y+1]]) goto android_se;
-         if (tab_android_move[cave[x+1][y-1]]) goto android_ne;
+         if (is_android_walkable[cave[x+1][y]])   goto android_e;
+         if (is_android_walkable[cave[x+1][y+1]]) goto android_se;
+         if (is_android_walkable[cave[x+1][y-1]]) goto android_ne;
          break;
 
        case 6: /* south west */
-         if (tab_android_move[cave[x-1][y+1]]) goto android_sw;
-         if (tab_android_move[cave[x-1][y]])   goto android_w;
-         if (tab_android_move[cave[x][y+1]])   goto android_s;
+         if (is_android_walkable[cave[x-1][y+1]]) goto android_sw;
+         if (is_android_walkable[cave[x-1][y]])   goto android_w;
+         if (is_android_walkable[cave[x][y+1]])   goto android_s;
          break;
 
        case 7: /* south */
-         if (tab_android_move[cave[x][y+1]])   goto android_s;
-         if (tab_android_move[cave[x-1][y+1]]) goto android_sw;
-         if (tab_android_move[cave[x+1][y+1]]) goto android_se;
+         if (is_android_walkable[cave[x][y+1]])   goto android_s;
+         if (is_android_walkable[cave[x-1][y+1]]) goto android_sw;
+         if (is_android_walkable[cave[x+1][y+1]]) goto android_se;
          break;
 
        case 8: /* south east */
-         if (tab_android_move[cave[x+1][y+1]]) goto android_se;
-         if (tab_android_move[cave[x][y+1]])   goto android_s;
-         if (tab_android_move[cave[x+1][y]])   goto android_e;
+         if (is_android_walkable[cave[x+1][y+1]]) goto android_se;
+         if (is_android_walkable[cave[x][y+1]])   goto android_s;
+         if (is_android_walkable[cave[x+1][y]])   goto android_e;
          break;
       }
     }
@@ -1669,54 +1749,54 @@ static void Landroid(int x, int y)
        /* attempt counterclockwise move first if direct path is blocked */
 
        case 0: /* north west */
-         if (tab_android_move[cave[x-1][y-1]]) goto android_nw;
-         if (tab_android_move[cave[x-1][y]])   goto android_w;
-         if (tab_android_move[cave[x][y-1]])   goto android_n;
+         if (is_android_walkable[cave[x-1][y-1]]) goto android_nw;
+         if (is_android_walkable[cave[x-1][y]])   goto android_w;
+         if (is_android_walkable[cave[x][y-1]])   goto android_n;
          break;
 
        case 1: /* north */
-         if (tab_android_move[cave[x][y-1]])   goto android_n;
-         if (tab_android_move[cave[x-1][y-1]]) goto android_nw;
-         if (tab_android_move[cave[x+1][y-1]]) goto android_ne;
+         if (is_android_walkable[cave[x][y-1]])   goto android_n;
+         if (is_android_walkable[cave[x-1][y-1]]) goto android_nw;
+         if (is_android_walkable[cave[x+1][y-1]]) goto android_ne;
          break;
 
        case 2: /* north east */
-         if (tab_android_move[cave[x+1][y-1]]) goto android_ne;
-         if (tab_android_move[cave[x][y-1]])   goto android_n;
-         if (tab_android_move[cave[x+1][y]])   goto android_e;
+         if (is_android_walkable[cave[x+1][y-1]]) goto android_ne;
+         if (is_android_walkable[cave[x][y-1]])   goto android_n;
+         if (is_android_walkable[cave[x+1][y]])   goto android_e;
          break;
 
        case 3: /* west */
-         if (tab_android_move[cave[x-1][y]])   goto android_w;
-         if (tab_android_move[cave[x-1][y+1]]) goto android_sw;
-         if (tab_android_move[cave[x-1][y-1]]) goto android_nw;
+         if (is_android_walkable[cave[x-1][y]])   goto android_w;
+         if (is_android_walkable[cave[x-1][y+1]]) goto android_sw;
+         if (is_android_walkable[cave[x-1][y-1]]) goto android_nw;
          break;
 
        case 4: /* nowhere */
          break;
 
        case 5: /* east */
-         if (tab_android_move[cave[x+1][y]])   goto android_e;
-         if (tab_android_move[cave[x+1][y-1]]) goto android_ne;
-         if (tab_android_move[cave[x+1][y+1]]) goto android_se;
+         if (is_android_walkable[cave[x+1][y]])   goto android_e;
+         if (is_android_walkable[cave[x+1][y-1]]) goto android_ne;
+         if (is_android_walkable[cave[x+1][y+1]]) goto android_se;
          break;
 
        case 6: /* south west */
-         if (tab_android_move[cave[x-1][y+1]]) goto android_sw;
-         if (tab_android_move[cave[x][y+1]])   goto android_s;
-         if (tab_android_move[cave[x-1][y]])   goto android_w;
+         if (is_android_walkable[cave[x-1][y+1]]) goto android_sw;
+         if (is_android_walkable[cave[x][y+1]])   goto android_s;
+         if (is_android_walkable[cave[x-1][y]])   goto android_w;
          break;
 
        case 7: /* south */
-         if (tab_android_move[cave[x][y+1]])   goto android_s;
-         if (tab_android_move[cave[x+1][y+1]]) goto android_se;
-         if (tab_android_move[cave[x-1][y+1]]) goto android_sw;
+         if (is_android_walkable[cave[x][y+1]])   goto android_s;
+         if (is_android_walkable[cave[x+1][y+1]]) goto android_se;
+         if (is_android_walkable[cave[x-1][y+1]]) goto android_sw;
          break;
 
        case 8: /* south east */
-         if (tab_android_move[cave[x+1][y+1]]) goto android_se;
-         if (tab_android_move[cave[x+1][y]])   goto android_e;
-         if (tab_android_move[cave[x][y+1]])   goto android_s;
+         if (is_android_walkable[cave[x+1][y+1]]) goto android_se;
+         if (is_android_walkable[cave[x+1][y]])   goto android_e;
+         if (is_android_walkable[cave[x][y+1]])   goto android_s;
          break;
       }
     }
@@ -1788,8 +1868,8 @@ static void Landroid_1_n(int x, int y)
   switch (cave[x][y-1])
   {
     case Xblank:
-    case Xacid_splash_e:
-    case Xacid_splash_w:
+    case Xsplash_e:
+    case Xsplash_w:
     case Xfake_acid_1:
     case Xfake_acid_2:
     case Xfake_acid_3:
@@ -1816,9 +1896,9 @@ static void Landroid_1_n(int x, int y)
       cave[x][y] = Yandroid_nB;
       next[x][y] = Xblank;
       if (cave[x+1][y-2] == Xblank)
-       cave[x+1][y-2] = Xacid_splash_e;
+       cave[x+1][y-2] = Xsplash_e;
       if (cave[x-1][y-2] == Xblank)
-       cave[x-1][y-2] = Xacid_splash_w;
+       cave[x-1][y-2] = Xsplash_w;
       play_element_sound(x, y, SOUND_acid, Xacid_1);
       return;
 
@@ -1833,8 +1913,8 @@ static void Landroid_2_n(int x, int y)
   switch (cave[x][y-1])
   {
     case Xblank:
-    case Xacid_splash_e:
-    case Xacid_splash_w:
+    case Xsplash_e:
+    case Xsplash_w:
     case Xfake_acid_1:
     case Xfake_acid_2:
     case Xfake_acid_3:
@@ -1861,9 +1941,9 @@ static void Landroid_2_n(int x, int y)
       cave[x][y] = Yandroid_nB;
       next[x][y] = Xblank;
       if (cave[x+1][y-2] == Xblank)
-       cave[x+1][y-2] = Xacid_splash_e;
+       cave[x+1][y-2] = Xsplash_e;
       if (cave[x-1][y-2] == Xblank)
-       cave[x-1][y-2] = Xacid_splash_w;
+       cave[x-1][y-2] = Xsplash_w;
       play_element_sound(x, y, SOUND_acid, Xacid_1);
       return;
 
@@ -1878,8 +1958,8 @@ static void Landroid_1_e(int x, int y)
   switch (cave[x+1][y])
   {
     case Xblank:
-    case Xacid_splash_e:
-    case Xacid_splash_w:
+    case Xsplash_e:
+    case Xsplash_w:
     case Xfake_acid_1:
     case Xfake_acid_2:
     case Xfake_acid_3:
@@ -1906,9 +1986,9 @@ static void Landroid_1_e(int x, int y)
       cave[x][y] = Yandroid_eB;
       next[x][y] = Xblank;
       if (cave[x+2][y-1] == Xblank)
-       cave[x+2][y-1] = Xacid_splash_e;
+       cave[x+2][y-1] = Xsplash_e;
       if (cave[x][y-1] == Xblank)
-       cave[x][y-1] = Xacid_splash_w;
+       cave[x][y-1] = Xsplash_w;
       play_element_sound(x, y, SOUND_acid, Xacid_1);
       return;
 
@@ -1923,8 +2003,8 @@ static void Landroid_2_e(int x, int y)
   switch (cave[x+1][y])
   {
     case Xblank:
-    case Xacid_splash_e:
-    case Xacid_splash_w:
+    case Xsplash_e:
+    case Xsplash_w:
     case Xfake_acid_1:
     case Xfake_acid_2:
     case Xfake_acid_3:
@@ -1951,9 +2031,9 @@ static void Landroid_2_e(int x, int y)
       cave[x][y] = Yandroid_eB;
       next[x][y] = Xblank;
       if (cave[x+2][y-1] == Xblank)
-       cave[x+2][y-1] = Xacid_splash_e;
+       cave[x+2][y-1] = Xsplash_e;
       if (cave[x][y-1] == Xblank)
-       cave[x][y-1] = Xacid_splash_w;
+       cave[x][y-1] = Xsplash_w;
       play_element_sound(x, y, SOUND_acid, Xacid_1);
       return;
 
@@ -1968,8 +2048,8 @@ static void Landroid_1_s(int x, int y)
   switch (cave[x][y+1])
   {
     case Xblank:
-    case Xacid_splash_e:
-    case Xacid_splash_w:
+    case Xsplash_e:
+    case Xsplash_w:
     case Xfake_acid_1:
     case Xfake_acid_2:
     case Xfake_acid_3:
@@ -1996,9 +2076,9 @@ static void Landroid_1_s(int x, int y)
       cave[x][y] = Yandroid_sB;
       next[x][y] = Xblank;
       if (cave[x+1][y] == Xblank)
-       cave[x+1][y] = Xacid_splash_e;
+       cave[x+1][y] = Xsplash_e;
       if (cave[x-1][y] == Xblank)
-       cave[x-1][y] = Xacid_splash_w;
+       cave[x-1][y] = Xsplash_w;
       play_element_sound(x, y, SOUND_acid, Xacid_1);
       return;
 
@@ -2013,8 +2093,8 @@ static void Landroid_2_s(int x, int y)
   switch (cave[x][y+1])
   {
     case Xblank:
-    case Xacid_splash_e:
-    case Xacid_splash_w:
+    case Xsplash_e:
+    case Xsplash_w:
     case Xfake_acid_1:
     case Xfake_acid_2:
     case Xfake_acid_3:
@@ -2041,9 +2121,9 @@ static void Landroid_2_s(int x, int y)
       cave[x][y] = Yandroid_sB;
       next[x][y] = Xblank;
       if (cave[x+1][y] == Xblank)
-       cave[x+1][y] = Xacid_splash_e;
+       cave[x+1][y] = Xsplash_e;
       if (cave[x-1][y] == Xblank)
-       cave[x-1][y] = Xacid_splash_w;
+       cave[x-1][y] = Xsplash_w;
       play_element_sound(x, y, SOUND_acid, Xacid_1);
       return;
 
@@ -2058,8 +2138,8 @@ static void Landroid_1_w(int x, int y)
   switch (cave[x-1][y])
   {
     case Xblank:
-    case Xacid_splash_e:
-    case Xacid_splash_w:
+    case Xsplash_e:
+    case Xsplash_w:
     case Xfake_acid_1:
     case Xfake_acid_2:
     case Xfake_acid_3:
@@ -2086,9 +2166,9 @@ static void Landroid_1_w(int x, int y)
       cave[x][y] = Yandroid_wB;
       next[x][y] = Xblank;
       if (cave[x][y-1] == Xblank)
-       cave[x][y-1] = Xacid_splash_e;
+       cave[x][y-1] = Xsplash_e;
       if (cave[x-2][y-1] == Xblank)
-       cave[x-2][y-1] = Xacid_splash_w;
+       cave[x-2][y-1] = Xsplash_w;
       play_element_sound(x, y, SOUND_acid, Xacid_1);
       return;
 
@@ -2103,8 +2183,8 @@ static void Landroid_2_w(int x, int y)
   switch (cave[x-1][y])
   {
     case Xblank:
-    case Xacid_splash_e:
-    case Xacid_splash_w:
+    case Xsplash_e:
+    case Xsplash_w:
     case Xfake_acid_1:
     case Xfake_acid_2:
     case Xfake_acid_3:
@@ -2131,9 +2211,9 @@ static void Landroid_2_w(int x, int y)
       cave[x][y] = Yandroid_wB;
       next[x][y] = Xblank;
       if (cave[x][y-1] == Xblank)
-       cave[x][y-1] = Xacid_splash_e;
+       cave[x][y-1] = Xsplash_e;
       if (cave[x-2][y-1] == Xblank)
-       cave[x-2][y-1] = Xacid_splash_w;
+       cave[x-2][y-1] = Xsplash_w;
       play_element_sound(x, y, SOUND_acid, Xacid_1);
       return;
 
@@ -2180,8 +2260,8 @@ static void Leater_n(int x, int y)
   switch (cave[x][y-1])
   {
     case Xblank:
-    case Xacid_splash_e:
-    case Xacid_splash_w:
+    case Xsplash_e:
+    case Xsplash_w:
     case Xfake_acid_1:
     case Xfake_acid_2:
     case Xfake_acid_3:
@@ -2210,9 +2290,9 @@ static void Leater_n(int x, int y)
       cave[x][y] = Yeater_nB;
       next[x][y] = Xblank;
       if (cave[x+1][y-2] == Xblank)
-       cave[x+1][y-2] = Xacid_splash_e;
+       cave[x+1][y-2] = Xsplash_e;
       if (cave[x-1][y-2] == Xblank)
-       cave[x-1][y-2] = Xacid_splash_w;
+       cave[x-1][y-2] = Xsplash_w;
       play_element_sound(x, y, SOUND_acid, Xacid_1);
       return;
 
@@ -2260,8 +2340,8 @@ static void Leater_e(int x, int y)
   switch (cave[x+1][y])
   {
     case Xblank:
-    case Xacid_splash_e:
-    case Xacid_splash_w:
+    case Xsplash_e:
+    case Xsplash_w:
     case Xfake_acid_1:
     case Xfake_acid_2:
     case Xfake_acid_3:
@@ -2290,9 +2370,9 @@ static void Leater_e(int x, int y)
       cave[x][y] = Yeater_eB;
       next[x][y] = Xblank;
       if (cave[x+2][y-1] == Xblank)
-       cave[x+2][y-1] = Xacid_splash_e;
+       cave[x+2][y-1] = Xsplash_e;
       if (cave[x][y-1] == Xblank)
-       cave[x][y-1] = Xacid_splash_w;
+       cave[x][y-1] = Xsplash_w;
       play_element_sound(x, y, SOUND_acid, Xacid_1);
       return;
 
@@ -2340,8 +2420,8 @@ static void Leater_s(int x, int y)
   switch (cave[x][y+1])
   {
     case Xblank:
-    case Xacid_splash_e:
-    case Xacid_splash_w:
+    case Xsplash_e:
+    case Xsplash_w:
     case Xfake_acid_1:
     case Xfake_acid_2:
     case Xfake_acid_3:
@@ -2370,9 +2450,9 @@ static void Leater_s(int x, int y)
       cave[x][y] = Yeater_sB;
       next[x][y] = Xblank;
       if (cave[x+1][y] == Xblank)
-       cave[x+1][y] = Xacid_splash_e;
+       cave[x+1][y] = Xsplash_e;
       if (cave[x-1][y] == Xblank)
-       cave[x-1][y] = Xacid_splash_w;
+       cave[x-1][y] = Xsplash_w;
       play_element_sound(x, y, SOUND_acid, Xacid_1);
       return;
 
@@ -2420,8 +2500,8 @@ static void Leater_w(int x, int y)
   switch (cave[x-1][y])
   {
     case Xblank:
-    case Xacid_splash_e:
-    case Xacid_splash_w:
+    case Xsplash_e:
+    case Xsplash_w:
     case Xfake_acid_1:
     case Xfake_acid_2:
     case Xfake_acid_3:
@@ -2450,9 +2530,9 @@ static void Leater_w(int x, int y)
       cave[x][y] = Yeater_wB;
       next[x][y] = Xblank;
       if (cave[x][y-1] == Xblank)
-       cave[x][y-1] = Xacid_splash_e;
+       cave[x][y-1] = Xsplash_e;
       if (cave[x-2][y-1] == Xblank)
-       cave[x-2][y-1] = Xacid_splash_w;
+       cave[x-2][y-1] = Xsplash_w;
       play_element_sound(x, y, SOUND_acid, Xacid_1);
       return;
 
@@ -2484,8 +2564,8 @@ static void Lalien(int x, int y)
       switch (cave[x][y-1])
       {
        case Xblank:
-       case Xacid_splash_e:
-       case Xacid_splash_w:
+       case Xsplash_e:
+       case Xsplash_w:
        case Xfake_acid_1:
        case Xfake_acid_2:
        case Xfake_acid_3:
@@ -2515,9 +2595,9 @@ static void Lalien(int x, int y)
          cave[x][y] = Yalien_nB;
          next[x][y] = Xblank;
          if (cave[x+1][y-2] == Xblank)
-           cave[x+1][y-2] = Xacid_splash_e;
+           cave[x+1][y-2] = Xsplash_e;
          if (cave[x-1][y-2] == Xblank)
-           cave[x-1][y-2] = Xacid_splash_w;
+           cave[x-1][y-2] = Xsplash_w;
          play_element_sound(x, y, SOUND_acid, Xacid_1);
          return;
       }
@@ -2527,8 +2607,8 @@ static void Lalien(int x, int y)
       switch (cave[x][y+1])
       {
        case Xblank:
-       case Xacid_splash_e:
-       case Xacid_splash_w:
+       case Xsplash_e:
+       case Xsplash_w:
        case Xfake_acid_1:
        case Xfake_acid_2:
        case Xfake_acid_3:
@@ -2558,9 +2638,9 @@ static void Lalien(int x, int y)
          cave[x][y] = Yalien_sB;
          next[x][y] = Xblank;
          if (cave[x+1][y] == Xblank)
-           cave[x+1][y] = Xacid_splash_e;
+           cave[x+1][y] = Xsplash_e;
          if (cave[x-1][y] == Xblank)
-           cave[x-1][y] = Xacid_splash_w;
+           cave[x-1][y] = Xsplash_w;
          play_element_sound(x, y, SOUND_acid, Xacid_1);
          return;
       }
@@ -2573,8 +2653,8 @@ static void Lalien(int x, int y)
       switch (cave[x+1][y])
       {
        case Xblank:
-       case Xacid_splash_e:
-       case Xacid_splash_w:
+       case Xsplash_e:
+       case Xsplash_w:
        case Xfake_acid_1:
        case Xfake_acid_2:
        case Xfake_acid_3:
@@ -2604,9 +2684,9 @@ static void Lalien(int x, int y)
          cave[x][y] = Yalien_eB;
          next[x][y] = Xblank;
          if (cave[x+2][y-1] == Xblank)
-           cave[x+2][y-1] = Xacid_splash_e;
+           cave[x+2][y-1] = Xsplash_e;
          if (cave[x][y-1] == Xblank)
-           cave[x][y-1] = Xacid_splash_w;
+           cave[x][y-1] = Xsplash_w;
          play_element_sound(x, y, SOUND_acid, Xacid_1);
          return;
       }
@@ -2616,8 +2696,8 @@ static void Lalien(int x, int y)
       switch (cave[x-1][y])
       {
        case Xblank:
-       case Xacid_splash_e:
-       case Xacid_splash_w:
+       case Xsplash_e:
+       case Xsplash_w:
        case Xfake_acid_1:
        case Xfake_acid_2:
        case Xfake_acid_3:
@@ -2647,9 +2727,9 @@ static void Lalien(int x, int y)
          cave[x][y] = Yalien_wB;
          next[x][y] = Xblank;
          if (cave[x][y-1] == Xblank)
-           cave[x][y-1] = Xacid_splash_e;
+           cave[x][y-1] = Xsplash_e;
          if (cave[x-2][y-1] == Xblank)
-           cave[x-2][y-1] = Xacid_splash_w;
+           cave[x-2][y-1] = Xsplash_w;
          play_element_sound(x, y, SOUND_acid, Xacid_1);
          return;
       }
@@ -2667,8 +2747,8 @@ static void Lbug_n(int x, int y)
   switch (cave[x][y-1])
   {
     case Xblank:
-    case Xacid_splash_e:
-    case Xacid_splash_w:
+    case Xsplash_e:
+    case Xsplash_w:
     case Xfake_acid_1:
     case Xfake_acid_2:
     case Xfake_acid_3:
@@ -2698,9 +2778,9 @@ static void Lbug_n(int x, int y)
       cave[x][y] = Ybug_nB;
       next[x][y] = Xblank;
       if (cave[x+1][y-2] == Xblank)
-       cave[x+1][y-2] = Xacid_splash_e;
+       cave[x+1][y-2] = Xsplash_e;
       if (cave[x-1][y-2] == Xblank)
-       cave[x-1][y-2] = Xacid_splash_w;
+       cave[x-1][y-2] = Xsplash_w;
       play_element_sound(x, y, SOUND_acid, Xacid_1);
       return;
 
@@ -2714,10 +2794,10 @@ static void Lbug_n(int x, int y)
 
 static void Lbug_1_n(int x, int y)
 {
-  if (tab_amoeba[cave[x][y-1]] ||
-      tab_amoeba[cave[x+1][y]] ||
-      tab_amoeba[cave[x][y+1]] ||
-      tab_amoeba[cave[x-1][y]])
+  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]])
   {
     Lboom_bug(x, y, Xbug_1_n);
 
@@ -2727,8 +2807,8 @@ static void Lbug_1_n(int x, int y)
   switch (cave[x+1][y])
   {
     case Xblank:
-    case Xacid_splash_e:
-    case Xacid_splash_w:
+    case Xsplash_e:
+    case Xsplash_w:
     case Xfake_acid_1:
     case Xfake_acid_2:
     case Xfake_acid_3:
@@ -2761,10 +2841,10 @@ static void Lbug_1_n(int x, int y)
 
 static void Lbug_2_n(int x, int y)
 {
-  if (tab_amoeba[cave[x][y-1]] ||
-      tab_amoeba[cave[x+1][y]] ||
-      tab_amoeba[cave[x][y+1]] ||
-      tab_amoeba[cave[x-1][y]])
+  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]])
   {
     Lboom_bug(x, y, Xbug_2_n);
 
@@ -2779,8 +2859,8 @@ static void Lbug_e(int x, int y)
   switch (cave[x+1][y])
   {
     case Xblank:
-    case Xacid_splash_e:
-    case Xacid_splash_w:
+    case Xsplash_e:
+    case Xsplash_w:
     case Xfake_acid_1:
     case Xfake_acid_2:
     case Xfake_acid_3:
@@ -2810,9 +2890,9 @@ static void Lbug_e(int x, int y)
       cave[x][y] = Ybug_eB;
       next[x][y] = Xblank;
       if (cave[x+2][y-1] == Xblank)
-       cave[x+2][y-1] = Xacid_splash_e;
+       cave[x+2][y-1] = Xsplash_e;
       if (cave[x][y-1] == Xblank)
-       cave[x][y-1] = Xacid_splash_w;
+       cave[x][y-1] = Xsplash_w;
       play_element_sound(x, y, SOUND_acid, Xacid_1);
       return;
 
@@ -2826,10 +2906,10 @@ static void Lbug_e(int x, int y)
 
 static void Lbug_1_e(int x, int y)
 {
-  if (tab_amoeba[cave[x][y-1]] ||
-      tab_amoeba[cave[x+1][y]] ||
-      tab_amoeba[cave[x][y+1]] ||
-      tab_amoeba[cave[x-1][y]])
+  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]])
   {
     Lboom_bug(x, y, Xbug_1_e);
 
@@ -2839,8 +2919,8 @@ static void Lbug_1_e(int x, int y)
   switch (cave[x][y+1])
   {
     case Xblank:
-    case Xacid_splash_e:
-    case Xacid_splash_w:
+    case Xsplash_e:
+    case Xsplash_w:
     case Xfake_acid_1:
     case Xfake_acid_2:
     case Xfake_acid_3:
@@ -2873,10 +2953,10 @@ static void Lbug_1_e(int x, int y)
 
 static void Lbug_2_e(int x, int y)
 {
-  if (tab_amoeba[cave[x][y-1]] ||
-      tab_amoeba[cave[x+1][y]] ||
-      tab_amoeba[cave[x][y+1]] ||
-      tab_amoeba[cave[x-1][y]])
+  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]])
   {
     Lboom_bug(x, y, Xbug_2_e);
 
@@ -2891,8 +2971,8 @@ static void Lbug_s(int x, int y)
   switch (cave[x][y+1])
   {
     case Xblank:
-    case Xacid_splash_e:
-    case Xacid_splash_w:
+    case Xsplash_e:
+    case Xsplash_w:
     case Xfake_acid_1:
     case Xfake_acid_2:
     case Xfake_acid_3:
@@ -2922,9 +3002,9 @@ static void Lbug_s(int x, int y)
       cave[x][y] = Ybug_sB;
       next[x][y] = Xblank;
       if (cave[x+1][y] == Xblank)
-       cave[x+1][y] = Xacid_splash_e;
+       cave[x+1][y] = Xsplash_e;
       if (cave[x-1][y] == Xblank)
-       cave[x-1][y] = Xacid_splash_w;
+       cave[x-1][y] = Xsplash_w;
       play_element_sound(x, y, SOUND_acid, Xacid_1);
       return;
 
@@ -2938,10 +3018,10 @@ static void Lbug_s(int x, int y)
 
 static void Lbug_1_s(int x, int y)
 {
-  if (tab_amoeba[cave[x][y-1]] ||
-      tab_amoeba[cave[x+1][y]] ||
-      tab_amoeba[cave[x][y+1]] ||
-      tab_amoeba[cave[x-1][y]])
+  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]])
   {
     Lboom_bug(x, y, Xbug_1_s);
 
@@ -2951,8 +3031,8 @@ static void Lbug_1_s(int x, int y)
   switch (cave[x-1][y])
   {
     case Xblank:
-    case Xacid_splash_e:
-    case Xacid_splash_w:
+    case Xsplash_e:
+    case Xsplash_w:
     case Xfake_acid_1:
     case Xfake_acid_2:
     case Xfake_acid_3:
@@ -2985,10 +3065,10 @@ static void Lbug_1_s(int x, int y)
 
 static void Lbug_2_s(int x, int y)
 {
-  if (tab_amoeba[cave[x][y-1]] ||
-      tab_amoeba[cave[x+1][y]] ||
-      tab_amoeba[cave[x][y+1]] ||
-      tab_amoeba[cave[x-1][y]])
+  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]])
   {
     Lboom_bug(x, y, Xbug_2_s);
 
@@ -3003,8 +3083,8 @@ static void Lbug_w(int x, int y)
   switch (cave[x-1][y])
   {
     case Xblank:
-    case Xacid_splash_e:
-    case Xacid_splash_w:
+    case Xsplash_e:
+    case Xsplash_w:
     case Xfake_acid_1:
     case Xfake_acid_2:
     case Xfake_acid_3:
@@ -3034,9 +3114,9 @@ static void Lbug_w(int x, int y)
       cave[x][y] = Ybug_wB;
       next[x][y] = Xblank;
       if (cave[x][y-1] == Xblank)
-       cave[x][y-1] = Xacid_splash_e;
+       cave[x][y-1] = Xsplash_e;
       if (cave[x-2][y-1] == Xblank)
-       cave[x-2][y-1] = Xacid_splash_w;
+       cave[x-2][y-1] = Xsplash_w;
       play_element_sound(x, y, SOUND_acid, Xacid_1);
       return;
 
@@ -3050,10 +3130,10 @@ static void Lbug_w(int x, int y)
 
 static void Lbug_1_w(int x, int y)
 {
-  if (tab_amoeba[cave[x][y-1]] ||
-      tab_amoeba[cave[x+1][y]] ||
-      tab_amoeba[cave[x][y+1]] ||
-      tab_amoeba[cave[x-1][y]])
+  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]])
   {
     Lboom_bug(x, y, Xbug_1_w);
 
@@ -3063,8 +3143,8 @@ static void Lbug_1_w(int x, int y)
   switch (cave[x][y-1])
   {
     case Xblank:
-    case Xacid_splash_e:
-    case Xacid_splash_w:
+    case Xsplash_e:
+    case Xsplash_w:
     case Xfake_acid_1:
     case Xfake_acid_2:
     case Xfake_acid_3:
@@ -3097,10 +3177,10 @@ static void Lbug_1_w(int x, int y)
 
 static void Lbug_2_w(int x, int y)
 {
-  if (tab_amoeba[cave[x][y-1]] ||
-      tab_amoeba[cave[x+1][y]] ||
-      tab_amoeba[cave[x][y+1]] ||
-      tab_amoeba[cave[x-1][y]])
+  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]])
   {
     Lboom_bug(x, y, Xbug_2_w);
 
@@ -3115,8 +3195,8 @@ static void Ltank_n(int x, int y)
   switch (cave[x][y-1])
   {
     case Xblank:
-    case Xacid_splash_e:
-    case Xacid_splash_w:
+    case Xsplash_e:
+    case Xsplash_w:
     case Xfake_acid_1:
     case Xfake_acid_2:
     case Xfake_acid_3:
@@ -3146,9 +3226,9 @@ static void Ltank_n(int x, int y)
       cave[x][y] = Ytank_nB;
       next[x][y] = Xblank;
       if (cave[x+1][y-2] == Xblank)
-       cave[x+1][y-2] = Xacid_splash_e;
+       cave[x+1][y-2] = Xsplash_e;
       if (cave[x-1][y-2] == Xblank)
-       cave[x-1][y-2] = Xacid_splash_w;
+       cave[x-1][y-2] = Xsplash_w;
       play_element_sound(x, y, SOUND_acid, Xacid_1);
       return;
 
@@ -3162,10 +3242,10 @@ static void Ltank_n(int x, int y)
 
 static void Ltank_1_n(int x, int y)
 {
-  if (tab_amoeba[cave[x][y-1]] ||
-      tab_amoeba[cave[x+1][y]] ||
-      tab_amoeba[cave[x][y+1]] ||
-      tab_amoeba[cave[x-1][y]])
+  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]])
   {
     Lboom_tank(x, y, Xtank_1_n);
 
@@ -3175,8 +3255,8 @@ static void Ltank_1_n(int x, int y)
   switch (cave[x-1][y])
   {
     case Xblank:
-    case Xacid_splash_e:
-    case Xacid_splash_w:
+    case Xsplash_e:
+    case Xsplash_w:
     case Xfake_acid_1:
     case Xfake_acid_2:
     case Xfake_acid_3:
@@ -3209,10 +3289,10 @@ static void Ltank_1_n(int x, int y)
 
 static void Ltank_2_n(int x, int y)
 {
-  if (tab_amoeba[cave[x][y-1]] ||
-      tab_amoeba[cave[x+1][y]] ||
-      tab_amoeba[cave[x][y+1]] ||
-      tab_amoeba[cave[x-1][y]])
+  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]])
   {
     Lboom_tank(x, y, Xtank_2_n);
 
@@ -3227,8 +3307,8 @@ static void Ltank_e(int x, int y)
   switch (cave[x+1][y])
   {
     case Xblank:
-    case Xacid_splash_e:
-    case Xacid_splash_w:
+    case Xsplash_e:
+    case Xsplash_w:
     case Xfake_acid_1:
     case Xfake_acid_2:
     case Xfake_acid_3:
@@ -3258,9 +3338,9 @@ static void Ltank_e(int x, int y)
       cave[x][y] = Ytank_eB;
       next[x][y] = Xblank;
       if (cave[x+2][y-1] == Xblank)
-       cave[x+2][y-1] = Xacid_splash_e;
+       cave[x+2][y-1] = Xsplash_e;
       if (cave[x][y-1] == Xblank)
-       cave[x][y-1] = Xacid_splash_w;
+       cave[x][y-1] = Xsplash_w;
       play_element_sound(x, y, SOUND_acid, Xacid_1);
       return;
 
@@ -3274,10 +3354,10 @@ static void Ltank_e(int x, int y)
 
 static void Ltank_1_e(int x, int y)
 {
-  if (tab_amoeba[cave[x][y-1]] ||
-      tab_amoeba[cave[x+1][y]] ||
-      tab_amoeba[cave[x][y+1]] ||
-      tab_amoeba[cave[x-1][y]])
+  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]])
   {
     Lboom_tank(x, y, Xtank_1_e);
 
@@ -3287,8 +3367,8 @@ static void Ltank_1_e(int x, int y)
   switch (cave[x][y-1])
   {
     case Xblank:
-    case Xacid_splash_e:
-    case Xacid_splash_w:
+    case Xsplash_e:
+    case Xsplash_w:
     case Xfake_acid_1:
     case Xfake_acid_2:
     case Xfake_acid_3:
@@ -3321,10 +3401,10 @@ static void Ltank_1_e(int x, int y)
 
 static void Ltank_2_e(int x, int y)
 {
-  if (tab_amoeba[cave[x][y-1]] ||
-      tab_amoeba[cave[x+1][y]] ||
-      tab_amoeba[cave[x][y+1]] ||
-      tab_amoeba[cave[x-1][y]])
+  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]])
   {
     Lboom_tank(x, y, Xtank_2_e);
 
@@ -3339,8 +3419,8 @@ static void Ltank_s(int x, int y)
   switch (cave[x][y+1])
   {
     case Xblank:
-    case Xacid_splash_e:
-    case Xacid_splash_w:
+    case Xsplash_e:
+    case Xsplash_w:
     case Xfake_acid_1:
     case Xfake_acid_2:
     case Xfake_acid_3:
@@ -3370,9 +3450,9 @@ static void Ltank_s(int x, int y)
       cave[x][y] = Ytank_sB;
       next[x][y] = Xblank;
       if (cave[x+1][y] == Xblank)
-       cave[x+1][y] = Xacid_splash_e;
+       cave[x+1][y] = Xsplash_e;
       if (cave[x-1][y] == Xblank)
-       cave[x-1][y] = Xacid_splash_w;
+       cave[x-1][y] = Xsplash_w;
       play_element_sound(x, y, SOUND_acid, Xacid_1);
       return;
 
@@ -3386,10 +3466,10 @@ static void Ltank_s(int x, int y)
 
 static void Ltank_1_s(int x, int y)
 {
-  if (tab_amoeba[cave[x][y-1]] ||
-      tab_amoeba[cave[x+1][y]] ||
-      tab_amoeba[cave[x][y+1]] ||
-      tab_amoeba[cave[x-1][y]])
+  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]])
   {
     Lboom_tank(x, y, Xtank_1_s);
 
@@ -3399,8 +3479,8 @@ static void Ltank_1_s(int x, int y)
   switch (cave[x+1][y])
   {
     case Xblank:
-    case Xacid_splash_e:
-    case Xacid_splash_w:
+    case Xsplash_e:
+    case Xsplash_w:
     case Xfake_acid_1:
     case Xfake_acid_2:
     case Xfake_acid_3:
@@ -3433,10 +3513,10 @@ static void Ltank_1_s(int x, int y)
 
 static void Ltank_2_s(int x, int y)
 {
-  if (tab_amoeba[cave[x][y-1]] ||
-      tab_amoeba[cave[x+1][y]] ||
-      tab_amoeba[cave[x][y+1]] ||
-      tab_amoeba[cave[x-1][y]])
+  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]])
   {
     Lboom_tank(x, y, Xtank_2_s);
 
@@ -3451,8 +3531,8 @@ static void Ltank_w(int x, int y)
   switch (cave[x-1][y])
   {
     case Xblank:
-    case Xacid_splash_e:
-    case Xacid_splash_w:
+    case Xsplash_e:
+    case Xsplash_w:
     case Xfake_acid_1:
     case Xfake_acid_2:
     case Xfake_acid_3:
@@ -3482,9 +3562,9 @@ static void Ltank_w(int x, int y)
       cave[x][y] = Ytank_wB;
       next[x][y] = Xblank;
       if (cave[x][y-1] == Xblank)
-       cave[x][y-1] = Xacid_splash_e;
+       cave[x][y-1] = Xsplash_e;
       if (cave[x-2][y-1] == Xblank)
-       cave[x-2][y-1] = Xacid_splash_w;
+       cave[x-2][y-1] = Xsplash_w;
       play_element_sound(x, y, SOUND_acid, Xacid_1);
       return;
 
@@ -3498,10 +3578,10 @@ static void Ltank_w(int x, int y)
 
 static void Ltank_1_w(int x, int y)
 {
-  if (tab_amoeba[cave[x][y-1]] ||
-      tab_amoeba[cave[x+1][y]] ||
-      tab_amoeba[cave[x][y+1]] ||
-      tab_amoeba[cave[x-1][y]])
+  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]])
   {
     Lboom_tank(x, y, Xtank_1_w);
 
@@ -3511,8 +3591,8 @@ static void Ltank_1_w(int x, int y)
   switch (cave[x][y+1])
   {
     case Xblank:
-    case Xacid_splash_e:
-    case Xacid_splash_w:
+    case Xsplash_e:
+    case Xsplash_w:
     case Xfake_acid_1:
     case Xfake_acid_2:
     case Xfake_acid_3:
@@ -3545,10 +3625,10 @@ static void Ltank_1_w(int x, int y)
 
 static void Ltank_2_w(int x, int y)
 {
-  if (tab_amoeba[cave[x][y-1]] ||
-      tab_amoeba[cave[x+1][y]] ||
-      tab_amoeba[cave[x][y+1]] ||
-      tab_amoeba[cave[x-1][y]])
+  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]])
   {
     Lboom_tank(x, y, Xtank_2_w);
 
@@ -3563,8 +3643,8 @@ static void Lemerald(int x, int y)
   switch (cave[x][y+1])
   {
     case Xblank:
-    case Xacid_splash_e:
-    case Xacid_splash_w:
+    case Xsplash_e:
+    case Xsplash_w:
     case Xfake_acid_1:
     case Xfake_acid_2:
     case Xfake_acid_3:
@@ -3590,9 +3670,9 @@ static void Lemerald(int x, int y)
       cave[x][y] = Yemerald_sB;
       next[x][y] = Xblank;
       if (cave[x+1][y] == Xblank)
-       cave[x+1][y] = Xacid_splash_e;
+       cave[x+1][y] = Xsplash_e;
       if (cave[x-1][y] == Xblank)
-       cave[x-1][y] = Xacid_splash_w;
+       cave[x-1][y] = Xsplash_w;
       play_element_sound(x, y, SOUND_acid, Xacid_1);
       return;
 
@@ -3624,8 +3704,8 @@ static void Lemerald(int x, int y)
     case Xball_2:
     case Xnut:
     case Xnut_pause:
-    case Xslidewall_ns:
-    case Xslidewall_ew:
+    case Xslide_ns:
+    case Xslide_ew:
     case Xwonderwall:
     case Xkey_1:
     case Xkey_2:
@@ -3651,7 +3731,7 @@ static void Lemerald(int x, int y)
     case Xroundwall_4:
       if (RANDOM(2))
       {
-       if (tab_blank[cave[x+1][y]] && tab_acid[cave[x+1][y+1]])
+       if (is_blank[cave[x+1][y]] && is_blank_or_acid[cave[x+1][y+1]])
        {
          cave[x][y] = Yemerald_eB;
          next[x][y] = Xblank;
@@ -3660,7 +3740,7 @@ static void Lemerald(int x, int y)
          return;
        }
 
-       if (tab_blank[cave[x-1][y]] && tab_acid[cave[x-1][y+1]])
+       if (is_blank[cave[x-1][y]] && is_blank_or_acid[cave[x-1][y+1]])
        {
          cave[x][y] = Yemerald_wB;
          next[x][y] = Xblank;
@@ -3671,7 +3751,7 @@ static void Lemerald(int x, int y)
       }
       else
       {
-       if (tab_blank[cave[x-1][y]] && tab_acid[cave[x-1][y+1]])
+       if (is_blank[cave[x-1][y]] && is_blank_or_acid[cave[x-1][y+1]])
        {
          cave[x][y] = Yemerald_wB;
          next[x][y] = Xblank;
@@ -3680,7 +3760,7 @@ static void Lemerald(int x, int y)
          return;
        }
 
-       if (tab_blank[cave[x+1][y]] && tab_acid[cave[x+1][y+1]])
+       if (is_blank[cave[x+1][y]] && is_blank_or_acid[cave[x+1][y+1]])
        {
          cave[x][y] = Yemerald_eB;
          next[x][y] = Xblank;
@@ -3706,8 +3786,8 @@ static void Lemerald_pause(int x, int y)
   switch (cave[x][y+1])
   {
     case Xblank:
-    case Xacid_splash_e:
-    case Xacid_splash_w:
+    case Xsplash_e:
+    case Xsplash_w:
     case Xfake_acid_1:
     case Xfake_acid_2:
     case Xfake_acid_3:
@@ -3733,9 +3813,9 @@ static void Lemerald_pause(int x, int y)
       cave[x][y] = Yemerald_sB;
       next[x][y] = Xblank;
       if (cave[x+1][y] == Xblank)
-       cave[x+1][y] = Xacid_splash_e;
+       cave[x+1][y] = Xsplash_e;
       if (cave[x-1][y] == Xblank)
-       cave[x-1][y] = Xacid_splash_w;
+       cave[x-1][y] = Xsplash_w;
       play_element_sound(x, y, SOUND_acid, Xacid_1);
       return;
 
@@ -3751,8 +3831,8 @@ static void Lemerald_fall(int x, int y)
   switch (cave[x][y+1])
   {
     case Xblank:
-    case Xacid_splash_e:
-    case Xacid_splash_w:
+    case Xsplash_e:
+    case Xsplash_w:
     case Xfake_acid_1:
     case Xfake_acid_2:
     case Xfake_acid_3:
@@ -3779,9 +3859,9 @@ static void Lemerald_fall(int x, int y)
       cave[x][y] = Yemerald_sB;
       next[x][y] = Xblank;
       if (cave[x+1][y] == Xblank)
-       cave[x+1][y] = Xacid_splash_e;
+       cave[x+1][y] = Xsplash_e;
       if (cave[x-1][y] == Xblank)
-       cave[x-1][y] = Xacid_splash_w;
+       cave[x-1][y] = Xsplash_w;
       play_element_sound(x, y, SOUND_acid, Xacid_1);
       return;
 
@@ -3790,7 +3870,7 @@ static void Lemerald_fall(int x, int y)
       {
        lev.wonderwall_state = 1;
        cave[x][y] = Yemerald_sB;
-       if (tab_blank[cave[x][y+2]])
+       if (is_blank[cave[x][y+2]])
        {
          cave[x][y+2] = Ydiamond_s;
          next[x][y+2] = Xdiamond_fall;
@@ -3814,8 +3894,8 @@ static void Ldiamond(int x, int y)
   switch (cave[x][y+1])
   {
     case Xblank:
-    case Xacid_splash_e:
-    case Xacid_splash_w:
+    case Xsplash_e:
+    case Xsplash_w:
     case Xfake_acid_1:
     case Xfake_acid_2:
     case Xfake_acid_3:
@@ -3841,9 +3921,9 @@ static void Ldiamond(int x, int y)
       cave[x][y] = Ydiamond_sB;
       next[x][y] = Xblank;
       if (cave[x+1][y] == Xblank)
-       cave[x+1][y] = Xacid_splash_e;
+       cave[x+1][y] = Xsplash_e;
       if (cave[x-1][y] == Xblank)
-       cave[x-1][y] = Xacid_splash_w;
+       cave[x-1][y] = Xsplash_w;
       play_element_sound(x, y, SOUND_acid, Xacid_1);
       return;
 
@@ -3875,8 +3955,8 @@ static void Ldiamond(int x, int y)
     case Xball_2:
     case Xnut:
     case Xnut_pause:
-    case Xslidewall_ns:
-    case Xslidewall_ew:
+    case Xslide_ns:
+    case Xslide_ew:
     case Xwonderwall:
     case Xkey_1:
     case Xkey_2:
@@ -3902,7 +3982,7 @@ static void Ldiamond(int x, int y)
     case Xroundwall_4:
       if (RANDOM(2))
       {
-       if (tab_blank[cave[x+1][y]] && tab_acid[cave[x+1][y+1]])
+       if (is_blank[cave[x+1][y]] && is_blank_or_acid[cave[x+1][y+1]])
        {
          cave[x][y] = Ydiamond_eB;
          next[x][y] = Xblank;
@@ -3911,7 +3991,7 @@ static void Ldiamond(int x, int y)
          return;
        }
 
-       if (tab_blank[cave[x-1][y]] && tab_acid[cave[x-1][y+1]])
+       if (is_blank[cave[x-1][y]] && is_blank_or_acid[cave[x-1][y+1]])
        {
          cave[x][y] = Ydiamond_wB;
          next[x][y] = Xblank;
@@ -3922,7 +4002,7 @@ static void Ldiamond(int x, int y)
       }
       else
       {
-       if (tab_blank[cave[x-1][y]] && tab_acid[cave[x-1][y+1]])
+       if (is_blank[cave[x-1][y]] && is_blank_or_acid[cave[x-1][y+1]])
        {
          cave[x][y] = Ydiamond_wB;
          next[x][y] = Xblank;
@@ -3931,7 +4011,7 @@ static void Ldiamond(int x, int y)
          return;
        }
 
-       if (tab_blank[cave[x+1][y]] && tab_acid[cave[x+1][y+1]])
+       if (is_blank[cave[x+1][y]] && is_blank_or_acid[cave[x+1][y+1]])
        {
          cave[x][y] = Ydiamond_eB;
          next[x][y] = Xblank;
@@ -3957,8 +4037,8 @@ static void Ldiamond_pause(int x, int y)
   switch (cave[x][y+1])
   {
     case Xblank:
-    case Xacid_splash_e:
-    case Xacid_splash_w:
+    case Xsplash_e:
+    case Xsplash_w:
     case Xfake_acid_1:
     case Xfake_acid_2:
     case Xfake_acid_3:
@@ -3984,9 +4064,9 @@ static void Ldiamond_pause(int x, int y)
       cave[x][y] = Ydiamond_sB;
       next[x][y] = Xblank;
       if (cave[x+1][y] == Xblank)
-       cave[x+1][y] = Xacid_splash_e;
+       cave[x+1][y] = Xsplash_e;
       if (cave[x-1][y] == Xblank)
-       cave[x-1][y] = Xacid_splash_w;
+       cave[x-1][y] = Xsplash_w;
       play_element_sound(x, y, SOUND_acid, Xacid_1);
       return;
 
@@ -4002,8 +4082,8 @@ static void Ldiamond_fall(int x, int y)
   switch (cave[x][y+1])
   {
     case Xblank:
-    case Xacid_splash_e:
-    case Xacid_splash_w:
+    case Xsplash_e:
+    case Xsplash_w:
     case Xfake_acid_1:
     case Xfake_acid_2:
     case Xfake_acid_3:
@@ -4030,9 +4110,9 @@ static void Ldiamond_fall(int x, int y)
       cave[x][y] = Ydiamond_sB;
       next[x][y] = Xblank;
       if (cave[x+1][y] == Xblank)
-       cave[x+1][y] = Xacid_splash_e;
+       cave[x+1][y] = Xsplash_e;
       if (cave[x-1][y] == Xblank)
-       cave[x-1][y] = Xacid_splash_w;
+       cave[x-1][y] = Xsplash_w;
       play_element_sound(x, y, SOUND_acid, Xacid_1);
       return;
 
@@ -4041,7 +4121,7 @@ static void Ldiamond_fall(int x, int y)
       {
        lev.wonderwall_state = 1;
        cave[x][y] = Ydiamond_sB;
-       if (tab_blank[cave[x][y+2]])
+       if (is_blank[cave[x][y+2]])
        {
          cave[x][y+2] = Ystone_s;
          next[x][y+2] = Xstone_fall;
@@ -4065,8 +4145,8 @@ static void Lstone(int x, int y)
   switch (cave[x][y+1])
   {
     case Xblank:
-    case Xacid_splash_e:
-    case Xacid_splash_w:
+    case Xsplash_e:
+    case Xsplash_w:
     case Xfake_acid_1:
     case Xfake_acid_2:
     case Xfake_acid_3:
@@ -4094,9 +4174,9 @@ static void Lstone(int x, int y)
       cave[x][y] = Ystone_sB;
       next[x][y] = Xblank;
       if (cave[x+1][y] == Xblank)
-       cave[x+1][y] = Xacid_splash_e;
+       cave[x+1][y] = Xsplash_e;
       if (cave[x-1][y] == Xblank)
-       cave[x-1][y] = Xacid_splash_w;
+       cave[x-1][y] = Xsplash_w;
       play_element_sound(x, y, SOUND_acid, Xacid_1);
       return;
 
@@ -4135,8 +4215,8 @@ static void Lstone(int x, int y)
     case Xball_2:
     case Xnut:
     case Xnut_pause:
-    case Xslidewall_ns:
-    case Xslidewall_ew:
+    case Xslide_ns:
+    case Xslide_ew:
     case Xkey_1:
     case Xkey_2:
     case Xkey_3:
@@ -4155,7 +4235,7 @@ static void Lstone(int x, int y)
     case Xroundwall_4:
       if (RANDOM(2))
       {
-       if (tab_blank[cave[x+1][y]] && tab_acid[cave[x+1][y+1]])
+       if (is_blank[cave[x+1][y]] && is_blank_or_acid[cave[x+1][y+1]])
        {
          cave[x][y] = Ystone_eB;
          next[x][y] = Xblank;
@@ -4164,7 +4244,7 @@ static void Lstone(int x, int y)
          return;
        }
 
-       if (tab_blank[cave[x-1][y]] && tab_acid[cave[x-1][y+1]])
+       if (is_blank[cave[x-1][y]] && is_blank_or_acid[cave[x-1][y+1]])
        {
          cave[x][y] = Ystone_wB;
          next[x][y] = Xblank;
@@ -4175,7 +4255,7 @@ static void Lstone(int x, int y)
       }
       else
       {
-       if (tab_blank[cave[x-1][y]] && tab_acid[cave[x-1][y+1]])
+       if (is_blank[cave[x-1][y]] && is_blank_or_acid[cave[x-1][y+1]])
        {
          cave[x][y] = Ystone_wB;
          next[x][y] = Xblank;
@@ -4184,7 +4264,7 @@ static void Lstone(int x, int y)
          return;
        }
 
-       if (tab_blank[cave[x+1][y]] && tab_acid[cave[x+1][y+1]])
+       if (is_blank[cave[x+1][y]] && is_blank_or_acid[cave[x+1][y+1]])
        {
          cave[x][y] = Ystone_eB;
          next[x][y] = Xblank;
@@ -4201,8 +4281,8 @@ static void Lstone_pause(int x, int y)
   switch (cave[x][y+1])
   {
     case Xblank:
-    case Xacid_splash_e:
-    case Xacid_splash_w:
+    case Xsplash_e:
+    case Xsplash_w:
     case Xfake_acid_1:
     case Xfake_acid_2:
     case Xfake_acid_3:
@@ -4228,9 +4308,9 @@ static void Lstone_pause(int x, int y)
       cave[x][y] = Ystone_sB;
       next[x][y] = Xblank;
       if (cave[x+1][y] == Xblank)
-       cave[x+1][y] = Xacid_splash_e;
+       cave[x+1][y] = Xsplash_e;
       if (cave[x-1][y] == Xblank)
-       cave[x-1][y] = Xacid_splash_w;
+       cave[x-1][y] = Xsplash_w;
       play_element_sound(x, y, SOUND_acid, Xacid_1);
       return;
 
@@ -4246,8 +4326,8 @@ static void Lstone_fall(int x, int y)
   switch (cave[x][y+1])
   {
     case Xblank:
-    case Xacid_splash_e:
-    case Xacid_splash_w:
+    case Xsplash_e:
+    case Xsplash_w:
     case Xfake_acid_1:
     case Xfake_acid_2:
     case Xfake_acid_3:
@@ -4274,9 +4354,9 @@ static void Lstone_fall(int x, int y)
       cave[x][y] = Ystone_sB;
       next[x][y] = Xblank;
       if (cave[x+1][y] == Xblank)
-       cave[x+1][y] = Xacid_splash_e;
+       cave[x+1][y] = Xsplash_e;
       if (cave[x-1][y] == Xblank)
-       cave[x-1][y] = Xacid_splash_w;
+       cave[x-1][y] = Xsplash_w;
       play_element_sound(x, y, SOUND_acid, Xacid_1);
       return;
 
@@ -4323,8 +4403,8 @@ static void Lstone_fall(int x, int y)
        switch (cave[x+1][y+1])
        {
          case Xblank:
-         case Xacid_splash_e:
-         case Xacid_splash_w:
+         case Xsplash_e:
+         case Xsplash_w:
          case Xfake_acid_1:
          case Xfake_acid_2:
          case Xfake_acid_3:
@@ -4348,8 +4428,8 @@ static void Lstone_fall(int x, int y)
        switch (cave[x-1][y+1])
        {
          case Xblank:
-         case Xacid_splash_e:
-         case Xacid_splash_w:
+         case Xsplash_e:
+         case Xsplash_w:
          case Xfake_acid_1:
          case Xfake_acid_2:
          case Xfake_acid_3:
@@ -4394,8 +4474,8 @@ static void Lstone_fall(int x, int y)
       switch (cave[x][y+2])
       {
        case Xblank:
-       case Xacid_splash_e:
-       case Xacid_splash_w:
+       case Xsplash_e:
+       case Xsplash_w:
        case Xfake_acid_1:
        case Xfake_acid_2:
        case Xfake_acid_3:
@@ -4471,7 +4551,7 @@ static void Lstone_fall(int x, int y)
        lev.wonderwall_state = 1;
        cave[x][y] = Ystone_sB;
 
-       if (tab_blank[cave[x][y+2]])
+       if (is_blank[cave[x][y+2]])
        {
          cave[x][y+2] = Yemerald_s;
          next[x][y+2] = Xemerald_fall;
@@ -4495,8 +4575,8 @@ static void Lbomb(int x, int y)
   switch (cave[x][y+1])
   {
     case Xblank:
-    case Xacid_splash_e:
-    case Xacid_splash_w:
+    case Xsplash_e:
+    case Xsplash_w:
     case Xfake_acid_1:
     case Xfake_acid_2:
     case Xfake_acid_3:
@@ -4522,9 +4602,9 @@ static void Lbomb(int x, int y)
       cave[x][y] = Ybomb_sB;
       next[x][y] = Xblank;
       if (cave[x+1][y] == Xblank)
-       cave[x+1][y] = Xacid_splash_e;
+       cave[x+1][y] = Xsplash_e;
       if (cave[x-1][y] == Xblank)
-       cave[x-1][y] = Xacid_splash_w;
+       cave[x-1][y] = Xsplash_w;
       play_element_sound(x, y, SOUND_acid, Xacid_1);
       return;
 
@@ -4556,8 +4636,8 @@ static void Lbomb(int x, int y)
     case Xball_2:
     case Xnut:
     case Xnut_pause:
-    case Xslidewall_ns:
-    case Xslidewall_ew:
+    case Xslide_ns:
+    case Xslide_ew:
     case Xkey_1:
     case Xkey_2:
     case Xkey_3:
@@ -4574,7 +4654,7 @@ static void Lbomb(int x, int y)
     case Xroundwall_4:
       if (RANDOM(2))
       {
-       if (tab_blank[cave[x+1][y]] && tab_acid[cave[x+1][y+1]])
+       if (is_blank[cave[x+1][y]] && is_blank_or_acid[cave[x+1][y+1]])
        {
          cave[x][y] = Ybomb_eB;
          next[x][y] = Xblank;
@@ -4583,7 +4663,7 @@ static void Lbomb(int x, int y)
          return;
        }
 
-       if (tab_blank[cave[x-1][y]] && tab_acid[cave[x-1][y+1]])
+       if (is_blank[cave[x-1][y]] && is_blank_or_acid[cave[x-1][y+1]])
        {
          cave[x][y] = Ybomb_wB;
          next[x][y] = Xblank;
@@ -4594,7 +4674,7 @@ static void Lbomb(int x, int y)
       }
       else
       {
-       if (tab_blank[cave[x-1][y]] && tab_acid[cave[x-1][y+1]])
+       if (is_blank[cave[x-1][y]] && is_blank_or_acid[cave[x-1][y+1]])
        {
          cave[x][y] = Ybomb_wB;
          next[x][y] = Xblank;
@@ -4603,7 +4683,7 @@ static void Lbomb(int x, int y)
          return;
        }
 
-       if (tab_blank[cave[x+1][y]] && tab_acid[cave[x+1][y+1]])
+       if (is_blank[cave[x+1][y]] && is_blank_or_acid[cave[x+1][y+1]])
        {
          cave[x][y] = Ybomb_eB;
          next[x][y] = Xblank;
@@ -4620,8 +4700,8 @@ static void Lbomb_pause(int x, int y)
   switch (cave[x][y+1])
   {
     case Xblank:
-    case Xacid_splash_e:
-    case Xacid_splash_w:
+    case Xsplash_e:
+    case Xsplash_w:
     case Xfake_acid_1:
     case Xfake_acid_2:
     case Xfake_acid_3:
@@ -4647,9 +4727,9 @@ static void Lbomb_pause(int x, int y)
       cave[x][y] = Ybomb_sB;
       next[x][y] = Xblank;
       if (cave[x+1][y] == Xblank)
-       cave[x+1][y] = Xacid_splash_e;
+       cave[x+1][y] = Xsplash_e;
       if (cave[x-1][y] == Xblank)
-       cave[x-1][y] = Xacid_splash_w;
+       cave[x-1][y] = Xsplash_w;
       play_element_sound(x, y, SOUND_acid, Xacid_1);
       return;
 
@@ -4665,8 +4745,8 @@ static void Lbomb_fall(int x, int y)
   switch (cave[x][y+1])
   {
     case Xblank:
-    case Xacid_splash_e:
-    case Xacid_splash_w:
+    case Xsplash_e:
+    case Xsplash_w:
     case Xfake_acid_1:
     case Xfake_acid_2:
     case Xfake_acid_3:
@@ -4692,9 +4772,9 @@ static void Lbomb_fall(int x, int y)
       cave[x][y] = Ybomb_sB;
       next[x][y] = Xblank;
       if (cave[x+1][y] == Xblank)
-       cave[x+1][y] = Xacid_splash_e;
+       cave[x+1][y] = Xsplash_e;
       if (cave[x-1][y] == Xblank)
-       cave[x-1][y] = Xacid_splash_w;
+       cave[x-1][y] = Xsplash_w;
       play_element_sound(x, y, SOUND_acid, Xacid_1);
       return;
 
@@ -4710,8 +4790,8 @@ static void Lnut(int x, int y)
   switch (cave[x][y+1])
   {
     case Xblank:
-    case Xacid_splash_e:
-    case Xacid_splash_w:
+    case Xsplash_e:
+    case Xsplash_w:
     case Xfake_acid_1:
     case Xfake_acid_2:
     case Xfake_acid_3:
@@ -4737,9 +4817,9 @@ static void Lnut(int x, int y)
       cave[x][y] = Ynut_sB;
       next[x][y] = Xblank;
       if (cave[x+1][y] == Xblank)
-       cave[x+1][y] = Xacid_splash_e;
+       cave[x+1][y] = Xsplash_e;
       if (cave[x-1][y] == Xblank)
-       cave[x-1][y] = Xacid_splash_w;
+       cave[x-1][y] = Xsplash_w;
       play_element_sound(x, y, SOUND_acid, Xacid_1);
       return;
 
@@ -4771,8 +4851,8 @@ static void Lnut(int x, int y)
     case Xball_2:
     case Xnut:
     case Xnut_pause:
-    case Xslidewall_ns:
-    case Xslidewall_ew:
+    case Xslide_ns:
+    case Xslide_ew:
     case Xkey_1:
     case Xkey_2:
     case Xkey_3:
@@ -4789,7 +4869,7 @@ static void Lnut(int x, int y)
     case Xroundwall_4:
       if (RANDOM(2))
       {
-       if (tab_blank[cave[x+1][y]] && tab_acid[cave[x+1][y+1]])
+       if (is_blank[cave[x+1][y]] && is_blank_or_acid[cave[x+1][y+1]])
        {
          cave[x][y] = Ynut_eB;
          next[x][y] = Xblank;
@@ -4798,7 +4878,7 @@ static void Lnut(int x, int y)
          return;
        }
 
-       if (tab_blank[cave[x-1][y]] && tab_acid[cave[x-1][y+1]])
+       if (is_blank[cave[x-1][y]] && is_blank_or_acid[cave[x-1][y+1]])
        {
          cave[x][y] = Ynut_wB;
          next[x][y] = Xblank;
@@ -4809,7 +4889,7 @@ static void Lnut(int x, int y)
       }
       else
       {
-       if (tab_blank[cave[x-1][y]] && tab_acid[cave[x-1][y+1]])
+       if (is_blank[cave[x-1][y]] && is_blank_or_acid[cave[x-1][y+1]])
        {
          cave[x][y] = Ynut_wB;
          next[x][y] = Xblank;
@@ -4818,7 +4898,7 @@ static void Lnut(int x, int y)
          return;
        }
 
-       if (tab_blank[cave[x+1][y]] && tab_acid[cave[x+1][y+1]])
+       if (is_blank[cave[x+1][y]] && is_blank_or_acid[cave[x+1][y+1]])
        {
          cave[x][y] = Ynut_eB;
          next[x][y] = Xblank;
@@ -4835,8 +4915,8 @@ static void Lnut_pause(int x, int y)
   switch (cave[x][y+1])
   {
     case Xblank:
-    case Xacid_splash_e:
-    case Xacid_splash_w:
+    case Xsplash_e:
+    case Xsplash_w:
     case Xfake_acid_1:
     case Xfake_acid_2:
     case Xfake_acid_3:
@@ -4862,9 +4942,9 @@ static void Lnut_pause(int x, int y)
       cave[x][y] = Ynut_sB;
       next[x][y] = Xblank;
       if (cave[x+1][y] == Xblank)
-       cave[x+1][y] = Xacid_splash_e;
+       cave[x+1][y] = Xsplash_e;
       if (cave[x-1][y] == Xblank)
-       cave[x-1][y] = Xacid_splash_w;
+       cave[x-1][y] = Xsplash_w;
       play_element_sound(x, y, SOUND_acid, Xacid_1);
       return;
 
@@ -4880,8 +4960,8 @@ static void Lnut_fall(int x, int y)
   switch (cave[x][y+1])
   {
     case Xblank:
-    case Xacid_splash_e:
-    case Xacid_splash_w:
+    case Xsplash_e:
+    case Xsplash_w:
     case Xfake_acid_1:
     case Xfake_acid_2:
     case Xfake_acid_3:
@@ -4908,9 +4988,9 @@ static void Lnut_fall(int x, int y)
       cave[x][y] = Ynut_sB;
       next[x][y] = Xblank;
       if (cave[x+1][y] == Xblank)
-       cave[x+1][y] = Xacid_splash_e;
+       cave[x+1][y] = Xsplash_e;
       if (cave[x-1][y] == Xblank)
-       cave[x-1][y] = Xacid_splash_w;
+       cave[x-1][y] = Xsplash_w;
       play_element_sound(x, y, SOUND_acid, Xacid_1);
       return;
 
@@ -4927,8 +5007,8 @@ static void Lspring(int x, int y)
   switch (cave[x][y+1])
   {
     case Xblank:
-    case Xacid_splash_e:
-    case Xacid_splash_w:
+    case Xsplash_e:
+    case Xsplash_w:
     case Xfake_acid_1:
     case Xfake_acid_2:
     case Xfake_acid_3:
@@ -4956,9 +5036,9 @@ static void Lspring(int x, int y)
       cave[x][y] = Yspring_sB;
       next[x][y] = Xblank;
       if (cave[x+1][y] == Xblank)
-       cave[x+1][y] = Xacid_splash_e;
+       cave[x+1][y] = Xsplash_e;
       if (cave[x-1][y] == Xblank)
-       cave[x-1][y] = Xacid_splash_w;
+       cave[x-1][y] = Xsplash_w;
       play_element_sound(x, y, SOUND_acid, Xacid_1);
       return;
 
@@ -4990,8 +5070,8 @@ static void Lspring(int x, int y)
     case Xball_2:
     case Xnut:
     case Xnut_pause:
-    case Xslidewall_ns:
-    case Xslidewall_ew:
+    case Xslide_ns:
+    case Xslide_ew:
     case Xkey_1:
     case Xkey_2:
     case Xkey_3:
@@ -5008,7 +5088,7 @@ static void Lspring(int x, int y)
     case Xroundwall_4:
       if (RANDOM(2))
       {
-       if (tab_blank[cave[x+1][y]] && tab_acid[cave[x+1][y+1]])
+       if (is_blank[cave[x+1][y]] && is_blank_or_acid[cave[x+1][y+1]])
        {
          cave[x][y] = Yspring_eB;
          next[x][y] = Xblank;
@@ -5024,7 +5104,7 @@ static void Lspring(int x, int y)
          return;
        }
 
-       if (tab_blank[cave[x-1][y]] && tab_acid[cave[x-1][y+1]])
+       if (is_blank[cave[x-1][y]] && is_blank_or_acid[cave[x-1][y+1]])
        {
          cave[x][y] = Yspring_wB;
          next[x][y] = Xblank;
@@ -5042,7 +5122,7 @@ static void Lspring(int x, int y)
       }
       else
       {
-       if (tab_blank[cave[x-1][y]] && tab_acid[cave[x-1][y+1]])
+       if (is_blank[cave[x-1][y]] && is_blank_or_acid[cave[x-1][y+1]])
        {
          cave[x][y] = Yspring_wB;
          next[x][y] = Xblank;
@@ -5058,7 +5138,7 @@ static void Lspring(int x, int y)
          return;
        }
 
-       if (tab_blank[cave[x+1][y]] && tab_acid[cave[x+1][y+1]])
+       if (is_blank[cave[x+1][y]] && is_blank_or_acid[cave[x+1][y+1]])
        {
          cave[x][y] = Yspring_eB;
          next[x][y] = Xblank;
@@ -5082,8 +5162,8 @@ static void Lspring_pause(int x, int y)
   switch (cave[x][y+1])
   {
     case Xblank:
-    case Xacid_splash_e:
-    case Xacid_splash_w:
+    case Xsplash_e:
+    case Xsplash_w:
     case Xfake_acid_1:
     case Xfake_acid_2:
     case Xfake_acid_3:
@@ -5109,9 +5189,9 @@ static void Lspring_pause(int x, int y)
       cave[x][y] = Yspring_sB;
       next[x][y] = Xblank;
       if (cave[x+1][y] == Xblank)
-       cave[x+1][y] = Xacid_splash_e;
+       cave[x+1][y] = Xsplash_e;
       if (cave[x-1][y] == Xblank)
-       cave[x-1][y] = Xacid_splash_w;
+       cave[x-1][y] = Xsplash_w;
       play_element_sound(x, y, SOUND_acid, Xacid_1);
       return;
 
@@ -5127,8 +5207,8 @@ static void Lspring_e(int x, int y)
   switch (cave[x][y+1])
   {
     case Xblank:
-    case Xacid_splash_e:
-    case Xacid_splash_w:
+    case Xsplash_e:
+    case Xsplash_w:
     case Xfake_acid_1:
     case Xfake_acid_2:
     case Xfake_acid_3:
@@ -5154,9 +5234,9 @@ static void Lspring_e(int x, int y)
       cave[x][y] = Yspring_sB;
       next[x][y] = Xblank;
       if (cave[x+1][y] == Xblank)
-       cave[x+1][y] = Xacid_splash_e;
+       cave[x+1][y] = Xsplash_e;
       if (cave[x-1][y] == Xblank)
-       cave[x-1][y] = Xacid_splash_w;
+       cave[x-1][y] = Xsplash_w;
       play_element_sound(x, y, SOUND_acid, Xacid_1);
       return;
 
@@ -5167,8 +5247,8 @@ static void Lspring_e(int x, int y)
   switch (cave[x+1][y])
   {
     case Xblank:
-    case Xacid_splash_e:
-    case Xacid_splash_w:
+    case Xsplash_e:
+    case Xsplash_w:
     case Xfake_acid_1:
     case Xfake_acid_2:
     case Xfake_acid_3:
@@ -5198,9 +5278,9 @@ static void Lspring_e(int x, int y)
       cave[x][y] = Yspring_eB;
       next[x][y] = Xblank;
       if (cave[x+2][y-1] == Xblank)
-       cave[x+2][y-1] = Xacid_splash_e;
+       cave[x+2][y-1] = Xsplash_e;
       if (cave[x][y-1] == Xblank)
-       cave[x][y-1] = Xacid_splash_w;
+       cave[x][y-1] = Xsplash_w;
       play_element_sound(x, y, SOUND_acid, Xacid_1);
       return;
 
@@ -5238,8 +5318,8 @@ static void Lspring_w(int x, int y)
   switch (cave[x][y+1])
   {
     case Xblank:
-    case Xacid_splash_e:
-    case Xacid_splash_w:
+    case Xsplash_e:
+    case Xsplash_w:
     case Xfake_acid_1:
     case Xfake_acid_2:
     case Xfake_acid_3:
@@ -5265,9 +5345,9 @@ static void Lspring_w(int x, int y)
       cave[x][y] = Yspring_sB;
       next[x][y] = Xblank;
       if (cave[x+1][y] == Xblank)
-       cave[x+1][y] = Xacid_splash_e;
+       cave[x+1][y] = Xsplash_e;
       if (cave[x-1][y] == Xblank)
-       cave[x-1][y] = Xacid_splash_w;
+       cave[x-1][y] = Xsplash_w;
       play_element_sound(x, y, SOUND_acid, Xacid_1);
       return;
 
@@ -5278,8 +5358,8 @@ static void Lspring_w(int x, int y)
   switch (cave[x-1][y])
   {
     case Xblank:
-    case Xacid_splash_e:
-    case Xacid_splash_w:
+    case Xsplash_e:
+    case Xsplash_w:
     case Xfake_acid_1:
     case Xfake_acid_2:
     case Xfake_acid_3:
@@ -5309,9 +5389,9 @@ static void Lspring_w(int x, int y)
       cave[x][y] = Yspring_wB;
       next[x][y] = Xblank;
       if (cave[x][y-1] == Xblank)
-       cave[x][y-1] = Xacid_splash_e;
+       cave[x][y-1] = Xsplash_e;
       if (cave[x-2][y-1] == Xblank)
-       cave[x-2][y-1] = Xacid_splash_w;
+       cave[x-2][y-1] = Xsplash_w;
       play_element_sound(x, y, SOUND_acid, Xacid_1);
       return;
 
@@ -5349,8 +5429,8 @@ static void Lspring_fall(int x, int y)
   switch (cave[x][y+1])
   {
     case Xblank:
-    case Xacid_splash_e:
-    case Xacid_splash_w:
+    case Xsplash_e:
+    case Xsplash_w:
     case Xfake_acid_1:
     case Xfake_acid_2:
     case Xfake_acid_3:
@@ -5377,9 +5457,9 @@ static void Lspring_fall(int x, int y)
       cave[x][y] = Yspring_sB;
       next[x][y] = Xblank;
       if (cave[x+1][y] == Xblank)
-       cave[x+1][y] = Xacid_splash_e;
+       cave[x+1][y] = Xsplash_e;
       if (cave[x-1][y] == Xblank)
-       cave[x-1][y] = Xacid_splash_w;
+       cave[x-1][y] = Xsplash_w;
       play_element_sound(x, y, SOUND_acid, Xacid_1);
       return;
 
@@ -5828,8 +5908,8 @@ static void Lballoon(int x, int y)
       switch (cave[x][y-1])
       {
        case Xblank:
-       case Xacid_splash_e:
-       case Xacid_splash_w:
+       case Xsplash_e:
+       case Xsplash_w:
        case Xfake_acid_1:
        case Xfake_acid_2:
        case Xfake_acid_3:
@@ -5855,9 +5935,9 @@ static void Lballoon(int x, int y)
          cave[x][y] = Yballoon_nB;
          next[x][y] = Xblank;
          if (cave[x+1][y-2] == Xblank)
-           cave[x+1][y-2] = Xacid_splash_e;
+           cave[x+1][y-2] = Xsplash_e;
          if (cave[x-1][y-2] == Xblank)
-           cave[x-1][y-2] = Xacid_splash_w;
+           cave[x-1][y-2] = Xsplash_w;
          play_element_sound(x, y, SOUND_acid, Xacid_1);
          return;
       }
@@ -5867,8 +5947,8 @@ static void Lballoon(int x, int y)
       switch (cave[x+1][y])
       {
        case Xblank:
-       case Xacid_splash_e:
-       case Xacid_splash_w:
+       case Xsplash_e:
+       case Xsplash_w:
        case Xfake_acid_1:
        case Xfake_acid_2:
        case Xfake_acid_3:
@@ -5894,9 +5974,9 @@ static void Lballoon(int x, int y)
          cave[x][y] = Yballoon_eB;
          next[x][y] = Xblank;
          if (cave[x+2][y-1] == Xblank)
-           cave[x+2][y-1] = Xacid_splash_e;
+           cave[x+2][y-1] = Xsplash_e;
          if (cave[x][y-1] == Xblank)
-           cave[x][y-1] = Xacid_splash_w;
+           cave[x][y-1] = Xsplash_w;
          play_element_sound(x, y, SOUND_acid, Xacid_1);
          return;
       }
@@ -5906,8 +5986,8 @@ static void Lballoon(int x, int y)
       switch (cave[x][y+1])
       {
        case Xblank:
-       case Xacid_splash_e:
-       case Xacid_splash_w:
+       case Xsplash_e:
+       case Xsplash_w:
        case Xfake_acid_1:
        case Xfake_acid_2:
        case Xfake_acid_3:
@@ -5933,9 +6013,9 @@ static void Lballoon(int x, int y)
          cave[x][y] = Yballoon_sB;
          next[x][y] = Xblank;
          if (cave[x+1][y] == Xblank)
-           cave[x+1][y] = Xacid_splash_e;
+           cave[x+1][y] = Xsplash_e;
          if (cave[x-1][y] == Xblank)
-           cave[x-1][y] = Xacid_splash_w;
+           cave[x-1][y] = Xsplash_w;
          play_element_sound(x, y, SOUND_acid, Xacid_1);
          return;
       }
@@ -5945,8 +6025,8 @@ static void Lballoon(int x, int y)
       switch (cave[x-1][y])
       {
        case Xblank:
-       case Xacid_splash_e:
-       case Xacid_splash_w:
+       case Xsplash_e:
+       case Xsplash_w:
        case Xfake_acid_1:
        case Xfake_acid_2:
        case Xfake_acid_3:
@@ -5972,9 +6052,9 @@ static void Lballoon(int x, int y)
          cave[x][y] = Yballoon_wB;
          next[x][y] = Xblank;
          if (cave[x][y-1] == Xblank)
-           cave[x][y-1] = Xacid_splash_e;
+           cave[x][y-1] = Xsplash_e;
          if (cave[x-2][y-1] == Xblank)
-           cave[x-2][y-1] = Xacid_splash_w;
+           cave[x-2][y-1] = Xsplash_w;
          play_element_sound(x, y, SOUND_acid, Xacid_1);
          return;
       }
@@ -5992,7 +6072,7 @@ static void Lball_common(int x, int y)
     {
       case 0:
        if (lev.ball_array[lev.ball_pos][0] != Xblank &&
-           tab_blank[cave[x-1][y-1]])
+           is_blank[cave[x-1][y-1]])
        {
          cave[x-1][y-1] = Yball_blank;
          next[x-1][y-1] = lev.ball_array[lev.ball_pos][0];
@@ -6001,7 +6081,7 @@ static void Lball_common(int x, int y)
 
       case 1:
        if (lev.ball_array[lev.ball_pos][1] != Xblank &&
-           tab_blank[cave[x][y-1]])
+           is_blank[cave[x][y-1]])
        {
          cave[x][y-1] = Yball_blank;
          next[x][y-1] = lev.ball_array[lev.ball_pos][1];
@@ -6010,7 +6090,7 @@ static void Lball_common(int x, int y)
 
       case 2:
        if (lev.ball_array[lev.ball_pos][2] != Xblank &&
-           tab_blank[cave[x+1][y-1]])
+           is_blank[cave[x+1][y-1]])
        {
          cave[x+1][y-1] = Yball_blank;
          next[x+1][y-1] = lev.ball_array[lev.ball_pos][2];
@@ -6019,7 +6099,7 @@ static void Lball_common(int x, int y)
 
       case 3:
        if (lev.ball_array[lev.ball_pos][3] != Xblank &&
-           tab_blank[cave[x-1][y]])
+           is_blank[cave[x-1][y]])
        {
          cave[x-1][y] = Yball_blank;
          next[x-1][y] = lev.ball_array[lev.ball_pos][3];
@@ -6028,7 +6108,7 @@ static void Lball_common(int x, int y)
 
       case 4:
        if (lev.ball_array[lev.ball_pos][4] != Xblank &&
-           tab_blank[cave[x+1][y]])
+           is_blank[cave[x+1][y]])
        {
          cave[x+1][y] = Yball_blank;
          next[x+1][y] = lev.ball_array[lev.ball_pos][4];
@@ -6037,7 +6117,7 @@ static void Lball_common(int x, int y)
 
       case 5:
        if (lev.ball_array[lev.ball_pos][5] != Xblank &&
-           tab_blank[cave[x-1][y+1]])
+           is_blank[cave[x-1][y+1]])
        {
          cave[x-1][y+1] = Yball_blank;
          next[x-1][y+1] = lev.ball_array[lev.ball_pos][5];
@@ -6046,7 +6126,7 @@ static void Lball_common(int x, int y)
 
       case 6:
        if (lev.ball_array[lev.ball_pos][6] != Xblank &&
-           tab_blank[cave[x][y+1]])
+           is_blank[cave[x][y+1]])
        {
          cave[x][y+1] = Yball_blank;
          next[x][y+1] = lev.ball_array[lev.ball_pos][6];
@@ -6055,7 +6135,7 @@ static void Lball_common(int x, int y)
 
       case 7:
        if (lev.ball_array[lev.ball_pos][7] != Xblank &&
-           tab_blank[cave[x+1][y+1]])
+           is_blank[cave[x+1][y+1]])
        {
          cave[x+1][y+1] = Yball_blank;
          next[x+1][y+1] = lev.ball_array[lev.ball_pos][7];
@@ -6066,56 +6146,56 @@ static void Lball_common(int x, int y)
   else
   {
     if (lev.ball_array[lev.ball_pos][0] != Xblank &&
-       tab_blank[cave[x-1][y-1]])
+       is_blank[cave[x-1][y-1]])
     {
       cave[x-1][y-1] = Yball_blank;
       next[x-1][y-1] = lev.ball_array[lev.ball_pos][0];
     }
 
     if (lev.ball_array[lev.ball_pos][1] != Xblank &&
-       tab_blank[cave[x][y-1]])
+       is_blank[cave[x][y-1]])
     {
       cave[x][y-1] = Yball_blank;
       next[x][y-1] = lev.ball_array[lev.ball_pos][1];
     }
 
     if (lev.ball_array[lev.ball_pos][2] != Xblank &&
-       tab_blank[cave[x+1][y-1]])
+       is_blank[cave[x+1][y-1]])
     {
       cave[x+1][y-1] = Yball_blank;
       next[x+1][y-1] = lev.ball_array[lev.ball_pos][2];
     }
 
     if (lev.ball_array[lev.ball_pos][3] != Xblank &&
-       tab_blank[cave[x-1][y]])
+       is_blank[cave[x-1][y]])
     {
       cave[x-1][y] = Yball_blank;
       next[x-1][y] = lev.ball_array[lev.ball_pos][3];
     }
 
     if (lev.ball_array[lev.ball_pos][4] != Xblank &&
-       tab_blank[cave[x+1][y]])
+       is_blank[cave[x+1][y]])
     {
       cave[x+1][y] = Yball_blank;
       next[x+1][y] = lev.ball_array[lev.ball_pos][4];
     }
 
     if (lev.ball_array[lev.ball_pos][5] != Xblank &&
-       tab_blank[cave[x-1][y+1]])
+       is_blank[cave[x-1][y+1]])
     {
       cave[x-1][y+1] = Yball_blank;
       next[x-1][y+1] = lev.ball_array[lev.ball_pos][5];
     }
 
     if (lev.ball_array[lev.ball_pos][6] != Xblank &&
-       tab_blank[cave[x][y+1]])
+       is_blank[cave[x][y+1]])
     {
       cave[x][y+1] = Yball_blank;
       next[x][y+1] = lev.ball_array[lev.ball_pos][6];
     }
 
     if (lev.ball_array[lev.ball_pos][7] != Xblank &&
-       tab_blank[cave[x+1][y+1]])
+       is_blank[cave[x+1][y+1]])
     {
       cave[x+1][y+1] = Yball_blank;
       next[x+1][y+1] = lev.ball_array[lev.ball_pos][7];
@@ -6163,8 +6243,8 @@ static void Ldrip_fall(int x, int y)
   switch (cave[x][y+1])
   {
     case Xblank:
-    case Xacid_splash_e:
-    case Xacid_splash_w:
+    case Xsplash_e:
+    case Xsplash_w:
     case Xfake_acid_1:
     case Xfake_acid_2:
     case Xfake_acid_3:
@@ -6193,9 +6273,9 @@ static void Ldrip_fall(int x, int y)
       cave[x][y] = Ydrip_1_sB;
       next[x][y] = Xdrip_stretchB;
       if (cave[x+1][y] == Xblank)
-       cave[x+1][y] = Xacid_splash_e;
+       cave[x+1][y] = Xsplash_e;
       if (cave[x-1][y] == Xblank)
-       cave[x-1][y] = Xacid_splash_w;
+       cave[x-1][y] = Xsplash_w;
       play_element_sound(x, y, SOUND_acid, Xacid_1);
       return;
 
@@ -6275,8 +6355,8 @@ static void Lsand_stone(int x, int y)
   switch (cave[x][y+1])
   {
     case Xblank:
-    case Xacid_splash_e:
-    case Xacid_splash_w:
+    case Xsplash_e:
+    case Xsplash_w:
     case Xfake_acid_1:
     case Xfake_acid_2:
     case Xfake_acid_3:
@@ -6302,9 +6382,9 @@ static void Lsand_stone(int x, int y)
       cave[x][y] = Xsand_stonesand_quickout_1;
       next[x][y] = Xsand_stonesand_quickout_2;
       if (cave[x+1][y] == Xblank)
-       cave[x+1][y] = Xacid_splash_e;
+       cave[x+1][y] = Xsplash_e;
       if (cave[x-1][y] == Xblank)
-       cave[x-1][y] = Xacid_splash_w;
+       cave[x-1][y] = Xsplash_w;
       play_element_sound(x, y, SOUND_acid, Xacid_1);
       return;
 
@@ -6397,37 +6477,37 @@ static void Lsand_stonesand_quickout_2(int x, int y)
   next[x][y] = Xsand;
 }
 
-static void Lslidewall_ns(int x, int y)
+static void Lslide_ns(int x, int y)
 {
-  if (tab_blank[cave[x][y-1]])
+  if (is_blank[cave[x][y-1]])
   {
-    cave[x][y-1] = Yslidewall_ns_blank;
-    next[x][y-1] = Xslidewall_ns;
-    play_element_sound(x, y, SOUND_slidewall, Xslidewall_ns);
+    cave[x][y-1] = Yslide_ns_blank;
+    next[x][y-1] = Xslide_ns;
+    play_element_sound(x, y, SOUND_slide, Xslide_ns);
   }
 
-  if (tab_blank[cave[x][y+1]])
+  if (is_blank[cave[x][y+1]])
   {
-    cave[x][y+1] = Yslidewall_ns_blank;
-    next[x][y+1] = Xslidewall_ns;
-    play_element_sound(x, y, SOUND_slidewall, Xslidewall_ns);
+    cave[x][y+1] = Yslide_ns_blank;
+    next[x][y+1] = Xslide_ns;
+    play_element_sound(x, y, SOUND_slide, Xslide_ns);
   }
 }
 
-static void Lslidewall_ew(int x, int y)
+static void Lslide_ew(int x, int y)
 {
-  if (tab_blank[cave[x+1][y]])
+  if (is_blank[cave[x+1][y]])
   {
-    cave[x+1][y] = Yslidewall_ew_blank;
-    next[x+1][y] = Xslidewall_ew;
-    play_element_sound(x, y, SOUND_slidewall, Xslidewall_ew);
+    cave[x+1][y] = Yslide_ew_blank;
+    next[x+1][y] = Xslide_ew;
+    play_element_sound(x, y, SOUND_slide, Xslide_ew);
   }
 
-  if (tab_blank[cave[x-1][y]])
+  if (is_blank[cave[x-1][y]])
   {
-    cave[x-1][y] = Yslidewall_ew_blank;
-    next[x-1][y] = Xslidewall_ew;
-    play_element_sound(x, y, SOUND_slidewall, Xslidewall_ew);
+    cave[x-1][y] = Yslide_ew_blank;
+    next[x-1][y] = Xslide_ew;
+    play_element_sound(x, y, SOUND_slide, Xslide_ew);
   }
 }
 
@@ -6482,8 +6562,8 @@ static void Lamoeba(int x, int y)
   switch (cave[x][y])
   {
     case Xblank:
-    case Xacid_splash_e:
-    case Xacid_splash_w:
+    case Xsplash_e:
+    case Xsplash_w:
     case Xfake_acid_1:
     case Xfake_acid_2:
     case Xfake_acid_3:
@@ -6497,40 +6577,121 @@ static void Lamoeba(int x, int y)
     case Xsand:
     case Xplant:
     case Yplant:
-      if (tab_amoeba[cave[x][y-1]] ||
-         tab_amoeba[cave[x+1][y]] ||
-         tab_amoeba[cave[x][y+1]] ||
-         tab_amoeba[cave[x-1][y]])
+      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 Znormal:
+    case Zdynamite:
+    case Xboom_bug:
+    case Xboom_bomb:
+    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 Xacid_ne:
+    case Xacid_nw:
+    case Xacid_s:
+    case Xacid_se:
+    case Xacid_sw:
+    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 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;
+      return;
+
+    case Xbomb:
+    case Xbomb_pause:
+    case Xbomb_fall:
+      cave[x][y] = Xboom_bomb;
+      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 Znormal:
-      cave[x][y]     = Xboom_1;
-      cave[x][y-1]   = tab_explode_normal[cave[x][y-1]];
-      cave[x-1][y]   = tab_explode_normal[cave[x-1][y]];
-      cave[x+1][y]   = tab_explode_normal[cave[x+1][y]];
-      cave[x][y+1]   = tab_explode_normal[cave[x][y+1]];
-      cave[x-1][y-1] = tab_explode_normal[cave[x-1][y-1]];
-      cave[x+1][y-1] = tab_explode_normal[cave[x+1][y-1]];
-      cave[x-1][y+1] = tab_explode_normal[cave[x-1][y+1]];
-      cave[x+1][y+1] = tab_explode_normal[cave[x+1][y+1]];
+      Lboom_nine(x, y, FALSE);
       break;
 
     case Zdynamite:
-      cave[x][y]     = Xboom_1;
-      cave[x][y-1]   = tab_explode_dynamite[cave[x][y-1]];
-      cave[x-1][y]   = tab_explode_dynamite[cave[x-1][y]];
-      cave[x+1][y]   = tab_explode_dynamite[cave[x+1][y]];
-      cave[x][y+1]   = tab_explode_dynamite[cave[x][y+1]];
-      cave[x-1][y-1] = tab_explode_dynamite[cave[x-1][y-1]];
-      cave[x+1][y-1] = tab_explode_dynamite[cave[x+1][y-1]];
-      cave[x-1][y+1] = tab_explode_dynamite[cave[x-1][y+1]];
-      cave[x+1][y+1] = tab_explode_dynamite[cave[x+1][y+1]];
+      Lboom_nine(x, y, TRUE);
       break;
   }
 }
@@ -6709,8 +6870,8 @@ static void handle_tile(int x, int y)
     case Xsand_stonesand_quickout_1: Lsand_stonesand_quickout_1(x, y); break;
     case Xsand_stonesand_quickout_2: Lsand_stonesand_quickout_2(x, y); break;
 
-    case Xslidewall_ns:                Lslidewall_ns(x, y);            break;
-    case Xslidewall_ew:                Lslidewall_ew(x, y);            break;
+    case Xslide_ns:            Lslide_ns(x, y);                break;
+    case Xslide_ew:            Lslide_ew(x, y);                break;
 
     case Xexit:                        Lexit(x, y);                    break;
     case Xexit_1:              Lexit_1(x, y);                  break;
@@ -6727,7 +6888,7 @@ static void handle_tile(int x, int y)
   }
 }
 
-void logic_1(void)
+void logic_players(void)
 {
   int start_check_nr;
   int i;
@@ -6795,7 +6956,7 @@ void logic_1(void)
   }
 }
 
-void logic_2(void)
+void logic_objects(void)
 {
   int x, y;
 
@@ -6824,7 +6985,7 @@ void logic_2(void)
   lev.draw = temp;
 }
 
-void logic_3(void)
+void logic_globals(void)
 {
   int x;
   int y;