Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MIRROR] Halon combustion releases resin foam and pluoxium. Halon is formed by electrolysing BZ, and the reaction is much quicker. #2709

Merged
merged 1 commit into from
Apr 3, 2024
Merged
Show file tree
Hide file tree
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
16 changes: 10 additions & 6 deletions code/__DEFINES/reactions.dm
Original file line number Diff line number Diff line change
Expand Up @@ -176,15 +176,19 @@
#define REACTION_OPPRESSION_THRESHOLD 5

// Halon:
/// The minimum temperature required for halon to form from tritium and BZ.
#define HALON_FORMATION_MIN_TEMPERATURE 30
/// The maximum temperature required for halon to form from tritium and BZ.
#define HALON_FORMATION_MAX_TEMPERATURE 55
/// The amount of energy 4.25 moles of halon forming from tritium and BZ releases.
#define HALON_FORMATION_ENERGY 300
/// Energy released per mole of BZ consumed during halon formation.
#define HALON_FORMATION_ENERGY 91232.1

/// How much energy a mole of halon combusting consumes.
#define HALON_COMBUSTION_ENERGY 2500
/// The minimum temperature required for halon to combust.
#define HALON_COMBUSTION_MIN_TEMPERATURE (T0C + 70)
/// The temperature scale for halon combustion reaction rate.
#define HALON_COMBUSTION_TEMPERATURE_SCALE (FIRE_MINIMUM_TEMPERATURE_TO_EXIST * 10)
/// Amount of halon required to be consumed in order to release resin. This is always possible as long as there's enough gas.
#define HALON_COMBUSTION_MINIMUM_RESIN_MOLES (0.99 * HALON_COMBUSTION_MIN_TEMPERATURE / HALON_COMBUSTION_TEMPERATURE_SCALE)
/// The volume of the resin foam fluid when halon combusts, in turfs.
#define HALON_COMBUSTION_RESIN_VOLUME 1

// Healium:
/// The minimum temperature healium can form from BZ and freon at.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,12 @@
alpha = 120
max_integrity = 10
pass_flags_self = PASSGLASS
var/static/list/ignored_gases = typecacheof(list(
/datum/gas/nitrogen,
/datum/gas/oxygen,
/datum/gas/pluoxium,
/datum/gas/halon,
))

/obj/structure/foamedmetal/resin/Initialize(mapload)
. = ..()
Expand All @@ -432,11 +438,8 @@

var/list/gases = air.gases
for(var/gas_type in gases)
switch(gas_type)
if(/datum/gas/oxygen, /datum/gas/nitrogen)
continue
else
gases[gas_type][MOLES] = 0
if(!(ignored_gases[gas_type]))
gases[gas_type][MOLES] = 0
air.garbage_collect()

for(var/obj/machinery/atmospherics/components/unary/comp in location)
Expand All @@ -450,6 +453,22 @@
for(var/obj/item/potential_tinder in location)
potential_tinder.extinguish()

/datum/effect_system/fluid_spread/foam/metal/resin/halon
effect_type = /obj/effect/particle_effect/fluid/foam/metal/resin/halon

/// A variant of resin foam that is created from halon combustion. It does not dissolve in heat to allow the gas to spread before foaming.
/obj/effect/particle_effect/fluid/foam/metal/resin/halon

/obj/effect/particle_effect/fluid/foam/metal/resin/halon/Initialize(mapload)
. = ..()
RemoveElement(/datum/element/atmos_sensitive) // Doesn't dissolve in heat.

/obj/effect/particle_effect/fluid/foam/metal/resin/halon/should_atmos_process(datum/gas_mixture/air, exposed_temperature)
return FALSE // Doesn't dissolve in heat.

/obj/effect/particle_effect/fluid/foam/metal/resin/halon/atmos_expose(datum/gas_mixture/air, exposed_temperature)
return // Doesn't dissolve in heat.

/datum/effect_system/fluid_spread/foam/dirty
effect_type = /obj/effect/particle_effect/fluid/foam/dirty

Expand Down
114 changes: 62 additions & 52 deletions code/modules/atmospherics/gasmixtures/reactions.dm
Original file line number Diff line number Diff line change
Expand Up @@ -448,18 +448,18 @@

