Rechecked organs.dm so code compiles now.

Mobs in lockers now can hear radios.


git-svn-id: http://tgstation13.googlecode.com/svn/trunk@1247 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
rastaf.zero@gmail.com
2011-03-23 14:32:13 +00:00
parent d57b9f1d7d
commit 7ed34fe356
5 changed files with 42 additions and 14 deletions
+1 -1
View File
@@ -121,4 +121,4 @@ var/global/list/common_tools = list(
/proc/iscrowbar(O)
if(O && istype(O, /obj/item/weapon/crowbar))
return 1
return 0
return 0
+17 -2
View File
@@ -15,8 +15,23 @@
/obj/item/device/radio/intercom/send_hear()
if (!(src.wires & WIRE_RECEIVE))
return
if (src.listening)
return hearers(7, src.loc)
if (!src.listening)
return
var/turf/T = get_turf(src)
var/list/hear = hearers(7, T)
var/list/V
//find mobs in lockers, cryo and intellycards
for (var/mob/M in world)
if (isturf(M.loc))
continue //if M can hear us it is already was found by hearers()
if (!M.client)
continue //skip monkeys and leavers
if (!V) //lasy initialisation
V = view(7, T)
if (get_turf(M) in V) //this slow, but I don't think we'd have a lot of wardrobewhores every round --rastaf0
hear+=M
return hear
/obj/item/device/radio/intercom/hear_talk(mob/M as mob, msg)
if(!src.anyai && !(M in src.ai))
+14 -9
View File
@@ -187,9 +187,7 @@ Speaker: <A href='byond://?src=\ref[src];ch_name=[chan_name];listen=[!list]'>[li
//for (var/obj/item/device/radio/R in radio_connection.devices)
for (var/obj/item/device/radio/R in connection.devices["[RADIO_CHAT]"]) // Modified for security headset code -- TLE
//if(R.accept_rad(src, message))
for (var/i in R.send_hear(display_freq))
if (!(i in receive))
receive += i
receive |= R.send_hear(display_freq)
//world << "DEBUG: receive.len=[receive.len]"
var/list/heard_masked = list() // masked name or no real name
@@ -294,13 +292,20 @@ Speaker: <A href='byond://?src=\ref[src];ch_name=[chan_name];listen=[!list]'>[li
break
if (!accept)
return
var/list/hear = hearers(1, src.loc)
// modified so that a mob holding the radio is always a hearer of it
// this fixes radio problems when inside something (e.g. mulebot)
if(ismob(loc))
if(! (loc in hear) )
hear += loc
var/turf/T = get_turf(src)
var/list/hear = hearers(1, T)
var/list/V
//find mobs in lockers, cryo and intellycards
for (var/mob/M in world)
if (isturf(M.loc))
continue //if M can hear us it is already was found by hearers()
if (!M.client)
continue //skip monkeys and leavers
if (!V) //lasy initialisation
V = view(1, T)
if (get_turf(M) in V) //this slow, but I don't think we'd have a lot of wardrobewhores every round --rastaf0
hear+=M
return hear
/obj/item/device/radio/examine()
+9 -2
View File
@@ -141,11 +141,12 @@
for(var/i=0,i<bzz,i++)
message += "Z"
*/
var/list/obj/item/used_radios = new
switch (message_mode)
if ("headset")
if (src:ears)
src:ears.talk_into(src, message)
used_radios += src:ears
message_range = 1
italics = 1
@@ -153,6 +154,7 @@
if ("secure headset")
if (src:ears)
src:ears.talk_into(src, message, 1)
used_radios += src:ears
message_range = 1
italics = 1
@@ -160,6 +162,7 @@
if ("right hand")
if (src.r_hand)
src.r_hand.talk_into(src, message)
used_radios += src:r_hand
message_range = 1
italics = 1
@@ -167,6 +170,7 @@
if ("left hand")
if (src.l_hand)
src.l_hand.talk_into(src, message)
used_radios += src:l_hand
message_range = 1
italics = 1
@@ -174,6 +178,7 @@
if ("intercom")
for (var/obj/item/device/radio/intercom/I in view(1, null))
I.talk_into(src, message)
used_radios += I
message_range = 1
italics = 1
@@ -198,6 +203,7 @@
if ("department")
if (src:ears)
src:ears.talk_into(src, message, message_mode)
used_radios += src:ears
message_range = 1
italics = 1
/////SPECIAL HEADSETS START
@@ -206,6 +212,7 @@
if (message_mode in radiochannels)
if (src:ears)
src:ears.talk_into(src, message, message_mode)
used_radios += src:ears
message_range = 1
italics = 1
/////SPECIAL HEADSETS END
@@ -245,7 +252,7 @@
if (get_turf(M) in V) //this slow, but I don't think we'd have a lot of wardrobewhores every round --rastaf0
listening+=M
for (var/obj/O in V)
for (var/obj/O in (V-used_radios))
spawn (0)
if (O)
O.hear_talk(src, message)