Files
Bubberstation/code/modules/surgery/coronary_bypass.dm
T
GhomandGitHub 778ed9f1ab The death or internal/external organ pathing (ft. fixed fox ears and recoloring bodypart overlays with dye sprays) (#87434)
## About The Pull Request
This PR kills the abstract internal and external typepaths for organs,
now replaced by an EXTERNAL_ORGAN flag to distinguish the two kinds.

This PR also fixes fox ears (from #87162, no tail is added) and
mushpeople's caps (they should be red, the screenshot is a tad
outdated).

And yes, you can now use a hair dye spray to recolor body parts like
most tails, podpeople hair, mushpeople caps and cat ears. The process
can be reversed by using the spray again.

## Why It's Good For The Game
Time-Green put some effort during the last few months to untie functions
and mechanics from external/internal organ pathing. Now, all that this
pathing is good for are a few typechecks, easily replaceable with
bitflags.

Also podpeople and mushpeople need a way to recolor their "hair". This
kind of applies to fish tails from the fish infusion, which colors can't
be selected right now. The rest is just there if you ever want to
recolor your lizard tail for some reason.

Proof of testing btw (screenshot taken before mushpeople cap fix, right
side has dyed body parts, moth can't be dyed, they're already fabolous):

![immagine](https://github.com/user-attachments/assets/2bb625c9-9233-42eb-b9b8-e0bd6909ce89)

## Changelog

🆑
code: Removed internal/external pathing from organs in favor of a bit
flag. Hopefully this shouldn't break anything about organs.
fix: Fixed invisible fox ears.
fix: Fixed mushpeople caps not being colored red by default.
add: You can now dye most tails, podpeople hair, mushpeople caps etc.
with a hair dye spray.
/🆑
2024-10-30 08:03:02 +01:00

167 lines
6.7 KiB
Plaintext

/datum/surgery/coronary_bypass
name = "Coronary Bypass"
organ_to_manipulate = ORGAN_SLOT_HEART
possible_locs = list(BODY_ZONE_CHEST)
steps = list(
/datum/surgery_step/incise,
/datum/surgery_step/retract_skin,
/datum/surgery_step/saw,
/datum/surgery_step/clamp_bleeders,
/datum/surgery_step/incise_heart,
/datum/surgery_step/coronary_bypass,
/datum/surgery_step/close,
)
/datum/surgery/gastrectomy/mechanic
name = "Engine Diagnostic"
requires_bodypart_type = BODYTYPE_ROBOTIC
steps = list(
/datum/surgery_step/mechanic_open,
/datum/surgery_step/open_hatch,
/datum/surgery_step/mechanic_unwrench,
/datum/surgery_step/incise_heart/mechanic,
/datum/surgery_step/coronary_bypass/mechanic,
/datum/surgery_step/mechanic_wrench,
/datum/surgery_step/mechanic_close,
)
/datum/surgery/coronary_bypass/can_start(mob/user, mob/living/carbon/target)
var/obj/item/organ/heart/target_heart = target.get_organ_slot(ORGAN_SLOT_HEART)
if(isnull(target_heart) || target_heart.damage < 60 || target_heart.operated)
return FALSE
return ..()
//an incision but with greater bleed, and a 90% base success chance
/datum/surgery_step/incise_heart
name = "incise heart (scalpel)"
implements = list(
TOOL_SCALPEL = 90,
/obj/item/melee/energy/sword = 45,
/obj/item/knife = 45,
/obj/item/shard = 25)
time = 16
preop_sound = 'sound/items/handling/surgery/scalpel1.ogg'
success_sound = 'sound/items/handling/surgery/scalpel2.ogg'
failure_sound = 'sound/items/handling/surgery/organ2.ogg'
surgery_effects_mood = TRUE
/datum/surgery_step/incise_heart/mechanic
name = "access engine internals (scalpel or crowbar)"
implements = list(
TOOL_SCALPEL = 95,
TOOL_CROWBAR = 95,
/obj/item/melee/energy/sword = 65,
/obj/item/knife = 45,
/obj/item/shard = 35)
preop_sound = 'sound/items/tools/ratchet.ogg'
success_sound = 'sound/machines/airlock/doorclick.ogg'
/datum/surgery_step/incise_heart/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
display_results(
user,
target,
span_notice("You begin to make an incision in [target]'s heart..."),
span_notice("[user] begins to make an incision in [target]'s heart."),
span_notice("[user] begins to make an incision in [target]'s heart."),
)
display_pain(target, "You feel a horrendous pain in your heart, it's almost enough to make you pass out!")
/datum/surgery_step/incise_heart/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery, default_display_results = FALSE)
if(ishuman(target))
var/mob/living/carbon/human/target_human = target
if (!HAS_TRAIT(target_human, TRAIT_NOBLOOD))
display_results(
user,
target,
span_notice("Blood pools around the incision in [target_human]'s heart."),
span_notice("Blood pools around the incision in [target_human]'s heart."),
span_notice("Blood pools around the incision in [target_human]'s heart."),
)
var/obj/item/bodypart/target_bodypart = target_human.get_bodypart(target_zone)
target_bodypart.adjustBleedStacks(10)
target_human.adjustBruteLoss(10)
return ..()
/datum/surgery_step/incise_heart/failure(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
if(ishuman(target))
var/mob/living/carbon/human/target_human = target
display_results(
user,
target,
span_warning("You screw up, cutting too deeply into the heart!"),
span_warning("[user] screws up, causing blood to spurt out of [target_human]'s chest!"),
span_warning("[user] screws up, causing blood to spurt out of [target_human]'s chest!"),
)
var/obj/item/bodypart/target_bodypart = target_human.get_bodypart(target_zone)
target_bodypart.adjustBleedStacks(10)
target_human.adjustOrganLoss(ORGAN_SLOT_HEART, 10)
target_human.adjustBruteLoss(10)
//grafts a coronary bypass onto the individual's heart, success chance is 90% base again
/datum/surgery_step/coronary_bypass
name = "graft coronary bypass (hemostat)"
implements = list(
TOOL_HEMOSTAT = 90,
TOOL_WIRECUTTER = 35,
/obj/item/stack/package_wrap = 15,
/obj/item/stack/cable_coil = 5)
time = 90
preop_sound = 'sound/items/handling/surgery/hemostat1.ogg'
success_sound = 'sound/items/handling/surgery/hemostat1.ogg'
failure_sound = 'sound/items/handling/surgery/organ2.ogg'
/datum/surgery_step/coronary_bypass/mechanic
name = "perform maintenance (hemostat or wrench)"
implements = list(
TOOL_HEMOSTAT = 90,
TOOL_WRENCH = 90,
TOOL_WIRECUTTER = 35,
/obj/item/stack/package_wrap = 15,
/obj/item/stack/cable_coil = 5)
preop_sound = 'sound/items/tools/ratchet.ogg'
success_sound = 'sound/machines/airlock/doorclick.ogg'
/datum/surgery_step/coronary_bypass/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
display_results(
user,
target,
span_notice("You begin to graft a bypass onto [target]'s heart..."),
span_notice("[user] begins to graft something onto [target]'s heart!"),
span_notice("[user] begins to graft something onto [target]'s heart!"),
)
display_pain(target, "The pain in your chest is unbearable! You can barely take it anymore!")
/datum/surgery_step/coronary_bypass/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery, default_display_results = FALSE)
target.setOrganLoss(ORGAN_SLOT_HEART, 60)
var/obj/item/organ/heart/target_heart = target.get_organ_slot(ORGAN_SLOT_HEART)
if(target_heart) //slightly worrying if we lost our heart mid-operation, but that's life
target_heart.operated = TRUE
if(target_heart.organ_flags & ORGAN_EMP) //If our organ is failing due to an EMP, fix that
target_heart.organ_flags &= ~ORGAN_EMP
display_results(
user,
target,
span_notice("You successfully graft a bypass onto [target]'s heart."),
span_notice("[user] finishes grafting something onto [target]'s heart."),
span_notice("[user] finishes grafting something onto [target]'s heart."),
)
display_pain(target, "The pain in your chest throbs, but your heart feels better than ever!")
return ..()
/datum/surgery_step/coronary_bypass/failure(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
if(ishuman(target))
var/mob/living/carbon/human/target_human = target
display_results(
user,
target,
span_warning("You screw up in attaching the graft, and it tears off, tearing part of the heart!"),
span_warning("[user] screws up, causing blood to spurt out of [target_human]'s chest profusely!"),
span_warning("[user] screws up, causing blood to spurt out of [target_human]'s chest profusely!"),
)
display_pain(target, "Your chest burns; you feel like you're going insane!")
target_human.adjustOrganLoss(ORGAN_SLOT_HEART, 20)
var/obj/item/bodypart/target_bodypart = target_human.get_bodypart(target_zone)
target_bodypart.adjustBleedStacks(30)
return FALSE