From d05ab4f87a284788033a6fe597f4c4490db64fce Mon Sep 17 00:00:00 2001 From: Skies-Of-Blue Date: Wed, 6 Mar 2024 14:10:39 -0800 Subject: [PATCH] requested changes --- code/modules/surgery/mechanic_steps.dm | 56 +++++++++++++------------- code/modules/surgery/mechanical.dm | 6 ++- 2 files changed, 33 insertions(+), 29 deletions(-) diff --git a/code/modules/surgery/mechanic_steps.dm b/code/modules/surgery/mechanic_steps.dm index 836a248d138d..3730f7cf1302 100644 --- a/code/modules/surgery/mechanic_steps.dm +++ b/code/modules/surgery/mechanic_steps.dm @@ -172,33 +172,35 @@ 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)].") + if(!istype(tool, /obj/item/bodypart)) + to_chat(user, "[tool] isn't a mechanical prosthesis!") + return FALSE + var/obj/item/bodypart/BP = tool + if(ishuman(target)) + if(IS_ORGANIC_LIMB(BP)) + to_chat(user, "[BP] isn't a 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. + to_chat(user, "[tool] isn't the right type for [parse_zone(target_zone)].") + return -1 + 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)].") + /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? + if(HAS_TRAIT(tool, TRAIT_NODROP)) + display_results(user, target, "The [tool] is stuck in your hand!", + "The [tool] seems stuck to [user]'s hand!", + "The [tool] seems stuck to [user]'s hand!") + return FALSE + var/obj/item/bodypart/L = tool + if(!L.attach_limb(target)) + display_results(user, target, "You fail to replace [target]'s [parse_zone(target_zone)]! Their body has rejected [L]!", + "[user] fails to replace [target]'s [parse_zone(target_zone)]!", + "[user] fails to replace [target]'s [parse_zone(target_zone)]!") + return FALSE + 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 ..() diff --git a/code/modules/surgery/mechanical.dm b/code/modules/surgery/mechanical.dm index ae66a98d1bff..b387f0683445 100644 --- a/code/modules/surgery/mechanical.dm +++ b/code/modules/surgery/mechanical.dm @@ -108,6 +108,7 @@ requires_bodypart_type = BODYTYPE_ROBOTIC lying_required = FALSE self_operable = TRUE + ignore_clothes = TRUE /datum/surgery/prosthesis_attachment name = "Prosthesis attachment" @@ -117,10 +118,11 @@ requires_bodypart_type = 0 lying_required = FALSE self_operable = TRUE + ignore_clothes = TRUE /datum/surgery/prosthesis_attachment/can_start(mob/user, mob/living/carbon/target) if(!iscarbon(target)) - return 0 + return FALSE var/mob/living/carbon/C = target if(!C.get_bodypart(user.zone_selected)) //can only start if limb is missing - return 1 + return TRUE