* Maps and things no code/icons * helpers defines globalvars * Onclick world.dm orphaned_procs * subsystems Round vote and shuttle autocall done here too * datums * Game folder * Admin - chatter modules * clothing - mining * modular computers - zambies * client * mob level 1 * mob stage 2 + simple_animal * silicons n brains * mob stage 3 + Alien/Monkey * human mobs * icons updated * some sounds * emitter y u no commit * update tgstation.dme * compile fixes * travis fixes Also removes Fast digest mode, because reasons. * tweaks for travis Mentors are broke again Also fixes Sizeray guns * oxygen loss fix for vore code. * removes unused code * some code updates * bulk fixes * further fixes * outside things * whoops. * Maint bar ported * GLOBs.
99 lines
3.1 KiB
Plaintext
99 lines
3.1 KiB
Plaintext
|
|
/*
|
|
The receiver idles and receives messages from subspace-compatible radio equipment;
|
|
primarily headsets. They then just relay this information to all linked devices,
|
|
which can would probably be network hubs.
|
|
|
|
Link to Processor Units in case receiver can't send to bus units.
|
|
*/
|
|
|
|
/obj/machinery/telecomms/receiver
|
|
name = "subspace receiver"
|
|
icon_state = "broadcast receiver"
|
|
desc = "This machine has a dish-like shape and green lights. It is designed to detect and process subspace radio activity."
|
|
density = 1
|
|
anchored = 1
|
|
use_power = 1
|
|
idle_power_usage = 30
|
|
machinetype = 1
|
|
//heatgen = 0
|
|
|
|
/obj/machinery/telecomms/receiver/receive_signal(datum/signal/signal)
|
|
|
|
if(!on) // has to be on to receive messages
|
|
return
|
|
if(!signal)
|
|
return
|
|
if(!check_receive_level(signal))
|
|
return
|
|
if(signal.transmission_method == 2)
|
|
|
|
if(is_freq_listening(signal)) // detect subspace signals
|
|
|
|
//Remove the level and then start adding levels that it is being broadcasted in.
|
|
signal.data["level"] = list()
|
|
|
|
var/can_send = relay_information(signal, "/obj/machinery/telecomms/hub") // ideally relay the copied information to relays
|
|
if(!can_send)
|
|
relay_information(signal, "/obj/machinery/telecomms/bus") // Send it to a bus instead, if it's linked to one
|
|
|
|
/obj/machinery/telecomms/receiver/proc/check_receive_level(datum/signal/signal)
|
|
|
|
if(signal.data["level"] != listening_level)
|
|
for(var/obj/machinery/telecomms/hub/H in links)
|
|
var/list/connected_levels = list()
|
|
for(var/obj/machinery/telecomms/relay/R in H.links)
|
|
if(R.can_receive(signal))
|
|
connected_levels |= R.listening_level
|
|
if(signal.data["level"] in connected_levels)
|
|
return 1
|
|
return 0
|
|
return 1
|
|
|
|
|
|
/obj/machinery/telecomms/receiver/New()
|
|
..()
|
|
var/obj/item/weapon/circuitboard/machine/B = new /obj/item/weapon/circuitboard/machine/telecomms/receiver(null)
|
|
B.apply_default_parts(src)
|
|
|
|
/obj/item/weapon/circuitboard/machine/telecomms/receiver
|
|
name = "Subspace Receiver (Machine Board)"
|
|
build_path = /obj/machinery/telecomms/receiver
|
|
origin_tech = "programming=2;engineering=2;bluespace=1"
|
|
req_components = list(
|
|
/obj/item/weapon/stock_parts/subspace/ansible = 1,
|
|
/obj/item/weapon/stock_parts/subspace/filter = 1,
|
|
/obj/item/weapon/stock_parts/manipulator = 2,
|
|
/obj/item/weapon/stock_parts/micro_laser = 1)
|
|
|
|
|
|
|
|
|
|
//Preset Receivers
|
|
|
|
//--PRESET LEFT--//
|
|
|
|
/obj/machinery/telecomms/receiver/preset_left
|
|
id = "Receiver A"
|
|
network = "tcommsat"
|
|
autolinkers = list("receiverA") // link to relay
|
|
freq_listening = list(GLOB.SCI_FREQ, GLOB.MED_FREQ, GLOB.SUPP_FREQ, GLOB.SERV_FREQ) // science, medical, supply, service
|
|
|
|
|
|
//--PRESET RIGHT--//
|
|
|
|
/obj/machinery/telecomms/receiver/preset_right
|
|
id = "Receiver B"
|
|
network = "tcommsat"
|
|
autolinkers = list("receiverB") // link to relay
|
|
freq_listening = list(GLOB.COMM_FREQ, GLOB.ENG_FREQ, GLOB.SEC_FREQ) //command, engineering, security
|
|
|
|
//Common and other radio frequencies for people to freely use
|
|
/obj/machinery/telecomms/receiver/preset_right/New()
|
|
for(var/i = 1441, i < 1489, i += 2)
|
|
freq_listening |= i
|
|
..()
|
|
|
|
/obj/machinery/telecomms/receiver/preset_left/birdstation
|
|
name = "Receiver"
|
|
freq_listening = list() |