From 872187afbc0f985ec1272f4e7c72b4ee4ca350f2 Mon Sep 17 00:00:00 2001 From: Phantastic-Swan Date: Wed, 6 Aug 2025 20:25:52 +0200 Subject: [PATCH 1/2] added defines and undefines for PP_MOLES since we lacked them here for some reason??? --- GainStation13/code/mechanics/water_sponge.dm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/GainStation13/code/mechanics/water_sponge.dm b/GainStation13/code/mechanics/water_sponge.dm index b43fc4f2c8..b2e2151ff8 100644 --- a/GainStation13/code/mechanics/water_sponge.dm +++ b/GainStation13/code/mechanics/water_sponge.dm @@ -49,9 +49,11 @@ if(breath) var/pressure = breath.return_pressure() var/total_moles = breath.total_moles() - //#define PP_MOLES(X) ((X / total_moles) * pressure) + #define PP_MOLES(X) ((X / total_moles) * pressure) #define PP(air, gas) PP_MOLES(air.get_moles(gas)) var/gas_breathed = PP(breath,GAS_H2O) + #undef PP_MOLES + #undef PP if(gas_breathed > 0) H.reagents.add_reagent(/datum/reagent/water, gas_breathed) breath.adjust_moles(GAS_H2O, -gas_breathed) From 082693d90df3b1c9b285e69d869f587a0e016e17 Mon Sep 17 00:00:00 2001 From: Phantastic-Swan Date: Wed, 6 Aug 2025 20:26:43 +0200 Subject: [PATCH 2/2] makes lipoifium easier to obtain, tweaks the formula for calculating BFI gained, as well as making it invisible --- .../code/mechanics/fattening_gasses.dm | 15 ++++++++----- .../modules/atmospherics/auxgm/gas_types.dm | 4 ++-- .../atmospherics/gasmixtures/reactions.dm | 21 ++++++++++++------- 3 files changed, 26 insertions(+), 14 deletions(-) diff --git a/GainStation13/code/mechanics/fattening_gasses.dm b/GainStation13/code/mechanics/fattening_gasses.dm index 216f105fb1..829c7e65b4 100644 --- a/GainStation13/code/mechanics/fattening_gasses.dm +++ b/GainStation13/code/mechanics/fattening_gasses.dm @@ -7,18 +7,23 @@ var/total_moles = breath.total_moles() var/lipoifium_moles = breath.get_moles(GAS_FAT) - #define PP_MOLES(X) ((X / total_moles) * pressure) // this needs to be here because spaghetti, I'm sorry + var/pressure = breath.return_pressure() + var/lipoifium_partial_pressure = pressure * lipoifium_moles / total_moles + // #define PP_MOLES(X) ((X / total_moles) * pressure) // this needs to be here because spaghetti, I'm sorry if(lipoifium_moles <= 0) return - H.adjust_fatness(lipoifium_moles * 1500, FATTENING_TYPE_ATMOS) + var/fatness_to_add = lipoifium_moles * 150 // each mole gives 150 BFI. Now, you may think that that's A METRIC FUCKTON, but in reality, because lungs by default are 0.5 liters, at 20C 101.325 kPa that's just 0.02 moles + fatness_to_add *= 10 * lipoifium_moles / total_moles + H.adjust_fatness(fatness_to_add + 5, FATTENING_TYPE_ATMOS) breath.set_moles(GAS_FAT, 0) - // TODO: the entire code below is a workaround for default odor not working + // TODO: the 3 lines below are a workaround for default odor not working // The problem seems to be auxmos'es get_gasses function not acknowledging that lipoifium exists // which is strange, considering that everything else regarding this gas and auxmos works - var/smell_chance = min(lipoifium_moles * 100 / total_moles, 20) + var/smell_chance = clamp((lipoifium_partial_pressure - 100) / 2.5, 0, 20) + // var/smell_chance = min(lipoifium_moles * 100 / total_moles, 5) if(prob(smell_chance)) - to_chat(owner, "You can smell lard.") + to_chat(owner, "" + pick("You can smell lard.", "Your clothes feel tight.", "You can feel yourself expand.") + "") /obj/item/organ/lungs/check_breath(datum/gas_mixture/breath, mob/living/carbon/human/H) diff --git a/GainStation13/code/modules/atmospherics/auxgm/gas_types.dm b/GainStation13/code/modules/atmospherics/auxgm/gas_types.dm index 16d4690100..c4c154f4de 100644 --- a/GainStation13/code/modules/atmospherics/auxgm/gas_types.dm +++ b/GainStation13/code/modules/atmospherics/auxgm/gas_types.dm @@ -2,8 +2,8 @@ id = GAS_FAT specific_heat = 20 name = "Lipoifium" - moles_visible = MOLES_GAS_VISIBLE - color = "#e2e1b1" + // moles_visible = MOLES_GAS_VISIBLE + // color = "#e2e1b1" odor = "that this is a function that wasn't working, but it now, for some reason, is. You should speak to the gods about this and the conditions under which it happened" odor_strength = 1 // TODO: doesn't work for now diff --git a/GainStation13/code/modules/atmospherics/gasmixtures/reactions.dm b/GainStation13/code/modules/atmospherics/gasmixtures/reactions.dm index 4be7b5f717..d758e72140 100644 --- a/GainStation13/code/modules/atmospherics/gasmixtures/reactions.dm +++ b/GainStation13/code/modules/atmospherics/gasmixtures/reactions.dm @@ -6,13 +6,16 @@ /datum/gas_reaction/lipoifium_formation/init_reqs() min_requirements = list( "MAX_TEMP" = 100, - GAS_BZ = 15, - GAS_TRITIUM = 15 + GAS_PLASMA = MINIMUM_MOLE_COUNT, + GAS_TRITIUM = MINIMUM_MOLE_COUNT ) /datum/gas_reaction/lipoifium_formation/react(datum/gas_mixture/air) - if (air.get_moles(GAS_BZ) < 15 || air.get_moles(GAS_TRITIUM) < 15) + var/plasma_moles = air.get_moles(GAS_PLASMA) + var/tritium_moles = air.get_moles(GAS_TRITIUM) + if (plasma_moles < MINIMUM_MOLE_COUNT || tritium_moles < MINIMUM_MOLE_COUNT) return NO_REACTION + var/temperature = air.return_temperature() var/reaction_efficiency = 0 if (temperature <= 5) @@ -22,11 +25,15 @@ else reaction_efficiency = -((temperature - 5) / 95) + 1 // will equal 1 at 5 kelvin, and will linearly fall until 0 at 100k - var/energy_released = reaction_efficiency * FIRE_CARBON_ENERGY_RELEASED + var/old_heat_capacity = air.heat_capacity() - air.adjust_moles(GAS_FAT, reaction_efficiency) - air.adjust_moles(GAS_TRITIUM, -reaction_efficiency / 2) - air.adjust_moles(GAS_BZ, -reaction_efficiency / 2) + + var/used_moles = min((reaction_efficiency * min(plasma_moles, tritium_moles) * 0.5), 10) + var/energy_released = used_moles * FIRE_CARBON_ENERGY_RELEASED + + air.adjust_moles(GAS_FAT, used_moles) + air.adjust_moles(GAS_TRITIUM, -used_moles) + air.adjust_moles(GAS_PLASMA, -used_moles) var/new_heat_capacity = air.heat_capacity() air.set_temperature(max((temperature * old_heat_capacity + energy_released) / new_heat_capacity, TCMB))