mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-30 00:29:02 +01:00
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
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user