From 5ee5efbcd8353dc3853792eddfeafaa59cfc222b Mon Sep 17 00:00:00 2001 From: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com> Date: Sat, 22 Jan 2022 23:46:15 -0800 Subject: [PATCH] Hopefully fixes another source of long timer singlecaps (#64316) * Hopefully fixes another source of long timer singlecaps Very similar to 87fbe4c205313f758f0a98974f7fe18f9a82bbb5 (#62415) Got a ping from mothblocks complaining about "Mass bombing" and "Unplayable rounds" on sybil, caused by long timer singlecaps. I'm like 90% sure they're using bz's slow heating to achieve this. So I'm just gonna cap bz production at 20 degress above room temp. It's not like you're going to be doing fabrication at this temperature anyway, so this isn't horribly impactful. For the curious among you, bz scales its temperature increase inversely to its pressure, among other factors. This scaling is VERY harsh, so at high pressures it barely creates any heat at all. Insert discussion of single caps, cursed problems, and salt prs here. Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com> --- code/__HELPERS/_logging.dm | 9 +++++++++ code/game/objects/items/tanks/tanks.dm | 1 + code/modules/atmospherics/gasmixtures/reactions.dm | 4 +++- 3 files changed, 13 insertions(+), 1 deletion(-) 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.