/datum/gas_reaction/nitrousformation/react(datum/gas_mixture/air)
var/list/cached_gases = air.gases
var/heat_efficency = min(cached_gases[/datum/gas/oxygen][MOLES] * INVERSE(0.5), cached_gases[/datum/gas/nitrogen][MOLES])
if ((cached_gases[/datum/gas/oxygen][MOLES] - heat_efficency * 0.5 < 0 ) || (cached_gases[/datum/gas/nitrogen][MOLES] - heat_efficency < 0))
var/heat_efficiency = min(cached_gases[/datum/gas/oxygen][MOLES] * INVERSE(0.5), cached_gases[/datum/gas/nitrogen][MOLES])
if ((cached_gases[/datum/gas/oxygen][MOLES] - heat_efficiency * 0.5 < 0 ) || (cached_gases[/datum/gas/nitrogen][MOLES] - heat_efficiency < 0))
return NO_REACTION // Shouldn't produce gas from nothing.

var/old_heat_capacity = air.heat_capacity()
cached_gases[/datum/gas/oxygen][MOLES] -= heat_efficency * 0.5
cached_gases[/datum/gas/nitrogen][MOLES] -= heat_efficency
cached_gases[/datum/gas/oxygen][MOLES] -= heat_efficiency * 0.5
cached_gases[/datum/gas/nitrogen][MOLES] -= heat_efficiency
ASSERT_GAS(/datum/gas/nitrous_oxide, air)
cached_gases[/datum/gas/nitrous_oxide][MOLES] += heat_efficency
cached_gases[/datum/gas/nitrous_oxide][MOLES] += heat_efficiency

SET_REACTION_RESULTS(heat_efficency)
var/energy_released = heat_efficency * N2O_FORMATION_ENERGY
SET_REACTION_RESULTS(heat_efficiency)
var/energy_released = heat_efficiency * N2O_FORMATION_ENERGY
var/new_heat_capacity = air.heat_capacity()
if(new_heat_capacity > MINIMUM_HEAT_CAPACITY)
air.temperature = max(((air.temperature * old_heat_capacity + energy_released) / new_heat_capacity), TCMB) // The air cools down when reacting.
Expand Down Expand Up @@ -642,20 +642,20 @@
/datum/gas_reaction/nitrium_formation/react(datum/gas_mixture/air)
var/list/cached_gases = air.gases
var/temperature = air.temperature
var/heat_efficency = min(temperature / NITRIUM_FORMATION_TEMP_DIVISOR, cached_gases[/datum/gas/tritium][MOLES], cached_gases[/datum/gas/nitrogen][MOLES], cached_gases[/datum/gas/bz][MOLES] * INVERSE(0.05))
var/heat_efficiency = min(temperature / NITRIUM_FORMATION_TEMP_DIVISOR, cached_gases[/datum/gas/tritium][MOLES], cached_gases[/datum/gas/nitrogen][MOLES], cached_gases[/datum/gas/bz][MOLES] * INVERSE(0.05))

if( heat_efficency <= 0 || (cached_gases[/datum/gas/tritium][MOLES] - heat_efficency < 0 ) || (cached_gases[/datum/gas/nitrogen][MOLES] - heat_efficency < 0) || (cached_gases[/datum/gas/bz][MOLES] - heat_efficency * 0.05 < 0)) //Shouldn't produce gas from nothing.
if( heat_efficiency <= 0 || (cached_gases[/datum/gas/tritium][MOLES] - heat_efficiency < 0 ) || (cached_gases[/datum/gas/nitrogen][MOLES] - heat_efficiency < 0) || (cached_gases[/datum/gas/bz][MOLES] - heat_efficiency * 0.05 < 0)) //Shouldn't produce gas from nothing.
return NO_REACTION

var/old_heat_capacity = air.heat_capacity()
ASSERT_GAS(/datum/gas/nitrium, air)
cached_gases[/datum/gas/tritium][MOLES] -= heat_efficency
cached_gases[/datum/gas/nitrogen][MOLES] -= heat_efficency
cached_gases[/datum/gas/bz][MOLES] -= heat_efficency * 0.05 //bz gets consumed to balance the nitrium production and not make it too common and/or easy
cached_gases[/datum/gas/nitrium][MOLES] += heat_efficency
cached_gases[/datum/gas/tritium][MOLES] -= heat_efficiency
cached_gases[/datum/gas/nitrogen][MOLES] -= heat_efficiency
cached_gases[/datum/gas/bz][MOLES] -= heat_efficiency * 0.05 //bz gets consumed to balance the nitrium production and not make it too common and/or easy
cached_gases[/datum/gas/nitrium][MOLES] += heat_efficiency

