adjusted temperatur calculations
This commit is contained in:
@@ -11,7 +11,6 @@
|
||||
)
|
||||
|
||||
/datum/gas_reaction/lipoifium_formation/react(datum/gas_mixture/air)
|
||||
// TODO: make the reaction exothermic, and make it more efficient at lower temperatures
|
||||
if (air.get_moles(GAS_BZ) < 15 || air.get_moles(GAS_TRITIUM) < 15)
|
||||
return NO_REACTION
|
||||
var/temperature = air.return_temperature()
|
||||
@@ -24,10 +23,11 @@
|
||||
reaction_efficiency = -((temperature - 5) / 95) + 1 // will equal 1 at 5 kelvin, and will linearly fall until 0 at 100k
|
||||
|
||||
var/energy_released = reaction_efficiency * FIRE_CARBON_ENERGY_RELEASED
|
||||
var/old_heat_capacity = air.heat_capacity()
|
||||
air.adjust_moles(GAS_FAT, reaction_efficiency)
|
||||
air.adjust_moles(GAS_TRITIUM, -reaction_efficiency / 2)
|
||||
air.adjust_moles(GAS_BZ, -reaction_efficiency / 2)
|
||||
var/heat_capacity = air.heat_capacity()
|
||||
air.set_temperature(max(temperature + energy_released / heat_capacity, TCMB))
|
||||
var/new_heat_capacity = air.heat_capacity()
|
||||
air.set_temperature(max((temperature * old_heat_capacity + energy_released) / new_heat_capacity, TCMB))
|
||||
|
||||
return REACTING
|
||||
|
||||
Reference in New Issue
Block a user