diff --git a/code/__DEFINES/mobs.dm b/code/__DEFINES/mobs.dm index 3ce91f4332..2cdb584e8a 100644 --- a/code/__DEFINES/mobs.dm +++ b/code/__DEFINES/mobs.dm @@ -347,6 +347,7 @@ // / Breathing types. Lungs can access either by these or by a string, which will be considered a gas ID. #define BREATH_OXY /datum/breathing_class/oxygen #define BREATH_PLASMA /datum/breathing_class/plasma +#define BREATH_METHANE /datum/breathing_class/methane //Gremlins #define NPC_TAMPER_ACT_FORGET 1 //Don't try to tamper with this again diff --git a/code/datums/atmosphere/planetary.dm b/code/datums/atmosphere/planetary.dm index 24125681d4..efa57b4e5f 100644 --- a/code/datums/atmosphere/planetary.dm +++ b/code/datums/atmosphere/planetary.dm @@ -13,7 +13,7 @@ ) restricted_gases = list( GAS_BZ=0.1, - GAS_METHYL_BROMIDE=0.1, + GAS_BROMINE=0.1 ) restricted_chance = 30 @@ -23,26 +23,44 @@ minimum_temp = 281 maximum_temp = 320 +/datum/atmosphere/lavaland/generate_gas_string() + if(prob(restricted_chance)) + base_gases = list( + GAS_METHANE=5, + GAS_N2=10 + ) + normal_gases = list( + GAS_METHANE=5, + GAS_N2=5, + ) + restricted_gases = list( + GAS_AMMONIA = 0.1, + GAS_METHYL_BROMIDE = 0.1, + GAS_HYDROGEN = 0.1 + ) + return ..() + /datum/atmosphere/lavaland/check_for_sanity(datum/gas_mixture/mix) - var/datum/breathing_class/o2_class = GLOB.gas_data.breathing_classes[BREATH_OXY] - while(o2_class.get_effective_pp(mix) < 10) - mix.adjust_moles(GAS_CO2, -0.5) - mix.adjust_moles(GAS_O2, 0.5) + if(mix.get_moles(GAS_METHANE) < 0.1) + var/datum/breathing_class/o2_class = GLOB.gas_data.breathing_classes[BREATH_OXY] + while(o2_class.get_effective_pp(mix) < 10) + mix.adjust_moles(GAS_CO2, -0.5) + mix.adjust_moles(GAS_O2, 0.5) /datum/atmosphere/icemoon id = ICEMOON_DEFAULT_ATMOS base_gases = list( - GAS_O2=5, + GAS_METHANE=5, GAS_N2=10, ) normal_gases = list( - GAS_O2=10, - GAS_N2=10, - GAS_CO2=10, + GAS_METHANE=5, + GAS_N2=10 ) restricted_gases = list( GAS_METHYL_BROMIDE=0.1, + GAS_HYDROGEN=0.1 ) restricted_chance = 10 @@ -52,3 +70,18 @@ minimum_temp = 180 maximum_temp = 180 +/datum/atmosphere/icemoon/generate_gas_string() + if(prob(restricted_chance)) + base_gases = list( + GAS_O2=5, + GAS_N2=10, + ) + normal_gases = list( + GAS_O2=5, + GAS_N2=10, + ) + restricted_gases = list( + GAS_BZ = 0.1, + GAS_METHYL_BROMIDE = 0.1, + ) + return ..() diff --git a/code/game/objects/effects/effect_system/effects_foam.dm b/code/game/objects/effects/effect_system/effects_foam.dm index 6af8a433aa..d9cfc09220 100644 --- a/code/game/objects/effects/effect_system/effects_foam.dm +++ b/code/game/objects/effects/effect_system/effects_foam.dm @@ -40,9 +40,16 @@ if(hotspot && istype(T) && T.air) qdel(hotspot) var/datum/gas_mixture/G = T.air - var/plas_amt = min(30,G.get_moles(GAS_PLASMA)) //Absorb some plasma - G.adjust_moles(GAS_PLASMA,-plas_amt) - absorbed_plasma += plas_amt + var/amt_removed = min(30,G.get_moles(GAS_PLASMA)) //Absorb some plasma + G.adjust_moles(GAS_PLASMA,-amt_removed) + absorbed_plasma += amt_removed + var/list/fire_gases = GLOB.gas_data.fire_temperatures.Copy() + for(var/gas in fire_gases - GAS_PLASMA) + if(amt_removed <= 0) + break + var/this_amount = min(30-amt_removed, G.get_moles(gas)) + G.adjust_moles(gas, -this_amount) + amt_removed -= this_amount if(G.return_temperature() > T20C) G.set_temperature(max(G.return_temperature()/2,T20C)) T.air_update_turf() diff --git a/code/modules/atmospherics/auxgm/breathing_classes.dm b/code/modules/atmospherics/auxgm/breathing_classes.dm index cfc82adbff..51a8e7bd40 100644 --- a/code/modules/atmospherics/auxgm/breathing_classes.dm +++ b/code/modules/atmospherics/auxgm/breathing_classes.dm @@ -41,3 +41,18 @@ low_alert_datum = /atom/movable/screen/alert/not_enough_tox high_alert_category = "too_much_tox" high_alert_datum = /atom/movable/screen/alert/too_much_tox + +/datum/breathing_class/methane + gases = list( + GAS_METHANE = 1, + GAS_METHYL_BROMIDE = -0.7, + GAS_OXYGEN = -0.1, + GAS_PLUOXIUM = -0.8 + ) + products = list( + GAS_METHYL_BROMIDE = 1 + ) + low_alert_category = "not_enough_ch4" + low_alert_datum = /atom/movable/screen/alert/not_enough_ch4 + high_alert_category = "too_much_ch4" + high_alert_datum = /atom/movable/screen/alert/too_much_ch4 diff --git a/code/modules/atmospherics/machinery/airalarm.dm b/code/modules/atmospherics/machinery/airalarm.dm index de0135519c..d6e48daff0 100644 --- a/code/modules/atmospherics/machinery/airalarm.dm +++ b/code/modules/atmospherics/machinery/airalarm.dm @@ -535,7 +535,7 @@ for(var/device_id in A.air_scrub_names) send_signal(device_id, list( "power" = 1, - "set_filters" = list(GAS_CO2, GAS_MIASMA, GAS_GROUP_CHEMICALS), + "set_filters" = list(GAS_CO2, GAS_METHANE, GAS_METHYL_BROMIDE, GAS_MIASMA, GAS_GROUP_CHEMICALS), "scrubbing" = 1, "widenet" = 0, )) diff --git a/code/modules/atmospherics/machinery/components/unary_devices/vent_scrubber.dm b/code/modules/atmospherics/machinery/components/unary_devices/vent_scrubber.dm index 098618bc65..025435929a 100644 --- a/code/modules/atmospherics/machinery/components/unary_devices/vent_scrubber.dm +++ b/code/modules/atmospherics/machinery/components/unary_devices/vent_scrubber.dm @@ -18,7 +18,7 @@ var/id_tag = null var/scrubbing = SCRUBBING //0 = siphoning, 1 = scrubbing - var/filter_types = list(GAS_CO2, GAS_MIASMA, GAS_GROUP_CHEMICALS) + var/filter_types = list(GAS_CO2, GAS_METHANE, GAS_METHYL_BROMIDE, GAS_MIASMA, GAS_GROUP_CHEMICALS) var/list/clean_filter_types = null var/volume_rate = 200 var/widenet = 0 //is this scrubber acting on the 3x3 area around it. diff --git a/code/modules/surgery/organs/lungs.dm b/code/modules/surgery/organs/lungs.dm index f6265969e7..aad33c4e92 100644 --- a/code/modules/surgery/organs/lungs.dm +++ b/code/modules/surgery/organs/lungs.dm @@ -440,7 +440,7 @@ owner.adjust_bodytemperature(30*TEMPERATURE_DAMAGE_COEFFICIENT) if(50 to INFINITY) owner.adjust_bodytemperature(100*TEMPERATURE_DAMAGE_COEFFICIENT) - + /obj/item/organ/lungs/ipc/ui_action_click(mob/user, actiontype) if(!owner) return @@ -494,7 +494,7 @@ if(owner.blood_volume <= next_warn) to_chat(owner, "[owner.blood_volume > BLOOD_VOLUME_BAD ? "" : ""]Coolant level passed threshold - now [round(owner.blood_volume / BLOOD_VOLUME_NORMAL * 100, 0.1)] percent.") next_warn -= (BLOOD_VOLUME_NORMAL * 0.1) - + /obj/item/organ/lungs/plasmaman name = "plasma filter" desc = "A spongy rib-shaped mass for filtering plasma from the air." @@ -574,6 +574,8 @@ // humans usually breathe 21 but require 16/17, so 80% - 1, which is more lenient but it's fine #define SAFE_THRESHOLD_RATIO 0.8 var/datum/gas_mixture/breath = SSair.planetary[LAVALAND_DEFAULT_ATMOS] // y'all know + if(breath.get_moles(GAS_METHANE) > 0.1) + breathing_class = BREATH_METHANE var/pressure = breath.return_pressure() var/total_moles = breath.total_moles() for(var/id in breath.get_gases())