SET_REACTION_RESULTS(heat_efficency)
var/energy_used = heat_efficency * NITRIUM_FORMATION_ENERGY
SET_REACTION_RESULTS(heat_efficiency)
var/energy_used = heat_efficiency * NITRIUM_FORMATION_ENERGY
var/new_heat_capacity = air.heat_capacity()
if(new_heat_capacity > MINIMUM_HEAT_CAPACITY)
air.temperature = max(((temperature * old_heat_capacity - energy_used) / new_heat_capacity), TCMB) //the air cools down when reacting
Expand Down Expand Up @@ -687,19 +687,19 @@
var/temperature = air.temperature

//This reaction is agressively slow. like, a tenth of a mole per fire slow. Keep that in mind
var/heat_efficency = min(temperature / NITRIUM_DECOMPOSITION_TEMP_DIVISOR, cached_gases[/datum/gas/nitrium][MOLES])
var/heat_efficiency = min(temperature / NITRIUM_DECOMPOSITION_TEMP_DIVISOR, cached_gases[/datum/gas/nitrium][MOLES])

if (heat_efficency <= 0 || (cached_gases[/datum/gas/nitrium][MOLES] - heat_efficency < 0)) //Shouldn't produce gas from nothing.
if (heat_efficiency <= 0 || (cached_gases[/datum/gas/nitrium][MOLES] - heat_efficiency < 0)) //Shouldn't produce gas from nothing.
return NO_REACTION

var/old_heat_capacity = air.heat_capacity()
air.assert_gases(/datum/gas/nitrogen, /datum/gas/hydrogen)
cached_gases[/datum/gas/nitrium][MOLES] -= heat_efficency
cached_gases[/datum/gas/hydrogen][MOLES] += heat_efficency
cached_gases[/datum/gas/nitrogen][MOLES] += heat_efficency
cached_gases[/datum/gas/nitrium][MOLES] -= heat_efficiency
cached_gases[/datum/gas/hydrogen][MOLES] += heat_efficiency
cached_gases[/datum/gas/nitrogen][MOLES] += heat_efficiency

SET_REACTION_RESULTS(heat_efficency)
var/energy_released = heat_efficency * NITRIUM_DECOMPOSITION_ENERGY
SET_REACTION_RESULTS(heat_efficiency)
var/energy_released = heat_efficiency * NITRIUM_DECOMPOSITION_ENERGY
var/new_heat_capacity = air.heat_capacity()
if(new_heat_capacity > MINIMUM_HEAT_CAPACITY)
air.temperature = max(((temperature * old_heat_capacity + energy_released) / new_heat_capacity), TCMB) //the air heats up when reacting
Expand Down Expand Up @@ -821,28 +821,38 @@
requirements = list(
/datum/gas/halon = MINIMUM_MOLE_COUNT,
/datum/gas/oxygen = MINIMUM_MOLE_COUNT,
"MIN_TEMP" = FIRE_MINIMUM_TEMPERATURE_TO_EXIST,
"MIN_TEMP" = HALON_COMBUSTION_MIN_TEMPERATURE,
)

/datum/gas_reaction/halon_o2removal/react(datum/gas_mixture/air, datum/holder)
var/list/cached_gases = air.gases
var/temperature = air.temperature

var/heat_efficency = min(temperature / ( FIRE_MINIMUM_TEMPERATURE_TO_EXIST * 10), cached_gases[/datum/gas/halon][MOLES], cached_gases[/datum/gas/oxygen][MOLES] * INVERSE(20))
if (heat_efficency <= 0 || (cached_gases[/datum/gas/halon][MOLES] - heat_efficency < 0 ) || (cached_gases[/datum/gas/oxygen][MOLES] - heat_efficency * 20 < 0)) //Shouldn't produce gas from nothing.
var/heat_efficiency = min(temperature / HALON_COMBUSTION_TEMPERATURE_SCALE, cached_gases[/datum/gas/halon][MOLES], cached_gases[/datum/gas/oxygen][MOLES] * INVERSE(20))
if (heat_efficiency <= 0 || (cached_gases[/datum/gas/halon][MOLES] - heat_efficiency < 0 ) || (cached_gases[/datum/gas/oxygen][MOLES] - heat_efficiency * 20 < 0)) //Shouldn't produce gas from nothing.
return NO_REACTION

