diff --git a/code/game/objects/items/weapons/implants/implant.dm b/code/game/objects/items/weapons/implants/implant.dm index 0bfe624f50f..92769892f31 100644 --- a/code/game/objects/items/weapons/implants/implant.dm +++ b/code/game/objects/items/weapons/implants/implant.dm @@ -92,6 +92,10 @@ else ..() +/obj/item/implant/surgically_remove(mob/living/carbon/human/target, obj/item/organ/external/chest/removing_from) + . = ..() + imp_in = null + implanted = 0 ////////////////////////////// // Tracking Implant ////////////////////////////// diff --git a/code/modules/mob/living/simple_mob/subtypes/animal/borer/borer.dm b/code/modules/mob/living/simple_mob/subtypes/animal/borer/borer.dm index 0944f22c199..1aa2a52144f 100644 --- a/code/modules/mob/living/simple_mob/subtypes/animal/borer/borer.dm +++ b/code/modules/mob/living/simple_mob/subtypes/animal/borer/borer.dm @@ -51,7 +51,6 @@ var/roundstart = FALSE // If true, spawning won't try to pull a ghost. var/used_dominate // world.time when the dominate power was last used. - /mob/living/simple_mob/animal/borer/roundstart roundstart = TRUE @@ -267,3 +266,9 @@ continue else if(M.stat == DEAD && M.get_preference_toggle(/datum/game_preference_toggle/observer/ghost_ears)) to_chat(M, "[src.true_name] whispers to [host], \"[message]\"") + +/mob/living/simple_mob/animal/borer/proc/surgically_remove(mob/living/carbon/human/target, obj/item/organ/external/chest/removing_from) + if(controlling) + target.release_control() + detatch() + leave_host() diff --git a/code/modules/resleeving/mirror.dm b/code/modules/resleeving/mirror.dm index b68cb679199..92bebfefa35 100644 --- a/code/modules/resleeving/mirror.dm +++ b/code/modules/resleeving/mirror.dm @@ -81,6 +81,10 @@ forceMove(MT) MT.imp = src +/obj/item/implant/mirror/surgically_remove(mob/living/carbon/human/target, obj/item/organ/external/chest/removing_from) + . = ..() + target.mirror = null + /obj/item/implant/mirror/positronic name = "Synthetic Mirror" desc = "An altered form of the common mirror designed to work with synthetic brains." diff --git a/code/modules/surgery/implant.dm b/code/modules/surgery/implant.dm index 4f5bff25520..e0f11fce24b 100644 --- a/code/modules/surgery/implant.dm +++ b/code/modules/surgery/implant.dm @@ -158,6 +158,15 @@ // IMPLANT/ITEM REMOVAL SURGERY ////////////////////////////////////////////////////////////////// +/obj/item/proc/surgically_remove(mob/living/carbon/human/target, obj/item/organ/external/chest/removing_from) + removing_from.implants -= src + + target.update_hud_sec_implants() + + loc = get_turf(target) + add_blood(target) + update_icon() + /datum/surgery_step/cavity/implant_removal allowed_tools = list( /obj/item/surgical/hemostat = 100, \ @@ -190,49 +199,19 @@ /datum/surgery_step/cavity/implant_removal/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/chest/affected = target.get_organ(target_zone) - var/find_prob = 0 - if (affected.implants.len) - var/obj/item/obj = pick(affected.implants) - - if(istype(obj,/obj/item/implant)) - var/obj/item/implant/imp = obj - if (imp.islegal()) - find_prob +=60 - else - find_prob +=40 - else - find_prob +=50 - - if (prob(find_prob)) - user.visible_message("[user] takes something out of incision on [target]'s [affected.name] with \the [tool]!", \ - "You take [obj] out of incision on [target]'s [affected.name]s with \the [tool]!" ) - affected.implants -= obj - - target.update_hud_sec_implants() - - //Handle possessive brain borers. - if(istype(obj,/mob/living/simple_mob/animal/borer)) - var/mob/living/simple_mob/animal/borer/worm = obj - if(worm.controlling) - target.release_control() - worm.detatch() - worm.leave_host() - else - obj.loc = get_turf(target) - obj.add_blood(target) - obj.update_icon() - if(istype(obj,/obj/item/implant)) - var/obj/item/implant/imp = obj - imp.imp_in = null - imp.implanted = 0 - if(istype(obj, /obj/item/implant/mirror)) - target.mirror = null - else if(istype(tool,/obj/item/nif)){var/obj/item/nif/N = tool;N.unimplant(target)} - else - user.visible_message("[user] removes \the [tool] from [target]'s [affected.name].", \ - "There's something inside [target]'s [affected.name], but you just missed it this time." ) + var/obj/item/obj = input("What do you want to extract?") in affected.implants + + user.visible_message("[user] takes something out of incision on [target]'s [affected.name] with \the [tool]!", \ + "You take [obj] out of incision on [target]'s [affected.name]s with \the [tool]!" ) + + obj.surgically_remove(target, affected) + + if(istype(tool, /obj/item/nif)) + var/obj/item/nif/N = tool + N.unimplant(target) + else user.visible_message("[user] could not find anything inside [target]'s [affected.name], and pulls \the [tool] out.", \ "You could not find anything inside [target]'s [affected.name]." )