mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 02:34:00 +00:00
[MIRROR] Toggle for bloopers (multiple say sounds) (#11354)
Co-authored-by: SatinIsle <98125273+SatinIsle@users.noreply.github.com> Co-authored-by: C.L. <killer65311@gmail.com>
This commit is contained in:
committed by
GitHub
parent
472b25b15f
commit
175cb4bf29
@@ -63,6 +63,12 @@
|
||||
default_value = TRUE
|
||||
savefile_identifier = PREFERENCE_PLAYER
|
||||
|
||||
/datum/preference/toggle/bloop_sounds
|
||||
category = PREFERENCE_CATEGORY_GAME_PREFERENCES
|
||||
savefile_key = "BLOOP_SOUNDS"
|
||||
default_value = TRUE
|
||||
savefile_identifier = PREFERENCE_PLAYER
|
||||
|
||||
/datum/preference/toggle/emote_sounds
|
||||
category = PREFERENCE_CATEGORY_GAME_PREFERENCES
|
||||
savefile_key = "EMOTE_SOUNDS"
|
||||
|
||||
@@ -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,
|
||||
) //CHOMPEDIT - Ignore_walls set to TRUE
|
||||
|
||||
/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
|
||||
|
||||
Reference in New Issue
Block a user