added support for player dying sound for native BD engine
authorHolger Schemel <holger.schemel@virtion.de>
Fri, 6 Dec 2024 19:07:26 +0000 (20:07 +0100)
committerHolger Schemel <holger.schemel@virtion.de>
Fri, 6 Dec 2024 15:08:04 +0000 (16:08 +0100)
src/game.c
src/game_bd/bd_caveengine.c
src/game_bd/bd_elements.h
src/game_bd/bd_sound.c

index 9454c4acdd7606b882ba7906b2645134274bbc67..bcc86408c3123ce4d604817d20d734ea5eb97d82 100644 (file)
@@ -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:
index 11bdbe81e2a251e87840a171ffafed82d61e6503..88f4f2ba7b57f3e3406cf94f704da25b21098ec1 100644 (file)
@@ -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);
index 6b306a9fe6ffd02840daee52c8f9c2cabf5f6090..85d34602de4893edc5a90b98d51e06c73e094716 100644 (file)
@@ -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,
index dd42357eb48735cf7e012b8d20163d22cf992289..9aaddd0ed4a77b5785e5caec6b6045aa97804a36 100644 (file)
@@ -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                                   },