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)
This commit is contained in:
DeltaFire
2021-12-31 00:16:49 +01:00
parent bb3eb904eb
commit 051f5780db
3 changed files with 14 additions and 6 deletions
+3
View File
@@ -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
@@ -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()
@@ -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