Okay.. I think this fixes it all.

This commit is contained in:
Fermi
2019-09-21 11:13:20 +01:00
parent f0ea842c17
commit a3ae942c1d
4 changed files with 42 additions and 27 deletions
@@ -102,8 +102,8 @@
St.volume *= St.purity
St.purity = 1
N.volume -= 0.002
St.grown_volume += added_volume
St.data = St.grown_volume
St.data.["grown_volume"] += added_volume
St.data = St.data.["grown_volume"]
/datum/chemical_reaction/styptic_powder
name = "Styptic Powder"
+5 -4
View File
@@ -3,7 +3,7 @@
//TBD: Add heart damage, have heart reconstruction seperate from organ reconstruction, and find a better name for this. I can imagine people getting it confused with manipulation.
/datum/surgery/graft_synthtissue
name = "Graft_synthtissue"
name = "Graft synthtissue"
species = list(/mob/living/carbon/human, /mob/living/carbon/monkey)
possible_locs = list(BODY_ZONE_CHEST, BODY_ZONE_PRECISE_GROIN, BODY_ZONE_PRECISE_EYES)
steps = list(
@@ -21,7 +21,7 @@
name = "graft synthtissue"
implements = list(/obj/item/hemostat = 100, TOOL_SCREWDRIVER = 35, /obj/item/pen = 15)
repeatable = TRUE
time = 25
time = 50
chems_needed = list("synthtissue")
var/obj/item/organ/chosen_organ
@@ -36,9 +36,10 @@
O.on_find(user)
organs -= O
organs[O.name] = O
chosen_organ = input("Remove which organ?", "Surgery", null, null) as null|anything in organs
chosen_organ = input("Target which organ?", "Surgery", null, null) as null|anything in organs
chosen_organ = organs[chosen_organ]
if(chosen_organ.organ_flags & ORGAN_FAILING)
to_chat(user, "<span class='notice'>[target]'s [chosen_organ] is too damaged to repair graft onto!</span>")
to_chat(user, "<span class='notice'>[target]'s [chosen_organ] is too damaged to graft onto!</span>")
return -1
user.visible_message("[user] begins to repair damaged portions of [target]'s [chosen_organ].</span>")
@@ -218,7 +218,7 @@
LI = new()
LI.Insert(src)
if(only_one)
return
return TRUE
if(has_stomach && !getorganslot(ORGAN_SLOT_STOMACH))
var/obj/item/organ/stomach/S
@@ -229,19 +229,19 @@
S = new()
S.Insert(src)
if(only_one)
return
return TRUE
if(breathes && !getorganslot(ORGAN_SLOT_LUNGS))
var/obj/item/organ/lungs/L = new()
L.Insert(src)
if(only_one)
return
return TRUE
if(blooded && !getorganslot(ORGAN_SLOT_HEART))
var/obj/item/organ/heart/H = new()
H.Insert(src)
if(only_one)
return
return TRUE
if(!getorganslot(ORGAN_SLOT_TONGUE))
var/obj/item/organ/tongue/T
@@ -254,7 +254,7 @@
// if they have no mutant tongues, give them a regular one
T.Insert(src)
if(only_one)
return
return TRUE
else if (!only_one)
var/obj/item/organ/tongue/oT = getorganslot(ORGAN_SLOT_TONGUE)
@@ -278,7 +278,7 @@
E = new()
E.Insert(src)
if(only_one)
return
return TRUE
if(!getorganslot(ORGAN_SLOT_EARS))
var/obj/item/organ/ears/ears
@@ -289,7 +289,7 @@
ears.Insert(src)
if(only_one)
return
return TRUE
if(!getorganslot(ORGAN_SLOT_TAIL))
var/obj/item/organ/tail/tail
@@ -297,4 +297,4 @@
tail = new dna.species.mutanttail
tail.Insert(src)
if(only_one)
return
return TRUE
@@ -98,11 +98,10 @@
/datum/reagent/synthtissue
name = "Synthtissue"
id = "synthtissue"
description = "Synthetic tissue used for grafting onto damaged organs during surgery, or for treating limb damage."
description = "Synthetic tissue used for grafting onto damaged organs during surgery, or for treating limb damage. Has a very tight growth window between 305-320, any higher and the temperature will cause the cells to die. Additionally, growth time is considerably long, so chemists are encouraged to leave beakers with said reaction ongoing, while they tend to their other duties."
pH = 7.6
metabolization_rate = 0.1
var/grown_volume = 0
var/injected_vol = 0
data = list("grown_volume" = 0, "injected_vol" = 0)
/datum/reagent/synthtissue/reaction_mob(mob/living/M, method=TOUCH, reac_volume,show_message = 1)
if(iscarbon(M))
@@ -115,23 +114,38 @@
if(show_message)
to_chat(M, "<span class='danger'>You feel your [target] heal! It stings like hell!</span>")
SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "painful_medicine", /datum/mood_event/painful_medicine)
if(method == INJECT)
injected_vol += reac_volume
if(method==INJECT)
data.["injected_vol"] += reac_volume
message_admins("inject! [data.["injected_vol"]], [reac_volume]")
..()
/datum/reagent/synthtissue/on_mob_life(mob/living/carbon/C)
if(!iscarbon(C))
return ..()
if(injected_vol >= 20)
if(grown_volume > 150) //I don't think this is even possible, but damn to I want to see if someone can (bare in mind it takes 2s to grow 0.05u)
if(volume >= 20)
C.regenerate_organs(only_one = TRUE)
C.reagents.remove_reagent(id, 20)
if(data.["injected_vol"] > 14)
if(data.["grown_volume"] > 150) //I don't think this is even possible, but damn to I want to see if someone can (bare in mind it takes 2s to grow 0.05u)
if(volume >= 14)
if(C.regenerate_organs(only_one = TRUE))
C.reagents.remove_reagent(id, 15)
to_chat(C, "<span class='notice'>You feel something reform inside of you!</span>")
data.["injected_vol"] -= metabolization_rate
..()
/datum/reagent/synthtissue/on_merge(data)
if(data > grown_volume)
grown_volume = data
/datum/reagent/synthtissue/on_merge(passed_data)
if(passed_data.["grown_volume"] > data.["grown_volume"])
data.["grown_volume"] = passed_data.["grown_volume"]
if(!data)
data = passed_data
..()
/datum/reagent/synthtissue/on_new(passed_data)
if(passed_data.["grown_volume"] > data.["grown_volume"])
data.["grown_volume"] = passed_data.["grown_volume"]
if(!data)
data = passed_data
..()
/datum/reagent/synthtissue/
//NEEDS ON_MOB_DEAD()