TG: Borg radios now work while they're recharging

MMIs/pAIs/lockers in the dark can now hear.  This was done by changing the area
check for hearing to a range instead of view, and then doing a line of sight
calculation for each mob that can't hear naturally and checking if it's clear.
Revision: r3180
Author: 	 VivianFoxfoot
This commit is contained in:
Ren Erthilo
2012-04-24 20:28:38 +01:00
parent b4117291f8
commit 577669920f
2 changed files with 170 additions and 56 deletions
+22 -2
View File
@@ -32,8 +32,6 @@
if (!message)
return
log_say("[name]/[key] : [message]")
if (length(message) >= 1)
if (miming && copytext(message, 1, 2) != "*")
return
@@ -315,8 +313,11 @@
listening += src
*/
/* Handing this section over to get_mobs_in_view which was written with radiocode update
var/turf/T = get_turf(src)
listening = hearers(message_range, T)
for (var/O in listening)
world << O
var/list/V = view(message_range, T)
var/list/W = V
@@ -335,6 +336,21 @@
if (M.client && M.client.ghost_ears)
listening|=M
*/
listening = get_mobs_in_view(message_range, src)
for(var/mob/M in world)
if (!M.client)
continue //skip monkeys and leavers
if (istype(M, /mob/new_player))
continue
if(M.stat == 2 && M.client.ghost_ears)
listening|=M
var/turf/T = get_turf(src)
var/list/V = view(message_range, T)
var/list/W = V
var/list/eavesdroppers = get_mobs_in_view(7, src)
for(var/mob/M in listening)
eavesdroppers.Remove(M)
@@ -368,6 +384,8 @@
spawn(0)
O.hear_talk(src, message)
var/list/heard_a = list() // understood us
var/list/heard_b = list() // didn't understand us
@@ -520,6 +538,8 @@
M << speech_bubble
spawn(30) del(speech_bubble)
log_say("[name]/[key] : [message]")
/obj/effect/speech_bubble