// game panel display and control definitions
#define GAME_PANEL_LEVEL_NUMBER 0
#define GAME_PANEL_GEMS 1
-#define GAME_PANEL_INVENTORY_COUNT 2
-#define GAME_PANEL_INVENTORY_FIRST_1 3
-#define GAME_PANEL_INVENTORY_FIRST_2 4
-#define GAME_PANEL_INVENTORY_FIRST_3 5
-#define GAME_PANEL_INVENTORY_FIRST_4 6
-#define GAME_PANEL_INVENTORY_FIRST_5 7
-#define GAME_PANEL_INVENTORY_FIRST_6 8
-#define GAME_PANEL_INVENTORY_FIRST_7 9
-#define GAME_PANEL_INVENTORY_FIRST_8 10
-#define GAME_PANEL_INVENTORY_LAST_1 11
-#define GAME_PANEL_INVENTORY_LAST_2 12
-#define GAME_PANEL_INVENTORY_LAST_3 13
-#define GAME_PANEL_INVENTORY_LAST_4 14
-#define GAME_PANEL_INVENTORY_LAST_5 15
-#define GAME_PANEL_INVENTORY_LAST_6 16
-#define GAME_PANEL_INVENTORY_LAST_7 17
-#define GAME_PANEL_INVENTORY_LAST_8 18
-#define GAME_PANEL_KEY_1 19
-#define GAME_PANEL_KEY_2 20
-#define GAME_PANEL_KEY_3 21
-#define GAME_PANEL_KEY_4 22
-#define GAME_PANEL_KEY_5 23
-#define GAME_PANEL_KEY_6 24
-#define GAME_PANEL_KEY_7 25
-#define GAME_PANEL_KEY_8 26
-#define GAME_PANEL_KEY_WHITE 27
-#define GAME_PANEL_KEY_WHITE_COUNT 28
-#define GAME_PANEL_SCORE 29
-#define GAME_PANEL_HIGHSCORE 30
-#define GAME_PANEL_TIME 31
-#define GAME_PANEL_TIME_HH 32
-#define GAME_PANEL_TIME_MM 33
-#define GAME_PANEL_TIME_SS 34
-#define GAME_PANEL_TIME_ANIM 35
-#define GAME_PANEL_HEALTH 36
-#define GAME_PANEL_HEALTH_ANIM 37
-#define GAME_PANEL_FRAME 38
-#define GAME_PANEL_SHIELD_NORMAL 39
-#define GAME_PANEL_SHIELD_NORMAL_TIME 40
-#define GAME_PANEL_SHIELD_DEADLY 41
-#define GAME_PANEL_SHIELD_DEADLY_TIME 42
-#define GAME_PANEL_EXIT 43
-#define GAME_PANEL_EMC_MAGIC_BALL 44
-#define GAME_PANEL_EMC_MAGIC_BALL_SWITCH 45
-#define GAME_PANEL_LIGHT_SWITCH 46
-#define GAME_PANEL_LIGHT_SWITCH_TIME 47
-#define GAME_PANEL_TIMEGATE_SWITCH 48
-#define GAME_PANEL_TIMEGATE_SWITCH_TIME 49
-#define GAME_PANEL_SWITCHGATE_SWITCH 50
-#define GAME_PANEL_EMC_LENSES 51
-#define GAME_PANEL_EMC_LENSES_TIME 52
-#define GAME_PANEL_EMC_MAGNIFIER 53
-#define GAME_PANEL_EMC_MAGNIFIER_TIME 54
-#define GAME_PANEL_BALLOON_SWITCH 55
-#define GAME_PANEL_DYNABOMB_NUMBER 56
-#define GAME_PANEL_DYNABOMB_SIZE 57
-#define GAME_PANEL_DYNABOMB_POWER 58
-#define GAME_PANEL_PENGUINS 59
-#define GAME_PANEL_SOKOBAN_OBJECTS 60
-#define GAME_PANEL_SOKOBAN_FIELDS 61
-#define GAME_PANEL_ROBOT_WHEEL 62
-#define GAME_PANEL_CONVEYOR_BELT_1 63
-#define GAME_PANEL_CONVEYOR_BELT_2 64
-#define GAME_PANEL_CONVEYOR_BELT_3 65
-#define GAME_PANEL_CONVEYOR_BELT_4 66
-#define GAME_PANEL_CONVEYOR_BELT_1_SWITCH 67
-#define GAME_PANEL_CONVEYOR_BELT_2_SWITCH 68
-#define GAME_PANEL_CONVEYOR_BELT_3_SWITCH 69
-#define GAME_PANEL_CONVEYOR_BELT_4_SWITCH 70
-#define GAME_PANEL_MAGIC_WALL 71
-#define GAME_PANEL_MAGIC_WALL_TIME 72
-#define GAME_PANEL_GRAVITY_STATE 73
-#define GAME_PANEL_GRAPHIC_1 74
-#define GAME_PANEL_GRAPHIC_2 75
-#define GAME_PANEL_GRAPHIC_3 76
-#define GAME_PANEL_GRAPHIC_4 77
-#define GAME_PANEL_GRAPHIC_5 78
-#define GAME_PANEL_GRAPHIC_6 79
-#define GAME_PANEL_GRAPHIC_7 80
-#define GAME_PANEL_GRAPHIC_8 81
-#define GAME_PANEL_ELEMENT_1 82
-#define GAME_PANEL_ELEMENT_2 83
-#define GAME_PANEL_ELEMENT_3 84
-#define GAME_PANEL_ELEMENT_4 85
-#define GAME_PANEL_ELEMENT_5 86
-#define GAME_PANEL_ELEMENT_6 87
-#define GAME_PANEL_ELEMENT_7 88
-#define GAME_PANEL_ELEMENT_8 89
-#define GAME_PANEL_ELEMENT_COUNT_1 90
-#define GAME_PANEL_ELEMENT_COUNT_2 91
-#define GAME_PANEL_ELEMENT_COUNT_3 92
-#define GAME_PANEL_ELEMENT_COUNT_4 93
-#define GAME_PANEL_ELEMENT_COUNT_5 94
-#define GAME_PANEL_ELEMENT_COUNT_6 95
-#define GAME_PANEL_ELEMENT_COUNT_7 96
-#define GAME_PANEL_ELEMENT_COUNT_8 97
-#define GAME_PANEL_CE_SCORE_1 98
-#define GAME_PANEL_CE_SCORE_2 99
-#define GAME_PANEL_CE_SCORE_3 100
-#define GAME_PANEL_CE_SCORE_4 101
-#define GAME_PANEL_CE_SCORE_5 102
-#define GAME_PANEL_CE_SCORE_6 103
-#define GAME_PANEL_CE_SCORE_7 104
-#define GAME_PANEL_CE_SCORE_8 105
-#define GAME_PANEL_CE_SCORE_1_ELEMENT 106
-#define GAME_PANEL_CE_SCORE_2_ELEMENT 107
-#define GAME_PANEL_CE_SCORE_3_ELEMENT 108
-#define GAME_PANEL_CE_SCORE_4_ELEMENT 109
-#define GAME_PANEL_CE_SCORE_5_ELEMENT 110
-#define GAME_PANEL_CE_SCORE_6_ELEMENT 111
-#define GAME_PANEL_CE_SCORE_7_ELEMENT 112
-#define GAME_PANEL_CE_SCORE_8_ELEMENT 113
-#define GAME_PANEL_PLAYER_NAME 114
-#define GAME_PANEL_LEVEL_NAME 115
-#define GAME_PANEL_LEVEL_AUTHOR 116
-
-#define NUM_GAME_PANEL_CONTROLS 117
+#define GAME_PANEL_GEMS_TOTAL 2
+#define GAME_PANEL_GEMS_COLLECTED 3
+#define GAME_PANEL_GEMS_SCORE 4
+#define GAME_PANEL_INVENTORY_COUNT 5
+#define GAME_PANEL_INVENTORY_FIRST_1 6
+#define GAME_PANEL_INVENTORY_FIRST_2 7
+#define GAME_PANEL_INVENTORY_FIRST_3 8
+#define GAME_PANEL_INVENTORY_FIRST_4 9
+#define GAME_PANEL_INVENTORY_FIRST_5 10
+#define GAME_PANEL_INVENTORY_FIRST_6 11
+#define GAME_PANEL_INVENTORY_FIRST_7 12
+#define GAME_PANEL_INVENTORY_FIRST_8 13
+#define GAME_PANEL_INVENTORY_LAST_1 14
+#define GAME_PANEL_INVENTORY_LAST_2 15
+#define GAME_PANEL_INVENTORY_LAST_3 16
+#define GAME_PANEL_INVENTORY_LAST_4 17
+#define GAME_PANEL_INVENTORY_LAST_5 18
+#define GAME_PANEL_INVENTORY_LAST_6 19
+#define GAME_PANEL_INVENTORY_LAST_7 20
+#define GAME_PANEL_INVENTORY_LAST_8 21
+#define GAME_PANEL_KEY_1 22
+#define GAME_PANEL_KEY_2 23
+#define GAME_PANEL_KEY_3 24
+#define GAME_PANEL_KEY_4 25
+#define GAME_PANEL_KEY_5 26
+#define GAME_PANEL_KEY_6 27
+#define GAME_PANEL_KEY_7 28
+#define GAME_PANEL_KEY_8 29
+#define GAME_PANEL_KEY_WHITE 30
+#define GAME_PANEL_KEY_WHITE_COUNT 31
+#define GAME_PANEL_SCORE 32
+#define GAME_PANEL_HIGHSCORE 33
+#define GAME_PANEL_TIME 34
+#define GAME_PANEL_TIME_HH 35
+#define GAME_PANEL_TIME_MM 36
+#define GAME_PANEL_TIME_SS 37
+#define GAME_PANEL_TIME_ANIM 38
+#define GAME_PANEL_HEALTH 39
+#define GAME_PANEL_HEALTH_ANIM 40
+#define GAME_PANEL_FRAME 41
+#define GAME_PANEL_SHIELD_NORMAL 42
+#define GAME_PANEL_SHIELD_NORMAL_TIME 43
+#define GAME_PANEL_SHIELD_DEADLY 44
+#define GAME_PANEL_SHIELD_DEADLY_TIME 45
+#define GAME_PANEL_EXIT 46
+#define GAME_PANEL_EMC_MAGIC_BALL 47
+#define GAME_PANEL_EMC_MAGIC_BALL_SWITCH 48
+#define GAME_PANEL_LIGHT_SWITCH 49
+#define GAME_PANEL_LIGHT_SWITCH_TIME 50
+#define GAME_PANEL_TIMEGATE_SWITCH 51
+#define GAME_PANEL_TIMEGATE_SWITCH_TIME 52
+#define GAME_PANEL_SWITCHGATE_SWITCH 53
+#define GAME_PANEL_EMC_LENSES 54
+#define GAME_PANEL_EMC_LENSES_TIME 55
+#define GAME_PANEL_EMC_MAGNIFIER 56
+#define GAME_PANEL_EMC_MAGNIFIER_TIME 57
+#define GAME_PANEL_BALLOON_SWITCH 58
+#define GAME_PANEL_DYNABOMB_NUMBER 59
+#define GAME_PANEL_DYNABOMB_SIZE 60
+#define GAME_PANEL_DYNABOMB_POWER 61
+#define GAME_PANEL_PENGUINS 62
+#define GAME_PANEL_SOKOBAN_OBJECTS 63
+#define GAME_PANEL_SOKOBAN_FIELDS 64
+#define GAME_PANEL_ROBOT_WHEEL 65
+#define GAME_PANEL_CONVEYOR_BELT_1 66
+#define GAME_PANEL_CONVEYOR_BELT_2 67
+#define GAME_PANEL_CONVEYOR_BELT_3 68
+#define GAME_PANEL_CONVEYOR_BELT_4 69
+#define GAME_PANEL_CONVEYOR_BELT_1_SWITCH 70
+#define GAME_PANEL_CONVEYOR_BELT_2_SWITCH 71
+#define GAME_PANEL_CONVEYOR_BELT_3_SWITCH 72
+#define GAME_PANEL_CONVEYOR_BELT_4_SWITCH 73
+#define GAME_PANEL_MAGIC_WALL 74
+#define GAME_PANEL_MAGIC_WALL_TIME 75
+#define GAME_PANEL_GRAVITY_STATE 76
+#define GAME_PANEL_GRAPHIC_1 77
+#define GAME_PANEL_GRAPHIC_2 78
+#define GAME_PANEL_GRAPHIC_3 79
+#define GAME_PANEL_GRAPHIC_4 80
+#define GAME_PANEL_GRAPHIC_5 81
+#define GAME_PANEL_GRAPHIC_6 82
+#define GAME_PANEL_GRAPHIC_7 83
+#define GAME_PANEL_GRAPHIC_8 84
+#define GAME_PANEL_ELEMENT_1 85
+#define GAME_PANEL_ELEMENT_2 86
+#define GAME_PANEL_ELEMENT_3 87
+#define GAME_PANEL_ELEMENT_4 88
+#define GAME_PANEL_ELEMENT_5 89
+#define GAME_PANEL_ELEMENT_6 90
+#define GAME_PANEL_ELEMENT_7 91
+#define GAME_PANEL_ELEMENT_8 92
+#define GAME_PANEL_ELEMENT_COUNT_1 93
+#define GAME_PANEL_ELEMENT_COUNT_2 94
+#define GAME_PANEL_ELEMENT_COUNT_3 95
+#define GAME_PANEL_ELEMENT_COUNT_4 96
+#define GAME_PANEL_ELEMENT_COUNT_5 97
+#define GAME_PANEL_ELEMENT_COUNT_6 98
+#define GAME_PANEL_ELEMENT_COUNT_7 99
+#define GAME_PANEL_ELEMENT_COUNT_8 100
+#define GAME_PANEL_CE_SCORE_1 101
+#define GAME_PANEL_CE_SCORE_2 102
+#define GAME_PANEL_CE_SCORE_3 103
+#define GAME_PANEL_CE_SCORE_4 104
+#define GAME_PANEL_CE_SCORE_5 105
+#define GAME_PANEL_CE_SCORE_6 106
+#define GAME_PANEL_CE_SCORE_7 107
+#define GAME_PANEL_CE_SCORE_8 108
+#define GAME_PANEL_CE_SCORE_1_ELEMENT 109
+#define GAME_PANEL_CE_SCORE_2_ELEMENT 110
+#define GAME_PANEL_CE_SCORE_3_ELEMENT 111
+#define GAME_PANEL_CE_SCORE_4_ELEMENT 112
+#define GAME_PANEL_CE_SCORE_5_ELEMENT 113
+#define GAME_PANEL_CE_SCORE_6_ELEMENT 114
+#define GAME_PANEL_CE_SCORE_7_ELEMENT 115
+#define GAME_PANEL_CE_SCORE_8_ELEMENT 116
+#define GAME_PANEL_PLAYER_NAME 117
+#define GAME_PANEL_LEVEL_NAME 118
+#define GAME_PANEL_LEVEL_AUTHOR 119
+
+#define NUM_GAME_PANEL_CONTROLS 120
struct GamePanelOrderInfo
{
&game.panel.gems,
TYPE_INTEGER,
},
+ {
+ GAME_PANEL_GEMS_TOTAL,
+ &game.panel.gems_total,
+ TYPE_INTEGER,
+ },
+ {
+ GAME_PANEL_GEMS_COLLECTED,
+ &game.panel.gems_collected,
+ TYPE_INTEGER,
+ },
+ {
+ GAME_PANEL_GEMS_SCORE,
+ &game.panel.gems_score,
+ TYPE_INTEGER,
+ },
{
GAME_PANEL_INVENTORY_COUNT,
&game.panel.inventory_count,
level.game_engine_type == GAME_ENGINE_TYPE_MM ?
game_mm.kettles_still_needed :
game.gems_still_needed);
+ int gems_total = level.gems_needed;
+ int gems_collected = gems_total - gems;
+ int gems_score = level.score[SC_EMERALD];
int exit_closed = (level.game_engine_type == GAME_ENGINE_TYPE_EM ?
game_em.lev->gems_needed > 0 :
level.game_engine_type == GAME_ENGINE_TYPE_SP ?
// used instead of "level_nr" (for network games)
game_panel_controls[GAME_PANEL_LEVEL_NUMBER].value = levelset.level_nr;
game_panel_controls[GAME_PANEL_GEMS].value = gems;
+ game_panel_controls[GAME_PANEL_GEMS_TOTAL].value = gems_total;
+ game_panel_controls[GAME_PANEL_GEMS_COLLECTED].value = gems_collected;
+ game_panel_controls[GAME_PANEL_GEMS_SCORE].value = gems_score;
game_panel_controls[GAME_PANEL_INVENTORY_COUNT].value = 0;
for (i = 0; i < MAX_NUM_KEYS; i++)
TimeFrames = 0;
TimePlayed = 0;
TimeLeft = level.time;
+
+ TapeTimeFrames = 0;
TapeTime = 0;
ScreenMovDir = MV_NONE;
for (y1 = -1; y1 < 2; y1++) for (x1 = -1; x1 < 2; x1++)
{
- int xx = ax+x1, yy = ay+y1;
+ int xx = ax + x1, yy = ay + y1;
int old_element = Tile[xx][yy];
int num_neighbours = 0;
for (y2 = -1; y2 < 2; y2++) for (x2 = -1; x2 < 2; x2++)
{
- int x = xx+x2, y = yy+y2;
+ int x = xx + x2, y = yy + y2;
if (!IN_LEV_FIELD(x, y) || (x == xx && y == yy))
continue;
if (TimeFrames >= FRAMES_PER_SECOND)
{
TimeFrames = 0;
- TapeTime++;
for (i = 0; i < MAX_PLAYERS; i++)
{
game_em.lev->time = (game.no_level_time_limit ? TimePlayed : TimeLeft);
}
+ }
+
+ if (TapeTimeFrames >= FRAMES_PER_SECOND)
+ {
+ TapeTimeFrames = 0;
+ TapeTime++;
if (tape.recording || tape.playing)
DrawVideoDisplay(VIDEO_STATE_TIME_ON, TapeTime);
{
int i;
- // advance frame counters (global frame counter and time frame counter)
+ // advance frame counters (global frame counter and tape time frame counter)
FrameCounter++;
+ TapeTimeFrames++;
+
+ // advance time frame counter (used to control available time to solve level)
TimeFrames++;
// advance player counters (counters for move delay, move animation etc.)
loop_sound_volume = checked_calloc(num_sounds * sizeof(int));
}
-static void PlayLevelSound(int x, int y, int nr)
+static void PlayLevelSoundExt(int x, int y, int nr, boolean is_loop_sound)
{
int sx = SCREENX(x), sy = SCREENY(y);
int volume, stereo_position;
int max_distance = 8;
- int type = (IS_LOOP_SOUND(nr) ? SND_CTRL_PLAY_LOOP : SND_CTRL_PLAY_SOUND);
+ int type = (is_loop_sound ? SND_CTRL_PLAY_LOOP : SND_CTRL_PLAY_SOUND);
- if ((!setup.sound_simple && !IS_LOOP_SOUND(nr)) ||
- (!setup.sound_loops && IS_LOOP_SOUND(nr)))
+ if ((!setup.sound_simple && !is_loop_sound) ||
+ (!setup.sound_loops && is_loop_sound))
return;
if (!IN_LEV_FIELD(x, y) ||
(sx + max_distance) * SOUND_MAX_LEFT2RIGHT /
(SCR_FIELDX + 2 * max_distance));
- if (IS_LOOP_SOUND(nr))
+ if (is_loop_sound)
{
/* This assures that quieter loop sounds do not overwrite louder ones,
while restarting sound volume comparison with each new game frame. */
PlaySoundExt(nr, volume, stereo_position, type);
}
+static void PlayLevelSound(int x, int y, int nr)
+{
+ PlayLevelSoundExt(x, y, nr, IS_LOOP_SOUND(nr));
+}
+
static void PlayLevelSoundNearest(int x, int y, int sound_action)
{
PlayLevelSound(x < LEVELX(BX1) ? LEVELX(BX1) :
PlayMusicLoop(music_nr);
}
+static int getSoundAction_BD(int sample)
+{
+ switch (sample)
+ {
+ case GD_S_STONE:
+ case GD_S_NUT:
+ case GD_S_DIRT_BALL:
+ case GD_S_NITRO:
+ case GD_S_FALLING_WALL:
+ return ACTION_IMPACT;
+
+ case GD_S_NUT_CRACK:
+ return ACTION_BREAKING;
+
+ case GD_S_EXPANDING_WALL:
+ case GD_S_WALL_REAPPEAR:
+ case GD_S_SLIME:
+ case GD_S_LAVA:
+ case GD_S_ACID_SPREAD:
+ return ACTION_GROWING;
+
+ case GD_S_DIAMOND_COLLECT:
+ case GD_S_SKELETON_COLLECT:
+ case GD_S_PNEUMATIC_COLLECT:
+ case GD_S_BOMB_COLLECT:
+ case GD_S_CLOCK_COLLECT:
+ case GD_S_SWEET_COLLECT:
+ case GD_S_KEY_COLLECT:
+ case GD_S_DIAMOND_KEY_COLLECT:
+ return ACTION_COLLECTING;
+
+ case GD_S_BOMB_PLACE:
+ case GD_S_REPLICATOR:
+ return ACTION_DROPPING;
+
+ case GD_S_BLADDER_MOVE:
+ return ACTION_MOVING;
+
+ case GD_S_BLADDER_SPENDER:
+ case GD_S_BLADDER_CONVERT:
+ case GD_S_GRAVITY_CHANGE:
+ return ACTION_CHANGING;
+
+ case GD_S_BITER_EAT:
+ return ACTION_EATING;
+
+ case GD_S_DOOR_OPEN:
+ case GD_S_CRACK:
+ return ACTION_OPENING;
+
+ case GD_S_WALK_EARTH:
+ return ACTION_DIGGING;
+
+ case GD_S_WALK_EMPTY:
+ return ACTION_WALKING;
+
+ case GD_S_SWITCH_BITER:
+ case GD_S_SWITCH_CREATURES:
+ case GD_S_SWITCH_GRAVITY:
+ case GD_S_SWITCH_EXPANDING:
+ case GD_S_SWITCH_CONVEYOR:
+ case GD_S_SWITCH_REPLICATOR:
+ case GD_S_STIRRING:
+ return ACTION_ACTIVATING;
+
+ case GD_S_BOX_PUSH:
+ return ACTION_PUSHING;
+
+ case GD_S_TELEPORTER:
+ return ACTION_PASSING;
+
+ case GD_S_EXPLOSION:
+ case GD_S_BOMB_EXPLOSION:
+ case GD_S_GHOST_EXPLOSION:
+ case GD_S_VOODOO_EXPLOSION:
+ case GD_S_NITRO_EXPLOSION:
+ return ACTION_EXPLODING;
+
+ case GD_S_COVER:
+ case GD_S_AMOEBA:
+ case GD_S_AMOEBA_MAGIC:
+ case GD_S_MAGIC_WALL:
+ case GD_S_PNEUMATIC_HAMMER:
+ case GD_S_WATER:
+ return ACTION_ACTIVE;
+
+ case GD_S_DIAMOND_RANDOM:
+ case GD_S_DIAMOND_1:
+ case GD_S_DIAMOND_2:
+ case GD_S_DIAMOND_3:
+ case GD_S_DIAMOND_4:
+ case GD_S_DIAMOND_5:
+ case GD_S_DIAMOND_6:
+ case GD_S_DIAMOND_7:
+ case GD_S_DIAMOND_8:
+ case GD_S_TIMEOUT_0:
+ case GD_S_TIMEOUT_1:
+ case GD_S_TIMEOUT_2:
+ case GD_S_TIMEOUT_3:
+ case GD_S_TIMEOUT_4:
+ case GD_S_TIMEOUT_5:
+ case GD_S_TIMEOUT_6:
+ case GD_S_TIMEOUT_7:
+ case GD_S_TIMEOUT_8:
+ case GD_S_TIMEOUT_9:
+ case GD_S_TIMEOUT_10:
+ case GD_S_BONUS_LIFE:
+ // kludge to prevent playing as loop sound
+ return ACTION_OTHER;
+
+ case GD_S_FINISHED:
+ return ACTION_DEFAULT;
+
+ default:
+ return ACTION_DEFAULT;
+ }
+}
+
+static int getSoundEffect_BD(int element_bd, int sample)
+{
+ int sound_action = getSoundAction_BD(sample);
+ int sound_effect = element_info[SND_ELEMENT(element_bd)].sound[sound_action];
+ int nr;
+
+ // standard sounds
+ if (sound_action != ACTION_OTHER &&
+ sound_action != ACTION_DEFAULT)
+ return sound_effect;
+
+ // special sounds
+ switch (sample)
+ {
+ case GD_S_DIAMOND_RANDOM:
+ nr = GetSimpleRandom(8);
+ sound_effect = SND_BD_DIAMOND_IMPACT_RANDOM_1 + nr;
+ break;
+
+ case GD_S_DIAMOND_1:
+ case GD_S_DIAMOND_2:
+ case GD_S_DIAMOND_3:
+ case GD_S_DIAMOND_4:
+ case GD_S_DIAMOND_5:
+ case GD_S_DIAMOND_6:
+ case GD_S_DIAMOND_7:
+ case GD_S_DIAMOND_8:
+ nr = sample - GD_S_DIAMOND_1;
+ sound_effect = SND_BD_DIAMOND_IMPACT_RANDOM_1 + nr;
+ break;
+
+ case GD_S_TIMEOUT_0:
+ case GD_S_TIMEOUT_1:
+ case GD_S_TIMEOUT_2:
+ case GD_S_TIMEOUT_3:
+ case GD_S_TIMEOUT_4:
+ case GD_S_TIMEOUT_5:
+ case GD_S_TIMEOUT_6:
+ case GD_S_TIMEOUT_7:
+ case GD_S_TIMEOUT_8:
+ case GD_S_TIMEOUT_9:
+ case GD_S_TIMEOUT_10:
+ nr = sample - GD_S_TIMEOUT_0;
+ sound_effect = SND_GAME_RUNNING_OUT_OF_TIME_0 + nr;
+
+ if (getSoundInfoEntryFilename(sound_effect) == NULL && sample != GD_S_TIMEOUT_0)
+ sound_effect = SND_GAME_RUNNING_OUT_OF_TIME;
+ break;
+
+ case GD_S_FINISHED:
+ sound_effect = SND_GAME_LEVELTIME_BONUS;
+ break;
+
+ case GD_S_BONUS_LIFE:
+ sound_effect = SND_GAME_HEALTH_BONUS;
+ break;
+
+ default:
+ sound_effect = SND_UNDEFINED;
+ break;
+ }
+
+ return sound_effect;
+}
+
+void PlayLevelSound_BD(int xx, int yy, int element_bd, int sample)
+{
+ int element = (element_bd > -1 ? map_element_BD_to_RND(element_bd) : 0);
+ int sound_effect = getSoundEffect_BD(element, sample);
+ int sound_action = getSoundAction_BD(sample);
+ boolean is_loop_sound = IS_LOOP_SOUND(sound_effect);
+ int offset = 0;
+ int x = xx - offset;
+ int y = yy - offset;
+
+ if (sound_action == ACTION_OTHER)
+ is_loop_sound = FALSE;
+
+ if (sound_effect != SND_UNDEFINED)
+ PlayLevelSoundExt(x, y, sound_effect, is_loop_sound);
+}
+
+void StopSound_BD(int element_bd, int sample)
+{
+ int element = (element_bd > -1 ? map_element_BD_to_RND(element_bd) : 0);
+ int sound_effect = getSoundEffect_BD(element, sample);
+
+ if (sound_effect != SND_UNDEFINED)
+ StopSound(sound_effect);
+}
+
+boolean isSoundPlaying_BD(int element_bd, int sample)
+{
+ int element = (element_bd > -1 ? map_element_BD_to_RND(element_bd) : 0);
+ int sound_effect = getSoundEffect_BD(element, sample);
+
+ if (sound_effect != SND_UNDEFINED)
+ return isSoundPlaying(sound_effect);
+
+ return FALSE;
+}
+
void PlayLevelSound_EM(int xx, int yy, int element_em, int sample)
{
int element = (element_em > -1 ? map_element_EM_to_RND_game(element_em) : 0);
}
if (network.enabled)
+ {
SendToServer_StopPlaying(NETWORK_STOP_BY_PLAYER);
+ }
else
{
if (quick_quit)
SaveSnapshotBuffer(&buffers, ARGS_ADDRESS_AND_SIZEOF(TimeFrames));
SaveSnapshotBuffer(&buffers, ARGS_ADDRESS_AND_SIZEOF(TimePlayed));
SaveSnapshotBuffer(&buffers, ARGS_ADDRESS_AND_SIZEOF(TimeLeft));
+ SaveSnapshotBuffer(&buffers, ARGS_ADDRESS_AND_SIZEOF(TapeTimeFrames));
SaveSnapshotBuffer(&buffers, ARGS_ADDRESS_AND_SIZEOF(TapeTime));
SaveSnapshotBuffer(&buffers, ARGS_ADDRESS_AND_SIZEOF(ScreenMovDir));