Merge pull request #9895 from Thalpy/OrganQoL

[READY] Organ quality of life fixes. Adds Organ fridges with items, Tweaks scanner, new surgery, tweaks chems
This commit is contained in:
Putnam3145
2019-11-30 22:22:52 -08:00
committed by GitHub
21 changed files with 516 additions and 247 deletions
@@ -101,20 +101,39 @@
pH = 7.6
metabolization_rate = 0.05 //Give them time to graft
data = list("grown_volume" = 0, "injected_vol" = 0)
var/borrowed_health
color = "#FFDADA"
/datum/reagent/synthtissue/reaction_mob(mob/living/M, method=TOUCH, reac_volume,show_message = 1)
if(iscarbon(M))
var/target = M.zone_selected
if (M.stat == DEAD)
show_message = 0
var/mob/living/carbon/C = M
var/healing_factor = (((data["grown_volume"] / 100) + 1)*reac_volume)
if(method in list(PATCH, TOUCH))
M.apply_damage(reac_volume*-1.5, BRUTE, target)
M.apply_damage(reac_volume*-1.5, BURN, target)
if(show_message)
to_chat(M, "<span class='danger'>You feel your [target] heal! It stings like hell!</span>")
if (M.stat == DEAD)
M.visible_message("The synthetic tissue rapidly grafts into [M]'s wounds, attemping to repair the damage as quickly as possible.")
borrowed_health += healing_factor
M.adjustBruteLoss(-healing_factor*2)
M.adjustFireLoss(-healing_factor*2)
M.adjustToxLoss(-healing_factor)
M.adjustCloneLoss(-healing_factor)
M.updatehealth()
if(data["grown_volume"] > 135 && ((C.health + C.oxyloss)>=80))
if(M.revive())
M.emote("gasp")
borrowed_health *= 2
if(borrowed_health < 100)
borrowed_health = 100
log_combat(M, M, "revived", src)
else
M.adjustBruteLoss(-healing_factor)
M.adjustFireLoss(-healing_factor)
to_chat(M, "<span class='danger'>You feel your flesh merge with the synthetic tissue! It stings like hell!</span>")
SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "painful_medicine", /datum/mood_event/painful_medicine)
if(method==INJECT)
data["injected_vol"] = reac_volume
if(method==INJECT)
data["injected_vol"] = reac_volume
var/obj/item/organ/heart/H = C.getorganslot(ORGAN_SLOT_HEART)
if(data["grown_volume"] > 50 && H.organ_flags & ORGAN_FAILING)
H.applyOrganDamage(-20)
..()
/datum/reagent/synthtissue/on_mob_life(mob/living/carbon/C)
@@ -128,6 +147,10 @@
to_chat(C, "<span class='notice'>You feel something reform inside of you!</span>")
data["injected_vol"] -= metabolization_rate
if(borrowed_health)
C.adjustToxLoss(1)
C.adjustCloneLoss(1)
borrowed_health -= 1
..()
/datum/reagent/synthtissue/on_merge(passed_data)
@@ -138,6 +161,7 @@
if(iscarbon(holder.my_atom))
data["injected_vol"] = data["injected_vol"] + passed_data["injected_vol"]
passed_data["injected_vol"] = 0
update_name()
..()
/datum/reagent/synthtissue/on_new(passed_data)
@@ -145,6 +169,32 @@
return ..()
if(passed_data["grown_volume"] > data["grown_volume"])
data["grown_volume"] = passed_data["grown_volume"]
update_name()
..()
/datum/reagent/synthtissue/proc/update_name() //They are but babes on creation and have to grow unto godhood
switch(data["grown_volume"])
if(-INFINITY to 50)
name = "Induced Synthtissue Colony"
if(50 to 80)
name = "Oligopotent Synthtissue Colony"
if(80 to 135)
name = "Pluripotent Synthtissue Colony"
if(135 to 175)
name = "SuperSomatic Synthtissue Colony"
if(175 to INFINITY)
name = "Omnipotent Synthtissue Colony"
/datum/reagent/synthtissue/on_mob_delete(mob/living/M)
if(!iscarbon(M))
return
var/mob/living/carbon/C = M
C.adjustBruteLoss(borrowed_health*1.25)
C.adjustToxLoss(borrowed_health*1.25)
C.adjustCloneLoss(borrowed_health*1.25)
C.adjustAllOrganLoss(borrowed_health*0.25)
M.updatehealth()
if(borrowed_health && C.health < -20)
M.stat = DEAD
M.visible_message("The synthetic tissue degrades off [M]'s wounds as they collapse to the floor.")
//NEEDS ON_MOB_DEAD()