mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-31 09:08:30 +01:00
fixes and balancing, lowered hypernob min temp of reaction, balanced metallic hydrogen formation.
This commit is contained in:
@@ -123,7 +123,7 @@ nobiliumsuppression = INFINITY
|
||||
var/burned_fuel = 0
|
||||
|
||||
|
||||
burned_fuel = max(0,0.00002*(temperature-(0.00001*(temperature**2))))*cached_gases[/datum/gas/nitrous_oxide][MOLES]
|
||||
burned_fuel = max(0,0.00002 * (temperature - (0.00001 * (temperature**2)))) * cached_gases[/datum/gas/nitrous_oxide][MOLES]
|
||||
if(cached_gases[/datum/gas/nitrous_oxide][MOLES] - burned_fuel < 0)
|
||||
return NO_REACTION
|
||||
cached_gases[/datum/gas/nitrous_oxide][MOLES] -= burned_fuel
|
||||
@@ -132,13 +132,13 @@ nobiliumsuppression = INFINITY
|
||||
energy_released += (N2O_DECOMPOSITION_ENERGY_RELEASED * burned_fuel)
|
||||
|
||||
ASSERT_GAS(/datum/gas/oxygen, air)
|
||||
cached_gases[/datum/gas/oxygen][MOLES] += burned_fuel/2
|
||||
cached_gases[/datum/gas/oxygen][MOLES] += burned_fuel * 0.5
|
||||
ASSERT_GAS(/datum/gas/nitrogen, air)
|
||||
cached_gases[/datum/gas/nitrogen][MOLES] += burned_fuel
|
||||
|
||||
var/new_heat_capacity = air.heat_capacity()
|
||||
if(new_heat_capacity > MINIMUM_HEAT_CAPACITY)
|
||||
air.temperature = (temperature*old_heat_capacity + energy_released)/new_heat_capacity
|
||||
air.temperature = (temperature * old_heat_capacity + energy_released) / new_heat_capacity
|
||||
return REACTING
|
||||
return NO_REACTION
|
||||
|
||||
@@ -165,27 +165,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/tritium][MOLES] || MINIMUM_TRIT_OXYBURN_ENERGY > air.thermal_energy())
|
||||
burned_fuel = cached_gases[/datum/gas/oxygen][MOLES]/TRITIUM_BURN_OXY_FACTOR
|
||||
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
|
||||
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)
|
||||
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
|
||||
cached_gases[/datum/gas/water_vapor][MOLES] += burned_fuel / TRITIUM_BURN_OXY_FACTOR
|
||||
|
||||
cached_results["fire"] += burned_fuel
|
||||
|
||||
if(energy_released > 0)
|
||||
var/new_heat_capacity = air.heat_capacity()
|
||||
if(new_heat_capacity > MINIMUM_HEAT_CAPACITY)
|
||||
air.temperature = (temperature*old_heat_capacity + energy_released)/new_heat_capacity
|
||||
air.temperature = (temperature * old_heat_capacity + energy_released) / new_heat_capacity
|
||||
|
||||
//let the floor know a fire is happening
|
||||
if(istype(location))
|
||||
@@ -232,32 +232,32 @@ nobiliumsuppression = INFINITY
|
||||
if(temperature > PLASMA_UPPER_TEMPERATURE)
|
||||
temperature_scale = 1
|
||||
else
|
||||
temperature_scale = (temperature-PLASMA_MINIMUM_BURN_TEMPERATURE)/(PLASMA_UPPER_TEMPERATURE-PLASMA_MINIMUM_BURN_TEMPERATURE)
|
||||
temperature_scale = (temperature - PLASMA_MINIMUM_BURN_TEMPERATURE) / (PLASMA_UPPER_TEMPERATURE-PLASMA_MINIMUM_BURN_TEMPERATURE)
|
||||
if(temperature_scale > 0)
|
||||
oxygen_burn_rate = OXYGEN_BURN_RATE_BASE - temperature_scale
|
||||
if(cached_gases[/datum/gas/oxygen][MOLES] / cached_gases[/datum/gas/plasma][MOLES] > SUPER_SATURATION_THRESHOLD) //supersaturation. Form Tritium.
|
||||
super_saturation = TRUE
|
||||
if(cached_gases[/datum/gas/oxygen][MOLES] > cached_gases[/datum/gas/plasma][MOLES]*PLASMA_OXYGEN_FULLBURN)
|
||||
plasma_burn_rate = (cached_gases[/datum/gas/plasma][MOLES]*temperature_scale)/PLASMA_BURN_RATE_DELTA
|
||||
if(cached_gases[/datum/gas/oxygen][MOLES] > cached_gases[/datum/gas/plasma][MOLES] * PLASMA_OXYGEN_FULLBURN)
|
||||
plasma_burn_rate = (cached_gases[/datum/gas/plasma][MOLES] * temperature_scale) / PLASMA_BURN_RATE_DELTA
|
||||
else
|
||||
plasma_burn_rate = (temperature_scale*(cached_gases[/datum/gas/oxygen][MOLES]/PLASMA_OXYGEN_FULLBURN))/PLASMA_BURN_RATE_DELTA
|
||||
plasma_burn_rate = (temperature_scale * (cached_gases[/datum/gas/oxygen][MOLES] / PLASMA_OXYGEN_FULLBURN)) / PLASMA_BURN_RATE_DELTA
|
||||
|
||||
if(plasma_burn_rate > MINIMUM_HEAT_CAPACITY)
|
||||
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
|
||||
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)
|
||||
ASSERT_GAS(/datum/gas/tritium,air)
|
||||
ASSERT_GAS(/datum/gas/tritium, air)
|
||||
cached_gases[/datum/gas/tritium][MOLES] += plasma_burn_rate
|
||||
else
|
||||
ASSERT_GAS(/datum/gas/carbon_dioxide,air)
|
||||
ASSERT_GAS(/datum/gas/water_vapor,air)
|
||||
cached_gases[/datum/gas/carbon_dioxide][MOLES] += plasma_burn_rate
|
||||
ASSERT_GAS(/datum/gas/carbon_dioxide, air)
|
||||
ASSERT_GAS(/datum/gas/water_vapor, air)
|
||||
cached_gases[/datum/gas/carbon_dioxide][MOLES] += plasma_burn_rate * 0.05
|
||||
cached_gases[/datum/gas/water_vapor][MOLES] += plasma_burn_rate * 0.25
|
||||
|
||||
energy_released += FIRE_PLASMA_ENERGY_RELEASED * (plasma_burn_rate)
|
||||
|
||||
cached_results["fire"] += (plasma_burn_rate)*(1+oxygen_burn_rate)
|
||||
cached_results["fire"] += (plasma_burn_rate) * (1 + oxygen_burn_rate)
|
||||
|
||||
if(energy_released > 0)
|
||||
var/new_heat_capacity = air.heat_capacity()
|
||||
@@ -304,19 +304,19 @@ nobiliumsuppression = INFINITY
|
||||
if(temperature < FREON_LOWER_TEMPERATURE) //stop the reaction when too cold
|
||||
temperature_scale = 0
|
||||
else
|
||||
temperature_scale = (FREON_MAXIMUM_BURN_TEMPERATURE - temperature)/(FREON_MAXIMUM_BURN_TEMPERATURE - FREON_LOWER_TEMPERATURE) //calculate the scale based on the temperature
|
||||
temperature_scale = (FREON_MAXIMUM_BURN_TEMPERATURE - temperature) / (FREON_MAXIMUM_BURN_TEMPERATURE - FREON_LOWER_TEMPERATURE) //calculate the scale based on the temperature
|
||||
if(temperature_scale >= 0)
|
||||
oxygen_burn_rate = OXYGEN_BURN_RATE_BASE - temperature_scale
|
||||
if(cached_gases[/datum/gas/oxygen][MOLES] > cached_gases[/datum/gas/freon][MOLES]*FREON_OXYGEN_FULLBURN)
|
||||
freon_burn_rate = (cached_gases[/datum/gas/freon][MOLES]*temperature_scale)/FREON_BURN_RATE_DELTA
|
||||
if(cached_gases[/datum/gas/oxygen][MOLES] > cached_gases[/datum/gas/freon][MOLES] * FREON_OXYGEN_FULLBURN)
|
||||
freon_burn_rate = (cached_gases[/datum/gas/freon][MOLES] * temperature_scale) / FREON_BURN_RATE_DELTA
|
||||
else
|
||||
freon_burn_rate = (temperature_scale*(cached_gases[/datum/gas/oxygen][MOLES]/FREON_OXYGEN_FULLBURN))/FREON_BURN_RATE_DELTA
|
||||
freon_burn_rate = (temperature_scale * (cached_gases[/datum/gas/oxygen][MOLES] / FREON_OXYGEN_FULLBURN)) / FREON_BURN_RATE_DELTA
|
||||
|
||||
if(freon_burn_rate > MINIMUM_HEAT_CAPACITY)
|
||||
freon_burn_rate = min(freon_burn_rate,cached_gases[/datum/gas/freon][MOLES],cached_gases[/datum/gas/oxygen][MOLES]/oxygen_burn_rate) //Ensures matter is conserved properly
|
||||
freon_burn_rate = min(freon_burn_rate, cached_gases[/datum/gas/freon][MOLES], cached_gases[/datum/gas/oxygen][MOLES] / oxygen_burn_rate) //Ensures matter is conserved properly
|
||||
cached_gases[/datum/gas/freon][MOLES] = QUANTIZE(cached_gases[/datum/gas/freon][MOLES] - freon_burn_rate)
|
||||
cached_gases[/datum/gas/oxygen][MOLES] = QUANTIZE(cached_gases[/datum/gas/oxygen][MOLES] - (freon_burn_rate * oxygen_burn_rate))
|
||||
ASSERT_GAS(/datum/gas/carbon_dioxide,air)
|
||||
ASSERT_GAS(/datum/gas/carbon_dioxide, air)
|
||||
cached_gases[/datum/gas/carbon_dioxide][MOLES] += freon_burn_rate
|
||||
|
||||
if(temperature < 160 && temperature > 120 && prob(2))
|
||||
@@ -327,7 +327,7 @@ nobiliumsuppression = INFINITY
|
||||
if(energy_released < 0)
|
||||
var/new_heat_capacity = air.heat_capacity()
|
||||
if(new_heat_capacity > MINIMUM_HEAT_CAPACITY)
|
||||
air.temperature = (temperature*old_heat_capacity + energy_released)/new_heat_capacity
|
||||
air.temperature = (temperature * old_heat_capacity + energy_released)/new_heat_capacity
|
||||
|
||||
/datum/gas_reaction/h2fire
|
||||
priority = -3 //fire should ALWAYS be last, but tritium fires happen before plasma fires
|
||||
@@ -354,22 +354,22 @@ nobiliumsuppression = INFINITY
|
||||
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
|
||||
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
|
||||
cached_gases[/datum/gas/water_vapor][MOLES] += burned_fuel / HYDROGEN_BURN_OXY_FACTOR
|
||||
|
||||
cached_results["fire"] += burned_fuel
|
||||
|
||||
if(energy_released > 0)
|
||||
var/new_heat_capacity = air.heat_capacity()
|
||||
if(new_heat_capacity > MINIMUM_HEAT_CAPACITY)
|
||||
air.temperature = (temperature*old_heat_capacity + energy_released)/new_heat_capacity
|
||||
air.temperature = (temperature*old_heat_capacity + energy_released) / new_heat_capacity
|
||||
|
||||
//let the floor know a fire is happening
|
||||
if(istype(location))
|
||||
@@ -415,7 +415,7 @@ nobiliumsuppression = INFINITY
|
||||
if(energy_released > 0)
|
||||
var/new_heat_capacity = air.heat_capacity()
|
||||
if(new_heat_capacity > MINIMUM_HEAT_CAPACITY)
|
||||
air.temperature = (temperature*old_heat_capacity + energy_released)/new_heat_capacity
|
||||
air.temperature = (temperature * old_heat_capacity + energy_released)/new_heat_capacity
|
||||
|
||||
//fusion: a terrible idea that was fun but broken. Now reworked to be less broken and more interesting. Again (and again, and again). Again!
|
||||
//Fusion Rework Counter: Please increment this if you make a major overhaul to this system again.
|
||||
@@ -450,28 +450,28 @@ nobiliumsuppression = INFINITY
|
||||
var/initial_plasma = cached_gases[/datum/gas/plasma][MOLES]
|
||||
var/initial_hydrogen = cached_gases[/datum/gas/hydrogen][MOLES]
|
||||
var/scale_factor = (air.volume)/(PI) //We scale it down by volume/Pi because for fusion conditions, moles roughly = 2*volume, but we want it to be based off something constant between reactions.
|
||||
var/toroidal_size = (2*PI) //The size of the phase space hypertorus
|
||||
var/toroidal_size = (2 * PI) //The size of the phase space hypertorus
|
||||
var/gas_power = 0
|
||||
for (var/gas_id in cached_gases)
|
||||
gas_power += (cached_gases[gas_id][GAS_META][META_GAS_FUSION_POWER]*cached_gases[gas_id][MOLES])
|
||||
var/instability = MODULUS((gas_power*INSTABILITY_GAS_POWER_FACTOR)**2,toroidal_size) //Instability effects how chaotic the behavior of the reaction is
|
||||
gas_power += (cached_gases[gas_id][GAS_META][META_GAS_FUSION_POWER] * cached_gases[gas_id][MOLES])
|
||||
var/instability = MODULUS((gas_power * INSTABILITY_GAS_POWER_FACTOR)**2, toroidal_size) //Instability effects how chaotic the behavior of the reaction is
|
||||
cached_scan_results[id] = instability//used for analyzer feedback
|
||||
|
||||
var/plasma = (initial_plasma-FUSION_MOLE_THRESHOLD)/(scale_factor) //We have to scale the amounts of hydrogen and plasma down a significant amount in order to show the chaotic dynamics we want
|
||||
var/hydrogen = (initial_hydrogen-FUSION_MOLE_THRESHOLD)/(scale_factor) //We also subtract out the threshold amount to make it harder for fusion to burn itself out.
|
||||
|
||||
//The reaction is a specific form of the Kicked Rotator system, which displays chaotic behavior and can be used to model particle interactions.
|
||||
plasma = MODULUS(plasma - (instability*sin(TODEGREES(hydrogen))), toroidal_size)
|
||||
plasma = MODULUS(plasma - (instability * sin(TODEGREES(hydrogen))), toroidal_size)
|
||||
hydrogen = MODULUS(hydrogen - plasma, toroidal_size)
|
||||
|
||||
|
||||
cached_gases[/datum/gas/plasma][MOLES] = plasma*scale_factor + FUSION_MOLE_THRESHOLD //Scales the gases back up
|
||||
cached_gases[/datum/gas/hydrogen][MOLES] = hydrogen*scale_factor + FUSION_MOLE_THRESHOLD
|
||||
cached_gases[/datum/gas/plasma][MOLES] = plasma * scale_factor + FUSION_MOLE_THRESHOLD //Scales the gases back up
|
||||
cached_gases[/datum/gas/hydrogen][MOLES] = hydrogen * scale_factor + FUSION_MOLE_THRESHOLD
|
||||
var/delta_plasma = initial_plasma - cached_gases[/datum/gas/plasma][MOLES]
|
||||
|
||||
reaction_energy += delta_plasma*PLASMA_BINDING_ENERGY //Energy is gained or lost corresponding to the creation or destruction of mass.
|
||||
reaction_energy += delta_plasma * PLASMA_BINDING_ENERGY //Energy is gained or lost corresponding to the creation or destruction of mass.
|
||||
if(instability < FUSION_INSTABILITY_ENDOTHERMALITY)
|
||||
reaction_energy = max(reaction_energy,0) //Stable reactions don't end up endothermic.
|
||||
reaction_energy = max(reaction_energy, 0) //Stable reactions don't end up endothermic.
|
||||
else if (reaction_energy < 0)
|
||||
reaction_energy *= (instability-FUSION_INSTABILITY_ENDOTHERMALITY)**0.5
|
||||
|
||||
@@ -482,24 +482,24 @@ nobiliumsuppression = INFINITY
|
||||
cached_gases[/datum/gas/tritium][MOLES] -= FUSION_TRITIUM_MOLES_USED
|
||||
//The decay of the tritium and the reaction's energy produces waste gases, different ones depending on whether the reaction is endo or exothermic
|
||||
if(reaction_energy > 0)
|
||||
air.assert_gases(/datum/gas/carbon_dioxide,/datum/gas/water_vapor)
|
||||
cached_gases[/datum/gas/carbon_dioxide][MOLES] += FUSION_TRITIUM_MOLES_USED*(reaction_energy*FUSION_TRITIUM_CONVERSION_COEFFICIENT)
|
||||
cached_gases[/datum/gas/water_vapor][MOLES] += (FUSION_TRITIUM_MOLES_USED*(reaction_energy*FUSION_TRITIUM_CONVERSION_COEFFICIENT)) * 0.25
|
||||
air.assert_gases(/datum/gas/carbon_dioxide, /datum/gas/water_vapor)
|
||||
cached_gases[/datum/gas/carbon_dioxide][MOLES] += FUSION_TRITIUM_MOLES_USED * (reaction_energy * FUSION_TRITIUM_CONVERSION_COEFFICIENT)
|
||||
cached_gases[/datum/gas/water_vapor][MOLES] += (FUSION_TRITIUM_MOLES_USED * (reaction_energy * FUSION_TRITIUM_CONVERSION_COEFFICIENT)) * 0.25
|
||||
else
|
||||
air.assert_gases(/datum/gas/carbon_dioxide)
|
||||
cached_gases[/datum/gas/carbon_dioxide][MOLES] += FUSION_TRITIUM_MOLES_USED*(reaction_energy*-FUSION_TRITIUM_CONVERSION_COEFFICIENT)
|
||||
cached_gases[/datum/gas/carbon_dioxide][MOLES] += FUSION_TRITIUM_MOLES_USED * (reaction_energy * -FUSION_TRITIUM_CONVERSION_COEFFICIENT)
|
||||
|
||||
if(reaction_energy)
|
||||
if(location)
|
||||
var/particle_chance = ((PARTICLE_CHANCE_CONSTANT)/(reaction_energy-PARTICLE_CHANCE_CONSTANT)) + 1//Asymptopically approaches 100% as the energy of the reaction goes up.
|
||||
var/particle_chance = ((PARTICLE_CHANCE_CONSTANT) / (reaction_energy - PARTICLE_CHANCE_CONSTANT)) + 1//Asymptopically approaches 100% as the energy of the reaction goes up.
|
||||
if(prob(PERCENT(particle_chance)))
|
||||
location.fire_nuclear_particle()
|
||||
var/rad_power = max((FUSION_RAD_COEFFICIENT/instability) + FUSION_RAD_MAX,0)
|
||||
var/rad_power = max((FUSION_RAD_COEFFICIENT / instability) + FUSION_RAD_MAX, 0)
|
||||
radiation_pulse(location,rad_power)
|
||||
|
||||
var/new_heat_capacity = air.heat_capacity()
|
||||
if(new_heat_capacity > MINIMUM_HEAT_CAPACITY && (air.temperature <= FUSION_MAXIMUM_TEMPERATURE || reaction_energy <= 0)) //If above FUSION_MAXIMUM_TEMPERATURE, will only adjust temperature for endothermic reactions.
|
||||
air.temperature = clamp(((air.temperature*old_heat_capacity + reaction_energy)/new_heat_capacity),TCMB,INFINITY)
|
||||
air.temperature = clamp(((air.temperature * old_heat_capacity + reaction_energy) / new_heat_capacity), TCMB, INFINITY)
|
||||
return REACTING
|
||||
|
||||
/datum/gas_reaction/nitrousformation //formationn of n2o, esothermic, requires bz as catalyst
|
||||
@@ -522,7 +522,7 @@ nobiliumsuppression = INFINITY
|
||||
var/old_heat_capacity = air.heat_capacity()
|
||||
var/heat_efficency = min(cached_gases[/datum/gas/oxygen][MOLES], cached_gases[/datum/gas/nitrogen][MOLES])
|
||||
var/energy_used = heat_efficency * NITROUS_FORMATION_ENERGY
|
||||
ASSERT_GAS(/datum/gas/nitrous_oxide,air)
|
||||
ASSERT_GAS(/datum/gas/nitrous_oxide, air)
|
||||
if ((cached_gases[/datum/gas/oxygen][MOLES] - heat_efficency < 0 ) || (cached_gases[/datum/gas/nitrogen][MOLES] - heat_efficency * 2 < 0)) //Shouldn't produce gas from nothing.
|
||||
return NO_REACTION
|
||||
cached_gases[/datum/gas/oxygen][MOLES] -= heat_efficency
|
||||
@@ -532,7 +532,7 @@ nobiliumsuppression = INFINITY
|
||||
if(energy_used > 0)
|
||||
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 heats up when reacting
|
||||
air.temperature = max(((temperature * old_heat_capacity + energy_used) / new_heat_capacity), TCMB) //the air heats up when reacting
|
||||
return REACTING
|
||||
|
||||
/datum/gas_reaction/nitrylformation //The formation of nitryl. Endothermic. Requires bz.
|
||||
@@ -553,9 +553,9 @@ nobiliumsuppression = INFINITY
|
||||
var/temperature = air.temperature
|
||||
|
||||
var/old_heat_capacity = air.heat_capacity()
|
||||
var/heat_efficency = min(temperature/(FIRE_MINIMUM_TEMPERATURE_TO_EXIST + 100),cached_gases[/datum/gas/oxygen][MOLES],cached_gases[/datum/gas/nitrogen][MOLES])
|
||||
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)
|
||||
ASSERT_GAS(/datum/gas/nitryl, air)
|
||||
if ((cached_gases[/datum/gas/oxygen][MOLES] - heat_efficency * 2 < 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.
|
||||
return NO_REACTION
|
||||
cached_gases[/datum/gas/oxygen][MOLES] -= heat_efficency * 2
|
||||
@@ -566,7 +566,7 @@ nobiliumsuppression = INFINITY
|
||||
if(energy_used > 0)
|
||||
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
|
||||
air.temperature = max(((temperature * old_heat_capacity - energy_used) / new_heat_capacity), TCMB) //the air cools down when reacting
|
||||
return REACTING
|
||||
|
||||
/datum/gas_reaction/bzformation //Formation of BZ by combining plasma and tritium at low pressures. Exothermic.
|
||||
@@ -586,25 +586,25 @@ nobiliumsuppression = INFINITY
|
||||
var/temperature = air.temperature
|
||||
var/pressure = air.return_pressure()
|
||||
var/old_heat_capacity = air.heat_capacity()
|
||||
var/reaction_efficency = min(1/((pressure/(0.1*ONE_ATMOSPHERE))*(max(cached_gases[/datum/gas/plasma][MOLES]/cached_gases[/datum/gas/nitrous_oxide][MOLES],1))),cached_gases[/datum/gas/nitrous_oxide][MOLES],cached_gases[/datum/gas/plasma][MOLES]/2)
|
||||
var/energy_released = 2*reaction_efficency*FIRE_CARBON_ENERGY_RELEASED
|
||||
if ((cached_gases[/datum/gas/nitrous_oxide][MOLES] - reaction_efficency < 0 )|| (cached_gases[/datum/gas/plasma][MOLES] - (2*reaction_efficency) < 0) || energy_released <= 0) //Shouldn't produce gas from nothing.
|
||||
var/reaction_efficency = min(1 / ((pressure / (0.1 * ONE_ATMOSPHERE)) * (max(cached_gases[/datum/gas/plasma][MOLES] / cached_gases[/datum/gas/nitrous_oxide][MOLES], 1))), cached_gases[/datum/gas/nitrous_oxide][MOLES], cached_gases[/datum/gas/plasma][MOLES] * 0.5)
|
||||
var/energy_released = 2 * reaction_efficency * FIRE_CARBON_ENERGY_RELEASED
|
||||
if ((cached_gases[/datum/gas/nitrous_oxide][MOLES] - reaction_efficency < 0 )|| (cached_gases[/datum/gas/plasma][MOLES] - (2 * reaction_efficency) < 0) || energy_released <= 0) //Shouldn't produce gas from nothing.
|
||||
return NO_REACTION
|
||||
ASSERT_GAS(/datum/gas/bz,air)
|
||||
cached_gases[/datum/gas/bz][MOLES] += reaction_efficency
|
||||
ASSERT_GAS(/datum/gas/bz, air)
|
||||
cached_gases[/datum/gas/bz][MOLES] += reaction_efficency * 2
|
||||
if(reaction_efficency == cached_gases[/datum/gas/nitrous_oxide][MOLES])
|
||||
ASSERT_GAS(/datum/gas/oxygen,air)
|
||||
cached_gases[/datum/gas/bz][MOLES] -= min(pressure,1)
|
||||
cached_gases[/datum/gas/oxygen][MOLES] += min(pressure,1)
|
||||
ASSERT_GAS(/datum/gas/oxygen, air)
|
||||
cached_gases[/datum/gas/bz][MOLES] -= min(pressure,0.5)
|
||||
cached_gases[/datum/gas/oxygen][MOLES] += min(pressure,0.5)
|
||||
cached_gases[/datum/gas/nitrous_oxide][MOLES] -= reaction_efficency
|
||||
cached_gases[/datum/gas/plasma][MOLES] -= 2*reaction_efficency
|
||||
cached_gases[/datum/gas/plasma][MOLES] -= 2 * reaction_efficency
|
||||
|
||||
SSresearch.science_tech.add_point_type(TECHWEB_POINT_TYPE_DEFAULT, min((reaction_efficency**2)*BZ_RESEARCH_SCALE),BZ_RESEARCH_MAX_AMOUNT)
|
||||
SSresearch.science_tech.add_point_type(TECHWEB_POINT_TYPE_DEFAULT, min((reaction_efficency**2) * BZ_RESEARCH_SCALE), BZ_RESEARCH_MAX_AMOUNT)
|
||||
|
||||
if(energy_released > 0)
|
||||
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)
|
||||
air.temperature = max(((temperature * old_heat_capacity + energy_released) / new_heat_capacity), TCMB)
|
||||
return REACTING
|
||||
|
||||
/datum/gas_reaction/metalhydrogen
|
||||
@@ -634,15 +634,15 @@ nobiliumsuppression = INFINITY
|
||||
if(pressure >= METAL_HYDROGEN_MINIMUM_PRESSURE && temperature >= METAL_HYDROGEN_MINIMUM_HEAT)
|
||||
cached_gases[/datum/gas/bz][MOLES] -= heat_efficency * 0.01
|
||||
if (prob(20 * increase_factor))
|
||||
cached_gases[/datum/gas/hydrogen][MOLES] -= heat_efficency * 10
|
||||
if (prob(60 / increase_factor))
|
||||
cached_gases[/datum/gas/hydrogen][MOLES] -= heat_efficency * 2.5
|
||||
if (prob(100 / increase_factor))
|
||||
new /obj/item/stack/sheet/mineral/metal_hydrogen(location)
|
||||
SSresearch.science_tech.add_point_type(TECHWEB_POINT_TYPE_DEFAULT, min((heat_efficency * increase_factor), METAL_HYDROGEN_RESEARCH_MAX_AMOUNT))
|
||||
SSresearch.science_tech.add_point_type(TECHWEB_POINT_TYPE_DEFAULT, min((heat_efficency * increase_factor * 0.5), METAL_HYDROGEN_RESEARCH_MAX_AMOUNT))
|
||||
|
||||
if(energy_used > 0)
|
||||
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)
|
||||
air.temperature = max(((temperature * old_heat_capacity - energy_used) / new_heat_capacity), TCMB)
|
||||
return REACTING
|
||||
|
||||
/datum/gas_reaction/freonformation
|
||||
@@ -662,9 +662,9 @@ nobiliumsuppression = INFINITY
|
||||
var/list/cached_gases = air.gases
|
||||
var/temperature = air.temperature
|
||||
var/old_heat_capacity = air.heat_capacity()
|
||||
var/heat_efficency = min(temperature/(FIRE_MINIMUM_TEMPERATURE_TO_EXIST * 10), cached_gases[/datum/gas/plasma][MOLES], cached_gases[/datum/gas/carbon_dioxide][MOLES], cached_gases[/datum/gas/bz][MOLES])
|
||||
var/heat_efficency = min(temperature / (FIRE_MINIMUM_TEMPERATURE_TO_EXIST * 10), cached_gases[/datum/gas/plasma][MOLES], cached_gases[/datum/gas/carbon_dioxide][MOLES], cached_gases[/datum/gas/bz][MOLES])
|
||||
var/energy_used = heat_efficency * 100
|
||||
ASSERT_GAS(/datum/gas/freon,air)
|
||||
ASSERT_GAS(/datum/gas/freon, air)
|
||||
if ((cached_gases[/datum/gas/plasma][MOLES] - heat_efficency * 5 < 0 ) || (cached_gases[/datum/gas/carbon_dioxide][MOLES] - heat_efficency < 0) || (cached_gases[/datum/gas/bz][MOLES] - heat_efficency * 0.25 < 0)) //Shouldn't produce gas from nothing.
|
||||
return NO_REACTION
|
||||
cached_gases[/datum/gas/plasma][MOLES] -= heat_efficency * 5
|
||||
@@ -675,7 +675,7 @@ nobiliumsuppression = INFINITY
|
||||
if(energy_used > 0)
|
||||
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)
|
||||
air.temperature = max(((temperature * old_heat_capacity - energy_used)/new_heat_capacity), TCMB)
|
||||
return REACTING
|
||||
|
||||
/datum/gas_reaction/stimformation //Stimulum formation follows a strange pattern of how effective it will be at a given temperature, having some multiple peaks and some large dropoffs. Exo and endo thermic.
|
||||
@@ -694,20 +694,20 @@ nobiliumsuppression = INFINITY
|
||||
var/list/cached_gases = air.gases
|
||||
|
||||
var/old_heat_capacity = air.heat_capacity()
|
||||
var/heat_scale = min(air.temperature/2500,cached_gases[/datum/gas/tritium][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)
|
||||
var/heat_scale = min(air.temperature / 2500, cached_gases[/datum/gas/tritium][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)
|
||||
ASSERT_GAS(/datum/gas/stimulum, air)
|
||||
if ((cached_gases[/datum/gas/tritium][MOLES] - heat_scale < 0 ) || (cached_gases[/datum/gas/nitryl][MOLES] - heat_scale < 0)) //Shouldn't produce gas from nothing.
|
||||
return NO_REACTION
|
||||
cached_gases[/datum/gas/stimulum][MOLES]+= heat_scale/10
|
||||
cached_gases[/datum/gas/tritium][MOLES] -= heat_scale
|
||||
cached_gases[/datum/gas/nitryl][MOLES] -= heat_scale
|
||||
SSresearch.science_tech.add_point_type(TECHWEB_POINT_TYPE_DEFAULT, STIMULUM_RESEARCH_AMOUNT*max(stim_energy_change,0))
|
||||
SSresearch.science_tech.add_point_type(TECHWEB_POINT_TYPE_DEFAULT, STIMULUM_RESEARCH_AMOUNT * max(stim_energy_change, 0))
|
||||
if(stim_energy_change)
|
||||
var/new_heat_capacity = air.heat_capacity()
|
||||
if(new_heat_capacity > MINIMUM_HEAT_CAPACITY)
|
||||
air.temperature = max(((air.temperature*old_heat_capacity + stim_energy_change)/new_heat_capacity),TCMB)
|
||||
air.temperature = max(((air.temperature * old_heat_capacity + stim_energy_change) / new_heat_capacity), TCMB)
|
||||
return REACTING
|
||||
|
||||
/datum/gas_reaction/nobliumformation //Hyper-Noblium formation is extrememly endothermic, but requires high temperatures to start. Due to its high mass, hyper-nobelium uses large amounts of nitrogen and tritium. BZ can be used as a catalyst to make it less endothermic.
|
||||
@@ -719,25 +719,25 @@ nobiliumsuppression = INFINITY
|
||||
min_requirements = list(
|
||||
/datum/gas/nitrogen = 10,
|
||||
/datum/gas/tritium = 5,
|
||||
"TEMP" = 5000000)
|
||||
"TEMP" = 50000)
|
||||
|
||||
/datum/gas_reaction/nobliumformation/react(datum/gas_mixture/air)
|
||||
var/list/cached_gases = air.gases
|
||||
air.assert_gases(/datum/gas/hypernoblium,/datum/gas/bz)
|
||||
air.assert_gases(/datum/gas/hypernoblium, /datum/gas/bz)
|
||||
var/old_heat_capacity = air.heat_capacity()
|
||||
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)))
|
||||
if ((cached_gases[/datum/gas/tritium][MOLES] - 10*nob_formed < 0) || (cached_gases[/datum/gas/nitrogen][MOLES] - 20*nob_formed < 0))
|
||||
var/nob_formed = min((cached_gases[/datum/gas/nitrogen][MOLES] + cached_gases[/datum/gas/tritium][MOLES]) * 0.01, cached_gases[/datum/gas/tritium][MOLES] * 0.1, cached_gases[/datum/gas/nitrogen][MOLES] * 0.2)
|
||||
var/energy_taken = nob_formed * (NOBLIUM_FORMATION_ENERGY / (max(cached_gases[/datum/gas/bz][MOLES], 1)))
|
||||
if ((cached_gases[/datum/gas/tritium][MOLES] - 10 * nob_formed < 0) || (cached_gases[/datum/gas/nitrogen][MOLES] - 20 * nob_formed < 0))
|
||||
return NO_REACTION
|
||||
cached_gases[/datum/gas/tritium][MOLES] -= 10*nob_formed
|
||||
cached_gases[/datum/gas/nitrogen][MOLES] -= 20*nob_formed
|
||||
cached_gases[/datum/gas/hypernoblium][MOLES]+= nob_formed
|
||||
SSresearch.science_tech.add_point_type(TECHWEB_POINT_TYPE_DEFAULT, nob_formed*NOBLIUM_RESEARCH_AMOUNT)
|
||||
cached_gases[/datum/gas/tritium][MOLES] -= 10 * nob_formed
|
||||
cached_gases[/datum/gas/nitrogen][MOLES] -= 20 * nob_formed
|
||||
cached_gases[/datum/gas/hypernoblium][MOLES] += nob_formed
|
||||
SSresearch.science_tech.add_point_type(TECHWEB_POINT_TYPE_DEFAULT, nob_formed * NOBLIUM_RESEARCH_AMOUNT)
|
||||
|
||||
if (nob_formed)
|
||||
var/new_heat_capacity = air.heat_capacity()
|
||||
if(new_heat_capacity > MINIMUM_HEAT_CAPACITY)
|
||||
air.temperature = max(((air.temperature*old_heat_capacity - energy_taken)/new_heat_capacity),TCMB)
|
||||
air.temperature = max(((air.temperature * old_heat_capacity - energy_taken) / new_heat_capacity), TCMB)
|
||||
|
||||
|
||||
/datum/gas_reaction/miaster //dry heat sterilization: clears out pathogens in the air
|
||||
@@ -754,13 +754,13 @@ nobiliumsuppression = INFINITY
|
||||
/datum/gas_reaction/miaster/react(datum/gas_mixture/air, datum/holder)
|
||||
var/list/cached_gases = air.gases
|
||||
// As the name says it, it needs to be dry
|
||||
if(cached_gases[/datum/gas/water_vapor] && cached_gases[/datum/gas/water_vapor][MOLES]/air.total_moles() > 0.1)
|
||||
if(cached_gases[/datum/gas/water_vapor] && cached_gases[/datum/gas/water_vapor][MOLES] / air.total_moles() > 0.1)
|
||||
return
|
||||
|
||||
//Replace miasma with oxygen
|
||||
var/cleaned_air = min(cached_gases[/datum/gas/miasma][MOLES], 20 + (air.temperature - FIRE_MINIMUM_TEMPERATURE_TO_EXIST - 70) / 20)
|
||||
cached_gases[/datum/gas/miasma][MOLES] -= cleaned_air
|
||||
ASSERT_GAS(/datum/gas/oxygen,air)
|
||||
ASSERT_GAS(/datum/gas/oxygen, air)
|
||||
cached_gases[/datum/gas/oxygen][MOLES] += cleaned_air
|
||||
|
||||
//Possibly burning a bit of organic matter through maillard reaction, so a *tiny* bit more heat would be understandable
|
||||
@@ -788,21 +788,21 @@ nobiliumsuppression = INFINITY
|
||||
location = get_turf(pick(pipenet.members))
|
||||
else
|
||||
location = get_turf(holder)
|
||||
air.assert_gases(/datum/gas/water_vapor,/datum/gas/nitryl,/datum/gas/carbon_dioxide,/datum/gas/nitrogen)
|
||||
var/ball_shot_angle = 180*cos(cached_gases[/datum/gas/water_vapor][MOLES]/cached_gases[/datum/gas/nitryl][MOLES])+180
|
||||
var/stim_used = min(STIM_BALL_GAS_AMOUNT/cached_gases[/datum/gas/plasma][MOLES],cached_gases[/datum/gas/stimulum][MOLES])
|
||||
var/pluox_used = min(STIM_BALL_GAS_AMOUNT/cached_gases[/datum/gas/plasma][MOLES],cached_gases[/datum/gas/pluoxium][MOLES])
|
||||
var/energy_released = stim_used*STIMULUM_HEAT_SCALE//Stimulum has a lot of stored energy, and breaking it up releases some of it
|
||||
air.assert_gases(/datum/gas/water_vapor, /datum/gas/nitryl, /datum/gas/carbon_dioxide, /datum/gas/nitrogen)
|
||||
var/ball_shot_angle = 180 * cos(cached_gases[/datum/gas/water_vapor][MOLES] / cached_gases[/datum/gas/nitryl][MOLES]) + 180
|
||||
var/stim_used = min(STIM_BALL_GAS_AMOUNT / cached_gases[/datum/gas/plasma][MOLES], cached_gases[/datum/gas/stimulum][MOLES])
|
||||
var/pluox_used = min(STIM_BALL_GAS_AMOUNT / cached_gases[/datum/gas/plasma][MOLES], cached_gases[/datum/gas/pluoxium][MOLES])
|
||||
var/energy_released = stim_used * STIMULUM_HEAT_SCALE//Stimulum has a lot of stored energy, and breaking it up releases some of it
|
||||
location.fire_nuclear_particle(ball_shot_angle)
|
||||
cached_gases[/datum/gas/carbon_dioxide][MOLES] += 4*pluox_used
|
||||
cached_gases[/datum/gas/nitrogen][MOLES] += 8*stim_used
|
||||
cached_gases[/datum/gas/carbon_dioxide][MOLES] += 0.5 * pluox_used
|
||||
cached_gases[/datum/gas/nitrogen][MOLES] += 2 * stim_used
|
||||
cached_gases[/datum/gas/pluoxium][MOLES] -= pluox_used
|
||||
cached_gases[/datum/gas/stimulum][MOLES] -= stim_used
|
||||
cached_gases[/datum/gas/plasma][MOLES] *= 0.5 //Consumes half the plasma each time.
|
||||
cached_gases[/datum/gas/plasma][MOLES] -= min(stim_used * pluox_used, 10)
|
||||
if(energy_released)
|
||||
var/new_heat_capacity = air.heat_capacity()
|
||||
if(new_heat_capacity > MINIMUM_HEAT_CAPACITY)
|
||||
air.temperature = clamp((air.temperature*old_heat_capacity + energy_released)/new_heat_capacity,TCMB,INFINITY)
|
||||
air.temperature = clamp((air.temperature * old_heat_capacity + energy_released) / new_heat_capacity, TCMB, INFINITY)
|
||||
return REACTING
|
||||
|
||||
/datum/gas_reaction/halon_formation
|
||||
@@ -824,7 +824,7 @@ nobiliumsuppression = INFINITY
|
||||
var/old_heat_capacity = air.heat_capacity()
|
||||
var/heat_efficency = min(temperature * 0.01, cached_gases[/datum/gas/tritium][MOLES], cached_gases[/datum/gas/bz][MOLES])
|
||||
var/energy_used = heat_efficency * 100
|
||||
ASSERT_GAS(/datum/gas/halon,air)
|
||||
ASSERT_GAS(/datum/gas/halon, air)
|
||||
if ((cached_gases[/datum/gas/tritium][MOLES] - heat_efficency * 5 < 0 ) || (cached_gases[/datum/gas/bz][MOLES] - heat_efficency * 0.25 < 0)) //Shouldn't produce gas from nothing.
|
||||
return NO_REACTION
|
||||
cached_gases[/datum/gas/tritium][MOLES] -= heat_efficency * 5
|
||||
@@ -834,7 +834,7 @@ nobiliumsuppression = INFINITY
|
||||
if(energy_used)
|
||||
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)
|
||||
air.temperature = max(((temperature * old_heat_capacity + energy_used) / new_heat_capacity), TCMB)
|
||||
return REACTING
|
||||
|
||||
/datum/gas_reaction/hexane_formation
|
||||
@@ -856,7 +856,7 @@ nobiliumsuppression = INFINITY
|
||||
var/old_heat_capacity = air.heat_capacity()
|
||||
var/heat_efficency = min(temperature * 0.01, cached_gases[/datum/gas/hydrogen][MOLES], cached_gases[/datum/gas/bz][MOLES])
|
||||
var/energy_used = heat_efficency * 100
|
||||
ASSERT_GAS(/datum/gas/hexane,air)
|
||||
ASSERT_GAS(/datum/gas/hexane, air)
|
||||
if ((cached_gases[/datum/gas/hydrogen][MOLES] - heat_efficency * 5 < 0 ) || (cached_gases[/datum/gas/bz][MOLES] - heat_efficency * 0.25 < 0)) //Shouldn't produce gas from nothing.
|
||||
return NO_REACTION
|
||||
cached_gases[/datum/gas/hydrogen][MOLES] -= heat_efficency * 5
|
||||
@@ -866,7 +866,7 @@ nobiliumsuppression = INFINITY
|
||||
if(energy_used)
|
||||
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)
|
||||
air.temperature = max(((temperature * old_heat_capacity + energy_used) / new_heat_capacity), TCMB)
|
||||
return REACTING
|
||||
|
||||
/datum/gas_reaction/healium_formation
|
||||
@@ -888,7 +888,7 @@ nobiliumsuppression = INFINITY
|
||||
var/old_heat_capacity = air.heat_capacity()
|
||||
var/heat_efficency = min(temperature * 0.3, cached_gases[/datum/gas/freon][MOLES], cached_gases[/datum/gas/bz][MOLES])
|
||||
var/energy_used = heat_efficency * 100
|
||||
ASSERT_GAS(/datum/gas/healium,air)
|
||||
ASSERT_GAS(/datum/gas/healium, air)
|
||||
if ((cached_gases[/datum/gas/freon][MOLES] - heat_efficency * 5 < 0 ) || (cached_gases[/datum/gas/bz][MOLES] - heat_efficency * 0.25 < 0)) //Shouldn't produce gas from nothing.
|
||||
return NO_REACTION
|
||||
cached_gases[/datum/gas/freon][MOLES] -= heat_efficency * 5
|
||||
@@ -898,7 +898,7 @@ nobiliumsuppression = INFINITY
|
||||
if(energy_used)
|
||||
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)
|
||||
air.temperature = max(((temperature * old_heat_capacity + energy_used) / new_heat_capacity), TCMB)
|
||||
return REACTING
|
||||
|
||||
/datum/gas_reaction/proto_nitrate_formation
|
||||
@@ -920,7 +920,7 @@ nobiliumsuppression = INFINITY
|
||||
var/old_heat_capacity = air.heat_capacity()
|
||||
var/heat_efficency = min(temperature * 0.005, cached_gases[/datum/gas/pluoxium][MOLES], cached_gases[/datum/gas/hydrogen][MOLES])
|
||||
var/energy_used = heat_efficency * 100
|
||||
ASSERT_GAS(/datum/gas/proto_nitrate,air)
|
||||
ASSERT_GAS(/datum/gas/proto_nitrate, air)
|
||||
if ((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.
|
||||
return NO_REACTION
|
||||
if(air.temperature >= 10000)
|
||||
@@ -932,7 +932,7 @@ nobiliumsuppression = INFINITY
|
||||
if(energy_used > 0)
|
||||
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)
|
||||
air.temperature = max(((temperature * old_heat_capacity + energy_used) / new_heat_capacity), TCMB)
|
||||
return REACTING
|
||||
|
||||
/datum/gas_reaction/cyrion_b_formation
|
||||
@@ -954,7 +954,7 @@ nobiliumsuppression = INFINITY
|
||||
var/old_heat_capacity = air.heat_capacity()
|
||||
var/heat_efficency = min(temperature * 0.005, cached_gases[/datum/gas/hypernoblium][MOLES], cached_gases[/datum/gas/stimulum][MOLES])
|
||||
var/energy_used = heat_efficency * 10
|
||||
ASSERT_GAS(/datum/gas/cyrion_b,air)
|
||||
ASSERT_GAS(/datum/gas/cyrion_b, air)
|
||||
if ((cached_gases[/datum/gas/hypernoblium][MOLES] - heat_efficency * 0.01 < 0 ) || (cached_gases[/datum/gas/stimulum][MOLES] - heat_efficency * 0.5 < 0)) //Shouldn't produce gas from nothing.
|
||||
return NO_REACTION
|
||||
if(air.temperature >= 290)
|
||||
@@ -966,7 +966,7 @@ nobiliumsuppression = INFINITY
|
||||
if(energy_used)
|
||||
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)
|
||||
air.temperature = max(((temperature * old_heat_capacity + energy_used) / new_heat_capacity), TCMB)
|
||||
return REACTING
|
||||
|
||||
/datum/gas_reaction/halon_o2removal
|
||||
@@ -987,7 +987,7 @@ nobiliumsuppression = INFINITY
|
||||
var/old_heat_capacity = air.heat_capacity()
|
||||
var/heat_efficency = min(temperature / ( FIRE_MINIMUM_TEMPERATURE_TO_EXIST * 10), cached_gases[/datum/gas/halon][MOLES], cached_gases[/datum/gas/oxygen][MOLES])
|
||||
var/energy_used = heat_efficency * 100
|
||||
ASSERT_GAS(/datum/gas/carbon_dioxide,air)
|
||||
ASSERT_GAS(/datum/gas/carbon_dioxide, air)
|
||||
if ((cached_gases[/datum/gas/halon][MOLES] - heat_efficency < 0 ) || (cached_gases[/datum/gas/oxygen][MOLES] - heat_efficency * 10 < 0)) //Shouldn't produce gas from nothing.
|
||||
return NO_REACTION
|
||||
cached_gases[/datum/gas/halon][MOLES] -= heat_efficency
|
||||
@@ -997,7 +997,7 @@ nobiliumsuppression = INFINITY
|
||||
if(energy_used)
|
||||
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)
|
||||
air.temperature = max(((temperature * old_heat_capacity - energy_used) / new_heat_capacity), TCMB)
|
||||
return REACTING
|
||||
|
||||
/datum/gas_reaction/hexane_plasma_filtering
|
||||
@@ -1017,7 +1017,7 @@ nobiliumsuppression = INFINITY
|
||||
var/old_heat_capacity = air.heat_capacity()
|
||||
var/heat_efficency = min(temperature * 0.01, cached_gases[/datum/gas/hexane][MOLES], cached_gases[/datum/gas/plasma][MOLES])
|
||||
var/energy_used = heat_efficency * 100
|
||||
ASSERT_GAS(/datum/gas/carbon_dioxide,air)
|
||||
ASSERT_GAS(/datum/gas/carbon_dioxide, air)
|
||||
if ((cached_gases[/datum/gas/hexane][MOLES] - heat_efficency * 0.2 < 0 ) || (cached_gases[/datum/gas/plasma][MOLES] - heat_efficency * 0.5 < 0)) //Shouldn't produce gas from nothing.
|
||||
return NO_REACTION
|
||||
cached_gases[/datum/gas/hexane][MOLES] -= heat_efficency * 0.2
|
||||
@@ -1027,7 +1027,7 @@ nobiliumsuppression = INFINITY
|
||||
if(energy_used)
|
||||
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)
|
||||
air.temperature = max(((temperature * old_heat_capacity + energy_used) / new_heat_capacity), TCMB)
|
||||
return REACTING
|
||||
|
||||
/datum/gas_reaction/hexane_n2o_filtering
|
||||
@@ -1047,8 +1047,8 @@ nobiliumsuppression = INFINITY
|
||||
var/old_heat_capacity = air.heat_capacity()
|
||||
var/heat_efficency = min(temperature * 0.01, cached_gases[/datum/gas/hexane][MOLES], cached_gases[/datum/gas/nitrous_oxide][MOLES])
|
||||
var/energy_used = heat_efficency * 100
|
||||
ASSERT_GAS(/datum/gas/oxygen,air)
|
||||
ASSERT_GAS(/datum/gas/nitrogen,air)
|
||||
ASSERT_GAS(/datum/gas/oxygen, air)
|
||||
ASSERT_GAS(/datum/gas/nitrogen, air)
|
||||
if ((cached_gases[/datum/gas/hexane][MOLES] - heat_efficency * 0.2 < 0 ) || (cached_gases[/datum/gas/nitrous_oxide][MOLES] - heat_efficency * 0.5 < 0)) //Shouldn't produce gas from nothing.
|
||||
return NO_REACTION
|
||||
cached_gases[/datum/gas/hexane][MOLES] -= heat_efficency * 0.2
|
||||
@@ -1059,7 +1059,7 @@ nobiliumsuppression = INFINITY
|
||||
if(energy_used)
|
||||
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)
|
||||
air.temperature = max(((temperature * old_heat_capacity + energy_used) / new_heat_capacity), TCMB)
|
||||
return REACTING
|
||||
|
||||
/datum/gas_reaction/cyrion_b_decomp
|
||||
|
||||
Reference in New Issue
Block a user