mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 18:32:03 +00:00
- Added vent control to air alarms
- Added air filter pressure control and made N2O filtering a separate option - Fixed gas sensor division by zero bug - Some atmos changes - Disease gib-loop debugging - Moved alarms, scrubbers and vents initialization to more suitable place git-svn-id: http://tgstation13.googlecode.com/svn/trunk@352 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
@@ -7,6 +7,7 @@ obj/machinery/atmospherics/filter
|
||||
|
||||
dir = SOUTH
|
||||
initialize_directions = SOUTH|NORTH|WEST
|
||||
req_access = list(access_atmospherics)
|
||||
|
||||
var/on = 0
|
||||
var/temp = null // -- TLE
|
||||
@@ -116,9 +117,6 @@ Filter types:
|
||||
filtered_out.toxins = removed.toxins
|
||||
removed.toxins = 0
|
||||
|
||||
filtered_out.carbon_dioxide = removed.carbon_dioxide
|
||||
removed.carbon_dioxide = 0
|
||||
|
||||
if(removed.trace_gases.len>0)
|
||||
for(var/datum/gas/trace_gas in removed.trace_gases)
|
||||
if(istype(trace_gas, /datum/gas/oxygen_agent_b))
|
||||
@@ -133,15 +131,19 @@ Filter types:
|
||||
filtered_out.nitrogen = removed.nitrogen
|
||||
removed.nitrogen = 0
|
||||
|
||||
if(3) //removing CO2
|
||||
filtered_out.carbon_dioxide = removed.carbon_dioxide
|
||||
removed.carbon_dioxide = 0
|
||||
|
||||
if(4)//removing N2O
|
||||
if(removed.trace_gases.len>0)
|
||||
for(var/datum/gas/trace_gas in removed.trace_gases)
|
||||
if(istype(trace_gas, /datum/gas/sleeping_agent))
|
||||
removed.trace_gases -= trace_gas
|
||||
filtered_out.trace_gases += trace_gas
|
||||
|
||||
if(3) //removing CO2
|
||||
filtered_out.carbon_dioxide = removed.carbon_dioxide
|
||||
removed.carbon_dioxide = 0
|
||||
else
|
||||
filtered_out = null
|
||||
|
||||
|
||||
air_out1.merge(filtered_out)
|
||||
@@ -298,10 +300,12 @@ Filter types:
|
||||
|
||||
|
||||
obj/machinery/atmospherics/filter/attack_hand(user as mob) // -- TLE
|
||||
var/dat
|
||||
if(..())
|
||||
return
|
||||
if (1 == 1)
|
||||
|
||||
if(!src.allowed(user))
|
||||
user << "\red Access denied."
|
||||
return
|
||||
/*
|
||||
dat += "Autolathe Wires:<BR>"
|
||||
var/wire
|
||||
@@ -312,6 +316,7 @@ obj/machinery/atmospherics/filter/attack_hand(user as mob) // -- TLE
|
||||
dat += text("The green light is [src.shocked ? "off" : "on"].<BR>")
|
||||
dat += text("The blue light is [src.hacked ? "off" : "on"].<BR>")
|
||||
*/
|
||||
var/dat
|
||||
var/current_filter_type
|
||||
switch(filter_type)
|
||||
if(0)
|
||||
@@ -322,24 +327,38 @@ obj/machinery/atmospherics/filter/attack_hand(user as mob) // -- TLE
|
||||
current_filter_type = "Nitrogen"
|
||||
if(3)
|
||||
current_filter_type = "Carbon Dioxide"
|
||||
if(4)
|
||||
current_filter_type = "Nitrous Oxide"
|
||||
if(-1)
|
||||
current_filter_type = "Nothing"
|
||||
else
|
||||
current_filter_type = "ERROR - Report this bug to the admin, please!"
|
||||
|
||||
dat += "<b>Filtering: </b>[current_filter_type]<br><br>"
|
||||
dat += "<h3>Set Filter Type:</h3><BR>"
|
||||
dat += "<A href='?src=\ref[src];filterset=0'>Carbon Molecules</A><BR>"
|
||||
dat += "<A href='?src=\ref[src];filterset=1'>Oxygen</A><BR>"
|
||||
dat += "<A href='?src=\ref[src];filterset=2'>Nitrogen</A><BR>"
|
||||
dat += "<A href='?src=\ref[src];filterset=3'>Carbon Dioxide</A><BR>"
|
||||
|
||||
user << browse("<HEAD><TITLE>Atmospherics Filter</TITLE></HEAD>[dat]","window=atmo_filter")
|
||||
dat += {"<b>Filtering: </b>[current_filter_type]<br><HR>
|
||||
<h4>Set Filter Type:</h4>
|
||||
<A href='?src=\ref[src];filterset=0'>Carbon Molecules</A><BR>
|
||||
<A href='?src=\ref[src];filterset=1'>Oxygen</A><BR>
|
||||
<A href='?src=\ref[src];filterset=2'>Nitrogen</A><BR>
|
||||
<A href='?src=\ref[src];filterset=3'>Carbon Dioxide</A><BR>
|
||||
<A href='?src=\ref[src];filterset=4'>Nitrous Oxide</A><BR>
|
||||
<A href='?src=\ref[src];filterset=-1'>Nothing</A><BR>
|
||||
<HR><B>Desirible output pressure:</B>
|
||||
<a href='?src=\ref[src];out_press=-10'><b>-</b></a>
|
||||
<a href='?src=\ref[src];out_press=-1'>-</a>
|
||||
[src.target_pressure]
|
||||
<a href='?src=\ref[src];out_press=1'>+</a>
|
||||
<a href='?src=\ref[src];out_press=10'><b>+</b></a>"}
|
||||
/*
|
||||
user << browse("<HEAD><TITLE>[src.name] control</TITLE></HEAD>[dat]","window=atmo_filter")
|
||||
onclose(user, "atmo_filter")
|
||||
return
|
||||
|
||||
if (src.temp)
|
||||
dat = text("<TT>[]</TT><BR><BR><A href='?src=\ref[];temp=1'>Clear Screen</A>", src.temp, src)
|
||||
//else
|
||||
// src.on != src.on
|
||||
user << browse("<HEAD><TITLE>Autolathe Control Panel</TITLE></HEAD><TT>[dat]</TT>", "window=atmo_filter")
|
||||
*/
|
||||
user << browse("<HEAD><TITLE>[src.name] control</TITLE></HEAD><TT>[dat]</TT>", "window=atmo_filter")
|
||||
onclose(user, "atmo_filter")
|
||||
return
|
||||
|
||||
@@ -349,16 +368,11 @@ obj/machinery/atmospherics/filter/Topic(href, href_list) // -- TLE
|
||||
usr.machine = src
|
||||
src.add_fingerprint(usr)
|
||||
if(href_list["filterset"])
|
||||
if(href_list["filterset"] == "0")
|
||||
src.filter_type = 0
|
||||
if(href_list["filterset"] == "1")
|
||||
src.filter_type = 1
|
||||
if(href_list["filterset"] == "2")
|
||||
src.filter_type = 2
|
||||
if(href_list["filterset"] == "3")
|
||||
src.filter_type = 3
|
||||
src.filter_type = text2num(href_list["filterset"])
|
||||
if (href_list["temp"])
|
||||
src.temp = null
|
||||
if(href_list["out_press"])
|
||||
src.target_pressure = max(0, min(4000, src.target_pressure + text2num(href_list["out_press"])))
|
||||
|
||||
for(var/mob/M in viewers(1, src))
|
||||
if ((M.client && M.machine == src))
|
||||
|
||||
@@ -42,6 +42,8 @@
|
||||
|
||||
process()
|
||||
..()
|
||||
broadcast_status()
|
||||
|
||||
if(!on)
|
||||
return 0
|
||||
if(welded)
|
||||
@@ -143,6 +145,10 @@
|
||||
if("power_toggle")
|
||||
on = !on
|
||||
|
||||
if("toggle_checks")
|
||||
pressure_checks = (pressure_checks?0:3)
|
||||
|
||||
|
||||
if("set_direction")
|
||||
var/number = text2num(signal.data["parameter"])
|
||||
if(number > 0.5)
|
||||
@@ -175,7 +181,10 @@
|
||||
external_pressure_bound = number
|
||||
|
||||
if(signal.data["tag"])
|
||||
spawn(5) broadcast_status()
|
||||
spawn(2)
|
||||
broadcast_status()
|
||||
update_icon()
|
||||
return
|
||||
|
||||
hide(var/i) //to make the little pipe section invisible, the icon changes.
|
||||
if(on&&node)
|
||||
|
||||
@@ -45,6 +45,7 @@
|
||||
var/datum/signal/signal = new
|
||||
signal.transmission_method = 1 //radio signal
|
||||
signal.data["tag"] = id_tag
|
||||
signal.data["device"] = "AScr"
|
||||
signal.data["timestamp"] = air_master.current_cycle
|
||||
signal.data["on"] = on
|
||||
signal.data["scrubbing"] = scrubbing
|
||||
@@ -55,59 +56,14 @@
|
||||
|
||||
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()
|
||||
..()
|
||||
if(!(stat & (NOPOWER|BROKEN)))
|
||||
broadcast_status()
|
||||
else
|
||||
return 0
|
||||
|
||||
if(!on)
|
||||
return 0
|
||||
@@ -191,8 +147,8 @@
|
||||
else
|
||||
scrubbing = 1
|
||||
volume_rate = 120
|
||||
|
||||
if(signal.data["tag"])
|
||||
spawn(2) broadcast_status()
|
||||
spawn(2)
|
||||
broadcast_status()
|
||||
update_icon()
|
||||
return ..()
|
||||
return
|
||||
|
||||
@@ -28,6 +28,7 @@ obj/machinery/atmospherics/valve
|
||||
initialize_directions = NORTH|SOUTH
|
||||
if(EAST || WEST)
|
||||
initialize_directions = EAST|WEST
|
||||
..()
|
||||
|
||||
network_expand(datum/pipe_network/new_network, obj/machinery/atmospherics/pipe/reference)
|
||||
|
||||
@@ -213,6 +214,12 @@ obj/machinery/atmospherics/valve
|
||||
attack_ai(mob/user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
attack_hand(mob/user as mob)
|
||||
if(!src.allowed(user))
|
||||
user << "\red Access denied."
|
||||
return
|
||||
..()
|
||||
|
||||
//Radio remote control
|
||||
|
||||
proc
|
||||
|
||||
82
code/ATMOSPHERICS/init_S_V_A.dm
Normal file
82
code/ATMOSPHERICS/init_S_V_A.dm
Normal file
@@ -0,0 +1,82 @@
|
||||
datum/controller/game_controller
|
||||
proc/find_air_alarms()
|
||||
|
||||
for(var/area/A in world)
|
||||
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/list/vents = list()
|
||||
var/i = 0 //used in id_tag and 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/O in Rel.contents)
|
||||
switch(O.type)
|
||||
if(/obj/machinery/alarm)
|
||||
alarms += O
|
||||
if(/obj/machinery/atmospherics/unary/vent_scrubber)
|
||||
scrubbers += O
|
||||
if(/obj/machinery/atmospherics/unary/vent_pump)
|
||||
vents += O
|
||||
else continue
|
||||
/*
|
||||
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
|
||||
for(var/obj/machinery/atmospherics/unary/vent_pump/P in Rel.contents)
|
||||
if(P.id) continue
|
||||
vents += P
|
||||
*/
|
||||
|
||||
if(!alarms.len || (!scrubbers.len && !vents.len)) continue
|
||||
|
||||
i = 0
|
||||
if(scrubbers.len) //if scrubbers found in area
|
||||
for(var/obj/machinery/atmospherics/unary/vent_scrubber/Sc in scrubbers)//iterate over found scrubbers
|
||||
if(Sc.id_tag) continue
|
||||
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]_scr_[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 'sensors' list
|
||||
Sc.name = d_name //set scrubber name
|
||||
Sc.set_frequency(Sc.frequency)
|
||||
//debug
|
||||
//world << "[Sc.name] in [M.name] is set to frequency [Sc.frequency] with ID [Sc.id_tag]"
|
||||
//debug
|
||||
i = 0
|
||||
if(vents.len) //if vents found in area
|
||||
for(var/obj/machinery/atmospherics/unary/vent_pump/P in vents)//iterate over found vents
|
||||
if(P.id) continue
|
||||
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(P.loc, Al.loc)//if distance between current vent 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,
|
||||
P.id = "[uniq_id]_vpump_[i++]" //set vent id
|
||||
P.frequency = target_alarm.frequency //set vent frequency (alarm frequency)
|
||||
var/d_name = "[M.name] Vent Pump #[i]" //displayed name
|
||||
target_alarm.vents[P.id] = d_name //append vent to alarm 'vents' list
|
||||
P.name = d_name //set vent name
|
||||
P.set_frequency(P.frequency)
|
||||
//debug
|
||||
//world << "[Sc.name] in [M.name] is set to frequency [Sc.frequency] with ID [Sc.id_tag]"
|
||||
//debug
|
||||
|
||||
return
|
||||
@@ -20,7 +20,7 @@ to null does not delete the object itself. Thank you.
|
||||
var/cure = null
|
||||
var/cure_id = null// reagent.id or list containing them
|
||||
var/cure_chance = 8//chance for the cure to do its job
|
||||
var/spread = null
|
||||
var/spread = null //spread type description
|
||||
var/spread_type = AIRBORNE
|
||||
var/contagious_period = 0//the disease stage when it can be spread
|
||||
var/list/affected_species = list()
|
||||
@@ -58,7 +58,7 @@ to null does not delete the object itself. Thank you.
|
||||
return
|
||||
return
|
||||
|
||||
/datum/disease/proc/has_cure()
|
||||
/datum/disease/proc/has_cure()//check if affected_mob has required reagents.
|
||||
if(!cure_id) return 0
|
||||
var/result = 1
|
||||
if(istype(cure_id, /list))
|
||||
@@ -86,7 +86,7 @@ to null does not delete the object itself. Thank you.
|
||||
|
||||
if(src.virus) return
|
||||
|
||||
if(src.resistances.Find(virus.type))
|
||||
if(virus.type in src.resistances)
|
||||
if(prob(99.9)) return
|
||||
src.resistances.Remove(virus.type)//the resistance is futile
|
||||
|
||||
@@ -259,7 +259,7 @@ to null does not delete the object itself. Thank you.
|
||||
for(var/mob/living/carbon/M in oviewers(check_range, source))
|
||||
for(var/name in src.affected_species)
|
||||
var/mob_type = text2path("/mob/living/carbon/[lowertext(name)]")
|
||||
if(mob_type && istype(M, mob_type))
|
||||
if(mob_type && istype(M, mob_type))//check if mob can be infected
|
||||
M.contract_disease(src)
|
||||
break
|
||||
return
|
||||
@@ -273,8 +273,8 @@ to null does not delete the object itself. Thank you.
|
||||
src.stage_act()
|
||||
return
|
||||
|
||||
/datum/disease/proc/cure(var/resistance=1)
|
||||
if(resistance && src.affected_mob && !affected_mob.resistances.Find(src.type))
|
||||
/datum/disease/proc/cure(var/resistance=1)//if resistance = 0, the mob won't develop resistance to disease
|
||||
if(resistance && src.affected_mob && !(src.type in affected_mob.resistances))
|
||||
// world << "Setting res to [src]"
|
||||
var/type = "[src.type]"//copy the value, not create the reference to it, so when the object is deleted, the value remains.
|
||||
affected_mob.resistances += text2path(type)
|
||||
@@ -284,7 +284,7 @@ to null does not delete the object itself. Thank you.
|
||||
return
|
||||
|
||||
|
||||
/datum/disease/New()
|
||||
/datum/disease/New()//adding the object to global list. List is processed by master controller.
|
||||
active_diseases += src
|
||||
|
||||
/*
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
cure_chance = 20
|
||||
affected_species = list("Human", "Monkey")
|
||||
permeability_mod = 3//likely to infect
|
||||
var/gibbed = 0
|
||||
|
||||
/datum/disease/alien_embryo/stage_act()
|
||||
..()
|
||||
@@ -58,6 +59,7 @@
|
||||
affected_mob.toxloss += 10
|
||||
affected_mob.updatehealth()
|
||||
if(prob(40))
|
||||
ASSERT(gibbed == 0)
|
||||
var/list/candidates = list() // Picks a random ghost in the world to shove in the larva -- TLE
|
||||
for(var/mob/dead/observer/G in world)
|
||||
if(G.client)
|
||||
@@ -69,7 +71,9 @@
|
||||
else
|
||||
if(affected_mob.client)
|
||||
affected_mob.client.mob = new/mob/living/carbon/alien/larva(affected_mob.loc)
|
||||
src.cure(0)
|
||||
affected_mob.gib()
|
||||
gibbed = 1
|
||||
|
||||
/*
|
||||
if(affected_mob.client)
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
affected_species = list("Human")
|
||||
desc = "This disease, actually acute nanomachine infection, converts the victim into a cyborg."
|
||||
severity = "Major"
|
||||
var/gibbed = 0
|
||||
|
||||
/datum/disease/robotic_transformation/stage_act()
|
||||
..()
|
||||
@@ -53,6 +54,10 @@
|
||||
affected_mob.toxloss += 10
|
||||
affected_mob.updatehealth()
|
||||
if(prob(40)) //So everyone can feel like robot Seth Brundle
|
||||
ASSERT(src.gibbed == 0)
|
||||
var/turf/T = find_loc(affected_mob)
|
||||
gibs(T)
|
||||
src.cure(0)
|
||||
gibbed = 1
|
||||
affected_mob:Robotize()
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
cure = "None"
|
||||
agent = "Rip-LEY Alien Microbes"
|
||||
affected_species = list("Human")
|
||||
var/gibbed = 0
|
||||
|
||||
/datum/disease/xeno_transformation/stage_act()
|
||||
..()
|
||||
@@ -53,6 +54,10 @@
|
||||
affected_mob.toxloss += 10
|
||||
affected_mob.updatehealth()
|
||||
if(prob(40))
|
||||
ASSERT(gibbed == 0)
|
||||
var/turf/T = find_loc(affected_mob)
|
||||
gibs(T)
|
||||
src.cure(0)
|
||||
gibbed = 1
|
||||
affected_mob:Alienize()
|
||||
|
||||
|
||||
@@ -2,11 +2,14 @@
|
||||
|
||||
var/frequency = 1439
|
||||
var/list/sensors = list()
|
||||
var/list/vents = list()
|
||||
var/list/sensor_information = list()
|
||||
var/list/vent_information = list()
|
||||
var/datum/radio_frequency/radio_connection
|
||||
var/alarm_area //unused atm. Maybe do something if emmaged or hacked...Like change the area to security, syphon air out, ..., profit.
|
||||
var/locked = 1
|
||||
var/panic = 0 //is this alarm panicked?
|
||||
var/device = null
|
||||
|
||||
req_access = list(access_atmospherics)
|
||||
|
||||
@@ -30,9 +33,11 @@
|
||||
if(!signal || signal.encryption) return
|
||||
|
||||
var/id_tag = signal.data["tag"]
|
||||
if(!id_tag || !sensors.Find(id_tag)) return
|
||||
|
||||
if(!id_tag || (!sensors.Find(id_tag) && !vents.Find(id_tag))) return
|
||||
if(signal.data["device"] == "AScr")
|
||||
sensor_information[id_tag] = signal.data
|
||||
else if(signal.data["device"] == "AVP")
|
||||
vent_information[id_tag] = signal.data
|
||||
|
||||
proc
|
||||
set_frequency(new_frequency)
|
||||
@@ -40,34 +45,6 @@
|
||||
frequency = new_frequency
|
||||
radio_connection = radio_controller.add_object(src, "[frequency]")
|
||||
|
||||
/* //moved to vent_scrubber.dm
|
||||
|
||||
find_scrubbers()//finds vent_scrubbers in area, sets corresponding frequency, name and id_tags, fills sensor list with id_tags and names
|
||||
var/area/A = get_area(loc)
|
||||
var/area/M = A.master
|
||||
if(!alarm_area)
|
||||
alarm_area = M
|
||||
|
||||
//world << "\red Processing [M.name]"
|
||||
|
||||
var/uniq_id = md5(M.name)//hash works like a charm
|
||||
|
||||
if(M.related && M.related.len)//if has relatives
|
||||
var/i = 0
|
||||
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/atmospherics/unary/vent_scrubber/V in Rel.contents)
|
||||
if(V.id_tag)//id_tag assigned, probably already connected to alarm somewhere
|
||||
//world << "[V.id_tag] passed"
|
||||
continue
|
||||
V.id_tag = "[uniq_id]_[i++]"//unique ID of the scrubber
|
||||
V.frequency = frequency
|
||||
var/name = "[M.name] Air Scrubber #[i]" //displayed name
|
||||
sensors[V.id_tag] = name
|
||||
V.name = name
|
||||
//world << "[V.name] in [M.name] is set to [frequency] with ID [V.id_tag] and named [sensors[V.id_tag]]"
|
||||
*/
|
||||
|
||||
send_signal(var/target, var/command)//sends signal 'command' to 'target'. Returns 0 if no radio connection, 1 otherwise
|
||||
if(!radio_connection)
|
||||
@@ -81,12 +58,22 @@
|
||||
signal.data["command"] = command
|
||||
|
||||
radio_connection.post_signal(src, signal)
|
||||
//world << text("Signal [] Broadcasted to []", command, target)
|
||||
// world << text("Signal [] Broadcasted to []", command, target)
|
||||
|
||||
return 1
|
||||
|
||||
return_text()
|
||||
var/output = "<B>[alarm_zone] Air [name]</B><HR>"
|
||||
if(!src.device)
|
||||
output += {"<a href='?src=\ref[src];scrubbers_control=1'>Scrubbers Control</a><br>
|
||||
<a href='?src=\ref[src];vents_control=1'>Vents Control</a><br>
|
||||
<HR>
|
||||
"}
|
||||
|
||||
output += "<A href='?src=\ref[src];toggle_panic_siphon_global=1'><font color='red'><B>TOGGLE PANIC SYPHON IN AREA</B></font></A>"
|
||||
else
|
||||
var/sensor_data
|
||||
if(src.device == "Scrubbers")
|
||||
if(sensors.len)
|
||||
for(var/id_tag in sensors)
|
||||
var/long_name = sensors[id_tag]
|
||||
@@ -94,63 +81,88 @@
|
||||
var/sensor_part = "<B>[long_name]</B>:<BR>"
|
||||
|
||||
if(data)
|
||||
sensor_part += "<B>Operating:</B> <A href='?src=\ref[src];toggle_power=[id_tag]'>[data["on"]?"on":"off"]</A><BR>"
|
||||
sensor_part += "<B>Type:</B> <A href='?src=\ref[src];toggle_scrubbing=[id_tag]'>[data["scrubbing"]?"scrubbing":"syphoning"]</A><BR>"
|
||||
sensor_part += {"<B>Operating:</B> <A href='?src=\ref[src];scr_toggle_power=[id_tag]'>[(data["on"]?"on":"off")]</A><BR>
|
||||
<B>Type:</B> <A href='?src=\ref[src];scr_toggle_scrubbing=[id_tag]'>[(data["scrubbing"]?"scrubbing":"syphoning")]</A><BR>"}
|
||||
if(data["scrubbing"])
|
||||
sensor_part += "<B>Filtering:</B> Carbon Dioxide <A href='?src=\ref[src];toggle_co2_scrub=[id_tag]'>([data["filter_co2"]?"on":"off"])</A>; Toxins <A href='?src=\ref[src];toggle_tox_scrub=[id_tag]'>([data["filter_toxins"]?"on":"off"])</A><BR>"
|
||||
sensor_part += "<A href='?src=\ref[src];toggle_panic_siphon=[id_tag]'><font color='[data["panic"]?"blue'>Dea":"red'>A"]ctivate panic syphon</A></font><BR>"
|
||||
sensor_part += "<B>Filtering:</B> Carbon Dioxide <A href='?src=\ref[src];scr_toggle_co2_scrub=[id_tag]'>([(data["filter_co2"]?"on":"off")])</A>; Toxins <A href='?src=\ref[src];scr_toggle_tox_scrub=[id_tag]'>([data["filter_toxins"]?"on":"off"])</A><BR>"
|
||||
sensor_part += "<A href='?src=\ref[src];scr_toggle_panic_siphon=[id_tag]'><font color='[(data["panic"]?"blue'>Dea":"red'>A")]ctivate panic syphon</A></font><BR>"
|
||||
if(data["panic"])
|
||||
sensor_part += "<font color='red'><B>PANIC SYPHON ACTIVATED</B></font>"
|
||||
sensor_part += "<HR>"
|
||||
else
|
||||
sensor_part = "<FONT color='red'>[long_name] can not be found!</FONT><BR>"
|
||||
sensor_part = "<FONT color='red'>[long_name] can not be found!</FONT><BR><HR>"
|
||||
|
||||
sensor_data += sensor_part
|
||||
sensor_data += "<A href='?src=\ref[src];toggle_panic_siphon_global=1'><font color='red'><B>TOGGLE PANIC SYPHON IN AREA</B></font></A>"
|
||||
|
||||
else
|
||||
sensor_data = "No scrubbers connected."
|
||||
sensor_data = "No scrubbers connected.<BR>"
|
||||
|
||||
var/output = {"<B>[alarm_zone] Air [name]</B><HR>[sensor_data]"}
|
||||
else if(src.device == "Vents")
|
||||
if(vents.len)
|
||||
for(var/id_tag in vents)
|
||||
var/long_name = vents[id_tag]
|
||||
var/list/data = vent_information[id_tag]
|
||||
var/sensor_part = "<B>[long_name]</B>:<BR>"
|
||||
|
||||
if(data)
|
||||
sensor_part += {"<B>Operating:</B> <A href='?src=\ref[src];v_toggle_power=[id_tag]'>[data["power"]]</A><BR>
|
||||
<B>Pressure checks:</B> <A href='?src=\ref[src];v_toggle_checks=[id_tag]'>[data["checks"]?"on":"off"]</A><BR>
|
||||
<HR>"}
|
||||
else
|
||||
sensor_part = "<FONT color='red'>[long_name] can not be found!</FONT><HR>"
|
||||
|
||||
sensor_data += sensor_part
|
||||
else
|
||||
sensor_data = "No scrubbers connected.<BR>"
|
||||
|
||||
output = {"[sensor_data]<a href='?src=\ref[src];main=1'>Main menu</a><br>"}
|
||||
|
||||
return output
|
||||
|
||||
|
||||
|
||||
initialize()
|
||||
set_frequency(frequency)
|
||||
/*if(!(sensors.len))//if there's something in the list, do not search the area
|
||||
find_scrubbers()*/
|
||||
|
||||
|
||||
Topic(href, href_list)
|
||||
//if(..())
|
||||
// return
|
||||
if(href_list["scrubbers_control"])
|
||||
src.device = "Scrubbers"
|
||||
if(href_list["vents_control"])
|
||||
src.device = "Vents"
|
||||
if(href_list["main"])
|
||||
src.device = null
|
||||
if(href_list["scr_toggle_power"])
|
||||
send_signal(href_list["scr_toggle_power"], "toggle_power")
|
||||
|
||||
if(href_list["toggle_power"])
|
||||
send_signal(href_list["toggle_power"], "toggle_power")
|
||||
if(href_list["scr_toggle_scrubbing"])
|
||||
send_signal(href_list["scr_toggle_scrubbing"], "toggle_scrubbing")
|
||||
|
||||
if(href_list["toggle_scrubbing"])
|
||||
send_signal(href_list["toggle_scrubbing"], "toggle_scrubbing")
|
||||
if(href_list["scr_toggle_co2_scrub"])
|
||||
send_signal(href_list["scr_toggle_co2_scrub"], "toggle_co2_scrub")
|
||||
|
||||
if(href_list["toggle_co2_scrub"])
|
||||
send_signal(href_list["toggle_co2_scrub"], "toggle_co2_scrub")
|
||||
if(href_list["scr_toggle_tox_scrub"])
|
||||
send_signal(href_list["scr_toggle_tox_scrub"], "toggle_tox_scrub")
|
||||
|
||||
if(href_list["toggle_tox_scrub"])
|
||||
send_signal(href_list["toggle_tox_scrub"], "toggle_tox_scrub")
|
||||
if(href_list["scr_toggle_panic_siphon"])
|
||||
send_signal(href_list["scr_toggle_panic_siphon"], "toggle_panic_siphon")
|
||||
|
||||
if(href_list["toggle_panic_siphon"])
|
||||
send_signal(href_list["toggle_panic_siphon"], "toggle_panic_siphon")
|
||||
if(href_list["v_toggle_power"])
|
||||
send_signal(href_list["v_toggle_power"], "power_toggle")
|
||||
if(href_list["v_toggle_checks"])
|
||||
send_signal(href_list["v_toggle_checks"], "toggle_checks")
|
||||
|
||||
if(href_list["toggle_panic_siphon_global"])
|
||||
for(var/V in sensors)
|
||||
send_signal(V, "toggle_panic_siphon")
|
||||
for(var/P in vents)
|
||||
send_signal(P, "power_off")
|
||||
panic = !panic
|
||||
|
||||
|
||||
spawn(5)
|
||||
attack_hand(usr)
|
||||
return ..()
|
||||
// attack_hand(usr)
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/alarm/New()
|
||||
|
||||
@@ -41,6 +41,7 @@ obj/machinery/air_sensor
|
||||
|
||||
if(output>4)
|
||||
var/total_moles = air_sample.total_moles()
|
||||
if(total_moles > 0)
|
||||
if(output&4)
|
||||
signal.data["oxygen"] = round(100*air_sample.oxygen/total_moles,0.1)
|
||||
if(output&8)
|
||||
@@ -49,7 +50,11 @@ obj/machinery/air_sensor
|
||||
signal.data["nitrogen"] = round(100*air_sample.nitrogen/total_moles,0.1)
|
||||
if(output&32)
|
||||
signal.data["carbon_dioxide"] = round(100*air_sample.carbon_dioxide/total_moles,0.1)
|
||||
|
||||
else
|
||||
signal.data["oxygen"] = 0
|
||||
signal.data["toxins"] = 0
|
||||
signal.data["nitrogen"] = 0
|
||||
signal.data["carbon_dioxide"] = 0
|
||||
radio_connection.post_signal(src, signal)
|
||||
|
||||
|
||||
|
||||
@@ -44,6 +44,11 @@ datum/controller/game_controller
|
||||
for(var/obj/machinery/atmospherics/machine in world)
|
||||
machine.build_network()
|
||||
|
||||
world << "\red \b Initializing atmos machinery"
|
||||
sleep(-1)
|
||||
|
||||
find_air_alarms()
|
||||
|
||||
world << "\red \b Initializations complete."
|
||||
|
||||
|
||||
|
||||
@@ -533,41 +533,10 @@
|
||||
return 1
|
||||
|
||||
handle_virus_updates()
|
||||
if(src.bodytemperature > 406)
|
||||
if(src.bodytemperature > 406 && src.virus)
|
||||
src.virus.cure()
|
||||
return
|
||||
|
||||
if(!src.virus)
|
||||
if(prob(40))
|
||||
for(var/mob/living/carbon/M in oviewers(4, src))
|
||||
if(M.virus && M.virus.spread == "Airborne")
|
||||
if(M.virus.affected_species.Find("Alien"))
|
||||
if(src.resistances.Find(M.virus.type))
|
||||
continue
|
||||
var/datum/disease/D = new M.virus.type //Making sure strain_data is preserved
|
||||
D.strain_data = M.virus.strain_data
|
||||
src.contract_disease(D)
|
||||
|
||||
for(var/obj/decal/cleanable/blood/B in view(4, src))
|
||||
if(B.virus && B.virus.spread == "Airborne")
|
||||
if(B.virus.affected_species.Find("Alien"))
|
||||
if(src.resistances.Find(B.virus.type))
|
||||
continue
|
||||
var/datum/disease/D = new B.virus.type
|
||||
D.strain_data = B.virus.strain_data
|
||||
src.contract_disease(D)
|
||||
|
||||
for(var/obj/decal/cleanable/xenoblood/X in view(4, src))
|
||||
if(X.virus && X.virus.spread == "Airborne")
|
||||
if(X.virus.affected_species.Find("Alien"))
|
||||
if(src.resistances.Find(X.virus.type))
|
||||
continue
|
||||
var/datum/disease/D = new X.virus.type
|
||||
D.strain_data = X.virus.strain_data
|
||||
src.contract_disease(D)
|
||||
else
|
||||
src.virus.stage_act()
|
||||
|
||||
check_if_buckled()
|
||||
if (src.buckled)
|
||||
src.lying = (istype(src.buckled, /obj/stool/bed) ? 1 : 0)
|
||||
|
||||
@@ -454,38 +454,9 @@
|
||||
return
|
||||
|
||||
handle_virus_updates()
|
||||
if(src.bodytemperature > 406)
|
||||
src.resistances += src.virus
|
||||
del(src.virus)
|
||||
|
||||
if(!src.virus)
|
||||
if(prob(40))
|
||||
for(var/mob/living/carbon/M in oviewers(4, src))
|
||||
if(M.virus && M.virus.spread == "Airborne")
|
||||
if(M.virus.affected_species.Find("Alien"))
|
||||
if(src.resistances.Find(M.virus.type))
|
||||
continue
|
||||
var/datum/disease/D = new M.virus.type //Making sure strain_data is preserved
|
||||
D.strain_data = M.virus.strain_data
|
||||
src.contract_disease(D)
|
||||
for(var/obj/decal/cleanable/blood/B in view(4, src))
|
||||
if(B.virus && B.virus.spread == "Airborne")
|
||||
if(B.virus.affected_species.Find("Alien"))
|
||||
if(src.resistances.Find(B.virus.type))
|
||||
continue
|
||||
var/datum/disease/D = new B.virus.type
|
||||
D.strain_data = B.virus.strain_data
|
||||
src.contract_disease(D)
|
||||
for(var/obj/decal/cleanable/xenoblood/X in view(4, src))
|
||||
if(X.virus && X.virus.spread == "Airborne")
|
||||
if(X.virus.affected_species.Find("Alien"))
|
||||
if(src.resistances.Find(X.virus.type))
|
||||
continue
|
||||
var/datum/disease/D = new X.virus.type
|
||||
D.strain_data = X.virus.strain_data
|
||||
src.contract_disease(D)
|
||||
else
|
||||
src.virus.stage_act()
|
||||
if(src.bodytemperature > 406 && src.virus)
|
||||
src.virus.cure()
|
||||
return
|
||||
|
||||
check_if_buckled()
|
||||
if (src.buckled)
|
||||
|
||||
@@ -800,7 +800,7 @@
|
||||
return
|
||||
|
||||
handle_virus_updates()
|
||||
if(src.bodytemperature > 406)
|
||||
if(src.bodytemperature > 406 && src.virus)
|
||||
src.virus.cure()
|
||||
return
|
||||
|
||||
|
||||
@@ -553,7 +553,7 @@
|
||||
return
|
||||
|
||||
handle_virus_updates()
|
||||
if(src.bodytemperature > 406)
|
||||
if(src.bodytemperature > 406 && src.virus)
|
||||
src.virus.cure()
|
||||
return
|
||||
|
||||
|
||||
@@ -135,6 +135,7 @@
|
||||
#include "code\ATMOSPHERICS\atmospherics.dm"
|
||||
#include "code\ATMOSPHERICS\datum_pipe_network.dm"
|
||||
#include "code\ATMOSPHERICS\datum_pipeline.dm"
|
||||
#include "code\ATMOSPHERICS\init_S_V_A.dm"
|
||||
#include "code\ATMOSPHERICS\pipes.dm"
|
||||
#include "code\ATMOSPHERICS\components\filter.dm"
|
||||
#include "code\ATMOSPHERICS\components\mixer.dm"
|
||||
|
||||
12894
maps/trunkmap.dmm
12894
maps/trunkmap.dmm
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user