Merge pull request #4226 from Tastyfish/wpai

Lets pAI's whisper consistently
This commit is contained in:
TheDZD
2016-04-17 19:55:33 -04:00
3 changed files with 22 additions and 6 deletions
+9 -4
View File
@@ -334,6 +334,10 @@ proc/get_radio_key_from_channel(var/channel)
whisper_say(message, speaking)
// for weird circumstances where you're inside an atom that is also you, like pai's
/mob/living/proc/get_whisper_loc()
return src
/mob/living/proc/whisper_say(var/message, var/datum/language/speaking = null, var/alt_name="", var/verb="whispers")
if(client)
if(client.prefs.muted & MUTE_IC)
@@ -382,7 +386,8 @@ proc/get_radio_key_from_channel(var/channel)
if(!message || message=="")
return
var/list/listening = hearers(message_range, src)
var/atom/whisper_loc = get_whisper_loc()
var/list/listening = hearers(message_range, whisper_loc)
listening |= src
//ghosts
@@ -399,16 +404,16 @@ proc/get_radio_key_from_channel(var/channel)
listening += C
//pass on the message to objects that can hear us.
for(var/obj/O in view(message_range, src))
for(var/obj/O in view(message_range, whisper_loc))
spawn(0)
if(O)
O.hear_talk(src, message, verb, speaking)
var/list/eavesdropping = hearers(eavesdropping_range, src)
var/list/eavesdropping = hearers(eavesdropping_range, whisper_loc)
eavesdropping -= src
eavesdropping -= listening
var/list/watching = hearers(watching_range, src)
var/list/watching = hearers(watching_range, whisper_loc)
watching -= src
watching -= listening
watching -= eavesdropping
+9 -1
View File
@@ -2,4 +2,12 @@
if(silence_time)
to_chat(src, "<font color=green>Communication circuits remain uninitialized.</font>")
else
..(msg)
..(msg)
/mob/living/silicon/pai/get_whisper_loc()
if(loc == card) // currently in its card?
if(istype(card.loc, /mob/living))
return card.loc // allow a pai being held or in pocket to whisper
else
return card // allow a pai in its card to whisper
return ..()
+4 -1
View File
@@ -30,7 +30,10 @@
/mob/living/silicon/pai/handle_message_mode(message_mode, message, verb, speaking, used_radios, alt_name)
if(..())
return 1
if(message_mode)
else if(message_mode == "whisper")
whisper_say(message, speaking, alt_name)
return 1
else if(message_mode)
if(message_mode == "general")
message_mode = null
return radio.talk_into(src,message,message_mode,verb,speaking)