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

View File

@@ -246,7 +246,7 @@ Transponder Codes:<UL>"}
updateDialog()
/obj/machinery/navbeacon/Destroy()
navbeacons.Remove(src)
navbeacons?.Remove(src)
if(SSradio)
SSradio.remove_object(src, freq)
return ..()

View File

@@ -13,7 +13,7 @@ proc/fragem(var/source,var/fragx,var/fragy,var/light_dam,var/flash_dam,var/p_dam
P.pellets = fragments_per_projectile
P.range_step = p_range
P.shot_from = source
P.name = "[source]'s shrapnel"
P.name = "shrapnel"
P.launch_projectile(T)

View File

@@ -36,20 +36,16 @@
if(!istype(H))
return
for(var/obj/item/material/shard/shrapnel/S in H.contents)
if(!H.get_visible_implants(1))
to_chat(usr, "<span class='warning'>There's nothing large enough to remove!</span>")
return
for(var/obj/item/material/shard/S in H.contents)
visible_message("<span class='notice'>[usr] starts carefully digging out some of the shrapnel in [H == usr ? "themselves" : H]...</span>")
to_chat(H, "<font size=3><span class='danger'>It burns!</span></font>")
H.custom_pain("<font size=3><span class='danger'>It burns!</span></font>", 50)
if(do_mob(usr, H, 100))
S.forceMove(H.loc)
H.remove_implant(S, FALSE)
log_and_message_admins("has extracted shrapnel out of [key_name(H)]")
else
break
H.apply_damage(30, PAIN)
if(prob(25))
var/obj/item/organ/external/affecting = H.get_organ(H.zone_sel.selecting)
if(affecting)
to_chat(H, "<span class='danger'><font size=2>You feel something rip open in your [affecting.name]!</span></font>")
affecting.sever_artery()
if(H.can_feel_pain())
H.emote("scream")

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()

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)

View File

@@ -0,0 +1,43 @@
################################
# Example Changelog File
#
# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb.
#
# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.)
# When it is, any changes listed below will disappear.
#
# Valid Prefixes:
# bugfix
# wip (For works in progress)
# tweak
# soundadd
# sounddel
# rscadd (general adding of nice things)
# rscdel (general deleting of nice things)
# imageadd
# imagedel
# maptweak
# spellcheck (typo fixes)
# experiment
# balance
# admin
# backend
# security
# refactor
#################################
# Your name.
author: MattAtlas
# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again.
delete-after: True
# Any changes you've made. See valid prefix list above.
# INDENT WITH TWO SPACES. NOT TABS. SPACES.
# SCREW THIS UP AND IT WON'T WORK.
# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries.
# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog.
changes:
- bugfix: "Shrapnel extraction surgery should be far less fucky now."
- tweak: "Extracting shrapnel with knives now works far better. It also loops, so you don't have to click extract shrapnel 6 times."
- rscdel: "Shrapnel no longer contains the name of the weapon it came from in the name."