diff --git a/code/__DEFINES/atmospherics.dm b/code/__DEFINES/atmospherics.dm index 87f16da081..c919e0ff86 100644 --- a/code/__DEFINES/atmospherics.dm +++ b/code/__DEFINES/atmospherics.dm @@ -28,6 +28,7 @@ #define NORMPIPERATE 30 //pipe-insulation rate divisor #define HEATPIPERATE 8 //heat-exch pipe insulation #define FLOWFRAC 0.99 //fraction of gas transfered per process +#define TANK_MELT_TEMPERATURE 1000000 #define TANK_LEAK_PRESSURE (30.*ONE_ATMOSPHERE) //Tank starts leaking #define TANK_RUPTURE_PRESSURE (35.*ONE_ATMOSPHERE) //Tank spills all contents into atmosphere #define TANK_FRAGMENT_PRESSURE (40.*ONE_ATMOSPHERE) //Boom 3x3 base explosion diff --git a/code/game/objects/items/tanks/tanks.dm b/code/game/objects/items/tanks/tanks.dm index 513bdd2474..3d1c091a2b 100644 --- a/code/game/objects/items/tanks/tanks.dm +++ b/code/game/objects/items/tanks/tanks.dm @@ -233,6 +233,8 @@ return 0 var/pressure = air_contents.return_pressure() + var/temperature = air_contents.return_pressure() + if(pressure > TANK_FRAGMENT_PRESSURE) if(!istype(src.loc, /obj/item/device/transfer_valve)) message_admins("Explosive tank rupture! Last key to touch the tank was [src.fingerprintslast].") @@ -252,7 +254,7 @@ else qdel(src) - else if(pressure > TANK_RUPTURE_PRESSURE) + else if(pressure > TANK_RUPTURE_PRESSURE || temperature > TANK_MELT_TEMPERATURE) if(integrity <= 0) var/turf/T = get_turf(src) if(!T) diff --git a/code/game/turfs/open.dm b/code/game/turfs/open.dm index d227710b32..ae6aa0cb2d 100644 --- a/code/game/turfs/open.dm +++ b/code/game/turfs/open.dm @@ -355,3 +355,11 @@ if(wet_overlay) cut_overlay(wet_overlay) + +/turf/open/rad_act(pulse_strength) + if (air.gases[/datum/gas/carbon_dioxide] && air.gases[/datum/gas/oxygen]) + air.gases[/datum/gas/carbon_dioxide][MOLES]=max(air.gases[/datum/gas/carbon_dioxide][MOLES]-(pulse_strength/1000),0) + air.gases[/datum/gas/oxygen][MOLES]=max(air.gases[/datum/gas/oxygen][MOLES]-(pulse_strength/2000),0) + ASSERT_GAS(/datum/gas/pluoxium,air) + air.gases[/datum/gas/pluoxium][MOLES]+=(pulse_strength/4000) + air.garbage_collect() \ No newline at end of file diff --git a/code/modules/atmospherics/environmental/LINDA_fire.dm b/code/modules/atmospherics/environmental/LINDA_fire.dm index 58edfaae94..ca234308d8 100644 --- a/code/modules/atmospherics/environmental/LINDA_fire.dm +++ b/code/modules/atmospherics/environmental/LINDA_fire.dm @@ -1,3 +1,5 @@ + + /atom/proc/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume) return null @@ -94,7 +96,7 @@ AT.fire_act(temperature, volume) return - +#define INSUFFICIENT(path) (!location.air.gases[path] || location.air.gases[path][MOLES] < 0.5) /obj/effect/hotspot/process() if(just_spawned) just_spawned = FALSE @@ -111,9 +113,7 @@ if((temperature < FIRE_MINIMUM_TEMPERATURE_TO_EXIST) || (volume <= 1)) qdel(src) return - - //Nothing to burn - if(!(location.air) || !(location.air.gases[/datum/gas/plasma] || location.air.gases[/datum/gas/tritium]) || !location.air.gases[/datum/gas/oxygen]) + if(!location.air || (INSUFFICIENT(/datum/gas/plasma) && INSUFFICIENT(/datum/gas/tritium)) || INSUFFICIENT(/datum/gas/oxygen)) qdel(src) return @@ -190,3 +190,4 @@ . = ..() if(!isliving(loc)) return INITIALIZE_HINT_QDEL +#undef INSUFFICIENT \ No newline at end of file diff --git a/code/modules/atmospherics/gasmixtures/reactions.dm b/code/modules/atmospherics/gasmixtures/reactions.dm index bcb2f75bb4..07339807da 100644 --- a/code/modules/atmospherics/gasmixtures/reactions.dm +++ b/code/modules/atmospherics/gasmixtures/reactions.dm @@ -26,8 +26,9 @@ #define MAX_CATALYST_EFFICENCY 9 #define PLASMA_FUSED_COEFFICENT 0.08 #define CATALYST_COEFFICENT 0.01 -#define FUSION_PURITY_THRESHOLD 0.9 +#define FUSION_PURITY_THRESHOLD 0.95 #define FUSION_HEAT_DROPOFF 20000+T0C +#define NOBLIUM_FORMATION_ENERGY 2e9 //1 Mole of Noblium takes the planck energy to condense. /datum/controller/subsystem/air/var/list/gas_reactions //this is our singleton of all reactions /proc/init_gas_reactions() @@ -197,7 +198,7 @@ /datum/gas/tritium = MINIMUM_HEAT_CAPACITY ) -/datum/gas_reaction/fusion/react(datum/gas_mixture/air) +/datum/gas_reaction/fusion/react(datum/gas_mixture/air, turf/open/location) var/list/cached_gases = air.gases var/temperature = air.temperature @@ -210,22 +211,23 @@ 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/plasma_fused = (PLASMA_FUSED_COEFFICENT*catalyst_efficency)*(temperature/PLASMA_BINDING_ENERGY)*4 - var/tritium_catalyzed = (CATALYST_COEFFICENT*catalyst_efficency)*(temperature/PLASMA_BINDING_ENERGY) + 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/oxygen_added = tritium_catalyzed - var/waste_added = (plasma_fused-oxygen_added)-((air.total_moles()*air.heat_capacity())/PLASMA_BINDING_ENERGY) + 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) - air.assert_gases(/datum/gas/oxygen, /datum/gas/nitrogen, /datum/gas/water_vapor, /datum/gas/nitrous_oxide, /datum/gas/nitryl) + 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. cached_gases[/datum/gas/plasma][MOLES] = max(cached_gases[/datum/gas/plasma][MOLES] - plasma_fused,0) cached_gases[/datum/gas/tritium][MOLES] = max(cached_gases[/datum/gas/tritium][MOLES] - tritium_catalyzed,0) cached_gases[/datum/gas/oxygen][MOLES] += oxygen_added - cached_gases[/datum/gas/nitrogen][MOLES] += waste_added cached_gases[/datum/gas/water_vapor][MOLES] += waste_added cached_gases[/datum/gas/nitrous_oxide][MOLES] += waste_added cached_gases[/datum/gas/nitryl][MOLES] += waste_added - + cached_gases[/datum/gas/carbon_dioxide][MOLES] += waste_added + if (location) + radiation_pulse(location, reaction_energy/(PLASMA_BINDING_ENERGY*MAX_CATALYST_EFFICENCY)) if(reaction_energy > 0) var/new_heat_capacity = air.heat_capacity() if(new_heat_capacity > MINIMUM_HEAT_CAPACITY) @@ -288,8 +290,8 @@ ASSERT_GAS(/datum/gas/bz,air) cached_gases[/datum/gas/bz][MOLES]+= reaction_efficency - cached_gases[/datum/gas/tritium][MOLES] = max(cached_gases[/datum/gas/tritium][MOLES]- 2*reaction_efficency,0) - cached_gases[/datum/gas/plasma][MOLES] = max(cached_gases[/datum/gas/plasma][MOLES] - reaction_efficency,0) + cached_gases[/datum/gas/tritium][MOLES] = max(cached_gases[/datum/gas/tritium][MOLES]- reaction_efficency,0) + cached_gases[/datum/gas/plasma][MOLES] = max(cached_gases[/datum/gas/plasma][MOLES] - (2*reaction_efficency),0) if(energy_released > 0) @@ -346,7 +348,7 @@ 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/energy_taken = nob_formed*(10000000/(max(cached_gases[/datum/gas/bz][MOLES],1))) + 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) cached_gases[/datum/gas/hypernoblium][MOLES]+= nob_formed @@ -356,6 +358,8 @@ 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) + + #undef REACTING #undef NO_REACTION #undef OXYGEN_BURN_RATE_BASE @@ -381,4 +385,5 @@ #undef PLASMA_FUSED_COEFFICENT #undef CATALYST_COEFFICENT #undef FUSION_PURITY_THRESHOLD -#undef FUSION_HEAT_DROPOFF \ No newline at end of file +#undef FUSION_HEAT_DROPOFF +#undef NOBLIUM_FORMATION_ENERGY \ No newline at end of file diff --git a/code/modules/power/singularity/collector.dm b/code/modules/power/singularity/collector.dm index 2e92aa92aa..0ede336ef6 100644 --- a/code/modules/power/singularity/collector.dm +++ b/code/modules/power/singularity/collector.dm @@ -37,6 +37,8 @@ eject() else loaded_tank.air_contents.gases[/datum/gas/plasma][MOLES] -= 0.001*drainratio + ASSERT_GAS(/datum/gas/tritium,loaded_tank.air_contents) + loaded_tank.air_contents.gases[/datum/gas/tritium][MOLES] += 0.001*drainratio loaded_tank.air_contents.garbage_collect() var/power_produced = min(last_power, (last_power*RAD_COLLECTOR_STORED_OUT)+1000) //Produces at least 1000 watts if it has more than that stored