diff --git a/GainStation13/code/mechanics/fattening_gasses.dm b/GainStation13/code/mechanics/fattening_gasses.dm index f376645b05..216f105fb1 100644 --- a/GainStation13/code/mechanics/fattening_gasses.dm +++ b/GainStation13/code/mechanics/fattening_gasses.dm @@ -1,26 +1,24 @@ /obj/item/organ/lungs/proc/lipoifium_breathing(datum/gas_mixture/breath, mob/living/carbon/human/H) - if(breath) - var/pressure = breath.return_pressure() - var/total_moles = breath.total_moles() - var/lipoifium_moles = breath.get_moles(GAS_FAT) - #define PP_MOLES(X) ((X / total_moles) * pressure) - var/gas_breathed = PP_MOLES(lipoifium_moles) // this does the same thing as the bit below but I think this is more readable - // #define PP(air, gas) PP_MOLES(air.get_moles(gas)) - // var/gas_breathed = PP(breath, GAS_FAT) - if(gas_breathed > 0) - // listen I know I can debug this but sometimes having this show up in chat without a pause is more convenient - // message_admins("Lipoifium pp is [gas_breathed]") - // message_admins("Lipoifium moles are [lipoifium_moles]") - H.adjust_fatness(2 * gas_breathed, FATTENING_TYPE_ATMOS) - breath.adjust_moles(GAS_FAT, -gas_breathed) - // TODO: the entire code below is 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 - // I do not know what kind of spaghetti coding must be going on there, but I pray god has in his - // care the poor sods who have to work on that - var/smell_chance = min(lipoifium_moles * 100 / total_moles, 20) - if(prob(smell_chance)) - to_chat(owner, "You can smell lard.") + if(!breath) + return + + if(breath.total_moles() == 0) + return + + 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 + if(lipoifium_moles <= 0) + return + + H.adjust_fatness(lipoifium_moles * 1500, FATTENING_TYPE_ATMOS) + breath.set_moles(GAS_FAT, 0) + // TODO: the entire code below is 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) + if(prob(smell_chance)) + to_chat(owner, "You can smell lard.") /obj/item/organ/lungs/check_breath(datum/gas_mixture/breath, mob/living/carbon/human/H)