From 9415ea095d5c9dd3995243f6ad1afd58f2eb84ca Mon Sep 17 00:00:00 2001 From: Poojawa Date: Tue, 21 Jan 2020 23:32:32 -0600 Subject: [PATCH 1/5] Fixes blindness on transfers --- code/modules/vore/eating/belly_obj.dm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/code/modules/vore/eating/belly_obj.dm b/code/modules/vore/eating/belly_obj.dm index ad54c8a0c8..1889f680e8 100644 --- a/code/modules/vore/eating/belly_obj.dm +++ b/code/modules/vore/eating/belly_obj.dm @@ -344,10 +344,10 @@ /obj/belly/proc/transfer_contents(var/atom/movable/content, var/obj/belly/target, silent = FALSE) if(!(content in src) || !istype(target)) return - content.forceMove(target) - for(var/mob/living/M in contents) + var/mob/living/M = content M.cure_blind("belly_[REF(src)]") -// target.nom_mob(content, target.owner) + content.forceMove(target) + if(vore_sound && !recent_sound && !silent) if((world.time + NORMIE_HEARCHECK) > last_hearcheck) LAZYCLEARLIST(hearing_mobs) @@ -368,6 +368,7 @@ owner.updateVRPanel() for(var/mob/living/M in contents) M.updateVRPanel() + M.become_blind("belly_[REF(src)]") // Get the line that should show up in Examine message if the owner of this belly // is examined. By making this a proc, we not only take advantage of polymorphism, From a665aeb50f6e0f7c4fbb06fdb743dbf756c4bd9e Mon Sep 17 00:00:00 2001 From: Poojawa Date: Tue, 21 Jan 2020 23:33:11 -0600 Subject: [PATCH 2/5] ok just skip this line I guess --- code/modules/vore/eating/belly_obj.dm | 1 + 1 file changed, 1 insertion(+) diff --git a/code/modules/vore/eating/belly_obj.dm b/code/modules/vore/eating/belly_obj.dm index 1889f680e8..61031c0a0d 100644 --- a/code/modules/vore/eating/belly_obj.dm +++ b/code/modules/vore/eating/belly_obj.dm @@ -344,6 +344,7 @@ /obj/belly/proc/transfer_contents(var/atom/movable/content, var/obj/belly/target, silent = FALSE) if(!(content in src) || !istype(target)) return + if(isliving(content)) var/mob/living/M = content M.cure_blind("belly_[REF(src)]") content.forceMove(target) From ace195080076b2ac924a0c818f3c78c64209f7d1 Mon Sep 17 00:00:00 2001 From: Poojawa Date: Wed, 22 Jan 2020 00:07:39 -0600 Subject: [PATCH 3/5] Makes listen checks a tad cheaper. Improves external sounds with falloff --- code/modules/vore/eating/belly_obj.dm | 21 ++--- code/modules/vore/eating/bellymodes.dm | 110 ++++++++----------------- 2 files changed, 46 insertions(+), 85 deletions(-) diff --git a/code/modules/vore/eating/belly_obj.dm b/code/modules/vore/eating/belly_obj.dm index 61031c0a0d..e2b2b33ba7 100644 --- a/code/modules/vore/eating/belly_obj.dm +++ b/code/modules/vore/eating/belly_obj.dm @@ -1,4 +1,5 @@ -//#define VORE_SOUND_FALLOFF 0.05 +#define VORE_SOUND_FALLOFF 0.1 +#define VORE_SOUND_RANGE 3 // // Belly system 2.0, now using objects instead of datums because EH at datums. @@ -175,7 +176,7 @@ if(vore_sound && !recent_sound) if((world.time + NORMIE_HEARCHECK) > last_hearcheck) LAZYCLEARLIST(hearing_mobs) - for(var/mob/living/H in get_hearers_in_view(3, owner)) + for(var/mob/living/H in get_hearers_in_view(VORE_SOUND_RANGE, owner)) if(!H.client || !(H.client.prefs.cit_toggles & EATING_NOISES)) continue LAZYADD(hearing_mobs, H) @@ -229,7 +230,7 @@ if(release_sound && !recent_sound) if((world.time + NORMIE_HEARCHECK) > last_hearcheck) LAZYCLEARLIST(hearing_mobs) - for(var/mob/living/H in get_hearers_in_view(3, owner)) + for(var/mob/living/H in get_hearers_in_view(VORE_SOUND_RANGE, owner)) if(!H.client || !(H.client.prefs.cit_toggles & EATING_NOISES)) continue LAZYADD(hearing_mobs, H) @@ -237,7 +238,7 @@ for(var/mob/living/H in hearing_mobs) if(H && H.client && (isturf(H.loc) || (H.loc != src.contents))) var/sound/releasement = GLOB.pred_release_sounds[release_sound] - SEND_SOUND(H,releasement) + H.playsound_local(owner.loc, releasement, vol = 75, vary = 1, falloff = VORE_SOUND_FALLOFF) else if(H && H in contents && H.client) var/sound/releasement = GLOB.prey_release_sounds[release_sound] SEND_SOUND(H,releasement) @@ -294,7 +295,7 @@ for(var/mob/living/H in hearing_mobs) if(H && H.client && (isturf(H.loc) || (H.loc != src.contents))) var/sound/releasement = GLOB.pred_release_sounds[release_sound] - SEND_SOUND(H,releasement) + H.playsound_local(owner.loc, releasement, vol = 75, vary = 1, falloff = VORE_SOUND_FALLOFF) else if(H && H in contents && H.client) var/sound/releasement = GLOB.prey_release_sounds[release_sound] SEND_SOUND(H,releasement) @@ -352,7 +353,7 @@ if(vore_sound && !recent_sound && !silent) if((world.time + NORMIE_HEARCHECK) > last_hearcheck) LAZYCLEARLIST(hearing_mobs) - for(var/mob/living/H in get_hearers_in_view(3, owner)) + for(var/mob/living/H in get_hearers_in_view(VORE_SOUND_RANGE, owner)) if(!H.client || !(H.client.prefs.cit_toggles & EATING_NOISES)) continue LAZYADD(hearing_mobs, H) @@ -360,7 +361,7 @@ for(var/mob/living/H in hearing_mobs) if(H && H.client && (isturf(H.loc) || (H.loc != src.contents))) var/sound/eating = GLOB.pred_vore_sounds[vore_sound] - SEND_SOUND(H,eating) + H.playsound_local(owner.loc, eating, vol = 75, vary = 1, falloff = VORE_SOUND_FALLOFF) else if(H && H in contents && H.client) var/sound/eating = GLOB.prey_vore_sounds[vore_sound] SEND_SOUND(H,eating) @@ -578,7 +579,7 @@ var/sound/struggle_rustle = sound(get_sfx("rustle")) LAZYCLEARLIST(hearing_mobs) - for(var/mob/living/H in get_hearers_in_view(3, owner)) + for(var/mob/living/H in get_hearers_in_view(VORE_SOUND_RANGE, owner)) if(!H.client || !(H.client.prefs.cit_toggles & EATING_NOISES)) continue LAZYADD(hearing_mobs, H) @@ -586,14 +587,14 @@ if(is_wet) for(var/mob/living/H in hearing_mobs) if(H && H.client && (isturf(H.loc) || (H.loc != src.contents))) - SEND_SOUND(H,pred_struggle_snuggle) + H.playsound_local(owner.loc, pred_struggle_snuggle, vol = 75, vary = 1, falloff = VORE_SOUND_FALLOFF) else if(H && H in contents && H.client) SEND_SOUND(H,prey_struggle_snuggle) else for(var/mob/living/H in hearing_mobs) if(H && H.client) - SEND_SOUND(H, struggle_rustle) + H.playsound_local(owner.loc, struggle_rustle, vol = 75, vary = 1, falloff = VORE_SOUND_FALLOFF) for(var/mob/living/H in hearing_mobs) if(H && H.client && (isturf(H.loc))) diff --git a/code/modules/vore/eating/bellymodes.dm b/code/modules/vore/eating/bellymodes.dm index 0ecaf49abc..6942a2d5a9 100644 --- a/code/modules/vore/eating/bellymodes.dm +++ b/code/modules/vore/eating/bellymodes.dm @@ -18,7 +18,8 @@ return SSBELLIES_PROCESSED next_process = times_fired + (6 SECONDS/wait) //Set up our next process time. - var/to_update = FALSE + var/play_sound //Potential sound to play at the end to avoid code duplication. + var/to_update = FALSE //Did anything update worthy happen? /////////////////////////// Auto-Emotes /////////////////////////// if(contents.len && next_emote <= times_fired) @@ -40,7 +41,7 @@ if(M.client.prefs.cit_toggles & DIGESTION_NOISES) var/sound/preyloop = sound('sound/vore/prey/loop.ogg') M.playsound_local(get_turf(src),preyloop, 80,0, channel = CHANNEL_PREYLOOP) - M.next_preyloop = (world.time + 51 SECONDS) + M.next_preyloop = (world.time + 52 SECONDS) /////////////////////////// Exit Early //////////////////////////// @@ -71,18 +72,9 @@ for (var/mob/living/M in contents) if(prob(25)) - if((world.time + NORMIE_HEARCHECK) > last_hearcheck) - LAZYCLEARLIST(hearing_mobs) - for(var/mob/living/H in get_hearers_in_view(3, owner)) - if(!H.client || !(H.client.prefs.cit_toggles & DIGESTION_NOISES)) - continue - LAZYADD(hearing_mobs, H) - last_hearcheck = world.time - for(var/mob/living/H in hearing_mobs) - if(H && H.client && (isturf(H.loc) || (H.loc != src.contents))) - SEND_SOUND(H,pred_digest) - else if(H && H in contents && H.client) - SEND_SOUND(H,prey_digest) + if(M && M.client && M.client.prefs.cit_toggles & DIGESTION_NOISES) + SEND_SOUND(M,prey_digest) + play_sound = pick(pred_digest) //Pref protection! if (!M.digestable || M.absorbed) @@ -108,18 +100,9 @@ M.visible_message("You watch as [owner]'s form loses its additions.") owner.nutrition += 400 // so eating dead mobs gives you *something*. - if((world.time + NORMIE_HEARCHECK) > last_hearcheck) - LAZYCLEARLIST(hearing_mobs) - for(var/mob/living/H in get_hearers_in_view(3, owner)) - if(!H.client || !(H.client.prefs.cit_toggles & DIGESTION_NOISES)) - continue - LAZYADD(hearing_mobs, H) - last_hearcheck = world.time - for(var/mob/living/H in hearing_mobs) - if(H && H.client && (isturf(H.loc) || (H.loc != src.contents))) - SEND_SOUND(H,pred_death) - else if(H && H in contents && H.client) - SEND_SOUND(H,prey_death) + play_sound = pick(pred_death) + if(M && M.client && M.client.prefs.cit_toggles & DIGESTION_NOISES) + SEND_SOUND(M,prey_death) M.stop_sound_channel(CHANNEL_PREYLOOP) digestion_death(M) owner.update_icons() @@ -142,19 +125,9 @@ if(digest_mode == DM_HEAL) for (var/mob/living/M in contents) if(prob(25)) - if((world.time + NORMIE_HEARCHECK) > last_hearcheck) - LAZYCLEARLIST(hearing_mobs) - for(var/mob/living/H in get_hearers_in_view(3, owner)) - if(!H.client || !(H.client.prefs.cit_toggles & DIGESTION_NOISES)) - continue - LAZYADD(hearing_mobs, H) - last_hearcheck = world.time - for(var/mob/living/H in hearing_mobs) - if(H && H.client && (isturf(H.loc) || (H.loc != src.contents))) - SEND_SOUND(H,pred_digest) - else if(H && H in contents && H.client) - SEND_SOUND(H,prey_digest) - + if(M && M.client && M.client.prefs.cit_toggles & DIGESTION_NOISES) + SEND_SOUND(M,prey_digest) + play_sound = pick(pred_digest) if(M.stat != DEAD) if(owner.nutrition >= NUTRITION_LEVEL_STARVING && (M.health < M.maxHealth)) M.adjustBruteLoss(-3) @@ -165,18 +138,10 @@ //for when you just want people to squelch around if(digest_mode == DM_NOISY) if(prob(35)) - if((world.time + NORMIE_HEARCHECK) > last_hearcheck) - LAZYCLEARLIST(hearing_mobs) - for(var/mob/living/H in get_hearers_in_view(3, owner)) - if(!H.client || !(H.client.prefs.cit_toggles & DIGESTION_NOISES)) - continue - LAZYADD(hearing_mobs, H) - last_hearcheck = world.time - for(var/mob/living/H in hearing_mobs) - if(H && H.client && (isturf(H.loc) || (H.loc != src.contents))) - SEND_SOUND(H,pred_digest) - else if(H && H in contents && H.client) - SEND_SOUND(H,prey_digest) + for(var/mob/M in contents) + if(M && M.client && M.client.prefs.cit_toggles & DIGESTION_NOISES) + SEND_SOUND(M,prey_digest) + play_sound = pick(pred_digest) //////////////////////////// DM_ABSORB //////////////////////////// @@ -185,18 +150,9 @@ for (var/mob/living/M in contents) if(prob(10))//Less often than gurgles. People might leave this on forever. - if((world.time + NORMIE_HEARCHECK) > last_hearcheck) - LAZYCLEARLIST(hearing_mobs) - for(var/mob/living/H in get_hearers_in_view(3, owner)) - if(!H.client || !(H.client.prefs.cit_toggles & DIGESTION_NOISES)) - continue - LAZYADD(hearing_mobs, H) - last_hearcheck = world.time - for(var/mob/living/H in hearing_mobs) - if(H && H.client && (isturf(H.loc) || (H.loc != src.contents))) - SEND_SOUND(H,pred_digest) - else if(H && H in contents && H.client) - SEND_SOUND(H,prey_digest) + if(M && M.client && M.client.prefs.cit_toggles & DIGESTION_NOISES) + SEND_SOUND(M,prey_digest) + play_sound = pick(pred_digest) if(M.absorbed) continue @@ -262,18 +218,9 @@ to_chat(owner, "[digest_alert_owner]") to_chat(M, "[digest_alert_prey]") M.visible_message("You watch as [owner]'s guts loudly rumble as it finishes off a meal.") - if((world.time + NORMIE_HEARCHECK) > last_hearcheck) - LAZYCLEARLIST(hearing_mobs) - for(var/mob/living/H in get_hearers_in_view(3, owner)) - if(!H.client || !(H.client.prefs.cit_toggles & DIGESTION_NOISES)) - continue - LAZYADD(hearing_mobs, H) - last_hearcheck = world.time - for(var/mob/living/H in hearing_mobs) - if(H && H.client && (isturf(H.loc) || (H.loc != src.contents))) - SEND_SOUND(H,pred_death) - else if(H && H in contents && H.client) - SEND_SOUND(H,prey_death) + play_sound = pick(pred_death) + if(M && M.client && M.client.prefs.cit_toggles & DIGESTION_NOISES) + SEND_SOUND(M,prey_death) M.spill_organs(FALSE,TRUE,TRUE) M.stop_sound_channel(CHANNEL_PREYLOOP) digestion_death(M) @@ -293,6 +240,19 @@ if(istype(T,/obj/item/reagent_containers/food) || istype(T,/obj/item/organ)) digest_item(T) +/////////////////////////// Make any noise /////////////////////////// + if(play_sound) + if((world.time + NORMIE_HEARCHECK) > last_hearcheck) + LAZYCLEARLIST(hearing_mobs) + for(var/mob/M in hearers(VORE_SOUND_RANGE, owner)) + if(!M.client || !(M.client.prefs.cit_toggles & DIGESTION_NOISES)) + continue + LAZYADD(hearing_mobs, M) + last_hearcheck = world.time + for(var/mob/M in hearing_mobs) //so we don't fill the whole room with the sound effect + if(M && M.client && (isturf(M.loc) || (M.loc != src.contents))) //to avoid people on the inside getting the outside sounds and their direct sounds + built in sound pref check + M.playsound_local(owner.loc, play_sound, vol = 75, vary = 1, falloff = VORE_SOUND_FALLOFF) + //these are all external sound triggers now, so it's ok. if(to_update) for(var/mob/living/M in contents) if(M.client) From ba50b4a851d044b79cb32c6e0ecedf6e47586f4f Mon Sep 17 00:00:00 2001 From: Ghom <42542238+Ghommie@users.noreply.github.com> Date: Fri, 24 Jan 2020 22:13:55 +0100 Subject: [PATCH 4/5] Risky web edit, disgusting contents. --- code/modules/vore/eating/belly_obj.dm | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/code/modules/vore/eating/belly_obj.dm b/code/modules/vore/eating/belly_obj.dm index e2b2b33ba7..062ea98773 100644 --- a/code/modules/vore/eating/belly_obj.dm +++ b/code/modules/vore/eating/belly_obj.dm @@ -165,7 +165,12 @@ . = ..() // Called whenever an atom enters this belly -/obj/belly/Entered(var/atom/movable/thing,var/atom/OldLoc) +/obj/belly/Entered(atom/movable/thing, atom/OldLoc) + . = ..() + var/mob/living/L //for chat messages and blindness + if(isliving(thing)) + L = thing + L.become_blind("belly_[REF(src)]") if(OldLoc in contents) return //Someone dropping something (or being stripdigested) @@ -190,11 +195,14 @@ SEND_SOUND(H,eating) recent_sound = TRUE - //Messages if it's a mob - if(isliving(thing)) - var/mob/living/M = thing - if(desc) - to_chat(M, "[desc]") + if(L && desc) + to_chat(L, "[desc]") + +/obj/belly/Entered(atom/movable/AM, atom/newloc) + . = ..() + if(isliving(AM)) + var/mob/living/L = AM + L.cure_blind("belly_[REF(src)]") // Release all contents of this belly into the owning mob's location. // If that location is another mob, contents are transferred into whichever of its bellies the owning mob is in. @@ -215,7 +223,6 @@ continue L.absorbed = FALSE L.stop_sound_channel(CHANNEL_PREYLOOP) - L.cure_blind("belly_[REF(src)]") SEND_SIGNAL(OW, COMSIG_CLEAR_MOOD_EVENT, "fedpred", /datum/mood_event/fedpred) SEND_SIGNAL(L, COMSIG_CLEAR_MOOD_EVENT, "fedprey", /datum/mood_event/fedprey) SEND_SIGNAL(OW, COMSIG_ADD_MOOD_EVENT, "emptypred", /datum/mood_event/emptypred) @@ -263,7 +270,6 @@ var/mob/living/OW = owner if(ML.client) ML.stop_sound_channel(CHANNEL_PREYLOOP) //Stop the internal loop, it'll restart if the isbelly check on next tick anyway - ML.cure_blind("belly_[REF(src)]") SEND_SIGNAL(OW, COMSIG_CLEAR_MOOD_EVENT, "fedpred", /datum/mood_event/fedpred) SEND_SIGNAL(ML, COMSIG_CLEAR_MOOD_EVENT, "fedprey", /datum/mood_event/fedprey) SEND_SIGNAL(OW, COMSIG_ADD_MOOD_EVENT, "emptypred", /datum/mood_event/emptypred) @@ -326,7 +332,6 @@ for(var/mob/living/M in contents) M.updateVRPanel() - M.become_blind("belly_[REF(src)]") // Setup the autotransfer checks if needed if(transferlocation != null && autotransferchance > 0) @@ -345,9 +350,6 @@ /obj/belly/proc/transfer_contents(var/atom/movable/content, var/obj/belly/target, silent = FALSE) if(!(content in src) || !istype(target)) return - if(isliving(content)) - var/mob/living/M = content - M.cure_blind("belly_[REF(src)]") content.forceMove(target) if(vore_sound && !recent_sound && !silent) @@ -370,7 +372,6 @@ owner.updateVRPanel() for(var/mob/living/M in contents) M.updateVRPanel() - M.become_blind("belly_[REF(src)]") // Get the line that should show up in Examine message if the owner of this belly // is examined. By making this a proc, we not only take advantage of polymorphism, From 2884bbdc23c6465a91ea773ee216e83a6c3dba59 Mon Sep 17 00:00:00 2001 From: Ghom <42542238+Ghommie@users.noreply.github.com> Date: Fri, 24 Jan 2020 22:15:33 +0100 Subject: [PATCH 5/5] I'm exiting this code. :eyes: --- code/modules/vore/eating/belly_obj.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/vore/eating/belly_obj.dm b/code/modules/vore/eating/belly_obj.dm index 062ea98773..f88f6bd6e8 100644 --- a/code/modules/vore/eating/belly_obj.dm +++ b/code/modules/vore/eating/belly_obj.dm @@ -198,7 +198,7 @@ if(L && desc) to_chat(L, "[desc]") -/obj/belly/Entered(atom/movable/AM, atom/newloc) +/obj/belly/Exited(atom/movable/AM, atom/newloc) . = ..() if(isliving(AM)) var/mob/living/L = AM