From 051f5780dbdd7e173dcda60d0ed9275e11a9dfd5 Mon Sep 17 00:00:00 2001 From: DeltaFire Date: Fri, 31 Dec 2021 00:16:49 +0100 Subject: [PATCH] tweaks Synthtissue borrowed health capped at 250, gradually flips from clonedamage towards toxdamage within 45 cycles. Restores organ healing for strange reagent, but only in a very weak fashion (5 heal for failing organs) --- code/__DEFINES/reagents.dm | 3 +++ .../chemistry/reagents/medicine_reagents.dm | 4 ++++ .../modules/reagents/chemistry/reagents/healing.dm | 13 +++++++------ 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/code/__DEFINES/reagents.dm b/code/__DEFINES/reagents.dm index 8864e41ae9..90128606ac 100644 --- a/code/__DEFINES/reagents.dm +++ b/code/__DEFINES/reagents.dm @@ -63,6 +63,9 @@ #define THRESHOLD_UNHUSK 50 // health threshold for synthflesh/rezadone to unhusk someone +#define SYNTHTISSUE_BORROW_CAP 250 //The cap for synthtissue's borrowed health value when used on someone dead or already having borrowed health. +#define SYNTHTISSUE_DAMAGE_FLIP_CYCLES 45 //After how many cycles the damage will be pure toxdamage as opposed to clonedamage like initially. Gradually changes during its cycles. + //reagent bitflags, used for altering how they works #define REAGENT_DEAD_PROCESS (1<<0) //calls on_mob_dead() if present in a dead body #define REAGENT_DONOTSPLIT (1<<1) //Do not split the chem at all during processing diff --git a/code/modules/reagents/chemistry/reagents/medicine_reagents.dm b/code/modules/reagents/chemistry/reagents/medicine_reagents.dm index 3ca96645ad..a211a29298 100644 --- a/code/modules/reagents/chemistry/reagents/medicine_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/medicine_reagents.dm @@ -1000,6 +1000,10 @@ var/obj/item/organ/heart/H = C.getorganslot(ORGAN_SLOT_HEART) if(H && H.organ_flags & ORGAN_FAILING) H.applyOrganDamage(-15) + for(var/obj/item/organ/O as anything in C.internal_organs) + if(O.organ_flags & ORGAN_FAILING) + O.applyOrganDamage(-5) + M.adjustOxyLoss(-20, 0) M.adjustToxLoss(-20, 0) M.updatehealth() diff --git a/modular_citadel/code/modules/reagents/chemistry/reagents/healing.dm b/modular_citadel/code/modules/reagents/chemistry/reagents/healing.dm index d291278a5f..346a74006f 100644 --- a/modular_citadel/code/modules/reagents/chemistry/reagents/healing.dm +++ b/modular_citadel/code/modules/reagents/chemistry/reagents/healing.dm @@ -167,9 +167,10 @@ data["injected_vol"] = max(0, data["injected_vol"] - metabolization_rate * C.metabolism_efficiency) //No negatives. if(borrowed_health) - var/payback = 2 * C.metabolism_efficiency //How much borrowed health we are paying back. Half as clonedam, half as true omni toxdam - C.adjustToxLoss(payback / 2, forced = TRUE, toxins_type = TOX_OMNI) - C.adjustCloneLoss(payback / 2) + var/ratio = (current_cycle > SYNTHTISSUE_DAMAGE_FLIP_CYCLES) ? 0 : (1 - (current_cycle / SYNTHTISSUE_DAMAGE_FLIP_CYCLES)) + var/payback = 2 * C.metabolism_efficiency //How much borrowed health we are paying back. Starts as cloneloss, slowly flips over to toxloss. + C.adjustToxLoss((1 - ratio) * payback * REAGENTS_EFFECT_MULTIPLIER, forced = TRUE, toxins_type = TOX_OMNI) + C.adjustCloneLoss(ratio * payback * REAGENTS_EFFECT_MULTIPLIER) borrowed_health = max(borrowed_health - payback, 0) ..() @@ -188,7 +189,7 @@ /datum/reagent/synthtissue/on_new(passed_data) if(!passed_data) return ..() - borrowed_health += passed_data["borrowed_health"] + borrowed_health = min(passed_data["borrowed_health"] + borrowed_health, SYNTHTISSUE_BORROW_CAP) if(passed_data["grown_volume"] > data["grown_volume"]) data["grown_volume"] = passed_data["grown_volume"] update_name() @@ -220,9 +221,9 @@ C.adjustCloneLoss(borrowed_health*1.25) C.adjustAllOrganLoss(borrowed_health*0.25) M.updatehealth() - if(borrowed_health && C.health < -20) - M.stat = DEAD + if(C.stat != DEAD && borrowed_health && C.health < -20) M.visible_message("The synthetic tissue degrades off [M]'s wounds as they collapse to the floor.") + M.death() //NEEDS ON_MOB_DEAD() /datum/reagent/fermi/zeolites