Allow planets to have fuel-based atmospheres

This commit is contained in:
Putnam3145
2022-04-25 20:27:01 -07:00
parent 26683acdbb
commit 621b974691
4 changed files with 57 additions and 7 deletions
+1
View File
@@ -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
+37 -5
View File
@@ -13,7 +13,7 @@
)
restricted_gases = list(
GAS_BZ=0.1,
GAS_METHYL_BROMIDE=0.1,
GAS_BROMINE=0.1
)
restricted_chance = 30
@@ -23,6 +23,23 @@
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)
@@ -33,16 +50,16 @@
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 +69,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 ..()
@@ -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
+4 -2
View File
@@ -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 ? "<span class='notice'>" : "<span class='warning'>"]Coolant level passed threshold - now [round(owner.blood_volume / BLOOD_VOLUME_NORMAL * 100, 0.1)] percent.</span>")
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())