diff --git a/modular_zzplurt/code/datums/quirks/positive_quirks/restorative_metabolism.dm b/modular_zzplurt/code/datums/quirks/positive_quirks/restorative_metabolism.dm index a01d7ec28acc6..c3d0573adc4fb 100644 --- a/modular_zzplurt/code/datums/quirks/positive_quirks/restorative_metabolism.dm +++ b/modular_zzplurt/code/datums/quirks/positive_quirks/restorative_metabolism.dm @@ -1,6 +1,13 @@ +#define RESTMETA_BRUTE_THRESHOLD 50 +#define RESTMETA_BRUTE_AMOUNT -0.5 +#define RESTMETA_BURN_THRESHOLD 50 +#define RESTMETA_BURN_AMOUNT -0.25 +#define RESTMETA_TOX_THRESHOLD 50 +#define RESTMETA_TOX_AMOUNT -0.3 + /datum/quirk/restorative_metabolism name = "Restorative Metabolism" - desc = "Your body possesses a differentiated reconstructive ability, allowing you to slowly recover from injuries. Critical injuries, wounds, and genetic damage will still require medical attention." + desc = "Your body possesses a differentiated reconstructive ability, allowing you to slowly recover from light to moderate injuries. Critical injuries, wounds, and genetic damage will still require medical attention." value = 10 quirk_flags = QUIRK_PROCESSES gain_text = span_notice("You feel a surge of reconstructive vitality coursing through your body...") @@ -11,12 +18,34 @@ icon = FA_ICON_NOTES_MEDICAL /datum/quirk/restorative_metabolism/process(seconds_per_tick) - var/mob/living/carbon/human/H = quirk_holder - - H.adjustBruteLoss(-0.5) - H.adjustFireLoss(-0.25) - if(H.getBruteLoss() > 0 && H.getFireLoss() <= 50 || H.getFireLoss() > 0 && H.getFireLoss() <= 50) - H.adjustBruteLoss(-0.5, forced = TRUE) - H.adjustFireLoss(-0.25, forced = TRUE) - else if (H.getToxLoss() <= 90) - H.adjustToxLoss(-0.3, forced = TRUE) + // Quirk holder must be injured + if(quirk_holder.health >= quirk_holder.maxHealth) + // Do nothing + return + + // Define health needing updates + var/need_mob_update = FALSE + + // Check brute threshold + if(quirk_holder.getBruteLoss() <= RESTMETA_BRUTE_THRESHOLD) + need_mob_update += quirk_holder.adjustBruteLoss(RESTMETA_BRUTE_AMOUNT, updating_health = FALSE) + + // Check burn threshold + if(quirk_holder.getFireLoss() <= RESTMETA_BURN_THRESHOLD) + need_mob_update += quirk_holder.adjustFireLoss(RESTMETA_BURN_AMOUNT, updating_health = FALSE) + + // Check tox threshold + if(quirk_holder.getToxLoss() <= RESTMETA_TOX_THRESHOLD) + need_mob_update += quirk_holder.adjustToxLoss(RESTMETA_TOX_AMOUNT, updating_health = FALSE, forced = TRUE) + + // Check if healing will be applied + if(need_mob_update) + // Update health + quirk_holder.updatehealth() + +#undef RESTMETA_BRUTE_THRESHOLD +#undef RESTMETA_BRUTE_AMOUNT +#undef RESTMETA_BURN_THRESHOLD +#undef RESTMETA_BURN_AMOUNT +#undef RESTMETA_TOX_THRESHOLD +#undef RESTMETA_TOX_AMOUNT