Adds sound volume setting to vorebellies

Vorgan sound volume can now be adjusted per-belly to allow certain vorgans to sound more muffled etc.
This commit is contained in:
Verkister
2022-12-08 20:55:27 +02:00
parent 76eb33df3d
commit 23ce23f6bf
5 changed files with 27 additions and 12 deletions
+8 -5
View File
@@ -57,6 +57,7 @@
var/special_entrance_sound // CHOMPEdit: Mob specific custom entry sound set by mob's init_vore when applicable
var/slow_digestion = FALSE // CHOMPEdit: Gradual corpse digestion
var/slow_brutal = FALSE // CHOMPEdit: Gradual corpse digestion: Stumpy's Special
var/sound_volume = 100 // CHOMPEdit: Volume knob.
// Generally just used by AI
var/autotransferchance = 0 // % Chance of prey being autotransferred to transfer location
@@ -276,7 +277,8 @@
"autotransfer_min_amount",
"autotransfer_max_amount",
"slow_digestion",
"slow_brutal", //CHOMP end of variables from CHOMP
"slow_brutal",
"sound_volume", //CHOMP end of variables from CHOMP
"egg_type",
"save_digest_mode"
)
@@ -334,7 +336,7 @@
if(special_entrance_sound) //CHOMPEdit: Custom sound set by mob's init_vore or ingame varedits.
soundfile = special_entrance_sound
if(soundfile)
playsound(src, soundfile, vol = 100, vary = 1, falloff = VORE_SOUND_FALLOFF, preference = /datum/client_preference/eating_noises, volume_channel = VOLUME_CHANNEL_VORE)
playsound(src, soundfile, vol = sound_volume, vary = 1, falloff = VORE_SOUND_FALLOFF, preference = /datum/client_preference/eating_noises, volume_channel = VOLUME_CHANNEL_VORE) //CHOPEdit
recent_sound = TRUE
//Messages if it's a mob
@@ -499,7 +501,7 @@
else
soundfile = fancy_release_sounds[release_sound]
if(soundfile)
playsound(src, soundfile, vol = 100, vary = 1, falloff = VORE_SOUND_FALLOFF, preference = /datum/client_preference/eating_noises, volume_channel = VOLUME_CHANNEL_VORE)
playsound(src, soundfile, vol = sound_volume, vary = 1, falloff = VORE_SOUND_FALLOFF, preference = /datum/client_preference/eating_noises, volume_channel = VOLUME_CHANNEL_VORE) //CHOPEdit
return count
@@ -569,7 +571,7 @@
else
soundfile = fancy_release_sounds[release_sound]
if(soundfile)
playsound(src, soundfile, vol = 100, vary = 1, falloff = VORE_SOUND_FALLOFF, preference = /datum/client_preference/eating_noises, volume_channel = VOLUME_CHANNEL_VORE)
playsound(src, soundfile, vol = sound_volume, vary = 1, falloff = VORE_SOUND_FALLOFF, preference = /datum/client_preference/eating_noises, volume_channel = VOLUME_CHANNEL_VORE) //CHOPEdit
//Should fix your view not following you out of mobs sometimes!
if(ismob(M))
var/mob/ourmob = M
@@ -1330,7 +1332,8 @@
dupe.autotransfer_min_amount = autotransfer_min_amount
dupe.autotransfer_max_amount = autotransfer_max_amount
dupe.slow_digestion = slow_digestion
dupe.slow_brutal = slow_brutal //CHOMP end of variables from CHOMP
dupe.slow_brutal = slow_brutal
dupe.sound_volume = sound_volume //CHOMP end of variables from CHOMP
dupe.belly_fullscreen = belly_fullscreen
dupe.disable_hud = disable_hud
+4 -4
View File
@@ -105,9 +105,9 @@
continue
if(isturf(M.loc) || (M.loc != src)) //to avoid people on the inside getting the outside sounds and their direct sounds + built in sound pref check
if(fancy_vore)
M.playsound_local(get_turf(owner), play_sound, vol = 100, vary = 1, falloff = VORE_SOUND_FALLOFF)
M.playsound_local(get_turf(owner), play_sound, vol = sound_volume, vary = 1, falloff = VORE_SOUND_FALLOFF) //CHOMPEdit
else
M.playsound_local(get_turf(owner), play_sound, vol = 100, vary = 1, falloff = VORE_SOUND_FALLOFF)
M.playsound_local(get_turf(owner), play_sound, vol = sound_volume, vary = 1, falloff = VORE_SOUND_FALLOFF) //CHOMPEdit
//these are all external sound triggers now, so it's ok.
return
@@ -132,9 +132,9 @@
continue
if(isturf(M.loc) || (M.loc != src)) //to avoid people on the inside getting the outside sounds and their direct sounds + built in sound pref check
if(fancy_vore)
M.playsound_local(get_turf(owner), play_sound, vol = 100, vary = 1, falloff = VORE_SOUND_FALLOFF)
M.playsound_local(get_turf(owner), play_sound, vol = sound_volume, vary = 1, falloff = VORE_SOUND_FALLOFF) //CHOMPEdit
else
M.playsound_local(get_turf(owner), play_sound, vol = 100, vary = 1, falloff = VORE_SOUND_FALLOFF)
M.playsound_local(get_turf(owner), play_sound, vol = sound_volume, vary = 1, falloff = VORE_SOUND_FALLOFF) //CHOMPEdit
//these are all external sound triggers now, so it's ok.
if(emote_active)
+6
View File
@@ -200,6 +200,7 @@
"belly_fullscreen_color" = selected.belly_fullscreen_color,
"colorization_enabled" = selected.colorization_enabled,
"vorespawn_blacklist" = selected.vorespawn_blacklist, //CHOMP Addition: vorespawn blacklist
"sound_volume" = selected.sound_volume, //CHOMPAdd
//CHOMP add: vore sprite options
"affects_voresprite" = selected.affects_vore_sprites,
"absorbed_voresprite" = selected.count_absorbed_prey_for_sprite,
@@ -1294,6 +1295,11 @@
if(voretest)
SEND_SOUND(user, voretest)
. = TRUE
if("b_sound_volume") //CHOMPAdd
var/sound_volume_input = tgui_input_number(user, "Set belly sound volume percentage.", "Sound Volume", null, 100, 0)
if(!isnull(sound_volume_input)) //These have to be 'null' because both cancel and 0 are valid, separate options
host.vore_selected.sound_volume = sanitize_integer(sound_volume_input, 0, 100, initial(host.vore_selected.sound_volume))
. = TRUE
if("b_tastes")
host.vore_selected.can_taste = !host.vore_selected.can_taste
. = TRUE
+8 -2
View File
@@ -49,7 +49,7 @@ const digestModeToPreyMode = {
* show_liq, liq_interacts, liq_reagent_gen, liq_reagent_type, liq_reagent_name,
* liq_reagent_transfer_verb, liq_reagent_nutri_rate, liq_reagent_capacity, liq_sloshing, liq_reagent_addons,
* show_liq_fullness, liq_messages, liq_msg_toggle1, liq_msg_toggle2, liq_msg_toggle3, liq_msg_toggle4,
* liq_msg_toggle5, liq_msg1, liq_msg2, liq_msg3, liq_msg4, liq_msg5,
* liq_msg_toggle5, liq_msg1, liq_msg2, liq_msg3, liq_msg4, liq_msg5, sound_volume,
*
* To the tabs section of VoreSelectedBelly return
* <Tabs.Tab selected={tabIndex === 5} onClick={() => setTabIndex(5)}>
@@ -792,7 +792,7 @@ const VoreSelectedBellySounds = (props, context) => {
const { act } = useBackend(context);
const { belly } = props;
const { is_wet, wet_loop, fancy, sound, release_sound } = belly;
const { is_wet, wet_loop, fancy, sound, release_sound, sound_volume } = belly;
return (
<Flex wrap="wrap">
@@ -830,6 +830,12 @@ const VoreSelectedBellySounds = (props, context) => {
<Button onClick={() => act('set_attribute', { attribute: 'b_release' })} content={release_sound} />
<Button onClick={() => act('set_attribute', { attribute: 'b_releasesoundtest' })} icon="volume-up" />
</LabeledList.Item>
<LabeledList.Item label="Sound Volume">
<Button
onClick={() => act('set_attribute', { attribute: 'b_sound_volume' })}
content={sound_volume + '%'}
/>
</LabeledList.Item>
</LabeledList>
</Flex.Item>
</Flex>
File diff suppressed because one or more lines are too long