Files
Bubberstation/code/modules/surgery/operations/operation_generic_basic.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

186 lines
7.4 KiB
Plaintext

// Some operations that mirror basic carbon state-moving operations but for basic mobs
/// Incision of skin for basic mobs
/datum/surgery_operation/basic/incise_skin
name = "make incision"
// rnd_name = "Laparotomy / Craniotomy / Myotomy (Make Incision)" // Maybe we keep this one simple
desc = "Make an incision in the patient's skin to access internals. \
Causes \"cut skin\" surgical state."
implements = list(
TOOL_SCALPEL = 1,
/obj/item/melee/energy/sword = 1.33,
/obj/item/knife = 1.5,
/obj/item/shard = 2.25,
/obj/item/screwdriver = 5,
/obj/item/pen = 5,
/obj/item = 3.33,
)
time = 1.6 SECONDS
preop_sound = 'sound/items/handling/surgery/scalpel1.ogg'
success_sound = 'sound/items/handling/surgery/scalpel2.ogg'
operation_flags = OPERATION_AFFECTS_MOOD
any_surgery_states_blocked = ALL_SURGERY_SKIN_STATES
target_zone = null
/datum/surgery_operation/basic/incise_skin/get_any_tool()
return "Any sharp edged item"
/datum/surgery_operation/basic/incise_skin/all_blocked_strings()
return ..() + list("The patient must not have complex anatomy")
/datum/surgery_operation/basic/incise_skin/get_default_radial_image()
return image('icons/hud/surgery_radial.dmi', "make_incision")
/datum/surgery_operation/basic/incise_skin/state_check(mob/living/patient)
return !patient.has_limbs // Only for limbless mobs
/datum/surgery_operation/basic/incise_skin/tool_check(obj/item/tool)
// Require edged sharpness OR a tool behavior match
if((tool.get_sharpness() & SHARP_EDGED) || implements[tool.tool_behaviour])
return TRUE
// these are here by popular demand, even though they don't fit the above criteria
if(istype(tool, /obj/item/pen) || istype(tool, /obj/item/screwdriver))
return TRUE
return FALSE
/datum/surgery_operation/basic/incise_skin/on_preop(mob/living/patient, mob/living/surgeon, obj/item/tool, list/operation_args)
display_results(
surgeon,
patient,
span_notice("You begin to make an incision in [patient]..."),
span_notice("[surgeon] begins to make an incision in [patient]."),
span_notice("[surgeon] begins to make an incision in [patient]."),
)
display_pain(patient, "You feel a sharp stabbing sensation!")
/datum/surgery_operation/basic/incise_skin/on_success(mob/living/patient, mob/living/surgeon, obj/item/tool, list/operation_args)
. = ..()
patient.apply_status_effect(/datum/status_effect/basic_surgery_state, SURGERY_SKIN_OPEN)
/datum/surgery_operation/basic/saw_bone
name = "saw bone"
desc = "Saw through the patient's bones to access their internal organs. \
Causes \"bone sawed\" surgical state."
implements = list(
TOOL_SAW = 1,
/obj/item/shovel/serrated = 1.33,
/obj/item/melee/arm_blade = 1.33,
/obj/item/fireaxe = 2,
/obj/item/hatchet = 2.85,
/obj/item/knife/butcher = 2.85,
/obj/item = 4,
)
time = 5.4 SECONDS
preop_sound = list(
/obj/item/circular_saw = 'sound/items/handling/surgery/saw.ogg',
/obj/item/melee/arm_blade = 'sound/items/handling/surgery/scalpel1.ogg',
/obj/item/fireaxe = 'sound/items/handling/surgery/scalpel1.ogg',
/obj/item/hatchet = 'sound/items/handling/surgery/scalpel1.ogg',
/obj/item/knife/butcher = 'sound/items/handling/surgery/scalpel1.ogg',
/obj/item = 'sound/items/handling/surgery/scalpel1.ogg',
)
success_sound = 'sound/items/handling/surgery/organ2.ogg'
operation_flags = OPERATION_AFFECTS_MOOD
all_surgery_states_required = SURGERY_SKIN_OPEN
any_surgery_states_blocked = SURGERY_BONE_SAWED|SURGERY_BONE_DRILLED
target_zone = null
/datum/surgery_operation/basic/saw_bone/get_any_tool()
return "Any sharp edged item with decent force"
/datum/surgery_operation/basic/saw_bone/all_blocked_strings()
return ..() + list("The patient must not have complex anatomy")
/datum/surgery_operation/basic/saw_bone/get_default_radial_image()
return image('icons/hud/surgery_radial.dmi', "mend_incision")
/datum/surgery_operation/basic/saw_bone/state_check(mob/living/patient)
return !patient.has_limbs // Only for limbless mobs
/datum/surgery_operation/basic/saw_bone/tool_check(obj/item/tool)
// Require edged sharpness and sufficient force OR a tool behavior match
return (((tool.get_sharpness() & SHARP_EDGED) && tool.force >= 10) || implements[tool.tool_behaviour])
/datum/surgery_operation/basic/saw_bone/on_preop(mob/living/patient, mob/living/surgeon, obj/item/tool, list/operation_args)
display_results(
surgeon,
patient,
span_notice("You begin to saw through [patient]'s bones..."),
span_notice("[surgeon] begins to saw through [patient]'s bones."),
span_notice("[surgeon] begins to saw through [patient]'s bones."),
)
display_pain(patient, "You feel a horrid ache spread through your insides!")
/datum/surgery_operation/basic/saw_bone/on_success(mob/living/patient, mob/living/surgeon, obj/item/tool, list/operation_args)
. = ..()
patient.apply_status_effect(/datum/status_effect/basic_surgery_state, SURGERY_BONE_SAWED)
patient.apply_damage(patient.maxHealth * 0.5, sharpness = tool.get_sharpness(), wound_bonus = CANT_WOUND, attacking_item = tool)
display_results(
surgeon,
patient,
span_notice("You saw [patient] open."),
span_notice("[surgeon] saws [patient] open!"),
span_notice("[surgeon] saws [patient] open!"),
)
display_pain(patient, "It feels like something just broke!")
// Closing of skin for basic mobs
/datum/surgery_operation/basic/close_skin
name = "mend incision"
desc = "Mend the incision in the patient's skin, closing it up. \
Clears most surgical states."
implements = list(
TOOL_CAUTERY = 1,
/obj/item/stack/medical/suture = 1,
/obj/item/gun/energy/laser = 1.15,
TOOL_WELDER = 1.5,
/obj/item = 3.33,
)
time = 2.4 SECONDS
preop_sound = list(
/obj/item/stack/medical/suture = SFX_SUTURE_BEGIN,
/obj/item = 'sound/items/handling/surgery/cautery1.ogg',
)
success_sound = list(
/obj/item/stack/medical/suture = SFX_SUTURE_END,
/obj/item = 'sound/items/handling/surgery/cautery2.ogg',
)
any_surgery_states_required = ALL_SURGERY_STATES_UNSET_ON_CLOSE // we're not picky
target_zone = null
/datum/surgery_operation/basic/close_skin/get_any_tool()
return "Any heat source"
/datum/surgery_operation/basic/close_skin/all_blocked_strings()
return ..() + list("The patient must not have complex anatomy")
/datum/surgery_operation/basic/close_skin/get_default_radial_image()
return image(/obj/item/cautery)
/datum/surgery_operation/basic/close_skin/state_check(mob/living/patient)
return !patient.has_limbs // Only for limbless mobs
/datum/surgery_operation/basic/close_skin/tool_check(obj/item/tool)
if(istype(tool, /obj/item/stack/medical/suture))
return TRUE
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/basic/close_skin/on_preop(mob/living/patient, mob/living/surgeon, obj/item/tool, list/operation_args)
display_results(
surgeon,
patient,
span_notice("You begin to mend the incision in [patient]..."),
span_notice("[surgeon] begins to mend the incision in [patient]."),
span_notice("[surgeon] begins to mend the incision in [patient]."),
)
display_pain(patient, "You are being [istype(tool, /obj/item/stack/medical/suture) ? "pinched" : "burned"]!")
/datum/surgery_operation/basic/close_skin/on_success(mob/living/patient, mob/living/surgeon, obj/item/tool, list/operation_args)
. = ..()
// Just nuke the status effect, wipe the slate clean
patient.remove_status_effect(/datum/status_effect/basic_surgery_state)