diff --git a/code/ZAS/FEA_gas_mixture.dm b/code/ZAS/FEA_gas_mixture.dm index 8b7ab992c9..273d7669f1 100644 --- a/code/ZAS/FEA_gas_mixture.dm +++ b/code/ZAS/FEA_gas_mixture.dm @@ -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() diff --git a/code/ZAS/ZAS_Turfs.dm b/code/ZAS/ZAS_Turfs.dm index 0070a19c5d..4cdc8217e8 100644 --- a/code/ZAS/ZAS_Turfs.dm +++ b/code/ZAS/ZAS_Turfs.dm @@ -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 diff --git a/code/modules/clothing/clothing.dm b/code/modules/clothing/clothing.dm index 92f18afcc1..0a9ecad292 100644 --- a/code/modules/clothing/clothing.dm +++ b/code/modules/clothing/clothing.dm @@ -1,6 +1,7 @@ /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) diff --git a/code/modules/clothing/masks/gasmask.dm b/code/modules/clothing/masks/gasmask.dm index f8d643d5e3..44bf751967 100644 --- a/code/modules/clothing/masks/gasmask.dm +++ b/code/modules/clothing/masks/gasmask.dm @@ -1,6 +1,6 @@ /obj/item/clothing/mask/gas name = "gas mask" - desc = "A face-covering mask that can be connected to an air supply." + desc = "A face-covering mask that can be connected to an air supply. Filters harmful gases from the air." icon_state = "gas_alt" flags = FPRINT | TABLEPASS | MASKCOVERSMOUTH | MASKCOVERSEYES | BLOCK_GAS_SMOKE_EFFECT | MASKINTERNALS flags_inv = HIDEEARS|HIDEEYES|HIDEFACE @@ -9,6 +9,7 @@ gas_transfer_coefficient = 0.01 permeability_coefficient = 0.01 siemens_coefficient = 0.9 + gas_filter_strength = 1 //Plague Dr suit can be found in clothing/suits/bio.dm /obj/item/clothing/mask/gas/plaguedoctor diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 35029f8ec8..d514a4f95b 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -97,7 +97,7 @@ handle_pain() - handle_medical_side_effects() +// handle_medical_side_effects() handle_stasis_bag() @@ -322,14 +322,7 @@ // Not enough air around, take a percentage of what's there to model this properly breath_moles = environment.total_moles()*BREATH_PERCENTAGE - breath = loc.remove_air(breath_moles) - - if(!is_lung_ruptured()) - if(!breath || breath.total_moles < BREATH_MOLES / 5 || breath.total_moles > BREATH_MOLES * 5) - if(prob(5)) - rupture_lung() - - // Handle chem smoke effect -- Doohl + // Handle filtering var/block = 0 if(wear_mask) if(wear_mask.flags & BLOCK_GAS_SMOKE_EFFECT) @@ -341,6 +334,16 @@ if(head.flags & BLOCK_GAS_SMOKE_EFFECT) block = 1 + if(!block && !wear_mask) + breath = loc.remove_air(breath_moles, 0) + else + breath = loc.remove_air(breath_moles, wear_mask.gas_filter_strength) //Filters out harmful gases + + if(!is_lung_ruptured()) + if(!breath || breath.total_moles < BREATH_MOLES / 5 || breath.total_moles > BREATH_MOLES * 5) + if(prob(5)) + rupture_lung() + if(!block) for(var/obj/effect/effect/chem_smoke/smoke in view(1, src)) diff --git a/code/modules/mob/living/carbon/monkey/life.dm b/code/modules/mob/living/carbon/monkey/life.dm index 675f2c76a5..84228208c9 100644 --- a/code/modules/mob/living/carbon/monkey/life.dm +++ b/code/modules/mob/living/carbon/monkey/life.dm @@ -225,7 +225,6 @@ breath = location_as_object.handle_internal_lifeform(src, BREATH_VOLUME) else if(istype(loc, /turf/)) var/breath_moles = environment.total_moles()*BREATH_PERCENTAGE - breath = loc.remove_air(breath_moles) // Handle chem smoke effect -- Doohl var/block = 0 @@ -233,6 +232,11 @@ if(istype(wear_mask, /obj/item/clothing/mask/gas)) block = 1 + if(!block) + breath = loc.remove_air(breath_moles, 0) + else + breath = loc.remove_air(breath_moles, wear_mask.gas_filter_strength) //Filters out harmful gases + if(!block) for(var/obj/effect/effect/chem_smoke/smoke in view(1, src)) diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 3442a7fba5..c978045198 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -262,6 +262,7 @@ blinded = 0 eye_blind = 0 eye_blurry = 0 + eye_stat = 0 ear_deaf = 0 ear_damage = 0 heal_overall_damage(1000, 1000)