Merge pull request #4815 from phil235/AudibleMsgFix

Simplifying audible messages
This commit is contained in:
Swag McYolosteinen
2014-09-27 15:01:56 +02:00
30 changed files with 107 additions and 116 deletions
+5 -18
View File
@@ -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("<span class='adminnotice'>[key_name_admin(usr)] gave [key_name(T)] the disease [D].</span>", 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("<b>[mob.control_object.name]</b> 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"
+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
@@ -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)
+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")
+8 -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,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("<b>[src]</b>'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("<b>[src]</b>'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
*/
@@ -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
@@ -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)
src.loc.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)
src.loc.audible_message(message)
+4 -4
View File
@@ -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("<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'>You hear something rumbling.</span>", 4,\
"<span class='danger'>Something is rumbling inside your stomach!</span>")
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("<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)
src.loc.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)
src.loc.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)
src.loc.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)
src.loc.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)
src.loc.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)
src.loc.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.
// 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
+1 -2
View File
@@ -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("<FONT size=[max(0, 5 - get_dist(src, M))]>CLONG, clong!</FONT>", 2)
playsound(src.loc, 'sound/effects/clang.ogg', 50, 0, 0)
// called to vent all gas in holder to a location