From c49a5fc579bb7f30fb7629a1f62fc18ba4f60736 Mon Sep 17 00:00:00 2001 From: Casey Date: Fri, 24 Sep 2021 01:00:51 -0400 Subject: [PATCH 1/3] Merge pull request #11610 from lm40/master adds audible belch emote --- code/game/sound.dm | 7 ++++++- code/modules/emotes/definitions/audible_belch.dm | 10 ++++++++++ code/modules/mob/living/carbon/human/emote.dm | 2 ++ vorestation.dme | 1 + 4 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 code/modules/emotes/definitions/audible_belch.dm diff --git a/code/game/sound.dm b/code/game/sound.dm index e44f34e636..37f0436fbb 100644 --- a/code/game/sound.dm +++ b/code/game/sound.dm @@ -1,7 +1,7 @@ /proc/playsound(atom/source, soundin, vol as num, vary, extrarange as num, falloff, is_global, frequency = null, channel = 0, pressure_affected = TRUE, ignore_walls = TRUE, preference = null, volume_channel = null) if(Master.current_runlevel < RUNLEVEL_LOBBY) return - + var/turf/turf_source = get_turf(source) if(!turf_source) return @@ -262,6 +262,11 @@ 'sound/vore/sunesound/prey/death_04.ogg','sound/vore/sunesound/prey/death_05.ogg','sound/vore/sunesound/prey/death_06.ogg', 'sound/vore/sunesound/prey/death_07.ogg','sound/vore/sunesound/prey/death_08.ogg','sound/vore/sunesound/prey/death_09.ogg', 'sound/vore/sunesound/prey/death_10.ogg') + if ("belches") soundin = pick( + 'sound/vore/belches/belch1.ogg','sound/vore/belches/belch2.ogg','sound/vore/belches/belch3.ogg','sound/vore/belches/belch4.ogg', + 'sound/vore/belches/belch5.ogg','sound/vore/belches/belch6.ogg','sound/vore/belches/belch7.ogg','sound/vore/belches/belch8.ogg', + 'sound/vore/belches/belch9.ogg','sound/vore/belches/belch10.ogg','sound/vore/belches/belch11.ogg','sound/vore/belches/belch12.ogg', + 'sound/vore/belches/belch13.ogg','sound/vore/belches/belch14.ogg','sound/vore/belches/belch15.ogg') //END VORESTATION EDIT //CHOMPEdit Begin if ("belches") soundin = pick( diff --git a/code/modules/emotes/definitions/audible_belch.dm b/code/modules/emotes/definitions/audible_belch.dm new file mode 100644 index 0000000000..68de583061 --- /dev/null +++ b/code/modules/emotes/definitions/audible_belch.dm @@ -0,0 +1,10 @@ +/decl/emote/audible/belch + key = "belch" + emote_message_3p = "belches." + message_type = AUDIBLE_MESSAGE + +/decl/emote/audible/belch/get_emote_sound(var/atom/user) + return list( + "sound" = sound(get_sfx("belches")), + "vol" = emote_volume / 2 + ) diff --git a/code/modules/mob/living/carbon/human/emote.dm b/code/modules/mob/living/carbon/human/emote.dm index 14d79fee30..fa8c198dc6 100644 --- a/code/modules/mob/living/carbon/human/emote.dm +++ b/code/modules/mob/living/carbon/human/emote.dm @@ -96,6 +96,7 @@ var/list/_human_default_emotes = list( //VOREStation Add /decl/emote/audible/awoo, /decl/emote/audible/awoo2, + /decl/emote/audible/belch, /decl/emote/audible/growl, /decl/emote/audible/woof, /decl/emote/audible/woof2, @@ -228,6 +229,7 @@ var/list/_simple_mob_default_emotes = list( /decl/emote/visible/flip, /decl/emote/audible/awoo, /decl/emote/audible/awoo2, + /decl/emote/audible/belch, /decl/emote/audible/growl, /decl/emote/audible/woof, /decl/emote/audible/woof2, diff --git a/vorestation.dme b/vorestation.dme index 31fe972d75..4611f60895 100644 --- a/vorestation.dme +++ b/vorestation.dme @@ -2269,6 +2269,7 @@ #include "code\modules\emotes\definitions\_mob.dm" #include "code\modules\emotes\definitions\_species.dm" #include "code\modules\emotes\definitions\audible.dm" +#include "code\modules\emotes\definitions\audible_belch.dm" #include "code\modules\emotes\definitions\audible_cough.dm" #include "code\modules\emotes\definitions\audible_furry_vr.dm" #include "code\modules\emotes\definitions\audible_scream.dm" From b75c306318ca68bdf1054a7b7a5d26c485bba99d Mon Sep 17 00:00:00 2001 From: Rykka Date: Fri, 24 Sep 2021 15:14:13 -0700 Subject: [PATCH 3/3] Reformats preferences to take a list, adds belch pref to emote Preferences can now take a list instead of a singular datum (but will still accept a singular datum for legacy compat), and any arguments that check is_preference_enabled must return true on all prefs from the list, not just one. --- code/game/sound.dm | 7 ------- .../client/preference_setup/global/02_settings.dm | 12 ++++++++++-- code/modules/emotes/definitions/audible_belch.dm | 1 + code/modules/emotes/emote_define.dm | 4 +++- 4 files changed, 14 insertions(+), 10 deletions(-) diff --git a/code/game/sound.dm b/code/game/sound.dm index 37f0436fbb..4c2cc64c88 100644 --- a/code/game/sound.dm +++ b/code/game/sound.dm @@ -268,13 +268,6 @@ 'sound/vore/belches/belch9.ogg','sound/vore/belches/belch10.ogg','sound/vore/belches/belch11.ogg','sound/vore/belches/belch12.ogg', 'sound/vore/belches/belch13.ogg','sound/vore/belches/belch14.ogg','sound/vore/belches/belch15.ogg') //END VORESTATION EDIT - //CHOMPEdit Begin - if ("belches") soundin = pick( - 'sound/vore/belches/belch1.ogg','sound/vore/belches/belch2.ogg','sound/vore/belches/belch3.ogg','sound/vore/belches/belch4.ogg', - 'sound/vore/belches/belch5.ogg','sound/vore/belches/belch6.ogg','sound/vore/belches/belch7.ogg','sound/vore/belches/belch8.ogg', - 'sound/vore/belches/belch9.ogg','sound/vore/belches/belch10.ogg','sound/vore/belches/belch11.ogg','sound/vore/belches/belch12.ogg', - 'sound/vore/belches/belch13.ogg','sound/vore/belches/belch14.ogg','sound/vore/belches/belch15.ogg',) - //CHOMPEdit End if ("terminal_type") soundin = pick('sound/machines/terminal_button01.ogg', 'sound/machines/terminal_button02.ogg', 'sound/machines/terminal_button03.ogg', \ 'sound/machines/terminal_button04.ogg', 'sound/machines/terminal_button05.ogg', 'sound/machines/terminal_button06.ogg', \ diff --git a/code/modules/client/preference_setup/global/02_settings.dm b/code/modules/client/preference_setup/global/02_settings.dm index 16dc0f91bd..1808ff6c65 100644 --- a/code/modules/client/preference_setup/global/02_settings.dm +++ b/code/modules/client/preference_setup/global/02_settings.dm @@ -83,9 +83,17 @@ return ..() +/** + * This can take either a single preference datum or a list of preferences, and will return true if *all* preferences in the arguments are enabled. + */ /client/proc/is_preference_enabled(var/preference) - var/datum/client_preference/cp = get_client_preference(preference) - return cp && (cp.key in prefs.preferences_enabled) + if(!islist(preference)) + preference = list(preference) + for(var/p in preference) + var/datum/client_preference/cp = get_client_preference(p) + if(!cp || !(cp.key in prefs.preferences_enabled)) + return FALSE + return TRUE /client/proc/set_preference(var/preference, var/set_preference) var/datum/client_preference/cp = get_client_preference(preference) diff --git a/code/modules/emotes/definitions/audible_belch.dm b/code/modules/emotes/definitions/audible_belch.dm index 68de583061..3bb3b6a17c 100644 --- a/code/modules/emotes/definitions/audible_belch.dm +++ b/code/modules/emotes/definitions/audible_belch.dm @@ -2,6 +2,7 @@ key = "belch" emote_message_3p = "belches." message_type = AUDIBLE_MESSAGE + sound_preferences = list(/datum/client_preference/emote_noises,/datum/client_preference/belch_noises) /decl/emote/audible/belch/get_emote_sound(var/atom/user) return list( diff --git a/code/modules/emotes/emote_define.dm b/code/modules/emotes/emote_define.dm index 9a1debb429..b8f2e414a9 100644 --- a/code/modules/emotes/emote_define.dm +++ b/code/modules/emotes/emote_define.dm @@ -42,6 +42,8 @@ var/global/list/emotes_by_key var/check_range // falsy, or a range outside which the emote will not work var/conscious = TRUE // Do we need to be awake to emote this? var/emote_range = 0 // If >0, restricts emote visibility to viewers within range. + + var/sound_preferences = list(/datum/client_preference/emote_noises) /decl/emote/Initialize() . = ..() @@ -176,7 +178,7 @@ var/global/list/emotes_by_key if(islist(sound_to_play) && length(sound_to_play)) sound_to_play = pick(sound_to_play) if(sound_to_play) - playsound(user.loc, sound_to_play, use_sound["vol"], 0, preference = /datum/client_preference/emote_noises) //VOREStation Add - Preference + playsound(user.loc, sound_to_play, use_sound["vol"], 0, preference = sound_preferences) //VOREStation Add - Preference /decl/emote/proc/mob_can_use(var/mob/user) return istype(user) && user.stat != DEAD && (type in user.get_available_emotes())