[Xfake_acid_8] = 1
};
+static const byte is_player[GAME_TILE_MAX] =
+{
+ [Zplayer] = 1,
+ [Xfake_acid_1_player] = 1,
+ [Xfake_acid_2_player] = 1,
+ [Xfake_acid_3_player] = 1,
+ [Xfake_acid_4_player] = 1,
+ [Xfake_acid_5_player] = 1,
+ [Xfake_acid_6_player] = 1,
+ [Xfake_acid_7_player] = 1,
+ [Xfake_acid_8_player] = 1
+};
+
+static const byte add_player[GAME_TILE_MAX] =
+{
+ [Xblank] = Zplayer,
+ [Xsplash_e] = Zplayer,
+ [Xsplash_w] = Zplayer,
+ [Xfake_acid_1] = Xfake_acid_1_player,
+ [Xfake_acid_2] = Xfake_acid_2_player,
+ [Xfake_acid_3] = Xfake_acid_3_player,
+ [Xfake_acid_4] = Xfake_acid_4_player,
+ [Xfake_acid_5] = Xfake_acid_5_player,
+ [Xfake_acid_6] = Xfake_acid_6_player,
+ [Xfake_acid_7] = Xfake_acid_7_player,
+ [Xfake_acid_8] = Xfake_acid_8_player
+};
+
+static const byte remove_player[GAME_TILE_MAX] =
+{
+ [Zplayer] = Xblank,
+ [Xfake_acid_1_player] = Xfake_acid_1,
+ [Xfake_acid_2_player] = Xfake_acid_2,
+ [Xfake_acid_3_player] = Xfake_acid_3,
+ [Xfake_acid_4_player] = Xfake_acid_4,
+ [Xfake_acid_5_player] = Xfake_acid_5,
+ [Xfake_acid_6_player] = Xfake_acid_6,
+ [Xfake_acid_7_player] = Xfake_acid_7,
+ [Xfake_acid_8_player] = Xfake_acid_8
+};
+
static const byte is_amoeba[GAME_TILE_MAX] =
{
[Xfake_amoeba] = 1,
case Xfake_acid_6:
case Xfake_acid_7:
case Xfake_acid_8:
+ case Xfake_acid_1_player:
+ case Xfake_acid_2_player:
+ case Xfake_acid_3_player:
+ case Xfake_acid_4_player:
+ case Xfake_acid_5_player:
+ case Xfake_acid_6_player:
+ case Xfake_acid_7_player:
+ case Xfake_acid_8_player:
case Xdynamite_1:
case Xdynamite_2:
case Xdynamite_3:
case Xblank:
case Xsplash_e:
case Xsplash_w:
- cave[x][y] = Zplayer;
- next[x][y] = Zplayer;
- // FALL THROUGH
-
case Xfake_acid_1:
case Xfake_acid_2:
case Xfake_acid_3:
case Xfake_acid_6:
case Xfake_acid_7:
case Xfake_acid_8:
+ cave[x][y] = add_player[element];
+ next[x][y] = add_player[element];
+
play_element_sound(x, y, SOUND_blank, Xblank);
ply->anim = PLY_walk_n + anim;
ply->x = x;
if (!is_blank[cave[x+dx][y+dy]])
break;
- if (!is_fake_acid[cave[x+dx][y+dy]])
- {
- cave[x+dx][y+dy] = Zplayer;
- next[x+dx][y+dy] = Zplayer;
- }
+ int element_next = cave[x+dx][y+dy];
+
+ cave[x+dx][y+dy] = add_player[element_next];
+ next[x+dx][y+dy] = add_player[element_next];
play_element_sound(x, y, SOUND_door, element);
ply->anim = PLY_walk_n + anim;
android_move:
if (lev.android_move_cnt == 0)
{
- if (cave[x-1][y-1] == Zplayer ||
- cave[x][y-1] == Zplayer ||
- cave[x+1][y-1] == Zplayer ||
- cave[x-1][y] == Zplayer ||
- cave[x+1][y] == Zplayer ||
- cave[x-1][y+1] == Zplayer ||
- cave[x][y+1] == Zplayer ||
- cave[x+1][y+1] == Zplayer)
+ if (is_player[cave[x-1][y-1]] ||
+ is_player[cave[x][y-1]] ||
+ is_player[cave[x+1][y-1]] ||
+ is_player[cave[x-1][y]] ||
+ is_player[cave[x+1][y]] ||
+ is_player[cave[x-1][y+1]] ||
+ is_player[cave[x][y+1]] ||
+ is_player[cave[x+1][y+1]])
goto android_still;
set_nearest_player_xy(x, y, &dx, &dy);
case Xfake_acid_6:
case Xfake_acid_7:
case Xfake_acid_8:
+ case Xfake_acid_1_player:
+ case Xfake_acid_2_player:
+ case Xfake_acid_3_player:
+ case Xfake_acid_4_player:
+ case Xfake_acid_5_player:
+ case Xfake_acid_6_player:
+ case Xfake_acid_7_player:
+ case Xfake_acid_8_player:
case Xplant:
case Yplant:
cave[x][y] = Yeater_nB;
case Xfake_acid_6:
case Xfake_acid_7:
case Xfake_acid_8:
+ case Xfake_acid_1_player:
+ case Xfake_acid_2_player:
+ case Xfake_acid_3_player:
+ case Xfake_acid_4_player:
+ case Xfake_acid_5_player:
+ case Xfake_acid_6_player:
+ case Xfake_acid_7_player:
+ case Xfake_acid_8_player:
case Xplant:
case Yplant:
cave[x][y] = Yeater_eB;
case Xfake_acid_6:
case Xfake_acid_7:
case Xfake_acid_8:
+ case Xfake_acid_1_player:
+ case Xfake_acid_2_player:
+ case Xfake_acid_3_player:
+ case Xfake_acid_4_player:
+ case Xfake_acid_5_player:
+ case Xfake_acid_6_player:
+ case Xfake_acid_7_player:
+ case Xfake_acid_8_player:
case Xplant:
case Yplant:
cave[x][y] = Yeater_sB;
case Xfake_acid_6:
case Xfake_acid_7:
case Xfake_acid_8:
+ case Xfake_acid_1_player:
+ case Xfake_acid_2_player:
+ case Xfake_acid_3_player:
+ case Xfake_acid_4_player:
+ case Xfake_acid_5_player:
+ case Xfake_acid_6_player:
+ case Xfake_acid_7_player:
+ case Xfake_acid_8_player:
case Xplant:
case Yplant:
cave[x][y] = Yeater_wB;
case Xfake_acid_6:
case Xfake_acid_7:
case Xfake_acid_8:
+ case Xfake_acid_1_player:
+ case Xfake_acid_2_player:
+ case Xfake_acid_3_player:
+ case Xfake_acid_4_player:
+ case Xfake_acid_5_player:
+ case Xfake_acid_6_player:
+ case Xfake_acid_7_player:
+ case Xfake_acid_8_player:
case Xplant:
case Yplant:
cave[x][y] = Yalien_nB;
case Xfake_acid_6:
case Xfake_acid_7:
case Xfake_acid_8:
+ case Xfake_acid_1_player:
+ case Xfake_acid_2_player:
+ case Xfake_acid_3_player:
+ case Xfake_acid_4_player:
+ case Xfake_acid_5_player:
+ case Xfake_acid_6_player:
+ case Xfake_acid_7_player:
+ case Xfake_acid_8_player:
case Xplant:
case Yplant:
cave[x][y] = Yalien_sB;
case Xfake_acid_6:
case Xfake_acid_7:
case Xfake_acid_8:
+ case Xfake_acid_1_player:
+ case Xfake_acid_2_player:
+ case Xfake_acid_3_player:
+ case Xfake_acid_4_player:
+ case Xfake_acid_5_player:
+ case Xfake_acid_6_player:
+ case Xfake_acid_7_player:
+ case Xfake_acid_8_player:
case Xplant:
case Yplant:
cave[x][y] = Yalien_eB;
case Xfake_acid_6:
case Xfake_acid_7:
case Xfake_acid_8:
+ case Xfake_acid_1_player:
+ case Xfake_acid_2_player:
+ case Xfake_acid_3_player:
+ case Xfake_acid_4_player:
+ case Xfake_acid_5_player:
+ case Xfake_acid_6_player:
+ case Xfake_acid_7_player:
+ case Xfake_acid_8_player:
case Xplant:
case Yplant:
cave[x][y] = Yalien_wB;
case Xfake_acid_6:
case Xfake_acid_7:
case Xfake_acid_8:
+ case Xfake_acid_1_player:
+ case Xfake_acid_2_player:
+ case Xfake_acid_3_player:
+ case Xfake_acid_4_player:
+ case Xfake_acid_5_player:
+ case Xfake_acid_6_player:
+ case Xfake_acid_7_player:
+ case Xfake_acid_8_player:
case Xplant:
case Yplant:
cave[x][y] = Ybug_nB;
case Xfake_acid_6:
case Xfake_acid_7:
case Xfake_acid_8:
+ case Xfake_acid_1_player:
+ case Xfake_acid_2_player:
+ case Xfake_acid_3_player:
+ case Xfake_acid_4_player:
+ case Xfake_acid_5_player:
+ case Xfake_acid_6_player:
+ case Xfake_acid_7_player:
+ case Xfake_acid_8_player:
case Xplant:
case Yplant:
case Xacid_1:
case Xfake_acid_6:
case Xfake_acid_7:
case Xfake_acid_8:
+ case Xfake_acid_1_player:
+ case Xfake_acid_2_player:
+ case Xfake_acid_3_player:
+ case Xfake_acid_4_player:
+ case Xfake_acid_5_player:
+ case Xfake_acid_6_player:
+ case Xfake_acid_7_player:
+ case Xfake_acid_8_player:
case Xplant:
case Yplant:
cave[x][y] = Ybug_eB;
case Xfake_acid_6:
case Xfake_acid_7:
case Xfake_acid_8:
+ case Xfake_acid_1_player:
+ case Xfake_acid_2_player:
+ case Xfake_acid_3_player:
+ case Xfake_acid_4_player:
+ case Xfake_acid_5_player:
+ case Xfake_acid_6_player:
+ case Xfake_acid_7_player:
+ case Xfake_acid_8_player:
case Xplant:
case Yplant:
case Xacid_1:
case Xfake_acid_6:
case Xfake_acid_7:
case Xfake_acid_8:
+ case Xfake_acid_1_player:
+ case Xfake_acid_2_player:
+ case Xfake_acid_3_player:
+ case Xfake_acid_4_player:
+ case Xfake_acid_5_player:
+ case Xfake_acid_6_player:
+ case Xfake_acid_7_player:
+ case Xfake_acid_8_player:
case Xplant:
case Yplant:
cave[x][y] = Ybug_sB;
case Xfake_acid_6:
case Xfake_acid_7:
case Xfake_acid_8:
+ case Xfake_acid_1_player:
+ case Xfake_acid_2_player:
+ case Xfake_acid_3_player:
+ case Xfake_acid_4_player:
+ case Xfake_acid_5_player:
+ case Xfake_acid_6_player:
+ case Xfake_acid_7_player:
+ case Xfake_acid_8_player:
case Xplant:
case Yplant:
case Xacid_1:
case Xfake_acid_6:
case Xfake_acid_7:
case Xfake_acid_8:
+ case Xfake_acid_1_player:
+ case Xfake_acid_2_player:
+ case Xfake_acid_3_player:
+ case Xfake_acid_4_player:
+ case Xfake_acid_5_player:
+ case Xfake_acid_6_player:
+ case Xfake_acid_7_player:
+ case Xfake_acid_8_player:
case Xplant:
case Yplant:
cave[x][y] = Ybug_wB;
case Xfake_acid_6:
case Xfake_acid_7:
case Xfake_acid_8:
+ case Xfake_acid_1_player:
+ case Xfake_acid_2_player:
+ case Xfake_acid_3_player:
+ case Xfake_acid_4_player:
+ case Xfake_acid_5_player:
+ case Xfake_acid_6_player:
+ case Xfake_acid_7_player:
+ case Xfake_acid_8_player:
case Xplant:
case Yplant:
case Xacid_1:
case Xfake_acid_6:
case Xfake_acid_7:
case Xfake_acid_8:
+ case Xfake_acid_1_player:
+ case Xfake_acid_2_player:
+ case Xfake_acid_3_player:
+ case Xfake_acid_4_player:
+ case Xfake_acid_5_player:
+ case Xfake_acid_6_player:
+ case Xfake_acid_7_player:
+ case Xfake_acid_8_player:
case Xplant:
case Yplant:
cave[x][y] = Ytank_nB;
case Xfake_acid_6:
case Xfake_acid_7:
case Xfake_acid_8:
+ case Xfake_acid_1_player:
+ case Xfake_acid_2_player:
+ case Xfake_acid_3_player:
+ case Xfake_acid_4_player:
+ case Xfake_acid_5_player:
+ case Xfake_acid_6_player:
+ case Xfake_acid_7_player:
+ case Xfake_acid_8_player:
case Xplant:
case Yplant:
case Xacid_1:
case Xfake_acid_6:
case Xfake_acid_7:
case Xfake_acid_8:
+ case Xfake_acid_1_player:
+ case Xfake_acid_2_player:
+ case Xfake_acid_3_player:
+ case Xfake_acid_4_player:
+ case Xfake_acid_5_player:
+ case Xfake_acid_6_player:
+ case Xfake_acid_7_player:
+ case Xfake_acid_8_player:
case Xplant:
case Yplant:
cave[x][y] = Ytank_eB;
case Xfake_acid_6:
case Xfake_acid_7:
case Xfake_acid_8:
+ case Xfake_acid_1_player:
+ case Xfake_acid_2_player:
+ case Xfake_acid_3_player:
+ case Xfake_acid_4_player:
+ case Xfake_acid_5_player:
+ case Xfake_acid_6_player:
+ case Xfake_acid_7_player:
+ case Xfake_acid_8_player:
case Xplant:
case Yplant:
case Xacid_1:
case Xfake_acid_6:
case Xfake_acid_7:
case Xfake_acid_8:
+ case Xfake_acid_1_player:
+ case Xfake_acid_2_player:
+ case Xfake_acid_3_player:
+ case Xfake_acid_4_player:
+ case Xfake_acid_5_player:
+ case Xfake_acid_6_player:
+ case Xfake_acid_7_player:
+ case Xfake_acid_8_player:
case Xplant:
case Yplant:
cave[x][y] = Ytank_sB;
case Xfake_acid_6:
case Xfake_acid_7:
case Xfake_acid_8:
+ case Xfake_acid_1_player:
+ case Xfake_acid_2_player:
+ case Xfake_acid_3_player:
+ case Xfake_acid_4_player:
+ case Xfake_acid_5_player:
+ case Xfake_acid_6_player:
+ case Xfake_acid_7_player:
+ case Xfake_acid_8_player:
case Xplant:
case Yplant:
case Xacid_1:
case Xfake_acid_6:
case Xfake_acid_7:
case Xfake_acid_8:
+ case Xfake_acid_1_player:
+ case Xfake_acid_2_player:
+ case Xfake_acid_3_player:
+ case Xfake_acid_4_player:
+ case Xfake_acid_5_player:
+ case Xfake_acid_6_player:
+ case Xfake_acid_7_player:
+ case Xfake_acid_8_player:
case Xplant:
case Yplant:
cave[x][y] = Ytank_wB;
case Xfake_acid_6:
case Xfake_acid_7:
case Xfake_acid_8:
+ case Xfake_acid_1_player:
+ case Xfake_acid_2_player:
+ case Xfake_acid_3_player:
+ case Xfake_acid_4_player:
+ case Xfake_acid_5_player:
+ case Xfake_acid_6_player:
+ case Xfake_acid_7_player:
+ case Xfake_acid_8_player:
case Xplant:
case Yplant:
case Xacid_1:
case Xfake_acid_6:
case Xfake_acid_7:
case Xfake_acid_8:
+ case Xfake_acid_1_player:
+ case Xfake_acid_2_player:
+ case Xfake_acid_3_player:
+ case Xfake_acid_4_player:
+ case Xfake_acid_5_player:
+ case Xfake_acid_6_player:
+ case Xfake_acid_7_player:
+ case Xfake_acid_8_player:
cave[x][y] = Yemerald_sB;
next[x][y] = Xblank;
cave[x][y+1] = Yemerald_s;
case Xfake_acid_6:
case Xfake_acid_7:
case Xfake_acid_8:
+ case Xfake_acid_1_player:
+ case Xfake_acid_2_player:
+ case Xfake_acid_3_player:
+ case Xfake_acid_4_player:
+ case Xfake_acid_5_player:
+ case Xfake_acid_6_player:
+ case Xfake_acid_7_player:
+ case Xfake_acid_8_player:
cave[x][y] = Ydiamond_sB;
next[x][y] = Xblank;
cave[x][y+1] = Ydiamond_s;
case Xfake_acid_6:
case Xfake_acid_7:
case Xfake_acid_8:
+ case Xfake_acid_1_player:
+ case Xfake_acid_2_player:
+ case Xfake_acid_3_player:
+ case Xfake_acid_4_player:
+ case Xfake_acid_5_player:
+ case Xfake_acid_6_player:
+ case Xfake_acid_7_player:
+ case Xfake_acid_8_player:
cave[x][y] = Ystone_sB;
next[x][y] = Xblank;
cave[x][y+1] = Ystone_s;
case Xfake_acid_6:
case Xfake_acid_7:
case Xfake_acid_8:
+ case Xfake_acid_1_player:
+ case Xfake_acid_2_player:
+ case Xfake_acid_3_player:
+ case Xfake_acid_4_player:
+ case Xfake_acid_5_player:
+ case Xfake_acid_6_player:
+ case Xfake_acid_7_player:
+ case Xfake_acid_8_player:
case Xplant:
case Yplant:
case Xacid_1:
case Xfake_acid_6:
case Xfake_acid_7:
case Xfake_acid_8:
+ case Xfake_acid_1_player:
+ case Xfake_acid_2_player:
+ case Xfake_acid_3_player:
+ case Xfake_acid_4_player:
+ case Xfake_acid_5_player:
+ case Xfake_acid_6_player:
+ case Xfake_acid_7_player:
+ case Xfake_acid_8_player:
cave[x][y] = Ynut_sB;
next[x][y] = Xblank;
cave[x][y+1] = Ynut_s;
case Xfake_acid_6:
case Xfake_acid_7:
case Xfake_acid_8:
+ case Xfake_acid_1_player:
+ case Xfake_acid_2_player:
+ case Xfake_acid_3_player:
+ case Xfake_acid_4_player:
+ case Xfake_acid_5_player:
+ case Xfake_acid_6_player:
+ case Xfake_acid_7_player:
+ case Xfake_acid_8_player:
cave[x][y] = Yspring_sB;
next[x][y] = Xblank;
cave[x][y+1] = Yspring_s;
case Xfake_acid_6:
case Xfake_acid_7:
case Xfake_acid_8:
+ case Xfake_acid_1_player:
+ case Xfake_acid_2_player:
+ case Xfake_acid_3_player:
+ case Xfake_acid_4_player:
+ case Xfake_acid_5_player:
+ case Xfake_acid_6_player:
+ case Xfake_acid_7_player:
+ case Xfake_acid_8_player:
case Xplant:
case Yplant:
cave[x][y] = Ydrip_1_sB;
if (!ply[i].alive)
continue;
- if (cave[ply[i].prev_x][ply[i].prev_y] == Zplayer)
+ if (is_player[cave[ply[i].prev_x][ply[i].prev_y]])
{
- cave[ply[i].prev_x][ply[i].prev_y] = Xblank;
- next[ply[i].prev_x][ply[i].prev_y] = Xblank;
+ int element = cave[ply[i].prev_x][ply[i].prev_y];
+
+ cave[ply[i].prev_x][ply[i].prev_y] = remove_player[element];
+ next[ply[i].prev_x][ply[i].prev_y] = remove_player[element];
}
- if (cave[ply[i].x][ply[i].y] == Xblank)
+ if (is_blank[cave[ply[i].x][ply[i].y]])
{
- cave[ply[i].x][ply[i].y] = Zplayer;
- next[ply[i].x][ply[i].y] = Zplayer;
+ int element = cave[ply[i].x][ply[i].y];
+
+ cave[ply[i].x][ply[i].y] = add_player[element];
+ next[ply[i].x][ply[i].y] = add_player[element];
}
}
}