mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
- Scrubbers in the area can be controlled by air alarms. Air alarm interface must be unlocked with an ID card (minimum access level - atmospheric technician), usable only by humans and AI. Panic syphon drains the air from affected room (simple syphoning does too, but much slower).
- Sleeper consoles inject soporific and track the amounts of rejuvination chemicals and sleep toxins in occupants bloodstream. - Flashlights can be used to check if mob is dead, blind or has certain superpower. Aim for the eyes. - Radiation collectors and collector controls can be moved. Secured\unsecured with a wrench. - Air sensors report nitrogen and carbon dioxide in air composition(if set to). - Air Control console in Toxins. - Additional DNA console in genetics - Enough equipment to build another singularity engine can be found in engineering secure storage. - Air scrubber, vent and air alarm added to library - Air alarm added to brig - Air scrubbers in Toxins turned on, set to filter toxins - Empty tanks, portable air pumps and similar can be filled with air in Aft Primary Hallway, just connect them to the port. Target pressure is set by Mixed Air Supply console in Atmospherics (defaults to 4000kPa). git-svn-id: http://tgstation13.googlecode.com/svn/trunk@262 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
@@ -7,27 +7,105 @@
|
||||
|
||||
level = 1
|
||||
|
||||
var/id_tag
|
||||
var/frequency = 1439
|
||||
var/datum/radio_frequency/radio_connection
|
||||
|
||||
var/on = 0
|
||||
var/scrubbing = 1 //0 = siphoning, 1 = scrubbing
|
||||
var/scrub_CO2 = 1
|
||||
var/scrub_Toxins = 0
|
||||
|
||||
var/volume_rate = 120
|
||||
var/panic = 0 //is this scrubber panicked?
|
||||
|
||||
update_icon()
|
||||
if(on&&node)
|
||||
if(on)//&&node)//seems to be broken
|
||||
if(scrubbing)
|
||||
icon_state = "[level == 1 && istype(loc, /turf/simulated) ? "h" : "" ]on"
|
||||
else
|
||||
icon_state = "[level == 1 && istype(loc, /turf/simulated) ? "h" : "" ]in"
|
||||
else
|
||||
icon_state = "[level == 1 && istype(loc, /turf/simulated) ? "h" : "" ]off"
|
||||
on = 0
|
||||
//on = 0
|
||||
|
||||
return
|
||||
|
||||
|
||||
proc
|
||||
set_frequency(new_frequency)
|
||||
radio_controller.remove_object(src, "[frequency]")
|
||||
frequency = new_frequency
|
||||
radio_connection = radio_controller.add_object(src, "[frequency]")
|
||||
|
||||
broadcast_status()
|
||||
if(!radio_connection)
|
||||
return 0
|
||||
|
||||
var/datum/signal/signal = new
|
||||
signal.transmission_method = 1 //radio signal
|
||||
signal.data["tag"] = id_tag
|
||||
signal.data["timestamp"] = air_master.current_cycle
|
||||
signal.data["on"] = on
|
||||
signal.data["scrubbing"] = scrubbing
|
||||
signal.data["panic"] = panic
|
||||
signal.data["filter_co2"] = scrub_CO2
|
||||
signal.data["filter_toxins"] = scrub_Toxins
|
||||
radio_connection.post_signal(src, signal)
|
||||
|
||||
return 1
|
||||
|
||||
//This is probably not a good place for this, since it messes with all scrubbers and alarms in area. Maybe it's better to move this to area code.
|
||||
//It has its issues. Just place additional air alarm closer to the scrubbers, or assign scrubbers manually
|
||||
find_air_alarm()
|
||||
if(src.id_tag) return //id_tag assigned
|
||||
var/area/A = get_area(loc)
|
||||
var/area/M = A.master //we want to search master area, not only L(number) one
|
||||
|
||||
var/uniq_id = md5(M.name)//hash works like a charm
|
||||
var/list/alarms = list()
|
||||
var/list/scrubbers = list()
|
||||
var/i = 0 //used in id_tag and scrubber name generation
|
||||
|
||||
if(M.related && M.related.len)//if has relatives
|
||||
for(var/area/Rel in M.related)//check all relatives
|
||||
if(Rel == M) continue //same parent area.
|
||||
if(Rel.contents && Rel.contents.len)
|
||||
for(var/obj/machinery/alarm/Al in Rel.contents)//find air alarms in area, append to list
|
||||
alarms += Al
|
||||
for(var/obj/machinery/atmospherics/unary/vent_scrubber/V in Rel.contents)//find scrubbers in area, append to list
|
||||
if(V.id_tag) continue//already connected to air alarm
|
||||
scrubbers += V
|
||||
|
||||
if(scrubbers.len&&alarms.len) //if scrubbers & alarms found in area
|
||||
for(var/obj/machinery/atmospherics/unary/vent_scrubber/Sc in scrubbers)//iterate over found scrubbers
|
||||
var/dist = 127 //max value returned by get_dist
|
||||
var/obj/machinery/alarm/target_alarm = null
|
||||
for(var/obj/machinery/alarm/Al in alarms)//iterate over found alarms
|
||||
var/temp_dist = get_dist(Sc.loc, Al.loc)//if distance between current scrubber and current alarm < previous distance, set this alarm as target to connect to
|
||||
if(temp_dist<dist)
|
||||
target_alarm = Al
|
||||
dist = temp_dist
|
||||
if(target_alarm) //if target(closest) air alarm found,
|
||||
Sc.id_tag = "[uniq_id]_[i++]" //set scrubber id_tag
|
||||
Sc.frequency = target_alarm.frequency //set scrubber frequency (alarm frequency)
|
||||
var/d_name = "[M.name] Air Scrubber #[i]" //displayed name
|
||||
target_alarm.sensors[Sc.id_tag] = d_name //append scrubber to alarm 'sensor' list
|
||||
Sc.name = d_name //set scrubber name
|
||||
//debug
|
||||
//world << "[Sc.name] in [M.name] is set to frequency [Sc.frequency] with ID [Sc.id_tag]"
|
||||
//debug
|
||||
|
||||
initialize()
|
||||
find_air_alarm()
|
||||
set_frequency(frequency)
|
||||
update_icon()
|
||||
|
||||
|
||||
process()
|
||||
..()
|
||||
broadcast_status()
|
||||
|
||||
if(!on)
|
||||
return 0
|
||||
|
||||
@@ -75,7 +153,7 @@
|
||||
network.update = 1
|
||||
|
||||
return 1
|
||||
|
||||
/* //unused piece of code
|
||||
hide(var/i) //to make the little pipe section invisible, the icon changes.
|
||||
if(on&&node)
|
||||
if(scrubbing)
|
||||
@@ -85,4 +163,33 @@
|
||||
else
|
||||
icon_state = "[i == 1 && istype(loc, /turf/simulated) ? "h" : "" ]off"
|
||||
on = 0
|
||||
return
|
||||
return
|
||||
*/
|
||||
|
||||
receive_signal(datum/signal/signal)
|
||||
if(signal.data["tag"] && (signal.data["tag"] != id_tag))
|
||||
return ..()
|
||||
|
||||
switch(signal.data["command"])
|
||||
if("toggle_power")
|
||||
on = !on
|
||||
if("toggle_scrubbing")
|
||||
scrubbing = !scrubbing
|
||||
if("toggle_co2_scrub")
|
||||
scrub_CO2 = !scrub_CO2
|
||||
if("toggle_tox_scrub")
|
||||
scrub_Toxins = !scrub_Toxins
|
||||
if("toggle_panic_siphon")
|
||||
panic = !panic
|
||||
if(panic)
|
||||
on = 1
|
||||
scrubbing = 0
|
||||
volume_rate = 500
|
||||
else
|
||||
scrubbing = 1
|
||||
volume_rate = 120
|
||||
|
||||
if(signal.data["tag"])
|
||||
spawn(2) broadcast_status()
|
||||
update_icon()
|
||||
return ..()
|
||||
|
||||
Reference in New Issue
Block a user