From f8dfb1e3aaf4541e804448455d7e58b9f75ae2e1 Mon Sep 17 00:00:00 2001
From: Fermi <>
Date: Sat, 21 Sep 2019 12:45:10 +0100
Subject: [PATCH] Okay.
---
.../reagents/chemistry/recipes/medicine.dm | 3 +-
code/modules/surgery/graft_synthtissue.dm | 38 ++++++++++++-------
.../reagents/chemistry/reagents/healing.dm | 25 ++++++------
3 files changed, 37 insertions(+), 29 deletions(-)
diff --git a/code/modules/reagents/chemistry/recipes/medicine.dm b/code/modules/reagents/chemistry/recipes/medicine.dm
index f1eda93505..11dd8b7475 100644
--- a/code/modules/reagents/chemistry/recipes/medicine.dm
+++ b/code/modules/reagents/chemistry/recipes/medicine.dm
@@ -102,8 +102,7 @@
St.volume *= St.purity
St.purity = 1
N.volume -= 0.002
- St.data.["grown_volume"] += added_volume
- St.data = St.data.["grown_volume"]
+ St.data["grown_volume"] = St.data["grown_volume"] + added_volume
/datum/chemical_reaction/styptic_powder
name = "Styptic Powder"
diff --git a/code/modules/surgery/graft_synthtissue.dm b/code/modules/surgery/graft_synthtissue.dm
index 0d396e5fdf..8e61f49f49 100644
--- a/code/modules/surgery/graft_synthtissue.dm
+++ b/code/modules/surgery/graft_synthtissue.dm
@@ -21,9 +21,10 @@
name = "graft synthtissue"
implements = list(/obj/item/hemostat = 100, TOOL_SCREWDRIVER = 35, /obj/item/pen = 15)
repeatable = TRUE
- time = 50
+ time = 75
chems_needed = list("synthtissue")
var/obj/item/organ/chosen_organ
+ var/health_restored = 10
/datum/surgery_step/graft_synthtissue/preop(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool, datum/surgery/surgery)
if(implement_type in implements)
@@ -38,23 +39,32 @@
organs[O.name] = O
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, "[target]'s [chosen_organ] is too damaged to graft onto!")
+ if(!chosen_organ)
+ return -1
+ if(!target.reagents.has_reagent("synthtissue"))
+ to_chat(user, "There's no synthtissue available for use on [chosen_organ]")
+ return -1
+ var/datum/reagent/synthtissue/Sf = locate(/datum/reagent/synthtissue) in target.reagents.reagent_list
+ if(Sf.volume < 10)
+ to_chat(user, "There's not enough synthtissue to perform the operation! There needs to be at least 10u.")
return -1
- user.visible_message("[user] begins to repair damaged portions of [target]'s [chosen_organ].")
+ if((chosen_organ.organ_flags & ORGAN_FAILING) && !(Sf.data["grown_volume"] >= 115))
+ to_chat(user, "[chosen_organ] is too damaged to graft onto!")
+ return -1
+
+
+ user.visible_message("[user] begins to graft synthtissue onto [chosen_organ].")
+ target.reagents.remove_reagent("synthtissue", 10)
+ if(health_restored != 10)
+ health_restored = 10
+ health_restored += (Sf.data["grown_volume"]/10)
/datum/surgery_step/graft_synthtissue/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
- if((!chosen_organ)||(chosen_organ.organ_flags & ORGAN_FAILING))
- to_chat(user, "[target] has no [chosen_organ] capable of repair!")
- else
- user.visible_message("[user] successfully repairs part of [target]'s [chosen_organ].", "You succeed in repairing parts of [target]'s [chosen_organ].")
- chosen_organ.applyOrganDamage(-10)
+ user.visible_message("[user] successfully repairs part of [chosen_organ].", "You succeed in repairing parts of [chosen_organ].")
+ chosen_organ.applyOrganDamage(health_restored)
/datum/surgery_step/graft_synthtissue/failure(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
- if((!chosen_organ)||(chosen_organ.organ_flags & ORGAN_FAILING))
- to_chat(user, "[target] has no [chosen_organ] capable of repair!")
- else
- user.visible_message("[user] accidentally damages part of [target]'s [chosen_organ]!", "You damage [target]'s [chosen_organ]! Apply more synthtissue if it's run out.")
- chosen_organ.applyOrganDamage(10)
+ user.visible_message("[user] accidentally damages part of [chosen_organ]!", "You damage [chosen_organ]! Apply more synthtissue if it's run out.")
+ chosen_organ.applyOrganDamage(10)
return FALSE
diff --git a/modular_citadel/code/modules/reagents/chemistry/reagents/healing.dm b/modular_citadel/code/modules/reagents/chemistry/reagents/healing.dm
index 9c24720a5a..9daddb3104 100644
--- a/modular_citadel/code/modules/reagents/chemistry/reagents/healing.dm
+++ b/modular_citadel/code/modules/reagents/chemistry/reagents/healing.dm
@@ -115,35 +115,34 @@
to_chat(M, "You feel your [target] heal! It stings like hell!")
SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "painful_medicine", /datum/mood_event/painful_medicine)
if(method==INJECT)
- data.["injected_vol"] += reac_volume
- message_admins("inject! [data.["injected_vol"]], [reac_volume]")
+ data["injected_vol"] = data["injected_vol"] + reac_volume
..()
/datum/reagent/synthtissue/on_mob_life(mob/living/carbon/C)
if(!iscarbon(C))
return ..()
- 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(data["injected_vol"] > 14)
+ if(data["grown_volume"] > 175) //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, "You feel something reform inside of you!")
- data.["injected_vol"] -= metabolization_rate
+ data["injected_vol"] -= metabolization_rate
..()
/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
+ if(!passed_data)
+ return ..()
+ if(passed_data["grown_volume"] > data["grown_volume"])
+ data["grown_volume"] = passed_data["grown_volume"]
..()
/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
+ if(!passed_data)
+ return ..()
+ if(passed_data["grown_volume"] > data["grown_volume"])
+ data["grown_volume"] = passed_data["grown_volume"]
..()
/datum/reagent/synthtissue/