Toggle for bloopers (multiple say sounds) (#18201)

* Toggle for bloopers (multiple say sounds)

Added a preference for "Multiple Say Sounds", which is enabled by default. If you have it enabled it plays multiple say sounds for long sentences as normal. If disabled it will play only one say sound, if say sounds are enabled.
It does mean there's an extra bloop at the beginning now, but it doesn't change the effect much in my testing.

* make this respect whisper/say

---------

Co-authored-by: C.L. <killer65311@gmail.com>
This commit is contained in:
SatinIsle
2025-08-07 22:58:06 -04:00
committed by GitHub
co-authored by C.L.
parent 773b5f5abe
commit 5f11aebbde
3 changed files with 18 additions and 3 deletions
+4 -3
View File
@@ -444,7 +444,7 @@ var/list/channel_to_radio_key = list()
#define BLOOPER_MAX_BLOOPERS 24
#define BLOOPER_MAX_TIME (1.5 SECONDS)
/mob/living/proc/blooper(extrarange = 0, volume, sound_preference = /datum/preference/toggle/say_sounds)
/mob/living/proc/blooper(extrarange = 0, volume, sound_preference = /datum/preference/toggle/bloop_sounds)
playsound(\
src,\
pick(voice_sounds_list),\
@@ -458,13 +458,14 @@ var/list/channel_to_radio_key = list()
preference = sound_preference,
)
/mob/living/proc/blooploop(message, extrarange = 0, volume, sound_preference = /datum/preference/toggle/say_sounds)
/mob/living/proc/blooploop(message, extrarange = 0, volume, sound_preference = /datum/preference/toggle/say_sounds, bloop_preference = /datum/preference/toggle/bloop_sounds)
var/bloopers = min(round((LAZYLEN(message) / BLOOPER_SPEED)) + 1, BLOOPER_MAX_BLOOPERS)
var/total_delay
playsound(src, pick(voice_sounds_list), 75, TRUE, extrarange = extrarange, falloff = 1 , is_global = TRUE, frequency = voice_freq > 0 ? voice_freq : null, ignore_walls = FALSE, preference = sound_preference)
for(var/i in 1 to bloopers)
if(total_delay > BLOOPER_MAX_TIME)
break
addtimer(CALLBACK(src, PROC_REF(blooper), extrarange, volume, sound_preference), total_delay)
addtimer(CALLBACK(src, PROC_REF(blooper), extrarange, volume, bloop_preference), total_delay)
total_delay += rand(\
DS2TICKS(BLOOPER_SPEED / BLOOPER_SPEED_BASELINE), \
DS2TICKS(BLOOPER_SPEED / BLOOPER_SPEED_BASELINE) + DS2TICKS(BLOOPER_SPEED / BLOOPER_SPEED_BASELINE)) TICKS