mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-01-04 22:52:03 +00:00
- To help further lower the cost of this proc I have lowered the default intercom range to 2. I then added consistency of not being able to use an intercom from across the room by adding a check for distance, using the same variable as the intercom range. - Committing a fix by VistaPOWA for the changeling sting drink. You should be able to create it now by mixing screwdrivercocktail, limejuice and lemonjuice. Before it was orangejuice, limejuice, lemonuice and vodka but orangejuice and vodka would mix first to create screwdrivercocktail. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@5560 316c924e-a436-60f5-8080-3fe189b3f50e
73 lines
1.6 KiB
Plaintext
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 = 2
|
|
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(!(0 in level))
|
|
var/turf/position = get_turf(src)
|
|
if(isnull(position) || !(position.z in 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) |