Files
VOREStation/code/game/objects/radio/intercom.dm
giacomand@gmail.com 4b239afe76 Fixed issue 724 - I've also tried to fix the unreported bug where a person cannot hear their radio messages while in the dark. Instead I'll make an issue report and try to work on it more later. I'm assuming it has something to do with BYOND thinking that the user cannot see dark tiles in the viewer proc.
Cleaned up a bit of the broadcasting code.
Made everything use turf's z levels as I find them more reliable, sometimes an item's loc can be null or the z level can be entirely wrong. I hope the high usage of get_turf() will not create problems.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4275 316c924e-a436-60f5-8080-3fe189b3f50e
2012-08-01 22:55:14 +00:00

54 lines
1.1 KiB
Plaintext

/obj/item/device/radio/intercom
name = "station intercom"
desc = "Talk through this."
icon_state = "intercom"
anchored = 1
w_class = 4.0
canhear_range = 4
var/number = 0
var/anyai = 1
var/mob/living/silicon/ai/ai = list()
attack_ai(mob/user as mob)
src.add_fingerprint(user)
spawn (0)
attack_self(user)
attack_paw(mob/user as mob)
if ((ticker && ticker.mode.name == "monkey"))
return src.attack_hand(user)
attack_hand(mob/user as mob)
src.add_fingerprint(user)
spawn (0)
attack_self(user)
send_hear(freq, level)
var/range = receive_range(freq, level)
if(range > 0)
return get_mobs_in_view(canhear_range, src)
receive_range(freq, level)
if (!on)
return 0
if (!(src.wires & WIRE_RECEIVE))
return 0
var/turf/position = get_turf(src)
if(isnull(position) || position.z != level)
return 0
if (!src.listening)
return 0
if(freq == SYND_FREQ)
if(!(src.syndie))
return 0//Prevents broadcast of messages over devices lacking the encryption
return canhear_range
hear_talk(mob/M as mob, msg)
if(!src.anyai && !(M in src.ai))
return
..()