From a08c1229d63989ea94291c01d067b6744b289240 Mon Sep 17 00:00:00 2001 From: Fermi <> Date: Sat, 21 Sep 2019 09:31:53 +0100 Subject: [PATCH] OKAY now I'm done I think. --- .../reagents/chemistry/recipes/medicine.dm | 8 +++--- code/modules/surgery/graft_synthtissue.dm | 2 +- code/modules/surgery/organs/organ_internal.dm | 21 +++++++++++++-- .../reagents/chemistry/reagents/healing.dm | 26 ++++++++++++++++--- .../reagents/chemistry/recipes/fermi.dm | 2 +- 5 files changed, 49 insertions(+), 10 deletions(-) diff --git a/code/modules/reagents/chemistry/recipes/medicine.dm b/code/modules/reagents/chemistry/recipes/medicine.dm index 2c75fc8827..b5f0fb0f4b 100644 --- a/code/modules/reagents/chemistry/recipes/medicine.dm +++ b/code/modules/reagents/chemistry/recipes/medicine.dm @@ -82,16 +82,16 @@ OptimalpHMax = 9.5 // Higest value for above ReactpHLim = 2 // How far out pH wil react, giving impurity place (Exponential phase) CatalystFact = 0 // How much the catalyst affects the reaction (0 = no catalyst) - CurveSharpT = 2.5 // How sharp the temperature exponential curve is (to the power of value) + CurveSharpT = 1 // How sharp the temperature exponential curve is (to the power of value) CurveSharppH = 2.5 // How sharp the pH exponential curve is (to the power of value) ThermicConstant = 0.01 // Temperature change per 1u produced HIonRelease = 0.01 // pH change per 1u reaction (inverse for some reason) - RateUpLim = 0.02 // Optimal/max rate possible if all conditions are perfect + RateUpLim = 0.05 // Optimal/max rate possible if all conditions are perfect FermiChem = TRUE // If the chemical uses the Fermichem reaction mechanics PurityMin = 0 /datum/chemical_reaction/synthtissue/FermiCreate(datum/reagents/holder, added_volume, added_purity) - var/datum/reagent/St = holder.has_reagent("synthtissue") + var/datum/reagent/synthtissue/St = holder.has_reagent("synthtissue") var/datum/reagent/N = holder.has_reagent("nutriment") if(!St) return @@ -102,6 +102,8 @@ St.volume *= St.purity St.purity = 1 N.volume -= 0.002 + St.grown_volume += added_volume + St.data = St.grown_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 58e4c4a181..fb0a2552ba 100644 --- a/code/modules/surgery/graft_synthtissue.dm +++ b/code/modules/surgery/graft_synthtissue.dm @@ -5,7 +5,7 @@ /datum/surgery/graft_synthtissue name = "Graft_synthtissue" species = list(/mob/living/carbon/human, /mob/living/carbon/monkey) - possible_locs = list(BODY_ZONE_CHEST) + possible_locs = list(BODY_ZONE_CHEST, BODY_ZONE_PRECISE_GROIN, BODY_ZONE_PRECISE_EYES) steps = list( /datum/surgery_step/incise, /datum/surgery_step/retract_skin, diff --git a/code/modules/surgery/organs/organ_internal.dm b/code/modules/surgery/organs/organ_internal.dm index 65b0888bc7..78742e9b61 100644 --- a/code/modules/surgery/organs/organ_internal.dm +++ b/code/modules/surgery/organs/organ_internal.dm @@ -198,7 +198,7 @@ /mob/living/proc/regenerate_organs() return 0 -/mob/living/carbon/regenerate_organs() +/mob/living/carbon/regenerate_organs(only_one = FALSE) var/breathes = TRUE var/blooded = TRUE if(dna && dna.species) @@ -217,6 +217,8 @@ else LI = new() LI.Insert(src) + if(only_one) + return if(has_stomach && !getorganslot(ORGAN_SLOT_STOMACH)) var/obj/item/organ/stomach/S @@ -226,14 +228,20 @@ else S = new() S.Insert(src) + if(only_one) + return if(breathes && !getorganslot(ORGAN_SLOT_LUNGS)) var/obj/item/organ/lungs/L = new() L.Insert(src) + if(only_one) + return if(blooded && !getorganslot(ORGAN_SLOT_HEART)) var/obj/item/organ/heart/H = new() H.Insert(src) + if(only_one) + return if(!getorganslot(ORGAN_SLOT_TONGUE)) var/obj/item/organ/tongue/T @@ -245,7 +253,10 @@ // if they have no mutant tongues, give them a regular one T.Insert(src) - else + if(only_one) + return + + else if (!only_one) var/obj/item/organ/tongue/oT = getorganslot(ORGAN_SLOT_TONGUE) if(oT.name == "fluffy tongue") var/obj/item/organ/tongue/T @@ -266,6 +277,8 @@ else E = new() E.Insert(src) + if(only_one) + return if(!getorganslot(ORGAN_SLOT_EARS)) var/obj/item/organ/ears/ears @@ -275,9 +288,13 @@ ears = new ears.Insert(src) + if(only_one) + return if(!getorganslot(ORGAN_SLOT_TAIL)) var/obj/item/organ/tail/tail if(dna && dna.species && dna.species.mutanttail) tail = new dna.species.mutanttail tail.Insert(src) + if(only_one) + return diff --git a/modular_citadel/code/modules/reagents/chemistry/reagents/healing.dm b/modular_citadel/code/modules/reagents/chemistry/reagents/healing.dm index 5a8d74d30b..f2db39a593 100644 --- a/modular_citadel/code/modules/reagents/chemistry/reagents/healing.dm +++ b/modular_citadel/code/modules/reagents/chemistry/reagents/healing.dm @@ -100,18 +100,38 @@ id = "synthtissue" description = "Synthetic tissue used for grafting onto damaged organs during surgery, or for treating limb damage." pH = 7.6 + var/grown_volume = 0 + var/injected_vol = 0 /datum/reagent/synthtissue/reaction_mob(mob/living/M, method=TOUCH, reac_volume,show_message = 1) + cached_method = method if(iscarbon(M)) var/target = M.zone_selected if (M.stat == DEAD) show_message = 0 if(method in list(PATCH, TOUCH)) - M.apply_damage(volume*1.25, BRUTE, target) - M.apply_damage(volume*1.25, BURN, target) + M.apply_damage(reac_volume*-1.25, BRUTE, target) + M.apply_damage(reac_volume*-1.25, BURN, target) if(show_message) - to_chat(M, "You feel your damaged [target] heal! It stings like hell!") + 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) + injected_vol += reac_volume + ..() + +/datum/reagent/synthtissue/on_mob_life(mob/living/carbon/C) + if(!iscarbon(C)) + return ..() + if(cached_method == INJECT) + 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) + ..() + +/datum/reagent/synthtissue/on_merge(data) + if(data > grown_volume) + grown_volume = data ..() //NEEDS ON_MOB_DEAD() diff --git a/modular_citadel/code/modules/reagents/chemistry/recipes/fermi.dm b/modular_citadel/code/modules/reagents/chemistry/recipes/fermi.dm index 78765434b2..7d5e36f84f 100644 --- a/modular_citadel/code/modules/reagents/chemistry/recipes/fermi.dm +++ b/modular_citadel/code/modules/reagents/chemistry/recipes/fermi.dm @@ -2,7 +2,7 @@ mix_sound = 'sound/effects/bubbles.ogg' //Called for every reaction step -/datum/chemical_reaction/proc/FermiCreate(datum/reagents) +/datum/chemical_reaction/proc/FermiCreate(datum/reagents/holder, added_volume, added_purity) return //Called when reaction STOP_PROCESSING