diff --git a/code/modules/surgery/implant_removal.dm b/code/modules/surgery/implant_removal.dm
index 68eb25bf2b15..6574fc349225 100644
--- a/code/modules/surgery/implant_removal.dm
+++ b/code/modules/surgery/implant_removal.dm
@@ -66,4 +66,5 @@
/datum/surgery_step/mechanic_unwrench,
/datum/surgery_step/extract_implant,
/datum/surgery_step/mechanic_wrench,
+ /datum/surgery_step/close_hatch,
/datum/surgery_step/mechanic_close)
diff --git a/code/modules/surgery/ipc_revive.dm b/code/modules/surgery/ipc_revive.dm
index 1077a147b4f1..b224bc3a2b60 100644
--- a/code/modules/surgery/ipc_revive.dm
+++ b/code/modules/surgery/ipc_revive.dm
@@ -8,6 +8,7 @@
/datum/surgery_step/open_hatch,
/datum/surgery_step/prepare_electronics,
/datum/surgery_step/revive/ipc,
+ /datum/surgery_step/close_hatch,
/datum/surgery_step/mechanic_close
)
possible_locs = list(BODY_ZONE_CHEST)
diff --git a/code/modules/surgery/prosthetic_replacement.dm b/code/modules/surgery/limb_grafting.dm
similarity index 86%
rename from code/modules/surgery/prosthetic_replacement.dm
rename to code/modules/surgery/limb_grafting.dm
index 8b3d4aa1218e..f3cc0d08d5c8 100644
--- a/code/modules/surgery/prosthetic_replacement.dm
+++ b/code/modules/surgery/limb_grafting.dm
@@ -1,30 +1,35 @@
-/datum/surgery/prosthetic_replacement
- name = "Prosthetic replacement"
- steps = list(/datum/surgery_step/incise, /datum/surgery_step/clamp_bleeders, /datum/surgery_step/retract_skin, /datum/surgery_step/add_prosthetic)
+// Formerly prosthetic_replacement.dm
+
+/datum/surgery/limb_grafting
+ name = "Limb grafting"
+ steps = list(/datum/surgery_step/incise, /datum/surgery_step/clamp_bleeders, /datum/surgery_step/retract_skin, /datum/surgery_step/graft_limb)
target_mobtypes = list(/mob/living/carbon/human, /mob/living/carbon/monkey)
possible_locs = list(BODY_ZONE_R_ARM, BODY_ZONE_L_ARM, BODY_ZONE_L_LEG, BODY_ZONE_R_LEG, BODY_ZONE_HEAD)
requires_bodypart = FALSE //need a missing limb
requires_bodypart_type = 0
-/datum/surgery/prosthetic_replacement/can_start(mob/user, mob/living/carbon/target)
+/datum/surgery/limb_grafting/can_start(mob/user, mob/living/carbon/target)
if(!iscarbon(target))
return 0
var/mob/living/carbon/C = target
if(!C.get_bodypart(user.zone_selected)) //can only start if limb is missing
return 1
-/datum/surgery_step/add_prosthetic
- name = "add prosthetic"
+/datum/surgery_step/graft_limb
+ name = "graft limb"
implements = list(
/obj/item/bodypart = 100,
- /obj/item/organ_storage = 100,
- /obj/item/chainsaw = 100,
- /obj/item/melee/synthetic_arm_blade = 100)
+ /obj/item/organ_storage = 100)
+// /obj/item/chainsaw = 100,
+// /obj/item/melee/synthetic_arm_blade = 100)
+// Frankly these have always bothered me. They fill like a bad fit for Shiptest.
+// Marking out for now. Keeping the later code used to install unconventional prostheses just in case someone finds a good use for it.
+
time = 32
experience_given = MEDICAL_SKILL_ORGAN_FIX //won't get full XP if rejected
var/organ_rejection_dam = 0
-/datum/surgery_step/add_prosthetic/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
+/datum/surgery_step/graft_limb/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
if(istype(tool, /obj/item/organ_storage))
if(!tool.contents.len)
to_chat(user, "There is nothing inside [tool]!")
@@ -65,7 +70,7 @@
to_chat(user, "[tool] must be installed onto an arm.")
return -1
-/datum/surgery_step/add_prosthetic/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery, default_display_results = FALSE)
+/datum/surgery_step/graft_limb/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery, default_display_results = FALSE)
. = ..()
if(istype(tool, /obj/item/organ_storage))
tool.icon_state = initial(tool.icon_state)
diff --git a/code/modules/surgery/mechanic_steps.dm b/code/modules/surgery/mechanic_steps.dm
index f1fd128c2d9e..6523f2ec791f 100644
--- a/code/modules/surgery/mechanic_steps.dm
+++ b/code/modules/surgery/mechanic_steps.dm
@@ -112,3 +112,93 @@
display_results(user, target, "You begin to open the hatch holders in [target]'s [parse_zone(target_zone)]...",
"[user] begins to open the hatch holders in [target]'s [parse_zone(target_zone)].",
"[user] begins to open the hatch holders in [target]'s [parse_zone(target_zone)].")
+
+//close hatch
+
+/datum/surgery_step/close_hatch
+ name = "close the hatch"
+ accept_hand = TRUE
+ time = 1 SECONDS
+ preop_sound = 'sound/machines/doorclick.ogg'
+ success_sound = 'sound/items/ratchet.ogg'
+
+/datum/surgery_step/close_hatch/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
+ display_results(user, target, "You begin to close the hatch holders in [target]'s [parse_zone(target_zone)]...",
+ "[user] begins to close the hatch holders in [target]'s [parse_zone(target_zone)].",
+ "[user] begins to close the hatch holders in [target]'s [parse_zone(target_zone)].")
+
+//manipulate organs (metal edition)
+/datum/surgery_step/manipulate_organs/mechanic
+ name = "manipulate mechanical organs"
+ preop_sound = 'sound/surgery/organ2.ogg'
+ success_sound = 'sound/surgery/organ1.ogg'
+ var/implements_extract = list(
+ TOOL_HEMOSTAT = 55,
+ TOOL_CROWBAR = 100,
+ /obj/item/kitchen/fork = 35)
+
+//prosthesis removal
+/datum/surgery_step/prosthesis_removal
+ name = "detach prosthesis"
+ accept_hand = TRUE //once a prosthesis is unseated, it should be a simple matter of removing it without tools
+ implements = list(
+ TOOL_WRENCH = 100,
+ TOOL_CROWBAR = 100) //exists just in case you want to reflavor your prosthesis as something a little more integrated
+ time = 2.8 SECONDS
+ preop_sound = 'sound/items/ratchet.ogg'
+ success_sound = 'sound/machines/doorclick.ogg'
+
+/datum/surgery_step/prosthesis_removal/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
+ display_results(user, target, "You begin to unseat [target]'s [parse_zone(target_zone)]...",
+ "[user] begins to unseat [target]'s [parse_zone(target_zone)]!",
+ "[user] begins to unseat [target]'s [parse_zone(target_zone)]!")
+
+/datum/surgery_step/prosthesis_removal/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery, default_display_results = FALSE)
+ var/mob/living/carbon/human/L = target
+ display_results(user, target, "You detach [L]'s [parse_zone(target_zone)].",
+ "[user] detaches [L]'s [parse_zone(target_zone)]!",
+ "[user] detaches [L]'s [parse_zone(target_zone)]!")
+ if(surgery.operated_bodypart)
+ var/obj/item/bodypart/target_limb = surgery.operated_bodypart
+ target_limb.drop_limb()
+
+//Add prosthetic
+/datum/surgery_step/add_prosthetic
+ name = "add prosthetic"
+ implements = list(
+ /obj/item/bodypart = 100)
+ time = 32
+ experience_given = MEDICAL_SKILL_ORGAN_FIX //won't get full XP if rejected
+ var/organ_rejection_dam = 0
+
+/datum/surgery_step/add_prosthetic/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
+ if(istype(tool, /obj/item/bodypart))
+ var/obj/item/bodypart/BP = tool
+ if(ishuman(target))
+ if(IS_ORGANIC_LIMB(BP))
+ to_chat(user, "[BP] isn't mechanical prosthesis!")
+ return -1
+
+ if(target_zone == BP.body_zone) //so we can't replace a leg with an arm, or a human arm with a monkey arm.
+ display_results(user, target, "You begin to replace [target]'s [parse_zone(target_zone)] with [tool]...",
+ "[user] begins to replace [target]'s [parse_zone(target_zone)] with [tool].",
+ "[user] begins to replace [target]'s [parse_zone(target_zone)].")
+ else
+ to_chat(user, "[tool] isn't the right type for [parse_zone(target_zone)].")
+ return -1
+
+/datum/surgery_step/add_prosthetic/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery, default_display_results = FALSE)
+ . = ..()
+ if(istype(tool, /obj/item/bodypart) && user.temporarilyRemoveItemFromInventory(tool))
+ var/obj/item/bodypart/L = tool
+ if(!L.attach_limb(target))
+ display_results(user, target, "You fail in replacing [target]'s [parse_zone(target_zone)]! Their body has rejected [L]!",
+ "[user] fails to replace [target]'s [parse_zone(target_zone)]!",
+ "[user] fails to replaces [target]'s [parse_zone(target_zone)]!")
+ L.forceMove(target.loc)
+ return
+ display_results(user, target, "You succeed in replacing [target]'s [parse_zone(target_zone)].",
+ "[user] successfully replaces [target]'s [parse_zone(target_zone)] with [tool]!",
+ "[user] successfully replaces [target]'s [parse_zone(target_zone)]!")
+ return
+ return ..() //if for some reason we fail everything we'll print out some text okay?
diff --git a/code/modules/surgery/mechanical.dm b/code/modules/surgery/mechanical.dm
index fe7b583d2c36..ae66a98d1bff 100644
--- a/code/modules/surgery/mechanical.dm
+++ b/code/modules/surgery/mechanical.dm
@@ -8,6 +8,7 @@
/datum/surgery_step/open_hatch,
/datum/surgery_step/prepare_electronics,
/datum/surgery_step/fix_brain,
+ /datum/surgery_step/close_hatch,
/datum/surgery_step/mechanic_close
)
lying_required = FALSE
@@ -99,3 +100,27 @@
L.electrocute_act(urdamageamt_burn, target)
target.take_bodypart_damage(urdamageamt_brute, urdamageamt_burn)
return FALSE
+
+/datum/surgery/prosthesis_removal
+ name = "Detach prosthesis"
+ steps = list(/datum/surgery_step/mechanic_open, /datum/surgery_step/open_hatch, /datum/surgery_step/prepare_electronics, /datum/surgery_step/mechanic_unwrench, /datum/surgery_step/prosthesis_removal)
+ possible_locs = list(BODY_ZONE_R_ARM, BODY_ZONE_L_ARM, BODY_ZONE_L_LEG, BODY_ZONE_R_LEG, BODY_ZONE_HEAD)
+ requires_bodypart_type = BODYTYPE_ROBOTIC
+ lying_required = FALSE
+ self_operable = TRUE
+
+/datum/surgery/prosthesis_attachment
+ name = "Prosthesis attachment"
+ steps = list(/datum/surgery_step/mechanic_wrench, /datum/surgery_step/prepare_electronics, /datum/surgery_step/add_prosthetic, /datum/surgery_step/close_hatch, /datum/surgery_step/mechanic_close)
+ possible_locs = list(BODY_ZONE_R_ARM, BODY_ZONE_L_ARM, BODY_ZONE_L_LEG, BODY_ZONE_R_LEG, BODY_ZONE_HEAD)
+ requires_bodypart = FALSE //need a missing limb
+ requires_bodypart_type = 0
+ lying_required = FALSE
+ self_operable = TRUE
+
+/datum/surgery/prosthesis_attachment/can_start(mob/user, mob/living/carbon/target)
+ if(!iscarbon(target))
+ return 0
+ var/mob/living/carbon/C = target
+ if(!C.get_bodypart(user.zone_selected)) //can only start if limb is missing
+ return 1
diff --git a/code/modules/surgery/organ_manipulation.dm b/code/modules/surgery/organ_manipulation.dm
index 2242c4c242ea..1b14aed144a1 100644
--- a/code/modules/surgery/organ_manipulation.dm
+++ b/code/modules/surgery/organ_manipulation.dm
@@ -49,8 +49,9 @@
/datum/surgery_step/open_hatch,
/datum/surgery_step/mechanic_unwrench,
/datum/surgery_step/prepare_electronics,
- /datum/surgery_step/manipulate_organs,
+ /datum/surgery_step/manipulate_organs/mechanic,
/datum/surgery_step/mechanic_wrench,
+ /datum/surgery_step/close_hatch,
/datum/surgery_step/mechanic_close
)
@@ -60,7 +61,8 @@
/datum/surgery_step/mechanic_open,
/datum/surgery_step/open_hatch,
/datum/surgery_step/prepare_electronics,
- /datum/surgery_step/manipulate_organs,
+ /datum/surgery_step/manipulate_organs/mechanic,
+ /datum/surgery_step/close_hatch,
/datum/surgery_step/mechanic_close
)
diff --git a/shiptest.dme b/shiptest.dme
index 7b712252299e..c4f7f3b38163 100644
--- a/shiptest.dme
+++ b/shiptest.dme
@@ -745,8 +745,8 @@
#include "code\datums\votes\_vote_datum.dm"
#include "code\datums\votes\custom_vote.dm"
#include "code\datums\votes\restart_vote.dm"
-#include "code\datums\weather\weather.dm"
#include "code\datums\votes\transfer_vote.dm"
+#include "code\datums\weather\weather.dm"
#include "code\datums\weather\weather_controller.dm"
#include "code\datums\weather\weather_types\acid_rain.dm"
#include "code\datums\weather\weather_types\ash_storm.dm"
@@ -3325,13 +3325,13 @@
#include "code\modules\surgery\implant_removal.dm"
#include "code\modules\surgery\ipc_revive.dm"
#include "code\modules\surgery\limb_augmentation.dm"
+#include "code\modules\surgery\limb_grafting.dm"
#include "code\modules\surgery\lobectomy.dm"
#include "code\modules\surgery\mechanic_steps.dm"
#include "code\modules\surgery\mechanical.dm"
#include "code\modules\surgery\organ_manipulation.dm"
#include "code\modules\surgery\organic_steps.dm"
#include "code\modules\surgery\plastic_surgery.dm"
-#include "code\modules\surgery\prosthetic_replacement.dm"
#include "code\modules\surgery\remove_embedded_object.dm"
#include "code\modules\surgery\revival.dm"
#include "code\modules\surgery\stomachpump.dm"