Files
Paradise/code/game/objects/items/devices/radio/intercom.dm
giacomand@gmail.com eb68c1e510 -You can now only hear from headsets when it is on your ear slot. People around you won't be able to hear your headset anymore.
-The firedoor wasn't updating the freelook camera. When I looked at it I couldn't figure out why it was using it's own "rebuild" code, supposedly it only updates the air that it set in the dir variable but the current map doesn't utilize it at all (firelocks with a dir of 8 which are lined horizontalally), and you would have to have two thick wide firelocks to make it effective. I've commented it out and I'll put it back in if we have problems.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4832 316c924e-a436-60f5-8080-3fe189b3f50e
2012-10-08 03:52:25 +00:00

73 lines
1.6 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()
/obj/item/device/radio/intercom/New()
spawn(5)
checkpower()
..()
/obj/item/device/radio/intercom/attack_ai(mob/user as mob)
src.add_fingerprint(user)
spawn (0)
attack_self(user)
/obj/item/device/radio/intercom/attack_paw(mob/user as mob)
return src.attack_hand(user)
/obj/item/device/radio/intercom/attack_hand(mob/user as mob)
src.add_fingerprint(user)
spawn (0)
attack_self(user)
/obj/item/device/radio/intercom/receive_range(freq, level)
if (!on)
return -1
if (!(src.wires & WIRE_RECEIVE))
return -1
if(level != 0)
var/turf/position = get_turf(src)
if(isnull(position) || position.z != level)
return -1
if (!src.listening)
return -1
if(freq == SYND_FREQ)
if(!(src.syndie))
return -1//Prevents broadcast of messages over devices lacking the encryption
return canhear_range
/obj/item/device/radio/intercom/hear_talk(mob/M as mob, msg)
if(!src.anyai && !(M in src.ai))
return
..()
/obj/item/device/radio/intercom/proc/checkpower()
// Simple loop, checks for power. Strictly for intercoms
while(src)
if(!src.loc)
on = 0
else
var/area/A = src.loc.loc
if(!A || !isarea(A) || !A.master)
on = 0
else
on = A.master.powered(EQUIP) // set "on" to the power status
if(!on)
icon_state = "intercom-p"
else
icon_state = "intercom"
sleep(30)