Files
Bubberstation/code/modules/surgery/implant_removal.dm
Jacquerel a5b5bf6516 Tend Wounds works on non-human mobs (#76471)
## About The Pull Request

Tend Wounds seems to be intentionally written such that you would be
able to perform it on arbitrary mobs, however this had two problems.
- Most mobs can't rest and it requires a resting position, meaning the
surgery can only be initiated on cats and mothroaches.
- The code which picks up surgery steps existed on Carbon not Living, so
after the game tells you that you've started doing surgery on Runtime,
clicking on her with a scalpel will cause you to stab her to death. I
noticed this after a tragic kitten incident.

I have fixed both of these issues by moving surgery catching onto Living
instead of Carbon, and having the resting check only run if you are
capable of resting.

You still can't operate on Beepsky because he is made of metal. 

## Why It's Good For The Game

It can actually quite hard to heal pets who were harmed by accident,
this allows people to roleplay as veterinarians.

## Changelog

🆑
fix: You can now correctly Tend Wounds on most non-human animals.
add: You can now Remove Implants from non-human animals, just in case
Ian swallowed a macrobomb.
/🆑
2023-07-02 20:24:01 +02:00

93 lines
3.0 KiB
Plaintext

/datum/surgery/implant_removal
name = "Implant Removal"
target_mobtypes = list(/mob/living)
possible_locs = list(BODY_ZONE_CHEST)
steps = list(
/datum/surgery_step/incise,
/datum/surgery_step/clamp_bleeders,
/datum/surgery_step/retract_skin,
/datum/surgery_step/extract_implant,
/datum/surgery_step/close,
)
//extract implant
/datum/surgery_step/extract_implant
name = "extract implant (hemostat)"
implements = list(
TOOL_HEMOSTAT = 100,
TOOL_CROWBAR = 65,
/obj/item/kitchen/fork = 35)
time = 64
success_sound = 'sound/surgery/hemostat1.ogg'
var/obj/item/implant/implant
/datum/surgery_step/extract_implant/preop(mob/user, mob/living/target, target_zone, obj/item/tool, datum/surgery/surgery)
for(var/obj/item/object in target.implants)
implant = object
break
if(implant)
display_results(
user,
target,
span_notice("You begin to extract [implant] from [target]'s [target_zone]..."),
span_notice("[user] begins to extract [implant] from [target]'s [target_zone]."),
span_notice("[user] begins to extract something from [target]'s [target_zone]."),
)
display_pain(target, "You feel a serious pain in your [target_zone]!")
else
display_results(
user,
target,
span_notice("You look for an implant in [target]'s [target_zone]..."),
span_notice("[user] looks for an implant in [target]'s [target_zone]."),
span_notice("[user] looks for something in [target]'s [target_zone]."),
)
/datum/surgery_step/extract_implant/success(mob/user, mob/living/target, target_zone, obj/item/tool, datum/surgery/surgery, default_display_results = FALSE)
if(implant)
display_results(
user,
target,
span_notice("You successfully remove [implant] from [target]'s [target_zone]."),
span_notice("[user] successfully removes [implant] from [target]'s [target_zone]!"),
span_notice("[user] successfully removes something from [target]'s [target_zone]!"),
)
display_pain(target, "You can feel your [implant.name] pulled out of you!")
implant.removed(target)
var/obj/item/implantcase/case
for(var/obj/item/implantcase/implant_case in user.held_items)
case = implant_case
break
if(!case)
case = locate(/obj/item/implantcase) in get_turf(target)
if(case && !case.imp)
case.imp = implant
implant.forceMove(case)
case.update_appearance()
display_results(
user,
target,
span_notice("You place [implant] into [case]."),
span_notice("[user] places [implant] into [case]!"),
span_notice("[user] places it into [case]!"),
)
else
qdel(implant)
else
to_chat(user, span_warning("You can't find anything in [target]'s [target_zone]!"))
return ..()
/datum/surgery/implant_removal/mechanic
name = "Implant Removal"
requires_bodypart_type = BODYTYPE_ROBOTIC
target_mobtypes = list(/mob/living/carbon/human) // Simpler mobs don't have bodypart types
steps = list(
/datum/surgery_step/mechanic_open,
/datum/surgery_step/open_hatch,
/datum/surgery_step/mechanic_unwrench,
/datum/surgery_step/extract_implant,
/datum/surgery_step/mechanic_wrench,
/datum/surgery_step/mechanic_close)