Moved gas_filter_strength out of clothing and into gas masks.

This commit is contained in:
Erthilo
2013-09-02 17:38:42 +01:00
parent 37acbe9bf7
commit afcfed02bd
4 changed files with 15 additions and 9 deletions

View File

@@ -1,7 +1,6 @@
/obj/item/clothing
name = "clothing"
var/list/species_restricted = null //Only these species can wear this kit.
var/gas_filter_strength = 0 //For gas mask filters
//BS12: Species-restricted clothing check.
/obj/item/clothing/mob_can_equip(M as mob, slot)

View File

@@ -9,7 +9,7 @@
gas_transfer_coefficient = 0.01
permeability_coefficient = 0.01
siemens_coefficient = 0.9
gas_filter_strength = 1
var/gas_filter_strength = 1 //For gas mask filters
//Plague Dr suit can be found in clothing/suits/bio.dm
/obj/item/clothing/mask/gas/plaguedoctor

View File

@@ -334,10 +334,14 @@
if(head.flags & BLOCK_GAS_SMOKE_EFFECT)
block = 1
if(!block && !wear_mask)
breath = loc.remove_air(breath_moles, 0)
if(block && wear_mask)
if(istype(wear_mask, /obj/item/clothing/mask/gas))
var/obj/item/clothing/mask/gas/G = wear_mask
breath = loc.remove_air(breath_moles, G.gas_filter_strength) //Filters out harmful gases
else
breath = loc.remove_air(breath_moles, 0)
else
breath = loc.remove_air(breath_moles, wear_mask.gas_filter_strength) //Filters out harmful gases
breath = loc.remove_air(breath_moles, 0)
if(!is_lung_ruptured())
if(!breath || breath.total_moles < BREATH_MOLES / 5 || breath.total_moles > BREATH_MOLES * 5)

View File

@@ -232,13 +232,16 @@
if(istype(wear_mask, /obj/item/clothing/mask/gas))
block = 1
if(!block)
breath = loc.remove_air(breath_moles, 0)
if(block && wear_mask)
if(istype(wear_mask, /obj/item/clothing/mask/gas))
var/obj/item/clothing/mask/gas/G = wear_mask
breath = loc.remove_air(breath_moles, G.gas_filter_strength) //Filters out harmful gases
else
breath = loc.remove_air(breath_moles, 0)
else
breath = loc.remove_air(breath_moles, wear_mask.gas_filter_strength) //Filters out harmful gases
breath = loc.remove_air(breath_moles, 0)
if(!block)
for(var/obj/effect/effect/chem_smoke/smoke in view(1, src))
if(smoke.reagents.total_volume)
smoke.reagents.reaction(src, INGEST)