added check for when we ran out of fuel

This commit is contained in:
AbsFree
2024-12-17 10:01:24 +01:00
parent 0d041fbf2e
commit 5f61b40fea
@@ -12,6 +12,8 @@
/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()
var/reaction_efficiency = 0
if (temperature <= 5)
@@ -21,7 +23,7 @@
else
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/energy_released = reaction_efficiency * FIRE_CARBON_ENERGY_RELEASED
air.adjust_moles(GAS_FAT, reaction_efficiency)
air.adjust_moles(GAS_TRITIUM, -reaction_efficiency / 2)
air.adjust_moles(GAS_BZ, -reaction_efficiency / 2)