Files
VMSolidus 0625b841c3 Surgery Speed Modifiers (#22472)
This PR "gently refactors" surgery doafter timers to be deterministic
and variable. Instead of being simply a random number of seconds between
an upper and lower bounds, surgeries now have a base amount of time they
take to perform (in fractional seconds). This doafter time can then be
modified via signal interactions, such as coming from components.

The Morale component, Surgery skill, Anatomy skill, and Xenobiology
skill all have had signal hooks for surgery speed added, while the
latter two are uniquely conditional signal modifiers. Anatomy only
provides its modifier if the target's species matches your own, while
Xenobiology only applies its modifier if the target is an alien. Morale
can situationally either give a bonus or a penalty depending on your
current amount of morale points.

So to offset that this is now significantly more variable and that 4
different sources of bonus surgical speed exist, I've actually made the
base surgery times always on the upper end of what their previous
doafter duration range was, so surgeries are in general slower if you
aren't taking advantage of specializing in it.

Signed-off-by: VMSolidus <evilexecutive@gmail.com>
2026-06-19 16:47:29 +00:00

61 lines
3.3 KiB
Plaintext

//Procedures in this file: Facial reconstruction surgery
//////////////////////////////////////////////////////////////////
// FACE SURGERY //
//////////////////////////////////////////////////////////////////
/singleton/surgery_step/generic/cut_face
allowed_tools = list(
TOOL_SCALPEL = 100,
/obj/item/material/knife = 75,
/obj/item/material/shard = 50
)
base_surgery_time = 9 SECONDS
skill_requirements = alist(SURGERY_SKILL_COMPONENT = SKILL_LEVEL_TRAINED)
/singleton/surgery_step/generic/cut_face/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
return ..() && target_zone == BP_MOUTH && target.op_stage.face == FACE_NORMAL
/singleton/surgery_step/generic/cut_face/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message("[user] starts to cut open [target]'s face and neck with \the [tool].", \
"You start to cut open [target]'s face and neck with \the [tool].")
..()
/singleton/surgery_step/generic/cut_face/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message("<b>[user]</b> has cut open [target]'s face and neck with \the [tool]." , \
SPAN_NOTICE("You have cut open [target]'s face and neck with \the [tool]."),)
target.op_stage.face = FACE_CUT_OPEN
/singleton/surgery_step/generic/cut_face/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message(SPAN_WARNING("[user]'s hand slips, slicing [target]'s throat wth \the [tool]!") , \
SPAN_WARNING("Your hand slips, slicing [target]'s throat wth \the [tool]!") )
target.apply_damage(40, DAMAGE_BRUTE, target_zone, 0, tool, damage_flags = tool.damage_flags())
target.apply_damage(20, DAMAGE_OXY)
target.losebreath += 10
/singleton/surgery_step/robotics/face/synthskin
allowed_tools = list(
TOOL_SCALPEL = 100,
/obj/item/material/knife = 75,
/obj/item/material/shard = 50
)
base_surgery_time = 9 SECONDS
skill_requirements = alist(ROBOTICS_SKILL_COMPONENT = SKILL_LEVEL_TRAINED)
/singleton/surgery_step/robotics/face/synthskin/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
return ..() && target.op_stage.face == FACE_NORMAL && target.get_species() == SPECIES_IPC_SHELL
/singleton/surgery_step/robotics/face/synthskin/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message("[user] starts to cut open [target]'s synthskin face and neck with \the [tool].", \
"You start to cut open [target]'s synthskin face and neck with \the [tool].")
..()
/singleton/surgery_step/robotics/face/synthskin/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message("<b>[user]</b> has cut open [target]'s synthskin face and neck with \the [tool]." , \
SPAN_NOTICE("You have cut open [target]'s synthskin face and neck with \the [tool]."),)
target.op_stage.face = FACE_CUT_OPEN
/singleton/surgery_step/robotics/face/synthskin/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message(SPAN_WARNING("[user]'s hand slips, slicing [target]'s throat wth \the [tool]!") , \
SPAN_WARNING("Your hand slips, slicing [target]'s throat wth \the [tool]!") )
target.apply_damage(40, DAMAGE_BRUTE, target_zone, 0, tool, damage_flags = tool.damage_flags())