Files
Bubberstation/code/__HELPERS/logging/atmos.dm
SkyratBot 9bd67f0203 [MIRROR] Adds and improves logging for various shit. (#26831)
* Adds and improves logging for various shit. (#81738)

## About The Pull Request
Adds logging for RCD construction and deconstruction. Hallucinated
projectiles no longer causes logs. Flamethrowers log gas mixture
information, the flamethrower, the gas tank, tank distribution pressure
and whether it was lit. Adds a lot more logging to records consoles.
Frozen objects now log when they get shattered.
## Why It's Good For The Game
Closes #68452
Closes #71798
Closes #78008
Closes #81098
Closes #81130
## Changelog
🆑 Pickle-Coding and Rhials
admin: RCD construction and deconstruction are logged.
admin: Hallucinated projectiles no longer log.
admin: Gives more detail to flamethrower logging.
admin: More actions are logged for records consoles usage.
admin: Frozen object shattering is logged.
/🆑

---------

Co-authored-by: Rhials <Datguy33456@ gmail.com>

* Adds and improves logging for various shit.

---------

Co-authored-by: Pickle-Coding <58013024+Pickle-Coding@users.noreply.github.com>
Co-authored-by: Rhials <Datguy33456@ gmail.com>
2024-03-11 22:35:39 -04:00

49 lines
1.7 KiB
Plaintext

/// Logs the contents of the gasmix to the game log, prefixed by text
/proc/log_atmos(text, datum/gas_mixture/gas_mixture)
var/message = "[text]\"[print_gas_mixture(gas_mixture)]\""
//Cache commonly accessed information.
var/list/gases = gas_mixture.gases //List of gas datum paths that are associated with a list of information related to the gases.
var/heat_capacity = gas_mixture.heat_capacity()
var/temperature = gas_mixture.return_temperature()
var/thermal_energy = temperature * heat_capacity
var/volume = gas_mixture.return_volume()
var/pressure = gas_mixture.return_pressure()
var/total_moles = gas_mixture.total_moles()
///The total value of the gas mixture in credits.
var/total_value = 0
var/list/specific_gas_data = list()
//Gas specific information assigned to each gas.
for(var/datum/gas/gas_path as anything in gases)
var/list/gas = gases[gas_path]
var/moles = gas[MOLES]
var/composition = moles / total_moles
var/energy = temperature * moles * gas[GAS_META][META_GAS_SPECIFIC_HEAT]
var/value = initial(gas_path.base_value) * moles
total_value += value
specific_gas_data[gas[GAS_META][META_GAS_NAME]] = list(
"moles" = moles,
"composition" = composition,
"molar concentration" = moles / volume,
"partial pressure" = composition * pressure,
"energy" = energy,
"energy density" = energy / volume,
"value" = value,
)
log_game(
message,
data = list(
"total moles" = total_moles,
"volume" = volume,
"molar density" = total_moles / volume,
"temperature" = temperature,
"pressure" = pressure,
"heat capacity" = heat_capacity,
"energy" = thermal_energy,
"energy density" = thermal_energy / volume,
"value" = total_value,
"gases" = specific_gas_data,
)
)