mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-12 19:22:56 +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
|
default_value = TRUE
|
||||||
savefile_identifier = PREFERENCE_PLAYER
|
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
|
/datum/preference/toggle/emote_sounds
|
||||||
category = PREFERENCE_CATEGORY_GAME_PREFERENCES
|
category = PREFERENCE_CATEGORY_GAME_PREFERENCES
|
||||||
savefile_key = "EMOTE_SOUNDS"
|
savefile_key = "EMOTE_SOUNDS"
|
||||||
|
|||||||
@@ -444,7 +444,7 @@ var/list/channel_to_radio_key = list()
|
|||||||
#define BLOOPER_MAX_BLOOPERS 24
|
#define BLOOPER_MAX_BLOOPERS 24
|
||||||
#define BLOOPER_MAX_TIME (1.5 SECONDS)
|
#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(\
|
playsound(\
|
||||||
src,\
|
src,\
|
||||||
pick(voice_sounds_list),\
|
pick(voice_sounds_list),\
|
||||||
@@ -458,13 +458,14 @@ var/list/channel_to_radio_key = list()
|
|||||||
preference = sound_preference,
|
preference = sound_preference,
|
||||||
) //CHOMPEDIT - Ignore_walls set to TRUE
|
) //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/bloopers = min(round((LAZYLEN(message) / BLOOPER_SPEED)) + 1, BLOOPER_MAX_BLOOPERS)
|
||||||
var/total_delay
|
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)
|
for(var/i in 1 to bloopers)
|
||||||
if(total_delay > BLOOPER_MAX_TIME)
|
if(total_delay > BLOOPER_MAX_TIME)
|
||||||
break
|
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(\
|
total_delay += rand(\
|
||||||
DS2TICKS(BLOOPER_SPEED / BLOOPER_SPEED_BASELINE), \
|
DS2TICKS(BLOOPER_SPEED / BLOOPER_SPEED_BASELINE), \
|
||||||
DS2TICKS(BLOOPER_SPEED / BLOOPER_SPEED_BASELINE) + DS2TICKS(BLOOPER_SPEED / BLOOPER_SPEED_BASELINE)) TICKS
|
DS2TICKS(BLOOPER_SPEED / BLOOPER_SPEED_BASELINE) + DS2TICKS(BLOOPER_SPEED / BLOOPER_SPEED_BASELINE)) TICKS
|
||||||
|
|||||||
@@ -61,6 +61,14 @@ export const SAY_SOUNDS: FeatureToggle = {
|
|||||||
component: CheckboxInput,
|
component: CheckboxInput,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const BLOOP_SOUNDS: FeatureToggle = {
|
||||||
|
name: 'Multiple Say Sounds',
|
||||||
|
category: 'SOUNDS',
|
||||||
|
description:
|
||||||
|
'Enable hearing a say sound play multiple times for longer messages.',
|
||||||
|
component: CheckboxInput,
|
||||||
|
};
|
||||||
|
|
||||||
export const EMOTE_SOUNDS: FeatureToggle = {
|
export const EMOTE_SOUNDS: FeatureToggle = {
|
||||||
name: 'Me Sounds',
|
name: 'Me Sounds',
|
||||||
category: 'SOUNDS',
|
category: 'SOUNDS',
|
||||||
|
|||||||
Reference in New Issue
Block a user