* compilers suck.
*/
-#include "display.h"
-#include "tile.h"
-#include "level.h"
-#include "sample.h"
+#include "main_em.h"
#define RANDOM (random = random << 31 | random >> 1)
-#define PLAY(sample) { if ((unsigned int)(y - top) <= 12 && (unsigned int)(x - left) <= 20) play[sample] = 1; }
-extern unsigned int screen_x;
-extern unsigned int screen_y;
+static void set_nearest_player_xy(int x, int y, int *dx, int *dy)
+{
+ int distance, distance_shortest = EM_MAX_CAVE_WIDTH + EM_MAX_CAVE_HEIGHT;
+ int i;
+
+ /* default values if no players are alive anymore */
+ *dx = 0;
+ *dy = 0;
+
+ for (i = 0; i < MAX_PLAYERS; i++)
+ {
+ if (!ply[i].alive)
+ continue;
+
+ distance = ABS(ply[i].x - x) + ABS(ply[i].y - y);
+
+ if (distance < distance_shortest)
+ {
+ *dx = ply[i].x;
+ *dy = ply[i].y;
+
+ distance_shortest = distance;
+ }
+ }
+}
void synchro_2(void)
{
- register unsigned int x = 0;
- register unsigned int y = 1;
- register unsigned long random = Random;
- register unsigned short *cave_cache = Cave[y]; /* might be a win */
- unsigned long score = 0;
-
- unsigned int temp = 0; /* initialized to make compilers happy */
- unsigned int left = screen_x / TILEX; /* only needed for sounds */
- unsigned int top = screen_y / TILEY;
- unsigned int dx; /* only needed to find closest player */
- unsigned int dy;
+ int x = 0;
+ int y = 1;
+ unsigned long random = RandomEM;
+ short *cave_cache = Cave[y]; /* might be a win */
+ int score = 0;
+
+ int temp = 0; /* initialized to make compilers happy */
+ int dx; /* only needed to find closest player */
+ int dy;
+ int element;
loop:
- switch (cave_cache[++x])
+ element = cave_cache[++x];
+
+ switch (element)
{
default:
goto loop;
if (Cave[y][x-1] == Xblank)
Cave[y][x-1] = Yacid_splash_wB;
Next[y][x] = Xblank;
- PLAY(SAMPLE_acid);
+ play_element_sound(x, y, SAMPLE_acid, Xacid_1);
goto loop;
case Xblank:
case Yacid_splash_wB:
case Xplant:
case Yplant:
+#if 1
+ 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:
+#endif
Cave[y][x] = Ystone_sB;
Cave[y+1][x] = Ystone_s;
Next[y][x] = Xblank;
if (Cave[y][x-1] == Xblank)
Cave[y][x-1] = Yacid_splash_wB;
Next[y][x] = Xblank;
- PLAY(SAMPLE_acid);
+ play_element_sound(x, y, SAMPLE_acid, Xacid_1);
goto loop;
case Xblank:
case Yacid_splash_eB:
case Yacid_splash_wB:
+#if 1
+ 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:
+#endif
Cave[y][x] = Ystone_sB;
Cave[y+1][x] = Ystone_s;
Next[y][x] = Xblank;
if (Cave[y][x-1] == Xblank)
Cave[y][x-1] = Yacid_splash_wB;
Next[y][x] = Xblank;
- PLAY(SAMPLE_acid);
+ play_element_sound(x, y, SAMPLE_acid, Xacid_1);
goto loop;
case Xblank:
case Yacid_splash_eB:
case Yacid_splash_wB:
case Zplayer:
+#if 1
+ 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:
+#endif
Cave[y][x] = Ystone_sB;
Cave[y+1][x] = Ystone_s;
Next[y][x] = Xblank;
Cave[y+1][x] = Yemerald_stone;
Next[y][x] = Xstone;
Next[y+1][x] = Xemerald;
- play[SAMPLE_crack] = 1;
+ play_element_sound(x, y, SAMPLE_crack, Xnut);
score += lev.nut_score;
goto loop;
Boom[y+2][x-1] = Xemerald;
Boom[y+2][x] = Xemerald;
Boom[y+2][x+1] = Xemerald;
+#if PLAY_ELEMENT_SOUND
+ play_element_sound(x, y, SAMPLE_boom, element);
+#endif
score += lev.bug_score;
goto loop;
Boom[y+2][x-1] = Xblank;
Boom[y+2][x] = Xblank;
Boom[y+2][x+1] = Xblank;
+#if PLAY_ELEMENT_SOUND
+ play_element_sound(x, y, SAMPLE_boom, element);
+#endif
score += lev.tank_score;
goto loop;
Boom[y+2][x-1] = lev.eater_array[lev.eater_pos][6];
Boom[y+2][x] = lev.eater_array[lev.eater_pos][7];
Boom[y+2][x+1] = lev.eater_array[lev.eater_pos][8];
+#if PLAY_ELEMENT_SOUND
+ play_element_sound(x, y, SAMPLE_boom, element);
+#endif
lev.eater_pos = (lev.eater_pos + 1) & 7;
score += lev.eater_score;
goto loop;
Boom[y+2][x-1] = Xblank;
Boom[y+2][x] = Xblank;
Boom[y+2][x+1] = Xblank;
+#if PLAY_ELEMENT_SOUND
+ play_element_sound(x, y, SAMPLE_boom, element);
+#endif
score += lev.alien_score;
goto loop;
case Xplant:
case Yplant:
Next[y][x] = Xstone;
- PLAY(SAMPLE_stone);
+ play_element_sound(x, y, SAMPLE_stone, Xstone);
goto loop;
}
Cave[y+1][x] = Ydiamond_stone;
Next[y][x] = Xblank;
Next[y+1][x] = Xstone_pause;
- play[SAMPLE_squash] = 1;
+ play_element_sound(x, y, SAMPLE_squash, Xdiamond);
goto loop;
case Xbomb:
Boom[y+2][x-1] = Xblank;
Boom[y+2][x] = Xblank;
Boom[y+2][x+1] = Xblank;
+#if PLAY_ELEMENT_SOUND
+ play_element_sound(x, y, SAMPLE_boom, element);
+#endif
goto loop;
case Xwonderwall:
}
Next[y][x] = Xblank;
- play[SAMPLE_squash] = 1;
+ play_element_sound(x, y, SAMPLE_wonderfall, Xwonderwall);
goto loop;
}
default:
Cave[y][x] = Xstone;
Next[y][x] = Xstone;
- PLAY(SAMPLE_stone);
+ play_element_sound(x, y, SAMPLE_stone, Xstone);
goto loop;
}
if (Cave[y][x-1] == Xblank)
Cave[y][x-1] = Yacid_splash_wB;
Next[y][x] = Xblank;
- PLAY(SAMPLE_acid);
+ play_element_sound(x, y, SAMPLE_acid, Xacid_1);
goto loop;
case Xblank:
if (Cave[y][x-1] == Xblank)
Cave[y][x-1] = Yacid_splash_wB;
Next[y][x] = Xblank;
- PLAY(SAMPLE_acid);
+ play_element_sound(x, y, SAMPLE_acid, Xacid_1);
goto loop;
case Xblank:
if (Cave[y][x-1] == Xblank)
Cave[y][x-1] = Yacid_splash_wB;
Next[y][x] = Xblank;
- PLAY(SAMPLE_acid);
+ play_element_sound(x, y, SAMPLE_acid, Xacid_1);
goto loop;
case Xblank:
default:
Cave[y][x] = Xnut;
Next[y][x] = Xnut;
- PLAY(SAMPLE_nut);
+ play_element_sound(x, y, SAMPLE_nut, Xnut);
goto loop;
}
/* --------------------------------------------------------------------- */
case Xbug_n:
- if (tab_ameuba[Cave[y-1][x]] ||
- tab_ameuba[Cave[y][x+1]] ||
- tab_ameuba[Cave[y+1][x]] ||
- tab_ameuba[Cave[y][x-1]])
+ if (tab_amoeba[Cave[y-1][x]] ||
+ tab_amoeba[Cave[y][x+1]] ||
+ tab_amoeba[Cave[y+1][x]] ||
+ tab_amoeba[Cave[y][x-1]])
goto bug_boom;
switch (Cave[y][x+1])
case Zplayer:
Cave[y][x] = Ybug_n_e;
Next[y][x] = Xbug_goe;
- PLAY(SAMPLE_bug);
+ play_element_sound(x, y, SAMPLE_bug, element);
goto loop;
default:
}
case Xbug_gon:
- if (tab_ameuba[Cave[y-1][x]] ||
- tab_ameuba[Cave[y][x+1]] ||
- tab_ameuba[Cave[y+1][x]] ||
- tab_ameuba[Cave[y][x-1]])
+ if (tab_amoeba[Cave[y-1][x]] ||
+ tab_amoeba[Cave[y][x+1]] ||
+ tab_amoeba[Cave[y+1][x]] ||
+ tab_amoeba[Cave[y][x-1]])
goto bug_boom;
bug_gon:
if (Cave[y-2][x-1] == Xblank)
Cave[y-2][x-1] = Yacid_splash_wB;
Next[y][x] = Xblank;
- PLAY(SAMPLE_acid);
+ play_element_sound(x, y, SAMPLE_acid, Xacid_1);
goto loop;
case Xblank:
Cave[y-1][x] = Ybug_n;
Next[y][x] = Xblank;
Next[y-1][x] = Xbug_n;
- PLAY(SAMPLE_bug);
+ play_element_sound(x, y, SAMPLE_bug, element);
goto loop;
default:
Cave[y][x] = Ybug_n_w;
Next[y][x] = Xbug_gow;
- PLAY(SAMPLE_bug);
+ play_element_sound(x, y, SAMPLE_bug, element);
goto loop;
}
/* --------------------------------------------------------------------- */
case Xbug_e:
- if (tab_ameuba[Cave[y-1][x]] ||
- tab_ameuba[Cave[y][x+1]] ||
- tab_ameuba[Cave[y+1][x]] ||
- tab_ameuba[Cave[y][x-1]])
+ if (tab_amoeba[Cave[y-1][x]] ||
+ tab_amoeba[Cave[y][x+1]] ||
+ tab_amoeba[Cave[y+1][x]] ||
+ tab_amoeba[Cave[y][x-1]])
goto bug_boom;
switch (Cave[y+1][x])
case Zplayer:
Cave[y][x] = Ybug_e_s;
Next[y][x] = Xbug_gos;
- PLAY(SAMPLE_bug);
+ play_element_sound(x, y, SAMPLE_bug, element);
goto loop;
default:
}
case Xbug_goe:
- if (tab_ameuba[Cave[y-1][x]] ||
- tab_ameuba[Cave[y][x+1]] ||
- tab_ameuba[Cave[y+1][x]] ||
- tab_ameuba[Cave[y][x-1]])
+ if (tab_amoeba[Cave[y-1][x]] ||
+ tab_amoeba[Cave[y][x+1]] ||
+ tab_amoeba[Cave[y+1][x]] ||
+ tab_amoeba[Cave[y][x-1]])
goto bug_boom;
bug_goe:
if (Cave[y-1][x] == Xblank)
Cave[y-1][x] = Yacid_splash_wB;
Next[y][x] = Xblank;
- PLAY(SAMPLE_acid);
+ play_element_sound(x, y, SAMPLE_acid, Xacid_1);
goto loop;
case Xblank:
Cave[y][x+1] = Ybug_e;
Next[y][x] = Xblank;
Next[y][x+1] = Xbug_e;
- PLAY(SAMPLE_bug);
+ play_element_sound(x, y, SAMPLE_bug, element);
goto loop;
default:
Cave[y][x] = Ybug_e_n;
Next[y][x] = Xbug_gon;
- PLAY(SAMPLE_bug);
+ play_element_sound(x, y, SAMPLE_bug, element);
goto loop;
}
/* --------------------------------------------------------------------- */
case Xbug_s:
- if (tab_ameuba[Cave[y-1][x]] ||
- tab_ameuba[Cave[y][x+1]] ||
- tab_ameuba[Cave[y+1][x]] ||
- tab_ameuba[Cave[y][x-1]])
+ if (tab_amoeba[Cave[y-1][x]] ||
+ tab_amoeba[Cave[y][x+1]] ||
+ tab_amoeba[Cave[y+1][x]] ||
+ tab_amoeba[Cave[y][x-1]])
goto bug_boom;
switch (Cave[y][x-1])
case Zplayer:
Cave[y][x] = Ybug_s_w;
Next[y][x] = Xbug_gow;
- PLAY(SAMPLE_bug);
+ play_element_sound(x, y, SAMPLE_bug, element);
goto loop;
default:
}
case Xbug_gos:
- if (tab_ameuba[Cave[y-1][x]] ||
- tab_ameuba[Cave[y][x+1]] ||
- tab_ameuba[Cave[y+1][x]] ||
- tab_ameuba[Cave[y][x-1]])
+ if (tab_amoeba[Cave[y-1][x]] ||
+ tab_amoeba[Cave[y][x+1]] ||
+ tab_amoeba[Cave[y+1][x]] ||
+ tab_amoeba[Cave[y][x-1]])
goto bug_boom;
bug_gos:
if (Cave[y][x-1] == Xblank)
Cave[y][x-1] = Yacid_splash_wB;
Next[y][x] = Xblank;
- PLAY(SAMPLE_acid);
+ play_element_sound(x, y, SAMPLE_acid, Xacid_1);
goto loop;
case Xblank:
Cave[y+1][x] = Ybug_s;
Next[y][x] = Xblank;
Next[y+1][x] = Xbug_s;
- PLAY(SAMPLE_bug);
+ play_element_sound(x, y, SAMPLE_bug, element);
goto loop;
default:
Cave[y][x] = Ybug_s_e;
Next[y][x] = Xbug_goe;
- PLAY(SAMPLE_bug);
+ play_element_sound(x, y, SAMPLE_bug, element);
goto loop;
}
/* --------------------------------------------------------------------- */
case Xbug_w:
- if (tab_ameuba[Cave[y-1][x]] ||
- tab_ameuba[Cave[y][x+1]] ||
- tab_ameuba[Cave[y+1][x]] ||
- tab_ameuba[Cave[y][x-1]])
+ if (tab_amoeba[Cave[y-1][x]] ||
+ tab_amoeba[Cave[y][x+1]] ||
+ tab_amoeba[Cave[y+1][x]] ||
+ tab_amoeba[Cave[y][x-1]])
goto bug_boom;
switch (Cave[y-1][x])
case Zplayer:
Cave[y][x] = Ybug_w_n;
Next[y][x] = Xbug_gon;
- PLAY(SAMPLE_bug);
+ play_element_sound(x, y, SAMPLE_bug, element);
goto loop;
default:
}
case Xbug_gow:
- if (tab_ameuba[Cave[y-1][x]] ||
- tab_ameuba[Cave[y][x+1]] ||
- tab_ameuba[Cave[y+1][x]] ||
- tab_ameuba[Cave[y][x-1]])
+ if (tab_amoeba[Cave[y-1][x]] ||
+ tab_amoeba[Cave[y][x+1]] ||
+ tab_amoeba[Cave[y+1][x]] ||
+ tab_amoeba[Cave[y][x-1]])
goto bug_boom;
bug_gow:
if (Cave[y-1][x-2] == Xblank)
Cave[y-1][x-2] = Yacid_splash_wB;
Next[y][x] = Xblank;
- PLAY(SAMPLE_acid);
+ play_element_sound(x, y, SAMPLE_acid, Xacid_1);
goto loop;
case Xblank:
Cave[y][x-1] = Ybug_w;
Next[y][x] = Xblank;
Next[y][x-1] = Xbug_w;
- PLAY(SAMPLE_bug);
+ play_element_sound(x, y, SAMPLE_bug, element);
goto loop;
default:
Cave[y][x] = Ybug_w_s;
Next[y][x] = Xbug_gos;
- PLAY(SAMPLE_bug);
+ play_element_sound(x, y, SAMPLE_bug, element);
goto loop;
}
/* --------------------------------------------------------------------- */
case Xtank_n:
- if (tab_ameuba[Cave[y-1][x]] ||
- tab_ameuba[Cave[y][x+1]] ||
- tab_ameuba[Cave[y+1][x]] ||
- tab_ameuba[Cave[y][x-1]])
+ if (tab_amoeba[Cave[y-1][x]] ||
+ tab_amoeba[Cave[y][x+1]] ||
+ tab_amoeba[Cave[y+1][x]] ||
+ tab_amoeba[Cave[y][x-1]])
goto tank_boom;
switch (Cave[y][x-1])
case Zplayer:
Cave[y][x] = Ytank_n_w;
Next[y][x] = Xtank_gow;
- PLAY(SAMPLE_tank);
+ play_element_sound(x, y, SAMPLE_tank, element);
goto loop;
default:
}
case Xtank_gon:
- if (tab_ameuba[Cave[y-1][x]] ||
- tab_ameuba[Cave[y][x+1]] ||
- tab_ameuba[Cave[y+1][x]] ||
- tab_ameuba[Cave[y][x-1]])
+ if (tab_amoeba[Cave[y-1][x]] ||
+ tab_amoeba[Cave[y][x+1]] ||
+ tab_amoeba[Cave[y+1][x]] ||
+ tab_amoeba[Cave[y][x-1]])
goto tank_boom;
tank_gon:
if (Cave[y-2][x-1] == Xblank)
Cave[y-2][x-1] = Yacid_splash_wB;
Next[y][x] = Xblank;
- PLAY(SAMPLE_acid);
+ play_element_sound(x, y, SAMPLE_acid, Xacid_1);
goto loop;
case Xblank:
Cave[y-1][x] = Ytank_n;
Next[y][x] = Xblank;
Next[y-1][x] = Xtank_n;
- PLAY(SAMPLE_tank);
+ play_element_sound(x, y, SAMPLE_tank, element);
goto loop;
default:
Cave[y][x] = Ytank_n_e;
Next[y][x] = Xtank_goe;
- PLAY(SAMPLE_tank);
+ play_element_sound(x, y, SAMPLE_tank, element);
goto loop;
}
/* --------------------------------------------------------------------- */
case Xtank_e:
- if (tab_ameuba[Cave[y-1][x]] ||
- tab_ameuba[Cave[y][x+1]] ||
- tab_ameuba[Cave[y+1][x]] ||
- tab_ameuba[Cave[y][x-1]])
+ if (tab_amoeba[Cave[y-1][x]] ||
+ tab_amoeba[Cave[y][x+1]] ||
+ tab_amoeba[Cave[y+1][x]] ||
+ tab_amoeba[Cave[y][x-1]])
goto tank_boom;
switch (Cave[y-1][x])
case Zplayer:
Cave[y][x] = Ytank_e_n;
Next[y][x] = Xtank_gon;
- PLAY(SAMPLE_tank);
+ play_element_sound(x, y, SAMPLE_tank, element);
goto loop;
default:
}
case Xtank_goe:
- if (tab_ameuba[Cave[y-1][x]] ||
- tab_ameuba[Cave[y][x+1]] ||
- tab_ameuba[Cave[y+1][x]] ||
- tab_ameuba[Cave[y][x-1]])
+ if (tab_amoeba[Cave[y-1][x]] ||
+ tab_amoeba[Cave[y][x+1]] ||
+ tab_amoeba[Cave[y+1][x]] ||
+ tab_amoeba[Cave[y][x-1]])
goto tank_boom;
tank_goe:
if (Cave[y-1][x] == Xblank)
Cave[y-1][x] = Yacid_splash_wB;
Next[y][x] = Xblank;
- PLAY(SAMPLE_acid);
+ play_element_sound(x, y, SAMPLE_acid, Xacid_1);
goto loop;
case Xblank:
Cave[y][x+1] = Ytank_e;
Next[y][x] = Xblank;
Next[y][x+1] = Xtank_e;
- PLAY(SAMPLE_tank);
+ play_element_sound(x, y, SAMPLE_tank, element);
goto loop;
default:
Cave[y][x] = Ytank_e_s;
Next[y][x] = Xtank_gos;
- PLAY(SAMPLE_tank);
+ play_element_sound(x, y, SAMPLE_tank, element);
goto loop;
}
/* --------------------------------------------------------------------- */
case Xtank_s:
- if (tab_ameuba[Cave[y-1][x]] ||
- tab_ameuba[Cave[y][x+1]] ||
- tab_ameuba[Cave[y+1][x]] ||
- tab_ameuba[Cave[y][x-1]])
+ if (tab_amoeba[Cave[y-1][x]] ||
+ tab_amoeba[Cave[y][x+1]] ||
+ tab_amoeba[Cave[y+1][x]] ||
+ tab_amoeba[Cave[y][x-1]])
goto tank_boom;
switch (Cave[y][x+1])
case Zplayer:
Cave[y][x] = Ytank_s_e;
Next[y][x] = Xtank_goe;
- PLAY(SAMPLE_tank);
+ play_element_sound(x, y, SAMPLE_tank, element);
goto loop;
default:
}
case Xtank_gos:
- if (tab_ameuba[Cave[y-1][x]] ||
- tab_ameuba[Cave[y][x+1]] ||
- tab_ameuba[Cave[y+1][x]] ||
- tab_ameuba[Cave[y][x-1]])
+ if (tab_amoeba[Cave[y-1][x]] ||
+ tab_amoeba[Cave[y][x+1]] ||
+ tab_amoeba[Cave[y+1][x]] ||
+ tab_amoeba[Cave[y][x-1]])
goto tank_boom;
tank_gos:
if (Cave[y][x-1] == Xblank)
Cave[y][x-1] = Yacid_splash_wB;
Next[y][x] = Xblank;
- PLAY(SAMPLE_acid);
+ play_element_sound(x, y, SAMPLE_acid, Xacid_1);
goto loop;
case Xblank:
Cave[y+1][x] = Ytank_s;
Next[y][x] = Xblank;
Next[y+1][x] = Xtank_s;
- PLAY(SAMPLE_tank);
+ play_element_sound(x, y, SAMPLE_tank, element);
goto loop;
default:
Cave[y][x] = Ytank_s_w;
Next[y][x] = Xtank_gow;
- PLAY(SAMPLE_tank);
+ play_element_sound(x, y, SAMPLE_tank, element);
goto loop;
}
/* --------------------------------------------------------------------- */
case Xtank_w:
- if (tab_ameuba[Cave[y-1][x]] ||
- tab_ameuba[Cave[y][x+1]] ||
- tab_ameuba[Cave[y+1][x]] ||
- tab_ameuba[Cave[y][x-1]])
+ if (tab_amoeba[Cave[y-1][x]] ||
+ tab_amoeba[Cave[y][x+1]] ||
+ tab_amoeba[Cave[y+1][x]] ||
+ tab_amoeba[Cave[y][x-1]])
goto tank_boom;
switch (Cave[y+1][x])
case Zplayer:
Cave[y][x] = Ytank_w_s;
Next[y][x] = Xtank_gos;
- PLAY(SAMPLE_tank);
+ play_element_sound(x, y, SAMPLE_tank, element);
goto loop;
default:
}
case Xtank_gow:
- if (tab_ameuba[Cave[y-1][x]] ||
- tab_ameuba[Cave[y][x+1]] ||
- tab_ameuba[Cave[y+1][x]] ||
- tab_ameuba[Cave[y][x-1]])
+ if (tab_amoeba[Cave[y-1][x]] ||
+ tab_amoeba[Cave[y][x+1]] ||
+ tab_amoeba[Cave[y+1][x]] ||
+ tab_amoeba[Cave[y][x-1]])
goto tank_boom;
tank_gow:
if (Cave[y-1][x-2] == Xblank)
Cave[y-1][x-2] = Yacid_splash_wB;
Next[y][x] = Xblank;
- PLAY(SAMPLE_acid);
+ play_element_sound(x, y, SAMPLE_acid, Xacid_1);
goto loop;
case Xblank:
Cave[y][x-1] = Ytank_w;
Next[y][x] = Xblank;
Next[y][x-1] = Xtank_w;
- PLAY(SAMPLE_tank);
+ play_element_sound(x, y, SAMPLE_tank, element);
goto loop;
default:
Cave[y][x] = Ytank_w_n;
Next[y][x] = Xtank_gon;
- PLAY(SAMPLE_tank);
+ play_element_sound(x, y, SAMPLE_tank, element);
goto loop;
}
goto android_move;
}
- Next[y][x] = temp; /* the item we chose to clone */
- play[SAMPLE_android] = 1;
+ Next[y][x] = temp; /* the item we chose to clone */
+ play_element_sound(x, y, SAMPLE_android_clone, temp);
switch (RANDOM & 7)
{
Cave[y+1][x+1] == Zplayer)
goto android_still;
+#if 1
+
+ set_nearest_player_xy(x, y, &dx, &dy);
+
+#else
+
if (ply1.alive && ply2.alive)
{
if ((ply1.x > x ? ply1.x - x : x - ply1.x) +
dy = 0;
}
- Next[y][x] = Xblank; /* assume we will move */
+#endif
+
+ Next[y][x] = Xblank; /* assume we will move */
temp = ((x < dx) + 1 - (x > dx)) + ((y < dy) + 1 - (y > dy)) * 3;
if (RANDOM & 1)
Cave[y][x] = Yandroid_nB;
Cave[y-1][x] = Yandroid_n;
Next[y-1][x] = Xandroid;
- PLAY(SAMPLE_tank);
+ play_element_sound(x, y, SAMPLE_android_move, element);
goto loop;
android_ne:
Cave[y][x] = Yandroid_neB;
Cave[y-1][x+1] = Yandroid_ne;
Next[y-1][x+1] = Xandroid;
- PLAY(SAMPLE_tank);
+ play_element_sound(x, y, SAMPLE_android_move, element);
goto loop;
android_e:
Cave[y][x] = Yandroid_eB;
Cave[y][x+1] = Yandroid_e;
Next[y][x+1] = Xandroid;
- PLAY(SAMPLE_tank);
+ play_element_sound(x, y, SAMPLE_android_move, element);
goto loop;
android_se:
Cave[y][x] = Yandroid_seB;
Cave[y+1][x+1] = Yandroid_se;
Next[y+1][x+1] = Xandroid;
- PLAY(SAMPLE_tank);
+ play_element_sound(x, y, SAMPLE_android_move, element);
goto loop;
android_s:
Cave[y][x] = Yandroid_sB;
Cave[y+1][x] = Yandroid_s;
Next[y+1][x] = Xandroid;
- PLAY(SAMPLE_tank);
+ play_element_sound(x, y, SAMPLE_android_move, element);
goto loop;
android_sw:
Cave[y][x] = Yandroid_swB;
Cave[y+1][x-1] = Yandroid_sw;
Next[y+1][x-1] = Xandroid;
- PLAY(SAMPLE_tank);
+ play_element_sound(x, y, SAMPLE_android_move, element);
goto loop;
android_w:
Cave[y][x] = Yandroid_wB;
Cave[y][x-1] = Yandroid_w;
Next[y][x-1] = Xandroid;
- PLAY(SAMPLE_tank);
+ play_element_sound(x, y, SAMPLE_android_move, element);
goto loop;
android_nw:
Cave[y][x] = Yandroid_nwB;
Cave[y-1][x-1] = Yandroid_nw;
Next[y-1][x-1] = Xandroid;
- PLAY(SAMPLE_tank);
+ play_element_sound(x, y, SAMPLE_android_move, element);
goto loop;
/* --------------------------------------------------------------------- */
if (Cave[y-2][x-1] == Xblank)
Cave[y-2][x-1] = Yacid_splash_wB;
Next[y][x] = Xblank;
- PLAY(SAMPLE_acid);
+ play_element_sound(x, y, SAMPLE_acid, Xacid_1);
goto loop;
case Xblank:
Cave[y-1][x] = Yandroid_n;
Next[y][x] = Xblank;
Next[y-1][x] = Xandroid;
- PLAY(SAMPLE_tank);
+ play_element_sound(x, y, SAMPLE_android_move, element);
goto loop;
default:
if (Cave[y-2][x-1] == Xblank)
Cave[y-2][x-1] = Yacid_splash_wB;
Next[y][x] = Xblank;
- PLAY(SAMPLE_acid);
+ play_element_sound(x, y, SAMPLE_acid, Xacid_1);
goto loop;
case Xblank:
Cave[y-1][x] = Yandroid_n;
Next[y][x] = Xblank;
Next[y-1][x] = Xandroid_1_n;
- PLAY(SAMPLE_tank);
+ play_element_sound(x, y, SAMPLE_android_move, element);
goto loop;
default:
if (Cave[y-1][x] == Xblank)
Cave[y-1][x] = Yacid_splash_wB;
Next[y][x] = Xblank;
- PLAY(SAMPLE_acid);
+ play_element_sound(x, y, SAMPLE_acid, Xacid_1);
goto loop;
case Xblank:
Cave[y][x+1] = Yandroid_e;
Next[y][x] = Xblank;
Next[y][x+1] = Xandroid;
- PLAY(SAMPLE_tank);
+ play_element_sound(x, y, SAMPLE_android_move, element);
goto loop;
default:
if (Cave[y-1][x] == Xblank)
Cave[y-1][x] = Yacid_splash_wB;
Next[y][x] = Xblank;
- PLAY(SAMPLE_acid);
+ play_element_sound(x, y, SAMPLE_acid, Xacid_1);
goto loop;
case Xblank:
Cave[y][x+1] = Yandroid_e;
Next[y][x] = Xblank;
Next[y][x+1] = Xandroid_1_e;
- PLAY(SAMPLE_tank);
+ play_element_sound(x, y, SAMPLE_android_move, element);
goto loop;
default:
if (Cave[y][x-1] == Xblank)
Cave[y][x-1] = Yacid_splash_wB;
Next[y][x] = Xblank;
- PLAY(SAMPLE_acid);
+ play_element_sound(x, y, SAMPLE_acid, Xacid_1);
goto loop;
case Xblank:
Cave[y+1][x] = Yandroid_s;
Next[y][x] = Xblank;
Next[y+1][x] = Xandroid;
- PLAY(SAMPLE_tank);
+ play_element_sound(x, y, SAMPLE_android_move, element);
goto loop;
default:
if (Cave[y][x-1] == Xblank)
Cave[y][x-1] = Yacid_splash_wB;
Next[y][x] = Xblank;
- PLAY(SAMPLE_acid);
+ play_element_sound(x, y, SAMPLE_acid, Xacid_1);
goto loop;
case Xblank:
Cave[y+1][x] = Yandroid_s;
Next[y][x] = Xblank;
Next[y+1][x] = Xandroid_1_s;
- PLAY(SAMPLE_tank);
+ play_element_sound(x, y, SAMPLE_android_move, element);
goto loop;
default:
if (Cave[y-1][x-2] == Xblank)
Cave[y-1][x-2] = Yacid_splash_wB;
Next[y][x] = Xblank;
- PLAY(SAMPLE_acid);
+ play_element_sound(x, y, SAMPLE_acid, Xacid_1);
goto loop;
case Xblank:
Cave[y][x-1] = Yandroid_w;
Next[y][x] = Xblank;
Next[y][x-1] = Xandroid;
- PLAY(SAMPLE_tank);
+ play_element_sound(x, y, SAMPLE_android_move, element);
goto loop;
default:
if (Cave[y-1][x-2] == Xblank)
Cave[y-1][x-2] = Yacid_splash_wB;
Next[y][x] = Xblank;
- PLAY(SAMPLE_acid);
+ play_element_sound(x, y, SAMPLE_acid, Xacid_1);
goto loop;
case Xblank:
Cave[y][x-1] = Yandroid_w;
Next[y][x] = Xblank;
Next[y][x-1] = Xandroid_1_w;
- PLAY(SAMPLE_tank);
+ play_element_sound(x, y, SAMPLE_android_move, element);
goto loop;
default:
if (Cave[y][x-1] == Xblank)
Cave[y][x-1] = Yacid_splash_wB;
Next[y][x] = Xblank;
- PLAY(SAMPLE_acid);
+ play_element_sound(x, y, SAMPLE_acid, Xacid_1);
goto loop;
case Xblank:
if (Cave[y][x-1] == Xblank)
Cave[y][x-1] = Yacid_splash_wB;
Next[y][x] = Xblank;
- PLAY(SAMPLE_acid);
+ play_element_sound(x, y, SAMPLE_acid, Xacid_1);
goto loop;
case Xblank:
if (Cave[y][x-1] == Xblank)
Cave[y][x-1] = Yacid_splash_wB;
Next[y][x] = Xblank;
- PLAY(SAMPLE_acid);
+ play_element_sound(x, y, SAMPLE_acid, Xacid_1);
goto loop;
case Xblank:
if (Cave[y-1][x] == Xblank)
Cave[y-1][x] = Yacid_splash_wB;
Next[y][x] = Xblank;
- PLAY(SAMPLE_acid);
+ play_element_sound(x, y, SAMPLE_acid, Xacid_1);
goto loop;
case Xblank:
Cave[y][x+1] = Yspring_kill_e;
Next[y][x] = Xblank;
Next[y][x+1] = Xspring_e;
- play[SAMPLE_slurp] = 1;
+ play_element_sound(x, y, SAMPLE_slurp, Xalien);
score += lev.slurp_score;
goto loop;
case XbumperB:
Cave[y][x+1] = XbumperB;
Next[y][x] = Xspring_w;
- PLAY(SAMPLE_spring);
+ play_element_sound(x, y, SAMPLE_spring, Xspring);
goto loop;
default:
Cave[y][x] = Xspring;
Next[y][x] = Xspring;
- PLAY(SAMPLE_spring);
+ play_element_sound(x, y, SAMPLE_spring, Xspring);
goto loop;
}
if (Cave[y][x-1] == Xblank)
Cave[y][x-1] = Yacid_splash_wB;
Next[y][x] = Xblank;
- PLAY(SAMPLE_acid);
+ play_element_sound(x, y, SAMPLE_acid, Xacid_1);
goto loop;
case Xblank:
if (Cave[y-1][x-2] == Xblank)
Cave[y-1][x-2] = Yacid_splash_wB;
Next[y][x] = Xblank;
- PLAY(SAMPLE_acid);
+ play_element_sound(x, y, SAMPLE_acid, Xacid_1);
goto loop;
case Xblank:
Cave[y][x-1] = Yspring_kill_w;
Next[y][x] = Xblank;
Next[y][x-1] = Xspring_w;
- play[SAMPLE_slurp] = 1;
+ play_element_sound(x, y, SAMPLE_slurp, Xalien);
score += lev.slurp_score;
goto loop;
case XbumperB:
Cave[y][x-1] = XbumperB;
Next[y][x] = Xspring_e;
- PLAY(SAMPLE_spring);
+ play_element_sound(x, y, SAMPLE_spring, Xspring);
goto loop;
default:
Cave[y][x] = Xspring;
Next[y][x] = Xspring;
- PLAY(SAMPLE_spring);
+ play_element_sound(x, y, SAMPLE_spring, Xspring);
goto loop;
}
if (Cave[y][x-1] == Xblank)
Cave[y][x-1] = Yacid_splash_wB;
Next[y][x] = Xblank;
- PLAY(SAMPLE_acid);
+ play_element_sound(x, y, SAMPLE_acid, Xacid_1);
goto loop;
case Xblank:
Boom[y+2][x-1] = Xblank;
Boom[y+2][x] = Xblank;
Boom[y+2][x+1] = Xblank;
+#if PLAY_ELEMENT_SOUND
+ play_element_sound(x, y, SAMPLE_boom, element);
+#endif
goto loop;
case Xbug_n:
Boom[y+2][x-1] = Xemerald;
Boom[y+2][x] = Xemerald;
Boom[y+2][x+1] = Xemerald;
+#if PLAY_ELEMENT_SOUND
+ play_element_sound(x, y, SAMPLE_boom, element);
+#endif
score += lev.bug_score;
goto loop;
Boom[y+2][x-1] = Xblank;
Boom[y+2][x] = Xblank;
Boom[y+2][x+1] = Xblank;
+#if PLAY_ELEMENT_SOUND
+ play_element_sound(x, y, SAMPLE_boom, element);
+#endif
score += lev.tank_score;
goto loop;
Boom[y+2][x-1] = lev.eater_array[lev.eater_pos][6];
Boom[y+2][x] = lev.eater_array[lev.eater_pos][7];
Boom[y+2][x+1] = lev.eater_array[lev.eater_pos][8];
+#if PLAY_ELEMENT_SOUND
+ play_element_sound(x, y, SAMPLE_boom, element);
+#endif
lev.eater_pos = (lev.eater_pos + 1) & 7;
score += lev.eater_score;
goto loop;
Boom[y+2][x-1] = Xblank;
Boom[y+2][x] = Xblank;
Boom[y+2][x+1] = Xblank;
+#if PLAY_ELEMENT_SOUND
+ play_element_sound(x, y, SAMPLE_boom, element);
+#endif
score += lev.alien_score;
goto loop;
default:
Cave[y][x] = Xspring;
Next[y][x] = Xspring;
- PLAY(SAMPLE_spring);
+ play_element_sound(x, y, SAMPLE_spring, Xspring);
goto loop;
}
{
Cave[y][x+1] = Ydiamond_eat;
Next[y][x+1] = Xblank;
- play[SAMPLE_eater] = 1;
+ play_element_sound(x, y, SAMPLE_eater_eat, element);
goto loop;
}
{
Cave[y+1][x] = Ydiamond_eat;
Next[y+1][x] = Xblank;
- play[SAMPLE_eater] = 1;
+ play_element_sound(x, y, SAMPLE_eater_eat, element);
goto loop;
}
{
Cave[y][x-1] = Ydiamond_eat;
Next[y][x-1] = Xblank;
- play[SAMPLE_eater] = 1;
+ play_element_sound(x, y, SAMPLE_eater_eat, element);
goto loop;
}
{
Cave[y-1][x] = Ydiamond_eat;
Next[y-1][x] = Xblank;
- play[SAMPLE_eater] = 1;
+ play_element_sound(x, y, SAMPLE_eater_eat, element);
goto loop;
}
if (Cave[y-2][x-1] == Xblank)
Cave[y-2][x-1] = Yacid_splash_wB;
Next[y][x] = Xblank;
- PLAY(SAMPLE_acid);
+ play_element_sound(x, y, SAMPLE_acid, Xacid_1);
goto loop;
case Xblank:
default:
Next[y][x] = RANDOM & 1 ? Xeater_e : Xeater_w;
- PLAY(SAMPLE_eater);
+ play_element_sound(x, y, SAMPLE_eater, element);
goto loop;
}
{
Cave[y+1][x] = Ydiamond_eat;
Next[y+1][x] = Xblank;
- play[SAMPLE_eater] = 1;
+ play_element_sound(x, y, SAMPLE_eater_eat, element);
goto loop;
}
{
Cave[y][x-1] = Ydiamond_eat;
Next[y][x-1] = Xblank;
- play[SAMPLE_eater] = 1;
+ play_element_sound(x, y, SAMPLE_eater_eat, element);
goto loop;
}
{
Cave[y-1][x] = Ydiamond_eat;
Next[y-1][x] = Xblank;
- play[SAMPLE_eater] = 1;
+ play_element_sound(x, y, SAMPLE_eater_eat, element);
goto loop;
}
{
Cave[y][x+1] = Ydiamond_eat;
Next[y][x+1] = Xblank;
- play[SAMPLE_eater] = 1;
+ play_element_sound(x, y, SAMPLE_eater_eat, element);
goto loop;
}
if (Cave[y-1][x] == Xblank)
Cave[y-1][x] = Yacid_splash_wB;
Next[y][x] = Xblank;
- PLAY(SAMPLE_acid);
+ play_element_sound(x, y, SAMPLE_acid, Xacid_1);
goto loop;
case Xblank:
default:
Next[y][x] = RANDOM & 1 ? Xeater_n : Xeater_s;
- PLAY(SAMPLE_eater);
+ play_element_sound(x, y, SAMPLE_eater, element);
goto loop;
}
{
Cave[y][x-1] = Ydiamond_eat;
Next[y][x-1] = Xblank;
- play[SAMPLE_eater] = 1;
+ play_element_sound(x, y, SAMPLE_eater_eat, element);
goto loop;
}
{
Cave[y-1][x] = Ydiamond_eat;
Next[y-1][x] = Xblank;
- play[SAMPLE_eater] = 1;
+ play_element_sound(x, y, SAMPLE_eater_eat, element);
goto loop;
}
{
Cave[y][x+1] = Ydiamond_eat;
Next[y][x+1] = Xblank;
- play[SAMPLE_eater] = 1;
+ play_element_sound(x, y, SAMPLE_eater_eat, element);
goto loop;
}
{
Cave[y+1][x] = Ydiamond_eat;
Next[y+1][x] = Xblank;
- play[SAMPLE_eater] = 1;
+ play_element_sound(x, y, SAMPLE_eater_eat, element);
goto loop;
}
if (Cave[y][x-1] == Xblank)
Cave[y][x-1] = Yacid_splash_wB;
Next[y][x] = Xblank;
- PLAY(SAMPLE_acid);
+ play_element_sound(x, y, SAMPLE_acid, Xacid_1);
goto loop;
case Xblank:
default:
Next[y][x] = RANDOM & 1 ? Xeater_e : Xeater_w;
- PLAY(SAMPLE_eater);
+ play_element_sound(x, y, SAMPLE_eater, element);
goto loop;
}
{
Cave[y-1][x] = Ydiamond_eat;
Next[y-1][x] = Xblank;
- play[SAMPLE_eater] = 1;
+ play_element_sound(x, y, SAMPLE_eater_eat, element);
goto loop;
}
{
Cave[y][x+1] = Ydiamond_eat;
Next[y][x+1] = Xblank;
- play[SAMPLE_eater] = 1;
+ play_element_sound(x, y, SAMPLE_eater_eat, element);
goto loop;
}
{
Cave[y+1][x] = Ydiamond_eat;
Next[y+1][x] = Xblank;
- play[SAMPLE_eater] = 1;
+ play_element_sound(x, y, SAMPLE_eater_eat, element);
goto loop;
}
{
Cave[y][x-1] = Ydiamond_eat;
Next[y][x-1] = Xblank;
- play[SAMPLE_eater] = 1;
+ play_element_sound(x, y, SAMPLE_eater_eat, element);
goto loop;
}
if (Cave[y-1][x-2] == Xblank)
Cave[y-1][x-2] = Yacid_splash_wB;
Next[y][x] = Xblank;
- PLAY(SAMPLE_acid);
+ play_element_sound(x, y, SAMPLE_acid, Xacid_1);
goto loop;
case Xblank:
default:
Next[y][x] = RANDOM & 1 ? Xeater_n : Xeater_s;
- PLAY(SAMPLE_eater);
+ play_element_sound(x, y, SAMPLE_eater, element);
goto loop;
}
/* --------------------------------------------------------------------- */
case Xalien:
+
+#if 1
+
+ if (lev.wheel_cnt)
+ {
+ dx = lev.wheel_x;
+ dy = lev.wheel_y;
+ }
+ else
+ {
+ set_nearest_player_xy(x, y, &dx, &dy);
+ }
+
+#else
+
if (lev.wheel_cnt)
{
dx = lev.wheel_x;
dy = 0;
}
+#endif
+
if (RANDOM & 1)
{
if (y > dy)
if (Cave[y-2][x-1] == Xblank)
Cave[y-2][x-1] = Yacid_splash_wB;
Next[y][x] = Xblank;
- PLAY(SAMPLE_acid);
+ play_element_sound(x, y, SAMPLE_acid, Xacid_1);
goto loop;
case Xblank:
Cave[y-1][x] = Yalien_n;
Next[y][x] = Xblank;
Next[y-1][x] = Xalien_pause;
- PLAY(SAMPLE_alien);
+ play_element_sound(x, y, SAMPLE_alien, Xalien);
goto loop;
}
}
Cave[y][x+1] = Yacid_splash_eB;
if (Cave[y][x-1] == Xblank)
Cave[y][x-1] = Yacid_splash_wB;
- PLAY(SAMPLE_acid);
+ play_element_sound(x, y, SAMPLE_acid, Xacid_1);
goto loop;
case Xblank:
Cave[y+1][x] = Yalien_s;
Next[y][x] = Xblank;
Next[y+1][x] = Xalien_pause;
- PLAY(SAMPLE_alien);
+ play_element_sound(x, y, SAMPLE_alien, Xalien);
goto loop;
}
}
if (Cave[y-1][x] == Xblank)
Cave[y-1][x] = Yacid_splash_wB;
Next[y][x] = Xblank;
- PLAY(SAMPLE_acid);
+ play_element_sound(x, y, SAMPLE_acid, Xacid_1);
goto loop;
case Xblank:
Cave[y][x+1] = Yalien_e;
Next[y][x] = Xblank;
Next[y][x+1] = Xalien_pause;
- PLAY(SAMPLE_alien);
+ play_element_sound(x, y, SAMPLE_alien, Xalien);
goto loop;
}
}
if (Cave[y-1][x-2] == Xblank)
Cave[y-1][x-2] = Yacid_splash_wB;
Next[y][x] = Xblank;
- PLAY(SAMPLE_acid);
+ play_element_sound(x, y, SAMPLE_acid, Xacid_1);
goto loop;
case Xblank:
Cave[y][x-1] = Yalien_w;
Next[y][x] = Xblank;
Next[y][x-1] = Xalien_pause;
- PLAY(SAMPLE_alien);
+ play_element_sound(x, y, SAMPLE_alien, Xalien);
goto loop;
}
}
if (Cave[y][x-1] == Xblank)
Cave[y][x-1] = Yacid_splash_wB;
Next[y][x] = Xblank;
- PLAY(SAMPLE_acid);
+ play_element_sound(x, y, SAMPLE_acid, Xacid_1);
goto loop;
case Xblank:
if (Cave[y][x-1] == Xblank)
Cave[y][x-1] = Yacid_splash_wB;
Next[y][x] = Xblank;
- PLAY(SAMPLE_acid);
+ play_element_sound(x, y, SAMPLE_acid, Xacid_1);
goto loop;
case Xblank:
if (Cave[y][x-1] == Xblank)
Cave[y][x-1] = Yacid_splash_wB;
Next[y][x] = Xblank;
- PLAY(SAMPLE_acid);
+ play_element_sound(x, y, SAMPLE_acid, Xacid_1);
goto loop;
case Xblank:
}
Next[y][x] = Xblank;
- play[SAMPLE_squash] = 1;
+ play_element_sound(x, y, SAMPLE_wonderfall, Xwonderwall);
goto loop;
}
default:
Cave[y][x] = Xemerald;
Next[y][x] = Xemerald;
- PLAY(SAMPLE_diamond);
+ play_element_sound(x, y, SAMPLE_diamond, Xemerald);
goto loop;
}
if (Cave[y][x-1] == Xblank)
Cave[y][x-1] = Yacid_splash_wB;
Next[y][x] = Xblank;
- PLAY(SAMPLE_acid);
+ play_element_sound(x, y, SAMPLE_acid, Xacid_1);
goto loop;
case Xblank:
if (Cave[y][x-1] == Xblank)
Cave[y][x-1] = Yacid_splash_wB;
Next[y][x] = Xblank;
- PLAY(SAMPLE_acid);
+ play_element_sound(x, y, SAMPLE_acid, Xacid_1);
goto loop;
case Xblank:
if (Cave[y][x-1] == Xblank)
Cave[y][x-1] = Yacid_splash_wB;
Next[y][x] = Xblank;
- PLAY(SAMPLE_acid);
+ play_element_sound(x, y, SAMPLE_acid, Xacid_1);
goto loop;
case Xblank:
}
Next[y][x] = Xblank;
- play[SAMPLE_squash] = 1;
+ play_element_sound(x, y, SAMPLE_wonderfall, Xwonderwall);
goto loop;
}
default:
Cave[y][x] = Xdiamond;
Next[y][x] = Xdiamond;
- PLAY(SAMPLE_diamond);
+ play_element_sound(x, y, SAMPLE_diamond, Xdiamond);
goto loop;
}
if (Cave[y][x-1] == Xblank)
Cave[y][x-1] = Yacid_splash_wB;
Next[y][x] = Xdrip_stretchB;
- PLAY(SAMPLE_acid);
+ play_element_sound(x, y, SAMPLE_acid, Xacid_1);
goto loop;
case Xblank:
switch (RANDOM & 7)
{
case 0:
- temp = Xameuba_1;
+ temp = Xamoeba_1;
break;
case 1:
- temp = Xameuba_2;
+ temp = Xamoeba_2;
break;
case 2:
- temp = Xameuba_3;
+ temp = Xamoeba_3;
break;
case 3:
- temp = Xameuba_4;
+ temp = Xamoeba_4;
break;
case 4:
- temp = Xameuba_5;
+ temp = Xamoeba_5;
break;
case 5:
- temp = Xameuba_6;
+ temp = Xamoeba_6;
break;
case 6:
- temp = Xameuba_7;
+ temp = Xamoeba_7;
break;
case 7:
- temp = Xameuba_8;
+ temp = Xamoeba_8;
break;
}
Cave[y][x] = temp;
Next[y][x] = temp;
- play[SAMPLE_drip] = 1;
+ play_element_sound(x, y, SAMPLE_drip, Xdrip_fall);
goto loop;
}
if (Cave[y][x-1] == Xblank)
Cave[y][x-1] = Yacid_splash_wB;
Next[y][x] = Xblank;
- PLAY(SAMPLE_acid);
+ play_element_sound(x, y, SAMPLE_acid, Xacid_1);
goto loop;
case Xblank:
if (Cave[y][x-1] == Xblank)
Cave[y][x-1] = Yacid_splash_wB;
Next[y][x] = Xblank;
- PLAY(SAMPLE_acid);
+ play_element_sound(x, y, SAMPLE_acid, Xacid_1);
goto loop;
case Xblank:
if (Cave[y][x-1] == Xblank)
Cave[y][x-1] = Yacid_splash_wB;
Next[y][x] = Xblank;
- PLAY(SAMPLE_acid);
+ play_element_sound(x, y, SAMPLE_acid, Xacid_1);
goto loop;
case Xblank:
Boom[y+1][x-1] = Xblank;
Boom[y+1][x] = Xblank;
Boom[y+1][x+1] = Xblank;
+#if PLAY_ELEMENT_SOUND
+ play_element_sound(x, y, SAMPLE_boom, element);
+#endif
goto loop;
}
if (Cave[y-2][x-1] == Xblank)
Cave[y-2][x-1] = Yacid_splash_wB;
Next[y][x] = Xblank;
- PLAY(SAMPLE_acid);
+ play_element_sound(x, y, SAMPLE_acid, Xacid_1);
goto loop;
case Xblank:
if (Cave[y-1][x] == Xblank)
Cave[y-1][x] = Yacid_splash_wB;
Next[y][x] = Xblank;
- PLAY(SAMPLE_acid);
+ play_element_sound(x, y, SAMPLE_acid, Xacid_1);
goto loop;
case Xblank:
if (Cave[y][x-1] == Xblank)
Cave[y][x-1] = Yacid_splash_wB;
Next[y][x] = Xblank;
- PLAY(SAMPLE_acid);
+ play_element_sound(x, y, SAMPLE_acid, Xacid_1);
goto loop;
case Xblank:
if (Cave[y-1][x-2] == Xblank)
Cave[y-1][x-2] = Yacid_splash_wB;
Next[y][x] = Xblank;
- PLAY(SAMPLE_acid);
+ play_element_sound(x, y, SAMPLE_acid, Xacid_1);
goto loop;
case Xblank:
Next[y][x] = Xacid_1;
goto loop;
+ case Xfake_acid_1:
+ Next[y][x] = Xfake_acid_2;
+ goto loop;
+
+ case Xfake_acid_2:
+ Next[y][x] = Xfake_acid_3;
+ goto loop;
+
+ case Xfake_acid_3:
+ Next[y][x] = Xfake_acid_4;
+ goto loop;
+
+ case Xfake_acid_4:
+ Next[y][x] = Xfake_acid_5;
+ goto loop;
+
+ case Xfake_acid_5:
+ Next[y][x] = Xfake_acid_6;
+ goto loop;
+
+ case Xfake_acid_6:
+ Next[y][x] = Xfake_acid_7;
+ goto loop;
+
+ case Xfake_acid_7:
+ Next[y][x] = Xfake_acid_8;
+ goto loop;
+
+ case Xfake_acid_8:
+ Next[y][x] = Xfake_acid_1;
+ goto loop;
+
/* --------------------------------------------------------------------- */
case Xball_1:
ball_common:
- play[SAMPLE_ball] = 1;
+ play_element_sound(x, y, SAMPLE_ball, element);
if (lev.ball_random)
{
switch (RANDOM & 7)
}
}
+#if 1
+ lev.ball_pos = (lev.ball_pos + 1) % lev.num_ball_arrays;
+#else
lev.ball_pos = (lev.ball_pos + 1) & 7;
+#endif
goto loop;
/* --------------------------------------------------------------------- */
{
Cave[y-1][x] = Ygrow_ns_eat;
Next[y-1][x] = Xgrow_ns;
- play[SAMPLE_grow] = 1;
+ play_element_sound(x, y, SAMPLE_grow, Xgrow_ns);
}
if (tab_blank[Cave[y+1][x]])
{
Cave[y+1][x] = Ygrow_ns_eat;
Next[y+1][x] = Xgrow_ns;
- play[SAMPLE_grow] = 1;
+ play_element_sound(x, y, SAMPLE_grow, Xgrow_ns);
}
goto loop;
{
Cave[y][x+1] = Ygrow_ew_eat;
Next[y][x+1] = Xgrow_ew;
- play[SAMPLE_grow] = 1;
+ play_element_sound(x, y, SAMPLE_grow, Xgrow_ew);
}
if (tab_blank[Cave[y][x-1]])
{
Cave[y][x-1] = Ygrow_ew_eat;
Next[y][x-1] = Xgrow_ew;
- play[SAMPLE_grow] = 1;
+ play_element_sound(x, y, SAMPLE_grow, Xgrow_ew);
}
goto loop;
if (lev.wonderwall_time && lev.wonderwall_state)
{
Cave[y][x] = XwonderwallB;
- play[SAMPLE_wonder] = 1;
+ play_element_sound(x, y, SAMPLE_wonder, Xwonderwall);
}
goto loop;
Next[y][x] = Xexit_1;
}
+ play_element_sound(x, y, SAMPLE_exit_open, Xexit);
+
goto loop;
case Xexit_1:
/* --------------------------------------------------------------------- */
case Xdynamite_1:
- play[SAMPLE_tick] = 1;
+ play_element_sound(x, y, SAMPLE_tick, Xdynamite_1);
Next[y][x] = Xdynamite_2;
goto loop;
case Xdynamite_2:
- play[SAMPLE_tick] = 1;
+ play_element_sound(x, y, SAMPLE_tick, Xdynamite_2);
Next[y][x] = Xdynamite_3;
goto loop;
case Xdynamite_3:
- play[SAMPLE_tick] = 1;
+ play_element_sound(x, y, SAMPLE_tick, Xdynamite_3);
Next[y][x] = Xdynamite_4;
goto loop;
case Xdynamite_4:
- play[SAMPLE_tick] = 1;
+ play_element_sound(x, y, SAMPLE_tick, Xdynamite_4);
Next[y][x] = Zdynamite;
Boom[y-1][x-1] = Xblank;
Boom[y-1][x] = Xblank;
if (Cave[y][x-1] == Xblank)
Cave[y][x-1] = Yacid_splash_wB;
Next[y][x] = Xsand_stonesand_4;
- PLAY(SAMPLE_acid);
+ play_element_sound(x, y, SAMPLE_acid, Xacid_1);
goto loop;
case Xblank:
Boom[y+1][x-1] = Xemerald;
Boom[y+1][x] = Xemerald;
Boom[y+1][x+1] = Xemerald;
+#if PLAY_ELEMENT_SOUND
+ play_element_sound(x, y, SAMPLE_boom, element);
+#endif
goto loop;
case Xboom_bomb:
Boom[y+1][x-1] = Xblank;
Boom[y+1][x] = Xblank;
Boom[y+1][x+1] = Xblank;
+#if PLAY_ELEMENT_SOUND
+ play_element_sound(x, y, SAMPLE_boom, element);
+#endif
goto loop;
case Xboom_android:
+#if PLAY_ELEMENT_SOUND
+ play_element_sound(x, y, SAMPLE_boom, Xandroid);
+#endif
case Xboom_1:
Next[y][x] = Xboom_2;
- play[SAMPLE_boom] = 1;
+#if !PLAY_ELEMENT_SOUND
+ if (x != lev.exit_x && y != lev.exit_y)
+ play_sound(x, y, SAMPLE_boom);
+ else
+ lev.exit_x = lev.exit_y = -1;
+#endif
goto loop;
case Xboom_2:
done:
- if (ply1.alive || ply2.alive)
- lev.score += score; /* only get a score if someone is alive */
+ if (ply[0].alive || ply[1].alive || ply[2].alive || ply[3].alive)
+ lev.score += score; /* only add a score if someone is alive */
- Random = random;
+ RandomEM = random;
{
void *temp = Cave;