Create the audible_message() proc to replace most instance of " for(var/mob/M in hearers(...) show_message(..., 2)"

fixing typos and missing emotes in emote lists.
This commit is contained in:
phil235
2014-09-14 01:15:15 +02:00
parent 304b89bdc0
commit 87d7c9e91e
27 changed files with 89 additions and 91 deletions
@@ -373,11 +373,9 @@
if(!target_vent)
return
for(var/mob/O in viewers(L, null))
O.show_message(text("<B>[L] scrambles into the ventillation ducts!</B>"), 1)
visible_message("<B>[L] scrambles into the ventillation ducts!</B>")
for(var/mob/O in hearers(target_vent,null))
O.show_message("You hear something squeezing through the ventilation ducts.",2)
audible_message("<span class='notice'>You hear something squeezing through the ventilation ducts.</span>")
if(target_vent.welded) //the vent can be welded while they scrolled through the list.
target_vent = src
+4 -4
View File
@@ -467,8 +467,8 @@ 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("<b>[src]</b>'s monitor flashes, \"[world.time - reqtime] seconds remaining until another requisition form may be printed.\"")
audible_message("<b>[src]</b>'s monitor beeps, \"[world.time - reqtime] seconds remaining until another requisition form may be printed.\"",\
"<b>[src]</b>'s monitor flashes.")
return
//Find the correct supply_pack datum
@@ -657,8 +657,8 @@ 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("<b>[src]</b>'s monitor flashes, \"[world.time - reqtime] seconds remaining until another requisition form may be printed.\"")
audible_message("<b>[src]</b>'s monitor beeps, \"[world.time - reqtime] seconds remaining until another requisition form may be printed.\"", \
"<b>[src]</b>'s monitor flashes.")
return
//Find the correct supply_pack datum
+2 -2
View File
@@ -166,7 +166,7 @@
/obj/machinery/bot/proc/speak(var/message)
if((!src.on) || (!message))
return
for(var/mob/O in hearers(src, null))
O.show_message("<span class='game say'><span class='name'>[src]</span> beeps, \"[message]\"</span>",2)
audible_message("<span class='game say'><span class='name'>[src]</span> beeps, \"[message]\"</span>")
return
+2 -4
View File
@@ -434,8 +434,7 @@
customrecepient.tnote += "<i><b>&larr; From <a href='byond://?src=\ref[customrecepient];choice=Message;target=\ref[src]'>[customsender]</a> ([customjob]):</b></i><br>[custommessage]<br>"
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, null, 3)
if( customrecepient.loc && ishuman(customrecepient.loc) )
var/mob/living/carbon/human/H = customrecepient.loc
H << "\icon[customrecepient] <b>Message from [customsender] ([customjob]), </b>\"[custommessage]\" (<a href='byond://?src=\ref[src];choice=Message;skiprefresh=1;target=\ref[src]'>Reply</a>)"
@@ -448,8 +447,7 @@
customrecepient.tnote += "<i><b>&larr; From <a href='byond://?src=\ref[customrecepient];choice=Message;target=\ref[PDARec]'>[PDARec.owner]</a> ([customjob]):</b></i><br>[custommessage]<br>"
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] <b>Message from [PDARec.owner] ([customjob]), </b>\"[custommessage]\" (<a href='byond://?src=\ref[customrecepient];choice=Message;skiprefresh=1;target=\ref[PDARec]'>Reply</a>)"
+3 -2
View File
@@ -137,7 +137,8 @@
return
var/obj/machinery/atmospherics/unary/vent_pump/exit_vent = pick(vents)
if(prob(50))
src.visible_message("<B>[src] scrambles into the ventillation ducts!</B>")
visible_message("<B>[src] scrambles into the ventillation ducts!</B>", \
"<span class='notice'>You hear something squeezing through the ventilation ducts.</span>")
spawn(rand(20,60))
loc = exit_vent
@@ -150,7 +151,7 @@
return
if(prob(50))
src.visible_message("<span class='notice'>You hear something squeezing through the ventilation ducts.</span>",2)
audible_message("<span class='notice'>You hear something squeezing through the ventilation ducts.</span>")
sleep(travel_time)
if(!exit_vent || exit_vent.welded)
+1 -3
View File
@@ -755,9 +755,7 @@ var/global/list/obj/item/device/pda/PDAs = list()
P.tnote += "<i><b>&larr; From <a href='byond://?src=\ref[P];choice=Message;target=\ref[src]'>[owner]</a> ([ownjob]):</b></i><br>[t]<br>"
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))
@@ -162,8 +162,7 @@ Frequency:
user.show_message("<span class='notice'>\The [src] is recharging!</span>")
return
var/T = L[t1]
for(var/mob/O in hearers(user, null))
O.show_message("<span class='notice'>Locked In.</span>", 2)
user.audible_message("<span class='notice'>Locked In.</span>")
var/obj/effect/portal/P = new /obj/effect/portal(get_turf(src), T, src)
try_move_adjacent(P)
active_portals++
@@ -250,7 +250,7 @@
if(!lastbang)
lastbang = 1
for (var/mob/M in hearers(src, null))
M << text("<FONT size=[]>BANG, bang!</FONT>", max(0, 5 - get_dist(src, M)))
M.show_message("<FONT size=[max(0, 5 - get_dist(src, M))]>BANG, bang!</FONT>", 2)
spawn(30)
lastbang = 0
@@ -96,7 +96,7 @@
if(world.time > lastbang+5)
lastbang = world.time
for(var/mob/M in hearers(src, null))
M << "<FONT size=[max(0, 5 - get_dist(src, M))]>BANG, bang!</FONT>"
M.show_message("<FONT size=[max(0, 5 - get_dist(src, M))]>BANG, bang!</FONT>", 2)
return
/obj/structure/closet/secure_closet/attack_hand(mob/user as mob)
+1 -2
View File
@@ -481,8 +481,7 @@ var/list/admin_verbs_hideable = list(
if(mob.control_object)
if(!msg)
return
for (var/mob/V in hearers(mob.control_object))
V.show_message("<b>[mob.control_object.name]</b> says: \"" + msg + "\"", 2)
mob.control_object.audible_message("<b>[mob.control_object.name]</b> says: \"" + msg + "\"")
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()
+1 -2
View File
@@ -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
+1 -2
View File
@@ -76,8 +76,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)
+1 -2
View File
@@ -1875,8 +1875,7 @@ ________________________________________________________________________________
P.tnote += "<i><b>&larr; From [!s_control?(A):"an unknown source"]:</b></i><br>[t]<br>"
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")
+5 -6
View File
@@ -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,8 @@ 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("<b>[src]</b>'s monitor flashes, \"Bible printer currently unavailable, please wait a moment.\"")
audible_message("<b>[src]</b>'s monitor beeps, \"Bible printer currently unavailable, please wait a moment.\"", \
"<b>[src]</b>'s monitor flashes.")
if("7")
screenstate = 7
@@ -364,8 +363,8 @@ 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("<b>[src]</b>'s monitor flashes, \"Printer unavailable. Please allow a short time before attempting to print.\"")
audible_message("<b>[src]</b>'s monitor beeps, \"Printer unavailable. Please allow a short time before attempting to print.\"", \
"<b>[src]</b>'s monitor flashes.")
else
bibledelay = 1
spawn(60)
@@ -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)
audible_message(message)
return
@@ -101,14 +101,11 @@
else
src << "<span class='info'> Unusable emote '[act]'. Say *help for a list.</span>"
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)
audible_message(message)
return
@@ -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)
audible_message(message)
+2 -4
View File
@@ -23,9 +23,7 @@
/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("<span class='danger'>You hear something rumbling inside [src]'s stomach...</span>"), 2)
audible_message("<span class='danger'>You hear something rumbling inside [src]'s stomach...</span>", "<span class='danger'>Something is rumbling inside your stomach!</span>", null, 4)
var/obj/item/I = user.get_active_hand()
if(I && I.force)
var/d = rand(round(I.force / 4), I.force)
@@ -41,7 +39,7 @@
src.take_organ_damage(d)
for(var/mob/M in viewers(user, null))
if(M.client)
M.show_message(text("<span class='userdanger'>[user] attacks [src]'s stomach wall with the [I.name]!</span>"), 2)
M.show_message("<span class='userdanger'>[user] attacks [src]'s stomach wall with the [I.name]!</span>", 2)
playsound(user.loc, 'sound/effects/attackblob.ogg', 50, 1)
if(prob(src.getBruteLoss() - 50))
+2 -4
View File
@@ -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)
audible_message(message)
@@ -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)
audible_message(message)
@@ -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)
audible_message(message)
return
@@ -52,11 +52,8 @@
src << "<span class='notice'>Unusable emote '[act]'. Say *help for a list.</span>"
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)
audible_message(message)
return
+3 -5
View File
@@ -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 << "<span class='notice'>Unusable emote '[act]'. Say *help for a list.</span>"
@@ -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)
audible_message(message)
@@ -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"])
@@ -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)
audible_message(message)
return
+36
View File
@@ -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.
// blind_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/self_message, var/deaf_message, var/hearing_distance)
var/range = 7
if(hearing_distance)
range = hearing_distance
for(var/mob/M in hearers(range, src))
var/msg = message
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.
// blind_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 hearers(range, src))
M.show_message( message, 2, deaf_message, 1)
/mob/proc/movement_delay()
return 0
+1 -1
View File
@@ -582,7 +582,7 @@
return
if (src.loc)
for (var/mob/M in hearers(src.loc.loc))
M << "<FONT size=[max(0, 5 - get_dist(src, M))]>CLONG, clong!</FONT>"
M.show_message("<FONT size=[max(0, 5 - get_dist(src, M))]>CLONG, clong!</FONT>", 2)
playsound(src.loc, 'sound/effects/clang.ogg', 50, 0, 0)