From 3a1b6a79950c07a4feb3abc5d50ec272f17e5620 Mon Sep 17 00:00:00 2001 From: Bloop <13398309+vinylspiders@users.noreply.github.com> Date: Mon, 19 Jan 2026 13:21:50 -0500 Subject: [PATCH] Adds some extra args to some surgery procs (#94904) ## About The Pull Request Tin, we already have these available, might as well make them available to the procs as well. ## Why It's Good For The Game Code extensibility ## Changelog Not player-facing --- code/__DEFINES/surgery.dm | 2 +- code/modules/surgery/operations/_operation.dm | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/code/__DEFINES/surgery.dm b/code/__DEFINES/surgery.dm index 1a7945b2bf7..ab8fee7c9a0 100644 --- a/code/__DEFINES/surgery.dm +++ b/code/__DEFINES/surgery.dm @@ -173,7 +173,7 @@ DEFINE_BITFIELD(operation_flags, list( #define OPERATION_BRUTE_MULTIPLIER "brute_multiplier" #define OPERATION_BURN_MULTIPLIER "burn_multiplier" -/// Used in string formatting to print a limb as "John's right arm" or "the human right arm" +/// Used in string formatting to print a limb as "John's right arm" or "the human right arm" #define FORMAT_LIMB_OWNER(limb) (limb.owner ? "[limb.owner]'s [limb.plaintext_zone]" : limb) /// Used in string formatting to print an organ's location as "John" or "the human chest" #define FORMAT_ORGAN_OWNER(organ) (organ.owner || organ.loc) diff --git a/code/modules/surgery/operations/_operation.dm b/code/modules/surgery/operations/_operation.dm index 10d906ad0c1..c5d378a1069 100644 --- a/code/modules/surgery/operations/_operation.dm +++ b/code/modules/surgery/operations/_operation.dm @@ -742,17 +742,17 @@ GLOBAL_DATUM_INIT(operations, /datum/operation_holder, new) // Ignore alllll the penalties (but also all the bonuses) if(!HAS_TRAIT(surgeon, TRAIT_IGNORE_SURGERY_MODIFIERS)) var/mob/living/patient = get_patient(operating_on) - total_mod *= get_surgeon_surgery_speed_mod(surgeon, tool) + total_mod *= get_surgeon_surgery_speed_mod(patient, surgeon, tool) if(!isnull(patient)) // Some surgeries can lack patients - total_mod *= get_location_modifier(get_turf(patient)) - total_mod *= get_mob_surgery_speed_mod(patient) + total_mod *= get_location_modifier(get_turf(patient), patient, surgeon, tool) + total_mod *= get_mob_surgery_speed_mod(patient, surgeon, tool) // Using TRAIT_SELF_SURGERY on a surgery which doesn't normally allow self surgery imparts a penalty if(operating_on == surgeon && HAS_TRAIT(surgeon, TRAIT_SELF_SURGERY) && !(operation_flags & OPERATION_SELF_OPERABLE)) total_mod *= 1.5 return round(total_mod, 0.01) /// Returns a time modifier based on the mob's status -/datum/surgery_operation/proc/get_mob_surgery_speed_mod(mob/living/patient) +/datum/surgery_operation/proc/get_mob_surgery_speed_mod(mob/living/patient, mob/living/surgeon, tool) PROTECTED_PROC(TRUE) var/basemod = 1.0 for(var/mod_id, mod_amt in patient.mob_surgery_speed_mods) @@ -764,7 +764,7 @@ GLOBAL_DATUM_INIT(operations, /datum/operation_holder, new) return basemod /// Returns a time modifier based on the surgeon's status -/datum/surgery_operation/proc/get_surgeon_surgery_speed_mod(mob/living/surgeon, tool) +/datum/surgery_operation/proc/get_surgeon_surgery_speed_mod(mob/living/patient, mob/living/surgeon, tool) PROTECTED_PROC(TRUE) var/basemod = 1.0 if((operation_flags & OPERATION_MORBID) && HAS_MIND_TRAIT(surgeon, TRAIT_MORBID) && isitem(tool)) @@ -782,7 +782,7 @@ GLOBAL_DATUM_INIT(operations, /datum/operation_holder, new) return basemod /// Gets the surgery speed modifier for a given mob, based off what sort of table/bed/whatever is on their turf. -/datum/surgery_operation/proc/get_location_modifier(turf/operation_turf) +/datum/surgery_operation/proc/get_location_modifier(turf/operation_turf, mob/living/patient, mob/living/surgeon, tool) PROTECTED_PROC(TRUE) // Technically this IS a typecache, just not the usual kind :3 // The order of the modifiers matter, latter entries override earlier ones