Files
Bubberstation/code/modules/surgery/operations/operation_puncture.dm
Alexis 21b4095dfd [MDB IGNORE] [IDB IGNORE] Upstream Sync - 04/17/2026 (#5453)
Upstream 04/17/2026

fixes https://github.com/Bubberstation/Bubberstation/issues/5549

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: tgstation-ci[bot] <179393467+tgstation-ci[bot]@users.noreply.github.com>
Co-authored-by: ArcaneMusic <41715314+ArcaneMusic@users.noreply.github.com>
Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com>
Co-authored-by: Rhials <28870487+Rhials@users.noreply.github.com>
Co-authored-by: rageguy505 <54517726+rageguy505@users.noreply.github.com>
Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
Co-authored-by: John Willard <53777086+JohnFulpWillard@users.noreply.github.com>
Co-authored-by: Aliceee2ch <160794176+Aliceee2ch@users.noreply.github.com>
Co-authored-by: Time-Green <7501474+Time-Green@users.noreply.github.com>
Co-authored-by: Tsar-Salat <62388554+Tsar-Salat@users.noreply.github.com>
Co-authored-by: SmArtKar <44720187+SmArtKar@users.noreply.github.com>
Co-authored-by: Maxipat <108554989+Maxipat112@users.noreply.github.com>
Co-authored-by: SyncIt21 <110812394+SyncIt21@users.noreply.github.com>
Co-authored-by: deltanedas <39013340+deltanedas@users.noreply.github.com>
Co-authored-by: SimplyLogan <47579821+loganuk@users.noreply.github.com>
Co-authored-by: loganuk <fakeemail123@aol.com>
Co-authored-by: Leland Kemble <70413276+lelandkemble@users.noreply.github.com>
Co-authored-by: FalloutFalcon <86381784+FalloutFalcon@users.noreply.github.com>
Co-authored-by: Roxy <75404941+TealSeer@users.noreply.github.com>
Co-authored-by: Lucy <lucy@absolucy.moe>
Co-authored-by: siliconOpossum <138069572+siliconOpossum@users.noreply.github.com>
Co-authored-by: Isratosh <Isratosh@hotmail.com>
Co-authored-by: TheRyeGuyWhoWillNowDie <70169560+TheRyeGuyWhoWillNowDie@users.noreply.github.com>
Co-authored-by: Neocloudy <88008002+Neocloudy@users.noreply.github.com>
Co-authored-by: Alexander V. <volas@ya.ru>
Co-authored-by: ElGitificador <168473461+ElGitificador@users.noreply.github.com>
Co-authored-by: Twaticus <46540570+Twaticus@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Bloop <13398309+vinylspiders@users.noreply.github.com>
Co-authored-by: Cameron Lennox <killer65311@gmail.com>
Co-authored-by: Tim <timothymtorres@gmail.com>
Co-authored-by: Iamgoofball <iamgoofball@gmail.com>
Co-authored-by: Layzu666 <121319428+Layzu666@users.noreply.github.com>
Co-authored-by: Arturlang <24881678+Arturlang@users.noreply.github.com>
Co-authored-by: _0Steven <42909981+00-Steven@users.noreply.github.com>
Co-authored-by: mrmanlikesbt <99309552+mrmanlikesbt@users.noreply.github.com>
Co-authored-by: Ben10Omintrix <138636438+Ben10Omintrix@users.noreply.github.com>
Co-authored-by: John F. Kennedy <54908920+MacaroniCritter@users.noreply.github.com>
Co-authored-by: Cursor <102828457+theselfish@users.noreply.github.com>
Co-authored-by: Josh <josh.adam.powell@gmail.com>
Co-authored-by: Josh Powell <josh.powell@softwire.com>
Co-authored-by: Yobrocharlie <Charliemiller5617@gmail.com>
Co-authored-by: Hardly3D <66234359+Hardly3D@users.noreply.github.com>
Co-authored-by: shayoki <96078776+shayoki@users.noreply.github.com>
Co-authored-by: LT3 <83487515+lessthnthree@users.noreply.github.com>
2026-05-16 00:56:00 +02:00

151 lines
6.8 KiB
Plaintext

/datum/surgery_operation/limb/repair_puncture
name = "realign blood vessels"
desc = "Realign a patient's torn blood vessels to prepare for sealing."
implements = list(
TOOL_HEMOSTAT = 1,
TOOL_SCALPEL = 1.15,
TOOL_WIRECUTTER = 2.5,
)
time = 3 SECONDS
preop_sound = 'sound/items/handling/surgery/hemostat1.ogg'
operation_flags = OPERATION_AFFECTS_MOOD | OPERATION_PRIORITY_NEXT_STEP | OPERATION_NO_PATIENT_REQUIRED
all_surgery_states_required = SURGERY_SKIN_OPEN|SURGERY_ORGANS_CUT
/datum/surgery_operation/limb/repair_puncture/get_time_modifiers(obj/item/bodypart/limb, mob/living/surgeon, tool)
. = ..()
for(var/datum/wound/pierce/bleed/pierce_wound in limb.wounds)
if(HAS_TRAIT(pierce_wound, TRAIT_WOUND_SCANNED))
. *= 0.5
/datum/surgery_operation/limb/repair_puncture/get_default_radial_image()
return image(/obj/item/hemostat)
/datum/surgery_operation/limb/repair_puncture/all_required_strings()
return list("the limb must have an unoperated puncture wound") + ..()
/datum/surgery_operation/limb/repair_puncture/state_check(obj/item/bodypart/limb)
var/datum/wound/pierce/bleed/pierce_wound = locate() in limb.wounds
if(isnull(pierce_wound) || pierce_wound.blood_flow <= 0 || pierce_wound.mend_state)
return FALSE
return TRUE
/datum/surgery_operation/limb/repair_puncture/on_preop(obj/item/bodypart/limb, mob/living/surgeon, obj/item/tool, list/operation_args)
display_results(
surgeon,
limb.owner,
span_notice("You begin to realign the torn blood vessels in [FORMAT_LIMB_OWNER(limb)]..."),
span_notice("[surgeon] begins to realign the torn blood vessels in [FORMAT_LIMB_OWNER(limb)] with [tool]."),
span_notice("[surgeon] begins to realign the torn blood vessels in [FORMAT_LIMB_OWNER(limb)]."),
)
display_pain(limb.owner, "You feel a horrible stabbing pain in your [limb.plaintext_zone]!")
/datum/surgery_operation/limb/repair_puncture/on_success(obj/item/bodypart/limb, mob/living/surgeon, obj/item/tool, list/operation_args)
var/datum/wound/pierce/bleed/pierce_wound = locate() in limb.wounds
pierce_wound?.adjust_blood_flow(-0.25)
limb.receive_damage(3, wound_bonus = CANT_WOUND, sharpness = tool.get_sharpness(), damage_source = tool)
if(QDELETED(pierce_wound))
display_results(
surgeon,
limb.owner,
span_notice("You successfully realign the last of the torn blood vessels in [FORMAT_LIMB_OWNER(limb)]."),
span_notice("[surgeon] successfully realigns the last of the torn blood vessels in [FORMAT_LIMB_OWNER(limb)] with [tool]!"),
span_notice("[surgeon] successfully realigns the last of the torn blood vessels in [FORMAT_LIMB_OWNER(limb)]!"),
)
return
pierce_wound?.mend_state = TRUE
display_results(
surgeon,
limb.owner,
span_notice("You successfully realign some of the blood vessels in [FORMAT_LIMB_OWNER(limb)]."),
span_notice("[surgeon] successfully realigns some of the blood vessels in [FORMAT_LIMB_OWNER(limb)] with [tool]!"),
span_notice("[surgeon] successfully realigns some of the blood vessels in [FORMAT_LIMB_OWNER(limb)]!"),
)
/datum/surgery_operation/limb/repair_puncture/on_failure(obj/item/bodypart/limb, mob/living/surgeon, tool, list/operation_args)
display_results(
surgeon,
limb.owner,
span_notice("You jerk apart some of the blood vessels in [FORMAT_LIMB_OWNER(limb)]."),
span_notice("[surgeon] jerks apart some of the blood vessels in [FORMAT_LIMB_OWNER(limb)] with [tool]!"),
span_notice("[surgeon] jerks apart some of the blood vessels in [FORMAT_LIMB_OWNER(limb)]."),
)
limb.receive_damage(rand(4, 8), wound_bonus = 10, sharpness = SHARP_EDGED, damage_source = tool)
/datum/surgery_operation/limb/seal_veins
name = "seal blood vessels"
// rnd_name = "Anastomosis (Seal Blood Vessels)" // doctor says this is the term to use but it fits awkwardly
desc = "Seal a patient's now-realigned blood vessels."
implements = list(
TOOL_CAUTERY = 1,
/obj/item/gun/energy/laser = 1.12,
TOOL_WELDER = 1.5,
/obj/item = 3.33,
)
time = 3.2 SECONDS
preop_sound = 'sound/items/handling/surgery/hemostat1.ogg'
operation_flags = OPERATION_AFFECTS_MOOD | OPERATION_PRIORITY_NEXT_STEP | OPERATION_NO_PATIENT_REQUIRED
all_surgery_states_required = SURGERY_SKIN_OPEN|SURGERY_ORGANS_CUT
/datum/surgery_operation/limb/seal_veins/get_time_modifiers(obj/item/bodypart/limb, mob/living/surgeon, tool)
. = ..()
for(var/datum/wound/pierce/bleed/pierce_wound in limb.wounds)
if(HAS_TRAIT(pierce_wound, TRAIT_WOUND_SCANNED))
. *= 0.5
/datum/surgery_operation/limb/seal_veins/get_default_radial_image()
return image(/obj/item/cautery)
/datum/surgery_operation/limb/seal_veins/get_any_tool()
return "Any heat source"
/datum/surgery_operation/limb/seal_veins/all_required_strings()
return list("the limb must have an operated puncture wound") + ..()
/datum/surgery_operation/limb/seal_veins/tool_check(obj/item/tool)
if(istype(tool, /obj/item/gun/energy/laser))
var/obj/item/gun/energy/laser/lasergun = tool
return lasergun.cell?.charge > 0
return tool.get_temperature() >= FIRE_MINIMUM_TEMPERATURE_TO_EXIST
/datum/surgery_operation/limb/seal_veins/state_check(obj/item/bodypart/limb)
var/datum/wound/pierce/bleed/pierce_wound = locate() in limb.wounds
if(isnull(pierce_wound) || pierce_wound.blood_flow <= 0 || !pierce_wound.mend_state)
return FALSE
return TRUE
/datum/surgery_operation/limb/seal_veins/on_preop(obj/item/bodypart/limb, mob/living/surgeon, obj/item/tool, list/operation_args)
display_results(
surgeon,
limb.owner,
span_notice("You begin to seal the realigned blood vessels in [FORMAT_LIMB_OWNER(limb)]..."),
span_notice("[surgeon] begins to seal the realigned blood vessels in [FORMAT_LIMB_OWNER(limb)] with [tool]."),
span_notice("[surgeon] begins to seal the realigned blood vessels in [FORMAT_LIMB_OWNER(limb)]."),
)
display_pain(limb.owner, "You feel a burning sensation in your [limb.plaintext_zone]!")
/datum/surgery_operation/limb/seal_veins/on_success(obj/item/bodypart/limb, mob/living/surgeon, obj/item/tool, list/operation_args)
var/datum/wound/pierce/bleed/pierce_wound = locate() in limb.wounds
pierce_wound?.adjust_blood_flow(-0.5)
if(QDELETED(pierce_wound))
display_results(
surgeon,
limb.owner,
span_notice("You successfully seal the last of the ruptured blood vessels in [FORMAT_LIMB_OWNER(limb)]."),
span_notice("[surgeon] successfully seals the last of the ruptured blood vessels in [FORMAT_LIMB_OWNER(limb)] with [tool]!"),
span_notice("[surgeon] successfully seals the last of the ruptured blood vessels in [FORMAT_LIMB_OWNER(limb)]!"),
)
return
pierce_wound?.mend_state = FALSE
display_results(
surgeon,
limb.owner,
span_notice("You successfully seal some of the blood vessels in [FORMAT_LIMB_OWNER(limb)]."),
span_notice("[surgeon] successfully seals some of the blood vessels in [FORMAT_LIMB_OWNER(limb)] with [tool]!"),
span_notice("[surgeon] successfully seals some of the blood vessels in [FORMAT_LIMB_OWNER(limb)]!"),
)