diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 46745011a57..069a0903cdc 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -1217,82 +1217,6 @@ del(feet_blood_DNA) return 1 -mob/living/carbon/human/yank_out_object() - set category = "Object" - set name = "Yank out object" - set desc = "Remove an embedded item at the cost of bleeding and pain." - set src in view(1) - - if(!isliving(usr) || usr.next_move > world.time) - return - usr.next_move = world.time + 20 - - if(usr.stat == 1) - usr << "You are unconcious and cannot do that!" - return - - if(usr.restrained()) - usr << "You are restrained and cannot do that!" - return - - var/list/valid_objects = list() - var/datum/organ/external/affected = null - var/mob/living/carbon/human/S = src - var/mob/living/carbon/human/U = usr - var/self = null - - if(S == U) - self = 1 // Removing object from yourself. - - valid_objects = get_visible_implants(1) - - if(!valid_objects.len) - if(self) - src << "You have nothing stuck in your wounds that is large enough to remove without surgery." - else - U << "[src] has nothing stuck in their wounds that is large enough to remove without surgery." - return - - var/obj/item/weapon/selection = input("What do you want to yank out?", "Embedded objects") in valid_objects - - for(var/datum/organ/external/organ in organs) //Grab the organ holding the implant. - for(var/obj/item/weapon/O in organ.implants) - if(O == selection) - affected = organ - if(self) - src << "You attempt to get a good grip on the [selection] in your [affected.display_name] with bloody fingers." - else - U << "You attempt to get a good grip on the [selection] in [S]'s [affected.display_name] with bloody fingers." - - if(istype(U,/mob/living/carbon/human/)) U.bloody_hands(S) - - if(!do_after(U, 80)) - return - - if(!selection || !affected || !S || !U) - return - - if(self) - visible_message("[src] rips [selection] out of their [affected.display_name] in a welter of blood.","You rip [selection] out of your [affected] in a welter of blood.") - else - visible_message("[usr] rips [selection] out of [src]'s [affected.display_name] in a welter of blood.","[usr] rips [selection] out of your [affected] in a welter of blood.") - - selection.loc = get_turf(src) - affected.implants -= selection - shock_stage+=10 - - for(var/obj/item/weapon/O in pinned) - if(O == selection) - pinned -= O - if(!pinned.len) - anchored = 0 - - if(prob(10)) //I'M SO ANEMIC I COULD JUST -DIE-. - var/datum/wound/internal_bleeding/I = new (15) - affected.wounds += I - custom_pain("Something tears wetly in your [affected] as [selection] is pulled free!", 1) - return 1 - /mob/living/carbon/human/proc/get_visible_implants(var/class = 0) var/list/visible_implants = list() diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index befa4b23a87..69ef0fdd0e3 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -1109,7 +1109,7 @@ note dizziness decrements automatically in the mob's Life() proc. /mob/proc/flash_weak_pain() flick("weak_pain",pain) -mob/verb/yank_out_object() +mob/proc/yank_out_object() set category = "Object" set name = "Yank out object" set desc = "Remove an embedded item at the cost of bleeding and pain." @@ -1135,9 +1135,13 @@ mob/verb/yank_out_object() if(S == U) self = 1 // Removing object from yourself. - for(var/obj/item/weapon/W in embedded) - if(W.w_class >= 2) - valid_objects += W + if(istype(src,/mob/living/carbon/human)) + var/mob/living/carbon/human/H = src + valid_objects = H.get_visible_implants(1) + else + for(var/obj/item/weapon/W in embedded) + if(W.w_class >= 2) + valid_objects += W if(!valid_objects.len) if(self) @@ -1163,6 +1167,26 @@ mob/verb/yank_out_object() else visible_message("[usr] rips [selection] out of [src]'s body.","[usr] rips [selection] out of your body.") + if(istype(src,/mob/living/carbon/human)) + + var/mob/living/carbon/human/H = src + var/datum/organ/external/affected + + for(var/datum/organ/external/organ in H.organs) //Grab the organ holding the implant. + for(var/obj/item/weapon/O in organ.implants) + if(O == selection) + affected = organ + + affected.implants -= selection + H.shock_stage+=10 + H.bloody_hands(S) + + if(prob(10)) //I'M SO ANEMIC I COULD JUST -DIE-. + var/datum/wound/internal_bleeding/I = new (15) + affected.wounds += I + H.custom_pain("Something tears wetly in your [affected] as [selection] is pulled free!", 1) + return 1 + selection.loc = get_turf(src) for(var/obj/item/weapon/O in pinned)