[MIRROR] Trit & H2 Consistency Fix (#2999)

* Trit & H2 Consistency Fix (#56265)

Make the reactions for trit and h2 fires more consistent with other gas reactions

* Trit & H2 Consistency Fix

Co-authored-by: vincentiusvin <54709710+vincentiusvin@users.noreply.github.com>
This commit is contained in:
SkyratBot
2021-02-01 14:24:24 +01:00
committed by GitHub
parent 0c2351163e
commit 5b98f08bc0
2 changed files with 34 additions and 19 deletions
+2 -1
View File
@@ -7,7 +7,8 @@
#define PLASMA_MINIMUM_OXYGEN_NEEDED 2
#define PLASMA_MINIMUM_OXYGEN_PLASMA_RATIO 30
#define FIRE_CARBON_ENERGY_RELEASED 100000 //Amount of heat released per mole of burnt carbon into the tile
#define FIRE_HYDROGEN_ENERGY_RELEASED 280000 //Amount of heat released per mole of burnt hydrogen and/or tritium(hydrogen isotope)
#define FIRE_HYDROGEN_ENERGY_RELEASED 2800000 //Amount of heat released per mole of burnt hydrogen and/or tritium(hydrogen isotope)
#define FIRE_HYDROGEN_ENERGY_WEAK 280000
#define FIRE_PLASMA_ENERGY_RELEASED 3000000 //Amount of heat released per mole of burnt plasma into the tile
//General assmos defines.
#define WATER_VAPOR_FREEZE 200
@@ -160,23 +160,32 @@ nobiliumsuppression = INFINITY
cached_results["fire"] = 0
var/turf/open/location = isturf(holder) ? holder : null
var/burned_fuel = 0
if(cached_gases[/datum/gas/oxygen][MOLES] < cached_gases[/datum/gas/tritium][MOLES] || MINIMUM_TRIT_OXYBURN_ENERGY > air.thermal_energy())
burned_fuel = cached_gases[/datum/gas/oxygen][MOLES] / TRITIUM_BURN_OXY_FACTOR
cached_gases[/datum/gas/tritium][MOLES] -= burned_fuel
else
burned_fuel = cached_gases[/datum/gas/tritium][MOLES] * TRITIUM_BURN_TRIT_FACTOR
cached_gases[/datum/gas/tritium][MOLES] -= cached_gases[/datum/gas/tritium][MOLES] / TRITIUM_BURN_TRIT_FACTOR
cached_gases[/datum/gas/oxygen][MOLES] -= cached_gases[/datum/gas/tritium][MOLES]
if(burned_fuel)
energy_released += (FIRE_HYDROGEN_ENERGY_RELEASED * burned_fuel)
if(location && prob(10) && burned_fuel > TRITIUM_MINIMUM_RADIATION_ENERGY) //woah there let's not crash the server
radiation_pulse(location, energy_released / TRITIUM_BURN_RADIOACTIVITY_FACTOR)
ASSERT_GAS(/datum/gas/water_vapor, air) //oxygen+more-or-less hydrogen=H2O
cached_gases[/datum/gas/water_vapor][MOLES] += burned_fuel / TRITIUM_BURN_OXY_FACTOR
energy_released += (FIRE_HYDROGEN_ENERGY_WEAK * burned_fuel)
cached_results["fire"] += burned_fuel
else
burned_fuel = cached_gases[/datum/gas/tritium][MOLES]
cached_gases[/datum/gas/tritium][MOLES] -= burned_fuel / TRITIUM_BURN_TRIT_FACTOR
cached_gases[/datum/gas/oxygen][MOLES] -= burned_fuel
ASSERT_GAS(/datum/gas/water_vapor, air) //oxygen+more-or-less hydrogen=H2O
cached_gases[/datum/gas/water_vapor][MOLES] += burned_fuel / TRITIUM_BURN_TRIT_FACTOR
energy_released += (FIRE_HYDROGEN_ENERGY_RELEASED * burned_fuel)
cached_results["fire"] += burned_fuel * 10
if(burned_fuel)
if(location && prob(10) && burned_fuel > TRITIUM_MINIMUM_RADIATION_ENERGY) //woah there let's not crash the server
radiation_pulse(location, energy_released / TRITIUM_BURN_RADIOACTIVITY_FACTOR)
if(energy_released > 0)
var/new_heat_capacity = air.heat_capacity()
@@ -343,21 +352,27 @@ nobiliumsuppression = INFINITY
var/turf/open/location = isturf(holder) ? holder : null
var/burned_fuel = 0
if(cached_gases[/datum/gas/oxygen][MOLES] < cached_gases[/datum/gas/hydrogen][MOLES] || MINIMUM_H2_OXYBURN_ENERGY > air.thermal_energy())
burned_fuel = cached_gases[/datum/gas/oxygen][MOLES]/HYDROGEN_BURN_OXY_FACTOR
burned_fuel = cached_gases[/datum/gas/oxygen][MOLES] / HYDROGEN_BURN_OXY_FACTOR
cached_gases[/datum/gas/hydrogen][MOLES] -= burned_fuel
else
burned_fuel = cached_gases[/datum/gas/hydrogen][MOLES] * HYDROGEN_BURN_H2_FACTOR
cached_gases[/datum/gas/hydrogen][MOLES] -= cached_gases[/datum/gas/hydrogen][MOLES] / HYDROGEN_BURN_H2_FACTOR
cached_gases[/datum/gas/oxygen][MOLES] -= cached_gases[/datum/gas/hydrogen][MOLES]
if(burned_fuel)
energy_released += (FIRE_HYDROGEN_ENERGY_RELEASED * burned_fuel)
ASSERT_GAS(/datum/gas/water_vapor, air) //oxygen+more-or-less hydrogen=H2O
cached_gases[/datum/gas/water_vapor][MOLES] += burned_fuel / HYDROGEN_BURN_OXY_FACTOR
energy_released += (FIRE_HYDROGEN_ENERGY_WEAK * burned_fuel)
cached_results["fire"] += burned_fuel
else
burned_fuel = cached_gases[/datum/gas/hydrogen][MOLES]
cached_gases[/datum/gas/hydrogen][MOLES] -= burned_fuel / HYDROGEN_BURN_H2_FACTOR
cached_gases[/datum/gas/oxygen][MOLES] -= burned_fuel
ASSERT_GAS(/datum/gas/water_vapor, air) //oxygen+more-or-less hydrogen=H2O
cached_gases[/datum/gas/water_vapor][MOLES] += burned_fuel / HYDROGEN_BURN_H2_FACTOR
energy_released += (FIRE_HYDROGEN_ENERGY_RELEASED * burned_fuel)
cached_results["fire"] += burned_fuel * 10
if(energy_released > 0)
var/new_heat_capacity = air.heat_capacity()
if(new_heat_capacity > MINIMUM_HEAT_CAPACITY)
@@ -481,7 +496,6 @@ nobiliumsuppression = INFINITY
/datum/gas/plasma = 10
)
/datum/gas_reaction/bzformation/react(datum/gas_mixture/air)
var/list/cached_gases = air.gases
var/temperature = air.temperature