X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fgame_em%2Flogic.c;h=19930d24eba7d12cf920d40f787907ebca1fd2be;hb=4b9cc1bf8622907234c4f0cb6c5a7e060a045404;hp=616e80c1d37dfab726e327bc6e195f1bc4aec135;hpb=aabdde1f5e4f678c5896c48454acdbe3f6c0535c;p=rocksndiamonds.git diff --git a/src/game_em/logic.c b/src/game_em/logic.c index 616e80c1..19930d24 100644 --- a/src/game_em/logic.c +++ b/src/game_em/logic.c @@ -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, + [Yfake_amoeba] = 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; @@ -171,15 +251,10 @@ static boolean player_killed(struct PLAYER *ply) switch (cave[x][y]) { - case Xblank: - case Xacid_splash_e: - case Xacid_splash_w: case Zplayer: - case Xdynamite_1: - case Xdynamite_2: - case Xdynamite_3: - case Xdynamite_4: -#ifdef EM_ENGINE_USE_ADDITIONAL_ELEMENTS + case Xblank: + case Xsplash_e: + case Xsplash_w: case Xfake_acid_1: case Xfake_acid_2: case Xfake_acid_3: @@ -188,7 +263,10 @@ static boolean player_killed(struct PLAYER *ply) case Xfake_acid_6: case Xfake_acid_7: case Xfake_acid_8: -#endif + case Xdynamite_1: + case Xdynamite_2: + case Xdynamite_3: + case Xdynamite_4: return FALSE; } @@ -361,11 +439,10 @@ 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; -#ifdef EM_ENGINE_USE_ADDITIONAL_ELEMENTS case Xfake_acid_1: case Xfake_acid_2: case Xfake_acid_3: @@ -374,7 +451,6 @@ static boolean player_digfield(struct PLAYER *ply, int dx, int dy) case Xfake_acid_6: case Xfake_acid_7: case Xfake_acid_8: -#endif play_element_sound(x, y, SOUND_blank, Xblank); ply->anim = PLY_walk_n + anim; ply->x = x; @@ -391,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 @@ -567,8 +643,16 @@ 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: + case Xfake_acid_4: + case Xfake_acid_5: + case Xfake_acid_6: + case Xfake_acid_7: + case Xfake_acid_8: cave[x+dx][y] = dx > 0 ? Ystone_e : Ystone_w; next[x+dx][y] = Xstone_pause; goto stone_walk; @@ -582,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: @@ -606,8 +690,16 @@ 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: + case Xfake_acid_4: + case Xfake_acid_5: + case Xfake_acid_6: + case Xfake_acid_7: + case Xfake_acid_8: cave[x+dx][y] = dx > 0 ? Ybomb_e : Ybomb_w; next[x+dx][y] = Xbomb_pause; goto bomb_walk; @@ -621,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: @@ -645,8 +737,16 @@ 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: + case Xfake_acid_4: + case Xfake_acid_5: + case Xfake_acid_6: + case Xfake_acid_7: + case Xfake_acid_8: cave[x+dx][y] = dx > 0 ? Ynut_e : Ynut_w; next[x+dx][y] = Xnut_pause; goto nut_walk; @@ -660,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: @@ -684,8 +784,16 @@ 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: + case Xfake_acid_4: + case Xfake_acid_5: + case Xfake_acid_6: + case Xfake_acid_7: + case Xfake_acid_8: cave[x+dx][y] = dx > 0 ? Yspring_e : Yspring_w; next[x+dx][y] = dx > 0 ? Xspring_e : Xspring_w; goto spring_walk; @@ -699,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: @@ -745,8 +853,16 @@ 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: + case Xfake_acid_4: + case Xfake_acid_5: + case Xfake_acid_6: + case Xfake_acid_7: + case Xfake_acid_8: cave[x+dx][y+dy] = (dy ? (dy < 0 ? Yballoon_n : Yballoon_s) : (dx > 0 ? Yballoon_e : Yballoon_w)); next[x+dx][y+dy] = Xballoon; @@ -761,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: @@ -792,8 +908,16 @@ 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: + case Xfake_acid_4: + case Xfake_acid_5: + case Xfake_acid_6: + case Xfake_acid_7: + case Xfake_acid_8: cave[x+dx][y+dy] = (dy ? (dy < 0 ? Yandroid_n : Yandroid_s) : (dx > 0 ? Yandroid_e : Yandroid_w)); next[x+dx][y+dy] = (dy ? (dy < 0 ? Xandroid_2_n : Xandroid_2_s) : @@ -809,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: @@ -886,11 +1010,15 @@ 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; - cave[x+dx][y+dy] = Zplayer; - next[x+dx][y+dy] = Zplayer; + if (!is_fake_acid[cave[x+dx][y+dy]]) + { + cave[x+dx][y+dy] = Zplayer; + next[x+dx][y+dy] = Zplayer; + } + play_element_sound(x, y, SOUND_door, element); ply->anim = PLY_walk_n + anim; ply->x = x + dx; @@ -1292,7 +1420,6 @@ static void Lacid_8(int x, int y) next[x][y] = Xacid_1; } -#ifdef EM_ENGINE_USE_ADDITIONAL_ELEMENTS static void Lfake_acid_1(int x, int y) { next[x][y] = Xfake_acid_2; @@ -1332,7 +1459,6 @@ static void Lfake_acid_8(int x, int y) { next[x][y] = Xfake_acid_1; } -#endif static void Landroid(int x, int y) { @@ -1340,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)) @@ -1451,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; } } @@ -1565,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; } } @@ -1623,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; } } @@ -1742,8 +1868,16 @@ 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: + case Xfake_acid_4: + case Xfake_acid_5: + case Xfake_acid_6: + case Xfake_acid_7: + case Xfake_acid_8: cave[x][y] = Yandroid_nB; next[x][y] = Xblank; cave[x][y-1] = Yandroid_n; @@ -1762,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; @@ -1779,8 +1913,16 @@ 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: + case Xfake_acid_4: + case Xfake_acid_5: + case Xfake_acid_6: + case Xfake_acid_7: + case Xfake_acid_8: cave[x][y] = Yandroid_nB; next[x][y] = Xblank; cave[x][y-1] = Yandroid_n; @@ -1799,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; @@ -1816,8 +1958,16 @@ 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: + case Xfake_acid_4: + case Xfake_acid_5: + case Xfake_acid_6: + case Xfake_acid_7: + case Xfake_acid_8: cave[x][y] = Yandroid_eB; next[x][y] = Xblank; cave[x+1][y] = Yandroid_e; @@ -1836,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; @@ -1853,8 +2003,16 @@ 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: + case Xfake_acid_4: + case Xfake_acid_5: + case Xfake_acid_6: + case Xfake_acid_7: + case Xfake_acid_8: cave[x][y] = Yandroid_eB; next[x][y] = Xblank; cave[x+1][y] = Yandroid_e; @@ -1873,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; @@ -1890,8 +2048,16 @@ 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: + case Xfake_acid_4: + case Xfake_acid_5: + case Xfake_acid_6: + case Xfake_acid_7: + case Xfake_acid_8: cave[x][y] = Yandroid_sB; next[x][y] = Xblank; cave[x][y+1] = Yandroid_s; @@ -1910,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; @@ -1927,8 +2093,16 @@ 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: + case Xfake_acid_4: + case Xfake_acid_5: + case Xfake_acid_6: + case Xfake_acid_7: + case Xfake_acid_8: cave[x][y] = Yandroid_sB; next[x][y] = Xblank; cave[x][y+1] = Yandroid_s; @@ -1947,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; @@ -1964,8 +2138,16 @@ 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: + case Xfake_acid_4: + case Xfake_acid_5: + case Xfake_acid_6: + case Xfake_acid_7: + case Xfake_acid_8: cave[x][y] = Yandroid_wB; next[x][y] = Xblank; cave[x-1][y] = Yandroid_w; @@ -1984,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; @@ -2001,8 +2183,16 @@ 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: + case Xfake_acid_4: + case Xfake_acid_5: + case Xfake_acid_6: + case Xfake_acid_7: + case Xfake_acid_8: cave[x][y] = Yandroid_wB; next[x][y] = Xblank; cave[x-1][y] = Yandroid_w; @@ -2021,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; @@ -2069,12 +2259,20 @@ static void Leater_n(int x, int y) switch (cave[x][y-1]) { + case Zplayer: 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: + case Xfake_acid_4: + case Xfake_acid_5: + case Xfake_acid_6: + case Xfake_acid_7: + case Xfake_acid_8: case Xplant: case Yplant: - case Zplayer: cave[x][y] = Yeater_nB; next[x][y] = Xblank; cave[x][y-1] = Yeater_n; @@ -2092,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; @@ -2141,12 +2339,20 @@ static void Leater_e(int x, int y) switch (cave[x+1][y]) { + case Zplayer: 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: + case Xfake_acid_4: + case Xfake_acid_5: + case Xfake_acid_6: + case Xfake_acid_7: + case Xfake_acid_8: case Xplant: case Yplant: - case Zplayer: cave[x][y] = Yeater_eB; next[x][y] = Xblank; cave[x+1][y] = Yeater_e; @@ -2164,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; @@ -2213,12 +2419,20 @@ static void Leater_s(int x, int y) switch (cave[x][y+1]) { + case Zplayer: 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: + case Xfake_acid_4: + case Xfake_acid_5: + case Xfake_acid_6: + case Xfake_acid_7: + case Xfake_acid_8: case Xplant: case Yplant: - case Zplayer: cave[x][y] = Yeater_sB; next[x][y] = Xblank; cave[x][y+1] = Yeater_s; @@ -2236,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; @@ -2285,12 +2499,20 @@ static void Leater_w(int x, int y) switch (cave[x-1][y]) { + case Zplayer: 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: + case Xfake_acid_4: + case Xfake_acid_5: + case Xfake_acid_6: + case Xfake_acid_7: + case Xfake_acid_8: case Xplant: case Yplant: - case Zplayer: cave[x][y] = Yeater_wB; next[x][y] = Xblank; cave[x-1][y] = Yeater_w; @@ -2308,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; @@ -2341,12 +2563,20 @@ static void Lalien(int x, int y) { switch (cave[x][y-1]) { + case Zplayer: 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: + case Xfake_acid_4: + case Xfake_acid_5: + case Xfake_acid_6: + case Xfake_acid_7: + case Xfake_acid_8: case Xplant: case Yplant: - case Zplayer: cave[x][y] = Yalien_nB; next[x][y] = Xblank; cave[x][y-1] = Yalien_n; @@ -2365,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; } @@ -2376,12 +2606,20 @@ static void Lalien(int x, int y) { switch (cave[x][y+1]) { + case Zplayer: 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: + case Xfake_acid_4: + case Xfake_acid_5: + case Xfake_acid_6: + case Xfake_acid_7: + case Xfake_acid_8: case Xplant: case Yplant: - case Zplayer: cave[x][y] = Yalien_sB; next[x][y] = Xblank; cave[x][y+1] = Yalien_s; @@ -2400,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; } @@ -2414,12 +2652,20 @@ static void Lalien(int x, int y) { switch (cave[x+1][y]) { + case Zplayer: 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: + case Xfake_acid_4: + case Xfake_acid_5: + case Xfake_acid_6: + case Xfake_acid_7: + case Xfake_acid_8: case Xplant: case Yplant: - case Zplayer: cave[x][y] = Yalien_eB; next[x][y] = Xblank; cave[x+1][y] = Yalien_e; @@ -2438,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; } @@ -2449,12 +2695,20 @@ static void Lalien(int x, int y) { switch (cave[x-1][y]) { + case Zplayer: 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: + case Xfake_acid_4: + case Xfake_acid_5: + case Xfake_acid_6: + case Xfake_acid_7: + case Xfake_acid_8: case Xplant: case Yplant: - case Zplayer: cave[x][y] = Yalien_wB; next[x][y] = Xblank; cave[x-1][y] = Yalien_w; @@ -2473,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; } @@ -2492,12 +2746,20 @@ static void Lbug_n(int x, int y) { switch (cave[x][y-1]) { + case Zplayer: 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: + case Xfake_acid_4: + case Xfake_acid_5: + case Xfake_acid_6: + case Xfake_acid_7: + case Xfake_acid_8: case Xplant: case Yplant: - case Zplayer: cave[x][y] = Ybug_nB; next[x][y] = Xblank; cave[x][y-1] = Ybug_n; @@ -2516,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; @@ -2532,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); @@ -2544,9 +2806,18 @@ static void Lbug_1_n(int x, int y) switch (cave[x+1][y]) { + case Zplayer: 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: + case Xfake_acid_4: + case Xfake_acid_5: + case Xfake_acid_6: + case Xfake_acid_7: + case Xfake_acid_8: case Xplant: case Yplant: case Xacid_1: @@ -2557,7 +2828,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); @@ -2571,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); @@ -2588,12 +2858,20 @@ static void Lbug_e(int x, int y) { switch (cave[x+1][y]) { + case Zplayer: 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: + case Xfake_acid_4: + case Xfake_acid_5: + case Xfake_acid_6: + case Xfake_acid_7: + case Xfake_acid_8: case Xplant: case Yplant: - case Zplayer: cave[x][y] = Ybug_eB; next[x][y] = Xblank; cave[x+1][y] = Ybug_e; @@ -2612,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; @@ -2628,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); @@ -2640,9 +2918,18 @@ static void Lbug_1_e(int x, int y) switch (cave[x][y+1]) { + case Zplayer: 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: + case Xfake_acid_4: + case Xfake_acid_5: + case Xfake_acid_6: + case Xfake_acid_7: + case Xfake_acid_8: case Xplant: case Yplant: case Xacid_1: @@ -2653,7 +2940,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); @@ -2667,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); @@ -2684,12 +2970,20 @@ static void Lbug_s(int x, int y) { switch (cave[x][y+1]) { + case Zplayer: 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: + case Xfake_acid_4: + case Xfake_acid_5: + case Xfake_acid_6: + case Xfake_acid_7: + case Xfake_acid_8: case Xplant: case Yplant: - case Zplayer: cave[x][y] = Ybug_sB; next[x][y] = Xblank; cave[x][y+1] = Ybug_s; @@ -2708,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; @@ -2724,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); @@ -2736,9 +3030,18 @@ static void Lbug_1_s(int x, int y) switch (cave[x-1][y]) { + case Zplayer: 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: + case Xfake_acid_4: + case Xfake_acid_5: + case Xfake_acid_6: + case Xfake_acid_7: + case Xfake_acid_8: case Xplant: case Yplant: case Xacid_1: @@ -2749,7 +3052,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); @@ -2763,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); @@ -2780,12 +3082,20 @@ static void Lbug_w(int x, int y) { switch (cave[x-1][y]) { + case Zplayer: 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: + case Xfake_acid_4: + case Xfake_acid_5: + case Xfake_acid_6: + case Xfake_acid_7: + case Xfake_acid_8: case Xplant: case Yplant: - case Zplayer: cave[x][y] = Ybug_wB; next[x][y] = Xblank; cave[x-1][y] = Ybug_w; @@ -2804,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; @@ -2820,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); @@ -2832,9 +3142,18 @@ static void Lbug_1_w(int x, int y) switch (cave[x][y-1]) { + case Zplayer: 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: + case Xfake_acid_4: + case Xfake_acid_5: + case Xfake_acid_6: + case Xfake_acid_7: + case Xfake_acid_8: case Xplant: case Yplant: case Xacid_1: @@ -2845,7 +3164,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); @@ -2859,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); @@ -2876,12 +3194,20 @@ static void Ltank_n(int x, int y) { switch (cave[x][y-1]) { + case Zplayer: 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: + case Xfake_acid_4: + case Xfake_acid_5: + case Xfake_acid_6: + case Xfake_acid_7: + case Xfake_acid_8: case Xplant: case Yplant: - case Zplayer: cave[x][y] = Ytank_nB; next[x][y] = Xblank; cave[x][y-1] = Ytank_n; @@ -2900,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; @@ -2916,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); @@ -2928,9 +3254,18 @@ static void Ltank_1_n(int x, int y) switch (cave[x-1][y]) { + case Zplayer: 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: + case Xfake_acid_4: + case Xfake_acid_5: + case Xfake_acid_6: + case Xfake_acid_7: + case Xfake_acid_8: case Xplant: case Yplant: case Xacid_1: @@ -2941,7 +3276,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); @@ -2955,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); @@ -2972,12 +3306,20 @@ static void Ltank_e(int x, int y) { switch (cave[x+1][y]) { + case Zplayer: 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: + case Xfake_acid_4: + case Xfake_acid_5: + case Xfake_acid_6: + case Xfake_acid_7: + case Xfake_acid_8: case Xplant: case Yplant: - case Zplayer: cave[x][y] = Ytank_eB; next[x][y] = Xblank; cave[x+1][y] = Ytank_e; @@ -2996,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; @@ -3012,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); @@ -3024,9 +3366,18 @@ static void Ltank_1_e(int x, int y) switch (cave[x][y-1]) { + case Zplayer: 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: + case Xfake_acid_4: + case Xfake_acid_5: + case Xfake_acid_6: + case Xfake_acid_7: + case Xfake_acid_8: case Xplant: case Yplant: case Xacid_1: @@ -3037,7 +3388,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); @@ -3051,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); @@ -3068,16 +3418,24 @@ static void Ltank_s(int x, int y) { switch (cave[x][y+1]) { - case Xblank: - case Xacid_splash_e: - case Xacid_splash_w: - case Xplant: - case Yplant: case Zplayer: - cave[x][y] = Ytank_sB; - next[x][y] = Xblank; - cave[x][y+1] = Ytank_s; - next[x][y+1] = Xtank_1_s; + case Xblank: + case Xsplash_e: + case Xsplash_w: + case Xfake_acid_1: + case Xfake_acid_2: + case Xfake_acid_3: + case Xfake_acid_4: + case Xfake_acid_5: + case Xfake_acid_6: + case Xfake_acid_7: + case Xfake_acid_8: + case Xplant: + case Yplant: + cave[x][y] = Ytank_sB; + next[x][y] = Xblank; + cave[x][y+1] = Ytank_s; + next[x][y+1] = Xtank_1_s; play_element_sound(x, y, SOUND_tank, Xtank_1_s); return; @@ -3092,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; @@ -3108,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); @@ -3120,9 +3478,18 @@ static void Ltank_1_s(int x, int y) switch (cave[x+1][y]) { + case Zplayer: 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: + case Xfake_acid_4: + case Xfake_acid_5: + case Xfake_acid_6: + case Xfake_acid_7: + case Xfake_acid_8: case Xplant: case Yplant: case Xacid_1: @@ -3133,7 +3500,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); @@ -3147,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); @@ -3164,12 +3530,20 @@ static void Ltank_w(int x, int y) { switch (cave[x-1][y]) { + case Zplayer: 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: + case Xfake_acid_4: + case Xfake_acid_5: + case Xfake_acid_6: + case Xfake_acid_7: + case Xfake_acid_8: case Xplant: case Yplant: - case Zplayer: cave[x][y] = Ytank_wB; next[x][y] = Xblank; cave[x-1][y] = Ytank_w; @@ -3188,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; @@ -3204,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); @@ -3216,9 +3590,18 @@ static void Ltank_1_w(int x, int y) switch (cave[x][y+1]) { + case Zplayer: 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: + case Xfake_acid_4: + case Xfake_acid_5: + case Xfake_acid_6: + case Xfake_acid_7: + case Xfake_acid_8: case Xplant: case Yplant: case Xacid_1: @@ -3229,7 +3612,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); @@ -3243,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); @@ -3261,8 +3643,16 @@ 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: + case Xfake_acid_4: + case Xfake_acid_5: + case Xfake_acid_6: + case Xfake_acid_7: + case Xfake_acid_8: cave[x][y] = Yemerald_sB; next[x][y] = Xblank; cave[x][y+1] = Yemerald_s; @@ -3280,16 +3670,12 @@ 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; - case Xspring: - case Xspring_pause: - case Xspring_e: - case Xspring_w: case Xandroid: case Xandroid_1_n: case Xandroid_2_n: @@ -3299,24 +3685,20 @@ static void Lemerald(int x, int y) case Xandroid_2_s: case Xandroid_1_w: case Xandroid_2_w: - case Xstone: - case Xstone_pause: case Xemerald: case Xemerald_pause: case Xdiamond: case Xdiamond_pause: + case Xstone: + case Xstone_pause: case Xbomb: case Xbomb_pause: - case Xballoon: - case Xacid_ne: - case Xacid_nw: - case Xball_1: - case Xball_2: case Xnut: case Xnut_pause: - case Xslidewall_ns: - case Xslidewall_ew: - case Xwonderwall: + case Xspring: + case Xspring_pause: + case Xspring_e: + case Xspring_w: case Xkey_1: case Xkey_2: case Xkey_3: @@ -3325,12 +3707,16 @@ static void Lemerald(int x, int y) case Xkey_6: case Xkey_7: case Xkey_8: - case Xbumper: + case Xballoon: + case Xball_1: + case Xball_2: + case Xwonderwall: case Xswitch: - case Xsteel_1: - case Xsteel_2: - case Xsteel_3: - case Xsteel_4: + case Xbumper: + case Xacid_ne: + case Xacid_nw: + case Xslide_ns: + case Xslide_ew: case Xwall_1: case Xwall_2: case Xwall_3: @@ -3339,9 +3725,13 @@ static void Lemerald(int x, int y) case Xroundwall_2: case Xroundwall_3: case Xroundwall_4: + case Xsteel_1: + case Xsteel_2: + case Xsteel_3: + case Xsteel_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; @@ -3350,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; @@ -3361,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; @@ -3370,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; @@ -3396,8 +3786,16 @@ 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: + case Xfake_acid_4: + case Xfake_acid_5: + case Xfake_acid_6: + case Xfake_acid_7: + case Xfake_acid_8: cave[x][y] = Yemerald_sB; next[x][y] = Xblank; cave[x][y+1] = Yemerald_s; @@ -3415,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; @@ -3432,10 +3830,18 @@ static void Lemerald_fall(int x, int y) { switch (cave[x][y+1]) { - case Xblank: - case Xacid_splash_e: - case Xacid_splash_w: case Zplayer: + case Xblank: + case Xsplash_e: + case Xsplash_w: + case Xfake_acid_1: + case Xfake_acid_2: + case Xfake_acid_3: + case Xfake_acid_4: + case Xfake_acid_5: + case Xfake_acid_6: + case Xfake_acid_7: + case Xfake_acid_8: cave[x][y] = Yemerald_sB; next[x][y] = Xblank; cave[x][y+1] = Yemerald_s; @@ -3453,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; @@ -3464,13 +3870,12 @@ static void Lemerald_fall(int x, int y) { lev.wonderwall_state = 1; cave[x][y] = Yemerald_sB; - if (tab_blank[cave[x][y+2]]) + next[x][y] = Xblank; + if (is_blank[cave[x][y+2]]) { cave[x][y+2] = Ydiamond_s; next[x][y+2] = Xdiamond_fall; } - - next[x][y] = Xblank; play_element_sound(x, y, SOUND_wonderfall, Xwonderwall); return; } @@ -3488,8 +3893,16 @@ 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: + case Xfake_acid_4: + case Xfake_acid_5: + case Xfake_acid_6: + case Xfake_acid_7: + case Xfake_acid_8: cave[x][y] = Ydiamond_sB; next[x][y] = Xblank; cave[x][y+1] = Ydiamond_s; @@ -3507,16 +3920,12 @@ 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; - case Xspring: - case Xspring_pause: - case Xspring_e: - case Xspring_w: case Xandroid: case Xandroid_1_n: case Xandroid_2_n: @@ -3526,24 +3935,20 @@ static void Ldiamond(int x, int y) case Xandroid_2_s: case Xandroid_1_w: case Xandroid_2_w: - case Xstone: - case Xstone_pause: case Xemerald: case Xemerald_pause: case Xdiamond: case Xdiamond_pause: + case Xstone: + case Xstone_pause: case Xbomb: case Xbomb_pause: - case Xballoon: - case Xacid_ne: - case Xacid_nw: - case Xball_1: - case Xball_2: case Xnut: case Xnut_pause: - case Xslidewall_ns: - case Xslidewall_ew: - case Xwonderwall: + case Xspring: + case Xspring_pause: + case Xspring_e: + case Xspring_w: case Xkey_1: case Xkey_2: case Xkey_3: @@ -3552,12 +3957,16 @@ static void Ldiamond(int x, int y) case Xkey_6: case Xkey_7: case Xkey_8: - case Xbumper: + case Xballoon: + case Xball_1: + case Xball_2: + case Xwonderwall: case Xswitch: - case Xsteel_1: - case Xsteel_2: - case Xsteel_3: - case Xsteel_4: + case Xbumper: + case Xacid_ne: + case Xacid_nw: + case Xslide_ns: + case Xslide_ew: case Xwall_1: case Xwall_2: case Xwall_3: @@ -3566,9 +3975,13 @@ static void Ldiamond(int x, int y) case Xroundwall_2: case Xroundwall_3: case Xroundwall_4: + case Xsteel_1: + case Xsteel_2: + case Xsteel_3: + case Xsteel_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; @@ -3577,7 +3990,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; @@ -3588,7 +4001,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; @@ -3597,7 +4010,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; @@ -3623,8 +4036,16 @@ 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: + case Xfake_acid_4: + case Xfake_acid_5: + case Xfake_acid_6: + case Xfake_acid_7: + case Xfake_acid_8: cave[x][y] = Ydiamond_sB; next[x][y] = Xblank; cave[x][y+1] = Ydiamond_s; @@ -3642,9 +4063,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; @@ -3659,10 +4080,18 @@ static void Ldiamond_fall(int x, int y) { switch (cave[x][y+1]) { - case Xblank: - case Xacid_splash_e: - case Xacid_splash_w: case Zplayer: + case Xblank: + case Xsplash_e: + case Xsplash_w: + case Xfake_acid_1: + case Xfake_acid_2: + case Xfake_acid_3: + case Xfake_acid_4: + case Xfake_acid_5: + case Xfake_acid_6: + case Xfake_acid_7: + case Xfake_acid_8: cave[x][y] = Ydiamond_sB; next[x][y] = Xblank; cave[x][y+1] = Ydiamond_s; @@ -3680,9 +4109,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; @@ -3691,13 +4120,12 @@ static void Ldiamond_fall(int x, int y) { lev.wonderwall_state = 1; cave[x][y] = Ydiamond_sB; - if (tab_blank[cave[x][y+2]]) + next[x][y] = Xblank; + if (is_blank[cave[x][y+2]]) { cave[x][y+2] = Ystone_s; next[x][y+2] = Xstone_fall; } - - next[x][y] = Xblank; play_element_sound(x, y, SOUND_wonderfall, Xwonderwall); return; } @@ -3715,11 +4143,8 @@ static void Lstone(int x, int y) switch (cave[x][y+1]) { case Xblank: - case Xacid_splash_e: - case Xacid_splash_w: - case Xplant: - case Yplant: -#ifdef EM_ENGINE_USE_ADDITIONAL_ELEMENTS + case Xsplash_e: + case Xsplash_w: case Xfake_acid_1: case Xfake_acid_2: case Xfake_acid_3: @@ -3728,7 +4153,8 @@ static void Lstone(int x, int y) case Xfake_acid_6: case Xfake_acid_7: case Xfake_acid_8: -#endif + case Xplant: + case Yplant: cave[x][y] = Ystone_sB; next[x][y] = Xblank; cave[x][y+1] = Ystone_s; @@ -3746,9 +4172,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; @@ -3759,10 +4185,6 @@ static void Lstone(int x, int y) next[x][y+1] = Xsand_sandstone_2; return; - case Xspring: - case Xspring_pause: - case Xspring_e: - case Xspring_w: case Xandroid: case Xandroid_1_n: case Xandroid_2_n: @@ -3772,23 +4194,20 @@ static void Lstone(int x, int y) case Xandroid_2_s: case Xandroid_1_w: case Xandroid_2_w: - case Xstone: - case Xstone_pause: case Xemerald: case Xemerald_pause: case Xdiamond: case Xdiamond_pause: + case Xstone: + case Xstone_pause: case Xbomb: case Xbomb_pause: - case Xballoon: - case Xacid_ne: - case Xacid_nw: - case Xball_1: - case Xball_2: case Xnut: case Xnut_pause: - case Xslidewall_ns: - case Xslidewall_ew: + case Xspring: + case Xspring_pause: + case Xspring_e: + case Xspring_w: case Xkey_1: case Xkey_2: case Xkey_3: @@ -3797,17 +4216,24 @@ static void Lstone(int x, int y) case Xkey_6: case Xkey_7: case Xkey_8: - case Xbumper: + case Xballoon: + case Xball_1: + case Xball_2: case Xswitch: + case Xbumper: + case Xacid_ne: + case Xacid_nw: case Xlenses: case Xmagnify: + case Xslide_ns: + case Xslide_ew: case Xroundwall_1: case Xroundwall_2: case Xroundwall_3: case Xroundwall_4: if (RANDOM(2)) { - if (tab_blank[cave[x+1][y]] && tab_acid[cave[x+1][y+1]]) + 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; @@ -3816,7 +4242,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; @@ -3827,7 +4253,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; @@ -3836,7 +4262,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; @@ -3853,9 +4279,8 @@ static void Lstone_pause(int x, int y) switch (cave[x][y+1]) { case Xblank: - case Xacid_splash_e: - case Xacid_splash_w: -#ifdef EM_ENGINE_USE_ADDITIONAL_ELEMENTS + case Xsplash_e: + case Xsplash_w: case Xfake_acid_1: case Xfake_acid_2: case Xfake_acid_3: @@ -3864,7 +4289,6 @@ static void Lstone_pause(int x, int y) case Xfake_acid_6: case Xfake_acid_7: case Xfake_acid_8: -#endif cave[x][y] = Ystone_sB; next[x][y] = Xblank; cave[x][y+1] = Ystone_s; @@ -3882,9 +4306,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; @@ -3899,11 +4323,10 @@ static void Lstone_fall(int x, int y) { switch (cave[x][y+1]) { - case Xblank: - case Xacid_splash_e: - case Xacid_splash_w: case Zplayer: -#ifdef EM_ENGINE_USE_ADDITIONAL_ELEMENTS + case Xblank: + case Xsplash_e: + case Xsplash_w: case Xfake_acid_1: case Xfake_acid_2: case Xfake_acid_3: @@ -3912,7 +4335,6 @@ static void Lstone_fall(int x, int y) case Xfake_acid_6: case Xfake_acid_7: case Xfake_acid_8: -#endif cave[x][y] = Ystone_sB; next[x][y] = Xblank; cave[x][y+1] = Ystone_s; @@ -3930,19 +4352,28 @@ 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; - case Xnut: - case Xnut_pause: - next[x][y] = Xstone; - cave[x][y+1] = Ynut_stone; - next[x][y+1] = Xemerald; - play_element_sound(x, y, SOUND_crack, Xnut); - score += lev.nut_score; + case Xeater_n: + case Xeater_e: + case Xeater_s: + case Xeater_w: + cave[x][y] = Ystone_sB; + cave[x][y+1] = Yeater_stone; + Lboom_eater(x, y+1, Xstone_fall); + score += lev.eater_score; + return; + + case Xalien: + case Xalien_pause: + cave[x][y] = Ystone_sB; + cave[x][y+1] = Yalien_stone; + Lboom_tank(x, y+1, Xstone_fall); + score += lev.alien_score; return; case Xbug_1_n: @@ -3973,70 +4404,41 @@ static void Lstone_fall(int x, int y) score += lev.tank_score; return; - case Xspring: - if (RANDOM(2)) - { - switch (cave[x+1][y+1]) - { - case Xblank: - case Xacid_splash_e: - case Xacid_splash_w: - case Xalien: - case Xalien_pause: - cave[x][y+1] = Xspring_e; - break; - - default: - cave[x][y+1] = Xspring_w; - break; - } - } - else - { - switch (cave[x-1][y+1]) - { - case Xblank: - case Xacid_splash_e: - case Xacid_splash_w: - case Xalien: - case Xalien_pause: - cave[x][y+1] = Xspring_w; - break; - default: - cave[x][y+1] = Xspring_e; - break; - } - } - - next[x][y] = Xstone; - return; - - case Xeater_n: - case Xeater_e: - case Xeater_s: - case Xeater_w: - cave[x][y] = Ystone_sB; - cave[x][y+1] = Yeater_stone; - Lboom_eater(x, y+1, Xstone_fall); - score += lev.eater_score; - return; - - case Xalien: - case Xalien_pause: - cave[x][y] = Ystone_sB; - cave[x][y+1] = Yalien_stone; - Lboom_tank(x, y+1, Xstone_fall); - score += lev.alien_score; - return; - case Xdiamond: case Xdiamond_pause: switch (cave[x][y+2]) { - case Xblank: - case Xacid_splash_e: - case Xacid_splash_w: case Zplayer: + case Xblank: + case Xsplash_e: + case Xsplash_w: + case Xfake_acid_1: + case Xfake_acid_2: + case Xfake_acid_3: + case Xfake_acid_4: + case Xfake_acid_5: + case Xfake_acid_6: + case Xfake_acid_7: + case Xfake_acid_8: + case Xplant: + case Yplant: + case Xacid_1: + case Xacid_2: + case Xacid_3: + case Xacid_4: + case Xacid_5: + case Xacid_6: + case Xacid_7: + case Xacid_8: + case Xandroid: + case Xandroid_1_n: + case Xandroid_2_n: + case Xandroid_1_e: + case Xandroid_2_e: + case Xandroid_1_s: + case Xandroid_2_s: + case Xandroid_1_w: + case Xandroid_2_w: case Xbug_1_n: case Xbug_1_e: case Xbug_1_s: @@ -4053,32 +4455,13 @@ static void Lstone_fall(int x, int y) case Xtank_2_e: case Xtank_2_s: case Xtank_2_w: - case Xspring_fall: - case Xandroid: - case Xandroid_1_n: - case Xandroid_2_n: - case Xandroid_1_e: - case Xandroid_2_e: - case Xandroid_1_s: - case Xandroid_2_s: - case Xandroid_1_w: - case Xandroid_2_w: - case Xstone_fall: case Xemerald_fall: case Xdiamond_fall: + case Xstone_fall: case Xbomb_fall: - case Xacid_s: - 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 Xnut_fall: - case Xplant: - case Yplant: + case Xspring_fall: + case Xacid_s: next[x][y] = Xstone; play_element_sound(x, y, SOUND_stone, Xstone); return; @@ -4097,19 +4480,80 @@ static void Lstone_fall(int x, int y) Lboom_tank(x, y+1, Xstone_fall); return; + case Xnut: + case Xnut_pause: + next[x][y] = Xstone; + cave[x][y+1] = Ynut_stone; + next[x][y+1] = Xemerald; + play_element_sound(x, y, SOUND_crack, Xnut); + score += lev.nut_score; + return; + + case Xspring: + if (RANDOM(2)) + { + switch (cave[x+1][y+1]) + { + case Xblank: + case Xsplash_e: + case Xsplash_w: + case Xfake_acid_1: + case Xfake_acid_2: + case Xfake_acid_3: + case Xfake_acid_4: + case Xfake_acid_5: + case Xfake_acid_6: + case Xfake_acid_7: + case Xfake_acid_8: + case Xalien: + case Xalien_pause: + cave[x][y+1] = Xspring_e; + break; + + default: + cave[x][y+1] = Xspring_w; + break; + } + } + else + { + switch (cave[x-1][y+1]) + { + case Xblank: + case Xsplash_e: + case Xsplash_w: + case Xfake_acid_1: + case Xfake_acid_2: + case Xfake_acid_3: + case Xfake_acid_4: + case Xfake_acid_5: + case Xfake_acid_6: + case Xfake_acid_7: + case Xfake_acid_8: + case Xalien: + case Xalien_pause: + cave[x][y+1] = Xspring_w; + break; + default: + cave[x][y+1] = Xspring_e; + break; + } + } + + next[x][y] = Xstone; + return; + case Xwonderwall: if (lev.wonderwall_time) { lev.wonderwall_state = 1; cave[x][y] = Ystone_sB; - - if (tab_blank[cave[x][y+2]]) + next[x][y] = Xblank; + if (is_blank[cave[x][y+2]]) { cave[x][y+2] = Yemerald_s; next[x][y+2] = Xemerald_fall; } - - next[x][y] = Xblank; play_element_sound(x, y, SOUND_wonderfall, Xwonderwall); return; } @@ -4127,8 +4571,16 @@ 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: + case Xfake_acid_4: + case Xfake_acid_5: + case Xfake_acid_6: + case Xfake_acid_7: + case Xfake_acid_8: cave[x][y] = Ybomb_sB; next[x][y] = Xblank; cave[x][y+1] = Ybomb_s; @@ -4146,16 +4598,12 @@ 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; - case Xspring: - case Xspring_pause: - case Xspring_e: - case Xspring_w: case Xandroid: case Xandroid_1_n: case Xandroid_2_n: @@ -4165,23 +4613,20 @@ static void Lbomb(int x, int y) case Xandroid_2_s: case Xandroid_1_w: case Xandroid_2_w: - case Xstone: - case Xstone_pause: case Xemerald: case Xemerald_pause: case Xdiamond: case Xdiamond_pause: + case Xstone: + case Xstone_pause: case Xbomb: case Xbomb_pause: - case Xballoon: - case Xacid_ne: - case Xacid_nw: - case Xball_1: - case Xball_2: case Xnut: case Xnut_pause: - case Xslidewall_ns: - case Xslidewall_ew: + case Xspring: + case Xspring_pause: + case Xspring_e: + case Xspring_w: case Xkey_1: case Xkey_2: case Xkey_3: @@ -4190,15 +4635,22 @@ static void Lbomb(int x, int y) case Xkey_6: case Xkey_7: case Xkey_8: - case Xbumper: + case Xballoon: + case Xball_1: + case Xball_2: case Xswitch: + case Xbumper: + case Xacid_ne: + case Xacid_nw: + case Xslide_ns: + case Xslide_ew: case Xroundwall_1: case Xroundwall_2: case Xroundwall_3: case Xroundwall_4: if (RANDOM(2)) { - if (tab_blank[cave[x+1][y]] && tab_acid[cave[x+1][y+1]]) + 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; @@ -4207,7 +4659,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; @@ -4218,7 +4670,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; @@ -4227,7 +4679,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; @@ -4244,8 +4696,16 @@ 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: + case Xfake_acid_4: + case Xfake_acid_5: + case Xfake_acid_6: + case Xfake_acid_7: + case Xfake_acid_8: cave[x][y] = Ybomb_sB; next[x][y] = Xblank; cave[x][y+1] = Ybomb_s; @@ -4263,9 +4723,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; @@ -4281,8 +4741,16 @@ 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: + case Xfake_acid_4: + case Xfake_acid_5: + case Xfake_acid_6: + case Xfake_acid_7: + case Xfake_acid_8: cave[x][y] = Ybomb_sB; next[x][y] = Xblank; cave[x][y+1] = Ybomb_s; @@ -4300,9 +4768,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; @@ -4318,8 +4786,16 @@ 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: + case Xfake_acid_4: + case Xfake_acid_5: + case Xfake_acid_6: + case Xfake_acid_7: + case Xfake_acid_8: cave[x][y] = Ynut_sB; next[x][y] = Xblank; cave[x][y+1] = Ynut_s; @@ -4337,16 +4813,12 @@ 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; - case Xspring: - case Xspring_pause: - case Xspring_e: - case Xspring_w: case Xandroid: case Xandroid_1_n: case Xandroid_2_n: @@ -4356,23 +4828,20 @@ static void Lnut(int x, int y) case Xandroid_2_s: case Xandroid_1_w: case Xandroid_2_w: - case Xstone: - case Xstone_pause: case Xemerald: case Xemerald_pause: case Xdiamond: case Xdiamond_pause: + case Xstone: + case Xstone_pause: case Xbomb: case Xbomb_pause: - case Xballoon: - case Xacid_ne: - case Xacid_nw: - case Xball_1: - case Xball_2: case Xnut: case Xnut_pause: - case Xslidewall_ns: - case Xslidewall_ew: + case Xspring: + case Xspring_pause: + case Xspring_e: + case Xspring_w: case Xkey_1: case Xkey_2: case Xkey_3: @@ -4381,15 +4850,22 @@ static void Lnut(int x, int y) case Xkey_6: case Xkey_7: case Xkey_8: - case Xbumper: + case Xballoon: + case Xball_1: + case Xball_2: case Xswitch: + case Xbumper: + case Xacid_ne: + case Xacid_nw: + case Xslide_ns: + case Xslide_ew: case Xroundwall_1: case Xroundwall_2: case Xroundwall_3: case Xroundwall_4: if (RANDOM(2)) { - if (tab_blank[cave[x+1][y]] && tab_acid[cave[x+1][y+1]]) + 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; @@ -4398,7 +4874,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; @@ -4409,7 +4885,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; @@ -4418,7 +4894,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; @@ -4435,8 +4911,16 @@ 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: + case Xfake_acid_4: + case Xfake_acid_5: + case Xfake_acid_6: + case Xfake_acid_7: + case Xfake_acid_8: cave[x][y] = Ynut_sB; next[x][y] = Xblank; cave[x][y+1] = Ynut_s; @@ -4454,9 +4938,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; @@ -4471,10 +4955,18 @@ static void Lnut_fall(int x, int y) { switch (cave[x][y+1]) { - case Xblank: - case Xacid_splash_e: - case Xacid_splash_w: case Zplayer: + case Xblank: + case Xsplash_e: + case Xsplash_w: + case Xfake_acid_1: + case Xfake_acid_2: + case Xfake_acid_3: + case Xfake_acid_4: + case Xfake_acid_5: + case Xfake_acid_6: + case Xfake_acid_7: + case Xfake_acid_8: cave[x][y] = Ynut_sB; next[x][y] = Xblank; cave[x][y+1] = Ynut_s; @@ -4492,9 +4984,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; @@ -4511,8 +5003,16 @@ 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: + case Xfake_acid_4: + case Xfake_acid_5: + case Xfake_acid_6: + case Xfake_acid_7: + case Xfake_acid_8: case Xplant: case Yplant: cave[x][y] = Yspring_sB; @@ -4532,16 +5032,12 @@ 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; - case Xspring: - case Xspring_pause: - case Xspring_e: - case Xspring_w: case Xandroid: case Xandroid_1_n: case Xandroid_2_n: @@ -4551,23 +5047,20 @@ static void Lspring(int x, int y) case Xandroid_2_s: case Xandroid_1_w: case Xandroid_2_w: - case Xstone: - case Xstone_pause: case Xemerald: case Xemerald_pause: case Xdiamond: case Xdiamond_pause: + case Xstone: + case Xstone_pause: case Xbomb: case Xbomb_pause: - case Xballoon: - case Xacid_ne: - case Xacid_nw: - case Xball_1: - case Xball_2: case Xnut: case Xnut_pause: - case Xslidewall_ns: - case Xslidewall_ew: + case Xspring: + case Xspring_pause: + case Xspring_e: + case Xspring_w: case Xkey_1: case Xkey_2: case Xkey_3: @@ -4576,21 +5069,28 @@ static void Lspring(int x, int y) case Xkey_6: case Xkey_7: case Xkey_8: - case Xbumper: + case Xballoon: + case Xball_1: + case Xball_2: case Xswitch: + case Xbumper: + case Xacid_ne: + case Xacid_nw: + case Xslide_ns: + case Xslide_ew: case Xroundwall_1: case Xroundwall_2: case Xroundwall_3: case Xroundwall_4: if (RANDOM(2)) { - if (tab_blank[cave[x+1][y]] && tab_acid[cave[x+1][y+1]]) + 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; cave[x+1][y] = Yspring_e; if (cave[x][y+1] == Xbumper) - cave[x][y+1] = XbumperB; + cave[x][y+1] = Ybumper; #ifdef SPRING_ROLL next[x+1][y] = Xspring_e; @@ -4600,13 +5100,13 @@ 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; cave[x-1][y] = Yspring_w; if (cave[x][y+1] == Xbumper) - cave[x][y+1] = XbumperB; + cave[x][y+1] = Ybumper; #ifdef SPRING_ROLL next[x-1][y] = Xspring_w; @@ -4618,13 +5118,13 @@ 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; cave[x-1][y] = Yspring_w; if (cave[x][y+1] == Xbumper) - cave[x][y+1] = XbumperB; + cave[x][y+1] = Ybumper; #ifdef SPRING_ROLL next[x-1][y] = Xspring_w; @@ -4634,13 +5134,13 @@ 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; cave[x+1][y] = Yspring_e; if (cave[x][y+1] == Xbumper) - cave[x][y+1] = XbumperB; + cave[x][y+1] = Ybumper; #ifdef SPRING_ROLL next[x+1][y] = Xspring_e; @@ -4658,8 +5158,16 @@ 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: + case Xfake_acid_4: + case Xfake_acid_5: + case Xfake_acid_6: + case Xfake_acid_7: + case Xfake_acid_8: cave[x][y] = Yspring_sB; next[x][y] = Xblank; cave[x][y+1] = Yspring_s; @@ -4677,9 +5185,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; @@ -4695,8 +5203,16 @@ 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: + case Xfake_acid_4: + case Xfake_acid_5: + case Xfake_acid_6: + case Xfake_acid_7: + case Xfake_acid_8: cave[x][y] = Yspring_sB; next[x][y] = Xblank; cave[x][y+1] = Yspring_s; @@ -4714,21 +5230,29 @@ 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; case Xbumper: - cave[x][y+1] = XbumperB; + cave[x][y+1] = Ybumper; } 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: + case Xfake_acid_4: + case Xfake_acid_5: + case Xfake_acid_6: + case Xfake_acid_7: + case Xfake_acid_8: case Yalien_nB: case Yalien_eB: case Yalien_sB: @@ -4750,9 +5274,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; @@ -4771,8 +5295,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; @@ -4790,8 +5314,16 @@ 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: + case Xfake_acid_4: + case Xfake_acid_5: + case Xfake_acid_6: + case Xfake_acid_7: + case Xfake_acid_8: cave[x][y] = Yspring_sB; next[x][y] = Xblank; cave[x][y+1] = Yspring_s; @@ -4809,21 +5341,29 @@ 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; case Xbumper: - cave[x][y+1] = XbumperB; + cave[x][y+1] = Ybumper; } 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: + case Xfake_acid_4: + case Xfake_acid_5: + case Xfake_acid_6: + case Xfake_acid_7: + case Xfake_acid_8: case Yalien_nB: case Yalien_eB: case Yalien_sB: @@ -4845,9 +5385,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; @@ -4866,8 +5406,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; @@ -4884,10 +5424,18 @@ static void Lspring_fall(int x, int y) { switch (cave[x][y+1]) { - case Xblank: - case Xacid_splash_e: - case Xacid_splash_w: case Zplayer: + case Xblank: + case Xsplash_e: + case Xsplash_w: + case Xfake_acid_1: + case Xfake_acid_2: + case Xfake_acid_3: + case Xfake_acid_4: + case Xfake_acid_5: + case Xfake_acid_6: + case Xfake_acid_7: + case Xfake_acid_8: cave[x][y] = Yspring_sB; next[x][y] = Xblank; cave[x][y+1] = Yspring_s; @@ -4905,16 +5453,28 @@ 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; - case Xbomb: - case Xbomb_pause: - cave[x][y+1] = Ybomb_blank; + case Xeater_n: + case Xeater_e: + case Xeater_s: + case Xeater_w: + cave[x][y] = Yspring_sB; + cave[x][y+1] = Yeater_spring; + Lboom_eater(x, y+1, Xspring_fall); + score += lev.eater_score; + return; + + case Xalien: + case Xalien_pause: + cave[x][y] = Yspring_sB; + cave[x][y+1] = Yalien_spring; Lboom_tank(x, y+1, Xspring_fall); + score += lev.alien_score; return; case Xbug_1_n: @@ -4945,22 +5505,10 @@ static void Lspring_fall(int x, int y) score += lev.tank_score; return; - case Xeater_n: - case Xeater_e: - case Xeater_s: - case Xeater_w: - cave[x][y] = Yspring_sB; - cave[x][y+1] = Yeater_spring; - Lboom_eater(x, y+1, Xspring_fall); - score += lev.eater_score; - return; - - case Xalien: - case Xalien_pause: - cave[x][y] = Yspring_sB; - cave[x][y+1] = Yalien_spring; + case Xbomb: + case Xbomb_pause: + cave[x][y+1] = Ybomb_blank; Lboom_tank(x, y+1, Xspring_fall); - score += lev.alien_score; return; default: @@ -4975,6 +5523,7 @@ static void Lpush_emerald_e(int x, int y) { switch (cave[x+1][y]) { + case Zplayer: case Zborder: case Znormal: case Zdynamite: @@ -4982,7 +5531,6 @@ 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; @@ -5000,6 +5548,7 @@ static void Lpush_emerald_w(int x, int y) { switch (cave[x-1][y]) { + case Zplayer: case Zborder: case Znormal: case Zdynamite: @@ -5007,7 +5556,6 @@ 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; @@ -5025,6 +5573,7 @@ static void Lpush_diamond_e(int x, int y) { switch (cave[x+1][y]) { + case Zplayer: case Zborder: case Znormal: case Zdynamite: @@ -5032,7 +5581,6 @@ 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; @@ -5050,6 +5598,7 @@ static void Lpush_diamond_w(int x, int y) { switch (cave[x-1][y]) { + case Zplayer: case Zborder: case Znormal: case Zdynamite: @@ -5057,7 +5606,6 @@ 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; @@ -5075,6 +5623,7 @@ static void Lpush_stone_e(int x, int y) { switch (cave[x+1][y]) { + case Zplayer: case Zborder: case Znormal: case Zdynamite: @@ -5082,7 +5631,6 @@ 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; @@ -5100,6 +5648,7 @@ static void Lpush_stone_w(int x, int y) { switch (cave[x-1][y]) { + case Zplayer: case Zborder: case Znormal: case Zdynamite: @@ -5107,7 +5656,6 @@ 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; @@ -5125,6 +5673,7 @@ static void Lpush_bomb_e(int x, int y) { switch (cave[x+1][y]) { + case Zplayer: case Zborder: case Znormal: case Zdynamite: @@ -5132,7 +5681,6 @@ 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; @@ -5150,6 +5698,7 @@ static void Lpush_bomb_w(int x, int y) { switch (cave[x-1][y]) { + case Zplayer: case Zborder: case Znormal: case Zdynamite: @@ -5157,7 +5706,6 @@ 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; @@ -5175,6 +5723,7 @@ static void Lpush_nut_e(int x, int y) { switch (cave[x+1][y]) { + case Zplayer: case Zborder: case Znormal: case Zdynamite: @@ -5182,7 +5731,6 @@ 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; @@ -5200,6 +5748,7 @@ static void Lpush_nut_w(int x, int y) { switch (cave[x-1][y]) { + case Zplayer: case Zborder: case Znormal: case Zdynamite: @@ -5207,7 +5756,6 @@ 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; @@ -5225,6 +5773,7 @@ static void Lpush_spring_e(int x, int y) { switch (cave[x+1][y]) { + case Zplayer: case Zborder: case Znormal: case Zdynamite: @@ -5232,7 +5781,6 @@ 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; @@ -5250,6 +5798,7 @@ static void Lpush_spring_w(int x, int y) { switch (cave[x-1][y]) { + case Zplayer: case Zborder: case Znormal: case Zdynamite: @@ -5257,7 +5806,6 @@ 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; @@ -5356,8 +5904,16 @@ 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: + case Xfake_acid_4: + case Xfake_acid_5: + case Xfake_acid_6: + case Xfake_acid_7: + case Xfake_acid_8: cave[x][y] = Yballoon_nB; next[x][y] = Xblank; cave[x][y-1] = Yballoon_n; @@ -5375,9 +5931,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; } @@ -5387,8 +5943,16 @@ 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: + case Xfake_acid_4: + case Xfake_acid_5: + case Xfake_acid_6: + case Xfake_acid_7: + case Xfake_acid_8: cave[x][y] = Yballoon_eB; next[x][y] = Xblank; cave[x+1][y] = Yballoon_e; @@ -5406,9 +5970,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; } @@ -5418,8 +5982,16 @@ 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: + case Xfake_acid_4: + case Xfake_acid_5: + case Xfake_acid_6: + case Xfake_acid_7: + case Xfake_acid_8: cave[x][y] = Yballoon_sB; next[x][y] = Xblank; cave[x][y+1] = Yballoon_s; @@ -5437,9 +6009,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; } @@ -5449,8 +6021,16 @@ 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: + case Xfake_acid_4: + case Xfake_acid_5: + case Xfake_acid_6: + case Xfake_acid_7: + case Xfake_acid_8: cave[x][y] = Yballoon_wB; next[x][y] = Xblank; cave[x-1][y] = Yballoon_w; @@ -5468,9 +6048,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; } @@ -5488,7 +6068,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]; @@ -5497,7 +6077,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]; @@ -5506,7 +6086,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]; @@ -5515,7 +6095,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]; @@ -5524,7 +6104,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]; @@ -5533,7 +6113,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]; @@ -5542,7 +6122,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]; @@ -5551,7 +6131,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]; @@ -5562,56 +6142,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]; @@ -5658,12 +6238,20 @@ static void Ldrip_fall(int x, int y) switch (cave[x][y+1]) { + case Zplayer: 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: + case Xfake_acid_4: + case Xfake_acid_5: + case Xfake_acid_6: + case Xfake_acid_7: + case Xfake_acid_8: case Xplant: case Yplant: - case Zplayer: cave[x][y] = Ydrip_1_sB; next[x][y] = Xdrip_stretchB; cave[x][y+1] = Ydrip_1_s; @@ -5681,9 +6269,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; @@ -5723,7 +6311,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); } } @@ -5731,31 +6319,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) @@ -5763,8 +6351,16 @@ 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: + case Xfake_acid_4: + case Xfake_acid_5: + case Xfake_acid_6: + case Xfake_acid_7: + case Xfake_acid_8: cave[x][y] = Xsand_stonesand_quickout_1; next[x][y] = Xsand_stonesand_quickout_2; cave[x][y+1] = Xsand_stoneout_1; @@ -5782,9 +6378,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; @@ -5867,7 +6463,6 @@ static void Lsand_stoneout_2(int x, int y) next[x][y] = Xstone_fall; } -#ifdef EM_ENGINE_USE_ADDITIONAL_ELEMENTS static void Lsand_stonesand_quickout_1(int x, int y) { next[x][y] = Xsand_stonesand_quickout_2; @@ -5877,39 +6472,38 @@ static void Lsand_stonesand_quickout_2(int x, int y) { next[x][y] = Xsand; } -#endif -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); } } @@ -5964,47 +6558,136 @@ 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: + case Xfake_acid_4: + case Xfake_acid_5: + case Xfake_acid_6: + case Xfake_acid_7: + case Xfake_acid_8: + case Xplant: + case Yplant: case Xgrass: case Xdirt: case Xsand: + if (is_amoeba[cave[x][y-1]] || + is_amoeba[cave[x+1][y]] || + is_amoeba[cave[x][y+1]] || + is_amoeba[cave[x-1][y]]) + cave[x][y] = Xdrip; + } +} + +static void Lboom_one(int x, int y, boolean by_dynamite) +{ + switch (cave[x][y]) + { + case Zborder: + case 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 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]]) - cave[x][y] = Xdrip; + case Xdoor_1: + case Xdoor_2: + case Xdoor_3: + case Xdoor_4: + case Xdoor_5: + case Xdoor_6: + case Xdoor_7: + case Xdoor_8: + case Xfake_door_1: + case Xfake_door_2: + case Xfake_door_3: + case Xfake_door_4: + case Xfake_door_5: + case Xfake_door_6: + case Xfake_door_7: + case Xfake_door_8: + case Xacid_ne: + case Xacid_nw: + case Xacid_s: + case Xacid_se: + case Xacid_sw: + case Xsteel_1: + case Xsteel_2: + case Xsteel_3: + case Xsteel_4: + return; + + case Xandroid: + case Xandroid_1_n: + case Xandroid_2_n: + case Xandroid_1_e: + case Xandroid_2_e: + case Xandroid_1_s: + case Xandroid_2_s: + case Xandroid_1_w: + case Xandroid_2_w: + if (by_dynamite) + cave[x][y] = Xboom_android; + return; + + case Xbug_1_n: + case Xbug_1_e: + case Xbug_1_s: + case Xbug_1_w: + case Xbug_2_n: + case Xbug_2_e: + case Xbug_2_s: + case Xbug_2_w: + cave[x][y] = Xboom_bug; + 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; } } @@ -6047,7 +6730,6 @@ static void handle_tile(int x, int y) case Xacid_7: Lacid_7(x, y); break; case Xacid_8: Lacid_8(x, y); break; -#ifdef EM_ENGINE_USE_ADDITIONAL_ELEMENTS case Xfake_acid_1: Lfake_acid_1(x, y); break; case Xfake_acid_2: Lfake_acid_2(x, y); break; case Xfake_acid_3: Lfake_acid_3(x, y); break; @@ -6056,7 +6738,6 @@ static void handle_tile(int x, int y) case Xfake_acid_6: Lfake_acid_6(x, y); break; case Xfake_acid_7: Lfake_acid_7(x, y); break; case Xfake_acid_8: Lfake_acid_8(x, y); break; -#endif case Xandroid: Landroid(x, y); break; case Xandroid_1_n: Landroid_1_n(x, y); break; @@ -6182,13 +6863,11 @@ static void handle_tile(int x, int y) case Xsand_stonesand_4: Lsand_stonesand_4(x, y); break; case Xsand_stoneout_1: Lsand_stoneout_1(x, y); break; case Xsand_stoneout_2: Lsand_stoneout_2(x, y); break; -#ifdef EM_ENGINE_USE_ADDITIONAL_ELEMENTS case Xsand_stonesand_quickout_1: Lsand_stonesand_quickout_1(x, y); break; case Xsand_stonesand_quickout_2: Lsand_stonesand_quickout_2(x, y); break; -#endif - 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; @@ -6205,7 +6884,7 @@ static void handle_tile(int x, int y) } } -void logic_1(void) +void logic_players(void) { int start_check_nr; int i; @@ -6236,6 +6915,7 @@ void logic_1(void) game.centered_player_nr_next = i; game.set_centered_player = TRUE; + game.set_centered_player_fast = TRUE; } ply[i].oldx = ply[i].x; @@ -6272,7 +6952,7 @@ void logic_1(void) } } -void logic_2(void) +void logic_objects(void) { int x, y; @@ -6301,7 +6981,7 @@ void logic_2(void) lev.draw = temp; } -void logic_3(void) +void logic_globals(void) { int x; int y; @@ -6344,8 +7024,8 @@ void logic_3(void) for (count = lev.amoeba_time; count--;) { - x = lev.left - 1 + (random >> 10) % CAVE_WIDTH; - y = lev.top - 1 + (random >> 20) % CAVE_HEIGHT; + x = lev.left - 1 + (random >> 10) % (CAVE_WIDTH + 2); + y = lev.top - 1 + (random >> 20) % (CAVE_HEIGHT + 2); if (x >= lev.left && x < lev.right && y >= lev.top && y < lev.bottom)