]> granicus.if.org Git - nethack/commitdiff
more Soundeffects tinkering
authornhmall <nhmall@nethack.org>
Sat, 28 Jan 2023 04:41:54 +0000 (23:41 -0500)
committernhmall <nhmall@nethack.org>
Sat, 28 Jan 2023 04:41:54 +0000 (23:41 -0500)
include/sndprocs.h
src/dig.c
src/mthrowu.c
src/sounds.c
src/zap.c

index d2f5c9d5b5153eea502f6022a70885bfd243b354..cc9eb287766747beb09fa56ebdeb0af36de99eb6 100755 (executable)
@@ -312,10 +312,13 @@ enum sound_effect_entries {
     se_orc_grunt                      = 186,
     se_avian_screak                   = 187,
     se_paranoid_confirmation          = 188,
-    se_bars_whap                      = 189,
-    se_bars_flapp                     = 190,
-    se_bars_clink                     = 191,
-    se_bars_clonk                     = 192,
+    se_bars_whang                     = 194,
+    se_bars_whap                      = 195,
+    se_bars_flapp                     = 196,
+    se_bars_clink                     = 197,
+    se_bars_clonk                     = 198,
+    se_boomerang_klonk                = 199,
+    se_bang_weapon_side               = 200,
     number_of_se_entries
 };
 
index 9fe99c7a197bfcb81b64751261aee445a6f3c8aa..fcc1b8ec7774d3ef6df4c726d42d58d669cd49a2 100644 (file)
--- a/src/dig.c
+++ b/src/dig.c
@@ -279,6 +279,7 @@ dig(void)
             }
             break;
         case 1:
+            Soundeffect(se_bang_weapon_side, 100);
             pline("Bang!  You hit with the broad side of %s!",
                   the(xname(uwep)));
             wake_nearby();
index a5f745b4e258e4fe4959d0400b3d2ff3966035f2..991635b6fd1b6d6e5bc70ec6be07638a27723649 100644 (file)
@@ -1234,17 +1234,28 @@ hit_bars(
                 dissolve_bars(barsx, barsy);
         }
     } else {
-        if (!Deaf)
-            pline("%s!", (obj_type == BOULDER || obj_type == HEAVY_IRON_BALL)
-                         ? "Whang"
-                         : harmless_missile(otmp) ? "Whap"
-                         : is_flimsy(otmp) ? "Flapp"
+        if (!Deaf) {
+            static enum sound_effect_entries se[] = {
+                se_zero_invalid,
+                se_bars_whang, se_bars_whap, se_bars_flapp,
+                se_bars_clink, se_bars_clonk
+            };
+            static const char *const barsounds[] = {
+                "", "Whang", "Whap", "Flapp", "Clink", "Clonk"
+            };
+            int bsindx = (obj_type == BOULDER || obj_type == HEAVY_IRON_BALL)
+                         ? 1
+                         : harmless_missile(otmp) ? 2
+                         : is_flimsy(otmp) ? 3
                          : (otmp->oclass == COIN_CLASS
                             || objects[obj_type].oc_material == GOLD
                             || objects[obj_type].oc_material == SILVER)
-                           ? "Clink"
-                           : "Clonk");
+                           ? 4
+                           : SIZE(barsounds) - 1;
 
+            Soundeffect(se[bsindx], 100);
+            pline("%s!", barsounds[bsindx]);
+        }
         if (!(harmless_missile(otmp) || is_flimsy(otmp)))
             noise = 4 * 4;
 
index e51218c31063253215d066e02e437806eb7737c5..c3d95970e155de25eb88dbfaaa3d4484e07d71da 100644 (file)
@@ -2040,10 +2040,13 @@ static const struct soundeffect_automapping
     { se_orc_grunt,                     "orc_grunt" },
     { se_avian_screak,                  "avian_screak" },
     { se_paranoid_confirmation,         "paranoid_confirmation" },
+    { se_bars_whang,                    "bars_whang" },
     { se_bars_whap,                     "bars_whap" },
     { se_bars_flapp,                    "bars_flapp" },
     { se_bars_clink,                    "bars_clink" },
     { se_bars_clonk,                    "bars_clonk" },
+    { se_boomerang_klonk,               "boomerang_klonk" },
+    { se_bang_weapon_side,              "bang_weapon_side" },
 };
 
 static const char *semap_basenames[SIZE(se_mappings_init)];
index 31a3a678d81b46906d12c0bd74f435d798fd72af..58b0bef757b2dc09de5dbc359a8138fda94e93a0 100644 (file)
--- a/src/zap.c
+++ b/src/zap.c
@@ -3852,6 +3852,7 @@ boomhit(struct obj *obj, coordxy dx, coordxy dy)
         tmp_at(gb.bhitpos.x, gb.bhitpos.y);
         delay_output();
         if (IS_SINK(levl[gb.bhitpos.x][gb.bhitpos.y].typ)) {
+            Soundeffect(se_boomerang_klonk, 75);
             if (!Deaf)
                 pline("Klonk!");
             wake_nearto(gb.bhitpos.x, gb.bhitpos.y, 20);