Is now possible to create a sub-list of air alarms the atmos control console will list.

Will be used to allow scientists on the outpost to remotely control their isolation cell air alarms.
This commit is contained in:
PsiOmega
2014-08-24 12:35:47 +02:00
parent e21da52af9
commit b5ff2048ab
2 changed files with 34 additions and 12 deletions
+23 -2
View File
@@ -11,8 +11,17 @@
circuit = "/obj/item/weapon/circuitboard/atmoscontrol"
var/obj/machinery/alarm/current
var/overridden = 0 //not set yet, can't think of a good way to do it
req_access = list(access_atmospherics)
req_access = list(access_ce)
var/list/monitored_alarm_ids = null
var/list/monitored_alarms = null
/obj/machinery/computer/atmoscontrol/laptop
name = "Atmospherics Laptop"
desc = "Cheap Nanotrasen Laptop."
icon_state = "medlaptop"
/obj/machinery/computer/atmoscontrol/New()
..()
/obj/machinery/computer/atmoscontrol/attack_ai(var/mob/user as mob)
return interact(user)
@@ -25,17 +34,29 @@
return
return interact(user)
// Original implementation used "in typesof(/obj/machinery/alarm/)" in New()
// but would throw runtime errors when attempting to access alarm_id
obj/machinery/computer/atmoscontrol/proc/setup_monitor()
if(!monitored_alarms && monitored_alarm_ids)
monitored_alarms = new
for(var/obj/machinery/alarm/alarm in machines)
if(alarm.alarm_id && alarm.alarm_id in monitored_alarm_ids)
monitored_alarms += alarm
/obj/machinery/computer/atmoscontrol/interact(mob/user)
setup_monitor()
user.set_machine(src)
if(allowed(user))
overridden = 1
else if(!emagged)
overridden = 0
var/dat = "<a href='?src=\ref[src]&reset=1'>Main Menu</a><hr>"
if(monitored_alarms && monitored_alarms.len == 1)
current = monitored_alarms[1]
if(current)
dat += specific()
else
for(var/obj/machinery/alarm/alarm in dd_sortedObjectList(machines))
for(var/obj/machinery/alarm/alarm in dd_sortedObjectList(monitored_alarms ? monitored_alarms : machines))
dat += "<a href='?src=\ref[src]&alarm=\ref[alarm]'>"
switch(max(alarm.danger_level, alarm.alarm_area.atmosalm))
if (0)
+11 -10
View File
@@ -68,6 +68,7 @@
active_power_usage = 1000 //For heating/cooling rooms. 1000 joules equates to about 1 degree every 2 seconds for a single tile of air.
power_channel = ENVIRON
req_one_access = list(access_atmospherics, access_engine_equip)
var/alarm_id = null
var/breach_detection = 1 // Whether to use automatic breach detection or not
var/frequency = 1439
//var/skipprocess = 0 //Experimenting
@@ -216,7 +217,7 @@
regulating_temperature = 0
visible_message("\The [src] clicks quietly as it stops [environment.temperature > target_temperature ? "cooling" : "heating"] the room.",\
"You hear a click as a faint electronic humming stops.")
if (regulating_temperature)
if(target_temperature > T0C + MAX_TEMPERATURE)
target_temperature = T0C + MAX_TEMPERATURE
@@ -227,26 +228,26 @@
var/datum/gas_mixture/gas
gas = environment.remove(0.25*environment.total_moles)
if(gas)
if (gas.temperature <= target_temperature) //gas heating
var/energy_used = min( gas.get_thermal_energy_change(target_temperature) , active_power_usage)
gas.add_thermal_energy(energy_used)
//use_power(energy_used, ENVIRON) //handle by update_use_power instead
else //gas cooling
var/heat_transfer = min(abs(gas.get_thermal_energy_change(target_temperature)), active_power_usage)
//Assume the heat is being pumped into the hull which is fixed at 20 C
//none of this is really proper thermodynamics but whatever
var/cop = gas.temperature/T20C //coefficient of performance -> power used = heat_transfer/cop
heat_transfer = min(heat_transfer, cop * active_power_usage) //this ensures that we don't use more than active_power_usage amount of power
heat_transfer = -gas.add_thermal_energy(-heat_transfer) //get the actual heat transfer
//use_power(heat_transfer / cop, ENVIRON) //handle by update_use_power instead
environment.merge(gas)
/obj/machinery/alarm/proc/overall_danger_level(var/datum/gas_mixture/environment)
@@ -412,7 +413,7 @@
for (var/area/RA in alarm_area.related)
for (var/obj/machinery/alarm/AA in RA)
AA.mode = mode
switch(mode)
if(AALARM_MODE_SCRUBBING)
for(var/device_id in alarm_area.air_scrub_names)