Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 9 additions & 10 deletions code/modules/atmospherics/gasmixtures/reactions.dm
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,7 @@ nobliumformation = 1001

/datum/gas_reaction/metalhydrogen/init_reqs()
min_requirements = list(
/datum/gas/hydrogen = 1000,
/datum/gas/hydrogen = 300, //same crystallizer recipe
/datum/gas/bz = 50,
"TEMP" = METAL_HYDROGEN_MINIMUM_HEAT
)
Expand All @@ -688,20 +688,19 @@ nobliumformation = 1001
if(!isturf(holder))
return NO_REACTION
var/turf/open/location = holder
///More heat means higher chance to react but less efficiency, i.e. higher speed lower yield
var/increase_factor = min(log(10 , (temperature / METAL_HYDROGEN_MINIMUM_HEAT)), 5) //e7-e12 range
///the more heat you use the higher is this factor
var/increase_factor = min(log(10 , (temperature / METAL_HYDROGEN_MINIMUM_HEAT)), 5) //e7-e12 range
///the more moles you use and the higher the heat, the higher is the efficiency
var/heat_efficency = air.get_moles(/datum/gas/hydrogen)* 0.01 * increase_factor //This variable name is dumb but I can't be assed to change it
var/heat_efficency = air.get_moles(/datum/gas/hydrogen)* 0.01 * increase_factor //This variable name is dumb but I can't be assed to change it
var/pressure = air.return_pressure()
var/energy_used = heat_efficency * METAL_HYDROGEN_FORMATION_ENERGY

if(pressure >= METAL_HYDROGEN_MINIMUM_PRESSURE && temperature >= METAL_HYDROGEN_MINIMUM_HEAT)
air.adjust_moles(/datum/gas/bz, -(heat_efficency * 0.05)) //0.0005-0.0025 x mols of present hydrogen as BZ consumed, something about it decomposing
if (prob(20 * increase_factor))
air.adjust_moles(/datum/gas/hydrogen, -(heat_efficency * 14)) //14-70% of present hydrogen consumed.
if (prob(25 / increase_factor))
new /obj/item/stack/sheet/mineral/metal_hydrogen(location)
SSresearch.science_tech.add_point_type(TECHWEB_POINT_TYPE_DEFAULT, min((heat_efficency * increase_factor * 0.5), METAL_HYDROGEN_RESEARCH_MAX_AMOUNT))
air.adjust_moles(/datum/gas/bz, -(heat_efficency)) //About 70% the amount of BZ requirement consumed
if (prob(25 * increase_factor))
air.adjust_moles(/datum/gas/hydrogen, -(heat_efficency * 10)) //Still consume about 70% of the hydrogen present
new /obj/item/stack/sheet/mineral/metal_hydrogen(location)
SSresearch.science_tech.add_point_type(TECHWEB_POINT_TYPE_DEFAULT, min((heat_efficency * increase_factor * 0.5), METAL_HYDROGEN_RESEARCH_MAX_AMOUNT))

if(energy_used > 0)
var/new_heat_capacity = air.heat_capacity()
Expand Down