Merge pull request #193 from Phantastic-Swan/lipoifium_update

Lipoifium update
This commit is contained in:
evilew
2025-08-08 17:52:19 -05:00
committed by GitHub
4 changed files with 29 additions and 15 deletions
@@ -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, "<span class='notice'>You can smell lard.</span>")
to_chat(owner, "<span class='notice'>" + pick("You can smell lard.", "Your clothes feel tight.", "You can feel yourself expand.") + "</span>")
/obj/item/organ/lungs/check_breath(datum/gas_mixture/breath, mob/living/carbon/human/H)
+3 -1
View File
@@ -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)
@@ -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
@@ -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))