From: Holger Schemel Date: Mon, 16 Dec 2024 19:06:32 +0000 (+0100) Subject: fixed amoeba sounds for BD engine X-Git-Tag: 4.4.0.0~16 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=9b4b51060178e15bd2d78e0eed64e08c036d42f5;p=rocksndiamonds.git fixed amoeba sounds for BD engine --- diff --git a/src/conf_snd.c b/src/conf_snd.c index bee15aaa..c6fb6128 100644 --- a/src/conf_snd.c +++ b/src/conf_snd.c @@ -97,9 +97,14 @@ struct ConfigInfo sound_config[] = { "bdx_bomb.collecting", "pong.wav" }, { "bdx_bomb.dropping", "zisch.wav" }, { "bdx_magic_wall.active", "miep.wav" }, + { "bdx_amoeba_1.growing", "amoebe.wav" }, + { "bdx_amoeba_1.growing.mode_loop", "false" }, { "bdx_amoeba_1.active", UNDEFINED_FILENAME }, - { "bdx_amoeba_1.other", UNDEFINED_FILENAME }, + { "bdx_amoeba_1.other", "miep.wav" }, + { "bdx_amoeba_2.growing", "amoebe.wav" }, + { "bdx_amoeba_2.growing.mode_loop", "false" }, { "bdx_amoeba_2.active", UNDEFINED_FILENAME }, + { "bdx_amoeba_2.other", "miep.wav" }, { "bdx_pneumatic_hammer.active", "hammer.wav" }, { "bdx_covered.active", "jingle.wav" }, { "bdx_inbox.opening", "crash.wav" }, diff --git a/src/game.c b/src/game.c index 72562d28..42732f50 100644 --- a/src/game.c +++ b/src/game.c @@ -15700,6 +15700,8 @@ static int getSoundAction_BD(int sample) case GD_S_LAVA: case GD_S_ACID_SPREADING: case GD_S_BLADDER_CONVERTING: + case GD_S_AMOEBA_GROWING: + case GD_S_AMOEBA_2_GROWING: return ACTION_GROWING; case GD_S_DIAMOND_COLLECTING: @@ -15761,6 +15763,7 @@ static int getSoundAction_BD(int sample) case GD_S_COVERING: case GD_S_AMOEBA: + case GD_S_AMOEBA_2: case GD_S_MAGIC_WALL: case GD_S_PNEUMATIC_HAMMER: case GD_S_WATER: @@ -15818,6 +15821,7 @@ static int getSoundAction_BD(int sample) return ACTION_OTHER; case GD_S_AMOEBA_MAGIC: + case GD_S_AMOEBA_2_MAGIC: case GD_S_FINISHED: // trigger special post-processing (and force sound to be looping) return ACTION_DEFAULT; @@ -15935,6 +15939,10 @@ static int getSoundEffect_BD(int element_bd, int sample) sound_effect = SND_BDX_AMOEBA_1_OTHER; break; + case GD_S_AMOEBA_2_MAGIC: + sound_effect = SND_BDX_AMOEBA_2_OTHER; + break; + case GD_S_FINISHED: sound_effect = SND_GAME_LEVELTIME_BONUS; break; diff --git a/src/game_bd/bd_caveengine.c b/src/game_bd/bd_caveengine.c index 38ddc094..3b870543 100644 --- a/src/game_bd/bd_caveengine.c +++ b/src/game_bd/bd_caveengine.c @@ -1834,7 +1834,7 @@ void gd_cave_iterate(GdCave *cave, GdDirection player_move, boolean player_fire, O_STONE }; - boolean amoeba_sound, magic_sound; + boolean amoeba_1_sound, amoeba_2_sound, magic_sound; gd_cave_clear_sounds(cave); @@ -3280,25 +3280,37 @@ void gd_cave_iterate(GdCave *cave, GdDirection player_move, boolean player_fire, case 0: // let this be up. numbers indifferent. if (amoeba_eats(cave, x, y, GD_MV_UP)) + { store_dir(cave, x, y, GD_MV_UP, O_AMOEBA); + gd_sound_play(cave, GD_S_AMOEBA_GROWING, O_AMOEBA, -1, -1); + } break; case 1: // down if (amoeba_eats(cave, x, y, GD_MV_DOWN)) + { store_dir(cave, x, y, GD_MV_DOWN, O_AMOEBA); + gd_sound_play(cave, GD_S_AMOEBA_GROWING, O_AMOEBA, -1, -1); + } break; case 2: // left if (amoeba_eats(cave, x, y, GD_MV_LEFT)) + { store_dir(cave, x, y, GD_MV_LEFT, O_AMOEBA); + gd_sound_play(cave, GD_S_AMOEBA_GROWING, O_AMOEBA, -1, -1); + } break; case 3: // right if (amoeba_eats(cave, x, y, GD_MV_RIGHT)) + { store_dir(cave, x, y, GD_MV_RIGHT, O_AMOEBA); + gd_sound_play(cave, GD_S_AMOEBA_GROWING, O_AMOEBA, -1, -1); + } break; } } @@ -3360,25 +3372,37 @@ void gd_cave_iterate(GdCave *cave, GdDirection player_move, boolean player_fire, case 0: // let this be up. numbers indifferent. if (amoeba_eats(cave, x, y, GD_MV_UP)) + { store_dir(cave, x, y, GD_MV_UP, O_AMOEBA_2); + gd_sound_play(cave, GD_S_AMOEBA_2_GROWING, O_AMOEBA_2, -1, -1); + } break; case 1: // down if (amoeba_eats(cave, x, y, GD_MV_DOWN)) + { store_dir(cave, x, y, GD_MV_DOWN, O_AMOEBA_2); + gd_sound_play(cave, GD_S_AMOEBA_2_GROWING, O_AMOEBA_2, -1, -1); + } break; case 2: // left if (amoeba_eats(cave, x, y, GD_MV_LEFT)) + { store_dir(cave, x, y, GD_MV_LEFT, O_AMOEBA_2); + gd_sound_play(cave, GD_S_AMOEBA_2_GROWING, O_AMOEBA_2, -1, -1); + } break; case 3: // right if (amoeba_eats(cave, x, y, GD_MV_RIGHT)) + { store_dir(cave, x, y, GD_MV_RIGHT, O_AMOEBA_2); + gd_sound_play(cave, GD_S_AMOEBA_2_GROWING, O_AMOEBA_2, -1, -1); + } break; } } @@ -4072,34 +4096,43 @@ void gd_cave_iterate(GdCave *cave, GdDirection player_move, boolean player_fire, // SPECIAL SOUNDS // cave 3 sounds. precedence is controlled by the sound_play function. - // but we have to check amoeba&magic together as they had a different gritty sound when mixed + // but we have to check amoeba & magic together as they had a different gritty sound when mixed if (found_water) gd_sound_play(cave, GD_S_WATER, O_WATER, -1, -1); magic_sound = (cave->magic_wall_state == GD_MW_ACTIVE && cave->magic_wall_sound); - amoeba_sound = (cave->hatched && cave->amoeba_sound && - ((amoeba_count > 0 && cave->amoeba_state == GD_AM_AWAKE) || - (amoeba_2_count > 0 && cave->amoeba_2_state == GD_AM_AWAKE))); + amoeba_1_sound = (cave->hatched && cave->amoeba_sound && + amoeba_count > 0 && cave->amoeba_state == GD_AM_AWAKE); - if (amoeba_sound && magic_sound) + amoeba_2_sound = (cave->hatched && cave->amoeba_sound && + amoeba_2_count > 0 && cave->amoeba_2_state == GD_AM_AWAKE); + + if (amoeba_1_sound && magic_sound) { gd_sound_play(cave, GD_S_AMOEBA_MAGIC, O_AMOEBA, -1, -1); } + else if (amoeba_2_sound && magic_sound) + { + gd_sound_play(cave, GD_S_AMOEBA_2_MAGIC, O_AMOEBA_2, -1, -1); + } else { - if (amoeba_sound) + if (amoeba_1_sound) gd_sound_play(cave, GD_S_AMOEBA, O_AMOEBA, -1, -1); + else if (amoeba_2_sound) + gd_sound_play(cave, GD_S_AMOEBA_2, O_AMOEBA_2, -1, -1); else if (magic_sound) gd_sound_play(cave, GD_S_MAGIC_WALL, O_MAGIC_WALL, -1, -1); } if (cave->hatched) { - if ((amoeba_count > 0 && cave->amoeba_state == GD_AM_AWAKE) || - (amoeba_2_count > 0 && cave->amoeba_2_state == GD_AM_AWAKE)) + if (amoeba_count > 0 && cave->amoeba_state == GD_AM_AWAKE) play_sound_of_element(cave, O_AMOEBA, -1, -1); + else if (amoeba_2_count > 0 && cave->amoeba_2_state == GD_AM_AWAKE) + play_sound_of_element(cave, O_AMOEBA_2, -1, -1); } diff --git a/src/game_bd/bd_elements.h b/src/game_bd/bd_elements.h index ab60e908..106a9222 100644 --- a/src/game_bd/bd_elements.h +++ b/src/game_bd/bd_elements.h @@ -562,9 +562,13 @@ typedef enum _sound GD_S_SWITCH_EXPANDING, GD_S_SWITCH_CONVEYOR, GD_S_SWITCH_REPLICATOR, + GD_S_AMOEBA_GROWING, + GD_S_AMOEBA_2_GROWING, GD_S_AMOEBA, // loop + GD_S_AMOEBA_2, // loop GD_S_AMOEBA_MAGIC, // loop + GD_S_AMOEBA_2_MAGIC, // loop GD_S_MAGIC_WALL, // loop GD_S_COVERING, // loop GD_S_PNEUMATIC_HAMMER, // loop diff --git a/src/game_bd/bd_sound.c b/src/game_bd/bd_sound.c index 794610c4..9dd3c7ce 100644 --- a/src/game_bd/bd_sound.c +++ b/src/game_bd/bd_sound.c @@ -205,10 +205,14 @@ static SoundProperty sound_flags[] = { GD_S_SWITCH_EXPANDING, 2, 10 }, { GD_S_SWITCH_CONVEYOR, 2, 10 }, { GD_S_SWITCH_REPLICATOR, 2, 10 }, + { GD_S_AMOEBA_GROWING, 2, 10 }, + { GD_S_AMOEBA_2_GROWING, 2, 10 }, // channel 3 sounds. { GD_S_AMOEBA, 3, 30, GD_SP_LOOPED }, + { GD_S_AMOEBA_2, 3, 30, GD_SP_LOOPED }, { GD_S_AMOEBA_MAGIC, 3, 40, GD_SP_LOOPED }, + { GD_S_AMOEBA_2_MAGIC, 3, 40, GD_SP_LOOPED }, { GD_S_MAGIC_WALL, 3, 35, GD_SP_LOOPED }, { GD_S_COVERING, 3, 100, GD_SP_LOOPED }, { GD_S_PNEUMATIC_HAMMER, 3, 50, GD_SP_LOOPED },