From b078ff772d5b9314288e5f90f633a55212ffac74 Mon Sep 17 00:00:00 2001 From: Guti <32563288+TheCaramelion@users.noreply.github.com> Date: Mon, 15 Sep 2025 00:44:33 +0200 Subject: [PATCH] Gives internal organs passive regeneration (#18470) * Organ heal * Changes * Use the config --- code/modules/organs/internal/_organ_internal.dm | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/code/modules/organs/internal/_organ_internal.dm b/code/modules/organs/internal/_organ_internal.dm index 6c665470545..9756182e5e1 100644 --- a/code/modules/organs/internal/_organ_internal.dm +++ b/code/modules/organs/internal/_organ_internal.dm @@ -5,12 +5,26 @@ var/dead_icon // Icon to use when the organ has died. var/supply_conversion_value = 0 + var/healing_factor = 0.005 // How much this organ will heal passively /obj/item/organ/internal/Initialize(mapload, internal) . = ..() if(supply_conversion_value) AddElement(/datum/element/sellable/organ) +/obj/item/organ/internal/process() + ..() + passive_heal() + +// Heals the internal organ passively as long as it's under the bruised threshold +// Not a lot of MATH just yet, but nutrition or other factors could be taken into account +/obj/item/organ/internal/proc/passive_heal() + if(!is_bruised() && !is_broken()) + return + + var/heal_amt = healing_factor * CONFIG_GET(number/organ_regeneration_multiplier) + damage = max(damage - heal_amt, 0) + /obj/item/organ/internal/die() ..() if((status & ORGAN_DEAD) && dead_icon)