mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-28 14:37:27 +01:00
Simplified version of bloopers (#18173)
This commit is contained in:
@@ -419,23 +419,61 @@ var/list/channel_to_radio_key = list()
|
||||
C.images -= I
|
||||
qdel(I)
|
||||
|
||||
var/ourfreq = null
|
||||
if(voice_freq > 0 )
|
||||
ourfreq = voice_freq
|
||||
//Log the message to file
|
||||
if(message_mode)
|
||||
message = "([message_mode == "headset" ? "Common" : capitalize(message_mode)]) [message]" //Adds radio keys used if available
|
||||
if(whispering)
|
||||
if(do_sound && message)
|
||||
playsound(T, pick(voice_sounds_list), 25, TRUE, extrarange = -6, falloff = 1 , is_global = TRUE, frequency = ourfreq, ignore_walls = FALSE, preference = /datum/preference/toggle/whisper_sounds)
|
||||
blooploop(message, extrarange = -6, volume = 25)
|
||||
// playsound(T, pick(voice_sounds_list), 25, TRUE, extrarange = -6, falloff = 1 , is_global = TRUE, frequency = ourfreq, ignore_walls = FALSE, preference = /datum/preference/toggle/whisper_sounds)
|
||||
|
||||
log_whisper(message, src)
|
||||
else
|
||||
if(do_sound && message)
|
||||
playsound(T, pick(voice_sounds_list), 75, TRUE, falloff = 1 , is_global = TRUE, frequency = ourfreq, ignore_walls = FALSE, preference = /datum/preference/toggle/say_sounds)
|
||||
blooploop(message, volume = 75)
|
||||
// playsound(T, pick(voice_sounds_list), 75, TRUE, falloff = 1 , is_global = TRUE, frequency = ourfreq, ignore_walls = FALSE, preference = /datum/preference/toggle/say_sounds)
|
||||
log_say(message, src)
|
||||
return 1
|
||||
|
||||
/*************************************************************************/
|
||||
/* HEAVILY SIMPLIFIED VARIANT OF BLOOPERS FROM Citadel */
|
||||
// https://github.com/Citadel-Station-13/Citadel-Station-13/pull/15677 */
|
||||
/*********************(***************************************************/
|
||||
#define BLOOPER_SPEED 6
|
||||
#define BLOOPER_SPEED_BASELINE 4
|
||||
#define BLOOPER_MAX_BLOOPERS 24
|
||||
#define BLOOPER_MAX_TIME (1.5 SECONDS)
|
||||
|
||||
/mob/living/proc/blooper(extrarange = 0, volume)
|
||||
playsound(\
|
||||
src,\
|
||||
pick(voice_sounds_list),\
|
||||
volume,\
|
||||
vary = TRUE,\
|
||||
extrarange = extrarange,\
|
||||
falloff = 1,\
|
||||
is_global = TRUE,\
|
||||
frequency = voice_freq > 0 ? voice_freq : null,\
|
||||
ignore_walls = FALSE,\
|
||||
preference = /datum/preference/toggle/say_sounds,
|
||||
)
|
||||
|
||||
/mob/living/proc/blooploop(message, extrarange = 0, volume)
|
||||
var/bloopers = min(round((LAZYLEN(message) / BLOOPER_SPEED)) + 1, BLOOPER_MAX_BLOOPERS)
|
||||
var/total_delay
|
||||
for(var/i in 1 to bloopers)
|
||||
if(total_delay > BLOOPER_MAX_TIME)
|
||||
break
|
||||
addtimer(CALLBACK(src, PROC_REF(blooper), extrarange, volume), total_delay)
|
||||
total_delay += rand(\
|
||||
DS2TICKS(BLOOPER_SPEED / BLOOPER_SPEED_BASELINE), \
|
||||
DS2TICKS(BLOOPER_SPEED / BLOOPER_SPEED_BASELINE) + DS2TICKS(BLOOPER_SPEED / BLOOPER_SPEED_BASELINE)) TICKS
|
||||
|
||||
#undef BLOOPER_SPEED
|
||||
#undef BLOOPER_SPEED_BASELINE
|
||||
#undef BLOOPER_MAX_BLOOPERS
|
||||
#undef BLOOPER_MAX_TIME
|
||||
|
||||
/mob/living/proc/say_signlang(var/message, var/verb="gestures", var/verb_understood="gestures", var/datum/language/language, var/type = 1)
|
||||
var/turf/T = get_turf(src)
|
||||
//We're in something, gesture to people inside the same thing
|
||||
|
||||
Reference in New Issue
Block a user