From 78e7bcf6430f2a9aaff88c3f585b1a8962d2e770 Mon Sep 17 00:00:00 2001 From: James R Date: Fri, 23 Feb 2024 17:15:09 -0800 Subject: [PATCH] Talk Point: plays sound effect for player who touches it (unless set to invisible) --- src/objects/talk-point.cpp | 5 +++++ src/sounds.c | 2 ++ src/sounds.h | 3 +++ 3 files changed, 10 insertions(+) diff --git a/src/objects/talk-point.cpp b/src/objects/talk-point.cpp index b43eedb75..af510f7d5 100644 --- a/src/objects/talk-point.cpp +++ b/src/objects/talk-point.cpp @@ -100,6 +100,11 @@ struct TalkPoint : Mobj collect(kCollectDuration); } + if (!invisible() && P_IsDisplayPlayer(&players[i])) + { + S_StartSound(nullptr, sfx_hint); + } + break; } } diff --git a/src/sounds.c b/src/sounds.c index f40be3c58..81322c55b 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -1263,6 +1263,8 @@ sfxinfo_t S_sfx[NUMSFX] = {"ssbmpr", false, 64, 8, -1, NULL, 0, -1, -1, LUMPERROR, "UNDESCRIBED SSBMPR"}, // SF_X4AWAYSOUND {"chcrun", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "UNDESCRIBED CHCRUN"}, + {"hint", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Hint Ring"}, + // Damage sounds {"dmga1", false, 255, 8, -1, NULL, 0, -1, -1, LUMPERROR, "Damaged"}, {"dmga2", false, 255, 8, -1, NULL, 0, -1, -1, LUMPERROR, "Damaged"}, diff --git a/src/sounds.h b/src/sounds.h index bfbd06887..b53450224 100644 --- a/src/sounds.h +++ b/src/sounds.h @@ -1338,6 +1338,9 @@ typedef enum sfx_ssbmpr, sfx_chcrun, + // Tutorial Hint + sfx_hint, + // Damage sounds sfx_dmga1, sfx_dmga2,