From e3342467b0065f36578bf25283dacd7ddd8c5f75 Mon Sep 17 00:00:00 2001 From: Poojawa Date: Thu, 4 Oct 2018 20:44:55 -0500 Subject: [PATCH 1/8] Sound prefs def should work this time, holy fuck --- .../code/modules/vore/eating/belly_obj_vr.dm | 2 + .../code/modules/vore/eating/bellymodes_vr.dm | 125 ++++++++++++------ 2 files changed, 83 insertions(+), 44 deletions(-) diff --git a/modular_citadel/code/modules/vore/eating/belly_obj_vr.dm b/modular_citadel/code/modules/vore/eating/belly_obj_vr.dm index 2ae5308835..ec75731411 100644 --- a/modular_citadel/code/modules/vore/eating/belly_obj_vr.dm +++ b/modular_citadel/code/modules/vore/eating/belly_obj_vr.dm @@ -48,6 +48,8 @@ var/tmp/list/items_preserved = list() // Stuff that wont digest so we shouldn't process it again. var/tmp/next_emote = 0 // When we're supposed to print our next emote, as a belly controller tick # var/tmp/recent_sound = FALSE // Prevent audio spam + var/tmp/last_hearcheck = 0 + var/tmp/list/hearing_mobs // Don't forget to watch your commas at the end of each line if you change these. var/list/struggle_messages_outside = list( diff --git a/modular_citadel/code/modules/vore/eating/bellymodes_vr.dm b/modular_citadel/code/modules/vore/eating/bellymodes_vr.dm index 8b8781cb02..804936087e 100644 --- a/modular_citadel/code/modules/vore/eating/bellymodes_vr.dm +++ b/modular_citadel/code/modules/vore/eating/bellymodes_vr.dm @@ -1,3 +1,5 @@ +#define NORMIE_HEARCHECK 4 + // Process the predator's effects upon the contents of its belly (i.e digestion/transformation etc) /obj/belly/proc/process_belly(var/times_fired,var/wait) //Passed by controller if((times_fired < next_process) || !contents.len) @@ -45,6 +47,7 @@ ////////////////////////// Sound vars ///////////////////////////// var/sound/prey_digest = sound(get_sfx("digest_prey")) var/sound/prey_death = sound(get_sfx("death_prey")) + var/turf/source = get_turf(owner) ///////////////////////////// DM_HOLD ///////////////////////////// @@ -55,12 +58,17 @@ else if(digest_mode == DM_DIGEST) for (var/mob/living/M in contents) if(prob(25)) - M.stop_sound_channel(CHANNEL_DIGEST) - for(var/mob/H in get_hearers_in_view(5, get_turf(owner))) - if(H.client && H.client.prefs.cit_toggles & DIGESTION_NOISES) - playsound(get_turf(owner),"digest_pred",50,0,-5,0,ignore_walls = FALSE,channel=CHANNEL_DIGEST) - M.stop_sound_channel(CHANNEL_DIGEST) - M.playsound_local(get_turf(M), prey_digest, 45) + if((world.time - NORMIE_HEARCHECK) > last_hearcheck) + LAZYCLEARLIST(hearing_mobs) + for(var/mob/H in get_hearers_in_view(3, source)) + if(!H.client || !(H.client.prefs.cit_toggles & DIGESTION_NOISES) && !isbelly(H.loc)) + continue + LAZYADD(hearing_mobs, H) + last_hearcheck = world.time + for(M in hearing_mobs) + var/mob/i = M + i.playsound_local(source, null, 45, falloff = 0, S = "digest_pred") + M.playsound_local(source, null, 45, falloff = 0, S = prey_digest) //Pref protection! if (!M.digestable || M.absorbed) @@ -86,13 +94,18 @@ M.visible_message("You watch as [owner]'s form loses its additions.") owner.nutrition += 400 // so eating dead mobs gives you *something*. - M.stop_sound_channel(DIGESTION_NOISES) - for(var/mob/H in get_hearers_in_view(5, get_turf(owner))) - if(H.client && H.client.prefs.cit_toggles & DIGESTION_NOISES) - playsound(get_turf(owner),"death_pred",50,0,-5,0,ignore_walls = FALSE,channel=CHANNEL_DIGEST) - M.stop_sound_channel(DIGESTION_NOISES) + if((world.time - NORMIE_HEARCHECK) > last_hearcheck) + LAZYCLEARLIST(hearing_mobs) + for(var/mob/H in get_hearers_in_view(3, source)) + if(!H.client || !(H.client.prefs.cit_toggles & DIGESTION_NOISES) && !isbelly(H.loc)) + continue + LAZYADD(hearing_mobs, H) + last_hearcheck = world.time + for(M in hearing_mobs) + var/mob/i = M + i.playsound_local(source, null, 45, falloff = 0, S = "death_pred") + M.playsound_local(source, null, 65, falloff = 0, S = prey_death) M.stop_sound_channel(CHANNEL_PREYLOOP) - M.playsound_local(get_turf(M), prey_death, 65) digestion_death(M) owner.update_icons() continue @@ -115,12 +128,17 @@ if(digest_mode == DM_HEAL) for (var/mob/living/M in contents) if(prob(25)) - M.stop_sound_channel(CHANNEL_DIGEST) - for(var/mob/H in get_hearers_in_view(5, get_turf(owner))) - if(H.client && H.client.prefs.cit_toggles & DIGESTION_NOISES) - playsound(get_turf(owner),"digest_pred",50,0,-5,0,ignore_walls = FALSE,channel=CHANNEL_DIGEST) - M.stop_sound_channel(CHANNEL_DIGEST) - M.playsound_local(get_turf(M), prey_digest, 65) + if((world.time - NORMIE_HEARCHECK) > last_hearcheck) + LAZYCLEARLIST(hearing_mobs) + for(var/mob/H in get_hearers_in_view(3, source)) + if(!H.client || !(H.client.prefs.cit_toggles & DIGESTION_NOISES) && !isbelly(H.loc)) + continue + LAZYADD(hearing_mobs, H) + last_hearcheck = world.time + for(M in hearing_mobs) + var/mob/i = M + i.playsound_local(source, null, 45, falloff = 0, S = "digest_pred") + M.playsound_local(source, null, 45, falloff = 0, S = prey_digest) if(M.stat != DEAD) if(owner.nutrition >= NUTRITION_LEVEL_STARVING && (M.health < M.maxHealth)) @@ -134,12 +152,17 @@ if(digest_mode == DM_NOISY) for (var/mob/living/M in contents) if(prob(35)) - M.stop_sound_channel(CHANNEL_DIGEST) - for(var/mob/H in get_hearers_in_view(5, get_turf(owner))) - if(H.client && H.client.prefs.cit_toggles & DIGESTION_NOISES) - playsound(get_turf(owner),"digest_pred",50,0,-5,0,ignore_walls = FALSE,channel=CHANNEL_DIGEST) - M.stop_sound_channel(CHANNEL_PRED) - M.playsound_local(get_turf(M), prey_digest, 65) + if((world.time - NORMIE_HEARCHECK) > last_hearcheck) + LAZYCLEARLIST(hearing_mobs) + for(var/mob/H in get_hearers_in_view(3, source)) + if(!H.client || !(H.client.prefs.cit_toggles & DIGESTION_NOISES) && !isbelly(H.loc)) + continue + LAZYADD(hearing_mobs, H) + last_hearcheck = world.time + for(M in hearing_mobs) + var/mob/i = M + i.playsound_local(source, null, 45, falloff = 0, S = "digest_pred") + M.playsound_local(source, null, 45, falloff = 0, S = prey_digest) //////////////////////////// DM_ABSORB //////////////////////////// @@ -147,13 +170,18 @@ for (var/mob/living/M in contents) - if(prob(10)) //Less often than gurgles. People might leave this on forever. - M.stop_sound_channel(CHANNEL_DIGEST) - for(var/mob/H in get_hearers_in_view(5, get_turf(owner))) - if(H.client && H.client.prefs.toggles & DIGESTION_NOISES) - playsound(get_turf(owner),"digest_pred",50,0,-5,0,ignore_walls = FALSE,channel=CHANNEL_DIGEST) - M.stop_sound_channel(CHANNEL_PRED) - M.playsound_local(get_turf(M), prey_digest, 65) + 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/H in get_hearers_in_view(3, source)) + if(!H.client || !(H.client.prefs.cit_toggles & DIGESTION_NOISES) && !isbelly(H.loc)) + continue + LAZYADD(hearing_mobs, H) + last_hearcheck = world.time + for(M in hearing_mobs) + var/mob/i = M + i.playsound_local(source, null, 45, falloff = 0, S = "digest_pred") + M.playsound_local(source, null, 45, falloff = 0, S = prey_digest) if(M.absorbed) continue @@ -180,12 +208,17 @@ if(digest_mode == DM_DRAGON) for (var/mob/living/M in contents) if(prob(55)) //if you're hearing this, you're a vore ho anyway. - M.stop_sound_channel(CHANNEL_DIGEST) - for(var/mob/H in get_hearers_in_view(5, get_turf(owner))) - if(H.client && H.client.prefs.cit_toggles & DIGESTION_NOISES) - playsound(get_turf(owner),"digest_pred",50,0,-5,0,ignore_walls = FALSE,channel=CHANNEL_DIGEST) - M.stop_sound_channel(CHANNEL_DIGEST) - M.playsound_local(get_turf(M), prey_digest, 65) + if((world.time - NORMIE_HEARCHECK) > last_hearcheck) + LAZYCLEARLIST(hearing_mobs) + for(var/mob/H in get_hearers_in_view(3, source)) + if(!H.client || !(H.client.prefs.cit_toggles & DIGESTION_NOISES) && !isbelly(H.loc)) + continue + LAZYADD(hearing_mobs, H) + last_hearcheck = world.time + for(M in hearing_mobs) + var/mob/i = M + i.playsound_local(source, null, 45, falloff = 0, S = "digest_pred") + M.playsound_local(source, null, 45, falloff = 0, S = prey_digest) //No digestion protection for megafauna. @@ -207,13 +240,17 @@ 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.") - - M.stop_sound_channel(CHANNEL_DIGEST) - for(var/mob/H in get_hearers_in_view(5, get_turf(owner))) - if(H.client && H.client.prefs.cit_toggles & DIGESTION_NOISES) - playsound(get_turf(owner),"death_pred",50,0,-5,0,ignore_walls = FALSE,channel=CHANNEL_DIGEST) - M.stop_sound_channel(CHANNEL_DIGEST) - M.playsound_local(get_turf(M), prey_death, 65) + if((world.time - NORMIE_HEARCHECK) > last_hearcheck) + LAZYCLEARLIST(hearing_mobs) + for(var/mob/H in get_hearers_in_view(3, source)) + if(!H.client || !(H.client.prefs.cit_toggles & DIGESTION_NOISES) && !isbelly(H.loc)) + continue + LAZYADD(hearing_mobs, H) + last_hearcheck = world.time + for(M in hearing_mobs) + var/mob/i = M + i.playsound_local(source, null, 45, falloff = 0, S = "death_pred") + M.playsound_local(source, null, 65, falloff = 0, S = prey_death) M.spill_organs(FALSE,TRUE,TRUE) M.stop_sound_channel(CHANNEL_PREYLOOP) digestion_death(M) From 2a9d412c7f1b5f3bea8df7b3f85c6de12488042c Mon Sep 17 00:00:00 2001 From: Poojawa Date: Thu, 4 Oct 2018 21:38:43 -0500 Subject: [PATCH 2/8] Ensures Normies don't freak out also hey, we're actually using those sounds now that I'm not brute forcing it like a meme. --- .../code/modules/vore/eating/bellymodes_vr.dm | 79 +++++++++++-------- 1 file changed, 44 insertions(+), 35 deletions(-) diff --git a/modular_citadel/code/modules/vore/eating/bellymodes_vr.dm b/modular_citadel/code/modules/vore/eating/bellymodes_vr.dm index 804936087e..25255814a5 100644 --- a/modular_citadel/code/modules/vore/eating/bellymodes_vr.dm +++ b/modular_citadel/code/modules/vore/eating/bellymodes_vr.dm @@ -47,6 +47,8 @@ ////////////////////////// Sound vars ///////////////////////////// var/sound/prey_digest = sound(get_sfx("digest_prey")) var/sound/prey_death = sound(get_sfx("death_prey")) + var/sound/pred_digest = sound(get_sfx("digest_pred")) + var/sound/pred_death = sound(get_sfx("death_pred")) var/turf/source = get_turf(owner) @@ -61,14 +63,15 @@ if((world.time - NORMIE_HEARCHECK) > last_hearcheck) LAZYCLEARLIST(hearing_mobs) for(var/mob/H in get_hearers_in_view(3, source)) - if(!H.client || !(H.client.prefs.cit_toggles & DIGESTION_NOISES) && !isbelly(H.loc)) + if(!H.client || !(H.client.prefs.cit_toggles & DIGESTION_NOISES)) continue LAZYADD(hearing_mobs, H) last_hearcheck = world.time - for(M in hearing_mobs) - var/mob/i = M - i.playsound_local(source, null, 45, falloff = 0, S = "digest_pred") - M.playsound_local(source, null, 45, falloff = 0, S = prey_digest) + for(var/mob/H in hearing_mobs) + if(!isbelly(H.loc)) + H.playsound_local(source, null, 45, falloff = 0, S = pred_digest) + else + H.playsound_local(source, null, 65, falloff = 0, S = prey_digest) //Pref protection! if (!M.digestable || M.absorbed) @@ -97,14 +100,15 @@ if((world.time - NORMIE_HEARCHECK) > last_hearcheck) LAZYCLEARLIST(hearing_mobs) for(var/mob/H in get_hearers_in_view(3, source)) - if(!H.client || !(H.client.prefs.cit_toggles & DIGESTION_NOISES) && !isbelly(H.loc)) + if(!H.client || !(H.client.prefs.cit_toggles & DIGESTION_NOISES)) continue LAZYADD(hearing_mobs, H) last_hearcheck = world.time - for(M in hearing_mobs) - var/mob/i = M - i.playsound_local(source, null, 45, falloff = 0, S = "death_pred") - M.playsound_local(source, null, 65, falloff = 0, S = prey_death) + for(var/mob/H in hearing_mobs) + if(!isbelly(H.loc)) + H.playsound_local(source, null, 45, falloff = 0, S = pred_death) + else + H.playsound_local(source, null, 65, falloff = 0, S = prey_death) M.stop_sound_channel(CHANNEL_PREYLOOP) digestion_death(M) owner.update_icons() @@ -131,14 +135,15 @@ if((world.time - NORMIE_HEARCHECK) > last_hearcheck) LAZYCLEARLIST(hearing_mobs) for(var/mob/H in get_hearers_in_view(3, source)) - if(!H.client || !(H.client.prefs.cit_toggles & DIGESTION_NOISES) && !isbelly(H.loc)) + if(!H.client || !(H.client.prefs.cit_toggles & DIGESTION_NOISES)) continue LAZYADD(hearing_mobs, H) last_hearcheck = world.time - for(M in hearing_mobs) - var/mob/i = M - i.playsound_local(source, null, 45, falloff = 0, S = "digest_pred") - M.playsound_local(source, null, 45, falloff = 0, S = prey_digest) + for(var/mob/H in hearing_mobs) + if(!isbelly(H.loc)) + H.playsound_local(source, null, 45, falloff = 0, S = pred_digest) + else + H.playsound_local(source, null, 65, falloff = 0, S = prey_digest) if(M.stat != DEAD) if(owner.nutrition >= NUTRITION_LEVEL_STARVING && (M.health < M.maxHealth)) @@ -155,14 +160,15 @@ if((world.time - NORMIE_HEARCHECK) > last_hearcheck) LAZYCLEARLIST(hearing_mobs) for(var/mob/H in get_hearers_in_view(3, source)) - if(!H.client || !(H.client.prefs.cit_toggles & DIGESTION_NOISES) && !isbelly(H.loc)) + if(!H.client || !(H.client.prefs.cit_toggles & DIGESTION_NOISES)) continue LAZYADD(hearing_mobs, H) last_hearcheck = world.time - for(M in hearing_mobs) - var/mob/i = M - i.playsound_local(source, null, 45, falloff = 0, S = "digest_pred") - M.playsound_local(source, null, 45, falloff = 0, S = prey_digest) + for(var/mob/H in hearing_mobs) + if(!isbelly(H.loc)) + H.playsound_local(source, null, 45, falloff = 0, S = pred_digest) + else + H.playsound_local(source, null, 65, falloff = 0, S = prey_digest) //////////////////////////// DM_ABSORB //////////////////////////// @@ -174,14 +180,15 @@ if((world.time - NORMIE_HEARCHECK) > last_hearcheck) LAZYCLEARLIST(hearing_mobs) for(var/mob/H in get_hearers_in_view(3, source)) - if(!H.client || !(H.client.prefs.cit_toggles & DIGESTION_NOISES) && !isbelly(H.loc)) + if(!H.client || !(H.client.prefs.cit_toggles & DIGESTION_NOISES)) continue LAZYADD(hearing_mobs, H) last_hearcheck = world.time - for(M in hearing_mobs) - var/mob/i = M - i.playsound_local(source, null, 45, falloff = 0, S = "digest_pred") - M.playsound_local(source, null, 45, falloff = 0, S = prey_digest) + for(var/mob/H in hearing_mobs) + if(!isbelly(H.loc)) + H.playsound_local(source, null, 45, falloff = 0, S = pred_digest) + else + H.playsound_local(source, null, 65, falloff = 0, S = prey_digest) if(M.absorbed) continue @@ -211,14 +218,15 @@ if((world.time - NORMIE_HEARCHECK) > last_hearcheck) LAZYCLEARLIST(hearing_mobs) for(var/mob/H in get_hearers_in_view(3, source)) - if(!H.client || !(H.client.prefs.cit_toggles & DIGESTION_NOISES) && !isbelly(H.loc)) + if(!H.client || !(H.client.prefs.cit_toggles & DIGESTION_NOISES)) continue LAZYADD(hearing_mobs, H) last_hearcheck = world.time - for(M in hearing_mobs) - var/mob/i = M - i.playsound_local(source, null, 45, falloff = 0, S = "digest_pred") - M.playsound_local(source, null, 45, falloff = 0, S = prey_digest) + for(var/mob/H in hearing_mobs) + if(!isbelly(H.loc)) + H.playsound_local(source, null, 45, falloff = 0, S = pred_digest) + else + H.playsound_local(source, null, 65, falloff = 0, S = prey_digest) //No digestion protection for megafauna. @@ -243,14 +251,15 @@ if((world.time - NORMIE_HEARCHECK) > last_hearcheck) LAZYCLEARLIST(hearing_mobs) for(var/mob/H in get_hearers_in_view(3, source)) - if(!H.client || !(H.client.prefs.cit_toggles & DIGESTION_NOISES) && !isbelly(H.loc)) + if(!H.client || !(H.client.prefs.cit_toggles & DIGESTION_NOISES)) continue LAZYADD(hearing_mobs, H) last_hearcheck = world.time - for(M in hearing_mobs) - var/mob/i = M - i.playsound_local(source, null, 45, falloff = 0, S = "death_pred") - M.playsound_local(source, null, 65, falloff = 0, S = prey_death) + for(var/mob/H in hearing_mobs) + if(!isbelly(H.loc)) + H.playsound_local(source, null, 45, falloff = 0, S = pred_death) + else + H.playsound_local(source, null, 65, falloff = 0, S = prey_death) M.spill_organs(FALSE,TRUE,TRUE) M.stop_sound_channel(CHANNEL_PREYLOOP) digestion_death(M) From 0b245e5eb0eceb01d11b91582218ee6b947444b3 Mon Sep 17 00:00:00 2001 From: Poojawa Date: Fri, 5 Oct 2018 08:08:14 -0500 Subject: [PATCH 3/8] Medihound Tweaks --- .../objects/items/devices/dogborg_sleeper.dm | 38 ++++++++++++++----- 1 file changed, 28 insertions(+), 10 deletions(-) diff --git a/code/game/objects/items/devices/dogborg_sleeper.dm b/code/game/objects/items/devices/dogborg_sleeper.dm index e12344fa53..8085f8edcf 100644 --- a/code/game/objects/items/devices/dogborg_sleeper.dm +++ b/code/game/objects/items/devices/dogborg_sleeper.dm @@ -13,7 +13,7 @@ var/cleaning = FALSE var/cleaning_cycles = 10 var/patient_laststat = null - var/list/injection_chems = list("antitoxin", "epinephrine", "morphine", "salbutamol", "bicaridine", "kelotane") + var/list/injection_chems = list("antitoxin", "epinephrine", "salbutamol", "bicaridine", "kelotane") var/eject_port = "ingestion" var/escape_in_progress = FALSE var/message_cooldown @@ -59,7 +59,7 @@ return if(!iscarbon(target)) return - if(!(target.client && target.client.prefs && target.client.prefs.toggles && (target.client.prefs.toggles & MEDIHOUND_SLEEPER))) + if(!target.client || !(target.client.prefs.cit_toggles & MEDIHOUND_SLEEPER)) to_chat(user, "This person is incompatible with our equipment.") return if(target.buckled) @@ -293,10 +293,19 @@ to_chat(hound,"You feel your belly slowly churn around [T], breaking them down into a soft slurry to be used as power for your systems.") to_chat(T,"You feel [hound]'s belly slowly churn around your form, breaking you down into a soft slurry to be used as power for [hound]'s systems.") hound.cell.give(30000) //Fueeeeellll - T.stop_sound_channel(CHANNEL_PRED) - playsound(get_turf(hound),"death_pred",50,0,-6,0,channel=CHANNEL_PRED,ignore_walls = FALSE) - T.stop_sound_channel(CHANNEL_PRED) - T.playsound_local("death_prey",60) + if((world.time - NORMIE_HEARCHECK) > last_hearcheck) + var/turf/source = get_turf(owner) + LAZYCLEARLIST(hearing_mobs) + for(var/mob/H in get_hearers_in_view(3, source)) + if(!H.client || !(H.client.prefs.cit_toggles & DIGESTION_NOISES)) + continue + LAZYADD(hearing_mobs, H) + last_hearcheck = world.time + for(var/mob/H in hearing_mobs) + if(!istype(H.loc, /obj/item/dogborg/sleeper)) + H.playsound_local(source, null, 45, falloff = 0, S = pred_death) + else + H.playsound_local(source, null, 65, falloff = 0, S = prey_death) for(var/belly in T.vore_organs) var/obj/belly/B = belly for(var/atom/movable/thing in B) @@ -333,10 +342,19 @@ //sound effects for(var/mob/living/M in contents) if(prob(50)) - M.stop_sound_channel(CHANNEL_PRED) - playsound(get_turf(hound),"digest_pred",35,0,-6,0,channel=CHANNEL_PRED,ignore_walls = FALSE) - M.stop_sound_channel(CHANNEL_PRED) - M.playsound_local("digest_prey",60) + if((world.time - NORMIE_HEARCHECK) > last_hearcheck) + var/turf/source = get_turf(owner) + LAZYCLEARLIST(hearing_mobs) + for(var/mob/H in get_hearers_in_view(3, source)) + if(!H.client || !(H.client.prefs.cit_toggles & DIGESTION_NOISES)) + continue + LAZYADD(hearing_mobs, H) + last_hearcheck = world.time + for(var/mob/H in hearing_mobs) + if(!istype(H.loc, /obj/item/dogborg/sleeper)) + H.playsound_local(source, null, 45, falloff = 0, S = pred_digest) + else + H.playsound_local(source, null, 65, falloff = 0, S = prey_digest) if(cleaning) addtimer(CALLBACK(src, .proc/clean_cycle), 50) From 1f3c2d6961a5a69b7cd0dd86d4561079ba4b3c0b Mon Sep 17 00:00:00 2001 From: Poojawa Date: Fri, 5 Oct 2018 08:24:52 -0500 Subject: [PATCH 4/8] oops --- .../objects/items/devices/dogborg_sleeper.dm | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/code/game/objects/items/devices/dogborg_sleeper.dm b/code/game/objects/items/devices/dogborg_sleeper.dm index 8085f8edcf..5af643217d 100644 --- a/code/game/objects/items/devices/dogborg_sleeper.dm +++ b/code/game/objects/items/devices/dogborg_sleeper.dm @@ -296,11 +296,11 @@ if((world.time - NORMIE_HEARCHECK) > last_hearcheck) var/turf/source = get_turf(owner) LAZYCLEARLIST(hearing_mobs) - for(var/mob/H in get_hearers_in_view(3, source)) - if(!H.client || !(H.client.prefs.cit_toggles & DIGESTION_NOISES)) - continue - LAZYADD(hearing_mobs, H) - last_hearcheck = world.time + for(var/mob/H in get_hearers_in_view(3, source)) + if(!H.client || !(H.client.prefs.cit_toggles & DIGESTION_NOISES)) + continue + LAZYADD(hearing_mobs, H) + last_hearcheck = world.time for(var/mob/H in hearing_mobs) if(!istype(H.loc, /obj/item/dogborg/sleeper)) H.playsound_local(source, null, 45, falloff = 0, S = pred_death) @@ -345,11 +345,11 @@ if((world.time - NORMIE_HEARCHECK) > last_hearcheck) var/turf/source = get_turf(owner) LAZYCLEARLIST(hearing_mobs) - for(var/mob/H in get_hearers_in_view(3, source)) - if(!H.client || !(H.client.prefs.cit_toggles & DIGESTION_NOISES)) - continue - LAZYADD(hearing_mobs, H) - last_hearcheck = world.time + for(var/mob/H in get_hearers_in_view(3, source)) + if(!H.client || !(H.client.prefs.cit_toggles & DIGESTION_NOISES)) + continue + LAZYADD(hearing_mobs, H) + last_hearcheck = world.time for(var/mob/H in hearing_mobs) if(!istype(H.loc, /obj/item/dogborg/sleeper)) H.playsound_local(source, null, 45, falloff = 0, S = pred_digest) From bcabdaa0dcbd51f12601656c7663e3b86dd31c32 Mon Sep 17 00:00:00 2001 From: Poojawa Date: Fri, 5 Oct 2018 09:34:01 -0500 Subject: [PATCH 5/8] Let's do this better Make it initialize and clean up processing memes m'yes. Icons update properly now too, how about that. --- code/__DEFINES/citadel_defines.dm | 3 ++ .../objects/items/devices/dogborg_sleeper.dm | 28 ++++++++++++------- .../code/modules/vore/eating/bellymodes_vr.dm | 2 +- 3 files changed, 22 insertions(+), 11 deletions(-) diff --git a/code/__DEFINES/citadel_defines.dm b/code/__DEFINES/citadel_defines.dm index 7744b24d0f..e5749764e0 100644 --- a/code/__DEFINES/citadel_defines.dm +++ b/code/__DEFINES/citadel_defines.dm @@ -128,3 +128,6 @@ //component stuff #define COMSIG_COMBAT_TOGGLED "combatmode_toggled" //called by combat mode toggle on all equipped items. args: (mob/user, combatmode) + +//belly sound pref things +#define NORMIE_HEARCHECK 4 diff --git a/code/game/objects/items/devices/dogborg_sleeper.dm b/code/game/objects/items/devices/dogborg_sleeper.dm index 5af643217d..bbac39afff 100644 --- a/code/game/objects/items/devices/dogborg_sleeper.dm +++ b/code/game/objects/items/devices/dogborg_sleeper.dm @@ -18,6 +18,8 @@ var/escape_in_progress = FALSE var/message_cooldown var/breakout_time = 300 + var/tmp/last_hearcheck = 0 + var/tmp/list/hearing_mobs var/list/items_preserved = list() var/static/list/important_items = typecacheof(list( /obj/item/hand_tele, @@ -45,10 +47,16 @@ // Bags are prohibited from this due to the potential explotation of objects, same with brought -/obj/item/dogborg/sleeper/New() - ..() +/obj/item/dogborg/sleeper/Initialize() + . = ..() update_icon() item_flags |= NOBLUDGEON //No more attack messages + START_PROCESSING(SSobj, src) + +/obj/item/dogborg/sleeper/Destroy() + STOP_PROCESSING(SSobj, src) + go_out() //just... sanity I guess, edge case shit + return ..() /obj/item/dogborg/sleeper/Exit(atom/movable/O) return 0 @@ -86,7 +94,6 @@ target.forceMove(src) target.reset_perspective(src) update_gut() - START_PROCESSING(SSobj, src) user.visible_message("[hound.name]'s medical pod lights up and expands as [target.name] slips inside into their [src.name].", "Your medical pod lights up as [target] slips into your [src]. Life support functions engaged.") message_admins("[key_name(hound)] has sleeper'd [key_name(patient)] as a dogborg. [ADMIN_JMP(src)]") playsound(hound, 'sound/effects/bin_close.ogg', 100, 1) @@ -137,7 +144,8 @@ else //You clicked eject with nothing in you, let's just reset stuff to be sure. items_preserved.Cut() cleaning = FALSE - update_gut() + update_gut() + /obj/item/dogborg/sleeper/attack_self(mob/user) if(..()) @@ -265,7 +273,6 @@ patient_laststat = null patient = null hound.update_icons() - return //Gurgleborg process /obj/item/dogborg/sleeper/proc/clean_cycle() @@ -274,6 +281,10 @@ if(!(I in contents)) items_preserved -= I var/list/touchable_items = contents - items_preserved + var/sound/prey_digest = sound(get_sfx("digest_prey")) + var/sound/prey_death = sound(get_sfx("death_prey")) + var/sound/pred_digest = sound(get_sfx("digest_pred")) + var/sound/pred_death = sound(get_sfx("death_pred")) if(cleaning_cycles) cleaning_cycles-- cleaning = TRUE @@ -294,7 +305,7 @@ to_chat(T,"You feel [hound]'s belly slowly churn around your form, breaking you down into a soft slurry to be used as power for [hound]'s systems.") hound.cell.give(30000) //Fueeeeellll if((world.time - NORMIE_HEARCHECK) > last_hearcheck) - var/turf/source = get_turf(owner) + var/turf/source = get_turf(hound) LAZYCLEARLIST(hearing_mobs) for(var/mob/H in get_hearers_in_view(3, source)) if(!H.client || !(H.client.prefs.cit_toggles & DIGESTION_NOISES)) @@ -337,13 +348,12 @@ to_chat(hound, "Your [src] is now clean. Ending self-cleaning cycle.") cleaning = FALSE update_gut() - return //sound effects for(var/mob/living/M in contents) if(prob(50)) if((world.time - NORMIE_HEARCHECK) > last_hearcheck) - var/turf/source = get_turf(owner) + var/turf/source = get_turf(hound) LAZYCLEARLIST(hearing_mobs) for(var/mob/H in get_hearers_in_view(3, source)) if(!H.client || !(H.client.prefs.cit_toggles & DIGESTION_NOISES)) @@ -425,7 +435,6 @@ brigman.forceMove(src) brigman.reset_perspective(src) update_gut() - START_PROCESSING(SSobj, src) user.visible_message("[hound.name]'s mobile brig clunks in series as [brigman] slips inside.", "Your mobile brig groans lightly as [brigman] slips inside.") playsound(hound, 'sound/effects/bin_close.ogg', 80, 1) // Really don't need ERP sound effects for robots return @@ -499,7 +508,6 @@ trashman.forceMove(src) trashman.reset_perspective(src) update_gut() - START_PROCESSING(SSobj, src) user.visible_message("[hound.name]'s garbage processor groans lightly as [trashman] slips inside.", "Your garbage compactor groans lightly as [trashman] slips inside.") playsound(hound, 'sound/effects/bin_close.ogg', 80, 1) return diff --git a/modular_citadel/code/modules/vore/eating/bellymodes_vr.dm b/modular_citadel/code/modules/vore/eating/bellymodes_vr.dm index 25255814a5..707e3106af 100644 --- a/modular_citadel/code/modules/vore/eating/bellymodes_vr.dm +++ b/modular_citadel/code/modules/vore/eating/bellymodes_vr.dm @@ -1,4 +1,4 @@ -#define NORMIE_HEARCHECK 4 + // Process the predator's effects upon the contents of its belly (i.e digestion/transformation etc) /obj/belly/proc/process_belly(var/times_fired,var/wait) //Passed by controller From 24dcf821a1c2b44880435ec42877b9d71377c830 Mon Sep 17 00:00:00 2001 From: Poojawa Date: Mon, 8 Oct 2018 02:39:08 -0500 Subject: [PATCH 6/8] Update mine_items.dm --- code/modules/mining/mine_items.dm | 1 - 1 file changed, 1 deletion(-) diff --git a/code/modules/mining/mine_items.dm b/code/modules/mining/mine_items.dm index 637dde45b9..a1ba493d46 100644 --- a/code/modules/mining/mine_items.dm +++ b/code/modules/mining/mine_items.dm @@ -60,7 +60,6 @@ new /obj/item/gun/energy/kinetic_accelerator(src) new /obj/item/clothing/glasses/meson(src) new /obj/item/survivalcapsule(src) - new /obj/item/suit_voucher(src) new /obj/item/assault_pod/mining(src) From c6d6da3bb400c525bf3660456d5a3a9d8bfd86f6 Mon Sep 17 00:00:00 2001 From: Poojawa Date: Mon, 8 Oct 2018 09:18:41 -0500 Subject: [PATCH 7/8] fuckin' merge memes --- modular_citadel/code/modules/vore/eating/belly_obj_vr.dm | 2 ++ modular_citadel/code/modules/vore/eating/bellymodes_vr.dm | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/modular_citadel/code/modules/vore/eating/belly_obj_vr.dm b/modular_citadel/code/modules/vore/eating/belly_obj_vr.dm index 2ae5308835..ec75731411 100644 --- a/modular_citadel/code/modules/vore/eating/belly_obj_vr.dm +++ b/modular_citadel/code/modules/vore/eating/belly_obj_vr.dm @@ -48,6 +48,8 @@ var/tmp/list/items_preserved = list() // Stuff that wont digest so we shouldn't process it again. var/tmp/next_emote = 0 // When we're supposed to print our next emote, as a belly controller tick # var/tmp/recent_sound = FALSE // Prevent audio spam + var/tmp/last_hearcheck = 0 + var/tmp/list/hearing_mobs // Don't forget to watch your commas at the end of each line if you change these. var/list/struggle_messages_outside = list( diff --git a/modular_citadel/code/modules/vore/eating/bellymodes_vr.dm b/modular_citadel/code/modules/vore/eating/bellymodes_vr.dm index 276af60bdb..54c3df6cbd 100644 --- a/modular_citadel/code/modules/vore/eating/bellymodes_vr.dm +++ b/modular_citadel/code/modules/vore/eating/bellymodes_vr.dm @@ -108,7 +108,6 @@ else H.playsound_local(source, null, 65, falloff = 0, S = prey_death) M.stop_sound_channel(CHANNEL_PREYLOOP) - M.playsound_local(get_turf(M), prey_death, 65) digestion_death(M) owner.update_icons() continue From c638a2783a70fe85bde687bd9e94e8532fd4d5a1 Mon Sep 17 00:00:00 2001 From: Poojawa Date: Mon, 8 Oct 2018 20:43:26 -0500 Subject: [PATCH 8/8] improves accuracy of playsounds removes excessively defined for (var/mob/living/M in contents) that didn't need it --- .../objects/items/devices/dogborg_sleeper.dm | 31 +++++++-------- .../code/modules/vore/eating/belly_obj_vr.dm | 10 ++--- .../code/modules/vore/eating/bellymodes_vr.dm | 39 +++++++++---------- 3 files changed, 39 insertions(+), 41 deletions(-) diff --git a/code/game/objects/items/devices/dogborg_sleeper.dm b/code/game/objects/items/devices/dogborg_sleeper.dm index bbac39afff..30a3e5a9a2 100644 --- a/code/game/objects/items/devices/dogborg_sleeper.dm +++ b/code/game/objects/items/devices/dogborg_sleeper.dm @@ -315,7 +315,7 @@ for(var/mob/H in hearing_mobs) if(!istype(H.loc, /obj/item/dogborg/sleeper)) H.playsound_local(source, null, 45, falloff = 0, S = pred_death) - else + else if(H in contents) H.playsound_local(source, null, 65, falloff = 0, S = prey_death) for(var/belly in T.vore_organs) var/obj/belly/B = belly @@ -350,21 +350,20 @@ update_gut() //sound effects - for(var/mob/living/M in contents) - if(prob(50)) - if((world.time - NORMIE_HEARCHECK) > last_hearcheck) - var/turf/source = get_turf(hound) - LAZYCLEARLIST(hearing_mobs) - for(var/mob/H in get_hearers_in_view(3, source)) - if(!H.client || !(H.client.prefs.cit_toggles & DIGESTION_NOISES)) - continue - LAZYADD(hearing_mobs, H) - last_hearcheck = world.time - for(var/mob/H in hearing_mobs) - if(!istype(H.loc, /obj/item/dogborg/sleeper)) - H.playsound_local(source, null, 45, falloff = 0, S = pred_digest) - else - H.playsound_local(source, null, 65, falloff = 0, S = prey_digest) + if(prob(50)) + if((world.time - NORMIE_HEARCHECK) > last_hearcheck) + var/turf/source = get_turf(hound) + LAZYCLEARLIST(hearing_mobs) + for(var/mob/H in get_hearers_in_view(3, source)) + if(!H.client || !(H.client.prefs.cit_toggles & DIGESTION_NOISES)) + continue + LAZYADD(hearing_mobs, H) + last_hearcheck = world.time + for(var/mob/H in hearing_mobs) + if(!istype(H.loc, /obj/item/dogborg/sleeper)) + H.playsound_local(source, null, 45, falloff = 0, S = pred_digest) + else if(H in contents) + H.playsound_local(source, null, 65, falloff = 0, S = prey_digest) if(cleaning) addtimer(CALLBACK(src, .proc/clean_cycle), 50) diff --git a/modular_citadel/code/modules/vore/eating/belly_obj_vr.dm b/modular_citadel/code/modules/vore/eating/belly_obj_vr.dm index ec75731411..1aa8122be5 100644 --- a/modular_citadel/code/modules/vore/eating/belly_obj_vr.dm +++ b/modular_citadel/code/modules/vore/eating/belly_obj_vr.dm @@ -169,7 +169,7 @@ //Sound w/ antispam flag setting if(!silent && !recent_sound) for(var/mob/M in get_hearers_in_view(5, get_turf(owner))) - if(M.client && M.client.prefs.cit_toggles & EATING_NOISES) + if(M.client && (M.client.prefs.cit_toggles & EATING_NOISES)) playsound(get_turf(owner),"[src.vore_sound]",50,0,-5,0,ignore_walls = FALSE,channel=CHANNEL_PRED) recent_sound = TRUE @@ -202,7 +202,7 @@ AM.forceMove(destination) // Move the belly contents into the same location as belly's owner. count++ for(var/mob/M in get_hearers_in_view(5, get_turf(owner))) - if(M.client && M.client.prefs.cit_toggles & EATING_NOISES) + if(M.client && (M.client.prefs.cit_toggles & EATING_NOISES)) playsound(get_turf(owner),"[src.release_sound]",50,0,-5,0,ignore_walls = FALSE,channel=CHANNEL_PRED) if(!silent) owner.visible_message("[owner] expels everything from their [lowertext(name)]!") @@ -222,7 +222,7 @@ items_preserved -= M if(release_sound) for(var/mob/H in get_hearers_in_view(5, get_turf(owner))) - if(H.client && H.client.prefs.cit_toggles & EATING_NOISES) + if(H.client && (H.client.prefs.cit_toggles & EATING_NOISES)) playsound(get_turf(owner),"[src.release_sound]",50,0,-5,0,ignore_walls = FALSE,channel=CHANNEL_PRED) if(istype(M,/mob/living)) @@ -298,7 +298,7 @@ target.nom_mob(content, target.owner) if(!silent) for(var/mob/M in get_hearers_in_view(5, get_turf(owner))) - if(M.client && M.client.prefs.cit_toggles & EATING_NOISES) + if(M.client && (M.client.prefs.cit_toggles & EATING_NOISES)) playsound(get_turf(owner),"[src.vore_sound]",50,0,-5,0,ignore_walls = FALSE,channel=CHANNEL_PRED) owner.updateVRPanel() for(var/mob/living/M in contents) @@ -512,7 +512,7 @@ if(!silent) for(var/mob/M in get_hearers_in_view(5, get_turf(owner))) - if(M.client && M.client.prefs.cit_toggles & EATING_NOISES) + if(M.client && (M.client.prefs.cit_toggles & EATING_NOISES)) playsound(get_turf(owner),"struggle_sound",35,0,-5,1,ignore_walls = FALSE,channel=CHANNEL_PRED) R.stop_sound_channel(CHANNEL_PRED) var/sound/prey_struggle = sound(get_sfx("prey_struggle")) diff --git a/modular_citadel/code/modules/vore/eating/bellymodes_vr.dm b/modular_citadel/code/modules/vore/eating/bellymodes_vr.dm index 54c3df6cbd..6c528f75a9 100644 --- a/modular_citadel/code/modules/vore/eating/bellymodes_vr.dm +++ b/modular_citadel/code/modules/vore/eating/bellymodes_vr.dm @@ -68,7 +68,7 @@ for(var/mob/H in hearing_mobs) if(!isbelly(H.loc)) H.playsound_local(source, null, 45, falloff = 0, S = pred_digest) - else + else if(H in contents) H.playsound_local(source, null, 65, falloff = 0, S = prey_digest) //Pref protection! @@ -105,7 +105,7 @@ for(var/mob/H in hearing_mobs) if(!isbelly(H.loc)) H.playsound_local(source, null, 45, falloff = 0, S = pred_death) - else + else if(H in contents) H.playsound_local(source, null, 65, falloff = 0, S = prey_death) M.stop_sound_channel(CHANNEL_PREYLOOP) digestion_death(M) @@ -140,7 +140,7 @@ for(var/mob/H in hearing_mobs) if(!isbelly(H.loc)) H.playsound_local(source, null, 45, falloff = 0, S = pred_digest) - else + else if(H in contents) H.playsound_local(source, null, 65, falloff = 0, S = prey_digest) if(M.stat != DEAD) @@ -153,20 +153,19 @@ ////////////////////////// DM_NOISY ///////////////////////////////// //for when you just want people to squelch around if(digest_mode == DM_NOISY) - for (var/mob/living/M in contents) - if(prob(35)) - if((world.time - NORMIE_HEARCHECK) > last_hearcheck) - LAZYCLEARLIST(hearing_mobs) - for(var/mob/H in get_hearers_in_view(3, source)) - if(!H.client || !(H.client.prefs.cit_toggles & DIGESTION_NOISES)) - continue - LAZYADD(hearing_mobs, H) - last_hearcheck = world.time - for(var/mob/H in hearing_mobs) - if(!isbelly(H.loc)) - H.playsound_local(source, null, 45, falloff = 0, S = pred_digest) - else - H.playsound_local(source, null, 65, falloff = 0, S = prey_digest) + if(prob(35)) + if((world.time - NORMIE_HEARCHECK) > last_hearcheck) + LAZYCLEARLIST(hearing_mobs) + for(var/mob/H in get_hearers_in_view(3, source)) + if(!H.client || !(H.client.prefs.cit_toggles & DIGESTION_NOISES)) + continue + LAZYADD(hearing_mobs, H) + last_hearcheck = world.time + for(var/mob/H in hearing_mobs) + if(!isbelly(H.loc)) + H.playsound_local(source, null, 45, falloff = 0, S = pred_digest) + else if(H in contents) + H.playsound_local(source, null, 65, falloff = 0, S = prey_digest) //////////////////////////// DM_ABSORB //////////////////////////// @@ -185,7 +184,7 @@ for(var/mob/H in hearing_mobs) if(!isbelly(H.loc)) H.playsound_local(source, null, 45, falloff = 0, S = pred_digest) - else + else if(H in contents) H.playsound_local(source, null, 65, falloff = 0, S = prey_digest) if(M.absorbed) @@ -223,7 +222,7 @@ for(var/mob/H in hearing_mobs) if(!isbelly(H.loc)) H.playsound_local(source, null, 45, falloff = 0, S = pred_digest) - else + else if(H in contents) H.playsound_local(source, null, 65, falloff = 0, S = prey_digest) //No digestion protection for megafauna. @@ -256,7 +255,7 @@ for(var/mob/H in hearing_mobs) if(!isbelly(H.loc)) H.playsound_local(source, null, 45, falloff = 0, S = pred_death) - else + else if(H in contents) H.playsound_local(source, null, 65, falloff = 0, S = prey_death) M.spill_organs(FALSE,TRUE,TRUE) M.stop_sound_channel(CHANNEL_PREYLOOP)