var/old_heat_capacity = air.heat_capacity()
ASSERT_GAS(/datum/gas/carbon_dioxide, air)
cached_gases[/datum/gas/halon][MOLES] -= heat_efficency
cached_gases[/datum/gas/oxygen][MOLES] -= heat_efficency * 20
cached_gases[/datum/gas/carbon_dioxide][MOLES] += heat_efficency * 5
ASSERT_GAS(/datum/gas/pluoxium, air)
cached_gases[/datum/gas/halon][MOLES] -= heat_efficiency
cached_gases[/datum/gas/oxygen][MOLES] -= heat_efficiency * 20
cached_gases[/datum/gas/pluoxium][MOLES] += heat_efficiency * 2.5

SET_REACTION_RESULTS(heat_efficency * 5)
var/energy_used = heat_efficency * HALON_COMBUSTION_ENERGY
SET_REACTION_RESULTS(heat_efficiency * 5)
var/energy_used = heat_efficiency * HALON_COMBUSTION_ENERGY
var/new_heat_capacity = air.heat_capacity()
if(new_heat_capacity > MINIMUM_HEAT_CAPACITY)
air.temperature = max(((temperature * old_heat_capacity - energy_used) / new_heat_capacity), TCMB)

// Resin foam effects.
var/turf/open/location = holder
var/obj/effect/particle_effect/fluid/foam/foam = locate() in location
var/obj/structure/foamedmetal/resin = locate() in location
if(heat_efficiency > HALON_COMBUSTION_MINIMUM_RESIN_MOLES && isopenturf(location) && !foam && !resin) // Don't resin if there is aleady resin or we are not in an open turf.
var/datum/effect_system/fluid_spread/foam/metal/resin/halon/foaming = new
foaming.set_up(amount = HALON_COMBUSTION_RESIN_VOLUME, holder = holder, location = location)
foaming.start()

return REACTING


Expand Down Expand Up @@ -870,18 +880,18 @@
/datum/gas_reaction/healium_formation/react(datum/gas_mixture/air, datum/holder)
var/list/cached_gases = air.gases
var/temperature = air.temperature
var/heat_efficency = min(temperature * 0.3, cached_gases[/datum/gas/freon][MOLES] * INVERSE(2.75), cached_gases[/datum/gas/bz][MOLES] * INVERSE(0.25))
if (heat_efficency <= 0 || (cached_gases[/datum/gas/freon][MOLES] - heat_efficency * 2.75 < 0 ) || (cached_gases[/datum/gas/bz][MOLES] - heat_efficency * 0.25 < 0)) //Shouldn't produce gas from nothing.
var/heat_efficiency = min(temperature * 0.3, cached_gases[/datum/gas/freon][MOLES] * INVERSE(2.75), cached_gases[/datum/gas/bz][MOLES] * INVERSE(0.25))
if (heat_efficiency <= 0 || (cached_gases[/datum/gas/freon][MOLES] - heat_efficiency * 2.75 < 0 ) || (cached_gases[/datum/gas/bz][MOLES] - heat_efficiency * 0.25 < 0)) //Shouldn't produce gas from nothing.
return NO_REACTION

var/old_heat_capacity = air.heat_capacity()
ASSERT_GAS(/datum/gas/healium, air)
cached_gases[/datum/gas/freon][MOLES] -= heat_efficency * 2.75
cached_gases[/datum/gas/bz][MOLES] -= heat_efficency * 0.25
cached_gases[/datum/gas/healium][MOLES] += heat_efficency * 3
cached_gases[/datum/gas/freon][MOLES] -= heat_efficiency * 2.75
cached_gases[/datum/gas/bz][MOLES] -= heat_efficiency * 0.25
cached_gases[/datum/gas/healium][MOLES] += heat_efficiency * 3

SET_REACTION_RESULTS(heat_efficency * 3)
var/energy_released = heat_efficency * HEALIUM_FORMATION_ENERGY
SET_REACTION_RESULTS(heat_efficiency * 3)
var/energy_released = heat_efficiency * HEALIUM_FORMATION_ENERGY
var/new_heat_capacity = air.heat_capacity()
if(new_heat_capacity > MINIMUM_HEAT_CAPACITY)
air.temperature = max(((temperature * old_heat_capacity + energy_released) / new_heat_capacity), TCMB)
Expand Down Expand Up @@ -911,18 +921,18 @@
var/list/cached_gases = air.gases
var/temperature = air.temperature

