#define SPRING_ROLL /* spring rolling off round things continues to roll */
#define ACID_ROLL /* rolling objects go into acid rather than remove it */
-
-#define USE_CHANGED_ACID_STUFF
+#define ACID_PLAYER /* player gets killed by acid, but without explosion */
#define RANDOM_RAW (seed = seed << 31 | seed >> 1)
#define RANDOM(x) (RANDOM_RAW & (x - 1))
static unsigned int seed;
static int score;
-static const byte is_blank[TILE_MAX] =
+static const byte is_blank[GAME_TILE_MAX] =
{
[Xblank] = 1,
[Xsplash_e] = 1,
[Xfake_acid_8] = 1
};
-static const byte is_blank_or_acid[TILE_MAX] =
+static const byte is_blank_or_acid[GAME_TILE_MAX] =
{
[Xblank] = 1,
[Xsplash_e] = 1,
[Xacid_8] = 1
};
-static const byte is_fake_acid[TILE_MAX] =
+static const byte is_fake_acid[GAME_TILE_MAX] =
{
[Xfake_acid_1] = 1,
[Xfake_acid_2] = 1,
[Xfake_acid_8] = 1
};
-static const byte is_amoeba[TILE_MAX] =
+static const byte is_amoeba[GAME_TILE_MAX] =
{
[Xfake_amoeba] = 1,
[Yfake_amoeba] = 1,
[Xamoeba_8] = 1
};
-static const byte is_android_walkable[TILE_MAX] =
+static const byte is_android_walkable[GAME_TILE_MAX] =
{
[Xblank] = 1,
[Xsplash_e] = 1,
int x = ply->x;
int y = ply->y;
- ply->alive = 0;
+ ply->alive = FALSE;
switch (cave[x][y-1])
{
switch (cave[x][y])
{
-#ifdef USE_CHANGED_ACID_STUFF
+#ifdef ACID_PLAYER
case Xacid_1:
case Xacid_2:
case Xacid_3:
if (dx && dy && ply->joy_snap) /* more than one direction specified */
return FALSE;
- if (ply->joy_snap == 0) /* player wants to move */
+ if (!ply->joy_snap) /* player wants to move */
{
int element = cave[x][y];
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:
ply->y = y;
break;
-#ifdef USE_CHANGED_ACID_STUFF
case Xacid_1:
case Xacid_2:
case Xacid_3:
case Xacid_6:
case Xacid_7:
case Xacid_8:
+#ifdef ACID_PLAYER
if (cave[x+1][y-1] == Xblank)
cave[x+1][y-1] = Xsplash_e;
if (cave[x-1][y-1] == Xblank)
cave[x-1][y-1] = Xsplash_w;
play_element_sound(x, y, SOUND_acid, Xacid_1);
+ // FALL THROUGH
#endif
-
case Xboom_android:
case Xboom_1:
case Xbug_1_n:
case Xtank_2_e:
case Xtank_2_s:
case Xtank_2_w:
-
-#ifndef USE_CHANGED_ACID_STUFF
- case Xacid_1:
- case Xacid_2:
- case Xacid_3:
- case Xacid_4:
- case Xacid_5:
- case Xacid_6:
- case Xacid_7:
- case Xacid_8:
-#endif
ply->anim = PLY_walk_n + anim;
ply->x = x;
ply->y = y;
case Xswitch:
play_element_sound(x, y, SOUND_press, element);
lev.ball_cnt = lev.ball_time;
- lev.ball_state = !lev.ball_state;
+ lev.ball_active = !lev.ball_active;
break;
case Xplant:
if (!can_move)
{
- ply->joy_n = ply->joy_e = ply->joy_s = ply->joy_w = 0;
+ ply->joy_n = FALSE;
+ ply->joy_e = FALSE;
+ ply->joy_s = FALSE;
+ ply->joy_w = FALSE;
return;
}
if (dx == 0 && dy == 0)
{
- ply->joy_stick = 0;
+ ply->joy_stick = FALSE;
if (ply->joy_drop)
{
return;
}
- ply->joy_stick = 1;
- ply->joy_n = ply->joy_e = ply->joy_s = ply->joy_w = 0;
+ ply->joy_stick = TRUE;
+ ply->joy_n = FALSE;
+ ply->joy_e = FALSE;
+ ply->joy_s = FALSE;
+ ply->joy_w = FALSE;
+
ply->dynamite_cnt = 0; /* reset dynamite timer if we move */
- ply->joy_spin = !ply->joy_spin;
- if (ply->joy_snap == 0) /* player wants to move */
+ if (!ply->joy_snap) /* player wants to move */
{
boolean moved = FALSE;
return;
case Xwonderwall:
- if (lev.wonderwall_time)
+ if (lev.wonderwall_time > 0)
{
- lev.wonderwall_state = 1;
+ lev.wonderwall_active = TRUE;
cave[x][y] = Yemerald_sB;
next[x][y] = Xblank;
if (is_blank[cave[x][y+2]])
return;
case Xwonderwall:
- if (lev.wonderwall_time)
+ if (lev.wonderwall_time > 0)
{
- lev.wonderwall_state = 1;
+ lev.wonderwall_active = TRUE;
cave[x][y] = Ydiamond_sB;
next[x][y] = Xblank;
if (is_blank[cave[x][y+2]])
return;
case Xwonderwall:
- if (lev.wonderwall_time)
+ if (lev.wonderwall_time > 0)
{
- lev.wonderwall_state = 1;
+ lev.wonderwall_active = TRUE;
cave[x][y] = Ystone_sB;
next[x][y] = Xblank;
if (is_blank[cave[x][y+2]])
static void Lball_1(int x, int y)
{
- if (lev.ball_state == 0)
+ if (!lev.ball_active)
return;
cave[x][y] = Yball_1;
static void Lball_2(int x, int y)
{
- if (lev.ball_state == 0)
+ if (!lev.ball_active)
return;
cave[x][y] = Yball_2;
static void Lwonderwall(int x, int y)
{
- if (lev.wonderwall_time && lev.wonderwall_state)
+ if (lev.wonderwall_time > 0 && lev.wonderwall_active)
{
cave[x][y] = Ywonderwall;
play_element_sound(x, y, SOUND_wonder, Xwonderwall);
static void Lswitch(int x, int y)
{
- if (lev.ball_state)
+ if (lev.ball_active)
cave[x][y] = Yswitch;
}
for (i = 0; i < MAX_PLAYERS; i++)
{
+ if (!ply[i].alive)
+ continue;
+
/* check for wrap-around movement */
if (ply[i].x < lev.left ||
ply[i].x > lev.right - 1)
game.centered_player_nr_next = i;
game.set_centered_player = TRUE;
- game.set_centered_player_fast = TRUE;
+ game.set_centered_player_wrap = TRUE;
}
- ply[i].oldx = ply[i].x;
- ply[i].oldy = ply[i].y;
+ ply[i].prev_x = ply[i].x;
+ ply[i].prev_y = ply[i].y;
ply[i].anim = PLY_still;
}
if (!ply[i].alive)
continue;
- if (cave[ply[i].oldx][ply[i].oldy] == Zplayer)
+ if (cave[ply[i].prev_x][ply[i].prev_y] == Zplayer)
{
- cave[ply[i].oldx][ply[i].oldy] = Xblank;
- next[ply[i].oldx][ply[i].oldy] = Xblank;
+ cave[ply[i].prev_x][ply[i].prev_y] = Xblank;
+ next[ply[i].prev_x][ply[i].prev_y] = Xblank;
}
if (cave[ply[i].x][ply[i].y] == Xblank)
lev.android_move_cnt = lev.android_move_time;
if (lev.android_clone_cnt-- == 0)
lev.android_clone_cnt = lev.android_clone_time;
- if (lev.ball_state)
+ if (lev.ball_active)
if (lev.ball_cnt-- == 0)
lev.ball_cnt = lev.ball_time;
if (lev.lenses_cnt)
lev.wheel_cnt--;
if (lev.wind_cnt)
lev.wind_cnt--;
- if (lev.wonderwall_time && lev.wonderwall_state)
+ if (lev.wonderwall_time > 0 && lev.wonderwall_active)
lev.wonderwall_time--;
if (lev.wheel_cnt)