From: Holger Schemel Date: Fri, 6 Dec 2024 19:07:26 +0000 (+0100) Subject: added support for player dying sound for native BD engine X-Git-Tag: 4.4.0.0-test-5~4 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=106d08b5cc7f52462c3edf6b94c40c265f7f990a;p=rocksndiamonds.git added support for player dying sound for native BD engine --- diff --git a/src/game.c b/src/game.c index 9454c4ac..bcc86408 100644 --- a/src/game.c +++ b/src/game.c @@ -15739,6 +15739,9 @@ static int getSoundAction_BD(int sample) case GD_S_NITRO_PACK_EXPLODING: return ACTION_EXPLODING; + case GD_S_DYING: + return ACTION_DYING; + case GD_S_COVERING: case GD_S_AMOEBA: case GD_S_MAGIC_WALL: diff --git a/src/game_bd/bd_caveengine.c b/src/game_bd/bd_caveengine.c index 11bdbe81..88f4f2ba 100644 --- a/src/game_bd/bd_caveengine.c +++ b/src/game_bd/bd_caveengine.c @@ -807,6 +807,9 @@ static void creature_explode(GdCave *cave, int x, int y, GdElement explode_to) cave->ckdelay_current += 1200; gd_sound_play(cave, GD_S_EXPLODING, get(cave, x, y), x, y); + if (is_player(cave, x, y)) + gd_sound_play(cave, GD_S_DYING, get(cave, x, y), x, y); + for (yy = y - 1; yy <= y + 1; yy++) for (xx = x - 1; xx <= x + 1; xx++) cell_explode(cave, xx, yy, explode_to); diff --git a/src/game_bd/bd_elements.h b/src/game_bd/bd_elements.h index 6b306a9f..85d34602 100644 --- a/src/game_bd/bd_elements.h +++ b/src/game_bd/bd_elements.h @@ -507,6 +507,7 @@ typedef enum _sound GD_S_BLADDER_CONVERTING, GD_S_BLADDER_SPENDER, GD_S_BITER_EATING, + GD_S_DYING, GD_S_DOOR_OPENING, GD_S_DIRT_WALKING, diff --git a/src/game_bd/bd_sound.c b/src/game_bd/bd_sound.c index dd42357e..9aaddd0e 100644 --- a/src/game_bd/bd_sound.c +++ b/src/game_bd/bd_sound.c @@ -169,6 +169,7 @@ static SoundProperty sound_flags[] = { GD_S_BLADDER_SPENDER, 1, 8 }, // very low precedence. biters tend to produce too much sound. { GD_S_BITER_EATING, 1, 3 }, + { GD_S_DYING, 1, 100 }, // channel2 sounds. { GD_S_DOOR_OPENING, 2, 10 },