modules: A to C
This commit is contained in:
@@ -80,8 +80,8 @@
|
||||
var/shorted = 0
|
||||
var/buildstage = 2 // 2 = complete, 1 = no wires, 0 = circuit gone
|
||||
|
||||
var/frequency = 1439
|
||||
var/alarm_frequency = 1437
|
||||
var/frequency = FREQ_ATMOS_CONTROL
|
||||
var/alarm_frequency = FREQ_ATMOS_ALARMS
|
||||
var/datum/radio_frequency/radio_connection
|
||||
|
||||
var/list/TLV = list( // Breathable air.
|
||||
@@ -427,21 +427,16 @@
|
||||
/obj/machinery/airalarm/proc/set_frequency(new_frequency)
|
||||
SSradio.remove_object(src, frequency)
|
||||
frequency = new_frequency
|
||||
radio_connection = SSradio.add_object(src, frequency, GLOB.RADIO_TO_AIRALARM)
|
||||
radio_connection = SSradio.add_object(src, frequency, RADIO_TO_AIRALARM)
|
||||
|
||||
/obj/machinery/airalarm/proc/send_signal(target, list/command)//sends signal 'command' to 'target'. Returns 0 if no radio connection, 1 otherwise
|
||||
if(!radio_connection)
|
||||
return 0
|
||||
|
||||
var/datum/signal/signal = new
|
||||
signal.transmission_method = 1 //radio signal
|
||||
signal.source = src
|
||||
|
||||
signal.data = command
|
||||
var/datum/signal/signal = new(command)
|
||||
signal.data["tag"] = target
|
||||
signal.data["sigtype"] = "command"
|
||||
|
||||
radio_connection.post_signal(src, signal, GLOB.RADIO_FROM_AIRALARM)
|
||||
radio_connection.post_signal(src, signal, RADIO_FROM_AIRALARM)
|
||||
|
||||
return 1
|
||||
|
||||
@@ -631,12 +626,10 @@
|
||||
|
||||
var/area/A = get_area(src)
|
||||
|
||||
var/datum/signal/alert_signal = new
|
||||
alert_signal.source = src
|
||||
alert_signal.transmission_method = 1
|
||||
alert_signal.data["zone"] = A.name
|
||||
alert_signal.data["type"] = "Atmospheric"
|
||||
|
||||
var/datum/signal/alert_signal = new(list(
|
||||
"zone" = A.name,
|
||||
"type" = "Atmospheric"
|
||||
))
|
||||
if(alert_level==2)
|
||||
alert_signal.data["alert"] = "severe"
|
||||
else if (alert_level==1)
|
||||
@@ -644,7 +637,7 @@
|
||||
else if (alert_level==0)
|
||||
alert_signal.data["alert"] = "clear"
|
||||
|
||||
frequency.post_signal(src, alert_signal,null,-1)
|
||||
frequency.post_signal(src, alert_signal, range = -1)
|
||||
|
||||
/obj/machinery/airalarm/proc/apply_danger_level()
|
||||
var/area/A = get_area(src)
|
||||
@@ -741,7 +734,7 @@
|
||||
return
|
||||
|
||||
return ..()
|
||||
|
||||
|
||||
/obj/machinery/airalarm/AltClick(mob/user)
|
||||
..()
|
||||
if(!issilicon(user) && (!user.canUseTopic(src, be_close=TRUE) || !isturf(loc)))
|
||||
@@ -749,7 +742,7 @@
|
||||
return
|
||||
else
|
||||
togglelock(user)
|
||||
|
||||
|
||||
/obj/machinery/airalarm/proc/togglelock(mob/living/user)
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
to_chat(user, "<span class='warning'>It does nothing!</span>")
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
|
||||
anchored = TRUE
|
||||
density = TRUE
|
||||
|
||||
var/global/const/CIRC_LEFT = 1
|
||||
var/global/const/CIRC_RIGHT = 2
|
||||
|
||||
@@ -39,6 +40,8 @@
|
||||
var/transfer_moles = pressure_delta*air1.volume/(air2.temperature * R_IDEAL_GAS_EQUATION)
|
||||
|
||||
last_pressure_delta = pressure_delta
|
||||
|
||||
//Actually transfer the gas
|
||||
var/datum/gas_mixture/removed = air2.remove(transfer_moles)
|
||||
|
||||
update_parents()
|
||||
|
||||
@@ -131,17 +131,13 @@ Acts like a normal vent, but has an input AND output.
|
||||
SSradio.remove_object(src, frequency)
|
||||
frequency = new_frequency
|
||||
if(frequency)
|
||||
radio_connection = SSradio.add_object(src, frequency, filter = GLOB.RADIO_ATMOSIA)
|
||||
radio_connection = SSradio.add_object(src, frequency, filter = RADIO_ATMOSIA)
|
||||
|
||||
/obj/machinery/atmospherics/components/binary/dp_vent_pump/proc/broadcast_status()
|
||||
if(!radio_connection)
|
||||
return
|
||||
|
||||
var/datum/signal/signal = new
|
||||
signal.transmission_method = 1 //radio signal
|
||||
signal.source = src
|
||||
|
||||
signal.data = list(
|
||||
var/datum/signal/signal = new(list(
|
||||
"tag" = id,
|
||||
"device" = "ADVP",
|
||||
"power" = on,
|
||||
@@ -151,8 +147,8 @@ Acts like a normal vent, but has an input AND output.
|
||||
"output" = output_pressure_max,
|
||||
"external" = external_pressure_bound,
|
||||
"sigtype" = "status"
|
||||
)
|
||||
radio_connection.post_signal(src, signal, filter = GLOB.RADIO_ATMOSIA)
|
||||
))
|
||||
radio_connection.post_signal(src, signal, filter = RADIO_ATMOSIA)
|
||||
|
||||
/obj/machinery/atmospherics/components/binary/dp_vent_pump/atmosinit()
|
||||
..()
|
||||
|
||||
@@ -72,25 +72,20 @@ Passive gate is similar to the regular pump except:
|
||||
SSradio.remove_object(src, frequency)
|
||||
frequency = new_frequency
|
||||
if(frequency)
|
||||
radio_connection = SSradio.add_object(src, frequency, filter = GLOB.RADIO_ATMOSIA)
|
||||
radio_connection = SSradio.add_object(src, frequency, filter = RADIO_ATMOSIA)
|
||||
|
||||
/obj/machinery/atmospherics/components/binary/passive_gate/proc/broadcast_status()
|
||||
if(!radio_connection)
|
||||
return
|
||||
|
||||
var/datum/signal/signal = new
|
||||
signal.transmission_method = 1 //radio signal
|
||||
signal.source = src
|
||||
|
||||
signal.data = list(
|
||||
var/datum/signal/signal = new(list(
|
||||
"tag" = id,
|
||||
"device" = "AGP",
|
||||
"power" = on,
|
||||
"target_output" = target_pressure,
|
||||
"sigtype" = "status"
|
||||
)
|
||||
|
||||
radio_connection.post_signal(src, signal, filter = GLOB.RADIO_ATMOSIA)
|
||||
))
|
||||
radio_connection.post_signal(src, signal, filter = RADIO_ATMOSIA)
|
||||
|
||||
/obj/machinery/atmospherics/components/binary/passive_gate/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
|
||||
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
|
||||
|
||||
@@ -75,25 +75,20 @@ Thus, the two variables affect pump operation are set in New():
|
||||
SSradio.remove_object(src, frequency)
|
||||
frequency = new_frequency
|
||||
if(frequency)
|
||||
radio_connection = SSradio.add_object(src, frequency, filter = GLOB.RADIO_ATMOSIA)
|
||||
radio_connection = SSradio.add_object(src, frequency, filter = RADIO_ATMOSIA)
|
||||
|
||||
/obj/machinery/atmospherics/components/binary/pump/proc/broadcast_status()
|
||||
if(!radio_connection)
|
||||
return
|
||||
|
||||
var/datum/signal/signal = new
|
||||
signal.transmission_method = 1 //radio signal
|
||||
signal.source = src
|
||||
|
||||
signal.data = list(
|
||||
var/datum/signal/signal = new(list(
|
||||
"tag" = id,
|
||||
"device" = "AGP",
|
||||
"power" = on,
|
||||
"target_output" = target_pressure,
|
||||
"sigtype" = "status"
|
||||
)
|
||||
|
||||
radio_connection.post_signal(src, signal, filter = GLOB.RADIO_ATMOSIA)
|
||||
))
|
||||
radio_connection.post_signal(src, signal, filter = RADIO_ATMOSIA)
|
||||
|
||||
/obj/machinery/atmospherics/components/binary/pump/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
|
||||
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
|
||||
|
||||
@@ -77,17 +77,13 @@ Thus, the two variables affect pump operation are set in New():
|
||||
if(!radio_connection)
|
||||
return
|
||||
|
||||
var/datum/signal/signal = new
|
||||
signal.transmission_method = 1 //radio signal
|
||||
signal.source = src
|
||||
|
||||
signal.data = list(
|
||||
var/datum/signal/signal = new(list(
|
||||
"tag" = id,
|
||||
"device" = "APV",
|
||||
"power" = on,
|
||||
"transfer_rate" = transfer_rate,
|
||||
"sigtype" = "status"
|
||||
)
|
||||
))
|
||||
radio_connection.post_signal(src, signal)
|
||||
|
||||
/obj/machinery/atmospherics/components/binary/volume_pump/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
SSradio.remove_object(src, frequency)
|
||||
frequency = new_frequency
|
||||
if(frequency)
|
||||
radio_connection = SSradio.add_object(src, frequency, GLOB.RADIO_ATMOSIA)
|
||||
radio_connection = SSradio.add_object(src, frequency, RADIO_ATMOSIA)
|
||||
|
||||
/obj/machinery/atmospherics/components/trinary/filter/New()
|
||||
..()
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
|
||||
radio = new(src)
|
||||
radio.keyslot = new radio_key
|
||||
radio.subspace_transmission = 1
|
||||
radio.subspace_transmission = TRUE
|
||||
radio.canhear_range = 0
|
||||
radio.recalculateChannels()
|
||||
|
||||
@@ -182,7 +182,7 @@
|
||||
mob_occupant.Unconscious((mob_occupant.bodytemperature * unconscious_factor) * 2000)
|
||||
if(beaker)
|
||||
if(reagent_transfer == 0) // Magically transfer reagents. Because cryo magic.
|
||||
beaker.reagents.trans_to(occupant, 1, 10 * efficiency) // Transfer reagents, multiplied because cryo magic.
|
||||
beaker.reagents.trans_to(occupant, 1, efficiency * 0.25) // Transfer reagents.
|
||||
beaker.reagents.reaction(occupant, VAPOR)
|
||||
air1.gases[/datum/gas/oxygen][MOLES] -= 2 / efficiency //Let's use gas for this
|
||||
if(++reagent_transfer >= 10 * efficiency) // Throttle reagent transfer (higher efficiency will transfer the same amount but consume less from the beaker).
|
||||
|
||||
@@ -93,19 +93,14 @@
|
||||
if(!radio_connection)
|
||||
return
|
||||
|
||||
var/datum/signal/signal = new
|
||||
signal.transmission_method = 1 //radio signal
|
||||
signal.source = src
|
||||
|
||||
signal.data = list(
|
||||
var/datum/signal/signal = new(list(
|
||||
"tag" = id,
|
||||
"device" = "AO",
|
||||
"power" = on,
|
||||
"volume_rate" = volume_rate,
|
||||
//"timestamp" = world.time,
|
||||
"sigtype" = "status"
|
||||
)
|
||||
|
||||
))
|
||||
radio_connection.post_signal(src, signal)
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/outlet_injector/atmosinit()
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
// INT_BOUND: Do not pass internal_pressure_bound
|
||||
// NO_BOUND: Do not pass either
|
||||
|
||||
var/frequency = 1439
|
||||
var/frequency = FREQ_ATMOS_CONTROL
|
||||
var/datum/radio_frequency/radio_connection
|
||||
var/radio_filter_out
|
||||
var/radio_filter_in
|
||||
@@ -178,11 +178,7 @@
|
||||
if(!radio_connection)
|
||||
return
|
||||
|
||||
var/datum/signal/signal = new
|
||||
signal.transmission_method = 1 // radio signal
|
||||
signal.source = src
|
||||
|
||||
signal.data = list(
|
||||
var/datum/signal/signal = new(list(
|
||||
"tag" = id_tag,
|
||||
"frequency" = frequency,
|
||||
"device" = "VP",
|
||||
@@ -193,7 +189,7 @@
|
||||
"internal" = internal_pressure_bound,
|
||||
"external" = external_pressure_bound,
|
||||
"sigtype" = "status"
|
||||
)
|
||||
))
|
||||
|
||||
var/area/A = get_area(src)
|
||||
if(!A.air_vent_names[id_tag])
|
||||
@@ -206,8 +202,8 @@
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/vent_pump/atmosinit()
|
||||
//some vents work his own spesial way
|
||||
radio_filter_in = frequency==1439?(GLOB.RADIO_FROM_AIRALARM):null
|
||||
radio_filter_out = frequency==1439?(GLOB.RADIO_TO_AIRALARM):null
|
||||
radio_filter_in = frequency==FREQ_ATMOS_CONTROL?(RADIO_FROM_AIRALARM):null
|
||||
radio_filter_out = frequency==FREQ_ATMOS_CONTROL?(RADIO_TO_AIRALARM):null
|
||||
if(frequency)
|
||||
set_frequency(frequency)
|
||||
broadcast_status()
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
var/widenet = 0 //is this scrubber acting on the 3x3 area around it.
|
||||
var/list/turf/adjacent_turfs = list()
|
||||
|
||||
var/frequency = 1439
|
||||
var/frequency = FREQ_ATMOS_CONTROL
|
||||
var/datum/radio_frequency/radio_connection
|
||||
var/radio_filter_out
|
||||
var/radio_filter_in
|
||||
@@ -81,7 +81,7 @@
|
||||
icon_state = "scrub_off"
|
||||
return
|
||||
|
||||
if(scrubbing & SCRUBBING)
|
||||
if(scrubbing & SCRUBBING)
|
||||
if(widenet)
|
||||
icon_state = "scrub_wide"
|
||||
else
|
||||
@@ -98,16 +98,12 @@
|
||||
if(!radio_connection)
|
||||
return FALSE
|
||||
|
||||
var/datum/signal/signal = new
|
||||
signal.transmission_method = 1 //radio signal
|
||||
signal.source = src
|
||||
|
||||
var/list/f_types = list()
|
||||
for(var/path in GLOB.meta_gas_info)
|
||||
var/list/gas = GLOB.meta_gas_info[path]
|
||||
f_types += list(list("gas_id" = gas[META_GAS_ID], "gas_name" = gas[META_GAS_NAME], "enabled" = (path in filter_types)))
|
||||
|
||||
signal.data = list(
|
||||
var/datum/signal/signal = new(list(
|
||||
"tag" = id_tag,
|
||||
"frequency" = frequency,
|
||||
"device" = "VS",
|
||||
@@ -117,7 +113,7 @@
|
||||
"widenet" = widenet,
|
||||
"filter_types" = f_types,
|
||||
"sigtype" = "status"
|
||||
)
|
||||
))
|
||||
|
||||
var/area/A = get_area(src)
|
||||
if(!A.air_scrub_names[id_tag])
|
||||
@@ -130,8 +126,8 @@
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/vent_scrubber/atmosinit()
|
||||
radio_filter_in = frequency==initial(frequency)?(GLOB.RADIO_FROM_AIRALARM):null
|
||||
radio_filter_out = frequency==initial(frequency)?(GLOB.RADIO_TO_AIRALARM):null
|
||||
radio_filter_in = frequency==initial(frequency)?(RADIO_FROM_AIRALARM):null
|
||||
radio_filter_out = frequency==initial(frequency)?(RADIO_TO_AIRALARM):null
|
||||
if(frequency)
|
||||
set_frequency(frequency)
|
||||
broadcast_status()
|
||||
@@ -205,7 +201,7 @@
|
||||
return TRUE
|
||||
|
||||
|
||||
//There is no easy way for an object to be notified of changes to atmos can pass flags_1
|
||||
//There is no easy way for an object to be notified of changes to atmos can pass flags
|
||||
// So we check every machinery process (2 seconds)
|
||||
/obj/machinery/atmospherics/components/unary/vent_scrubber/process()
|
||||
if(widenet)
|
||||
|
||||
@@ -77,15 +77,12 @@
|
||||
if(!radio_connection)
|
||||
return
|
||||
|
||||
var/datum/signal/signal = new
|
||||
signal.source = src
|
||||
signal.transmission_method = 1
|
||||
signal.data = list(
|
||||
var/datum/signal/signal = new(list(
|
||||
"id_tag" = id_tag,
|
||||
"device" = "AM",
|
||||
"pressure" = round(env_pressure),
|
||||
"sigtype" = "status"
|
||||
)
|
||||
))
|
||||
radio_connection.post_signal(src, signal)
|
||||
|
||||
/obj/machinery/meter/proc/status()
|
||||
|
||||
Reference in New Issue
Block a user