From 9a2fa8b1cf40b970585158cf55c5f2c03da01945 Mon Sep 17 00:00:00 2001 From: Cameron Lennox Date: Thu, 27 Nov 2025 23:39:50 -0500 Subject: [PATCH] More surgery tweaks and fixes (#18823) * Surgery Defines Adds some defines to surgery to make it easier to track how 'open' someone is instead of magical numbers. * Make frankensurgery less punishing Makes frankensurgery less painful. Resleeving is a thing and is MUCH easier to do. Having brain surgery apply a permanent debuff to people just means that the 'ideal' thing is to always resleeve/clone. This gets rid of the debuff. * Setting vital in a few places * Makes infected wounds not kill in stomachs Wounds still accumulate in stomachs, BUT the germ level of the external organ won't increase while being digested, meaning you won't get massive infections while doing a long-digestion scene. It was done here instead of in handle_germ_effects() so you can't just eat someone with major infections and act as a statis stomach. * Internal bleeding tweaks Makes internal bleeding slower if you have the IB cure (myelamine) Makes internal bleeding not get worse if you have the dermal equivalents of bicard+inaprovaline * Update neck.dm * Some more aggressive reform healing Makes reform healing do some more healing to bring them back. Instead of healing just 6, heals a flat 25 now of brute, fire, clone, and toxins. It then sees if you're 'below revival point' and if so, it gives you a much stronger heal to ENSURE you are brought back. * forgor to check this in the .dmi This is what happens when you have minitest selected and have your .dme ignored by default! * Update blood.dm * this comment is no longer relevent We have LVADs now! * Makes tourettes not trigger more if you have slow pulse This was presumably meant to increase your chance of a tic if you have a higher pulse, not if you have a slower/more calm pulse. * More edits * Update generic.dm --- code/__defines/surgery.dm | 5 + .../components/disabilities/tourettes.dm | 2 +- code/modules/eventkit/medical_issues.dm | 20 +-- code/modules/mob/_modifiers/cloning.dm | 11 -- code/modules/mob/living/carbon/human/human.dm | 2 +- code/modules/organs/blood.dm | 17 ++- code/modules/organs/internal/brain.dm | 3 +- code/modules/organs/misc.dm | 9 +- code/modules/organs/organ.dm | 2 +- code/modules/organs/organ_external.dm | 6 +- code/modules/organs/subtypes/diona.dm | 6 +- code/modules/organs/subtypes/machine.dm | 4 +- code/modules/organs/subtypes/slime.dm | 6 +- code/modules/organs/subtypes/standard.dm | 6 +- code/modules/surgery/bones.dm | 120 ++++++++---------- code/modules/surgery/encased.dm | 8 +- code/modules/surgery/generic.dm | 48 +++---- code/modules/surgery/neck.dm | 78 +++++++----- code/modules/surgery/other.dm | 10 +- code/modules/surgery/robotics.dm | 14 +- code/modules/vore/eating/vorepanel_vr.dm | 29 ++++- vorestation.dme | 1 + 22 files changed, 211 insertions(+), 196 deletions(-) create mode 100644 code/__defines/surgery.dm diff --git a/code/__defines/surgery.dm b/code/__defines/surgery.dm new file mode 100644 index 0000000000..9e21a4f5f5 --- /dev/null +++ b/code/__defines/surgery.dm @@ -0,0 +1,5 @@ +//Defines for when surgery steps are performed. These are used to track progress through surgeries and how 'open' we are. +#define INCISION_MADE 1 +#define FLESH_RETRACTED 2 +#define BONE_CUT 2.5 +#define BONE_RETRACTED 3 diff --git a/code/datums/components/disabilities/tourettes.dm b/code/datums/components/disabilities/tourettes.dm index 82ba274848..c855b0464d 100644 --- a/code/datums/components/disabilities/tourettes.dm +++ b/code/datums/components/disabilities/tourettes.dm @@ -55,7 +55,7 @@ return if(owner.client && (owner.client.prefs.muted & MUTE_IC)) return - if(owner.paralysis <= 1 && (H.pulse == PULSE_NORM ? (prob(1)) : (prob(50)))) + if(owner.paralysis <= 1 && (H.pulse <= PULSE_NORM ? (prob(1)) : (prob(50)))) owner.make_jittery(30 + rand(10, 30)) owner.emote(pick(motor_tics)) diff --git a/code/modules/eventkit/medical_issues.dm b/code/modules/eventkit/medical_issues.dm index e4cbced136..92444988e7 100644 --- a/code/modules/eventkit/medical_issues.dm +++ b/code/modules/eventkit/medical_issues.dm @@ -284,7 +284,7 @@ return 0 for(var/datum/medical_issue/MI in affected.medical_issues) if(MI.cure_surgery == "bone reinforcement") - return affected && (affected.robotic < ORGAN_ROBOT) && affected.open >= 2 + return affected && (affected.robotic < ORGAN_ROBOT) && affected.open >= FLESH_RETRACTED return 0 /datum/surgery_step/medical_issue/strengthen_bone/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) @@ -325,7 +325,7 @@ return 0 for(var/datum/medical_issue/MI in affected.medical_issues) if(MI.cure_surgery == "remove growths") - return affected && (affected.robotic < ORGAN_ROBOT) && affected.open >= 2 + return affected && (affected.robotic < ORGAN_ROBOT) && affected.open >= FLESH_RETRACTED return 0 /datum/surgery_step/medical_issue/remove_growth/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) @@ -366,7 +366,7 @@ return 0 for(var/datum/medical_issue/MI in affected.medical_issues) if(MI.cure_surgery == "redirect blood vessels") - return affected && (affected.robotic < ORGAN_ROBOT) && affected.open >= 2 + return affected && (affected.robotic < ORGAN_ROBOT) && affected.open >= FLESH_RETRACTED return 0 /datum/surgery_step/medical_issue/redirect_vessels/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) @@ -407,7 +407,7 @@ return 0 for(var/datum/medical_issue/MI in affected.medical_issues) if(MI.cure_surgery == "extract object") - return affected && (affected.robotic < ORGAN_ROBOT) && affected.open >= 2 + return affected && (affected.robotic < ORGAN_ROBOT) && affected.open >= FLESH_RETRACTED return 0 /datum/surgery_step/medical_issue/extract_object/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) @@ -448,7 +448,7 @@ return 0 for(var/datum/medical_issue/MI in affected.medical_issues) if(MI.cure_surgery == "flesh graft") - return affected && (affected.robotic < ORGAN_ROBOT) && affected.open >= 2 + return affected && (affected.robotic < ORGAN_ROBOT) && affected.open >= FLESH_RETRACTED return 0 /datum/surgery_step/medical_issue/flesh_graft/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) @@ -492,7 +492,7 @@ for(var/obj/item/organ/internal/I in affected.internal_organs) for(var/datum/medical_issue/MI in I.medical_issues) if(MI.cure_surgery == "remove growths") - return affected && (affected.robotic < ORGAN_ROBOT) && affected.open >= 2 + return affected && (affected.robotic < ORGAN_ROBOT) && affected.open >= FLESH_RETRACTED return 0 /datum/surgery_step/medical_issue/remove_growth_internal/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) @@ -535,7 +535,7 @@ for(var/obj/item/organ/internal/I in affected.internal_organs) for(var/datum/medical_issue/MI in I.medical_issues) if(MI.cure_surgery == "redirect blood vessels") - return affected && (affected.robotic < ORGAN_ROBOT) && affected.open >= 2 + return affected && (affected.robotic < ORGAN_ROBOT) && affected.open >= FLESH_RETRACTED return 0 /datum/surgery_step/medical_issue/redirect_vessels_internal/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) @@ -578,7 +578,7 @@ for(var/obj/item/organ/internal/I in affected.internal_organs) for(var/datum/medical_issue/MI in I.medical_issues) if(MI.cure_surgery == "close holes") - return affected && (affected.robotic < ORGAN_ROBOT) && affected.open >= 2 + return affected && (affected.robotic < ORGAN_ROBOT) && affected.open >= FLESH_RETRACTED return 0 /datum/surgery_step/medical_issue/close_holes/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) @@ -621,7 +621,7 @@ for(var/obj/item/organ/internal/I in affected.internal_organs) for(var/datum/medical_issue/MI in I.medical_issues) if(MI.cure_surgery == "ultrasound") - return affected && (affected.robotic < ORGAN_ROBOT) && affected.open >= 2 + return affected && (affected.robotic < ORGAN_ROBOT) && affected.open >= FLESH_RETRACTED return 0 /datum/surgery_step/medical_issue/ultrasound/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) @@ -664,7 +664,7 @@ for(var/obj/item/organ/internal/I in affected.internal_organs) for(var/datum/medical_issue/MI in I.medical_issues) if(MI.cure_surgery == "reoxygenate tissue") - return affected && (affected.robotic < ORGAN_ROBOT) && affected.open >= 2 + return affected && (affected.robotic < ORGAN_ROBOT) && affected.open >= FLESH_RETRACTED return 0 /datum/surgery_step/medical_issue/reoxygenate_tissue/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) diff --git a/code/modules/mob/_modifiers/cloning.dm b/code/modules/mob/_modifiers/cloning.dm index eec03ab9d2..f51d1eab17 100644 --- a/code/modules/mob/_modifiers/cloning.dm +++ b/code/modules/mob/_modifiers/cloning.dm @@ -79,7 +79,6 @@ outgoing_melee_damage_percent = 0.9 // 10% less melee damage. disable_duration_percent = 1.25 // Stuns last 25% longer. incoming_healing_percent = 0.9 // -10% to all healing - slowdown = 0.5 // Slower, by a smidge. evasion = -5 // 5% easier to hit. accuracy_dispersion = 1 // Inaccurate trait level of tile dispersion. @@ -93,16 +92,6 @@ return ..() -/datum/modifier/franken_sickness/tick() - if(holder.stat != DEAD) - if(ishuman(holder)) - var/mob/living/carbon/human/F = holder - if(F.can_defib) - F.can_defib = 0 - -/datum/modifier/franken_sickness/on_expire() //Not permanent, but its child is. - holder.add_modifier(/datum/modifier/franken_recovery, 0) - /datum/modifier/franken_recovery //When Franken_Sickness expires, this will be permanently applied in its place. name = "neural recovery" desc = "You feel out of touch, as your central nervous system is still recovering from being repaired." diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index c6383f22a2..16a08034d5 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -1216,7 +1216,7 @@ if(src.pulse) to_chat(usr, span_notice("[self ? "You have a" : "[src] has a"] pulse! Counting...")) else - to_chat(usr, span_danger("[src] has no pulse!")) //it is REALLY UNLIKELY that a dead person would check his own pulse + to_chat(usr, span_danger("[src] has no pulse!")) return to_chat(usr, span_filter_notice("You must[self ? "" : " both"] remain still until counting is finished.")) diff --git a/code/modules/organs/blood.dm b/code/modules/organs/blood.dm index 72cf4e3635..89503a0bbc 100644 --- a/code/modules/organs/blood.dm +++ b/code/modules/organs/blood.dm @@ -184,20 +184,23 @@ BLOOD_VOLUME_SURVIVE = 40 ///Second, we process internal bleeding. for(var/datum/wound/internal_bleeding/W in temp.wounds) blood_loss_divisor = blood_loss_divisor+10 //IB is slower bloodloss than normal. - var/bicardose = reagents.get_reagent_amount(REAGENT_ID_BICARIDINE) - var/inaprovaline = reagents.get_reagent_amount(REAGENT_ID_INAPROVALINE) + var/bicardose + if(reagents.get_reagent_amount(REAGENT_ID_BICARIDINE) || reagents.get_reagent_amount(REAGENT_ID_BICARIDAZE)) + bicardose = TRUE + var/inaprovaline + if(reagents.get_reagent_amount(REAGENT_ID_INAPROVALINE) || reagents.get_reagent_amount(REAGENT_ID_INAPROVALAZE)) + inaprovaline = TRUE var/myeldose = reagents.get_reagent_amount(REAGENT_ID_MYELAMINE) if(!(W.can_autoheal() || (bicardose && inaprovaline) || myeldose)) //bicaridine and inaprovaline stop internal wounds from growing bigger with time, unless it is so small that it is already healing W.open_wound(0.1) if(prob(1)) custom_pain("You feel a stabbing pain in your [temp.name]!", 50) - if(CE_STABLE in chem_effects) + if((CE_STABLE in chem_effects) || myeldose) blood_loss_divisor = max(blood_loss_divisor + 30, 1) //Inaprovaline is great on internal wounds. if(temp.applied_pressure) //Putting pressure on the afflicted wound helps stop the arterial bleeding. - if(ishuman(temp.applied_pressure)) - var/mob/living/carbon/human/H = temp.applied_pressure - H.bloody_hands(src, 0) - blood_loss_divisor += 30 //If you're putting pressure on that limb due to there being an external bleed there, you apply some pressure to the internal bleed as well. + blood_loss_divisor += 30 + if(W.clamped) + blood_loss_divisor = blood_loss_divisor * 10 //We hemostatted the internal bleeding. Bloodloss is 10 times slower. remove_blood(W.damage/blood_loss_divisor) //line should possibly be moved to handle_blood, so all the bleeding stuff is in one place. //Hi. 2025 here. Just did that. ~Diana ///Thirdly, we check to see if the limb is bleeding EXTERNALLY diff --git a/code/modules/organs/internal/brain.dm b/code/modules/organs/internal/brain.dm index f07c7a2c8e..d7e71d7406 100644 --- a/code/modules/organs/internal/brain.dm +++ b/code/modules/organs/internal/brain.dm @@ -6,7 +6,7 @@ GLOBAL_LIST_BOILERPLATE(all_brain_organs, /obj/item/organ/internal/brain) desc = "A piece of juicy meat found in a person's head." organ_tag = O_BRAIN parent_organ = BP_HEAD - vital = 1 + vital = TRUE icon_state = "brain2" force = 1.0 w_class = ITEMSIZE_SMALL @@ -177,7 +177,6 @@ GLOBAL_LIST_BOILERPLATE(all_brain_organs, /obj/item/organ/internal/brain) parent_organ = BP_HEAD icon = 'icons/mob/alien.dmi' icon_state = "chitin" - vital = 1 can_assist = FALSE /obj/item/organ/internal/brain/xeno diff --git a/code/modules/organs/misc.dm b/code/modules/organs/misc.dm index e51cab174b..85fef3eea3 100644 --- a/code/modules/organs/misc.dm +++ b/code/modules/organs/misc.dm @@ -48,14 +48,7 @@ parent_organ = BP_HEAD icon_state = "brain_prosthetic" organ_tag = "stack" - vital = 1 - var/backup_time = 0 - var/datum/mind/backup - -/obj/item/organ/internal/stack/process() - if(owner && owner.stat != DEAD && !is_broken()) - backup_time = world.time - if(owner.mind) backup = owner.mind + vital = TRUE /obj/item/organ/internal/stack/vox/stack name = "vox cortical stack" diff --git a/code/modules/organs/organ.dm b/code/modules/organs/organ.dm index 624fee4876..78c15ca5cc 100644 --- a/code/modules/organs/organ.dm +++ b/code/modules/organs/organ.dm @@ -140,7 +140,7 @@ var/list/organ_cache = list() STOP_PROCESSING(SSobj, src) handle_organ_mod_special(TRUE) if(owner && vital) - owner.can_defib = 0 + owner.can_defib = FALSE owner.death() /obj/item/organ/proc/adjust_germ_level(var/amount) // Unless you're setting germ level directly to 0, use this proc instead diff --git a/code/modules/organs/organ_external.dm b/code/modules/organs/organ_external.dm index f03596b6aa..b270005687 100644 --- a/code/modules/organs/organ_external.dm +++ b/code/modules/organs/organ_external.dm @@ -737,13 +737,15 @@ Note that amputating the affected organ does in fact remove the infection from t handle_germ_effects() /obj/item/organ/external/proc/handle_germ_sync() + if(owner && isbelly(owner.loc)) //If we're in a belly, just skip infection spreading. This leads to extended vore scenes killing via infection. + return var/antibiotics = owner.chem_effects[CE_ANTIBIOTIC] for(var/datum/wound/W in wounds) //Open wounds can become infected - if (owner.germ_level > W.germ_level && W.infection_check()) + if(owner.germ_level > W.germ_level && W.infection_check()) W.germ_level++ - if (antibiotics < ANTIBIO_NORM) + if(!antibiotics) for(var/datum/wound/W in wounds) //Infected wounds raise the organ's germ level if (W.germ_level > germ_level) diff --git a/code/modules/organs/subtypes/diona.dm b/code/modules/organs/subtypes/diona.dm index 92bfe1c73e..64f9b4f8d4 100644 --- a/code/modules/organs/subtypes/diona.dm +++ b/code/modules/organs/subtypes/diona.dm @@ -32,8 +32,8 @@ min_broken_damage = 50 w_class = ITEMSIZE_HUGE body_part = UPPER_TORSO - vital = 1 - cannot_amputate = 1 + vital = TRUE + cannot_amputate = TRUE parent_organ = null gendered_icon = 1 @@ -242,5 +242,5 @@ amputation_point = "branch" joint = "structural ligament" dislocated = -1 - vital = 0 + vital = FALSE slot_flags = SLOT_BELT diff --git a/code/modules/organs/subtypes/machine.dm b/code/modules/organs/subtypes/machine.dm index 66f3b6fa2d..7534f6779a 100644 --- a/code/modules/organs/subtypes/machine.dm +++ b/code/modules/organs/subtypes/machine.dm @@ -4,7 +4,7 @@ icon_state = "scell" organ_tag = O_CELL parent_organ = BP_TORSO - vital = 1 + vital = TRUE var/defib_timer = 1 // This sits in the brain organ slot, but is not a brain. /obj/item/organ/internal/cell/Initialize(mapload, internal) @@ -34,7 +34,7 @@ name = "brain interface" organ_tag = O_BRAIN parent_organ = BP_HEAD - vital = 1 + vital = TRUE var/brain_type = /obj/item/mmi var/obj/item/mmi/stored_mmi robotic = ORGAN_ASSISTED diff --git a/code/modules/organs/subtypes/slime.dm b/code/modules/organs/subtypes/slime.dm index f640ba9b6a..2624eb6532 100644 --- a/code/modules/organs/subtypes/slime.dm +++ b/code/modules/organs/subtypes/slime.dm @@ -51,10 +51,10 @@ /obj/item/organ/external/head/unbreakable/slime //They don't need this anymore. nonsolid = 1 - cannot_gib = 0 - vital = 0 + cannot_gib = FALSE + vital = FALSE max_damage = 30 - encased = 0 + encased = FALSE spread_dam = 1 /* diff --git a/code/modules/organs/subtypes/standard.dm b/code/modules/organs/subtypes/standard.dm index e70637746c..3e3123685b 100644 --- a/code/modules/organs/subtypes/standard.dm +++ b/code/modules/organs/subtypes/standard.dm @@ -12,7 +12,7 @@ min_broken_damage = 35 w_class = ITEMSIZE_HUGE body_part = UPPER_TORSO - vital = 1 + vital = TRUE amputation_point = "spine" joint = "neck" dislocated = -1 @@ -62,7 +62,7 @@ min_broken_damage = 35 w_class = ITEMSIZE_LARGE body_part = LOWER_TORSO - vital = 1 + vital = TRUE parent_organ = BP_TORSO amputation_point = "lumbar" joint = "hip" @@ -275,7 +275,7 @@ min_broken_damage = 35 w_class = ITEMSIZE_NORMAL body_part = HEAD - vital = 1 + vital = TRUE parent_organ = BP_TORSO joint = "jaw" amputation_point = "neck" diff --git a/code/modules/surgery/bones.dm b/code/modules/surgery/bones.dm index 2968208a46..0d34f77c78 100644 --- a/code/modules/surgery/bones.dm +++ b/code/modules/surgery/bones.dm @@ -3,11 +3,27 @@ // BONE SURGERY // ////////////////////////////////////////////////////////////////// +/datum/surgery_step/bones + +/datum/surgery_step/bones/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) + if(!ishuman(target)) + return FALSE + var/obj/item/organ/external/affected = target.get_organ(target_zone) + if(!(affected.status & ORGAN_BROKEN)) + return FALSE + if(coverage_check(user, target, affected, tool)) + return FALSE + if(affected.cannot_break && !affected.encased) + return FALSE + if(affected.robotic >= ORGAN_ROBOT) + return FALSE + return TRUE + /////////////////////////////////////////////////////////////// // Bone Glue Surgery /////////////////////////////////////////////////////////////// -/datum/surgery_step/glue_bone +/datum/surgery_step/bones/glue_bone surgery_name = "Glue Bone" allowed_tools = list( /obj/item/surgical/bonegel = 100 @@ -21,15 +37,11 @@ min_duration = 50 max_duration = 60 -/datum/surgery_step/glue_bone/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - if(!ishuman(target)) - return 0 +/datum/surgery_step/bones/glue_bone/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) - if(coverage_check(user, target, affected, tool)) - return 0 - return affected && (affected.robotic < ORGAN_ROBOT) && affected.open >= 2 && affected.stage == 0 + return ..() && affected.open >= FLESH_RETRACTED && affected.stage == 0 -/datum/surgery_step/glue_bone/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) +/datum/surgery_step/bones/glue_bone/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) if (affected.stage == 0) user.visible_message(span_notice("[user] starts applying medication to the damaged bones in [target]'s [affected.name] with \the [tool].") , \ @@ -38,14 +50,14 @@ target.custom_pain("Something in your [affected.name] is causing you a lot of pain!", 50) ..() -/datum/surgery_step/glue_bone/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) +/datum/surgery_step/bones/glue_bone/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) user.visible_message(span_notice("[user] applies some [tool] to [target]'s bone in [affected.name]"), \ span_notice("You apply some [tool] to [target]'s bone in [affected.name] with \the [tool].")) user.balloon_alert_visible("applies [tool] to [target]'s bone.", "applying [tool] to [target]'s bone.") affected.stage = 1 -/datum/surgery_step/glue_bone/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) +/datum/surgery_step/bones/glue_bone/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) user.visible_message(span_danger("[user]'s hand slips, smearing [tool] in the incision in [target]'s [affected.name]!") , \ span_danger("Your hand slips, smearing [tool] in the incision in [target]'s [affected.name]!")) @@ -55,7 +67,7 @@ // Bone Setting Surgery /////////////////////////////////////////////////////////////// -/datum/surgery_step/set_bone +/datum/surgery_step/bones/set_bone surgery_name = "Set Bone" allowed_tools = list( /obj/item/surgical/bonesetter = 100 @@ -64,17 +76,13 @@ allowed_procs = list(IS_WRENCH = 75) min_duration = 60 - max_duration = 70 + max_duration = 60 -/datum/surgery_step/set_bone/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - if(!ishuman(target)) - return 0 +/datum/surgery_step/bones/set_bone/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) - if(coverage_check(user, target, affected, tool)) - return 0 - return affected && affected.organ_tag != BP_HEAD && !(affected.robotic >= ORGAN_ROBOT) && affected.open >= 2 && affected.stage == 1 + return ..() && affected.organ_tag != BP_HEAD && affected.open >= FLESH_RETRACTED && affected.stage == 1 -/datum/surgery_step/set_bone/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) +/datum/surgery_step/bones/set_bone/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) user.visible_message(span_notice("[user] is beginning to set the bone in [target]'s [affected.name] in place with \the [tool].") , \ span_notice("You are beginning to set the bone in [target]'s [affected.name] in place with \the [tool].")) @@ -82,20 +90,14 @@ target.custom_pain("The pain in your [affected.name] is going to make you pass out!", 50) ..() -/datum/surgery_step/set_bone/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) +/datum/surgery_step/bones/set_bone/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) - if (affected.status & ORGAN_BROKEN) - user.visible_message(span_notice("[user] sets the bone in [target]'s [affected.name] in place with \the [tool]."), \ - span_notice("You set the bone in [target]'s [affected.name] in place with \the [tool].")) - user.balloon_alert_visible("sets the bone in place.", "bone set in place.") - affected.stage = 2 - else - user.visible_message("[user] sets the bone in [target]'s [affected.name] " + span_danger("in the WRONG place with \the [tool]."), \ - "You set the bone in [target]'s [affected.name] " + span_danger("in the WRONG place with \the [tool].")) - user.balloon_alert_visible("sets the bone in the WRONG place.", "bone set in the WRONG place.") - affected.fracture() + user.visible_message(span_notice("[user] sets the bone in [target]'s [affected.name] in place with \the [tool]."), \ + span_notice("You set the bone in [target]'s [affected.name] in place with \the [tool].")) + user.balloon_alert_visible("sets the bone in place.", "bone set in place.") + affected.stage = 2 -/datum/surgery_step/set_bone/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) +/datum/surgery_step/bones/set_bone/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) user.visible_message(span_danger("[user]'s hand slips, damaging the bone in [target]'s [affected.name] with \the [tool]!") , \ span_danger("Your hand slips, damaging the bone in [target]'s [affected.name] with \the [tool]!")) @@ -106,7 +108,7 @@ // Skull Mending Surgery /////////////////////////////////////////////////////////////// -/datum/surgery_step/mend_skull +/datum/surgery_step/bones/mend_skull surgery_name = "Mend Skull" allowed_tools = list( /obj/item/surgical/bonesetter = 100 @@ -115,43 +117,39 @@ allowed_procs = list(IS_WRENCH = 75) min_duration = 60 - max_duration = 70 + max_duration = 60 -/datum/surgery_step/mend_skull/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - if(!ishuman(target)) - return 0 +/datum/surgery_step/bones/mend_skull/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) - if(coverage_check(user, target, affected, tool)) - return 0 - return affected && affected.organ_tag == BP_HEAD && (affected.robotic < ORGAN_ROBOT) && affected.open >= 2 && affected.stage == 1 + return ..() && affected.organ_tag == BP_HEAD && affected.open >= FLESH_RETRACTED && affected.stage == 1 -/datum/surgery_step/mend_skull/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) +/datum/surgery_step/bones/mend_skull/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) user.visible_message(span_notice("[user] is beginning to piece together [target]'s skull with \the [tool].") , \ span_notice("You are beginning to piece together [target]'s skull with \the [tool].")) user.balloon_alert_visible("pieces the skull together", "piecing skull together.") ..() -/datum/surgery_step/mend_skull/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) +/datum/surgery_step/bones/mend_skull/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) user.visible_message(span_notice("[user] sets [target]'s skull with \the [tool].") , \ span_notice("You set [target]'s skull with \the [tool].")) user.balloon_alert_visible("sets the skull back.", "skull set back.") affected.stage = 2 -/datum/surgery_step/mend_skull/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) +/datum/surgery_step/bones/mend_skull/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) user.visible_message(span_danger("[user]'s hand slips, damaging [target]'s face with \the [tool]!") , \ span_danger("Your hand slips, damaging [target]'s face with \the [tool]!")) user.balloon_alert_visible("slips, damaging [target]'s face", "your hand slips, damaging [target]'s face") var/obj/item/organ/external/head/h = affected h.createwound(BRUISE, 10) - h.disfigured = 1 + h.disfigure() /////////////////////////////////////////////////////////////// // Bone Fixing Surgery /////////////////////////////////////////////////////////////// -/datum/surgery_step/finish_bone +/datum/surgery_step/bones/finish_bone surgery_name = "Finish Mending Bone" allowed_tools = list( /obj/item/surgical/bonegel = 100 @@ -163,24 +161,20 @@ blood_level = 1 min_duration = 50 - max_duration = 60 + max_duration = 50 -/datum/surgery_step/finish_bone/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - if(!ishuman(target)) - return 0 +/datum/surgery_step/bones/finish_bone/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) - if(coverage_check(user, target, affected, tool)) - return 0 - return affected && affected.open >= 2 && !(affected.robotic >= ORGAN_ROBOT) && affected.stage == 2 + return ..() && affected.open >= FLESH_RETRACTED && affected.stage == 2 -/datum/surgery_step/finish_bone/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) +/datum/surgery_step/bones/finish_bone/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) user.visible_message(span_notice("[user] starts to finish mending the damaged bones in [target]'s [affected.name] with \the [tool]."), \ span_notice("You start to finish mending the damaged bones in [target]'s [affected.name] with \the [tool].")) user.balloon_alert_visible("begins mending damaged bones.", "mending damaged bones.") ..() -/datum/surgery_step/finish_bone/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) +/datum/surgery_step/bones/finish_bone/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) user.visible_message(span_notice("[user] has mended the damaged bones in [target]'s [affected.name] with \the [tool].") , \ span_notice("You have mended the damaged bones in [target]'s [affected.name] with \the [tool].") ) @@ -188,7 +182,7 @@ affected.status &= ~ORGAN_BROKEN affected.stage = 0 -/datum/surgery_step/finish_bone/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) +/datum/surgery_step/bones/finish_bone/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) user.visible_message(span_danger("[user]'s hand slips, smearing [tool] in the incision in [target]'s [affected.name]!") , \ span_danger("Your hand slips, smearing [tool] in the incision in [target]'s [affected.name]!")) @@ -198,7 +192,7 @@ // Bone Clamp Surgery /////////////////////////////////////////////////////////////// -/datum/surgery_step/clamp_bone +/datum/surgery_step/bones/clamp_bone surgery_name = "Clamp Bone" allowed_tools = list( /obj/item/surgical/bone_clamp = 100 @@ -208,17 +202,13 @@ blood_level = 1 min_duration = 70 - max_duration = 90 + max_duration = 70 -/datum/surgery_step/clamp_bone/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - if(!ishuman(target)) - return 0 +/datum/surgery_step/bones/clamp_bone/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) - if(coverage_check(user, target, affected, tool)) - return 0 - return affected && (affected.status & ORGAN_BROKEN) && (affected.robotic < ORGAN_ROBOT) && affected.open >= 2 && affected.stage == 0 + return ..() && affected.open >= FLESH_RETRACTED && affected.stage == 0 -/datum/surgery_step/clamp_bone/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) +/datum/surgery_step/bones/clamp_bone/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) if (affected.stage == 0) user.visible_message(span_notice("[user] starts repairing the damaged bones in [target]'s [affected.name] with \the [tool].") , \ @@ -227,14 +217,14 @@ target.custom_pain("Something in your [affected.name] is causing you a lot of pain!", 50) ..() -/datum/surgery_step/clamp_bone/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) +/datum/surgery_step/bones/clamp_bone/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) user.visible_message(span_notice("[user] sets the bone in [target]'s [affected.name] with \the [tool]."), \ span_notice("You sets [target]'s bone in [affected.name] with \the [tool].")) user.balloon_alert_visible("sets the bone back in.", "bone set in.") affected.status &= ~ORGAN_BROKEN -/datum/surgery_step/clamp_bone/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) +/datum/surgery_step/bones/clamp_bone/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) user.visible_message(span_danger("[user]'s hand slips, damaging the bone in [target]'s [affected.name] with \the [tool]!") , \ span_danger("Your hand slips, damaging the bone in [target]'s [affected.name] with \the [tool]!")) diff --git a/code/modules/surgery/encased.dm b/code/modules/surgery/encased.dm index de00fed839..9950bfbca4 100644 --- a/code/modules/surgery/encased.dm +++ b/code/modules/surgery/encased.dm @@ -15,7 +15,7 @@ var/obj/item/organ/external/affected = target.get_organ(target_zone) if(coverage_check(user, target, affected, tool)) return 0 - return affected && !(affected.robotic >= ORGAN_ROBOT) && affected.encased && affected.open >= 2 + return affected && !(affected.robotic >= ORGAN_ROBOT) && affected.encased && affected.open >= FLESH_RETRACTED /////////////////////////////////////////////////////////////// // Rib Sawing Surgery @@ -148,7 +148,7 @@ if(!ishuman(target)) return var/obj/item/organ/external/affected = target.get_organ(target_zone) - return (..() && affected && affected.open == 3) + return (..() && affected && affected.open == BONE_RETRACTED) /datum/surgery_step/open_encased/close/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) if(!ishuman(target)) @@ -255,7 +255,7 @@ if(!ishuman(target)) return var/obj/item/organ/external/affected = target.get_organ(target_zone) - return ..() && affected && affected.open >= 2 && affected.open < 3 + return ..() && affected && affected.open >= FLESH_RETRACTED && affected.open < BONE_RETRACTED /datum/surgery_step/open_encased/advancedsaw_open/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) if(!ishuman(target)) @@ -308,7 +308,7 @@ if(!ishuman(target)) return var/obj/item/organ/external/affected = target.get_organ(target_zone) - return (..() && affected && affected.open == 3) + return (..() && affected && affected.open == BONE_RETRACTED) /datum/surgery_step/open_encased/advancedsaw_mend/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) if(!ishuman(target)) diff --git a/code/modules/surgery/generic.dm b/code/modules/surgery/generic.dm index a6778ea6b6..1fcad53b75 100644 --- a/code/modules/surgery/generic.dm +++ b/code/modules/surgery/generic.dm @@ -3,7 +3,7 @@ // COMMON STEPS // ////////////////////////////////////////////////////////////////// -/datum/surgery_step/generic/ +/datum/surgery_step/generic can_infect = 1 /datum/surgery_step/generic/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) @@ -38,12 +38,12 @@ req_open = 0 min_duration = 90 - max_duration = 110 + max_duration = 90 /datum/surgery_step/generic/cut_open/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) if(..()) var/obj/item/organ/external/affected = target.get_organ(target_zone) - return affected && affected.open == 0 && target_zone != O_MOUTH + return affected && !affected.open && target_zone != O_MOUTH /datum/surgery_step/generic/cut_open/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) @@ -58,7 +58,7 @@ user.visible_message(span_notice("[user] has made an incision on [target]'s [affected.name] with \the [tool]."), \ span_notice("You have made an incision on [target]'s [affected.name] with \the [tool]."),) user.balloon_alert_visible("opens an incision on [target]'s [affected.name]", "incision open on \the [affected.name]") - affected.open = 1 + affected.open = INCISION_MADE if(istype(target) && target.should_have_organ(O_HEART)) affected.status |= ORGAN_BLEEDING @@ -87,13 +87,13 @@ priority = 2 req_open = 0 min_duration = 90 - max_duration = 110 + max_duration = 90 excludes_steps = list(/datum/surgery_step/generic/cut_open) /datum/surgery_step/generic/cut_with_laser/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) if(..()) var/obj/item/organ/external/affected = target.get_organ(target_zone) - return affected && affected.open == 0 && target_zone != O_MOUTH + return affected && !affected.open && target_zone != O_MOUTH /datum/surgery_step/generic/cut_with_laser/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) @@ -105,7 +105,7 @@ /datum/surgery_step/generic/cut_with_laser/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) - affected.open = 1 + affected.open = INCISION_MADE affected.createwound(CUT, 1) var/clamp_chance = 0 @@ -121,9 +121,6 @@ user.visible_message(span_notice("[user] has made an incision on [target]'s [affected.name] with \the [tool], but blood is still escaping from the wound."), \ span_notice("You have made an incision on [target]'s [affected.name] with \the [tool], but blood is still coming from the wound.."),) user.balloon_alert_visible("opens an incision on [target]'s [affected.name], blood still flowing", "incision open on \the [affected.name], but blood still flows") - //Could be cleaner ... - - spread_germs_to_organ(affected, user) /datum/surgery_step/generic/cut_with_laser/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) @@ -146,13 +143,13 @@ priority = 2 req_open = 0 min_duration = 80 - max_duration = 120 + max_duration = 80 excludes_steps = list(/datum/surgery_step/generic/cut_open) /datum/surgery_step/generic/incision_manager/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) if(..()) var/obj/item/organ/external/affected = target.get_organ(target_zone) - return affected && affected.open == 0 && target_zone != O_MOUTH + return affected && !affected.open && target_zone != O_MOUTH /datum/surgery_step/generic/incision_manager/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) @@ -167,14 +164,14 @@ user.visible_message(span_notice("[user] has constructed a prepared incision on and within [target]'s [affected.name] with \the [tool]."), \ span_notice("You have constructed a prepared incision on and within [target]'s [affected.name] with \the [tool]."),) user.balloon_alert_visible("constructs a prepared incision", "constructed prepared incision") - affected.open = 1 + affected.open = INCISION_MADE if(istype(target) && target.should_have_organ(O_HEART)) affected.status |= ORGAN_BLEEDING affected.createwound(CUT, 1) affected.organ_clamp() - affected.open = 2 + affected.open = FLESH_RETRACTED /datum/surgery_step/generic/incision_manager/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) @@ -197,12 +194,20 @@ ) min_duration = 40 - max_duration = 60 + max_duration = 40 /datum/surgery_step/generic/clamp_bleeders/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) if(..()) var/obj/item/organ/external/affected = target.get_organ(target_zone) - return affected && affected.open && (affected.status & ORGAN_BLEEDING) + if(!affected) + return FALSE + var/internally_bleeding = FALSE + for(var/datum/wound/internal_bleeding/W in affected.wounds) + if(W.clamped) + continue + internally_bleeding = TRUE + break + return affected && affected.open && ((affected.status & ORGAN_BLEEDING) || internally_bleeding) /datum/surgery_step/generic/clamp_bleeders/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) @@ -218,7 +223,6 @@ span_notice("You clamp bleeders in [target]'s [affected.name] with \the [tool].")) user.balloon_alert_visible("clamps bleeders", "clamped bleeders") affected.organ_clamp() - spread_germs_to_organ(affected, user) /datum/surgery_step/generic/clamp_bleeders/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) @@ -241,12 +245,12 @@ allowed_procs = list(IS_CROWBAR = 75) min_duration = 30 - max_duration = 40 + max_duration = 30 /datum/surgery_step/generic/retract_skin/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) if(..()) var/obj/item/organ/external/affected = target.get_organ(target_zone) - return affected && affected.open == 1 //&& !(affected.status & ORGAN_BLEEDING) + return affected && affected.open == INCISION_MADE /datum/surgery_step/generic/retract_skin/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) @@ -286,7 +290,7 @@ self_msgBall = "keeping the incision open on the lower abdomen." user.visible_message(msg, self_msg) user.balloon_alert_visible(msgBall, self_msgBall) - affected.open = 2 + affected.open = FLESH_RETRACTED /datum/surgery_step/generic/retract_skin/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) @@ -322,7 +326,7 @@ ) min_duration = 70 - max_duration = 100 + max_duration = 70 /datum/surgery_step/generic/cauterize/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) if(..()) @@ -367,7 +371,7 @@ req_open = 0 min_duration = 110 - max_duration = 160 + max_duration = 110 /datum/surgery_step/generic/amputate/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) if (target_zone == O_EYES) //there are specific steps for eye surgery diff --git a/code/modules/surgery/neck.dm b/code/modules/surgery/neck.dm index 8922919d2a..8d4d718dd9 100644 --- a/code/modules/surgery/neck.dm +++ b/code/modules/surgery/neck.dm @@ -11,13 +11,24 @@ /datum/surgery_step/brainstem/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) if(!ishuman(target)) - return 0 + return FALSE var/obj/item/organ/external/affected = target.get_organ(target_zone) - if (!affected || (affected.robotic >= ORGAN_ROBOT) || !(affected.open >= 3)) - return 0 + if(!affected || (affected.robotic >= ORGAN_ROBOT)) + return FALSE + //If our organ is encased (has a bone) the bone must be cut. If the organ is NOT encased (boneless) we can only get to encased == 2 + if(affected.open != (affected.encased ? 3 : 2)) + return FALSE if(coverage_check(user, target, affected, tool)) - return 0 - return target_zone == BP_HEAD + return FALSE + //Gets where our brain is located and allows us to do frankensurgery in the right location. + var/obj/item/organ/internal/brain/sponge = locate(/obj/item/organ/internal/brain) in affected.internal_organs + if(!sponge) + return FALSE + if(target_zone != sponge.parent_organ) + return FALSE + if((target.can_defib && !(sponge.status & ORGAN_DEAD)) && !target.op_stage.brainstem == 5) //Final step can be done after our can_defib step is set. + return FALSE + return target_zone == sponge.parent_organ ///////////////////////////// // Blood Vessel Mending @@ -35,7 +46,7 @@ max_duration = 100 /datum/surgery_step/brainstem/mend_vessels/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - return ..() && target_zone == BP_HEAD && target.op_stage.brainstem == 0 + return ..() && target.op_stage.brainstem == 0 /datum/surgery_step/brainstem/mend_vessels/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) user.visible_message(span_filter_notice("[user] starts to mend the blood vessels on [target]'s brainstem with \the [tool]."), \ @@ -73,10 +84,10 @@ allowed_procs = list(IS_SCREWDRIVER = 75) min_duration = 200 //Very. Very. Carefully. - max_duration = 300 + max_duration = 200 /datum/surgery_step/brainstem/drill_vertebrae/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - return ..() && target_zone == BP_HEAD && target.op_stage.brainstem == 1 + return ..() && target.op_stage.brainstem == 1 /datum/surgery_step/brainstem/drill_vertebrae/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) user.visible_message(span_filter_notice("[user] starts to drill around [target]'s brainstem with \the [tool]."), \ @@ -100,9 +111,8 @@ user.balloon_alert_visible("slips, shredding [target]'s brainstem", "your hand slips, shredding the brainstem.") affected.createwound(PIERCE, 10) target.AdjustParalysis(15) - spawn() - for(var/obj/item/organ/internal/brain/O in affected.internal_organs) - O.take_damage(rand(5,10)) + for(var/obj/item/organ/internal/brain/O in affected.internal_organs) + O.take_damage(rand(5,10)) ///////////////////////////// // Bone Cleaning @@ -117,11 +127,11 @@ allowed_procs = list(IS_WIRECUTTER = 60) - min_duration = 90 - max_duration = 120 + min_duration = 100 + max_duration = 100 /datum/surgery_step/brainstem/clean_chips/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - return ..() && target_zone == BP_HEAD && target.op_stage.brainstem == 2 + return ..() && target.op_stage.brainstem == 2 /datum/surgery_step/brainstem/clean_chips/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) user.visible_message(span_filter_notice("[user] starts to pick around [target]'s brainstem for bone chips with \the [tool]."), \ @@ -143,9 +153,8 @@ user.balloon_alert_visible("slips, gouging [target]'s brainstem", "your hand slips, gouging the brainstem") affected.createwound(CUT, 5) target.AdjustParalysis(10) - spawn() - for(var/obj/item/organ/internal/brain/O in affected.internal_organs) //If there's more than one... - O.take_damage(rand(1,10)) + for(var/obj/item/organ/internal/brain/O in affected.internal_organs) //If there's more than one... + O.take_damage(rand(1,10)) ///////////////////////////// // Spinal Cord Repair @@ -161,10 +170,10 @@ /obj/item/assembly/mousetrap = 25) min_duration = 100 - max_duration = 200 + max_duration = 100 /datum/surgery_step/brainstem/mend_cord/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - return ..() && target_zone == BP_HEAD && target.op_stage.brainstem == 3 + return ..() && target.op_stage.brainstem == 3 /datum/surgery_step/brainstem/mend_cord/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) user.visible_message(span_filter_notice("[user] starts to fuse [target]'s spinal cord with \the [tool]."), \ @@ -174,11 +183,10 @@ /datum/surgery_step/brainstem/mend_cord/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) user.visible_message(span_notice("[user] has fused [target]'s spinal cord with \the [tool].") , \ - span_notice(" You have fused [target]'s spinal cord with \the [tool]."),) + span_notice("You have fused [target]'s spinal cord with \the [tool]."),) user.balloon_alert_visible("fused [target]'s spinal cord", "fused the spinal cord") target.op_stage.brainstem = 4 target.AdjustParalysis(5) - target.add_modifier(/datum/modifier/franken_sickness, 20 MINUTES) /datum/surgery_step/brainstem/mend_cord/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) @@ -187,9 +195,8 @@ user.balloon_alert_visible("slips, tearing [target]'s spinal cord", "your hand slips, tearing at the spinal cord") affected.createwound(PIERCE, 5) target.AdjustParalysis(20) - spawn() - for(var/obj/item/organ/internal/brain/O in affected.internal_organs) - O.take_damage(rand(5,15)) //Down to the wire. Or rather, the cord. + for(var/obj/item/organ/internal/brain/O in affected.internal_organs) + O.take_damage(rand(5,15)) //Down to the wire. Or rather, the cord. ///////////////////////////// // Vertebrae repair @@ -204,10 +211,10 @@ /obj/item/tape_roll = 50) min_duration = 100 - max_duration = 160 + max_duration = 100 /datum/surgery_step/brainstem/mend_vertebrae/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - return ..() && target_zone == BP_HEAD && target.op_stage.brainstem == 4 + return ..() && target.op_stage.brainstem == 4 /datum/surgery_step/brainstem/mend_vertebrae/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) user.visible_message(span_filter_notice("[user] starts to mend [target]'s opened vertebrae with \the [tool]."), \ @@ -237,6 +244,7 @@ // Realign tissues ///////////////////////////// +///This step isn't essential BUT does heal brain loss and heals a dead brain. /datum/surgery_step/brainstem/realign_tissue surgery_name = "Realign Tissue" priority = 3 //Do this instead of searching for objects in the skull. @@ -246,11 +254,11 @@ allowed_procs = list(IS_WIRECUTTER = 60) - min_duration = 90 - max_duration = 120 + min_duration = 100 + max_duration = 100 /datum/surgery_step/brainstem/realign_tissue/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - return ..() && target_zone == BP_HEAD && target.op_stage.brainstem == 5 + return ..() && target.op_stage.brainstem == 5 /datum/surgery_step/brainstem/realign_tissue/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) user.visible_message(span_filter_notice("[user] starts to realign the tissues in [target]'s skull with \the [tool]."), \ @@ -260,10 +268,13 @@ /datum/surgery_step/brainstem/realign_tissue/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) user.visible_message(span_notice("[user] has realigned the tissues in [target]'s skull back into place with \the [tool].") , \ - span_notice(" You have realigned the tissues in [target]'s skull back into place with \the [tool]."),) + span_notice("You have realigned the tissues in [target]'s skull back into place with \the [tool]."),) user.balloon_alert_visible("realigned the tissues in [target]'s skull back in place", "realigned the tissues in the skull back into place") target.AdjustParalysis(5) //I n v a s i v e - target.op_stage.brainstem = 0 //The cycle begins anew. + target.brainloss = 0 //The cycle begins anew. + for(var/obj/item/organ/internal/brain/sponge in target.internal_organs) //in case they have multiple brains. weirdo. + sponge.status = 0 + /datum/surgery_step/brainstem/realign_tissue/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) @@ -272,6 +283,5 @@ user.balloon_alert_visible("slips, gounging at [target]'s brainstem", "your hand slips, gouging at the brainstem") affected.createwound(CUT, 5) target.AdjustParalysis(30) - spawn() - for(var/obj/item/organ/internal/brain/O in affected.internal_organs) - O.take_damage(rand(1,10)) + for(var/obj/item/organ/internal/brain/O in affected.internal_organs) + O.take_damage(rand(1,10)) diff --git a/code/modules/surgery/other.dm b/code/modules/surgery/other.dm index a17cb22e29..f6c39ffdda 100644 --- a/code/modules/surgery/other.dm +++ b/code/modules/surgery/other.dm @@ -89,7 +89,7 @@ if(coverage_check(user, target, affected, tool)) return 0 - return affected && affected.open >= 2 && (affected.status & ORGAN_DEAD) + return affected && affected.open >= FLESH_RETRACTED && (affected.status & ORGAN_DEAD) /datum/surgery_step/necrotic/fix_dead_tissue //Debridement surgery_name = "Remove Dead Tissue" @@ -151,7 +151,7 @@ /datum/surgery_step/necrotic/treat_necrosis/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) - return ..() && affected.open >= 3 && affected.remove_necrosis >= 1 + return ..() && affected.open >= BONE_RETRACTED && affected.remove_necrosis >= 1 /datum/surgery_step/necrotic/treat_necrosis/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) @@ -210,7 +210,7 @@ /datum/surgery_step/necrotic/rejuvenate_dead_tissue/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) - return ..() && affected.open >= 3 && affected.remove_necrosis == 1 + return ..() && affected.open >= BONE_RETRACTED && affected.remove_necrosis == 1 /datum/surgery_step/necrotic/rejuvenate_dead_tissue/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) @@ -250,7 +250,7 @@ /datum/surgery_step/necrotic/rearrange_dead_tissue/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) - return ..() && affected.open >= 3 && affected.remove_necrosis == 2 + return ..() && affected.open >= BONE_RETRACTED && affected.remove_necrosis == 2 /datum/surgery_step/necrotic/rearrange_dead_tissue/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) @@ -291,7 +291,7 @@ /datum/surgery_step/necrotic/fix_necrotic_vessel/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) - return ..() && affected.open >= 3 && affected.remove_necrosis == 3 + return ..() && affected.open >= BONE_RETRACTED && affected.remove_necrosis == 3 /datum/surgery_step/necrotic/fix_necrotic_vessel/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) diff --git a/code/modules/surgery/robotics.dm b/code/modules/surgery/robotics.dm index 742b3a578a..7b9fe7f4ad 100644 --- a/code/modules/surgery/robotics.dm +++ b/code/modules/surgery/robotics.dm @@ -46,7 +46,7 @@ /datum/surgery_step/robotics/unscrew_hatch/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) if(..()) var/obj/item/organ/external/affected = target.get_organ(target_zone) - return affected && affected.open == 0 && target_zone != O_MOUTH + return affected && !affected.open && target_zone != O_MOUTH /datum/surgery_step/robotics/unscrew_hatch/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) @@ -60,7 +60,7 @@ user.visible_message(span_notice("[user] has opened the maintenance hatch on [target]'s [affected.name] with \the [tool]."), \ span_notice("You have opened the maintenance hatch on [target]'s [affected.name] with \the [tool]."),) user.balloon_alert_visible("opens the maintenance hatch on [target]'s [affected.name]", "maintenance hatch opened on \the [affected.name]") - affected.open = 1 + affected.open = INCISION_MADE /datum/surgery_step/robotics/unscrew_hatch/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) @@ -209,7 +209,7 @@ var/obj/item/weldingtool/welder = tool if(!welder.isOn() || !welder.remove_fuel(1,user)) return 0 - return affected && affected.open == 3 && (affected.disfigured || affected.brute_dam > 0) && target_zone != O_MOUTH + return affected && affected.open == BONE_RETRACTED && (affected.disfigured || affected.brute_dam > 0) && target_zone != O_MOUTH /datum/surgery_step/robotics/repair_brute/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) @@ -263,7 +263,7 @@ else C.use(5) - return affected && affected.open == 3 && (affected.disfigured || affected.burn_dam > 0) && target_zone != O_MOUTH + return affected && affected.open == BONE_RETRACTED && (affected.disfigured || affected.burn_dam > 0) && target_zone != O_MOUTH /datum/surgery_step/robotics/repair_burn/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) @@ -315,7 +315,7 @@ if(I.damage > 0 && (I.robotic >= ORGAN_ROBOT)) is_organ_damaged = 1 break - return affected.open == 3 && is_organ_damaged + return affected.open == BONE_RETRACTED && is_organ_damaged /datum/surgery_step/robotics/fix_organ_robotic/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) if(!ishuman(target)) @@ -514,7 +514,7 @@ var/obj/item/mmi/M = tool var/obj/item/organ/external/affected = target.get_organ(target_zone) - if(!(affected && affected.open == 3)) + if(!(affected && affected.open == BONE_RETRACTED)) return 0 if(!istype(M)) @@ -617,7 +617,7 @@ var/obj/item/holder/diona/N = tool var/obj/item/organ/external/affected = target.get_organ(target_zone) - if(!(affected && affected.open == 3)) + if(!(affected && affected.open == BONE_RETRACTED)) return 0 if(!istype(N)) diff --git a/code/modules/vore/eating/vorepanel_vr.dm b/code/modules/vore/eating/vorepanel_vr.dm index 24cec3f5cf..e1cac4c600 100644 --- a/code/modules/vore/eating/vorepanel_vr.dm +++ b/code/modules/vore/eating/vorepanel_vr.dm @@ -1152,14 +1152,33 @@ var/mob/living/body_backup = T.body_backup if(ishuman(body_backup)) var/mob/living/carbon/human/H = body_backup - body_backup.adjustBruteLoss(-6) - body_backup.adjustFireLoss(-6) - body_backup.setOxyLoss(0) + H.setOxyLoss(0) if(H.isSynthetic()) H.adjustToxLoss(-H.getToxLoss()) else - H.adjustToxLoss(-6) - body_backup.adjustCloneLoss(-6) + H.adjustToxLoss(-25) + if(H.health <= -H.getMaxHealth()) + H.adjustBruteLoss(-25) + H.adjustFireLoss(-25) + H.adjustCloneLoss(-25) + + //This looks how much health we need to get to 'barely in crit' + //We heal up to that point here, starting with toxins and moving up to the harder to heal types. + //Once we heal one type, we check again to see if we're still dead. If so, we heal the next type in the list. + if(H.health <= -H.getMaxHealth()) + var/barely_in_crit = -(H.get_crit_point() - 1) + var/adjust_health = barely_in_crit - H.health + if(adjust_health < 0) + adjust_health *= -1 + + H.adjustToxLoss(adjust_health) + if(H.health <= -H.getMaxHealth()) + H.adjustFireLoss(adjust_health) + if(H.health <= -H.getMaxHealth()) + H.adjustBruteLoss(adjust_health) + if(H.health <= -H.getMaxHealth()) + H.adjustCloneLoss(adjust_health) + body_backup.updatehealth() // Now we do the check to see if we should revive... var/should_proceed_with_revive = TRUE diff --git a/vorestation.dme b/vorestation.dme index 0c6d6ca5be..549dd25c15 100644 --- a/vorestation.dme +++ b/vorestation.dme @@ -186,6 +186,7 @@ #include "code\__defines\status_effects.dm" #include "code\__defines\subsystems.dm" #include "code\__defines\supply.dm" +#include "code\__defines\surgery.dm" #include "code\__defines\talksounds.dm" #include "code\__defines\targeting.dm" #include "code\__defines\text.dm"