Adds Hydrogen - The Framework for more Atmos Gases (#30742)

* IMPORTANT MILESTONE, AIR IS BREATHABLE

* the vibrations of the SM in my headphones are pleasing (no stupid hotspots)

* sanity check, it all works

* SM is fine

* this will work first try

* linter

* "thank you, warriorstar" everyone says in unison

* Build Rust library

* finishing touches (hopefully)

* Build Rust library

* update gas_mixture.dm to include hydrogen burning

* Build Rust library

* hydrogen should be the right color on gas analyzers

* i JUST rebuilt it

* adds agent B and Hydrogen floors

* update the h2 canister

* caniser bad speling

* in aa we trust

* Build Rust library

* Build Rust library

---------

Co-authored-by: paradisess13[bot] <165046124+paradisess13[bot]@users.noreply.github.com>
This commit is contained in:
Hayden Redacted
2025-11-03 21:05:26 +00:00
committed by GitHub
co-authored by paradisess13[bot] <165046124+paradisess13[bot]@users.noreply.github.com>
parent 096cbdd9a1
commit 99d57fd35d
42 changed files with 458 additions and 58 deletions
@@ -15,9 +15,11 @@
#define OXYGEN_HEAT_PENALTY 1
#define CO2_HEAT_PENALTY 0.1
#define NITROGEN_HEAT_PENALTY -1.5
#define HYDROGEN_HEAT_PENALTY 20
#define OXYGEN_TRANSMIT_MODIFIER 1.5 //Higher == Bigger bonus to power generation.
#define PLASMA_TRANSMIT_MODIFIER 4
#define HYDROGEN_TRANSMIT_MODIFIER 3
#define N2O_HEAT_RESISTANCE 6 //Higher == Gas makes the crystal more resistant against heat damage.
@@ -30,6 +32,7 @@
#define N2_CRUNCH 0.55
#define N2O_CRUNCH 0.55
#define PLASMA_CRUNCH 4
#define HYDROGEN_CRUNCH 2
#define MOLE_CRUNCH_THRESHOLD 1700 //Above this value we can get lord singulo and
#define MOLE_PENALTY_THRESHOLD 1800 //Above this value we can get lord singulo and independent mol damage, below it we can heal damage
@@ -152,6 +155,7 @@
var/o2comp = 0
var/co2comp = 0
var/n2ocomp = 0
var/h2comp = 0
///The last air sample's total molar count, will always be above or equal to 0
var/combined_gas = 0
@@ -517,10 +521,11 @@
co2comp = max(removed.carbon_dioxide() / combined_gas, 0)
n2ocomp = max(removed.sleeping_agent() / combined_gas, 0)
n2comp = max(removed.nitrogen() / combined_gas, 0)
h2comp = max(removed.hydrogen() / combined_gas, 0)
gasmix_power_ratio = min(max(plasmacomp + o2comp + co2comp - n2comp, 0), 1)
gasmix_power_ratio = min(max(plasmacomp + o2comp + co2comp + h2comp - n2comp, 0), 1)
dynamic_heat_modifier = max((plasmacomp * PLASMA_HEAT_PENALTY) + (o2comp * OXYGEN_HEAT_PENALTY) + (co2comp * CO2_HEAT_PENALTY) + (n2comp * NITROGEN_HEAT_PENALTY), 0.5)
dynamic_heat_modifier = max((plasmacomp * PLASMA_HEAT_PENALTY) + (o2comp * OXYGEN_HEAT_PENALTY) + (co2comp * CO2_HEAT_PENALTY) + (n2comp * NITROGEN_HEAT_PENALTY) + (h2comp * HYDROGEN_HEAT_PENALTY), 0.5)
dynamic_heat_resistance = max(n2ocomp * N2O_HEAT_RESISTANCE, 1)
power_transmission_bonus = max((plasmacomp * PLASMA_TRANSMIT_MODIFIER) + (o2comp * OXYGEN_TRANSMIT_MODIFIER), 0)
@@ -563,7 +568,7 @@
var/crush_ratio = combined_gas / MOLE_CRUNCH_THRESHOLD
gas_coefficient = 1 + (crush_ratio ** 2 * (crush_ratio <= 1) + (crush_ratio > 1) * 2 * crush_ratio / (crush_ratio + 1)) * (plasmacomp * PLASMA_CRUNCH + o2comp * O2_CRUNCH + co2comp * CO2_CRUNCH + n2comp * N2_CRUNCH + n2ocomp * N2O_CRUNCH)
gas_coefficient = 1 + (crush_ratio ** 2 * (crush_ratio <= 1) + (crush_ratio > 1) * 2 * crush_ratio / (crush_ratio + 1)) * (plasmacomp * PLASMA_CRUNCH + o2comp * O2_CRUNCH + co2comp * CO2_CRUNCH + n2comp * N2_CRUNCH + n2ocomp * N2O_CRUNCH + h2comp * HYDROGEN_CRUNCH)
radiation_pulse(src, 6 * power * (gas_coefficient + max(0, ((power_transmission_bonus / 10)))), GAMMA_RAD)
@@ -1276,8 +1281,10 @@
#undef OXYGEN_HEAT_PENALTY
#undef CO2_HEAT_PENALTY
#undef NITROGEN_HEAT_PENALTY
#undef HYDROGEN_HEAT_PENALTY
#undef OXYGEN_TRANSMIT_MODIFIER
#undef PLASMA_TRANSMIT_MODIFIER
#undef HYDROGEN_TRANSMIT_MODIFIER
#undef N2O_HEAT_RESISTANCE
#undef POWERLOSS_INHIBITION_GAS_THRESHOLD
#undef POWERLOSS_INHIBITION_MOLE_THRESHOLD
@@ -1320,3 +1327,4 @@
#undef N2_CRUNCH
#undef N2O_CRUNCH
#undef PLASMA_CRUNCH
#undef HYDROGEN_CRUNCH
@@ -111,6 +111,15 @@
/datum/engi_event/supermatter_event/charlie_tier/heat_penalty_threshold/on_start()
supermatter.heat_penalty_threshold -= 173
// hydrogen
/datum/engi_event/supermatter_event/charlie_tier/hydrogen
name = "C-4"
/datum/engi_event/supermatter_event/charlie_tier/hydrogen/on_start()
var/datum/gas_mixture/air = new()
air.set_hydrogen(2000)
supermatter_turf.blind_release_air(air)
//Class B events
/datum/engi_event/supermatter_event/bravo_tier
threat_level = SM_EVENT_THREAT_B