changed handling of pushed objects in EM engine
[rocksndiamonds.git] / src / game_em / logic.c
index dd158247e19925168eabc27f193441a84760b326..b76bac67400b54ac4b54a4cdb7914c7086d5727f 100644 (file)
@@ -9,6 +9,8 @@
 
 
 #define SPRING_ROLL    /* spring rolling off round things continues to roll */
+#define ACID_ROLL      /* rolling objects go into acid rather than remove it */
+
 #define USE_CHANGED_ACID_STUFF
 
 #define RANDOM_RAW     (seed = seed << 31 | seed >> 1)
@@ -71,7 +73,7 @@ static const byte is_fake_acid[TILE_MAX] =
 static const byte is_amoeba[TILE_MAX] =
 {
   [Xfake_amoeba]       = 1,
-  [Xfake_amoebaB]      = 1,
+  [Yfake_amoeba]       = 1,
   [Xamoeba_1]          = 1,
   [Xamoeba_2]          = 1,
   [Xamoeba_3]          = 1,
@@ -251,6 +253,7 @@ static boolean player_killed(struct PLAYER *ply)
 
   switch (cave[x][y])
   {
+    case Zplayer:
     case Xblank:
     case Xsplash_e:
     case Xsplash_w:
@@ -262,7 +265,6 @@ static boolean player_killed(struct PLAYER *ply)
     case Xfake_acid_6:
     case Xfake_acid_7:
     case Xfake_acid_8:
-    case Zplayer:
     case Xdynamite_1:
     case Xdynamite_2:
     case Xdynamite_3:
@@ -533,7 +535,7 @@ static boolean player_digfield(struct PLAYER *ply, int dx, int dy)
        next[x][y] = Zplayer;
        play_element_sound(x, y, SOUND_collect, element);
        lev.score += lev.diamond_score;
-       lev.required = lev.required < 3 ? 0 : lev.required - 3;
+       lev.gems_needed = lev.gems_needed < 3 ? 0 : lev.gems_needed - 3;
        game.snapshot.collected_item = TRUE;
        ply->anim = PLY_walk_n + anim;
        ply->x = x;
@@ -546,7 +548,7 @@ static boolean player_digfield(struct PLAYER *ply, int dx, int dy)
        next[x][y] = Zplayer;
        play_element_sound(x, y, SOUND_collect, element);
        lev.score += lev.emerald_score;
-       lev.required = lev.required < 1 ? 0 : lev.required - 1;
+       lev.gems_needed = lev.gems_needed < 1 ? 0 : lev.gems_needed - 1;
        game.snapshot.collected_item = TRUE;
        ply->anim = PLY_walk_n + anim;
        ply->x = x;
@@ -1124,7 +1126,7 @@ static boolean player_digfield(struct PLAYER *ply, int dx, int dy)
        next[x][y] = Xblank;
        play_element_sound(x, y, SOUND_collect, element);
        lev.score += lev.diamond_score;
-       lev.required = lev.required < 3 ? 0 : lev.required - 3;
+       lev.gems_needed = lev.gems_needed < 3 ? 0 : lev.gems_needed - 3;
        game.snapshot.collected_item = TRUE;
        ply->anim = PLY_walk_n + anim;
        break;
@@ -1135,7 +1137,7 @@ static boolean player_digfield(struct PLAYER *ply, int dx, int dy)
        next[x][y] = Xblank;
        play_element_sound(x, y, SOUND_collect, element);
        lev.score += lev.emerald_score;
-       lev.required = lev.required < 1 ? 0 : lev.required - 1;
+       lev.gems_needed = lev.gems_needed < 1 ? 0 : lev.gems_needed - 1;
        game.snapshot.collected_item = TRUE;
        ply->anim = PLY_walk_n + anim;
        break;
@@ -2259,6 +2261,7 @@ static void Leater_n(int x, int y)
 
   switch (cave[x][y-1])
   {
+    case Zplayer:
     case Xblank:
     case Xsplash_e:
     case Xsplash_w:
@@ -2272,7 +2275,6 @@ static void Leater_n(int x, int y)
     case Xfake_acid_8:
     case Xplant:
     case Yplant:
-    case Zplayer:
       cave[x][y] = Yeater_nB;
       next[x][y] = Xblank;
       cave[x][y-1] = Yeater_n;
@@ -2339,6 +2341,7 @@ static void Leater_e(int x, int y)
 
   switch (cave[x+1][y])
   {
+    case Zplayer:
     case Xblank:
     case Xsplash_e:
     case Xsplash_w:
@@ -2352,7 +2355,6 @@ static void Leater_e(int x, int y)
     case Xfake_acid_8:
     case Xplant:
     case Yplant:
-    case Zplayer:
       cave[x][y] = Yeater_eB;
       next[x][y] = Xblank;
       cave[x+1][y] = Yeater_e;
@@ -2419,6 +2421,7 @@ static void Leater_s(int x, int y)
 
   switch (cave[x][y+1])
   {
+    case Zplayer:
     case Xblank:
     case Xsplash_e:
     case Xsplash_w:
@@ -2432,7 +2435,6 @@ static void Leater_s(int x, int y)
     case Xfake_acid_8:
     case Xplant:
     case Yplant:
-    case Zplayer:
       cave[x][y] = Yeater_sB;
       next[x][y] = Xblank;
       cave[x][y+1] = Yeater_s;
@@ -2499,6 +2501,7 @@ static void Leater_w(int x, int y)
 
   switch (cave[x-1][y])
   {
+    case Zplayer:
     case Xblank:
     case Xsplash_e:
     case Xsplash_w:
@@ -2512,7 +2515,6 @@ static void Leater_w(int x, int y)
     case Xfake_acid_8:
     case Xplant:
     case Yplant:
-    case Zplayer:
       cave[x][y] = Yeater_wB;
       next[x][y] = Xblank;
       cave[x-1][y] = Yeater_w;
@@ -2563,6 +2565,7 @@ static void Lalien(int x, int y)
     {
       switch (cave[x][y-1])
       {
+       case Zplayer:
        case Xblank:
        case Xsplash_e:
        case Xsplash_w:
@@ -2576,7 +2579,6 @@ static void Lalien(int x, int y)
        case Xfake_acid_8:
        case Xplant:
        case Yplant:
-       case Zplayer:
          cave[x][y] = Yalien_nB;
          next[x][y] = Xblank;
          cave[x][y-1] = Yalien_n;
@@ -2606,6 +2608,7 @@ static void Lalien(int x, int y)
     {
       switch (cave[x][y+1])
       {
+       case Zplayer:
        case Xblank:
        case Xsplash_e:
        case Xsplash_w:
@@ -2619,7 +2622,6 @@ static void Lalien(int x, int y)
        case Xfake_acid_8:
        case Xplant:
        case Yplant:
-       case Zplayer:
          cave[x][y] = Yalien_sB;
          next[x][y] = Xblank;
          cave[x][y+1] = Yalien_s;
@@ -2652,6 +2654,7 @@ static void Lalien(int x, int y)
     {
       switch (cave[x+1][y])
       {
+       case Zplayer:
        case Xblank:
        case Xsplash_e:
        case Xsplash_w:
@@ -2665,7 +2668,6 @@ static void Lalien(int x, int y)
        case Xfake_acid_8:
        case Xplant:
        case Yplant:
-       case Zplayer:
          cave[x][y] = Yalien_eB;
          next[x][y] = Xblank;
          cave[x+1][y] = Yalien_e;
@@ -2695,6 +2697,7 @@ static void Lalien(int x, int y)
     {
       switch (cave[x-1][y])
       {
+       case Zplayer:
        case Xblank:
        case Xsplash_e:
        case Xsplash_w:
@@ -2708,7 +2711,6 @@ static void Lalien(int x, int y)
        case Xfake_acid_8:
        case Xplant:
        case Yplant:
-       case Zplayer:
          cave[x][y] = Yalien_wB;
          next[x][y] = Xblank;
          cave[x-1][y] = Yalien_w;
@@ -2746,6 +2748,7 @@ static void Lbug_n(int x, int y)
 {
   switch (cave[x][y-1])
   {
+    case Zplayer:
     case Xblank:
     case Xsplash_e:
     case Xsplash_w:
@@ -2759,7 +2762,6 @@ static void Lbug_n(int x, int y)
     case Xfake_acid_8:
     case Xplant:
     case Yplant:
-    case Zplayer:
       cave[x][y] = Ybug_nB;
       next[x][y] = Xblank;
       cave[x][y-1] = Ybug_n;
@@ -2806,6 +2808,7 @@ static void Lbug_1_n(int x, int y)
 
   switch (cave[x+1][y])
   {
+    case Zplayer:
     case Xblank:
     case Xsplash_e:
     case Xsplash_w:
@@ -2827,7 +2830,6 @@ static void Lbug_1_n(int x, int y)
     case Xacid_6:
     case Xacid_7:
     case Xacid_8:
-    case Zplayer:
       cave[x][y] = Ybug_n_e;
       next[x][y] = Xbug_2_e;
       play_element_sound(x, y, SOUND_bug, Xbug_1_n);
@@ -2858,6 +2860,7 @@ static void Lbug_e(int x, int y)
 {
   switch (cave[x+1][y])
   {
+    case Zplayer:
     case Xblank:
     case Xsplash_e:
     case Xsplash_w:
@@ -2871,7 +2874,6 @@ static void Lbug_e(int x, int y)
     case Xfake_acid_8:
     case Xplant:
     case Yplant:
-    case Zplayer:
       cave[x][y] = Ybug_eB;
       next[x][y] = Xblank;
       cave[x+1][y] = Ybug_e;
@@ -2918,6 +2920,7 @@ static void Lbug_1_e(int x, int y)
 
   switch (cave[x][y+1])
   {
+    case Zplayer:
     case Xblank:
     case Xsplash_e:
     case Xsplash_w:
@@ -2939,7 +2942,6 @@ static void Lbug_1_e(int x, int y)
     case Xacid_6:
     case Xacid_7:
     case Xacid_8:
-    case Zplayer:
       cave[x][y] = Ybug_e_s;
       next[x][y] = Xbug_2_s;
       play_element_sound(x, y, SOUND_bug, Xbug_1_e);
@@ -2970,6 +2972,7 @@ static void Lbug_s(int x, int y)
 {
   switch (cave[x][y+1])
   {
+    case Zplayer:
     case Xblank:
     case Xsplash_e:
     case Xsplash_w:
@@ -2983,7 +2986,6 @@ static void Lbug_s(int x, int y)
     case Xfake_acid_8:
     case Xplant:
     case Yplant:
-    case Zplayer:
       cave[x][y] = Ybug_sB;
       next[x][y] = Xblank;
       cave[x][y+1] = Ybug_s;
@@ -3030,6 +3032,7 @@ static void Lbug_1_s(int x, int y)
 
   switch (cave[x-1][y])
   {
+    case Zplayer:
     case Xblank:
     case Xsplash_e:
     case Xsplash_w:
@@ -3051,7 +3054,6 @@ static void Lbug_1_s(int x, int y)
     case Xacid_6:
     case Xacid_7:
     case Xacid_8:
-    case Zplayer:
       cave[x][y] = Ybug_s_w;
       next[x][y] = Xbug_2_w;
       play_element_sound(x, y, SOUND_bug, Xbug_1_s);
@@ -3082,6 +3084,7 @@ static void Lbug_w(int x, int y)
 {
   switch (cave[x-1][y])
   {
+    case Zplayer:
     case Xblank:
     case Xsplash_e:
     case Xsplash_w:
@@ -3095,7 +3098,6 @@ static void Lbug_w(int x, int y)
     case Xfake_acid_8:
     case Xplant:
     case Yplant:
-    case Zplayer:
       cave[x][y] = Ybug_wB;
       next[x][y] = Xblank;
       cave[x-1][y] = Ybug_w;
@@ -3142,6 +3144,7 @@ static void Lbug_1_w(int x, int y)
 
   switch (cave[x][y-1])
   {
+    case Zplayer:
     case Xblank:
     case Xsplash_e:
     case Xsplash_w:
@@ -3163,7 +3166,6 @@ static void Lbug_1_w(int x, int y)
     case Xacid_6:
     case Xacid_7:
     case Xacid_8:
-    case Zplayer:
       cave[x][y] = Ybug_w_n;
       next[x][y] = Xbug_2_n;
       play_element_sound(x, y, SOUND_bug, Xbug_1_w);
@@ -3194,6 +3196,7 @@ static void Ltank_n(int x, int y)
 {
   switch (cave[x][y-1])
   {
+    case Zplayer:
     case Xblank:
     case Xsplash_e:
     case Xsplash_w:
@@ -3207,7 +3210,6 @@ static void Ltank_n(int x, int y)
     case Xfake_acid_8:
     case Xplant:
     case Yplant:
-    case Zplayer:
       cave[x][y] = Ytank_nB;
       next[x][y] = Xblank;
       cave[x][y-1] = Ytank_n;
@@ -3254,6 +3256,7 @@ static void Ltank_1_n(int x, int y)
 
   switch (cave[x-1][y])
   {
+    case Zplayer:
     case Xblank:
     case Xsplash_e:
     case Xsplash_w:
@@ -3275,7 +3278,6 @@ static void Ltank_1_n(int x, int y)
     case Xacid_6:
     case Xacid_7:
     case Xacid_8:
-    case Zplayer:
       cave[x][y] = Ytank_n_w;
       next[x][y] = Xtank_2_w;
       play_element_sound(x, y, SOUND_tank, Xtank_1_n);
@@ -3306,6 +3308,7 @@ static void Ltank_e(int x, int y)
 {
   switch (cave[x+1][y])
   {
+    case Zplayer:
     case Xblank:
     case Xsplash_e:
     case Xsplash_w:
@@ -3319,7 +3322,6 @@ static void Ltank_e(int x, int y)
     case Xfake_acid_8:
     case Xplant:
     case Yplant:
-    case Zplayer:
       cave[x][y] = Ytank_eB;
       next[x][y] = Xblank;
       cave[x+1][y] = Ytank_e;
@@ -3366,6 +3368,7 @@ static void Ltank_1_e(int x, int y)
 
   switch (cave[x][y-1])
   {
+    case Zplayer:
     case Xblank:
     case Xsplash_e:
     case Xsplash_w:
@@ -3387,7 +3390,6 @@ static void Ltank_1_e(int x, int y)
     case Xacid_6:
     case Xacid_7:
     case Xacid_8:
-    case Zplayer:
       cave[x][y] = Ytank_e_n;
       next[x][y] = Xtank_2_n;
       play_element_sound(x, y, SOUND_tank, Xtank_1_e);
@@ -3418,6 +3420,7 @@ static void Ltank_s(int x, int y)
 {
   switch (cave[x][y+1])
   {
+    case Zplayer:
     case Xblank:
     case Xsplash_e:
     case Xsplash_w:
@@ -3431,7 +3434,6 @@ static void Ltank_s(int x, int y)
     case Xfake_acid_8:
     case Xplant:
     case Yplant:
-    case Zplayer:
       cave[x][y] = Ytank_sB;
       next[x][y] = Xblank;
       cave[x][y+1] = Ytank_s;
@@ -3478,6 +3480,7 @@ static void Ltank_1_s(int x, int y)
 
   switch (cave[x+1][y])
   {
+    case Zplayer:
     case Xblank:
     case Xsplash_e:
     case Xsplash_w:
@@ -3499,7 +3502,6 @@ static void Ltank_1_s(int x, int y)
     case Xacid_6:
     case Xacid_7:
     case Xacid_8:
-    case Zplayer:
       cave[x][y] = Ytank_s_e;
       next[x][y] = Xtank_2_e;
       play_element_sound(x, y, SOUND_tank, Xtank_1_s);
@@ -3530,6 +3532,7 @@ static void Ltank_w(int x, int y)
 {
   switch (cave[x-1][y])
   {
+    case Zplayer:
     case Xblank:
     case Xsplash_e:
     case Xsplash_w:
@@ -3543,7 +3546,6 @@ static void Ltank_w(int x, int y)
     case Xfake_acid_8:
     case Xplant:
     case Yplant:
-    case Zplayer:
       cave[x][y] = Ytank_wB;
       next[x][y] = Xblank;
       cave[x-1][y] = Ytank_w;
@@ -3590,6 +3592,7 @@ static void Ltank_1_w(int x, int y)
 
   switch (cave[x][y+1])
   {
+    case Zplayer:
     case Xblank:
     case Xsplash_e:
     case Xsplash_w:
@@ -3611,7 +3614,6 @@ static void Ltank_1_w(int x, int y)
     case Xacid_6:
     case Xacid_7:
     case Xacid_8:
-    case Zplayer:
       cave[x][y] = Ytank_w_s;
       next[x][y] = Xtank_2_s;
       play_element_sound(x, y, SOUND_tank, Xtank_1_w);
@@ -3713,6 +3715,7 @@ static void Lemerald(int x, int y)
     case Xwonderwall:
     case Xswitch:
     case Xbumper:
+    case Ybumper:
     case Xacid_ne:
     case Xacid_nw:
     case Xslide_ns:
@@ -3737,6 +3740,8 @@ static void Lemerald(int x, int y)
          next[x][y] = Xblank;
          cave[x+1][y] = Yemerald_e;
          next[x+1][y] = Xemerald_pause;
+         if (cave[x][y+1] == Xbumper)
+           cave[x][y+1] = Ybumper;
          return;
        }
 
@@ -3746,6 +3751,8 @@ static void Lemerald(int x, int y)
          next[x][y] = Xblank;
          cave[x-1][y] = Yemerald_w;
          next[x-1][y] = Xemerald_pause;
+         if (cave[x][y+1] == Xbumper)
+           cave[x][y+1] = Ybumper;
          return;
        }
       }
@@ -3757,6 +3764,8 @@ static void Lemerald(int x, int y)
          next[x][y] = Xblank;
          cave[x-1][y] = Yemerald_w;
          next[x-1][y] = Xemerald_pause;
+         if (cave[x][y+1] == Xbumper)
+           cave[x][y+1] = Ybumper;
          return;
        }
 
@@ -3766,6 +3775,8 @@ static void Lemerald(int x, int y)
          next[x][y] = Xblank;
          cave[x+1][y] = Yemerald_e;
          next[x+1][y] = Xemerald_pause;
+         if (cave[x][y+1] == Xbumper)
+           cave[x][y+1] = Ybumper;
          return;
        }
       }
@@ -3830,6 +3841,7 @@ static void Lemerald_fall(int x, int y)
 {
   switch (cave[x][y+1])
   {
+    case Zplayer:
     case Xblank:
     case Xsplash_e:
     case Xsplash_w:
@@ -3841,7 +3853,6 @@ static void Lemerald_fall(int x, int y)
     case Xfake_acid_6:
     case Xfake_acid_7:
     case Xfake_acid_8:
-    case Zplayer:
       cave[x][y] = Yemerald_sB;
       next[x][y] = Xblank;
       cave[x][y+1] = Yemerald_s;
@@ -3963,6 +3974,7 @@ static void Ldiamond(int x, int y)
     case Xwonderwall:
     case Xswitch:
     case Xbumper:
+    case Ybumper:
     case Xacid_ne:
     case Xacid_nw:
     case Xslide_ns:
@@ -3987,6 +3999,8 @@ static void Ldiamond(int x, int y)
          next[x][y] = Xblank;
          cave[x+1][y] = Ydiamond_e;
          next[x+1][y] = Xdiamond_pause;
+         if (cave[x][y+1] == Xbumper)
+           cave[x][y+1] = Ybumper;
          return;
        }
 
@@ -3996,6 +4010,8 @@ static void Ldiamond(int x, int y)
          next[x][y] = Xblank;
          cave[x-1][y] = Ydiamond_w;
          next[x-1][y] = Xdiamond_pause;
+         if (cave[x][y+1] == Xbumper)
+           cave[x][y+1] = Ybumper;
          return;
        }
       }
@@ -4007,6 +4023,8 @@ static void Ldiamond(int x, int y)
          next[x][y] = Xblank;
          cave[x-1][y] = Ydiamond_w;
          next[x-1][y] = Xdiamond_pause;
+         if (cave[x][y+1] == Xbumper)
+           cave[x][y+1] = Ybumper;
          return;
        }
 
@@ -4016,6 +4034,8 @@ static void Ldiamond(int x, int y)
          next[x][y] = Xblank;
          cave[x+1][y] = Ydiamond_e;
          next[x+1][y] = Xdiamond_pause;
+         if (cave[x][y+1] == Xbumper)
+           cave[x][y+1] = Ybumper;
          return;
        }
       }
@@ -4080,6 +4100,7 @@ static void Ldiamond_fall(int x, int y)
 {
   switch (cave[x][y+1])
   {
+    case Zplayer:
     case Xblank:
     case Xsplash_e:
     case Xsplash_w:
@@ -4091,7 +4112,6 @@ static void Ldiamond_fall(int x, int y)
     case Xfake_acid_6:
     case Xfake_acid_7:
     case Xfake_acid_8:
-    case Zplayer:
       cave[x][y] = Ydiamond_sB;
       next[x][y] = Xblank;
       cave[x][y+1] = Ydiamond_s;
@@ -4221,6 +4241,7 @@ static void Lstone(int x, int y)
     case Xball_2:
     case Xswitch:
     case Xbumper:
+    case Ybumper:
     case Xacid_ne:
     case Xacid_nw:
     case Xlenses:
@@ -4239,6 +4260,8 @@ static void Lstone(int x, int y)
          next[x][y] = Xblank;
          cave[x+1][y] = Ystone_e;
          next[x+1][y] = Xstone_pause;
+         if (cave[x][y+1] == Xbumper)
+           cave[x][y+1] = Ybumper;
          return;
        }
 
@@ -4248,6 +4271,8 @@ static void Lstone(int x, int y)
          next[x][y] = Xblank;
          cave[x-1][y] = Ystone_w;
          next[x-1][y] = Xstone_pause;
+         if (cave[x][y+1] == Xbumper)
+           cave[x][y+1] = Ybumper;
          return;
        }
       }
@@ -4259,6 +4284,8 @@ static void Lstone(int x, int y)
          next[x][y] = Xblank;
          cave[x-1][y] = Ystone_w;
          next[x-1][y] = Xstone_pause;
+         if (cave[x][y+1] == Xbumper)
+           cave[x][y+1] = Ybumper;
          return;
        }
 
@@ -4268,6 +4295,8 @@ static void Lstone(int x, int y)
          next[x][y] = Xblank;
          cave[x+1][y] = Ystone_e;
          next[x+1][y] = Xstone_pause;
+         if (cave[x][y+1] == Xbumper)
+           cave[x][y+1] = Ybumper;
          return;
        }
       }
@@ -4323,6 +4352,7 @@ static void Lstone_fall(int x, int y)
 {
   switch (cave[x][y+1])
   {
+    case Zplayer:
     case Xblank:
     case Xsplash_e:
     case Xsplash_w:
@@ -4334,7 +4364,6 @@ static void Lstone_fall(int x, int y)
     case Xfake_acid_6:
     case Xfake_acid_7:
     case Xfake_acid_8:
-    case Zplayer:
       cave[x][y] = Ystone_sB;
       next[x][y] = Xblank;
       cave[x][y+1] = Ystone_s;
@@ -4408,6 +4437,7 @@ static void Lstone_fall(int x, int y)
     case Xdiamond_pause:
       switch (cave[x][y+2])
       {
+       case Zplayer:
        case Xblank:
        case Xsplash_e:
        case Xsplash_w:
@@ -4419,7 +4449,6 @@ static void Lstone_fall(int x, int y)
        case Xfake_acid_6:
        case Xfake_acid_7:
        case Xfake_acid_8:
-       case Zplayer:
        case Xplant:
        case Yplant:
        case Xacid_1:
@@ -4640,6 +4669,7 @@ static void Lbomb(int x, int y)
     case Xball_2:
     case Xswitch:
     case Xbumper:
+    case Ybumper:
     case Xacid_ne:
     case Xacid_nw:
     case Xslide_ns:
@@ -4656,6 +4686,8 @@ static void Lbomb(int x, int y)
          next[x][y] = Xblank;
          cave[x+1][y] = Ybomb_e;
          next[x+1][y] = Xbomb_pause;
+         if (cave[x][y+1] == Xbumper)
+           cave[x][y+1] = Ybumper;
          return;
        }
 
@@ -4665,6 +4697,8 @@ static void Lbomb(int x, int y)
          next[x][y] = Xblank;
          cave[x-1][y] = Ybomb_w;
          next[x-1][y] = Xbomb_pause;
+         if (cave[x][y+1] == Xbumper)
+           cave[x][y+1] = Ybumper;
          return;
        }
       }
@@ -4676,6 +4710,8 @@ static void Lbomb(int x, int y)
          next[x][y] = Xblank;
          cave[x-1][y] = Ybomb_w;
          next[x-1][y] = Xbomb_pause;
+         if (cave[x][y+1] == Xbumper)
+           cave[x][y+1] = Ybumper;
          return;
        }
 
@@ -4685,6 +4721,8 @@ static void Lbomb(int x, int y)
          next[x][y] = Xblank;
          cave[x+1][y] = Ybomb_e;
          next[x+1][y] = Xbomb_pause;
+         if (cave[x][y+1] == Xbumper)
+           cave[x][y+1] = Ybumper;
          return;
        }
       }
@@ -4855,6 +4893,7 @@ static void Lnut(int x, int y)
     case Xball_2:
     case Xswitch:
     case Xbumper:
+    case Ybumper:
     case Xacid_ne:
     case Xacid_nw:
     case Xslide_ns:
@@ -4871,6 +4910,8 @@ static void Lnut(int x, int y)
          next[x][y] = Xblank;
          cave[x+1][y] = Ynut_e;
          next[x+1][y] = Xnut_pause;
+         if (cave[x][y+1] == Xbumper)
+           cave[x][y+1] = Ybumper;
          return;
        }
 
@@ -4880,6 +4921,8 @@ static void Lnut(int x, int y)
          next[x][y] = Xblank;
          cave[x-1][y] = Ynut_w;
          next[x-1][y] = Xnut_pause;
+         if (cave[x][y+1] == Xbumper)
+           cave[x][y+1] = Ybumper;
          return;
        }
       }
@@ -4891,6 +4934,8 @@ static void Lnut(int x, int y)
          next[x][y] = Xblank;
          cave[x-1][y] = Ynut_w;
          next[x-1][y] = Xnut_pause;
+         if (cave[x][y+1] == Xbumper)
+           cave[x][y+1] = Ybumper;
          return;
        }
 
@@ -4900,6 +4945,8 @@ static void Lnut(int x, int y)
          next[x][y] = Xblank;
          cave[x+1][y] = Ynut_e;
          next[x+1][y] = Xnut_pause;
+         if (cave[x][y+1] == Xbumper)
+           cave[x][y+1] = Ybumper;
          return;
        }
       }
@@ -4955,6 +5002,7 @@ static void Lnut_fall(int x, int y)
 {
   switch (cave[x][y+1])
   {
+    case Zplayer:
     case Xblank:
     case Xsplash_e:
     case Xsplash_w:
@@ -4966,7 +5014,6 @@ static void Lnut_fall(int x, int y)
     case Xfake_acid_6:
     case Xfake_acid_7:
     case Xfake_acid_8:
-    case Zplayer:
       cave[x][y] = Ynut_sB;
       next[x][y] = Xblank;
       cave[x][y+1] = Ynut_s;
@@ -5074,6 +5121,7 @@ static void Lspring(int x, int y)
     case Xball_2:
     case Xswitch:
     case Xbumper:
+    case Ybumper:
     case Xacid_ne:
     case Xacid_nw:
     case Xslide_ns:
@@ -5089,14 +5137,13 @@ static void Lspring(int x, int y)
          cave[x][y] = Yspring_eB;
          next[x][y] = Xblank;
          cave[x+1][y] = Yspring_e;
-         if (cave[x][y+1] == Xbumper)
-           cave[x][y+1] = XbumperB;
-
 #ifdef SPRING_ROLL
          next[x+1][y] = Xspring_e;
 #else
          next[x+1][y] = Xspring_pause;
 #endif
+         if (cave[x][y+1] == Xbumper)
+           cave[x][y+1] = Ybumper;
          return;
        }
 
@@ -5105,14 +5152,13 @@ static void Lspring(int x, int y)
          cave[x][y] = Yspring_wB;
          next[x][y] = Xblank;
          cave[x-1][y] = Yspring_w;
-         if (cave[x][y+1] == Xbumper)
-           cave[x][y+1] = XbumperB;
-
 #ifdef SPRING_ROLL
          next[x-1][y] = Xspring_w;
 #else
          next[x-1][y] = Xspring_pause;
 #endif
+         if (cave[x][y+1] == Xbumper)
+           cave[x][y+1] = Ybumper;
          return;
        }
       }
@@ -5123,14 +5169,13 @@ static void Lspring(int x, int y)
          cave[x][y] = Yspring_wB;
          next[x][y] = Xblank;
          cave[x-1][y] = Yspring_w;
-         if (cave[x][y+1] == Xbumper)
-           cave[x][y+1] = XbumperB;
-
 #ifdef SPRING_ROLL
          next[x-1][y] = Xspring_w;
 #else
          next[x-1][y] = Xspring_pause;
 #endif
+         if (cave[x][y+1] == Xbumper)
+           cave[x][y+1] = Ybumper;
          return;
        }
 
@@ -5139,14 +5184,13 @@ static void Lspring(int x, int y)
          cave[x][y] = Yspring_eB;
          next[x][y] = Xblank;
          cave[x+1][y] = Yspring_e;
-         if (cave[x][y+1] == Xbumper)
-           cave[x][y+1] = XbumperB;
-
 #ifdef SPRING_ROLL
          next[x+1][y] = Xspring_e;
 #else
          next[x+1][y] = Xspring_pause;
 #endif
+         if (cave[x][y+1] == Xbumper)
+           cave[x][y+1] = Ybumper;
          return;
        }
       }
@@ -5237,7 +5281,7 @@ static void Lspring_e(int x, int y)
       return;
 
     case Xbumper:
-      cave[x][y+1] = XbumperB;
+      cave[x][y+1] = Ybumper;
   }
 
   switch (cave[x+1][y])
@@ -5295,8 +5339,8 @@ static void Lspring_e(int x, int y)
       return;
 
     case Xbumper:
-    case XbumperB:
-      cave[x+1][y] = XbumperB;
+    case Ybumper:
+      cave[x+1][y] = Ybumper;
       next[x][y] = Xspring_w;
       play_element_sound(x, y, SOUND_spring, Xspring);
       return;
@@ -5348,7 +5392,7 @@ static void Lspring_w(int x, int y)
       return;
 
     case Xbumper:
-      cave[x][y+1] = XbumperB;
+      cave[x][y+1] = Ybumper;
   }
 
   switch (cave[x-1][y])
@@ -5406,8 +5450,8 @@ static void Lspring_w(int x, int y)
       return;
 
     case Xbumper:
-    case XbumperB:
-      cave[x-1][y] = XbumperB;
+    case Ybumper:
+      cave[x-1][y] = Ybumper;
       next[x][y] = Xspring_e;
       play_element_sound(x, y, SOUND_spring, Xspring);
       return;
@@ -5424,6 +5468,7 @@ static void Lspring_fall(int x, int y)
 {
   switch (cave[x][y+1])
   {
+    case Zplayer:
     case Xblank:
     case Xsplash_e:
     case Xsplash_w:
@@ -5435,7 +5480,6 @@ static void Lspring_fall(int x, int y)
     case Xfake_acid_6:
     case Xfake_acid_7:
     case Xfake_acid_8:
-    case Zplayer:
       cave[x][y] = Yspring_sB;
       next[x][y] = Xblank;
       cave[x][y+1] = Yspring_s;
@@ -5521,6 +5565,9 @@ static void Lspring_fall(int x, int y)
 
 static void Lpush_emerald_e(int x, int y)
 {
+  cave[x][y] = Yemerald_eB;
+  next[x][y] = Xblank;
+
   switch (cave[x+1][y])
   {
     case Zborder:
@@ -5530,22 +5577,35 @@ static void Lpush_emerald_e(int x, int y)
     case Xboom_bomb:
     case Xboom_android:
     case Xboom_1:
-    case Zplayer:
-      cave[x][y] = Xemerald;
-      next[x][y] = Xemerald;
       return;
 
-    default:
-      cave[x][y] = Yemerald_eB;
-      next[x][y] = Xblank;
-      cave[x+1][y] = Yemerald_e;
-      next[x+1][y] = Xemerald_pause;
+#ifdef ACID_ROLL
+    case Xacid_1:
+    case Xacid_2:
+    case Xacid_3:
+    case Xacid_4:
+    case Xacid_5:
+    case Xacid_6:
+    case Xacid_7:
+    case Xacid_8:
+      if (cave[x+2][y-1] == Xblank)
+       cave[x+2][y-1] = Xsplash_e;
+      if (cave[x][y-1] == Xblank)
+       cave[x][y-1] = Xsplash_w;
+      play_element_sound(x, y, SOUND_acid, Xacid_1);
       return;
+#endif
   }
+
+  cave[x+1][y] = Yemerald_e;
+  next[x+1][y] = Xemerald_pause;
 }
 
 static void Lpush_emerald_w(int x, int y)
 {
+  cave[x][y] = Yemerald_wB;
+  next[x][y] = Xblank;
+
   switch (cave[x-1][y])
   {
     case Zborder:
@@ -5555,22 +5615,35 @@ static void Lpush_emerald_w(int x, int y)
     case Xboom_bomb:
     case Xboom_android:
     case Xboom_1:
-    case Zplayer:
-      cave[x][y] = Xemerald;
-      next[x][y] = Xemerald;
       return;
 
-    default:
-      cave[x][y] = Yemerald_wB;
-      next[x][y] = Xblank;
-      cave[x-1][y] = Yemerald_w;
-      next[x-1][y] = Xemerald_pause;
+#ifdef ACID_ROLL
+    case Xacid_1:
+    case Xacid_2:
+    case Xacid_3:
+    case Xacid_4:
+    case Xacid_5:
+    case Xacid_6:
+    case Xacid_7:
+    case Xacid_8:
+      if (cave[x][y-1] == Xblank)
+       cave[x][y-1] = Xsplash_e;
+      if (cave[x-2][y-1] == Xblank)
+       cave[x-2][y-1] = Xsplash_w;
+      play_element_sound(x, y, SOUND_acid, Xacid_1);
       return;
+#endif
   }
+
+  cave[x-1][y] = Yemerald_w;
+  next[x-1][y] = Xemerald_pause;
 }
 
 static void Lpush_diamond_e(int x, int y)
 {
+  cave[x][y] = Ydiamond_eB;
+  next[x][y] = Xblank;
+
   switch (cave[x+1][y])
   {
     case Zborder:
@@ -5580,22 +5653,35 @@ static void Lpush_diamond_e(int x, int y)
     case Xboom_bomb:
     case Xboom_android:
     case Xboom_1:
-    case Zplayer:
-      cave[x][y] = Xdiamond;
-      next[x][y] = Xdiamond;
       return;
 
-    default:
-      cave[x][y] = Ydiamond_eB;
-      next[x][y] = Xblank;
-      cave[x+1][y] = Ydiamond_e;
-      next[x+1][y] = Xdiamond_pause;
+#ifdef ACID_ROLL
+    case Xacid_1:
+    case Xacid_2:
+    case Xacid_3:
+    case Xacid_4:
+    case Xacid_5:
+    case Xacid_6:
+    case Xacid_7:
+    case Xacid_8:
+      if (cave[x+2][y-1] == Xblank)
+       cave[x+2][y-1] = Xsplash_e;
+      if (cave[x][y-1] == Xblank)
+       cave[x][y-1] = Xsplash_w;
+      play_element_sound(x, y, SOUND_acid, Xacid_1);
       return;
+#endif
   }
+
+  cave[x+1][y] = Ydiamond_e;
+  next[x+1][y] = Xdiamond_pause;
 }
 
 static void Lpush_diamond_w(int x, int y)
 {
+  cave[x][y] = Ydiamond_wB;
+  next[x][y] = Xblank;
+
   switch (cave[x-1][y])
   {
     case Zborder:
@@ -5605,22 +5691,35 @@ static void Lpush_diamond_w(int x, int y)
     case Xboom_bomb:
     case Xboom_android:
     case Xboom_1:
-    case Zplayer:
-      cave[x][y] = Xdiamond;
-      next[x][y] = Xdiamond;
       return;
 
-    default:
-      cave[x][y] = Ydiamond_wB;
-      next[x][y] = Xblank;
-      cave[x-1][y] = Ydiamond_w;
-      next[x-1][y] = Xdiamond_pause;
+#ifdef ACID_ROLL
+    case Xacid_1:
+    case Xacid_2:
+    case Xacid_3:
+    case Xacid_4:
+    case Xacid_5:
+    case Xacid_6:
+    case Xacid_7:
+    case Xacid_8:
+      if (cave[x][y-1] == Xblank)
+       cave[x][y-1] = Xsplash_e;
+      if (cave[x-2][y-1] == Xblank)
+       cave[x-2][y-1] = Xsplash_w;
+      play_element_sound(x, y, SOUND_acid, Xacid_1);
       return;
+#endif
   }
+
+  cave[x-1][y] = Ydiamond_w;
+  next[x-1][y] = Xdiamond_pause;
 }
 
 static void Lpush_stone_e(int x, int y)
 {
+  cave[x][y] = Ystone_eB;
+  next[x][y] = Xblank;
+
   switch (cave[x+1][y])
   {
     case Zborder:
@@ -5630,22 +5729,35 @@ static void Lpush_stone_e(int x, int y)
     case Xboom_bomb:
     case Xboom_android:
     case Xboom_1:
-    case Zplayer:
-      cave[x][y] = Xstone;
-      next[x][y] = Xstone;
       return;
 
-    default:
-      cave[x][y] = Ystone_eB;
-      next[x][y] = Xblank;
-      cave[x+1][y] = Ystone_e;
-      next[x+1][y] = Xstone_pause;
+#ifdef ACID_ROLL
+    case Xacid_1:
+    case Xacid_2:
+    case Xacid_3:
+    case Xacid_4:
+    case Xacid_5:
+    case Xacid_6:
+    case Xacid_7:
+    case Xacid_8:
+      if (cave[x+2][y-1] == Xblank)
+       cave[x+2][y-1] = Xsplash_e;
+      if (cave[x][y-1] == Xblank)
+       cave[x][y-1] = Xsplash_w;
+      play_element_sound(x, y, SOUND_acid, Xacid_1);
       return;
+#endif
   }
+
+  cave[x+1][y] = Ystone_e;
+  next[x+1][y] = Xstone_pause;
 }
 
 static void Lpush_stone_w(int x, int y)
 {
+  cave[x][y] = Ystone_wB;
+  next[x][y] = Xblank;
+
   switch (cave[x-1][y])
   {
     case Zborder:
@@ -5655,22 +5767,35 @@ static void Lpush_stone_w(int x, int y)
     case Xboom_bomb:
     case Xboom_android:
     case Xboom_1:
-    case Zplayer:
-      cave[x][y] = Xstone;
-      next[x][y] = Xstone;
       return;
 
-    default:
-      cave[x][y] = Ystone_wB;
-      next[x][y] = Xblank;
-      cave[x-1][y] = Ystone_w;
-      next[x-1][y] = Xstone_pause;
+#ifdef ACID_ROLL
+    case Xacid_1:
+    case Xacid_2:
+    case Xacid_3:
+    case Xacid_4:
+    case Xacid_5:
+    case Xacid_6:
+    case Xacid_7:
+    case Xacid_8:
+      if (cave[x][y-1] == Xblank)
+       cave[x][y-1] = Xsplash_e;
+      if (cave[x-2][y-1] == Xblank)
+       cave[x-2][y-1] = Xsplash_w;
+      play_element_sound(x, y, SOUND_acid, Xacid_1);
       return;
+#endif
   }
+
+  cave[x-1][y] = Ystone_w;
+  next[x-1][y] = Xstone_pause;
 }
 
 static void Lpush_bomb_e(int x, int y)
 {
+  cave[x][y] = Ybomb_eB;
+  next[x][y] = Xblank;
+
   switch (cave[x+1][y])
   {
     case Zborder:
@@ -5680,22 +5805,35 @@ static void Lpush_bomb_e(int x, int y)
     case Xboom_bomb:
     case Xboom_android:
     case Xboom_1:
-    case Zplayer:
-      cave[x][y] = Xbomb;
-      next[x][y] = Xbomb;
       return;
 
-    default:
-      cave[x][y] = Ybomb_eB;
-      next[x][y] = Xblank;
-      cave[x+1][y] = Ybomb_e;
-      next[x+1][y] = Xbomb_pause;
+#ifdef ACID_ROLL
+    case Xacid_1:
+    case Xacid_2:
+    case Xacid_3:
+    case Xacid_4:
+    case Xacid_5:
+    case Xacid_6:
+    case Xacid_7:
+    case Xacid_8:
+      if (cave[x+2][y-1] == Xblank)
+       cave[x+2][y-1] = Xsplash_e;
+      if (cave[x][y-1] == Xblank)
+       cave[x][y-1] = Xsplash_w;
+      play_element_sound(x, y, SOUND_acid, Xacid_1);
       return;
+#endif
   }
+
+  cave[x+1][y] = Ybomb_e;
+  next[x+1][y] = Xbomb_pause;
 }
 
 static void Lpush_bomb_w(int x, int y)
 {
+  cave[x][y] = Ybomb_wB;
+  next[x][y] = Xblank;
+
   switch (cave[x-1][y])
   {
     case Zborder:
@@ -5705,22 +5843,35 @@ static void Lpush_bomb_w(int x, int y)
     case Xboom_bomb:
     case Xboom_android:
     case Xboom_1:
-    case Zplayer:
-      cave[x][y] = Xbomb;
-      next[x][y] = Xbomb;
       return;
 
-    default:
-      cave[x][y] = Ybomb_wB;
-      next[x][y] = Xblank;
-      cave[x-1][y] = Ybomb_w;
-      next[x-1][y] = Xbomb_pause;
+#ifdef ACID_ROLL
+    case Xacid_1:
+    case Xacid_2:
+    case Xacid_3:
+    case Xacid_4:
+    case Xacid_5:
+    case Xacid_6:
+    case Xacid_7:
+    case Xacid_8:
+      if (cave[x][y-1] == Xblank)
+       cave[x][y-1] = Xsplash_e;
+      if (cave[x-2][y-1] == Xblank)
+       cave[x-2][y-1] = Xsplash_w;
+      play_element_sound(x, y, SOUND_acid, Xacid_1);
       return;
+#endif
   }
+
+  cave[x-1][y] = Ybomb_w;
+  next[x-1][y] = Xbomb_pause;
 }
 
 static void Lpush_nut_e(int x, int y)
 {
+  cave[x][y] = Ynut_eB;
+  next[x][y] = Xblank;
+
   switch (cave[x+1][y])
   {
     case Zborder:
@@ -5730,22 +5881,35 @@ static void Lpush_nut_e(int x, int y)
     case Xboom_bomb:
     case Xboom_android:
     case Xboom_1:
-    case Zplayer:
-      cave[x][y] = Xnut;
-      next[x][y] = Xnut;
       return;
 
-    default:
-      cave[x][y] = Ynut_eB;
-      next[x][y] = Xblank;
-      cave[x+1][y] = Ynut_e;
-      next[x+1][y] = Xnut_pause;
+#ifdef ACID_ROLL
+    case Xacid_1:
+    case Xacid_2:
+    case Xacid_3:
+    case Xacid_4:
+    case Xacid_5:
+    case Xacid_6:
+    case Xacid_7:
+    case Xacid_8:
+      if (cave[x+2][y-1] == Xblank)
+       cave[x+2][y-1] = Xsplash_e;
+      if (cave[x][y-1] == Xblank)
+       cave[x][y-1] = Xsplash_w;
+      play_element_sound(x, y, SOUND_acid, Xacid_1);
       return;
+#endif
   }
+
+  cave[x+1][y] = Ynut_e;
+  next[x+1][y] = Xnut_pause;
 }
 
 static void Lpush_nut_w(int x, int y)
 {
+  cave[x][y] = Ynut_wB;
+  next[x][y] = Xblank;
+
   switch (cave[x-1][y])
   {
     case Zborder:
@@ -5755,22 +5919,35 @@ static void Lpush_nut_w(int x, int y)
     case Xboom_bomb:
     case Xboom_android:
     case Xboom_1:
-    case Zplayer:
-      cave[x][y] = Xnut;
-      next[x][y] = Xnut;
       return;
 
-    default:
-      cave[x][y] = Ynut_wB;
-      next[x][y] = Xblank;
-      cave[x-1][y] = Ynut_w;
-      next[x-1][y] = Xnut_pause;
+#ifdef ACID_ROLL
+    case Xacid_1:
+    case Xacid_2:
+    case Xacid_3:
+    case Xacid_4:
+    case Xacid_5:
+    case Xacid_6:
+    case Xacid_7:
+    case Xacid_8:
+      if (cave[x][y-1] == Xblank)
+       cave[x][y-1] = Xsplash_e;
+      if (cave[x-2][y-1] == Xblank)
+       cave[x-2][y-1] = Xsplash_w;
+      play_element_sound(x, y, SOUND_acid, Xacid_1);
       return;
+#endif
   }
+
+  cave[x-1][y] = Ynut_w;
+  next[x-1][y] = Xnut_pause;
 }
 
 static void Lpush_spring_e(int x, int y)
 {
+  cave[x][y] = Yspring_eB;
+  next[x][y] = Xblank;
+
   switch (cave[x+1][y])
   {
     case Zborder:
@@ -5780,22 +5957,35 @@ static void Lpush_spring_e(int x, int y)
     case Xboom_bomb:
     case Xboom_android:
     case Xboom_1:
-    case Zplayer:
-      cave[x][y] = Xspring;
-      next[x][y] = Xspring;
       return;
 
-    default:
-      cave[x][y] = Yspring_eB;
-      next[x][y] = Xblank;
-      cave[x+1][y] = Yspring_e;
-      next[x+1][y] = Xspring_e;
+#ifdef ACID_ROLL
+    case Xacid_1:
+    case Xacid_2:
+    case Xacid_3:
+    case Xacid_4:
+    case Xacid_5:
+    case Xacid_6:
+    case Xacid_7:
+    case Xacid_8:
+      if (cave[x+2][y-1] == Xblank)
+       cave[x+2][y-1] = Xsplash_e;
+      if (cave[x][y-1] == Xblank)
+       cave[x][y-1] = Xsplash_w;
+      play_element_sound(x, y, SOUND_acid, Xacid_1);
       return;
+#endif
   }
+
+  cave[x+1][y] = Yspring_e;
+  next[x+1][y] = Xspring_e;
 }
 
 static void Lpush_spring_w(int x, int y)
 {
+  cave[x][y] = Yspring_wB;
+  next[x][y] = Xblank;
+
   switch (cave[x-1][y])
   {
     case Zborder:
@@ -5805,18 +5995,28 @@ static void Lpush_spring_w(int x, int y)
     case Xboom_bomb:
     case Xboom_android:
     case Xboom_1:
-    case Zplayer:
-      cave[x][y] = Xspring;
-      next[x][y] = Xspring;
       return;
 
-    default:
-      cave[x][y] = Yspring_wB;
-      next[x][y] = Xblank;
-      cave[x-1][y] = Yspring_w;
-      next[x-1][y] = Xspring_w;
+#ifdef ACID_ROLL
+    case Xacid_1:
+    case Xacid_2:
+    case Xacid_3:
+    case Xacid_4:
+    case Xacid_5:
+    case Xacid_6:
+    case Xacid_7:
+    case Xacid_8:
+      if (cave[x][y-1] == Xblank)
+       cave[x][y-1] = Xsplash_e;
+      if (cave[x-2][y-1] == Xblank)
+       cave[x-2][y-1] = Xsplash_w;
+      play_element_sound(x, y, SOUND_acid, Xacid_1);
       return;
+#endif
   }
+
+  cave[x-1][y] = Yspring_w;
+  next[x-1][y] = Xspring_w;
 }
 
 static void Ldynamite_1(int x, int y)
@@ -6238,6 +6438,7 @@ static void Ldrip_fall(int x, int y)
 
   switch (cave[x][y+1])
   {
+    case Zplayer:
     case Xblank:
     case Xsplash_e:
     case Xsplash_w:
@@ -6251,7 +6452,6 @@ static void Ldrip_fall(int x, int y)
     case Xfake_acid_8:
     case Xplant:
     case Yplant:
-    case Zplayer:
       cave[x][y] = Ydrip_1_sB;
       next[x][y] = Xdrip_stretchB;
       cave[x][y+1] = Ydrip_1_s;
@@ -6311,7 +6511,7 @@ static void Lwonderwall(int x, int y)
 {
   if (lev.wonderwall_time && lev.wonderwall_state)
   {
-    cave[x][y] = XwonderwallB;
+    cave[x][y] = Ywonderwall;
     play_element_sound(x, y, SOUND_wonder, Xwonderwall);
   }
 }
@@ -6319,31 +6519,31 @@ static void Lwonderwall(int x, int y)
 static void Lwheel(int x, int y)
 {
   if (lev.wheel_cnt && x == lev.wheel_x && y == lev.wheel_y)
-    cave[x][y] = XwheelB;
+    cave[x][y] = Ywheel;
 }
 
 static void Lswitch(int x, int y)
 {
   if (lev.ball_state)
-    cave[x][y] = XswitchB;
+    cave[x][y] = Yswitch;
 }
 
 static void Lfake_blank(int x, int y)
 {
   if (lev.lenses_cnt)
-    cave[x][y] = Xfake_blankB;
+    cave[x][y] = Yfake_blank;
 }
 
 static void Lfake_grass(int x, int y)
 {
   if (lev.magnify_cnt)
-    cave[x][y] = Xfake_grassB;
+    cave[x][y] = Yfake_grass;
 }
 
 static void Lfake_amoeba(int x, int y)
 {
   if (lev.lenses_cnt)
-    cave[x][y] = Xfake_amoebaB;
+    cave[x][y] = Yfake_amoeba;
 }
 
 static void Lsand_stone(int x, int y)
@@ -6509,7 +6709,7 @@ static void Lslide_ew(int x, int y)
 
 static void Lexit(int x, int y)
 {
-  if (lev.required > 0)
+  if (lev.gems_needed > 0)
     return;
 
   switch (RANDOM(64) / 21)