Implant removal improvements. (#7825)

Implant surgery has been improved. Knife shrapnel extraction has been improved.
This commit is contained in:
Matt Atlas
2019-12-30 12:26:10 +01:00
committed by GitHub
parent 645e49b681
commit 56ed56ad05
6 changed files with 91 additions and 77 deletions
+23 -38
View File
@@ -1015,7 +1015,23 @@
imp.removed()
. = TRUE
mob/proc/yank_out_object()
/mob/living/carbon/human/remove_implant(var/obj/item/implant, var/surgical_removal = FALSE, var/obj/item/organ/external/affected)
if(!affected) //Grab the organ holding the implant.
for(var/obj/item/organ/external/organ in organs)
for(var/obj/item/O in organ.implants)
if(O == implant)
affected = organ
break
if(affected)
affected.implants -= implant
if(!surgical_removal)
shock_stage += 20
apply_damage((implant.w_class * 7), BRUTE, affected)
if(!BP_IS_ROBOTIC(affected) && prob(implant.w_class * 5) && affected.sever_artery()) //I'M SO ANEMIC I COULD JUST -DIE-.
custom_pain("Something tears wetly in your [affected.name] as [implant] is pulled free!", 50, affecting = affected)
. = ..()
/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."
@@ -1062,49 +1078,18 @@ mob/proc/yank_out_object()
return
if(self)
visible_message("<span class='warning'><b>[src] rips [selection] out of their body.</b></span>","<span class='warning'><b>You rip [selection] out of your body.</b></span>")
visible_message("<span class='warning'><b>[src] rips [selection] out of their body!</b></span>","<span class='warning'><b>You rip [selection] out of your body!</b></span>")
else
visible_message("<span class='warning'><b>[usr] rips [selection] out of [src]'s body.</b></span>","<span class='warning'><b>[usr] rips [selection] out of your body.</b></span>")
visible_message("<span class='warning'><b>[usr] rips [selection] out of [src]'s body!</b></span>","<span class='warning'><b>[usr] rips [selection] out of your body!</b></span>")
valid_objects = get_visible_implants(0)
if(valid_objects.len == 1) //Yanking out last object - removing verb.
src.verbs -= /mob/proc/yank_out_object
if(ishuman(src))
var/mob/living/carbon/human/H = src
var/obj/item/organ/external/affected
for(var/obj/item/organ/external/organ in H.organs) //Grab the organ holding the implant.
for(var/obj/item/O in organ.implants)
if(O == selection)
affected = organ
affected.implants -= selection
H.shock_stage+=20
affected.take_damage((selection.w_class * 3), 0, 0, 1, "Embedded object extraction")
if(prob(selection.w_class * 5)) //I'M SO ANEMIC I COULD JUST -DIE-.
affected.sever_artery()
H.custom_pain("Something tears wetly in your [affected] as [selection] is pulled free!", 50)
if (ishuman(U))
var/mob/living/carbon/human/human_user = U
human_user.bloody_hands(H)
else if(issilicon(src))
var/mob/living/silicon/robot/R = src
R.embedded -= selection
R.adjustBruteLoss(5)
R.adjustFireLoss(10)
remove_implant(selection)
selection.forceMove(get_turf(src))
if(!(U.l_hand && U.r_hand))
U.put_in_hands(selection)
for(var/obj/item/O in pinned)
if(O == selection)
pinned -= O
if(!pinned.len)
anchored = 0
if(ishuman(U))
var/mob/living/carbon/human/human_user = U
human_user.bloody_hands(src)
return 1
/mob/living/proc/handle_statuses()
+16 -26
View File
@@ -155,38 +155,40 @@
max_duration = 100
/datum/surgery_step/cavity/implant_removal/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/obj/item/organ/internal/brain/sponge = target.internal_organs_by_name[BP_BRAIN]
return ..() && (!sponge || !sponge.damage)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
return ..() && affected
/datum/surgery_step/cavity/implant_removal/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("[user] starts poking around inside [target]'s [affected.name] with \the [tool].", \
"You start poking around inside [target]'s [affected.name] with \the [tool]" )
target.custom_pain("The pain in your [affected.name] is living hell!",1)
"You start poking around inside [target]'s [affected.name] with \the [tool]." )
target.custom_pain("The pain in your [affected.name] is living hell!", 50)
..()
/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
var/list/implants = list()
if(affected.implants.len)
implants = affected.implants
var/obj/item/obj = pick(affected.implants)
var/obj/item/obj = pick(implants)
if(istype(obj,/obj/item/implant))
var/obj/item/implant/imp = obj
if(imp.islegal())
find_prob +=60
find_prob += 60
else
find_prob +=40
find_prob += 40
else
find_prob +=50
find_prob += 50
if(prob(find_prob))
user.visible_message("<span class='notice'>[user] takes something out of incision on [target]'s [affected.name] with \the [tool].</span>", \
"<span class='notice'>You take [obj] out of incision on [target]'s [affected.name]s with \the [tool].</span>" )
affected.implants -= obj
target.remove_implant(obj, TRUE, affected)
BITSET(target.hud_updateflag, IMPLOYAL_HUD)
@@ -197,14 +199,7 @@
target.release_control()
worm.detatch()
worm.leave_host()
else
obj.forceMove(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
playsound(target.loc, 'sound/effects/squelch1.ogg', 50, 1)
else
user.visible_message("<span class='notice'>[user] removes \the [tool] from [target]'s [affected.name].</span>", \
@@ -216,12 +211,7 @@
/datum/surgery_step/cavity/implant_removal/fail_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)
if(affected.implants.len)
var/fail_prob = 10
fail_prob += 100 - tool_quality(tool)
if(prob(fail_prob))
var/obj/item/implant/imp = affected.implants[1]
user.visible_message("<span class='warning'>Something beeps inside [target]'s [affected.name]!</span>")
playsound(imp.loc, 'sound/items/countdown.ogg', 75, 1, -3)
spawn(25)
imp.activate()
user.visible_message("<span class='warning'>[user] loses their grip and stabs [target] with \the [tool]!</span>", "<span class='warning'>You lose your grip on \the [tool] and stab [target]!</span>")
affected.sever_artery()
target.apply_damage(25, BRUTE, target_zone)