|
|
|
@@ -152,6 +152,7 @@
|
|
|
|
|
|
|
|
|
|
if(plasma_burn_rate > MINIMUM_HEAT_CAPACITY)
|
|
|
|
|
ASSERT_GAS(/datum/gas/carbon_dioxide, air) //don't need to assert o2, since if it isn't present we'll never reach this point anyway
|
|
|
|
|
plasma_burn_rate = min(plasma_burn_rate,cached_gases[/datum/gas/plasma][MOLES],cached_gases[/datum/gas/oxygen][MOLES]/oxygen_burn_rate) //Ensures matter is conserved properly
|
|
|
|
|
cached_gases[/datum/gas/plasma][MOLES] = QUANTIZE(cached_gases[/datum/gas/plasma][MOLES] - plasma_burn_rate)
|
|
|
|
|
cached_gases[/datum/gas/oxygen][MOLES] = QUANTIZE(cached_gases[/datum/gas/oxygen][MOLES] - (plasma_burn_rate * oxygen_burn_rate))
|
|
|
|
|
if (super_saturation)
|
|
|
|
@@ -207,13 +208,13 @@
|
|
|
|
|
var/old_heat_capacity = air.heat_capacity()
|
|
|
|
|
var/catalyst_efficency = max(min(cached_gases[/datum/gas/plasma][MOLES]/cached_gases[/datum/gas/tritium][MOLES],MAX_CATALYST_EFFICENCY)-(temperature/FUSION_HEAT_DROPOFF),1)
|
|
|
|
|
var/reaction_energy = THERMAL_ENERGY(air)
|
|
|
|
|
var/moles_impurities = air.total_moles()-(cached_gases[/datum/gas/plasma][MOLES]+cached_gases[/datum/gas/tritium][MOLES])
|
|
|
|
|
var/moles_impurities = max(air.total_moles()-(cached_gases[/datum/gas/plasma][MOLES]+cached_gases[/datum/gas/tritium][MOLES]),1) //This makes it assume a minimum of 1 mol impurities so the reaction energy doesn't divide by 0
|
|
|
|
|
|
|
|
|
|
var/plasma_fused = (PLASMA_FUSED_COEFFICENT*catalyst_efficency)*(temperature/PLASMA_BINDING_ENERGY)/10
|
|
|
|
|
var/tritium_catalyzed = (CATALYST_COEFFICENT*catalyst_efficency)*(temperature/PLASMA_BINDING_ENERGY)/40
|
|
|
|
|
var/plasma_fused = min((PLASMA_FUSED_COEFFICENT*catalyst_efficency)*(temperature/PLASMA_BINDING_ENERGY)/10,cached_gases[/datum/gas/plasma][MOLES]) //Preserve matter
|
|
|
|
|
var/tritium_catalyzed = min((CATALYST_COEFFICENT*catalyst_efficency)*(temperature/PLASMA_BINDING_ENERGY)/40,cached_gases[/datum/gas/tritium][MOLES]) //Ditto
|
|
|
|
|
var/oxygen_added = tritium_catalyzed
|
|
|
|
|
var/waste_added = max((plasma_fused-oxygen_added)-((air.total_moles()*air.heat_capacity())/PLASMA_BINDING_ENERGY),0)
|
|
|
|
|
reaction_energy = max(reaction_energy+((catalyst_efficency*cached_gases[/datum/gas/plasma][MOLES])/((moles_impurities/catalyst_efficency)+2)*10)+((plasma_fused/((moles_impurities/catalyst_efficency)))*PLASMA_BINDING_ENERGY),0)
|
|
|
|
|
reaction_energy = max(reaction_energy+((catalyst_efficency*cached_gases[/datum/gas/plasma][MOLES])/((moles_impurities/catalyst_efficency)+2)*10)+((plasma_fused/(moles_impurities/catalyst_efficency))*PLASMA_BINDING_ENERGY),0)
|
|
|
|
|
|
|
|
|
|
air.assert_gases(/datum/gas/oxygen, /datum/gas/carbon_dioxide, /datum/gas/water_vapor, /datum/gas/nitrous_oxide, /datum/gas/nitryl)
|
|
|
|
|
//Fusion produces an absurd amount of waste products now, requiring active filtration.
|
|
|
|
@@ -251,7 +252,7 @@
|
|
|
|
|
var/temperature = air.temperature
|
|
|
|
|
|
|
|
|
|
var/old_heat_capacity = air.heat_capacity()
|
|
|
|
|
var/heat_efficency = temperature/(FIRE_MINIMUM_TEMPERATURE_TO_EXIST*100)
|
|
|
|
|
var/heat_efficency = min(temperature/(FIRE_MINIMUM_TEMPERATURE_TO_EXIST*100),cached_gases[/datum/gas/oxygen][MOLES],cached_gases[/datum/gas/nitrogen][MOLES])
|
|
|
|
|
var/energy_used = heat_efficency*NITRYL_FORMATION_ENERGY
|
|
|
|
|
ASSERT_GAS(/datum/gas/nitryl,air)
|
|
|
|
|
|
|
|
|
@@ -283,7 +284,7 @@
|
|
|
|
|
var/pressure = air.return_pressure()
|
|
|
|
|
|
|
|
|
|
var/old_heat_capacity = air.heat_capacity()
|
|
|
|
|
var/reaction_efficency = 1/((pressure/(0.1*ONE_ATMOSPHERE))*(max(cached_gases[/datum/gas/plasma][MOLES]/cached_gases[/datum/gas/tritium][MOLES],1)))
|
|
|
|
|
var/reaction_efficency = min(1/((pressure/(0.1*ONE_ATMOSPHERE))*(max(cached_gases[/datum/gas/plasma][MOLES]/cached_gases[/datum/gas/tritium][MOLES],1))),cached_gases[/datum/gas/tritium][MOLES],cached_gases[/datum/gas/plasma][MOLES]/2)
|
|
|
|
|
var/energy_released = 2*reaction_efficency*FIRE_CARBON_ENERGY_RELEASED
|
|
|
|
|
|
|
|
|
|
ASSERT_GAS(/datum/gas/bz,air)
|
|
|
|
@@ -314,9 +315,8 @@
|
|
|
|
|
var/list/cached_gases = air.gases
|
|
|
|
|
|
|
|
|
|
var/old_heat_capacity = air.heat_capacity()
|
|
|
|
|
var/heat_scale = air.temperature/STIMULUM_HEAT_SCALE
|
|
|
|
|
var/stim_energy_change
|
|
|
|
|
stim_energy_change =heat_scale + (STIMULUM_FIRST_RISE(heat_scale**2)) - (STIMULUM_FIRST_DROP(heat_scale**3)) + (STIMULUM_SECOND_RISE(heat_scale**4)) - (STIMULUM_ABSOLUTE_DROP(heat_scale**5))
|
|
|
|
|
var/heat_scale = min(air.temperature/STIMULUM_HEAT_SCALE,cached_gases[/datum/gas/tritium][MOLES],cached_gases[/datum/gas/plasma][MOLES],cached_gases[/datum/gas/nitryl][MOLES])
|
|
|
|
|
var/stim_energy_change = heat_scale + STIMULUM_FIRST_RISE*(heat_scale**2) - STIMULUM_FIRST_DROP*(heat_scale**3) + STIMULUM_SECOND_RISE*(heat_scale**4) - STIMULUM_ABSOLUTE_DROP*(heat_scale**5)
|
|
|
|
|
|
|
|
|
|
ASSERT_GAS(/datum/gas/stimulum,air)
|
|
|
|
|
cached_gases[/datum/gas/stimulum][MOLES]+= heat_scale/10
|
|
|
|
@@ -345,7 +345,7 @@
|
|
|
|
|
var/list/cached_gases = air.gases
|
|
|
|
|
air.assert_gases(/datum/gas/hypernoblium,/datum/gas/bz)
|
|
|
|
|
var/old_heat_capacity = air.heat_capacity()
|
|
|
|
|
var/nob_formed = (cached_gases[/datum/gas/nitrogen][MOLES]*cached_gases[/datum/gas/tritium][MOLES])/100
|
|
|
|
|
var/nob_formed = min((cached_gases[/datum/gas/nitrogen][MOLES]+cached_gases[/datum/gas/tritium][MOLES])/100,cached_gases[/datum/gas/tritium][MOLES]/10,cached_gases[/datum/gas/nitrogen][MOLES]/20)
|
|
|
|
|
var/energy_taken = nob_formed*(NOBLIUM_FORMATION_ENERGY/(max(cached_gases[/datum/gas/bz][MOLES],1)))
|
|
|
|
|
cached_gases[/datum/gas/tritium][MOLES] = max(cached_gases[/datum/gas/tritium][MOLES]- 10*nob_formed,0)
|
|
|
|
|
cached_gases[/datum/gas/nitrogen][MOLES] = max(cached_gases[/datum/gas/nitrogen][MOLES]- 20*nob_formed,0)
|
|
|
|
|