From 57ce44d9f6e8102912589726d68d76bc0b5d7015 Mon Sep 17 00:00:00 2001 From: SeepingVisage <160535199+SeepingVisage@users.noreply.github.com> Date: Sun, 12 Jan 2025 21:59:59 -0500 Subject: [PATCH] fixing the belch and fart and burp fixes playsound_prefed which was previously broken. also adds burping and farting prefs to the menu. awesome --- GainStation13/code/game/sound.dm | 43 +++++++++++++++++++----------- code/__DEFINES/citadel_defines.dm | 4 +-- code/game/sound.dm | 24 +++++++++++++++++ code/modules/client/preferences.dm | 7 +++++ 4 files changed, 61 insertions(+), 17 deletions(-) diff --git a/GainStation13/code/game/sound.dm b/GainStation13/code/game/sound.dm index 5f7401e17e..92303a0dc7 100644 --- a/GainStation13/code/game/sound.dm +++ b/GainStation13/code/game/sound.dm @@ -1,7 +1,7 @@ -/proc/playsound_prefed(atom/source, soundin, pref, vol as num, vary, extrarange as num, falloff, frequency = null, channel = 0, pressure_affected = TRUE, ignore_walls = TRUE, soundenvwet = -10000, soundenvdry = 0) +/proc/playsound_prefed(atom/source, soundin, pref, vol as num, vary, extrarange as num, falloff_exponent = SOUND_FALLOFF_EXPONENT, frequency = null, channel = 0, pressure_affected = TRUE, ignore_walls = TRUE, + falloff_distance = SOUND_DEFAULT_FALLOFF_DISTANCE, envwet = -10000, envdry = 0, distance_multiplier = SOUND_DEFAULT_DISTANCE_MULTIPLIER, distance_multiplier_min_range = SOUND_DEFAULT_MULTIPLIER_EFFECT_RANGE) if(isarea(source)) - throw EXCEPTION("playsound(): source is an area") - return + CRASH("playsound(): source is an area") var/turf/turf_source = get_turf(source) @@ -9,29 +9,42 @@ return //allocate a channel if necessary now so its the same for everyone - channel = channel //|| open_sound_channel() + channel = channel || SSsounds.random_available_channel() - // Looping through the player list has the added bonus of working for mobs inside containers + // Looping through the player list has the added bonus of working for mobs inside containers var/sound/S = sound(get_sfx(soundin)) - var/maxdistance = (world.view + extrarange) - var/z = turf_source.z - var/list/listeners = SSmobs.clients_by_zlevel[z] + var/maxdistance = SOUND_RANGE + extrarange + var/source_z = turf_source.z + var/list/listeners = SSmobs.clients_by_zlevel[source_z].Copy() + + var/turf/above_turf = SSmapping.get_turf_above(turf_source) + var/turf/below_turf = SSmapping.get_turf_below(turf_source) + if(!ignore_walls) //these sounds don't carry through walls listeners = listeners & hearers(maxdistance,turf_source) + if(above_turf && istransparentturf(above_turf)) + listeners += hearers(maxdistance,above_turf) + + if(below_turf && istransparentturf(turf_source)) + listeners += hearers(maxdistance,below_turf) + + else + if(above_turf && istransparentturf(above_turf)) + listeners += SSmobs.clients_by_zlevel[above_turf.z] + + if(below_turf && istransparentturf(turf_source)) + listeners += SSmobs.clients_by_zlevel[below_turf.z] + for(var/P in listeners) var/mob/M = P - if(!M.client) - continue if(!(M.client?.prefs.cit_toggles & pref)) continue if(get_dist(M, turf_source) <= maxdistance) - M.playsound_local(turf_source, soundin, vol, vary, frequency, falloff, channel, pressure_affected, S, soundenvwet, soundenvdry) - for(var/P in SSmobs.dead_players_by_zlevel[z]) + M.playsound_local(turf_source, soundin, vol, vary, frequency, falloff_exponent, channel, pressure_affected, S, maxdistance, falloff_distance, get_dist(M, turf_source) <= distance_multiplier_min_range? 1 : distance_multiplier, envwet, envdry) + for(var/P in SSmobs.dead_players_by_zlevel[source_z]) var/mob/M = P - if(!M.client) - continue if(!(M.client?.prefs.cit_toggles & pref)) continue if(get_dist(M, turf_source) <= maxdistance) - M.playsound_local(turf_source, soundin, vol, vary, frequency, falloff, channel, pressure_affected, S, soundenvwet, soundenvdry) + M.playsound_local(turf_source, soundin, vol, vary, frequency, falloff_exponent, channel, pressure_affected, S, maxdistance, falloff_distance, get_dist(M, turf_source) <= distance_multiplier_min_range? 1 : distance_multiplier, envwet, envdry) diff --git a/code/__DEFINES/citadel_defines.dm b/code/__DEFINES/citadel_defines.dm index 91173d9c22..a5b36e862e 100644 --- a/code/__DEFINES/citadel_defines.dm +++ b/code/__DEFINES/citadel_defines.dm @@ -147,5 +147,5 @@ #define OLD_CHARACTER_COLORING "old_color_system" #define ADVANCED_CHARACTER_COLORING "advanced_color_system" -#define FARTING_NOISES (1<<4) //GS13 -#define BURPING_NOISES (1<<5) //GS13 +#define FARTING_NOISES (1<<17) //GS13 +#define BURPING_NOISES (1<<18) //GS13 diff --git a/code/game/sound.dm b/code/game/sound.dm index a99d9aeaa9..c28b0a38e1 100644 --- a/code/game/sound.dm +++ b/code/game/sound.dm @@ -340,4 +340,28 @@ distance_multiplier - Can be used to multiply the distance at which the sound is if("smdelam") soundin = pick('sound/machines/sm/accent/delam/1.ogg', 'sound/machines/sm/accent/normal/2.ogg', 'sound/machines/sm/accent/normal/3.ogg', 'sound/machines/sm/accent/normal/4.ogg', 'sound/machines/sm/accent/normal/5.ogg', 'sound/machines/sm/accent/normal/6.ogg', 'sound/machines/sm/accent/normal/7.ogg', 'sound/machines/sm/accent/normal/8.ogg', 'sound/machines/sm/accent/normal/9.ogg', 'sound/machines/sm/accent/normal/10.ogg', 'sound/machines/sm/accent/normal/11.ogg', 'sound/machines/sm/accent/normal/12.ogg', 'sound/machines/sm/accent/normal/13.ogg', 'sound/machines/sm/accent/normal/14.ogg', 'sound/machines/sm/accent/normal/15.ogg', 'sound/machines/sm/accent/normal/16.ogg', 'sound/machines/sm/accent/normal/17.ogg', 'sound/machines/sm/accent/normal/18.ogg', 'sound/machines/sm/accent/normal/19.ogg', 'sound/machines/sm/accent/normal/20.ogg', 'sound/machines/sm/accent/normal/21.ogg', 'sound/machines/sm/accent/normal/22.ogg', 'sound/machines/sm/accent/normal/23.ogg', 'sound/machines/sm/accent/normal/24.ogg', 'sound/machines/sm/accent/normal/25.ogg', 'sound/machines/sm/accent/normal/26.ogg', 'sound/machines/sm/accent/normal/27.ogg', 'sound/machines/sm/accent/normal/28.ogg', 'sound/machines/sm/accent/normal/29.ogg', 'sound/machines/sm/accent/normal/30.ogg', 'sound/machines/sm/accent/normal/31.ogg', 'sound/machines/sm/accent/normal/32.ogg', 'sound/machines/sm/accent/normal/33.ogg') //END OF CIT CHANGES + // GS13 Start - Gainstation sounds + if("belch") + soundin = pick( 'GainStation13/sound/voice/belch1.ogg', 'GainStation13/sound/voice/belch2.ogg', + 'GainStation13/sound/voice/belch3.ogg', 'GainStation13/sound/voice/belch4.ogg', + 'GainStation13/sound/voice/belch5.ogg', 'GainStation13/sound/voice/belch6.ogg', + 'GainStation13/sound/voice/belch7.ogg', 'GainStation13/sound/voice/belch8.ogg', + 'GainStation13/sound/voice/belch9.ogg', 'GainStation13/sound/voice/belch10.ogg', + 'GainStation13/sound/voice/belch11.ogg') + if("brap") + soundin = pick( 'GainStation13/sound/voice/brap1.ogg', 'GainStation13/sound/voice/brap2.ogg', + 'GainStation13/sound/voice/brap3.ogg', 'GainStation13/sound/voice/brap4.ogg', + 'GainStation13/sound/voice/brap5.ogg', 'GainStation13/sound/voice/brap6.ogg', + 'GainStation13/sound/voice/brap7.ogg', 'GainStation13/sound/voice/brap8.ogg') + if("burp") + soundin = pick( 'GainStation13/sound/voice/burp1.ogg') + if("burunyu") + soundin = pick( 'GainStation13/sound/voice/funnycat.ogg') + if("fart") + soundin = pick( 'GainStation13/sound/voice/fart1.ogg', 'GainStation13/sound/voice/fart2.ogg', + 'GainStation13/sound/voice/fart3.ogg', 'GainStation13/sound/voice/fart4.ogg') + if("gurgle") + soundin = pick( 'GainStation13/sound/voice/gurgle1.ogg', 'GainStation13/sound/voice/gurgle2.ogg', + 'GainStation13/sound/voice/gurgle3.ogg') + // GS13 end return soundin diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index 86d374a70d..848f4161e6 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -1405,6 +1405,8 @@ GLOBAL_LIST_EMPTY(preferences_datums) dat += "Show that you want to be confronted:[trouble_seeker == TRUE ? "Enabled" : "Disabled"]
" dat += "Bot Feeding:[bot_feeding == TRUE ? "Enabled" : "Disabled"]
" dat += "Blueberry Inflation:[blueberry_inflation == TRUE ? "Enabled" : "Disabled"]
" + dat += "Hear Burping Noises: [(cit_toggles & BURPING_NOISES) ? "Allowed" : "Disallowed"]
" + dat += "Hear Farting Noises: [(cit_toggles & FARTING_NOISES) ? "Allowed" : "Disallowed"]
" dat += "

Weight Gain Types

" dat += "Food:[weight_gain_food == TRUE ? "Enabled" : "Disabled"]
" @@ -3505,6 +3507,11 @@ GLOBAL_LIST_EMPTY(preferences_datums) if("blueberry_inflation") blueberry_inflation = !blueberry_inflation + if("burping_noises") + cit_toggles ^= BURPING_NOISES + if("farting_noises") + cit_toggles ^= FARTING_NOISES + if("max_fatness") max_weight = chose_weight("Choose your max fatness level, your weight will not go beyond this. None will let you gain without a limit", user)