94 lines
2.7 KiB
Plaintext
94 lines
2.7 KiB
Plaintext
/*
|
|
The relay idles until it receives information. It then passes on that information
|
|
depending on where it came from.
|
|
|
|
The relay is needed in order to send information pass Z levels. It must be linked
|
|
with a HUB, the only other machine that can send/receive pass Z levels.
|
|
*/
|
|
|
|
/obj/machinery/telecomms/relay
|
|
name = "telecommunication relay"
|
|
icon_state = "relay"
|
|
desc = "A mighty piece of hardware used to send massive amounts of data far away."
|
|
density = TRUE
|
|
use_power = IDLE_POWER_USE
|
|
idle_power_usage = 30
|
|
netspeed = 5
|
|
long_range_link = 1
|
|
circuit = /obj/item/circuitboard/machine/telecomms/relay
|
|
var/broadcasting = 1
|
|
var/receiving = 1
|
|
|
|
/obj/machinery/telecomms/relay/RefreshParts()
|
|
idle_power_usage = 30
|
|
for(var/obj/item/stock_parts/manipulator/P in component_parts)
|
|
idle_power_usage -= (P.rating * 1.5) //Has 2 manipulators
|
|
|
|
/obj/machinery/telecomms/relay/receive_information(datum/signal/subspace/signal, obj/machinery/telecomms/machine_from)
|
|
// Add our level and send it back
|
|
var/turf/T = get_turf(src)
|
|
if(can_send(signal) && T)
|
|
signal.levels |= T.z
|
|
|
|
// Checks to see if it can send/receive.
|
|
|
|
/obj/machinery/telecomms/relay/proc/can(datum/signal/signal)
|
|
if(!on)
|
|
return FALSE
|
|
if(!is_freq_listening(signal))
|
|
return FALSE
|
|
return TRUE
|
|
|
|
/obj/machinery/telecomms/relay/proc/can_send(datum/signal/signal)
|
|
if(!can(signal))
|
|
return FALSE
|
|
return broadcasting
|
|
|
|
/obj/machinery/telecomms/relay/proc/can_receive(datum/signal/signal)
|
|
if(!can(signal))
|
|
return FALSE
|
|
return receiving
|
|
|
|
//Preset Relay
|
|
|
|
/obj/machinery/telecomms/relay/preset
|
|
network = "tcommsat"
|
|
|
|
/obj/machinery/telecomms/relay/Initialize(mapload)
|
|
. = ..()
|
|
if(autolinkers.len) //We want lateloaded presets to autolink (lateloaded aways/ruins/shuttles)
|
|
return INITIALIZE_HINT_LATELOAD
|
|
|
|
/obj/machinery/telecomms/relay/preset/station
|
|
id = "Station Relay"
|
|
autolinkers = list("s_relay")
|
|
|
|
/obj/machinery/telecomms/relay/preset/telecomms
|
|
id = "Telecomms Relay"
|
|
autolinkers = list("relay")
|
|
|
|
/obj/machinery/telecomms/relay/preset/mining
|
|
id = "Mining Relay"
|
|
autolinkers = list("m_relay")
|
|
|
|
/obj/machinery/telecomms/relay/preset/ruskie
|
|
id = "Ruskie Relay"
|
|
hide = 1
|
|
toggled = FALSE
|
|
autolinkers = list("r_relay")
|
|
|
|
/obj/machinery/telecomms/relay/preset/reebe
|
|
name = "hierophant relay"
|
|
desc = "An arcane telecommunications relay that ingeniously combines bluespace technology with the Hierophant network to send and receive messages to and from Reebe."
|
|
id = "Hierophant Relay"
|
|
icon = 'icons/obj/clockwork_objects.dmi'
|
|
hide = TRUE
|
|
autolinkers = list("h_relay")
|
|
flags_1 = DEFAULT_RICOCHET_1 | NODECONSTRUCT_1
|
|
resistance_flags = INDESTRUCTIBLE
|
|
|
|
//Generic preset relay
|
|
/obj/machinery/telecomms/relay/preset/auto
|
|
hide = TRUE
|
|
autolinkers = list("autorelay")
|