var/heat_efficency = min(temperature * ZAUKER_FORMATION_TEMPERATURE_SCALE, cached_gases[/datum/gas/hypernoblium][MOLES] * INVERSE(0.01), cached_gases[/datum/gas/nitrium][MOLES] * INVERSE(0.5))
if (heat_efficency <= 0 || (cached_gases[/datum/gas/hypernoblium][MOLES] - heat_efficency * 0.01 < 0 ) || (cached_gases[/datum/gas/nitrium][MOLES] - heat_efficency * 0.5 < 0)) //Shouldn't produce gas from nothing.
var/heat_efficiency = min(temperature * ZAUKER_FORMATION_TEMPERATURE_SCALE, cached_gases[/datum/gas/hypernoblium][MOLES] * INVERSE(0.01), cached_gases[/datum/gas/nitrium][MOLES] * INVERSE(0.5))
if (heat_efficiency <= 0 || (cached_gases[/datum/gas/hypernoblium][MOLES] - heat_efficiency * 0.01 < 0 ) || (cached_gases[/datum/gas/nitrium][MOLES] - heat_efficiency * 0.5 < 0)) //Shouldn't produce gas from nothing.
return NO_REACTION

var/old_heat_capacity = air.heat_capacity()
ASSERT_GAS(/datum/gas/zauker, air)
cached_gases[/datum/gas/hypernoblium][MOLES] -= heat_efficency * 0.01
cached_gases[/datum/gas/nitrium][MOLES] -= heat_efficency * 0.5
cached_gases[/datum/gas/zauker][MOLES] += heat_efficency * 0.5
cached_gases[/datum/gas/hypernoblium][MOLES] -= heat_efficiency * 0.01
cached_gases[/datum/gas/nitrium][MOLES] -= heat_efficiency * 0.5
cached_gases[/datum/gas/zauker][MOLES] += heat_efficiency * 0.5

SET_REACTION_RESULTS(heat_efficency * 0.5)
var/energy_used = heat_efficency * ZAUKER_FORMATION_ENERGY
SET_REACTION_RESULTS(heat_efficiency * 0.5)
var/energy_used = heat_efficiency * ZAUKER_FORMATION_ENERGY
var/new_heat_capacity = air.heat_capacity()
if(new_heat_capacity > MINIMUM_HEAT_CAPACITY)
air.temperature = max(((temperature * old_heat_capacity - energy_used) / new_heat_capacity), TCMB)
Expand Down Expand Up @@ -993,18 +1003,18 @@
var/list/cached_gases = air.gases
var/temperature = air.temperature

var/heat_efficency = min(temperature * 0.005, cached_gases[/datum/gas/pluoxium][MOLES] * INVERSE(0.2), cached_gases[/datum/gas/hydrogen][MOLES] * INVERSE(2))
if (heat_efficency <= 0 || (cached_gases[/datum/gas/pluoxium][MOLES] - heat_efficency * 0.2 < 0 ) || (cached_gases[/datum/gas/hydrogen][MOLES] - heat_efficency * 2 < 0)) //Shouldn't produce gas from nothing.
var/heat_efficiency = min(temperature * 0.005, cached_gases[/datum/gas/pluoxium][MOLES] * INVERSE(0.2), cached_gases[/datum/gas/hydrogen][MOLES] * INVERSE(2))
if (heat_efficiency <= 0 || (cached_gases[/datum/gas/pluoxium][MOLES] - heat_efficiency * 0.2 < 0 ) || (cached_gases[/datum/gas/hydrogen][MOLES] - heat_efficiency * 2 < 0)) //Shouldn't produce gas from nothing.
return NO_REACTION

var/old_heat_capacity = air.heat_capacity()
ASSERT_GAS(/datum/gas/proto_nitrate, air)
cached_gases[/datum/gas/hydrogen][MOLES] -= heat_efficency * 2
cached_gases[/datum/gas/pluoxium][MOLES] -= heat_efficency * 0.2
cached_gases[/datum/gas/proto_nitrate][MOLES] += heat_efficency * 2.2
cached_gases[/datum/gas/hydrogen][MOLES] -= heat_efficiency * 2
cached_gases[/datum/gas/pluoxium][MOLES] -= heat_efficiency * 0.2
cached_gases[/datum/gas/proto_nitrate][MOLES] += heat_efficiency * 2.2

