Well it compiles

This commit is contained in:
Fermi
2019-11-21 02:15:58 +00:00
parent 2a8d72c909
commit cc53a0061f
10 changed files with 402 additions and 202 deletions
@@ -102,20 +102,35 @@
pH = 7.6
metabolization_rate = 0.05 //Give them time to graft
data = list("grown_volume" = 0, "injected_vol" = 0)
var/borrowed_health
/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")
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)
@@ -129,6 +144,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)
@@ -139,6 +158,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)
@@ -146,6 +166,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()
switch(data["grown_volume"])
if(-INFINITY to 50)
name = "Young Synthtissue Colony"
if(50 to 80)
name = "Adolescent Synthtissue Colony"
if(80 to 135)
name = "Adult Synthtissue Colony"
if(135 to 175)
name = "Master Synthtissue Colony"
if(175 to INFINITY)
name = "Apex 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()