diff --git a/code/ATMOSPHERICS/components/unary/vent_pump.dm b/code/ATMOSPHERICS/components/unary/vent_pump.dm
index 5be3be0e53d..a338f1a92c1 100644
--- a/code/ATMOSPHERICS/components/unary/vent_pump.dm
+++ b/code/ATMOSPHERICS/components/unary/vent_pump.dm
@@ -373,11 +373,9 @@
if(!target_vent)
return
- for(var/mob/O in viewers(L, null))
- O.show_message(text("[L] scrambles into the ventillation ducts!"), 1)
+ L.visible_message("[L] scrambles into the ventillation ducts!")
- for(var/mob/O in hearers(target_vent,null))
- O.show_message("You hear something squeezing through the ventilation ducts.",2)
+ target_vent.audible_message("You hear something squeezing through the ventilation ducts.")
if(target_vent.welded) //the vent can be welded while they scrolled through the list.
target_vent = src
diff --git a/code/controllers/supply_shuttle.dm b/code/controllers/supply_shuttle.dm
index 13ad8725cd2..56cd7f8d0b3 100644
--- a/code/controllers/supply_shuttle.dm
+++ b/code/controllers/supply_shuttle.dm
@@ -467,8 +467,7 @@ var/global/datum/controller/supply_shuttle/supply_shuttle
else if (href_list["doorder"])
if(world.time < reqtime)
- for(var/mob/V in hearers(src))
- V.show_message("[src]'s monitor flashes, \"[world.time - reqtime] seconds remaining until another requisition form may be printed.\"")
+ say("[world.time - reqtime] seconds remaining until another requisition form may be printed.")
return
//Find the correct supply_pack datum
@@ -538,6 +537,10 @@ var/global/datum/controller/supply_shuttle/supply_shuttle
updateUsrDialog()
return
+/obj/machinery/computer/ordercomp/say_quote(text)
+ return "flashes, \"[text]\""
+
+
/obj/machinery/computer/supplycomp/attack_hand(var/mob/user as mob)
if(!allowed(user))
user << " Access Denied."
@@ -657,8 +660,7 @@ var/global/datum/controller/supply_shuttle/supply_shuttle
else if (href_list["doorder"])
if(world.time < reqtime)
- for(var/mob/V in hearers(src))
- V.show_message("[src]'s monitor flashes, \"[world.time - reqtime] seconds remaining until another requisition form may be printed.\"")
+ say("[world.time - reqtime] seconds remaining until another requisition form may be printed.")
return
//Find the correct supply_pack datum
@@ -792,5 +794,7 @@ var/global/datum/controller/supply_shuttle/supply_shuttle
frequency.post_signal(src, status_signal)
+/obj/machinery/computer/supplycomp/say_quote(text)
+ return "flashes, \"[text]\""
diff --git a/code/game/gamemodes/changeling/powers/shriek.dm b/code/game/gamemodes/changeling/powers/shriek.dm
index 6e5925da8f7..026a0aa4a1b 100644
--- a/code/game/gamemodes/changeling/powers/shriek.dm
+++ b/code/game/gamemodes/changeling/powers/shriek.dm
@@ -8,7 +8,7 @@
//A flashy ability, good for crowd control and sewing chaos.
/obj/effect/proc_holder/changeling/resonant_shriek/sting_action(var/mob/user)
- for(var/mob/living/M in hearers(4, user))
+ for(var/mob/living/M in get_hearers_in_view(4, user))
if(iscarbon(M))
if(!M.mind || !M.mind.changeling)
M.ear_deaf += 30
diff --git a/code/game/gamemodes/malfunction/Malf_Modules.dm b/code/game/gamemodes/malfunction/Malf_Modules.dm
index 1eea8712125..4ca3488ed64 100644
--- a/code/game/gamemodes/malfunction/Malf_Modules.dm
+++ b/code/game/gamemodes/malfunction/Malf_Modules.dm
@@ -164,8 +164,7 @@
for(var/datum/AI_Module/small/overload_machine/overload in current_modules)
if(overload.uses > 0)
overload.uses --
- for(var/mob/V in hearers(M, null))
- V.show_message("You hear a loud electrical buzzing sound!", 2)
+ audible_message("You hear a loud electrical buzzing sound!")
src << "Overloading machine circuitry..."
spawn(50)
if(M)
@@ -191,8 +190,7 @@
for(var/datum/AI_Module/small/override_machine/override in current_modules)
if(override.uses > 0)
override.uses --
- for(var/mob/V in hearers(M, null))
- V.show_message("You hear a loud electrical buzzing sound!", 2)
+ audible_message("You hear a loud electrical buzzing sound!")
src << "Reprogramming machine behaviour..."
spawn(50)
if(M)
diff --git a/code/game/machinery/computer/message.dm b/code/game/machinery/computer/message.dm
index b9d29711de0..04226b689d2 100644
--- a/code/game/machinery/computer/message.dm
+++ b/code/game/machinery/computer/message.dm
@@ -434,8 +434,7 @@
customrecepient.tnote += "← From [customsender] ([customjob]):
[custommessage]
"
if (!customrecepient.silent)
playsound(customrecepient.loc, 'sound/machines/twobeep.ogg', 50, 1)
- for (var/mob/O in hearers(3, customrecepient.loc))
- O.show_message(text("\icon[customrecepient] *[customrecepient.ttone]*"))
+ customrecepient.loc.audible_message("\icon[customrecepient] *[customrecepient.ttone]*", null, 3)
if( customrecepient.loc && ishuman(customrecepient.loc) )
var/mob/living/carbon/human/H = customrecepient.loc
H << "\icon[customrecepient] Message from [customsender] ([customjob]), \"[custommessage]\" (Reply)"
@@ -448,8 +447,7 @@
customrecepient.tnote += "← From [PDARec.owner] ([customjob]):
[custommessage]
"
if (!customrecepient.silent)
playsound(customrecepient.loc, 'sound/machines/twobeep.ogg', 50, 1)
- for (var/mob/O in hearers(3, customrecepient.loc))
- O.show_message(text("\icon[customrecepient] *[customrecepient.ttone]*"))
+ customrecepient.loc.audible_message("\icon[customrecepient] *[customrecepient.ttone]*", null, 3)
if( customrecepient.loc && ishuman(customrecepient.loc) )
var/mob/living/carbon/human/H = customrecepient.loc
H << "\icon[customrecepient] Message from [PDARec.owner] ([customjob]), \"[custommessage]\" (Reply)"
diff --git a/code/game/machinery/mass_driver.dm b/code/game/machinery/mass_driver.dm
index 6d82f6f054e..cbae21bc11e 100644
--- a/code/game/machinery/mass_driver.dm
+++ b/code/game/machinery/mass_driver.dm
@@ -23,8 +23,7 @@
if(!O.anchored || istype(O, /obj/mecha)) //Mechs need their launch platforms.
O_limit++
if(O_limit >= 20)
- for(var/mob/M in hearers(src, null))
- M << "[src] lets out a screech, it doesn't seem to be able to handle the load."
+ audible_message("[src] lets out a screech, it doesn't seem to be able to handle the load.")
break
use_power(500)
spawn(0)
diff --git a/code/game/objects/effects/spiders.dm b/code/game/objects/effects/spiders.dm
index 68c04cf5d54..26c12f5f8da 100644
--- a/code/game/objects/effects/spiders.dm
+++ b/code/game/objects/effects/spiders.dm
@@ -137,7 +137,8 @@
return
var/obj/machinery/atmospherics/unary/vent_pump/exit_vent = pick(vents)
if(prob(50))
- src.visible_message("[src] scrambles into the ventillation ducts!")
+ visible_message("[src] scrambles into the ventillation ducts!", \
+ "You hear something squeezing through the ventilation ducts.")
spawn(rand(20,60))
loc = exit_vent
@@ -150,7 +151,7 @@
return
if(prob(50))
- src.visible_message("You hear something squeezing through the ventilation ducts.",2)
+ audible_message("You hear something squeezing through the ventilation ducts.")
sleep(travel_time)
if(!exit_vent || exit_vent.welded)
diff --git a/code/game/objects/items/devices/PDA/PDA.dm b/code/game/objects/items/devices/PDA/PDA.dm
index 3f239f3d591..e83598b3166 100644
--- a/code/game/objects/items/devices/PDA/PDA.dm
+++ b/code/game/objects/items/devices/PDA/PDA.dm
@@ -755,9 +755,7 @@ var/global/list/obj/item/device/pda/PDAs = list()
P.tnote += "← From [owner] ([ownjob]):
[t]
"
if (!P.silent)
- playsound(P.loc, 'sound/machines/twobeep.ogg', 50, 1)
- for (var/mob/O in hearers(3, P.loc))
- if(!P.silent) O.show_message(text("\icon[P] *[P.ttone]*"))
+ P.loc.audible_message("\icon[P] *[P.ttone]*", null, 3)
//Search for holder of the PDA.
var/mob/living/L = null
if(P.loc && isliving(P.loc))
diff --git a/code/game/objects/items/weapons/teleportation.dm b/code/game/objects/items/weapons/teleportation.dm
index 62f7a68cbb8..be5bc7c9402 100644
--- a/code/game/objects/items/weapons/teleportation.dm
+++ b/code/game/objects/items/weapons/teleportation.dm
@@ -162,8 +162,7 @@ Frequency:
user.show_message("\The [src] is recharging!")
return
var/T = L[t1]
- for(var/mob/O in hearers(user, null))
- O.show_message("Locked In.", 2)
+ user.show_message("Locked In.", 2)
var/obj/effect/portal/P = new /obj/effect/portal(get_turf(src), T, src)
try_move_adjacent(P)
active_portals++
diff --git a/code/game/objects/structures/crates_lockers/closets.dm b/code/game/objects/structures/crates_lockers/closets.dm
index 9c772d349b2..5da6def05ae 100644
--- a/code/game/objects/structures/crates_lockers/closets.dm
+++ b/code/game/objects/structures/crates_lockers/closets.dm
@@ -249,8 +249,8 @@
user << "It won't budge!"
if(!lastbang)
lastbang = 1
- for (var/mob/M in hearers(src, null))
- M << text("BANG, bang!", max(0, 5 - get_dist(src, M)))
+ for (var/mob/M in get_hearers_in_view(src, null))
+ M.show_message("BANG, bang!", 2)
spawn(30)
lastbang = 0
diff --git a/code/game/objects/structures/crates_lockers/closets/secure/secure_closets.dm b/code/game/objects/structures/crates_lockers/closets/secure/secure_closets.dm
index 30c0268575f..5b25d80bc0e 100644
--- a/code/game/objects/structures/crates_lockers/closets/secure/secure_closets.dm
+++ b/code/game/objects/structures/crates_lockers/closets/secure/secure_closets.dm
@@ -95,8 +95,8 @@
user << "The locker is locked!"
if(world.time > lastbang+5)
lastbang = world.time
- for(var/mob/M in hearers(src, null))
- M << "BANG, bang!"
+ for(var/mob/M in get_hearers_in_view(src, null))
+ M.show_message("BANG, bang!", 2)
return
/obj/structure/closet/secure_closet/attack_hand(mob/user as mob)
diff --git a/code/game/objects/structures/musician.dm b/code/game/objects/structures/musician.dm
index 1330585324e..061fdd3b141 100644
--- a/code/game/objects/structures/musician.dm
+++ b/code/game/objects/structures/musician.dm
@@ -57,7 +57,7 @@
return
// and play
var/turf/source = get_turf(instrumentObj)
- for(var/mob/M in hearers(15, source))
+ for(var/mob/M in get_hearers_in_view(15, source))
M.playsound_local(source, soundfile, 100, falloff = 5)
/datum/song/proc/updateDialog(mob/user as mob)
diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm
index 5db0a6bc7a0..3a1017aacd0 100644
--- a/code/modules/admin/admin_verbs.dm
+++ b/code/modules/admin/admin_verbs.dm
@@ -70,7 +70,6 @@ var/list/admin_verbs_sounds = list(
/client/proc/stop_sounds
)
var/list/admin_verbs_fun = list(
- /client/proc/object_talk,
/client/proc/cmd_admin_dress,
/client/proc/cmd_admin_gib_self,
/client/proc/drop_bomb,
@@ -79,7 +78,7 @@ var/list/admin_verbs_fun = list(
/client/proc/send_space_ninja,
/client/proc/cmd_admin_add_freeform_ai_law,
/client/proc/cmd_admin_add_random_ai_law,
- /client/proc/make_sound,
+ /client/proc/object_say,
/client/proc/toggle_random_events,
/client/proc/set_ooc,
/client/proc/forceEvent
@@ -152,7 +151,6 @@ var/list/admin_verbs_hideable = list(
/client/proc/check_words,
/client/proc/play_local_sound,
/client/proc/play_sound,
- /client/proc/object_talk,
/client/proc/cmd_admin_dress,
/client/proc/cmd_admin_gib_self,
/client/proc/drop_bomb,
@@ -161,7 +159,7 @@ var/list/admin_verbs_hideable = list(
/client/proc/cmd_admin_add_freeform_ai_law,
/client/proc/cmd_admin_add_random_ai_law,
/client/proc/cmd_admin_create_centcom_report,
- /client/proc/make_sound,
+ /client/proc/object_say,
/client/proc/toggle_random_events,
/client/proc/cmd_admin_add_random_ai_law,
/datum/admins/proc/startnow,
@@ -451,12 +449,12 @@ var/list/admin_verbs_hideable = list(
log_admin("[key_name(usr)] gave [key_name(T)] the disease [D].")
message_admins("[key_name_admin(usr)] gave [key_name(T)] the disease [D].", 1)
-/client/proc/make_sound(var/obj/O in world)
+/client/proc/object_say(var/obj/O in world)
set category = "Special Verbs"
- set name = "Osay"
+ set name = "Object Say"
set desc = "Makes an object say something."
if(istype(O))
- var/message = input("What do you want the message to be?", "Make Sound") as text | null
+ var/message = input("What do you want the message to be?", "Object Say") as text | null
if(!message)
return
var/templanguages = O.languages
@@ -474,17 +472,6 @@ var/list/admin_verbs_hideable = list(
togglebuildmode(src.mob)
feedback_add_details("admin_verb","TBMS") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
-/client/proc/object_talk(var/msg as text)
- set category = "Special Verbs"
- set name = "oSay"
- set desc = "Display a message to everyone who can hear the target"
- if(mob.control_object)
- if(!msg)
- return
- for (var/mob/V in hearers(mob.control_object))
- V.show_message("[mob.control_object.name] says: \"" + msg + "\"", 2)
- feedback_add_details("admin_verb","OT") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
-
/client/proc/kill_air()
set category = "Debug"
set name = "Kill Air"
diff --git a/code/modules/assembly/signaler.dm b/code/modules/assembly/signaler.dm
index 325b1688a5b..d46487da15b 100644
--- a/code/modules/assembly/signaler.dm
+++ b/code/modules/assembly/signaler.dm
@@ -134,8 +134,7 @@ Code:
if(signal.encryption != code) return 0
if(!(src.wires & WIRE_RADIO_RECEIVE)) return 0
pulse(1)
- for(var/mob/O in hearers(1, src.loc))
- O.show_message(text("\icon[] *beep* *beep*", src), 3, "*beep* *beep*", 2)
+ src.loc.audible_message("\icon[src] *beep* *beep*", null, 1)
return
diff --git a/code/modules/events/immovable_rod.dm b/code/modules/events/immovable_rod.dm
index 567e61bdf31..7cde782e7d6 100644
--- a/code/modules/events/immovable_rod.dm
+++ b/code/modules/events/immovable_rod.dm
@@ -49,8 +49,7 @@ In my current plan for it, 'solid' will be defined as anything with density == 1
/obj/effect/immovablerod/Bump(atom/clong)
playsound(src, 'sound/effects/bang.ogg', 50, 1)
- for (var/mob/O in hearers(src, null))
- O.show_message("CLANG", 2)
+ audible_message("CLANG")
if(istype(clong, /turf/unsimulated) || istype(clong, /turf/simulated/shuttle)) //Unstoppable force meets immovable object
explosion(src.loc, 4, 5, 6, 7, 0)
diff --git a/code/modules/events/ninja.dm b/code/modules/events/ninja.dm
index cb58098d54f..7e15d10946a 100644
--- a/code/modules/events/ninja.dm
+++ b/code/modules/events/ninja.dm
@@ -1875,8 +1875,7 @@ ________________________________________________________________________________
P.tnote += "← From [!s_control?(A):"an unknown source"]:
[t]
"
if (!P.silent)
playsound(P.loc, 'sound/machines/twobeep.ogg', 50, 1)
- for (var/mob/O in hearers(3, P.loc))
- O.show_message(text("\icon[P] *[P.ttone]*"))
+ P.loc.audible_message("\icon[P] *[P.ttone]*", null, 3)
P.overlays.Cut()
P.overlays += image('icons/obj/pda.dmi', "pda-r")
diff --git a/code/modules/library/lib_machines.dm b/code/modules/library/lib_machines.dm
index 96a727b7d8c..7cad50f8d9d 100644
--- a/code/modules/library/lib_machines.dm
+++ b/code/modules/library/lib_machines.dm
@@ -252,8 +252,7 @@ datum/borrowbook // Datum used to keep track of who has borrowed what when and f
var/obj/item/weapon/barcodescanner/scanner = W
scanner.computer = src
user << "[scanner]'s associated machine has been set to [src]."
- for (var/mob/V in hearers(src))
- V.show_message("[src] lets out a low, short blip.", 2)
+ audible_message("[src] lets out a low, short blip.")
else
..()
@@ -292,8 +291,7 @@ datum/borrowbook // Datum used to keep track of who has borrowed what when and f
bibledelay = 0
else
- for (var/mob/V in hearers(src))
- V.show_message("[src]'s monitor flashes, \"Bible printer currently unavailable, please wait a moment.\"")
+ say("Bible printer currently unavailable, please wait a moment.")
if("7")
screenstate = 7
@@ -364,8 +362,7 @@ datum/borrowbook // Datum used to keep track of who has borrowed what when and f
if(!dbcon.IsConnected())
alert("Connection to Archive has been severed. Aborting.")
if(bibledelay)
- for (var/mob/V in hearers(src))
- V.show_message("[src]'s monitor flashes, \"Printer unavailable. Please allow a short time before attempting to print.\"")
+ say("Printer unavailable. Please allow a short time before attempting to print.")
else
bibledelay = 1
spawn(60)
@@ -395,6 +392,11 @@ datum/borrowbook // Datum used to keep track of who has borrowed what when and f
src.updateUsrDialog()
return
+/obj/machinery/librarycomp/say_quote(text)
+ return "flashes, \"[text]\""
+
+
+
/*
* Library Scanner
*/
diff --git a/code/modules/mob/living/carbon/alien/humanoid/emote.dm b/code/modules/mob/living/carbon/alien/humanoid/emote.dm
index ed3061be2e8..384f405b03f 100644
--- a/code/modules/mob/living/carbon/alien/humanoid/emote.dm
+++ b/code/modules/mob/living/carbon/alien/humanoid/emote.dm
@@ -79,11 +79,7 @@
playsound(src.loc, 'sound/voice/hiss6.ogg', 80, 1, 1)
if (m_type & 1)
- for(var/mob/O in viewers(src, null))
- O.show_message(message, m_type)
- //Foreach goto(703)
+ visible_message(message)
else
- for(var/mob/O in hearers(src, null))
- O.show_message(message, m_type)
- //Foreach goto(746)
+ src.loc.audible_message(message)
return
\ No newline at end of file
diff --git a/code/modules/mob/living/carbon/alien/larva/emote.dm b/code/modules/mob/living/carbon/alien/larva/emote.dm
index 3504b211893..9e502353e03 100644
--- a/code/modules/mob/living/carbon/alien/larva/emote.dm
+++ b/code/modules/mob/living/carbon/alien/larva/emote.dm
@@ -101,14 +101,11 @@
else
src << " Unusable emote '[act]'. Say *help for a list."
+
if ((message && src.stat == 0))
log_emote("[name]/[key] : [message]")
if (m_type & 1)
- for(var/mob/O in viewers(src, null))
- O.show_message(message, m_type)
- //Foreach goto(703)
+ visible_message(message)
else
- for(var/mob/O in hearers(src, null))
- O.show_message(message, m_type)
- //Foreach goto(746)
+ src.loc.audible_message(message)
return
\ No newline at end of file
diff --git a/code/modules/mob/living/carbon/brain/emote.dm b/code/modules/mob/living/carbon/brain/emote.dm
index eae87baf57f..6f7e884fb11 100644
--- a/code/modules/mob/living/carbon/brain/emote.dm
+++ b/code/modules/mob/living/carbon/brain/emote.dm
@@ -67,8 +67,6 @@
if (m_type & 1)
- for (var/mob/O in viewers(src, null))
- O.show_message(message, m_type)
+ visible_message(message)
else if (m_type & 2)
- for (var/mob/O in hearers(src.loc, null))
- O.show_message(message, m_type)
\ No newline at end of file
+ src.loc.audible_message(message)
\ No newline at end of file
diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm
index bd6c513cd66..03fe3b71989 100644
--- a/code/modules/mob/living/carbon/carbon.dm
+++ b/code/modules/mob/living/carbon/carbon.dm
@@ -23,9 +23,9 @@
/mob/living/carbon/relaymove(var/mob/user, direction)
if(user in src.stomach_contents)
if(prob(40))
- for(var/mob/M in hearers(4, src))
- if(M.client)
- M.show_message(text("You hear something rumbling inside [src]'s stomach..."), 2)
+ audible_message("You hear something rumbling inside [src]'s stomach...", \
+ "You hear something rumbling.", 4,\
+ "Something is rumbling inside your stomach!")
var/obj/item/I = user.get_active_hand()
if(I && I.force)
var/d = rand(round(I.force / 4), I.force)
@@ -41,7 +41,7 @@
src.take_organ_damage(d)
for(var/mob/M in viewers(user, null))
if(M.client)
- M.show_message(text("[user] attacks [src]'s stomach wall with the [I.name]!"), 2)
+ M.show_message("[user] attacks [src]'s stomach wall with the [I.name]!", 2)
playsound(user.loc, 'sound/effects/attackblob.ogg', 50, 1)
if(prob(src.getBruteLoss() - 50))
diff --git a/code/modules/mob/living/carbon/emote.dm b/code/modules/mob/living/carbon/emote.dm
index 90c9809c580..cb7783dceff 100644
--- a/code/modules/mob/living/carbon/emote.dm
+++ b/code/modules/mob/living/carbon/emote.dm
@@ -193,8 +193,6 @@
if (m_type & 1)
- for (var/mob/O in viewers(src, null))
- O.show_message(message, m_type)
+ visible_message(message)
else if (m_type & 2)
- for (var/mob/O in hearers(src.loc, null))
- O.show_message(message, m_type)
+ src.loc.audible_message(message)
diff --git a/code/modules/mob/living/carbon/human/emote.dm b/code/modules/mob/living/carbon/human/emote.dm
index ba715c188be..504727a4584 100644
--- a/code/modules/mob/living/carbon/human/emote.dm
+++ b/code/modules/mob/living/carbon/human/emote.dm
@@ -316,7 +316,7 @@
m_type = 2
if ("help") //This can stay at the bottom.
- src << "Help for human emotes. You can use these emotes with say \"*emote\":\n\naflap, airguitar, blink, blink_r, blush, bow-(none)/mob, burp, choke, chuckle, clap, collapse, cough, cry, custom, dance, dap, deathgasp, drool, eyebrow, faint, frown, flap, gasp, giggle, glare-(none)/mob, grin, groan, grumble, handshake, hug-(none)/mob, johnny, jump, laugh, look-(none)/mob, me, moan, mumble, nod, pale, point-(atom), raise, salute, scream, shake, shiver, shrug, sigh, signal-#1-10, smile, sneeze, sniff, snore, stare-(none)/mob, tremble, twitch, twitch_s, wave, whimper, wink, yawn"
+ src << "Help for human emotes. You can use these emotes with say \"*emote\":\n\naflap, airguitar, blink, blink_r, blush, bow-(none)/mob, burp, choke, chuckle, clap, collapse, cough, cry, custom, dance, dap, deathgasp, drool, eyebrow, faint, flap, frown, gasp, giggle, glare-(none)/mob, grin, groan, grumble, handshake, hug-(none)/mob, johnny, jump, laugh, look-(none)/mob, me, moan, mumble, nod, pale, point-(atom), raise, salute, scream, shake, shiver, shrug, sigh, signal-#1-10, sit, smile, sneeze, sniff, snore, stare-(none)/mob, sulk, sway, tremble, twitch, twitch_s, wave, whimper, wink, yawn"
else
..(act)
@@ -340,9 +340,7 @@
if (m_type & 1)
- for (var/mob/O in viewers(src, null))
- O.show_message(message, m_type)
+ visible_message(message)
else if (m_type & 2)
- for (var/mob/O in hearers(src.loc, null))
- O.show_message(message, m_type)
+ src.loc.audible_message(message)
diff --git a/code/modules/mob/living/carbon/monkey/emote.dm b/code/modules/mob/living/carbon/monkey/emote.dm
index 2b51ed70355..dd3b837a38c 100644
--- a/code/modules/mob/living/carbon/monkey/emote.dm
+++ b/code/modules/mob/living/carbon/monkey/emote.dm
@@ -66,7 +66,7 @@
m_type = 1
if ("help") //Ooh ah ooh ooh this is an exception to alphabetical ooh ooh.
- src << "Help for monkey emotes. You can use these emotes with say \"*emote\":\n\naflap, airguitar, blink, blink_r, blush, bow, choke, clap, collapse, cough, dance, deathgasp, drool, flap, frown, gasp, gnarl, giggle, glare-(none)/mob, grin, jump, laugh, paw, me, moan, nod, roar, roll, point-atom, scream, scratch, scretch, shake, shiver, sign-#, sit, smile, sneeze, sniff, snore, stare-(none)/mob, sulk, sway, tail, tremble, twitch, twitch_s, whimper, yawn"
+ src << "Help for monkey emotes. You can use these emotes with say \"*emote\":\n\naflap, airguitar, blink, blink_r, blush, bow-(none)/mob, burp, choke, chuckle, clap, collapse, cough, dance, deathgasp, drool, flap, frown, gasp, gnarl, giggle, glare-(none)/mob, grin, jump, laugh, look, me, moan, nod, paw, point-(atom), roar, roll, scream, scratch, scretch, shake, shiver, sigh, sign-#, sit, smile, sneeze, sniff, snore, stare-(none)/mob, sulk, sway, tail, tremble, twitch, twitch_s, wave whimper, wink, yawn"
else
..(act)
@@ -75,11 +75,7 @@
if(src.client)
log_emote("[name]/[key] : [message]")
if (m_type & 1)
- for(var/mob/O in viewers(src, null))
- O.show_message(message, m_type)
- //Foreach goto(703)
+ visible_message(message)
else
- for(var/mob/O in hearers(src, null))
- O.show_message(message, m_type)
- //Foreach goto(746)
+ src.loc.audible_message(message)
return
diff --git a/code/modules/mob/living/carbon/slime/emote.dm b/code/modules/mob/living/carbon/slime/emote.dm
index 149bec620fd..d6b41afbee2 100644
--- a/code/modules/mob/living/carbon/slime/emote.dm
+++ b/code/modules/mob/living/carbon/slime/emote.dm
@@ -52,11 +52,8 @@
src << "Unusable emote '[act]'. Say *help for a list."
if ((message && src.stat == 0))
if (m_type & 1)
- for(var/mob/O in viewers(src, null))
- O.show_message(message, m_type)
- //Foreach goto(703)
+ visible_message(message)
else
- for(var/mob/O in hearers(src, null))
- O.show_message(message, m_type)
- //Foreach goto(746)
+ src.loc.audible_message(message)
+
return
\ No newline at end of file
diff --git a/code/modules/mob/living/emote.dm b/code/modules/mob/living/emote.dm
index f111b5cb5f5..91e4fd3a7c2 100644
--- a/code/modules/mob/living/emote.dm
+++ b/code/modules/mob/living/emote.dm
@@ -252,7 +252,7 @@
m_type = 2
if ("help")
- src << "Help for emotes. You can use these emotes with say \"*emote\":\n\naflap, blush, bow-(none)/mob, burp, choke, chuckle, clap, collapse, cough, dance, deathgasp, drool, flap, frown, gasp, giggle, glare-(none)/mob, grin, jump, laugh, look, me, nod, point-atom, scream, shake, sit, sigh, smile, sneeze, sniff, snore, stare-(none)/mob, sulk, sway, tremble, twitch, twitch_s, wave, whimper, yawn"
+ src << "Help for emotes. You can use these emotes with say \"*emote\":\n\naflap, blush, bow-(none)/mob, burp, choke, chuckle, clap, collapse, cough, dance, deathgasp, drool, flap, frown, gasp, giggle, glare-(none)/mob, grin, jump, laugh, look, me, nod, point-atom, scream, shake, sigh, sit, smile, sneeze, sniff, snore, stare-(none)/mob, sulk, sway, tremble, twitch, twitch_s, wave, whimper, yawn"
else
src << "Unusable emote '[act]'. Say *help for a list."
@@ -275,8 +275,6 @@
if (m_type & 1)
- for (var/mob/O in viewers(src, null))
- O.show_message(message, m_type)
+ visible_message(message)
else if (m_type & 2)
- for (var/mob/O in hearers(src.loc, null))
- O.show_message(message, m_type)
+ src.loc.audible_message(message)
diff --git a/code/modules/mob/living/silicon/pai/software.dm b/code/modules/mob/living/silicon/pai/software.dm
index a344f31aaeb..c11523d239a 100644
--- a/code/modules/mob/living/silicon/pai/software.dm
+++ b/code/modules/mob/living/silicon/pai/software.dm
@@ -171,8 +171,7 @@
if(href_list["send"])
sradio.send_signal("ACTIVATE")
- for(var/mob/O in hearers(1, src.loc))
- O.show_message(text("\icon[] *beep* *beep*", src), 3, "*beep* *beep*", 2)
+ audible_message("\icon[src] *beep* *beep*")
if(href_list["freq"])
diff --git a/code/modules/mob/living/silicon/robot/emote.dm b/code/modules/mob/living/silicon/robot/emote.dm
index e5634f9708c..d287923bb74 100644
--- a/code/modules/mob/living/silicon/robot/emote.dm
+++ b/code/modules/mob/living/silicon/robot/emote.dm
@@ -202,9 +202,7 @@
if ((message && src.stat == 0))
if (m_type & 1)
- for(var/mob/O in viewers(src, null))
- O.show_message(message, m_type)
+ visible_message(message)
else
- for(var/mob/O in hearers(src, null))
- O.show_message(message, m_type)
+ src.loc.audible_message(message)
return
diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm
index c7d4e7d8e96..eebe552a8d6 100644
--- a/code/modules/mob/mob.dm
+++ b/code/modules/mob/mob.dm
@@ -93,6 +93,42 @@ var/next_mob_id = 0
M.show_message( message, 1, blind_message, 2)
+
+
+
+// Show a message to all mobs in earshot of this one
+// This would be for audible actions by the src mob
+// message is the message output to anyone who can hear.
+// self_message (optional) is what the src mob hears.
+// deaf_message (optional) is what deaf people will see.
+// hearing_distance (optional) is the range, how many tiles away the message can be heard.
+
+/mob/audible_message(var/message, var/deaf_message, var/hearing_distance, var/self_message)
+ var/range = 7
+ if(hearing_distance)
+ range = hearing_distance
+ var/msg = message
+ for(var/mob/M in get_hearers_in_view(range, src))
+ if(self_message && M==src)
+ msg = self_message
+ M.show_message( msg, 2, deaf_message, 1)
+
+// Show a message to all mobs in earshot of this atom
+// Use for objects performing audible actions
+// message is the message output to anyone who can hear.
+// deaf_message (optional) is what deaf people will see.
+// hearing_distance (optional) is the range, how many tiles away the message can be heard.
+
+/atom/proc/audible_message(var/message, var/deaf_message, var/hearing_distance)
+ var/range = 7
+ if(hearing_distance)
+ range = hearing_distance
+ for(var/mob/M in get_hearers_in_view(range, src))
+ M.show_message( message, 2, deaf_message, 1)
+
+
+
+
/mob/proc/movement_delay()
return 0
diff --git a/code/modules/recycling/disposal.dm b/code/modules/recycling/disposal.dm
index 1c264fcc5d3..b1ea5d08ee7 100644
--- a/code/modules/recycling/disposal.dm
+++ b/code/modules/recycling/disposal.dm
@@ -581,9 +581,8 @@
if (user.stat)
return
if (src.loc)
- for (var/mob/M in hearers(src.loc.loc))
+ for (var/mob/M in get_hearers_in_view(src.loc.loc))
M.show_message("CLONG, clong!", 2)
-
playsound(src.loc, 'sound/effects/clang.ogg', 50, 0, 0)
// called to vent all gas in holder to a location