From 4f04256e4670a883ae5035e8fa8f6f0e77fdfa25 Mon Sep 17 00:00:00 2001 From: swindly Date: Thu, 2 Nov 2017 23:21:14 -0400 Subject: [PATCH] Allows cyborgs to perform limb augmentation (#32233) * allows organ storage bags to be used to augment limbs * replaces hardcoded stuff with intiial() --- code/modules/surgery/limb_augmentation.dm | 11 +++++++++-- code/modules/surgery/organ_manipulation.dm | 4 ++-- code/modules/surgery/prosthetic_replacement.dm | 4 ++-- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/code/modules/surgery/limb_augmentation.dm b/code/modules/surgery/limb_augmentation.dm index b5081370f0..25d914b0fb 100644 --- a/code/modules/surgery/limb_augmentation.dm +++ b/code/modules/surgery/limb_augmentation.dm @@ -15,15 +15,17 @@ /datum/surgery_step/add_limb name = "replace limb" - implements = list(/obj/item/bodypart = 100) + implements = list(/obj/item/bodypart = 100, /obj/item/organ_storage = 100) time = 32 var/obj/item/bodypart/L = null // L because "limb" /datum/surgery_step/add_limb/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) + if(istype(tool, /obj/item/organ_storage) && istype(tool.contents[1], /obj/item/bodypart)) + tool = tool.contents[1] var/obj/item/bodypart/aug = tool if(aug.status != BODYPART_ROBOTIC) - to_chat(user, "that's not an augment silly!") + to_chat(user, "That's not an augment, silly!") return -1 if(aug.body_zone != target_zone) to_chat(user, "[tool] isn't the right type for [parse_zone(target_zone)].") @@ -49,6 +51,11 @@ /datum/surgery_step/add_limb/success(mob/user, mob/living/carbon/target, target_zone, obj/item/bodypart/tool, datum/surgery/surgery) if(L) user.visible_message("[user] successfully augments [target]'s [parse_zone(target_zone)]!", "You successfully augment [target]'s [parse_zone(target_zone)].") + if(istype(tool, /obj/item/organ_storage)) + tool.icon_state = initial(tool.icon_state) + tool.desc = initial(tool.desc) + tool.cut_overlays() + tool = tool.contents[1] L.change_bodypart_status(BODYPART_ROBOTIC, TRUE) L.icon = tool.icon L.max_damage = tool.max_damage diff --git a/code/modules/surgery/organ_manipulation.dm b/code/modules/surgery/organ_manipulation.dm index 10e57babcd..f477535dab 100644 --- a/code/modules/surgery/organ_manipulation.dm +++ b/code/modules/surgery/organ_manipulation.dm @@ -152,8 +152,8 @@ if(current_type == "insert") if(istype(tool, /obj/item/organ_storage)) I = tool.contents[1] - tool.icon_state = "evidenceobj" - tool.desc = "A container for holding body parts." + tool.icon_state = initial(tool.icon_state) + tool.desc = initial(tool.desc) tool.cut_overlays() tool = I else diff --git a/code/modules/surgery/prosthetic_replacement.dm b/code/modules/surgery/prosthetic_replacement.dm index e55f3af009..b3f3953c49 100644 --- a/code/modules/surgery/prosthetic_replacement.dm +++ b/code/modules/surgery/prosthetic_replacement.dm @@ -60,8 +60,8 @@ /datum/surgery_step/add_prosthetic/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) if(istype(tool, /obj/item/organ_storage)) - tool.icon_state = "evidenceobj" - tool.desc = "A container for holding body parts." + tool.icon_state = initial(tool.icon_state) + tool.desc = initial(tool.desc) tool.cut_overlays() tool = tool.contents[1] if(istype(tool, /obj/item/bodypart) && user.temporarilyRemoveItemFromInventory(tool))