diff --git a/code/__HELPERS/_logging.dm b/code/__HELPERS/_logging.dm index d7f087523bb..05f2cd76798 100644 --- a/code/__HELPERS/_logging.dm +++ b/code/__HELPERS/_logging.dm @@ -166,6 +166,15 @@ GLOBAL_LIST_INIT(testing_global_profiler, list("_PROFILE_NAME" = "Global")) if(message_admins) message_admins("[user ? "[ADMIN_LOOKUPFLW(user)] at [ADMIN_VERBOSEJMP(user)] " : ""][details][bomb ? " [bomb.name] at [ADMIN_VERBOSEJMP(bomb)]": ""][additional_details ? " [additional_details]" : ""].") +/// Logs the contents of the gasmix to the game log, prefixed by text +/proc/log_atmos(text, datum/gas_mixture/mix) + var/message = text + message += "TEMP=[mix.temperature],MOL=[mix.total_moles()],VOL=[mix.volume]" + for(var/key in mix.gases) + var/list/gaslist = mix.gases[key] + message += "[gaslist[GAS_META][META_GAS_ID]]=[gaslist[MOLES]];" + log_game(message) + /proc/log_say(text) if (CONFIG_GET(flag/log_say)) WRITE_LOG(GLOB.world_game_log, "SAY: [text]") diff --git a/code/game/objects/items/tanks/tanks.dm b/code/game/objects/items/tanks/tanks.dm index 43a3e5779d3..d8b7fd91763 100644 --- a/code/game/objects/items/tanks/tanks.dm +++ b/code/game/objects/items/tanks/tanks.dm @@ -320,6 +320,7 @@ // As of writing this this is calibrated to maxcap at 140L and 160atm. var/power = (air_contents.volume * (pressure - TANK_FRAGMENT_PRESSURE)) / TANK_FRAGMENT_SCALE + log_atmos("[type] exploded with a power of [power] and a mix of ", air_contents) dyn_explosion(src, power, flash_range = 1.5, ignorecap = FALSE) return ..() diff --git a/code/modules/atmospherics/gasmixtures/reactions.dm b/code/modules/atmospherics/gasmixtures/reactions.dm index 87b0012f3cc..b6476d44764 100644 --- a/code/modules/atmospherics/gasmixtures/reactions.dm +++ b/code/modules/atmospherics/gasmixtures/reactions.dm @@ -485,7 +485,8 @@ /datum/gas_reaction/bzformation/init_reqs() requirements = list( /datum/gas/nitrous_oxide = 10, - /datum/gas/plasma = 10 + /datum/gas/plasma = 10, + "MAX_TEMP" = T20C + 20 // Yes, someone used this as a bomb timer. I hate players ) /datum/gas_reaction/bzformation/react(datum/gas_mixture/air) @@ -493,6 +494,7 @@ var/temperature = air.temperature var/pressure = air.return_pressure() var/old_heat_capacity = air.heat_capacity() + // This slows down in relation to pressure, very quickly. Please don't expect it to be anything more then a snail 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] * INVERSE(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.