From 60e6610c095cf4f9f4c44abe93a5bd17a4e15180 Mon Sep 17 00:00:00 2001 From: CRUNCH <143041327+Fordoxia@users.noreply.github.com> Date: Tue, 2 Sep 2025 16:04:31 +0100 Subject: [PATCH] Gives `TRAIT_NOFAT` to IPCs, making them immune to becoming fat. Also makes IPCs unable to be overfed. (#30238) * Update machine.dm * Update machine.dm * Update ai_programs.dm * Update code/modules/mob/living/carbon/human/species/machine.dm Co-authored-by: PollardTheDragon <144391971+PollardTheDragon@users.noreply.github.com> Signed-off-by: CRUNCH <143041327+Fordoxia@users.noreply.github.com> --------- Signed-off-by: CRUNCH <143041327+Fordoxia@users.noreply.github.com> Co-authored-by: PollardTheDragon <144391971+PollardTheDragon@users.noreply.github.com> --- .../mob/living/carbon/human/species/machine.dm | 11 +++++++++-- code/modules/mob/living/silicon/ai/ai_programs.dm | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/code/modules/mob/living/carbon/human/species/machine.dm b/code/modules/mob/living/carbon/human/species/machine.dm index 75d07d6269a..5be2603a393 100644 --- a/code/modules/mob/living/carbon/human/species/machine.dm +++ b/code/modules/mob/living/carbon/human/species/machine.dm @@ -21,7 +21,7 @@ death_sounds = list('sound/voice/borg_deathsound.ogg') //I've made this a list in the event we add more sounds for dead robots. species_traits = list(NO_BLOOD, NO_CLONESCAN, NO_INTORGANS) - inherent_traits = list(TRAIT_VIRUSIMMUNE, TRAIT_NOBREATH, TRAIT_NOGERMS, TRAIT_NODECAY, TRAIT_NOPAIN, TRAIT_GENELESS) //Computers that don't decay? What a lie! + inherent_traits = list(TRAIT_VIRUSIMMUNE, TRAIT_NOBREATH, TRAIT_NOGERMS, TRAIT_NODECAY, TRAIT_NOPAIN, TRAIT_GENELESS, TRAIT_NOFAT) // Computers that don't decay? What a lie! inherent_biotypes = MOB_ROBOTIC | MOB_HUMANOID clothing_flags = HAS_UNDERWEAR | HAS_UNDERSHIRT | HAS_SOCKS bodyflags = HAS_SKIN_COLOR | HAS_HEAD_MARKINGS | HAS_HEAD_ACCESSORY | ALL_RPARTS | SHAVED @@ -115,12 +115,19 @@ ..() if(isLivingSSD(H)) // We don't want AFK people dying from this return + if(H.nutrition >= NUTRITION_LEVEL_HYPOGLYCEMIA) return + // We invented surge protectors and power monitors for just this occasion. + if(H.nutrition >= NUTRITION_LEVEL_FAT) + H.nutrition = NUTRITION_LEVEL_FULL + return + var/obj/item/organ/internal/cell/microbattery = H.get_organ_slot("heart") if(!istype(microbattery)) //Maybe they're powered by an abductor gland or sheer force of will return + if(prob(6)) to_chat(H, "Error 74: Microbattery critical malfunction, likely cause: Extended strain.") microbattery.receive_damage(4, TRUE) @@ -189,7 +196,7 @@ /datum/species/machine/spec_electrocute_act(mob/living/carbon/human/H, shock_damage, source, siemens_coeff, flags) if(flags & SHOCK_ILLUSION) return - H.adjust_nutrition(shock_damage) + H.adjust_nutrition(clamp(shock_damage, 0, (NUTRITION_LEVEL_FULL - H.nutrition))) /datum/species/machine/handle_mutations_and_radiation(mob/living/carbon/human/H) H.adjustBrainLoss(H.radiation / 100) diff --git a/code/modules/mob/living/silicon/ai/ai_programs.dm b/code/modules/mob/living/silicon/ai/ai_programs.dm index 58af60a0b77..a136eaf8514 100644 --- a/code/modules/mob/living/silicon/ai/ai_programs.dm +++ b/code/modules/mob/living/silicon/ai/ai_programs.dm @@ -413,7 +413,7 @@ T.cell.give(power_sent) if(ismachineperson(target)) var/mob/living/carbon/human/machine/T = target - T.adjust_nutrition(AI.adapter_efficiency * (power_sent / 10)) + T.adjust_nutrition(clamp(AI.adapter_efficiency * (power_sent / 10), 0, (NUTRITION_LEVEL_FULL - T.nutrition))) // Handles draining the SMES for(var/obj/machinery/power/smes/power_source in A)