Gas mask filters Plasma and N2O.

This commit is contained in:
Erthilo
2013-09-01 20:51:19 +01:00
parent 469cc55020
commit a4829a271e
7 changed files with 33 additions and 22 deletions
+4 -4
View File
@@ -367,7 +367,7 @@ What are the archived variables for?
//del(giver)
return 1
/datum/gas_mixture/proc/remove(amount)
/datum/gas_mixture/proc/remove(amount, var/filtered = 0)
//Purpose: Removes a certain number of moles from the air.
//Called by: ?
//Inputs: How many moles to remove.
@@ -384,7 +384,7 @@ What are the archived variables for?
removed.oxygen = QUANTIZE((oxygen/sum)*amount)
removed.nitrogen = QUANTIZE((nitrogen/sum)*amount)
removed.carbon_dioxide = QUANTIZE((carbon_dioxide/sum)*amount)
removed.toxins = QUANTIZE((toxins/sum)*amount)
removed.toxins = QUANTIZE(((toxins/sum)*amount)*(1-filtered))
oxygen -= removed.oxygen/group_multiplier
nitrogen -= removed.nitrogen/group_multiplier
@@ -396,8 +396,8 @@ What are the archived variables for?
var/datum/gas/corresponding = new trace_gas.type()
removed.trace_gases += corresponding
corresponding.moles = (trace_gas.moles/sum)*amount
trace_gas.moles -= corresponding.moles/group_multiplier
corresponding.moles = ((trace_gas.moles/sum)*amount)*(1-filtered)
trace_gas.moles -= (corresponding.moles/group_multiplier)*(1-filtered)
removed.temperature = temperature
update_values()
+8 -7
View File
@@ -20,21 +20,22 @@
return GM
/turf/remove_air(amount as num)
/turf/remove_air(amount as num, var/filtered = 0)
var/datum/gas_mixture/GM = new
var/sum = oxygen + carbon_dioxide + nitrogen + toxins
var/sum = oxygen + carbon_dioxide + nitrogen + (toxins*(1-filtered))
if(sum>0)
GM.oxygen = (oxygen/sum)*amount
GM.carbon_dioxide = (carbon_dioxide/sum)*amount
GM.nitrogen = (nitrogen/sum)*amount
GM.toxins = (toxins/sum)*amount
GM.toxins = ((toxins/sum)*amount)*(1-filtered)
GM.temperature = temperature
GM.update_values()
return GM
/turf/simulated/var/current_graphic = null
/turf/simulated/var/tmp/datum/gas_mixture/air
@@ -109,21 +110,21 @@
else
return ..()
/turf/simulated/remove_air(amount as num)
/turf/simulated/remove_air(amount as num, var/filtered = 0)
if(zone)
var/datum/gas_mixture/removed = null
removed = zone.air.remove(amount)
removed = zone.air.remove(amount, filtered)
return removed
else if(air)
var/datum/gas_mixture/removed = null
removed = air.remove(amount)
removed = air.remove(amount, filtered)
if(air.check_tile_graphic())
update_visuals(air)
return removed
else
return ..()
return ..(amount, filtered)
/turf/simulated/proc/update_air_properties()
var/air_directions_archived = air_check_directions