From 7bfd296b7018d786b348d92f70d8c52f8ca0f7fa Mon Sep 17 00:00:00 2001 From: hunterluthi Date: Sun, 19 Dec 2010 01:35:27 +0000 Subject: [PATCH] Fixing some issues where the atmos sensor was too sensitive. Only change is with CO2 at this point, may or may not adjust that in the future. Resolved what appears to be an old bug with the CO2 detection system causing alerts for CO2 at 0.05kPa and 0.1kPa when the minimum value to cause harm is 10kPa. Updated values to 5 and 10 kPa for minor/severe alerts respectively. Also introduced detection for "unknown gases", which basically consists of N2O. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@665 316c924e-a436-60f5-8080-3fe189b3f50e --- code/game/machinery/alarm.dm | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/code/game/machinery/alarm.dm b/code/game/machinery/alarm.dm index b892933186d..bc3fe3929cb 100644 --- a/code/game/machinery/alarm.dm +++ b/code/game/machinery/alarm.dm @@ -111,8 +111,8 @@ output += {"Carbon: "} percent = round(environment.carbon_dioxide / total * 100, 2) //CO2 Levels Sensor - if(environment.carbon_dioxide > 0.05) - if(environment.carbon_dioxide > 0.1) + if(environment.carbon_dioxide > 5) + if(environment.carbon_dioxide > 10) output += {"[percent]%
"} safe = 0 else @@ -132,6 +132,18 @@ if(safe != 0) safe = 1 else output += {"[percent]%
"} + //Trace Gas Sensor + if(safe && environment.trace_gases.len) + for(var/datum/gas/sleeping_agent/SA in environment.trace_gases) + var/SA_pp = (SA.moles/environment.total_moles())*environment_pressure + if(SA_pp > 0.01) + if(SA_pp > 1) + output += {"High Concentration of Unknown Particles Detected
"} + safe = 0 + else + output += {"Low Concentration of Unknown Particles Detected
"} + safe = 1 + output += {"Temperature: "} //Temperature Levels Sensor if((environment.temperature < (T20C-10)) || (environment.temperature > (T20C+10))) @@ -338,9 +350,9 @@ safe = 0 else safe = 1 - if(safe && (environment.carbon_dioxide > 0.05)) + if(safe && (environment.carbon_dioxide > 5)) //CO2 Levels Sensor - if(environment.carbon_dioxide > 0.1) + if(environment.carbon_dioxide > 10) safe = 0 else safe = 1 @@ -350,6 +362,14 @@ safe = 0 else safe = 1 + if(safe && environment.trace_gases.len) + for(var/datum/gas/sleeping_agent/SA in environment.trace_gases) + var/SA_pp = (SA.moles/environment.total_moles())*environment_pressure + if(SA_pp > 0.01) + if(SA_pp > 1) + safe = 0 + else safe = 1 + src.icon_state = "alarm[!safe]" if(safe == 2) src.skipprocess = 1