From 8305efd5a18cd027bdbe928d849e3496e895cb3b Mon Sep 17 00:00:00 2001 From: Poojawa Date: Wed, 21 Feb 2018 00:42:11 -0600 Subject: [PATCH] Vore preference fix + Sounds respect wall barriers (#5623) * various vore QoLs * removed unused button, added the verb --- code/modules/client/preferences.dm | 6 ++++-- code/modules/vore/eating/belly_vr.dm | 25 +++++++++-------------- code/modules/vore/eating/bellymodes_vr.dm | 10 ++++----- code/modules/vore/eating/living_vr.dm | 16 ++++++++++++--- code/modules/vore/eating/vorepanel_vr.dm | 11 ++++------ 5 files changed, 36 insertions(+), 32 deletions(-) diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index 982417fd21..75f8a0c75e 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -1675,14 +1675,16 @@ GLOBAL_LIST_EMPTY(preferences_datums) if("load") load_preferences() load_character() - attempt_vr(parent.prefs_vr,"load_vore","") + if(parent && parent.prefs_vr) + attempt_vr(parent.prefs_vr,"load_vore","") if("changeslot") if(!load_character(text2num(href_list["num"]))) random_character() real_name = random_unique_name(gender) save_character() - attempt_vr(parent.prefs_vr,"load_vore","") + if(parent && parent.prefs_vr) + attempt_vr(parent.prefs_vr,"load_vore","") if("tab") if (href_list["tab"]) diff --git a/code/modules/vore/eating/belly_vr.dm b/code/modules/vore/eating/belly_vr.dm index 45c3c73498..d175f51e02 100644 --- a/code/modules/vore/eating/belly_vr.dm +++ b/code/modules/vore/eating/belly_vr.dm @@ -117,7 +117,8 @@ return 0 for (var/atom/movable/M in internal_contents) M.forceMove(owner.loc) // Move the belly contents into the same location as belly's owner. - M << sound(null, repeat = 0, wait = 0, volume = 80, channel = CHANNEL_PREYLOOP) + for(var/mob/living/W in M) + W.stop_sound_channel(CHANNEL_PREYLOOP) internal_contents.Remove(M) // Remove from the belly contents var/datum/belly/B = check_belly(owner) // This makes sure that the mob behaves properly if released into another mob @@ -135,7 +136,8 @@ return FALSE // They weren't in this belly anyway M.forceMove(owner.loc) // Move the belly contents into the same location as belly's owner. - M << sound(null, repeat = 0, wait = 0, volume = 80, channel = CHANNEL_PREYLOOP) + for(var/mob/living/W in M) + W.stop_sound_channel(CHANNEL_PREYLOOP) src.internal_contents.Remove(M) // Remove from the belly contents var/datum/belly/B = check_belly(owner) @@ -150,15 +152,11 @@ // The purpose of this method is to avoid duplicate code, and ensure that all necessary // steps are taken. /datum/belly/proc/nom_mob(var/mob/prey, var/mob/user) -// if (prey.buckled) -// prey.buckled.unbuckle_mob() + var/sound/preyloop = sound('sound/vore/prey/loop.ogg', repeat = TRUE) prey.forceMove(owner) internal_contents.Add(prey) - -// var/datum/belly/B = check_belly(owner) -// if(B.silenced == FALSE) //this needs more testing later - prey << sound('sound/vore/prey/loop.ogg', repeat = 1, wait = 0, volume = 35, channel = CHANNEL_PREYLOOP) + prey.playsound_local(get_turf(prey),preyloop,40,0, channel = CHANNEL_PREYLOOP) // Handle prey messages if(inside_flavor) @@ -274,7 +272,7 @@ /datum/belly/proc/digestion_death(var/mob/living/M) is_full = TRUE internal_contents.Remove(M) - M << sound(null, repeat = 0, wait = 0, volume = 80, channel = CHANNEL_PREYLOOP) + M.stop_sound_channel(CHANNEL_PREYLOOP) // If digested prey is also a pred... anyone inside their bellies gets moved up. if(is_vore_predator(M)) for(var/bellytype in M.vore_organs) @@ -336,12 +334,10 @@ struggle_outer_message = "" + struggle_outer_message + "" struggle_user_message = "" + struggle_user_message + "" -// for(var/mob/M in hearers(4, owner)) -// M.visible_message(struggle_outer_message) // hearable R.visible_message( "[struggle_outer_message]", "[struggle_user_message]") - playsound(get_turf(owner),"struggle_sound",35,0,-6,1,channel=151) + playsound(get_turf(owner),"struggle_sound",35,0,-6,1,channel=151,ignore_walls = FALSE) R.stop_sound_channel(151) - R.playsound_local(get_turf(R), null, 45, S = prey_struggle) + R.playsound_local(get_turf(R),prey_struggle,45,0) if(escapable && R.a_intent != "help") //If the stomach has escapable enabled and the person is actually trying to kick out to_chat(R, "You attempt to climb out of \the [name].") @@ -393,8 +389,7 @@ // Re-use nom_mob target.nom_mob(content, target.owner) if(!silent) - for(var/mob/hearer in range(1,owner)) - hearer << sound(target.vore_sound,volume=80) + playsound(get_turf(owner),"[target].vore_sound",35,0,-6,1,ignore_walls = FALSE) /* //Handles creation of temporary 'vore chest' upon digestion /datum/belly/proc/slimy_mass(var/obj/item/content, var/mob/living/M) diff --git a/code/modules/vore/eating/bellymodes_vr.dm b/code/modules/vore/eating/bellymodes_vr.dm index ba5fa1e295..3d00f9e0fe 100644 --- a/code/modules/vore/eating/bellymodes_vr.dm +++ b/code/modules/vore/eating/bellymodes_vr.dm @@ -23,7 +23,7 @@ for (var/mob/living/M in internal_contents) if(prob(25)) M.stop_sound_channel(CHANNEL_PRED) - playsound(get_turf(owner),"digest_pred",50,0,-6,0,channel=CHANNEL_PRED) + playsound(get_turf(owner),"digest_pred",50,0,-6,0,channel=CHANNEL_PRED,ignore_walls = FALSE) M.stop_sound_channel(CHANNEL_PRED) M.playsound_local(get_turf(M), null, 45, S = prey_gurgle) @@ -52,7 +52,7 @@ owner.nutrition += 400 // so eating dead mobs gives you *something*. M.stop_sound_channel(CHANNEL_PRED) - playsound(get_turf(owner),"death_pred",45,0,-6,0,channel=CHANNEL_PRED) + playsound(get_turf(owner),"death_pred",45,0,-6,0,channel=CHANNEL_PRED,ignore_walls = FALSE) M.stop_sound_channel(CHANNEL_PRED) M.playsound_local(get_turf(M), null, 45, S = prey_digest) digestion_death(M) @@ -71,7 +71,7 @@ for (var/mob/living/M in internal_contents) if(prob(25)) M.stop_sound_channel(CHANNEL_PRED) - playsound(get_turf(owner),"digest_pred",35,0,-6,0,channel=CHANNEL_PRED) + playsound(get_turf(owner),"digest_pred",35,0,-6,0,channel=CHANNEL_PRED,ignore_walls = FALSE) M.stop_sound_channel(CHANNEL_PRED) M.playsound_local(get_turf(M), null, 45, S = prey_gurgle) @@ -88,7 +88,7 @@ for (var/mob/living/M in internal_contents) if(prob(35)) M.stop_sound_channel(CHANNEL_PRED) - playsound(get_turf(owner),"digest_pred",35,0,-6,0,channel=CHANNEL_PRED) + playsound(get_turf(owner),"digest_pred",35,0,-6,0,channel=CHANNEL_PRED,ignore_walls = FALSE) M.stop_sound_channel(CHANNEL_PRED) M.playsound_local(get_turf(M), null, 45, S = prey_gurgle) @@ -99,7 +99,7 @@ for (var/mob/living/M in internal_contents) if(prob(25)) M.stop_sound_channel(CHANNEL_PRED) - playsound(get_turf(owner),"digest_pred",50,0,-6,0,channel=CHANNEL_PRED) + playsound(get_turf(owner),"digest_pred",50,0,-6,0,channel=CHANNEL_PRED,ignore_walls = FALSE) M.stop_sound_channel(CHANNEL_PRED) M.playsound_local(get_turf(M), null, 45, S = prey_gurgle) diff --git a/code/modules/vore/eating/living_vr.dm b/code/modules/vore/eating/living_vr.dm index b7ace801cd..16a63c40ac 100644 --- a/code/modules/vore/eating/living_vr.dm +++ b/code/modules/vore/eating/living_vr.dm @@ -13,8 +13,8 @@ // Hook for generic creation of stuff on new creatures // /hook/living_new/proc/vore_setup(mob/living/M) - M.verbs += /mob/living/proc/escapeOOC M.verbs += /mob/living/proc/lick + M.verbs += /mob/living/proc/preyloop_refresh if(M.no_vore) //If the mob isn's supposed to have a stomach, let's not give it an insidepanel so it can make one for itself, or a stomach. M << "The creature that you are can not eat others." return TRUE @@ -191,7 +191,7 @@ // If we got this far, nom successful! Announce it! user.visible_message(success_msg) - playsound(get_turf(user), belly_target.vore_sound,75,0,-6,0) + playsound(get_turf(user), belly_target.vore_sound,75,0,-6,0,ignore_walls = FALSE) // Actually shove prey into the belly. belly_target.nom_mob(prey, user) @@ -286,6 +286,16 @@ if(M.loc != src) B.internal_contents.Remove(M) +// internal slimy button in case the loop stops playing but the player wants to hear it +/mob/living/proc/preyloop_refresh() + set name = "Internal loop refresh" + set category = "Vore" + if(ismob(src.loc)) + src.stop_sound_channel(CHANNEL_PREYLOOP) // sanity just in case + var/sound/preyloop = sound('sound/vore/prey/loop.ogg', repeat = TRUE) + src.playsound_local(get_turf(src),preyloop,40,0, channel = CHANNEL_PREYLOOP) + else + to_chat(src, "You aren't inside anything, you clod.") // OOC Escape code for pref-breaking or AFK preds // @@ -398,7 +408,7 @@ taste_message += "[vore_taste]" else if(ishuman(src)) - taste_message += "normal, like a critter should" + taste_message += "they haven't bothered to set their flavor text" else taste_message += "a plain old normal [src]" diff --git a/code/modules/vore/eating/vorepanel_vr.dm b/code/modules/vore/eating/vorepanel_vr.dm index 0f01a4c9e3..e9bb44765f 100644 --- a/code/modules/vore/eating/vorepanel_vr.dm +++ b/code/modules/vore/eating/vorepanel_vr.dm @@ -301,7 +301,7 @@ return selected.release_all_contents() - playsound(user, 'sound/vore/pred/escape.ogg', vol=80) + playsound(get_turf(user),'sound/vore/pred/escape.ogg',50,0,-5,0,ignore_walls = FALSE) to_chat(user.loc,"Everything is released from [user]!") if("Move all") @@ -318,9 +318,7 @@ for(var/atom/movable/tgt in selected.internal_contents) to_chat(tgt, "You're squished from [user]'s [selected] to their [B]!") selected.transfer_contents(tgt, B, 1) - - for(var/mob/hearer in range(1,user)) - hearer << sound('sound/vore/pred/stomachmove.ogg',volume=80) + playsound(get_turf(user),'sound/vore/pred/stomachmove.ogg',50,0,-5,0,ignore_walls = FALSE) var/atom/movable/tgt = locate(href_list["insidepick"]) if(!(tgt in selected.internal_contents)) //Old menu, needs updating because they aren't really there. @@ -337,7 +335,7 @@ return FALSE selected.release_specific_contents(tgt) - playsound(user, 'sound/effects/splat.ogg', 50, 1) + playsound(get_turf(user),'sound/effects/splat.ogg',50,0,-5,0,ignore_walls = FALSE) user.loc << "[tgt] is released from [user]!" if("Move") @@ -354,8 +352,7 @@ if (!(tgt in selected.internal_contents)) return FALSE to_chat(tgt, "You're moved from [user]'s [lowertext(selected.name)] to their [lowertext(B.name)]!") - for(var/mob/hearer in range(1,user)) - hearer << sound('sound/vore/pred/stomachmove.ogg',volume=80) + playsound(get_turf(user),'sound/vore/pred/stomachmove.ogg',50,0,-5,0,ignore_walls = FALSE) selected.transfer_contents(tgt, B) if(href_list["newbelly"])