From 5f32fa88e9e604e768d471993f2a331bcab1f37d Mon Sep 17 00:00:00 2001 From: DeltaFire Date: Thu, 29 Oct 2020 21:34:54 +0100 Subject: [PATCH 1/5] biomech wound surgeries Since IPCs and synths can get wounds, they should prooobably also have access to the surgeries to fix them. instead of having to use the super-slow ways. --- code/modules/surgery/bone_mending.dm | 7 +++++++ code/modules/surgery/burn_dressing.dm | 4 ++++ code/modules/surgery/mechanic_steps.dm | 2 +- code/modules/surgery/repair_puncture.dm | 4 ++++ 4 files changed, 16 insertions(+), 1 deletion(-) diff --git a/code/modules/surgery/bone_mending.dm b/code/modules/surgery/bone_mending.dm index 0c0083575b..659e20aa3a 100644 --- a/code/modules/surgery/bone_mending.dm +++ b/code/modules/surgery/bone_mending.dm @@ -15,6 +15,9 @@ var/obj/item/bodypart/targeted_bodypart = target.get_bodypart(user.zone_selected) return(targeted_bodypart.get_wound_type(targetable_wound)) +/datum/surgery/repair_bone_hairline/biomech + requires_bodypart_type = BODYPART_HYBRID + steps = list(/datum/surgery_step/mechanic_open, /datum/surgery_step/repair_bone_hairline, /datum/surgery_step/mechanic_close) ///// Repair Compound Fracture (Critical) /datum/surgery/repair_bone_compound @@ -25,6 +28,10 @@ requires_real_bodypart = TRUE targetable_wound = /datum/wound/blunt/critical +/datum/surgery/repair_bone_compound/biomech + requires_bodypart_type = BODYPART_HYBRID + steps = list(/datum/surgery_step/mechanic_open, /datum/surgery_step/open_hatch, /datum/surgery_step/pry_off_plating, /datum/surgery_step/reset_compound_fracture, /datum/surgery_step/repair_bone_compound, /datum/surgery_step/add_plating, /datum/surgery_step/mechanic_close) + /datum/surgery/repair_bone_compound/can_start(mob/living/user, mob/living/carbon/target) if(..()) var/obj/item/bodypart/targeted_bodypart = target.get_bodypart(user.zone_selected) diff --git a/code/modules/surgery/burn_dressing.dm b/code/modules/surgery/burn_dressing.dm index 8bfa52d245..14bca66139 100644 --- a/code/modules/surgery/burn_dressing.dm +++ b/code/modules/surgery/burn_dressing.dm @@ -16,6 +16,10 @@ var/datum/wound/burn/burn_wound = targeted_bodypart.get_wound_type(targetable_wound) return(burn_wound && burn_wound.infestation > 0) +/datum/surgery/debride/biomech + name = "Debride infected synthetic flesh" + requires_bodypart_type = BODYPART_HYBRID + //SURGERY STEPS ///// Debride diff --git a/code/modules/surgery/mechanic_steps.dm b/code/modules/surgery/mechanic_steps.dm index 101be7f103..9df2a5d736 100644 --- a/code/modules/surgery/mechanic_steps.dm +++ b/code/modules/surgery/mechanic_steps.dm @@ -13,7 +13,7 @@ "[user] begins to unscrew the shell of [target]'s [parse_zone(target_zone)].", "[user] begins to unscrew the shell of [target]'s [parse_zone(target_zone)].") -/datum/surgery_step/mechanic_incise/tool_check(mob/user, obj/item/tool) +/datum/surgery_step/mechanic_open/tool_check(mob/user, obj/item/tool) if(implement_type == /obj/item && !tool.get_sharpness()) return FALSE return TRUE diff --git a/code/modules/surgery/repair_puncture.dm b/code/modules/surgery/repair_puncture.dm index 12aefefc82..b55fee199b 100644 --- a/code/modules/surgery/repair_puncture.dm +++ b/code/modules/surgery/repair_puncture.dm @@ -14,6 +14,10 @@ requires_real_bodypart = TRUE targetable_wound = /datum/wound/pierce +/datum/surgery/repair_puncture/biomech + requires_bodypart_type = BODYPART_HYBRID + steps = list(/datum/surgery_step/mechanic_open, /datum/surgery_step/repair_innards, /datum/surgery_step/seal_veins, /datum/surgery_step/mechanic_close) + /datum/surgery/repair_puncture/can_start(mob/living/user, mob/living/carbon/target) . = ..() if(.) From a07ab809ffed12403b77ac25ad54e89fadfe86e9 Mon Sep 17 00:00:00 2001 From: DeltaFire Date: Sat, 31 Oct 2020 18:04:59 +0100 Subject: [PATCH 2/5] fixes a thing Previously, if a wound was removed while there wasa surgery related to it going on, it'd just qdel() the surgery, which is.. kinda weird, since it, y'know, takes the closing step away from you, and all wound surgeries have checks for no wound being present anyways. --- code/datums/wounds/_wounds.dm | 2 -- code/modules/surgery/repair_puncture.dm | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/code/datums/wounds/_wounds.dm b/code/datums/wounds/_wounds.dm index 29c87b32d4..02421b1e52 100644 --- a/code/datums/wounds/_wounds.dm +++ b/code/datums/wounds/_wounds.dm @@ -91,8 +91,6 @@ var/wound_flags = (FLESH_WOUND | BONE_WOUND | ACCEPTS_GAUZE) /datum/wound/Destroy() - if(attached_surgery) - QDEL_NULL(attached_surgery) if(limb?.wounds && (src in limb.wounds)) // destroy can call remove_wound() and remove_wound() calls qdel, so we check to make sure there's anything to remove first remove_wound() limb = null diff --git a/code/modules/surgery/repair_puncture.dm b/code/modules/surgery/repair_puncture.dm index b55fee199b..d6dde5c007 100644 --- a/code/modules/surgery/repair_puncture.dm +++ b/code/modules/surgery/repair_puncture.dm @@ -1,5 +1,5 @@ -/////BURN FIXING SURGERIES////// +/////PUNCTURE FIXING SURGERIES////// //the step numbers of each of these two, we only currently use the first to switch back and forth due to advancing after finishing steps anyway #define REALIGN_INNARDS 1 From 04f0bb2fc20fb2419b27795524e7aa605c1b1499 Mon Sep 17 00:00:00 2001 From: DeltaFire Date: Sun, 1 Nov 2020 03:23:34 +0100 Subject: [PATCH 3/5] clarifications Now, you don't have to play the guessing game with the prepare electronics / open the hatch somewhat ambiguous surgery steps. --- code/modules/surgery/mechanic_steps.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/modules/surgery/mechanic_steps.dm b/code/modules/surgery/mechanic_steps.dm index 9df2a5d736..1650e43d7f 100644 --- a/code/modules/surgery/mechanic_steps.dm +++ b/code/modules/surgery/mechanic_steps.dm @@ -38,7 +38,7 @@ return TRUE //prepare electronics /datum/surgery_step/prepare_electronics - name = "prepare electronics" + name = "prepare electronics (multitool)" implements = list( TOOL_MULTITOOL = 100, TOOL_HEMOSTAT = 10) // try to reboot internal controllers via short circuit with some conductor @@ -77,7 +77,7 @@ //open hatch /datum/surgery_step/open_hatch - name = "open the hatch" + name = "open the hatch (empty hand)" accept_hand = 1 time = 10 From c4b0f21fd2d32b68a4f7939efbfd83ed1a575623 Mon Sep 17 00:00:00 2001 From: DeltaFire Date: Wed, 4 Nov 2020 04:34:56 +0100 Subject: [PATCH 4/5] buncha stuff All tools now have the surgical tool flag (save for wires since those have force 0 anyways and are only used very rarely in surgery), but yeah, since we got far more species using robot surgeries (0 -> 3), might be good to not have them accidentally beaten up. Also fixes organs being eaten after inserting them, yay! --- code/game/objects/items/devices/multitool.dm | 2 +- code/game/objects/items/tools/crowbar.dm | 1 + code/game/objects/items/tools/screwdriver.dm | 1 + code/game/objects/items/tools/weldingtool.dm | 1 + code/game/objects/items/tools/wirecutters.dm | 1 + code/game/objects/items/tools/wrench.dm | 1 + code/modules/surgery/organ_manipulation.dm | 2 +- 7 files changed, 7 insertions(+), 2 deletions(-) diff --git a/code/game/objects/items/devices/multitool.dm b/code/game/objects/items/devices/multitool.dm index 7a8a523a18..c02eb4a051 100644 --- a/code/game/objects/items/devices/multitool.dm +++ b/code/game/objects/items/devices/multitool.dm @@ -21,13 +21,13 @@ force = 5 w_class = WEIGHT_CLASS_SMALL tool_behaviour = TOOL_MULTITOOL + item_flags = SURGICAL_TOOL throwforce = 0 throw_range = 7 throw_speed = 3 custom_materials = list(/datum/material/iron=50, /datum/material/glass=20) var/obj/machinery/buffer // simple machine buffer for device linkage toolspeed = 1 - tool_behaviour = TOOL_MULTITOOL usesound = 'sound/weapons/empty.ogg' var/datum/integrated_io/selected_io = null //functional for integrated circuits. var/mode = 0 diff --git a/code/game/objects/items/tools/crowbar.dm b/code/game/objects/items/tools/crowbar.dm index 0dd9885c29..5c1c67e78c 100644 --- a/code/game/objects/items/tools/crowbar.dm +++ b/code/game/objects/items/tools/crowbar.dm @@ -8,6 +8,7 @@ usesound = 'sound/items/crowbar.ogg' flags_1 = CONDUCT_1 slot_flags = ITEM_SLOT_BELT + item_flags = SURGICAL_TOOL force = 5 throwforce = 7 w_class = WEIGHT_CLASS_SMALL diff --git a/code/game/objects/items/tools/screwdriver.dm b/code/game/objects/items/tools/screwdriver.dm index bf767af2ed..920afb8d14 100644 --- a/code/game/objects/items/tools/screwdriver.dm +++ b/code/game/objects/items/tools/screwdriver.dm @@ -8,6 +8,7 @@ righthand_file = 'icons/mob/inhands/equipment/tools_righthand.dmi' flags_1 = CONDUCT_1 slot_flags = ITEM_SLOT_BELT + item_flags = SURGICAL_TOOL force = 5 w_class = WEIGHT_CLASS_TINY throwforce = 5 diff --git a/code/game/objects/items/tools/weldingtool.dm b/code/game/objects/items/tools/weldingtool.dm index d35dad9f08..175ac4df82 100644 --- a/code/game/objects/items/tools/weldingtool.dm +++ b/code/game/objects/items/tools/weldingtool.dm @@ -9,6 +9,7 @@ righthand_file = 'icons/mob/inhands/equipment/tools_righthand.dmi' flags_1 = CONDUCT_1 slot_flags = ITEM_SLOT_BELT + item_flags = SURGICAL_TOOL force = 3 throwforce = 5 hitsound = "swing_hit" diff --git a/code/game/objects/items/tools/wirecutters.dm b/code/game/objects/items/tools/wirecutters.dm index 000b816d70..ad2c83da3a 100644 --- a/code/game/objects/items/tools/wirecutters.dm +++ b/code/game/objects/items/tools/wirecutters.dm @@ -8,6 +8,7 @@ righthand_file = 'icons/mob/inhands/equipment/tools_righthand.dmi' flags_1 = CONDUCT_1 slot_flags = ITEM_SLOT_BELT + item_flags = SURGICAL_TOOL force = 6 throw_speed = 3 throw_range = 7 diff --git a/code/game/objects/items/tools/wrench.dm b/code/game/objects/items/tools/wrench.dm index e8b77199d7..f44652dbf4 100644 --- a/code/game/objects/items/tools/wrench.dm +++ b/code/game/objects/items/tools/wrench.dm @@ -7,6 +7,7 @@ righthand_file = 'icons/mob/inhands/equipment/tools_righthand.dmi' flags_1 = CONDUCT_1 slot_flags = ITEM_SLOT_BELT + item_flags = SURGICAL_TOOL force = 5 throwforce = 7 w_class = WEIGHT_CLASS_SMALL diff --git a/code/modules/surgery/organ_manipulation.dm b/code/modules/surgery/organ_manipulation.dm index 85b400d2da..0876357e8e 100644 --- a/code/modules/surgery/organ_manipulation.dm +++ b/code/modules/surgery/organ_manipulation.dm @@ -144,4 +144,4 @@ display_results(user, target, "You can't extract anything from [target]'s [parse_zone(target_zone)]!", "[user] can't seem to extract anything from [target]'s [parse_zone(target_zone)]!", "[user] can't seem to extract anything from [target]'s [parse_zone(target_zone)]!") - return 0 + return 1 From f74bf6d94e1df276df31ae2753f875bddcd394cd Mon Sep 17 00:00:00 2001 From: DeltaFire Date: Wed, 4 Nov 2020 05:05:23 +0100 Subject: [PATCH 5/5] no more accidental slapping I said! Makes initiate() always return true if you do not finish the doafter, preventing certain issues (you walking away and therefore slapping them / starting to forcefeed a organ, etc) --- code/modules/surgery/surgery_step.dm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/code/modules/surgery/surgery_step.dm b/code/modules/surgery/surgery_step.dm index e287b38ca1..54134d5a47 100644 --- a/code/modules/surgery/surgery_step.dm +++ b/code/modules/surgery/surgery_step.dm @@ -81,8 +81,12 @@ surgery.status++ if(surgery.status > surgery.steps.len) surgery.complete() - surgery.step_in_progress = FALSE - return advance + surgery.step_in_progress = FALSE + return advance + else + surgery.step_in_progress = FALSE + return TRUE //Stop the attack chain! + /datum/surgery_step/proc/preop(mob/user, mob/living/target, target_zone, obj/item/tool, datum/surgery/surgery) display_results(user, target, "You begin to perform surgery on [target]...",