SET_REACTION_RESULTS(heat_efficency * 2.2)
var/energy_released = heat_efficency * PN_FORMATION_ENERGY
SET_REACTION_RESULTS(heat_efficiency * 2.2)
var/energy_released = heat_efficiency * PN_FORMATION_ENERGY
var/new_heat_capacity = air.heat_capacity()
if(new_heat_capacity > MINIMUM_HEAT_CAPACITY)
air.temperature = max(((temperature * old_heat_capacity + energy_released) / new_heat_capacity), TCMB)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,30 +89,26 @@ GLOBAL_LIST_INIT(electrolyzer_reactions, electrolyzer_reactions_list())
/datum/electrolyzer_reaction/halon_generation
name = "Halon generation"
id = "halon_generation"
desc = "Production of halon from CO2 and N2O"
desc = "Production of halon from the electrolysis of BZ."
requirements = list(
/datum/gas/carbon_dioxide = MINIMUM_MOLE_COUNT,
/datum/gas/nitrous_oxide = MINIMUM_MOLE_COUNT,
"MAX_TEMP" = 230
/datum/gas/bz = MINIMUM_MOLE_COUNT,
)
factor = list(
/datum/gas/carbon_dioxide = "2 moles of CO2 get consumed",
/datum/gas/nitrous_oxide = "1 mole of N2O gets consumed",
/datum/gas/halon = "1 mole of Halon gets produced",
"Energy" = "300 joules of energy is released per mole",
"Temperature" = "Can only occur under 230 kelvin.",
/datum/gas/bz = "Consumed during reaction.",
/datum/gas/oxygen = "0.2 moles of oxygen gets produced per mole of BZ consumed.",
/datum/gas/halon = "2 moles of Halon gets produced per mole of BZ consumed.",
"Energy" = "91.2321 kJ of thermal energy is released per mole of BZ consumed.",
"Temperature" = "Reaction efficiency is proportional to temperature.",
"Location" = "Can only happen on turfs with an active Electrolyzer.",
)

/datum/electrolyzer_reaction/halon_generation/react(turf/location, datum/gas_mixture/air_mixture, working_power)

var/old_heat_capacity = air_mixture.heat_capacity()
air_mixture.assert_gases(/datum/gas/carbon_dioxide, /datum/gas/nitrous_oxide, /datum/gas/halon)
var/pressure = air_mixture.return_pressure()
var/reaction_efficency = min(1 / ((pressure / (0.5 * ONE_ATMOSPHERE)) * (max(air_mixture.gases[/datum/gas/carbon_dioxide][MOLES] / air_mixture.gases[/datum/gas/nitrous_oxide][MOLES], 1))), air_mixture.gases[/datum/gas/nitrous_oxide][MOLES], air_mixture.gases[/datum/gas/carbon_dioxide][MOLES] * INVERSE(2))
air_mixture.gases[/datum/gas/carbon_dioxide][MOLES] -= reaction_efficency * 2
air_mixture.gases[/datum/gas/nitrous_oxide][MOLES] -= reaction_efficency
air_mixture.gases[/datum/gas/halon][MOLES] += reaction_efficency
air_mixture.assert_gases(/datum/gas/bz, /datum/gas/oxygen, /datum/gas/halon)
var/reaction_efficency = min(air_mixture.gases[/datum/gas/bz][MOLES] * (1 - NUM_E ** (-0.5 * air_mixture.temperature * working_power / FIRE_MINIMUM_TEMPERATURE_TO_EXIST)), air_mixture.gases[/datum/gas/bz][MOLES])
air_mixture.gases[/datum/gas/bz][MOLES] -= reaction_efficency
air_mixture.gases[/datum/gas/oxygen][MOLES] += reaction_efficency * 0.2
air_mixture.gases[/datum/gas/halon][MOLES] += reaction_efficency * 2
var/energy_used = reaction_efficency * HALON_FORMATION_ENERGY
var/new_heat_capacity = air_mixture.heat_capacity()
if(new_heat_capacity > MINIMUM_HEAT_CAPACITY)
Expand Down
Loading