mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-28 15:47:15 +01:00
Merge pull request #4815 from phil235/AudibleMsgFix
Simplifying audible messages
This commit is contained in:
@@ -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)
|
||||
@@ -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))
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user