From 107dd67cbee0bdaec26156b6d8dd029a49acc802 Mon Sep 17 00:00:00 2001 From: Fermi <> Date: Thu, 19 Sep 2019 01:14:12 +0100 Subject: [PATCH] Well it compiles; just synthtissue and TongueLoss now. --- code/__DEFINES/mobs.dm | 3 ++ code/controllers/subsystem/blackbox.dm | 3 +- code/game/machinery/cloning.dm | 2 +- code/game/objects/items/defib.dm | 9 +++--- code/game/objects/items/devices/scanners.dm | 17 +++++------ .../antagonists/changeling/changeling.dm | 2 +- .../changeling/powers/regenerate.dm | 2 +- code/modules/mob/living/brain/brain_item.dm | 28 +++++++++++-------- code/modules/mob/living/brain/life.dm | 2 +- code/modules/mob/living/carbon/carbon.dm | 1 - .../mob/living/carbon/carbon_defense.dm | 10 +++---- .../modules/mob/living/carbon/damage_procs.dm | 6 ++-- code/modules/mob/living/carbon/life.dm | 1 - code/modules/mob/living/living.dm | 10 ++++--- code/modules/mob/transform_procs.dm | 4 +-- .../chemistry/reagents/medicine_reagents.dm | 8 +++--- .../nanites/nanite_programs/healing.dm | 4 +-- code/modules/surgery/graft_synthtissue.dm | 21 ++++++-------- .../surgery/organs/augments_internal.dm | 2 +- code/modules/surgery/organs/liver.dm | 2 -- code/modules/surgery/organs/lungs.dm | 12 ++++---- code/modules/surgery/organs/organ_internal.dm | 15 ++-------- code/modules/surgery/organs/stomach.dm | 5 +--- code/modules/surgery/organs/tongue.dm | 3 +- .../code/datums/status_effects/chems.dm | 3 +- .../reagents/chemistry/reagents/SDGF.dm | 6 ++-- .../chemistry/reagents/fermi_reagents.dm | 3 +- .../reagents/chemistry/reagents/healing.dm | 25 +++++++++++++++-- tgstation.dme | 4 ++- 29 files changed, 107 insertions(+), 106 deletions(-) diff --git a/code/__DEFINES/mobs.dm b/code/__DEFINES/mobs.dm index 8b5cb1453b..657bbf82d5 100644 --- a/code/__DEFINES/mobs.dm +++ b/code/__DEFINES/mobs.dm @@ -254,6 +254,9 @@ #define MAX_QUIRKS 6 //The maximum amount of quirks one character can have at roundstart +#define MAX_REVIVE_FIRE_DAMAGE 180 +#define MAX_REVIVE_BRUTE_DAMAGE 180 + // AI Toggles #define AI_CAMERA_LUMINOSITY 5 #define AI_VOX // Comment out if you don't want VOX to be enabled and have players download the voice sounds. diff --git a/code/controllers/subsystem/blackbox.dm b/code/controllers/subsystem/blackbox.dm index 7cb46f594a..58476d472f 100644 --- a/code/controllers/subsystem/blackbox.dm +++ b/code/controllers/subsystem/blackbox.dm @@ -295,7 +295,6 @@ Versioning var/sqlbrute = L.getBruteLoss() var/sqlfire = L.getFireLoss() var/sqlbrain = L.getOrganLoss(ORGAN_SLOT_BRAIN) - var/sqlbrain = L.getOrganLoss(ORGAN_SLOT_BRAIN) var/sqloxy = L.getOxyLoss() var/sqltox = L.getToxLoss() var/sqlclone = L.getCloneLoss() @@ -309,7 +308,7 @@ Versioning if(!SSdbcore.Connect()) return - + sqlname = sanitizeSQL(sqlname) sqlkey = sanitizeSQL(sqlkey) sqljob = sanitizeSQL(sqljob) diff --git a/code/game/machinery/cloning.dm b/code/game/machinery/cloning.dm index efb357f295..66151031a2 100644 --- a/code/game/machinery/cloning.dm +++ b/code/game/machinery/cloning.dm @@ -447,7 +447,7 @@ unattached_flesh.Cut() H.setCloneLoss(CLONE_INITIAL_DAMAGE) //Yeah, clones start with very low health, not with random, because why would they start with random health - H.setBrainLoss(CLONE_INITIAL_DAMAGE) + H.setOrganLoss(ORGAN_SLOT_BRAIN, CLONE_INITIAL_DAMAGE) // In addition to being cellularly damaged and having barely any // brain function, they also have no limbs or internal organs. diff --git a/code/game/objects/items/defib.dm b/code/game/objects/items/defib.dm index c2c7dbfabc..e960272783 100644 --- a/code/game/objects/items/defib.dm +++ b/code/game/objects/items/defib.dm @@ -451,7 +451,7 @@ if(!heart || (heart.organ_flags & ORGAN_FAILING)) return var/obj/item/organ/brain/BR = H.getorgan(/obj/item/organ/brain) - if(QDELETED(BR) || BR.brain_death || (BR.organ_flags & ORGAN_FAILING) || BR.suicided) + if(QDELETED(BR) || BR.brain_death || (BR.organ_flags & ORGAN_FAILING) || H.suiciding) return return TRUE @@ -568,12 +568,11 @@ if(do_after(user, primetimer, target = H)) //beginning to place the paddles on patient's chest to allow some time for people to move away to stop the process user.visible_message("[user] places [src] on [H]'s chest.", "You place [src] on [H]'s chest.") playsound(src, 'sound/machines/defib_charge.ogg', 75, 0) - var/tplus = world.time - H.timeofdeath // patients rot when they are killed, and die when they are dead + var/tplus = world.time - H.timeofdeath //length of time spent dead var/tloss = deathtimer var/total_burn = 0 var/total_brute = 0 - var/tplus = world.time - H.timeofdeath //length of time spent dead var/obj/item/organ/heart = H.getorgan(/obj/item/organ/heart) if(do_after(user, primetimer2, target = H)) //placed on chest and short delay to shock for dramatic effect, revive time is 5sec total for(var/obj/item/carried_item in H.contents) @@ -614,11 +613,11 @@ failed = "[req_defib ? "[defib]" : "[src]"] buzzes: Resuscitation failed - Patient's brain tissue is damaged making recovery of patient impossible via defibrillator. Further attempts futile." if(BR.brain_death) failed = "[req_defib ? "[defib]" : "[src]"] buzzes: Resuscitation failed - Patient's brain damaged beyond point of no return. Further attempts futile." - if(BR.suicided || BR.brainmob?.suiciding) + if(H.suicided || BR.brainmob?.suiciding) failed = "[req_defib ? "[defib]" : "[src]"] buzzes: Resuscitation failed - No intelligence pattern can be detected in patient's brain. Further attempts futile." else failed = "[req_defib ? "[defib]" : "[src]"] buzzes: Resuscitation failed - Patient's brain is missing. Further attempts futile." - + if(failed) user.visible_message(failed) diff --git a/code/game/objects/items/devices/scanners.dm b/code/game/objects/items/devices/scanners.dm index a546a83732..8ceb8abc16 100644 --- a/code/game/objects/items/devices/scanners.dm +++ b/code/game/objects/items/devices/scanners.dm @@ -243,11 +243,11 @@ SLIME SCANNER healthy = FALSE msg += "\tSubject is deaf.\n" else - if(ears.ear_damage) - msg += "\tSubject has [ears.ear_damage > UNHEALING_EAR_DAMAGE? "permanent ": "temporary "]hearing damage.\n" + if(ears.damage) + to_chat(user, "\tSubject has [ears.damage > ears.maxHealth ? "permanent ": "temporary "]hearing damage.") healthy = FALSE if(ears.deaf) - msg += "\tSubject is [ears.ear_damage > UNHEALING_EAR_DAMAGE ? "permanently ": "temporarily "] deaf.\n" + to_chat(user, "\tSubject is [ears.damage > ears.maxHealth ? "permanently ": "temporarily "] deaf.") healthy = FALSE if(healthy) msg += "\tHealthy.\n" @@ -263,13 +263,13 @@ SLIME SCANNER if(HAS_TRAIT(C, TRAIT_NEARSIGHT)) msg += "\tSubject is nearsighted.\n" healthy = FALSE - if(eyes.eye_damage > 30) + if(eyes.damage > 30) msg += "\tSubject has severe eye damage.\n" healthy = FALSE - else if(eyes.eye_damage > 20) + else if(eyes.damage > 20) msg += "\tSubject has significant eye damage.\n" healthy = FALSE - else if(eyes.eye_damage) + else if(eyes.damage) msg += "\tSubject has minor eye damage.\n" healthy = FALSE if(healthy) @@ -292,7 +292,7 @@ SLIME SCANNER msg += "\tDamage: Brute-Burn-Toxin-Suffocation\n\t\tSpecifics: [brute_loss]-[fire_loss]-[tox_loss]-[oxy_loss]\n" for(var/obj/item/bodypart/org in damaged) msg += "\t\t[capitalize(org.name)]: [(org.brute_dam > 0) ? "[org.brute_dam]" : "0"]-[(org.burn_dam > 0) ? "[org.burn_dam]" : "0"]\n" - + //Organ damages report if(ishuman(M)) var/mob/living/carbon/human/H = M @@ -345,9 +345,6 @@ SLIME SCANNER to_chat(user, minor_damage) to_chat(user, major_damage) to_chat(user, max_damage) - //Genetic damage - if(advanced && H.has_dna()) - to_chat(user, "\tGenetic Stability: [H.dna.stability]%.") // Species and body temperature diff --git a/code/modules/antagonists/changeling/changeling.dm b/code/modules/antagonists/changeling/changeling.dm index 67f6bd1d46..b6e3d66c35 100644 --- a/code/modules/antagonists/changeling/changeling.dm +++ b/code/modules/antagonists/changeling/changeling.dm @@ -340,7 +340,7 @@ if(istype(C)) var/obj/item/organ/brain/B = C.getorganslot(ORGAN_SLOT_BRAIN) if(B) - B.vital = FALSE + B.organ_flags &= ~ORGAN_VITAL B.decoy_override = TRUE update_changeling_icons_added() return diff --git a/code/modules/antagonists/changeling/powers/regenerate.dm b/code/modules/antagonists/changeling/powers/regenerate.dm index a1f8e1ef9b..1b27fa9694 100644 --- a/code/modules/antagonists/changeling/powers/regenerate.dm +++ b/code/modules/antagonists/changeling/powers/regenerate.dm @@ -35,7 +35,7 @@ B = new C.dna.species.mutant_brain() else B = new() - B.vital = FALSE + B.organ_flags &= ~ORGAN_VITAL B.decoy_override = TRUE B.Insert(C) if(ishuman(user)) diff --git a/code/modules/mob/living/brain/brain_item.dm b/code/modules/mob/living/brain/brain_item.dm index 8b1ab66ba0..1d032109db 100644 --- a/code/modules/mob/living/brain/brain_item.dm +++ b/code/modules/mob/living/brain/brain_item.dm @@ -7,7 +7,7 @@ layer = ABOVE_MOB_LAYER zone = BODY_ZONE_HEAD slot = ORGAN_SLOT_BRAIN - organ_flags |= ORGAN_VITAL + organ_flags = ORGAN_VITAL attack_verb = list("attacked", "slapped", "whacked") ///The brain's organ variables are significantly more different than the other organs, with half the decay rate for balance reasons, and twice the maxHealth decay_factor = STANDARD_ORGAN_DECAY / 2 //30 minutes of decaying to result in a fully damaged brain, since a fast decay rate would be unfun gameplay-wise @@ -16,7 +16,7 @@ low_threshold = 45 high_threshold = 120 var/mob/living/brain/brainmob = null - var/organ_flags & ORGAN_FAILING = FALSE //whether the brain organ is damaged. + var/brain_death = FALSE //if the brainmob was intentionally killed by attacking the brain after removal, or by severe braindamage var/decoy_override = FALSE //I apologize to the security players, and myself, who abused this, but this is going to go. //two variables necessary for calculating whether we get a brain trauma or not var/damage_delta = 0 @@ -103,16 +103,16 @@ if((organ_flags & ORGAN_FAILING) && O.is_drainable() && O.reagents.has_reagent("neurine")) //Neurine fixes dead brains . = TRUE //don't do attack animation. - var/cached_Bdamage = brainmob?.health + var/cached_Bdamage = brainmob?.health var/datum/reagent/medicine/neurine/N = reagents.has_reagent("neurine") - if(O.reagents.has_reagent("mannitol")//Just a quick way to bolster the effects if someone mixes up a batch. + if(O.reagents.has_reagent("mannitol"))//Just a quick way to bolster the effects if someone mixes up a batch. N.volume *= 1.5 if(!O.reagents.has_reagent("neurine", 10)) to_chat(user, "There's not enough neurine in [O] to restore [src]!") return - + user.visible_message("[user] starts to pour the contents of [O] onto [src].", "You start to slowly pour the contents of [O] onto [src].") if(!do_after(user, 60, TRUE, src)) to_chat(user, "You failed to pour [O] onto [src]!") @@ -123,10 +123,10 @@ O.reagents.clear_reagents() if(cached_Bdamage) //Fixing dead brains yeilds a trauma - if(cached_Bdamage <= HEALTH_THRESHOLD_DEAD && brainmob.health > HEALTH_THRESHOLD_DEAD) + if((cached_Bdamage <= HEALTH_THRESHOLD_DEAD) && (brainmob.health > HEALTH_THRESHOLD_DEAD)) if(prob(90)) gain_trauma_type(BRAIN_TRAUMA_MILD) - if else(prob(50)) + else if(prob(50)) gain_trauma_type(BRAIN_TRAUMA_SEVERE) else gain_trauma_type(BRAIN_TRAUMA_SPECIAL) @@ -136,8 +136,8 @@ . = TRUE //don't do attack animation. var/datum/reagent/medicine/mannitol/M = reagents.has_reagent("mannitol") if(brain_death || brainmob?.health <= HEALTH_THRESHOLD_DEAD) //if the brain is fucked anyway, do nothing - to_chat(user, "[src] is far too damaged, you'll have to use neurine on it!") - return + to_chat(user, "[src] is far too damaged, you'll have to use neurine on it!") + return if(!O.reagents.has_reagent("mannitol", 10)) to_chat(user, "There's not enough mannitol in [O] to restore [src]!") @@ -152,13 +152,13 @@ setOrganDamage((damage - (0.05 * maxHealth)*M.volume)) //heals a small amount, and by using "setorgandamage", we clear the failing variable if that was up O.reagents.clear_reagents() return - -/obj/item/organ/brain/examine(mob/user)//BUG_PROBABLE_CAUSE to_chats changed to . += + +/obj/item/organ/brain/examine(mob/user)//BUG_PROBABLE_CAUSE to_chats changed to . += . = ..() - if(suicided) + if(user.suiciding) . += "It's started turning slightly grey. They must not have been able to handle the stress of it all." else if(brainmob) if(brainmob.get_ghost(FALSE, TRUE)) @@ -247,6 +247,10 @@ owner.death() brain_death = TRUE +/obj/item/organ/brain/on_death() + if(damage <= BRAIN_DAMAGE_DEATH) //rip + brain_death = FALSE + /obj/item/organ/brain/process() //needs to run in life AND death ..() //if we're not more injured than before, return without gambling for a trauma diff --git a/code/modules/mob/living/brain/life.dm b/code/modules/mob/living/brain/life.dm index 64f2a207a2..51be1f6971 100644 --- a/code/modules/mob/living/brain/life.dm +++ b/code/modules/mob/living/brain/life.dm @@ -20,7 +20,7 @@ else if(istype(loc, /obj/item/organ/brain)) BR = loc if(BR) - BR.organ_flags & ORGAN_FAILING = 1 //beaten to a pulp + BR.brain_death = TRUE /mob/living/brain/proc/handle_emp_damage() if(emp_damage) diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 5cbbc92693..9b5e60a295 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -814,7 +814,6 @@ reagents.clear_reagents() var/obj/item/organ/brain/B = getorgan(/obj/item/organ/brain) if(B) - B.organ_flags & ORGAN_FAILING = FALSE B.brain_death = FALSE for(var/thing in diseases) var/datum/disease/D = thing diff --git a/code/modules/mob/living/carbon/carbon_defense.dm b/code/modules/mob/living/carbon/carbon_defense.dm index 57483f64e7..bc64c8303b 100644 --- a/code/modules/mob/living/carbon/carbon_defense.dm +++ b/code/modules/mob/living/carbon/carbon_defense.dm @@ -405,16 +405,16 @@ if(istype(ears) && (deafen_pwr || damage_pwr)) var/ear_damage = damage_pwr * effect_amount - var/deaf = max(ears.deaf, deafen_pwr * effect_amount) + var/deaf = deafen_pwr * effect_amount adjustEarDamage(ear_damage,deaf) - if(ears.ear_damage >= 15) + if(ears.damage >= 15) to_chat(src, "Your ears start to ring badly!") - if(prob(ears.ear_damage - 5)) + if(prob(ears.damage - 5)) to_chat(src, "You can't hear anything!") - ears.ear_damage = min(ears.ear_damage, UNHEALING_EAR_DAMAGE) + ears.damage = min(ears.damage, ears.maxHealth) // you need earmuffs, inacusiate, or replacement - else if(ears.ear_damage >= 5) + else if(ears.damage >= 5) to_chat(src, "Your ears start to ring!") SEND_SOUND(src, sound('sound/weapons/flash_ring.ogg',0,1,0,250)) return effect_amount //how soundbanged we are diff --git a/code/modules/mob/living/carbon/damage_procs.dm b/code/modules/mob/living/carbon/damage_procs.dm index 5a1878f6bb..cc0c0d7434 100644 --- a/code/modules/mob/living/carbon/damage_procs.dm +++ b/code/modules/mob/living/carbon/damage_procs.dm @@ -147,15 +147,15 @@ if(O) return O.damage -/mob/living/carbon/adjustAllOrganLoss(amount, maximum) - for(var/o in internal_organs) +/mob/living/carbon/proc/adjustAllOrganLoss(amount, maximum) + for(var/obj/item/organ/O in internal_organs) if(O && !(status_flags & GODMODE)) continue if(!maximum) maximum = O.maxHealth O.applyOrganDamage(amount, maximum) O.onDamage(amount, maximum) - + //////////////////////////////////////////// diff --git a/code/modules/mob/living/carbon/life.dm b/code/modules/mob/living/carbon/life.dm index 6b3902bb07..cb155839c6 100644 --- a/code/modules/mob/living/carbon/life.dm +++ b/code/modules/mob/living/carbon/life.dm @@ -49,7 +49,6 @@ //Start of a breath chain, calls breathe() /mob/living/carbon/handle_breathing(times_fired) - /mob/living/carbon/handle_breathing(times_fired) var/next_breath = 4 var/obj/item/organ/lungs/L = getorganslot(ORGAN_SLOT_LUNGS) var/obj/item/organ/heart/H = getorganslot(ORGAN_SLOT_HEART) diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index c22b070340..5c6422c86e 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -500,10 +500,12 @@ mood.sanity = SANITY_GREAT mood.update_mood() //Heal all organs - if(internal_organs) - for(var/organ in internal_organs) - var/obj/item/organ/O = organ - O.setOrganDamage(0) + if(iscarbon(src)) + var/mob/living/carbon/C = src + if(C.internal_organs) + for(var/organ in C.internal_organs) + var/obj/item/organ/O = organ + O.setOrganDamage(0) //proc called by revive(), to check if we can actually ressuscitate the mob (we don't want to revive him and have him instantly die again) diff --git a/code/modules/mob/transform_procs.dm b/code/modules/mob/transform_procs.dm index be907fc1cd..6bbe512776 100644 --- a/code/modules/mob/transform_procs.dm +++ b/code/modules/mob/transform_procs.dm @@ -75,7 +75,7 @@ O.setOxyLoss(getOxyLoss(), 0) O.setCloneLoss(getCloneLoss(), 0) O.adjustFireLoss(getFireLoss(), 0) - O.setBrainLoss(getOrganLoss(ORGAN_SLOT_BRAIN), 0) + O.setOrganLoss(ORGAN_SLOT_BRAIN, getOrganLoss(ORGAN_SLOT_BRAIN), 0) O.adjustStaminaLoss(getStaminaLoss(), 0)//CIT CHANGE - makes monkey transformations inherit stamina O.updatehealth() O.radiation = radiation @@ -236,7 +236,7 @@ O.setOxyLoss(getOxyLoss(), 0) O.setCloneLoss(getCloneLoss(), 0) O.adjustFireLoss(getFireLoss(), 0) - O.setBrainLoss(getOrganLoss(ORGAN_SLOT_BRAIN), 0) + O.setOrganLoss(ORGAN_SLOT_BRAIN, getOrganLoss(ORGAN_SLOT_BRAIN), 0) O.adjustStaminaLoss(getStaminaLoss(), 0)//CIT CHANGE - makes monkey transformations inherit stamina O.updatehealth() O.radiation = radiation diff --git a/code/modules/reagents/chemistry/reagents/medicine_reagents.dm b/code/modules/reagents/chemistry/reagents/medicine_reagents.dm index f6863c6023..951a77b0e8 100644 --- a/code/modules/reagents/chemistry/reagents/medicine_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/medicine_reagents.dm @@ -44,7 +44,7 @@ M.heal_bodypart_damage(5,5) M.adjustToxLoss(-5, 0, TRUE) M.hallucination = 0 - M.setBrainLoss(0) + M.setOrganLoss(ORGAN_SLOT_BRAIN, 0) REMOVE_TRAITS_NOT_IN(M, list(SPECIES_TRAIT, ROUNDSTART_TRAIT, ORGAN_TRAIT)) M.set_blurriness(0) M.set_blindness(0) @@ -856,16 +856,16 @@ if(M.notify_ghost_cloning(source = M)) spawn (100) //so the ghost has time to re-enter return - + else M.adjustOxyLoss(-20, 0) M.adjustToxLoss(-20, 0) var/mob/living/carbon/H = M for(var/organ in H.internal_organs) var/obj/item/organ/O = organ - O.setOrganDamage(0) + O.setOrganDamage(0) M.updatehealth() - + if(M.revive()) M.emote("gasp") log_combat(M, M, "revived", src) diff --git a/code/modules/research/nanites/nanite_programs/healing.dm b/code/modules/research/nanites/nanite_programs/healing.dm index 5d89d3aba5..66a5344d6c 100644 --- a/code/modules/research/nanites/nanite_programs/healing.dm +++ b/code/modules/research/nanites/nanite_programs/healing.dm @@ -198,7 +198,7 @@ if(host_mob.getOrganLoss(ORGAN_SLOT_BRAIN)) return ..() return FALSE - + /datum/nanite_program/brain_heal_advanced/active_effect() host_mob.adjustOrganLoss(ORGAN_SLOT_BRAIN, -2, TRUE) if(iscarbon(host_mob) && prob(10)) @@ -232,7 +232,7 @@ if(!C.getorgan(/obj/item/organ/heart)) //what are we even shocking return FALSE var/obj/item/organ/brain/BR = C.getorgan(/obj/item/organ/brain) - if(QDELETED(BR) || BR.brain_death || (BR.organ_flags & ORGAN_FAILING) || BR.suicided) + if(QDELETED(BR) || BR.brain_death || (BR.organ_flags & ORGAN_FAILING) || C.suiciding) return FALSE if(C.get_ghost()) return FALSE diff --git a/code/modules/surgery/graft_synthtissue.dm b/code/modules/surgery/graft_synthtissue.dm index aeb3205b81..58e4c4a181 100644 --- a/code/modules/surgery/graft_synthtissue.dm +++ b/code/modules/surgery/graft_synthtissue.dm @@ -4,7 +4,7 @@ /datum/surgery/graft_synthtissue name = "Graft_synthtissue" - target_mobtypes = list(/mob/living/carbon/human, /mob/living/carbon/monkey) + species = list(/mob/living/carbon/human, /mob/living/carbon/monkey) possible_locs = list(BODY_ZONE_CHEST) steps = list( /datum/surgery_step/incise, @@ -16,8 +16,8 @@ /datum/surgery_step/close ) -//repair lungs step -/datum/surgery_step/repair_synthtissue +//repair organs +/datum/surgery_step/graft_synthtissue name = "graft synthtissue" implements = list(/obj/item/hemostat = 100, TOOL_SCREWDRIVER = 35, /obj/item/pen = 15) repeatable = TRUE @@ -25,10 +25,8 @@ chems_needed = list("synthtissue") var/obj/item/organ/chosen_organ -//Repair lungs -/datum/surgery_step/repair_synthtissue/preop(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool, datum/surgery/surgery) - if(implement_type in implements_extract) - current_type = "insert" +/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) var/list/organs = target.getorganszone(target_zone) if(!organs.len) to_chat(user, "There are no targetable organs in [target]'s [parse_zone(target_zone)]!") @@ -39,24 +37,23 @@ organs -= O organs[O.name] = O chosen_organ = input("Remove which organ?", "Surgery", null, null) as null|anything in organs - if(chosen_organ.organ_flags & ORGAN_FAILING)) + if(chosen_organ.organ_flags & ORGAN_FAILING) to_chat(user, "[target]'s [chosen_organ] is too damaged to repair graft onto!") return -1 - + user.visible_message("[user] begins to repair damaged portions of [target]'s [chosen_organ].") -/datum/surgery_step/repair_synthtissue/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) +/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) -/datum/surgery_step/repair_synthtissue/failure(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) +/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) return FALSE - diff --git a/code/modules/surgery/organs/augments_internal.dm b/code/modules/surgery/organs/augments_internal.dm index 0648a30fe1..114b92f10d 100644 --- a/code/modules/surgery/organs/augments_internal.dm +++ b/code/modules/surgery/organs/augments_internal.dm @@ -103,7 +103,7 @@ /obj/item/organ/cyberimp/brain/anti_stun/on_life() ..() - if((crit_fail || !(organ_flags & ORGAN_FAILING)) && amount > 0) + if(crit_fail || !(organ_flags & ORGAN_FAILING)) return owner.adjustStaminaLoss(-3.5) //Citadel edit, makes it more useful in Stamina based combat if(owner.AmountStun() > STUN_SET_AMOUNT) diff --git a/code/modules/surgery/organs/liver.dm b/code/modules/surgery/organs/liver.dm index 88d14cfd12..01559c83c3 100755 --- a/code/modules/surgery/organs/liver.dm +++ b/code/modules/surgery/organs/liver.dm @@ -15,10 +15,8 @@ healing_factor = STANDARD_ORGAN_HEALING decay_factor = STANDARD_ORGAN_DECAY - var/damage = 0 //liver damage, 0 is no damage, damage=maxHealth causes liver failure var/alcohol_tolerance = ALCOHOL_RATE//affects how much damage the liver takes from alcohol var/failing //is this liver failing? - var/maxHealth = LIVER_DEFAULT_HEALTH var/toxTolerance = LIVER_DEFAULT_TOX_TOLERANCE//maximum amount of toxins the liver can just shrug off var/toxLethality = LIVER_DEFAULT_TOX_LETHALITY//affects how much damage toxins do to the liver var/filterToxins = TRUE //whether to filter toxins diff --git a/code/modules/surgery/organs/lungs.dm b/code/modules/surgery/organs/lungs.dm index fec66c45a8..4c791c91f2 100644 --- a/code/modules/surgery/organs/lungs.dm +++ b/code/modules/surgery/organs/lungs.dm @@ -416,13 +416,13 @@ var/cold_modifier = H.dna.species.coldmod if(breath_temperature < cold_level_3_threshold) H.apply_damage_type(cold_level_3_damage*cold_modifier, cold_damage_type) - adjustOrganLoss(ORGAN_SLOT_LUNG, (cold_level_3_damage*cold_modifier*2)) + H.adjustOrganLoss(ORGAN_SLOT_LUNGS, (cold_level_3_damage*cold_modifier*2)) if(breath_temperature > cold_level_3_threshold && breath_temperature < cold_level_2_threshold) H.apply_damage_type(cold_level_2_damage*cold_modifier, cold_damage_type) - adjustOrganLoss(ORGAN_SLOT_LUNG, (cold_level_2_damage*cold_modifier*2)) + H.adjustOrganLoss(ORGAN_SLOT_LUNGS, (cold_level_2_damage*cold_modifier*2)) if(breath_temperature > cold_level_2_threshold && breath_temperature < cold_level_1_threshold) H.apply_damage_type(cold_level_1_damage*cold_modifier, cold_damage_type) - adjustOrganLoss(ORGAN_SLOT_LUNG, (cold_level_1_damage*cold_modifier*2)) + H.adjustOrganLoss(ORGAN_SLOT_LUNGS, (cold_level_1_damage*cold_modifier*2)) if(breath_temperature < cold_level_1_threshold) if(prob(20)) to_chat(H, "You feel [cold_message] in your [name]!") @@ -431,13 +431,13 @@ var/heat_modifier = H.dna.species.heatmod if(breath_temperature > heat_level_1_threshold && breath_temperature < heat_level_2_threshold) H.apply_damage_type(heat_level_1_damage*heat_modifier, heat_damage_type) - adjustOrganLoss(ORGAN_SLOT_LUNG, (heat_level_1_damage*heat_modifier*2)) + H.adjustOrganLoss(ORGAN_SLOT_LUNGS, (heat_level_1_damage*heat_modifier*2)) if(breath_temperature > heat_level_2_threshold && breath_temperature < heat_level_3_threshold) H.apply_damage_type(heat_level_2_damage*heat_modifier, heat_damage_type) - adjustOrganLoss(ORGAN_SLOT_LUNG, (heat_level_2_damage*heat_modifier*2)) + H.adjustOrganLoss(ORGAN_SLOT_LUNGS, (heat_level_2_damage*heat_modifier*2)) if(breath_temperature > heat_level_3_threshold) H.apply_damage_type(heat_level_3_damage*heat_modifier, heat_damage_type) - adjustOrganLoss(ORGAN_SLOT_LUNG, (heat_level_3_damage*heat_modifier*2)) + H.adjustOrganLoss(ORGAN_SLOT_LUNGS, (heat_level_3_damage*heat_modifier*2)) if(breath_temperature > heat_level_1_threshold) if(prob(20)) to_chat(H, "You feel [hot_message] in your [name]!") diff --git a/code/modules/surgery/organs/organ_internal.dm b/code/modules/surgery/organs/organ_internal.dm index 13363d9158..65b0888bc7 100644 --- a/code/modules/surgery/organs/organ_internal.dm +++ b/code/modules/surgery/organs/organ_internal.dm @@ -29,17 +29,6 @@ var/high_threshold_cleared var/low_threshold_cleared -/obj/item/organ/proc/Assemble_Failure_Message() //need to assemble a failure message since we can't have variables be based off of the same object's variables - var/name_length - //if no unique failure message is set, output the generic one, otherwise give the one we have set - if(!Unique_Failure_Msg) - name_length = lentext(name) - if(name[name_length] == "s") //plural case, done without much sanitization since I don't know any organ that ends with an "s" that isn't plural at the moment - Unique_Failure_Msg = "Subject's [name] are too damaged to function, and needs to be replaced or fixed!" - else - Unique_Failure_Msg = "Subject's [name] is too damaged to function, and needs to be replaced or fixed!" - return Unique_Failure_Msg - /obj/item/organ/proc/Insert(mob/living/carbon/M, special = 0, drop_if_replaced = TRUE) if(!iscarbon(M) || owner == M) return @@ -94,8 +83,8 @@ var/healing_amount = -(maxHealth * healing_factor) ///Damage decrements again by a percent of its maxhealth, up to a total of 4 extra times depending on the owner's health healing_amount -= owner.satiety > 0 ? 4 * healing_factor * owner.satiety / MAX_SATIETY : 0 - applyOrganDamage(healing_amount) //FERMI_TWEAK - + applyOrganDamage(healing_amount) //to FERMI_TWEAK + /obj/item/organ/examine(mob/user) . = ..() if(organ_flags & ORGAN_FAILING) diff --git a/code/modules/surgery/organs/stomach.dm b/code/modules/surgery/organs/stomach.dm index 0f5a1c2917..f9b4f180e3 100755 --- a/code/modules/surgery/organs/stomach.dm +++ b/code/modules/surgery/organs/stomach.dm @@ -25,9 +25,6 @@ if(!(organ_flags & ORGAN_FAILING)) H.dna.species.handle_digestion(H) handle_disgust(H) - - if(Nutri) - if(damage < low_threshold) return @@ -44,7 +41,7 @@ H.vomit(damage) to_chat(H, "Your stomach reels in pain as you're incapable of holding down all that food!") - + /obj/item/organ/stomach/proc/handle_disgust(mob/living/carbon/human/H) if(H.disgust) diff --git a/code/modules/surgery/organs/tongue.dm b/code/modules/surgery/organs/tongue.dm index 3eaaa8de92..be56a1387b 100644 --- a/code/modules/surgery/organs/tongue.dm +++ b/code/modules/surgery/organs/tongue.dm @@ -10,8 +10,7 @@ var/list/languages_possible var/say_mod = null var/taste_sensitivity = 15 // lower is more sensitive. - var/maxHealth = TONGUE_MAX_HEALTH - var/damage = 0 + maxHealth = TONGUE_MAX_HEALTH var/modifies_speech = FALSE var/static/list/languages_possible_base = typecacheof(list( /datum/language/common, diff --git a/modular_citadel/code/datums/status_effects/chems.dm b/modular_citadel/code/datums/status_effects/chems.dm index 61a107e446..1b1886173b 100644 --- a/modular_citadel/code/datums/status_effects/chems.dm +++ b/modular_citadel/code/datums/status_effects/chems.dm @@ -230,8 +230,7 @@ // owner.remove_status_effect(src)//At the moment, a user can enthrall themselves, toggle this back in if that should be removed. redirect_component = WEAKREF(owner.AddComponent(/datum/component/redirect, list(COMSIG_LIVING_RESIST = CALLBACK(src, .proc/owner_resist)))) //Do resistance calc if resist is pressed# RegisterSignal(owner, COMSIG_MOVABLE_HEAR, .proc/owner_hear) - var/obj/item/organ/brain/B = M.getorganslot(ORGAN_SLOT_BRAIN) //It's their brain! - mental_capacity = 500 - B.get_brain_damage() + mental_capacity = 500 - M.getOrganLoss(ORGAN_SLOT_BRAIN)//It's their brain! var/mob/living/carbon/human/H = owner if(H)//Prefs if(!H.canbearoused) diff --git a/modular_citadel/code/modules/reagents/chemistry/reagents/SDGF.dm b/modular_citadel/code/modules/reagents/chemistry/reagents/SDGF.dm index 8af3176746..84c436cdbd 100644 --- a/modular_citadel/code/modules/reagents/chemistry/reagents/SDGF.dm +++ b/modular_citadel/code/modules/reagents/chemistry/reagents/SDGF.dm @@ -123,7 +123,7 @@ IMPORTANT FACTORS TO CONSIDER WHILE BALANCING //Damage the clone SM.blood_volume = (BLOOD_VOLUME_NORMAL*SM.blood_ratio)/2 SM.adjustCloneLoss(60, 0) - SM.setBrainLoss(40) + SM.setOrganLoss(ORGAN_SLOT_BRAIN, 40) SM.nutrition = startHunger/2 //Transfer remaining reagent to clone. I think around 30u will make a healthy clone, otherwise they'll have clone damage, blood loss, brain damage and hunger. @@ -249,7 +249,7 @@ IMPORTANT FACTORS TO CONSIDER WHILE BALANCING SM.adjustToxLoss(-(bodydamage/10), 0) SM.blood_volume = (BLOOD_VOLUME_NORMAL*SM.blood_ratio)/1.5 SM.adjustCloneLoss((bodydamage/10), 0) - SM.setBrainLoss((bodydamage/10)) + SM.setOrganLoss(ORGAN_SLOT_BRAIN, (bodydamage/10)) SM.nutrition = 400 if(bodydamage>200) SM.gain_trauma_type(BRAIN_TRAUMA_MILD) @@ -289,7 +289,7 @@ IMPORTANT FACTORS TO CONSIDER WHILE BALANCING if(M.blood_volume < (BLOOD_VOLUME_NORMAL*M.blood_ratio)) M.blood_volume += 10 M.adjustCloneLoss(-2, 0) - M.setBrainLoss(-1) + M.setOrganLoss(ORGAN_SLOT_BRAIN, -1) M.nutrition += 10 ..() diff --git a/modular_citadel/code/modules/reagents/chemistry/reagents/fermi_reagents.dm b/modular_citadel/code/modules/reagents/chemistry/reagents/fermi_reagents.dm index 7f3548dd94..a7c4ea00b5 100644 --- a/modular_citadel/code/modules/reagents/chemistry/reagents/fermi_reagents.dm +++ b/modular_citadel/code/modules/reagents/chemistry/reagents/fermi_reagents.dm @@ -287,8 +287,7 @@ if((method==VAPOR) && (!C.wear_mask)) if(prob(20)) to_chat(C, "You can feel your lungs burning!") - var/obj/item/organ/lungs/L = C.getorganslot(ORGAN_SLOT_LUNGS) - L.adjustOrganLoss(ORGAN_SLOT_LUNG, acidstr*2) + C.adjustOrganLoss(ORGAN_SLOT_LUNGS, acidstr*2) C.apply_damage(acidstr/5, BURN, target) C.acid_act(acidstr, volume) ..() diff --git a/modular_citadel/code/modules/reagents/chemistry/reagents/healing.dm b/modular_citadel/code/modules/reagents/chemistry/reagents/healing.dm index b5cc5606b9..3cbccfd2cd 100644 --- a/modular_citadel/code/modules/reagents/chemistry/reagents/healing.dm +++ b/modular_citadel/code/modules/reagents/chemistry/reagents/healing.dm @@ -18,7 +18,7 @@ if(T) T.adjustTongueLoss(C, -2)//Fix the inputs me! if(L) - L.adjustOrganLoss(ORGAN_SLOT_LUNG, -5) + C.adjustOrganLoss(ORGAN_SLOT_LUNGS, -5) C.adjustOxyLoss(-2) else C.adjustOxyLoss(-10) @@ -65,7 +65,7 @@ holder.remove_reagent(src.id, "10") if(!C.getorganslot(ORGAN_SLOT_LUNGS)) - var/obj/item/organ/lungs/yamero/L = new() + var/obj/item/organ/lungs/yamerol/L = new() L.Insert(C) to_chat(C, "You feel the yamerol merge in your chest.") holder.remove_reagent(src.id, "10") @@ -88,8 +88,27 @@ if(T) T.adjustTongueLoss(C, 1) if(L) - L.adjustOrganLoss(ORGAN_SLOT_LUNG, 4) + C.adjustOrganLoss(ORGAN_SLOT_LUNGS, 4) C.adjustOxyLoss(3) else C.adjustOxyLoss(10) ..() + + +/datum/reagent/fermi/synthtissue + name = "Synthtissue" + id = "synthtissue" + description = "Synthetic tissue used for grafting onto damaged organs during surgery, or for treating limb damage." + +/datum/reagent/fermi/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 + if(method in list(PATCH, TOUCH)) + M.apply_damage(volume*1.25, BRUTE, target) + M.apply_damage(volume*1.25, BURN, target) + if(show_message) + to_chat(M, "You feel your damaged [target] heal! It stings like hell!") + SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "painful_medicine", /datum/mood_event/painful_medicine) + ..() diff --git a/tgstation.dme b/tgstation.dme index a84daf855d..e5e65864e7 100755 --- a/tgstation.dme +++ b/tgstation.dme @@ -2483,7 +2483,6 @@ #include "code\modules\projectiles\projectile\special\temperature.dm" #include "code\modules\projectiles\projectile\special\wormhole.dm" #include "code\modules\reagents\chem_splash.dm" -#include "code\modules\reagents\chem_wiki_render.dm" #include "code\modules\reagents\reagent_containers.dm" #include "code\modules\reagents\reagent_dispenser.dm" #include "code\modules\reagents\chemistry\colors.dm" @@ -2718,13 +2717,16 @@ #include "code\modules\surgery\brain_surgery.dm" #include "code\modules\surgery\cavity_implant.dm" #include "code\modules\surgery\core_removal.dm" +#include "code\modules\surgery\coronary_bypass.dm" #include "code\modules\surgery\dental_implant.dm" #include "code\modules\surgery\embalming.dm" #include "code\modules\surgery\eye_surgery.dm" +#include "code\modules\surgery\graft_synthtissue.dm" #include "code\modules\surgery\helpers.dm" #include "code\modules\surgery\implant_removal.dm" #include "code\modules\surgery\limb_augmentation.dm" #include "code\modules\surgery\lipoplasty.dm" +#include "code\modules\surgery\lobectomy.dm" #include "code\modules\surgery\mechanic_steps.dm" #include "code\modules\surgery\nutcracker.dm" #include "code\modules\surgery\organ_manipulation.dm"