mirror of
https://github.com/yogstation13/Yogstation.git
synced 2025-02-26 09:04:50 +00:00
maybe fixes reactions
This commit is contained in:
@@ -35,6 +35,7 @@
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
fusion_power = 3
|
fusion_power = 3
|
||||||
|
enthalpy = -393500
|
||||||
|
|
||||||
/datum/gas/plasma
|
/datum/gas/plasma
|
||||||
id = GAS_PLASMA
|
id = GAS_PLASMA
|
||||||
@@ -43,7 +44,10 @@
|
|||||||
gas_overlay = "plasma"
|
gas_overlay = "plasma"
|
||||||
moles_visible = MOLES_GAS_VISIBLE
|
moles_visible = MOLES_GAS_VISIBLE
|
||||||
flags = GAS_FLAG_DANGEROUS
|
flags = GAS_FLAG_DANGEROUS
|
||||||
// no fire info cause it has its own bespoke reaction for trit generation reasons
|
fire_burn_rate = OXYGEN_BURN_RATE_BASE // named when plasma fires were the only fires, surely
|
||||||
|
fire_temperature = FIRE_MINIMUM_TEMPERATURE_TO_EXIST
|
||||||
|
fire_products = "plasma_fire"
|
||||||
|
enthalpy = FIRE_PLASMA_ENERGY_RELEASED // 3000000, 3 megajoules, 3000 kj
|
||||||
|
|
||||||
/datum/gas/water_vapor
|
/datum/gas/water_vapor
|
||||||
id = GAS_H2O
|
id = GAS_H2O
|
||||||
@@ -53,6 +57,7 @@
|
|||||||
moles_visible = MOLES_GAS_VISIBLE
|
moles_visible = MOLES_GAS_VISIBLE
|
||||||
fusion_power = 8
|
fusion_power = 8
|
||||||
breath_reagent = /datum/reagent/water
|
breath_reagent = /datum/reagent/water
|
||||||
|
enthalpy = -241800 // FIRE_HYDROGEN_ENERGY_RELEASED is actually what this was supposed to be
|
||||||
|
|
||||||
/datum/gas/hypernoblium
|
/datum/gas/hypernoblium
|
||||||
id = GAS_HYPERNOB
|
id = GAS_HYPERNOB
|
||||||
@@ -71,6 +76,7 @@
|
|||||||
fire_products = list(GAS_N2 = 1)
|
fire_products = list(GAS_N2 = 1)
|
||||||
oxidation_rate = 0.5
|
oxidation_rate = 0.5
|
||||||
oxidation_temperature = FIRE_MINIMUM_TEMPERATURE_TO_EXIST + 100
|
oxidation_temperature = FIRE_MINIMUM_TEMPERATURE_TO_EXIST + 100
|
||||||
|
enthalpy = 81600
|
||||||
|
|
||||||
/datum/gas/nitryl
|
/datum/gas/nitryl
|
||||||
id = GAS_NITRYL
|
id = GAS_NITRYL
|
||||||
@@ -81,6 +87,7 @@
|
|||||||
flags = GAS_FLAG_DANGEROUS
|
flags = GAS_FLAG_DANGEROUS
|
||||||
fusion_power = 15
|
fusion_power = 15
|
||||||
fire_products = list(GAS_N2 = 0.5)
|
fire_products = list(GAS_N2 = 0.5)
|
||||||
|
enthalpy = 33200
|
||||||
oxidation_temperature = FIRE_MINIMUM_TEMPERATURE_TO_EXIST - 50
|
oxidation_temperature = FIRE_MINIMUM_TEMPERATURE_TO_EXIST - 50
|
||||||
|
|
||||||
/datum/gas/tritium
|
/datum/gas/tritium
|
||||||
@@ -91,13 +98,11 @@
|
|||||||
moles_visible = MOLES_GAS_VISIBLE
|
moles_visible = MOLES_GAS_VISIBLE
|
||||||
flags = GAS_FLAG_DANGEROUS
|
flags = GAS_FLAG_DANGEROUS
|
||||||
fusion_power = 1
|
fusion_power = 1
|
||||||
/*
|
fire_products = list(GAS_H2O = 1)
|
||||||
these are for when we add hydrogen, trit gets to keep its hardcoded fire for legacy reasons
|
enthalpy = 40000
|
||||||
fire_provides = list(GAS_H2O = 2)
|
|
||||||
fire_burn_rate = 2
|
fire_burn_rate = 2
|
||||||
fire_energy_released = FIRE_HYDROGEN_ENERGY_RELEASED
|
fire_radiation_released = 50 // arbitrary number, basically 60 moles of trit burning will just barely start to harm you
|
||||||
fire_temperature = FIRE_MINIMUM_TEMPERATURE_TO_EXIST - 50
|
fire_temperature = FIRE_MINIMUM_TEMPERATURE_TO_EXIST - 50
|
||||||
*/
|
|
||||||
|
|
||||||
/datum/gas/bz
|
/datum/gas/bz
|
||||||
id = GAS_BZ
|
id = GAS_BZ
|
||||||
@@ -105,6 +110,7 @@
|
|||||||
name = "BZ"
|
name = "BZ"
|
||||||
flags = GAS_FLAG_DANGEROUS
|
flags = GAS_FLAG_DANGEROUS
|
||||||
fusion_power = 8
|
fusion_power = 8
|
||||||
|
enthalpy = FIRE_CARBON_ENERGY_RELEASED // it is a mystery
|
||||||
|
|
||||||
/datum/gas/stimulum
|
/datum/gas/stimulum
|
||||||
id = GAS_STIMULUM
|
id = GAS_STIMULUM
|
||||||
@@ -119,6 +125,7 @@
|
|||||||
fusion_power = 10
|
fusion_power = 10
|
||||||
oxidation_temperature = FIRE_MINIMUM_TEMPERATURE_TO_EXIST * 1000 // it is VERY stable
|
oxidation_temperature = FIRE_MINIMUM_TEMPERATURE_TO_EXIST * 1000 // it is VERY stable
|
||||||
oxidation_rate = 8
|
oxidation_rate = 8
|
||||||
|
enthalpy = -50000 // but it reduces the heat output a bit
|
||||||
|
|
||||||
/datum/gas/miasma
|
/datum/gas/miasma
|
||||||
id = GAS_MIASMA
|
id = GAS_MIASMA
|
||||||
@@ -130,9 +137,13 @@
|
|||||||
|
|
||||||
/datum/gas/hydrogen
|
/datum/gas/hydrogen
|
||||||
id = GAS_H2
|
id = GAS_H2
|
||||||
specific_heat = 15
|
specific_heat = 10
|
||||||
name = "Hydrogen"
|
name = "Hydrogen"
|
||||||
flags = GAS_FLAG_DANGEROUS
|
flags = GAS_FLAG_DANGEROUS
|
||||||
|
fusion_power = 0
|
||||||
|
fire_products = list(GAS_H2O = 1)
|
||||||
|
fire_burn_rate = 2
|
||||||
|
fire_temperature = FIRE_MINIMUM_TEMPERATURE_TO_EXIST - 50
|
||||||
|
|
||||||
/datum/gas/freon
|
/datum/gas/freon
|
||||||
id = GAS_FREON
|
id = GAS_FREON
|
||||||
|
|||||||
@@ -32,11 +32,10 @@ GLOBAL_LIST_INIT(nonreactive_gases, typecacheof(list(GAS_O2, GAS_N2, GAS_CO2, GA
|
|||||||
var/list/oxidation_temperatures = list()
|
var/list/oxidation_temperatures = list()
|
||||||
var/list/oxidation_rates = list()
|
var/list/oxidation_rates = list()
|
||||||
var/list/fire_temperatures = list()
|
var/list/fire_temperatures = list()
|
||||||
var/list/fire_enthalpies = list()
|
var/list/enthalpies = list()
|
||||||
var/list/fire_products = list()
|
var/list/fire_products = list()
|
||||||
var/list/fire_burn_rates = list()
|
var/list/fire_burn_rates = list()
|
||||||
|
|
||||||
|
|
||||||
/datum/gas
|
/datum/gas
|
||||||
var/id = ""
|
var/id = ""
|
||||||
var/specific_heat = 0
|
var/specific_heat = 0
|
||||||
@@ -53,9 +52,9 @@ GLOBAL_LIST_INIT(nonreactive_gases, typecacheof(list(GAS_O2, GAS_N2, GAS_CO2, GA
|
|||||||
var/oxidation_rate = 1 // how many moles of this can oxidize how many moles of material
|
var/oxidation_rate = 1 // how many moles of this can oxidize how many moles of material
|
||||||
var/fire_temperature = null // temperature above which gas may catch fire; null for none
|
var/fire_temperature = null // temperature above which gas may catch fire; null for none
|
||||||
var/list/fire_products = null // what results when this gas is burned (oxidizer or fuel); null for none
|
var/list/fire_products = null // what results when this gas is burned (oxidizer or fuel); null for none
|
||||||
var/fire_energy_released = 0 // how much energy is released per mole of fuel burned
|
var/enthalpy = 0 // Standard enthalpy of formation in joules, used for fires
|
||||||
var/fire_burn_rate = 1 // how many moles are burned per product released
|
var/fire_burn_rate = 1 // how many moles are burned per product released
|
||||||
var/rarity = 0
|
var/fire_radiation_released = 0 // How much radiation is released when this gas burns
|
||||||
|
|
||||||
/datum/gas/proc/breath(partial_pressure, light_threshold, heavy_threshold, moles, mob/living/carbon/C, obj/item/organ/lungs/lungs)
|
/datum/gas/proc/breath(partial_pressure, light_threshold, heavy_threshold, moles, mob/living/carbon/C, obj/item/organ/lungs/lungs)
|
||||||
// This is only called on gases with the GAS_FLAG_BREATH_PROC flag. When possible, do NOT use this--
|
// This is only called on gases with the GAS_FLAG_BREATH_PROC flag. When possible, do NOT use this--
|
||||||
@@ -88,21 +87,18 @@ GLOBAL_LIST_INIT(nonreactive_gases, typecacheof(list(GAS_O2, GAS_N2, GAS_CO2, GA
|
|||||||
breath_reagents[g] = gas.breath_reagent
|
breath_reagents[g] = gas.breath_reagent
|
||||||
if(gas.breath_reagent_dangerous)
|
if(gas.breath_reagent_dangerous)
|
||||||
breath_reagents_dangerous[g] = gas.breath_reagent_dangerous
|
breath_reagents_dangerous[g] = gas.breath_reagent_dangerous
|
||||||
|
|
||||||
if(gas.oxidation_temperature)
|
if(gas.oxidation_temperature)
|
||||||
oxidation_temperatures[g] = gas.oxidation_temperature
|
oxidation_temperatures[g] = gas.oxidation_temperature
|
||||||
oxidation_rates[g] = gas.oxidation_rate
|
oxidation_rates[g] = gas.oxidation_rate
|
||||||
if(gas.fire_products)
|
if(gas.fire_products)
|
||||||
fire_products[g] = gas.fire_products
|
fire_products[g] = gas.fire_products
|
||||||
fire_enthalpies[g] = gas.fire_energy_released
|
enthalpies[g] = gas.enthalpy
|
||||||
else if(gas.fire_temperature)
|
else if(gas.fire_temperature)
|
||||||
fire_temperatures[g] = gas.fire_temperature
|
fire_temperatures[g] = gas.fire_temperature
|
||||||
fire_burn_rates[g] = gas.fire_burn_rate
|
fire_burn_rates[g] = gas.fire_burn_rate
|
||||||
if(gas.fire_products)
|
if(gas.fire_products)
|
||||||
fire_products[g] = gas.fire_products
|
fire_products[g] = gas.fire_products
|
||||||
fire_enthalpies[g] = gas.fire_energy_released
|
enthalpies[g] = gas.enthalpy
|
||||||
|
|
||||||
_auxtools_register_gas(gas)
|
|
||||||
|
|
||||||
/proc/finalize_gas_refs()
|
/proc/finalize_gas_refs()
|
||||||
|
|
||||||
|
|||||||
@@ -35,20 +35,10 @@ nobliumformation = 1001
|
|||||||
continue
|
continue
|
||||||
reaction = new r
|
reaction = new r
|
||||||
. += reaction
|
. += reaction
|
||||||
sortTim(., /proc/cmp_gas_reactions)
|
sortTim(., /proc/cmp_gas_reaction)
|
||||||
|
|
||||||
/proc/cmp_gas_reactions(list/datum/gas_reaction/a, list/datum/gas_reaction/b) // compares lists of reactions by the maximum priority contained within the list
|
/proc/cmp_gas_reaction(datum/gas_reaction/a, datum/gas_reaction/b) // compares lists of reactions by the maximum priority contained within the list
|
||||||
if (!length(a) || !length(b))
|
return b.priority - a.priority
|
||||||
return length(b) - length(a)
|
|
||||||
var/maxa
|
|
||||||
var/maxb
|
|
||||||
for (var/datum/gas_reaction/R in a)
|
|
||||||
if (R.priority > maxa)
|
|
||||||
maxa = R.priority
|
|
||||||
for (var/datum/gas_reaction/R in b)
|
|
||||||
if (R.priority > maxb)
|
|
||||||
maxb = R.priority
|
|
||||||
return maxb - maxa
|
|
||||||
|
|
||||||
/datum/gas_reaction
|
/datum/gas_reaction
|
||||||
//regarding the requirements lists: the minimum or maximum requirements must be non-zero.
|
//regarding the requirements lists: the minimum or maximum requirements must be non-zero.
|
||||||
@@ -85,20 +75,25 @@ nobliumformation = 1001
|
|||||||
id = "vapor"
|
id = "vapor"
|
||||||
|
|
||||||
/datum/gas_reaction/water_vapor/init_reqs()
|
/datum/gas_reaction/water_vapor/init_reqs()
|
||||||
min_requirements = list(GAS_H2O = MOLES_GAS_VISIBLE)
|
min_requirements = list(
|
||||||
|
GAS_H2O = MOLES_GAS_VISIBLE,
|
||||||
|
"MAX_TEMP" = T0C + 40
|
||||||
|
)
|
||||||
|
|
||||||
/datum/gas_reaction/water_vapor/react(datum/gas_mixture/air, datum/holder)
|
/datum/gas_reaction/water_vapor/react(datum/gas_mixture/air, datum/holder)
|
||||||
var/turf/open/location = isturf(holder) ? holder : null
|
var/turf/open/location = holder
|
||||||
. = NO_REACTION
|
if(!istype(location))
|
||||||
|
return NO_REACTION
|
||||||
if (air.return_temperature() <= WATER_VAPOR_FREEZE)
|
if (air.return_temperature() <= WATER_VAPOR_FREEZE)
|
||||||
if(location && location.freon_gas_act())
|
if(location && location.freon_gas_act())
|
||||||
. = REACTING
|
return REACTING
|
||||||
else if(location && location.water_vapor_gas_act())
|
else if(location && location.water_vapor_gas_act())
|
||||||
air.adjust_moles(GAS_H2O, -MOLES_GAS_VISIBLE)
|
air.adjust_moles(GAS_H2O,-MOLES_GAS_VISIBLE)
|
||||||
. = REACTING
|
return REACTING
|
||||||
|
|
||||||
/datum/gas_reaction/nitrous_decomp
|
/datum/gas_reaction/nitrous_decomp
|
||||||
priority = 0
|
priority = 0
|
||||||
|
exclude = TRUE // generic fire now takes care of this
|
||||||
name = "Nitrous Oxide Decomposition"
|
name = "Nitrous Oxide Decomposition"
|
||||||
id = "nitrous_decomp"
|
id = "nitrous_decomp"
|
||||||
|
|
||||||
@@ -133,6 +128,7 @@ nobliumformation = 1001
|
|||||||
//tritium combustion: combustion of oxygen and tritium (treated as hydrocarbons). creates hotspots. exothermic
|
//tritium combustion: combustion of oxygen and tritium (treated as hydrocarbons). creates hotspots. exothermic
|
||||||
/datum/gas_reaction/tritfire
|
/datum/gas_reaction/tritfire
|
||||||
priority = -1 //fire should ALWAYS be last, but tritium fires happen before plasma fires
|
priority = -1 //fire should ALWAYS be last, but tritium fires happen before plasma fires
|
||||||
|
exclude = TRUE // generic fire now takes care of this
|
||||||
name = "Tritium Combustion"
|
name = "Tritium Combustion"
|
||||||
id = "tritfire"
|
id = "tritfire"
|
||||||
|
|
||||||
@@ -222,6 +218,7 @@ nobliumformation = 1001
|
|||||||
priority = -2 //fire should ALWAYS be last, but plasma fires happen after tritium fires
|
priority = -2 //fire should ALWAYS be last, but plasma fires happen after tritium fires
|
||||||
name = "Plasma Combustion"
|
name = "Plasma Combustion"
|
||||||
id = "plasmafire"
|
id = "plasmafire"
|
||||||
|
exclude = TRUE // generic fire now takes care of this
|
||||||
|
|
||||||
/datum/gas_reaction/plasmafire/init_reqs()
|
/datum/gas_reaction/plasmafire/init_reqs()
|
||||||
min_requirements = list(
|
min_requirements = list(
|
||||||
@@ -348,7 +345,7 @@ nobliumformation = 1001
|
|||||||
fuels[fuel] *= oxidation_ratio
|
fuels[fuel] *= oxidation_ratio
|
||||||
fuels += oxidizers
|
fuels += oxidizers
|
||||||
var/list/fire_products = GLOB.gas_data.fire_products
|
var/list/fire_products = GLOB.gas_data.fire_products
|
||||||
var/list/fire_enthalpies = GLOB.gas_data.fire_enthalpies
|
var/list/fire_enthalpies = GLOB.gas_data.enthalpies
|
||||||
for(var/fuel in fuels + oxidizers)
|
for(var/fuel in fuels + oxidizers)
|
||||||
var/amt = fuels[fuel]
|
var/amt = fuels[fuel]
|
||||||
if(!burn_results[fuel])
|
if(!burn_results[fuel])
|
||||||
@@ -707,6 +704,7 @@ nobliumformation = 1001
|
|||||||
/datum/gas_reaction/h2fire
|
/datum/gas_reaction/h2fire
|
||||||
priority = -3 //fire should ALWAYS be last, but tritium fires happen before plasma fires
|
priority = -3 //fire should ALWAYS be last, but tritium fires happen before plasma fires
|
||||||
name = "Hydrogen Combustion"
|
name = "Hydrogen Combustion"
|
||||||
|
exclude = TRUE // generic fire now takes care of this
|
||||||
id = "h2fire"
|
id = "h2fire"
|
||||||
|
|
||||||
/datum/gas_reaction/h2fire/init_reqs()
|
/datum/gas_reaction/h2fire/init_reqs()
|
||||||
|
|||||||
Reference in New Issue
Block a user