From a55a71a2913110d4c874d9e143bc3c4572753185 Mon Sep 17 00:00:00 2001 From: Casper3667 <8396443+Casper3667@users.noreply.github.com> Date: Thu, 27 Aug 2026 23:50:55 +0000 Subject: [PATCH] Stops IPC from being smacked by wrongly selected surgery tools and adds IPC facial repair surgery (#23140) IPC faceplates can be repaired with 5 sheets of steel, by targetting the mouth after opening up the head. This does not work on synthskin, as they have a separate surgery for it. Additionally IPC will no longer get randomly smacked if one guesses the next surgery tool wrong, assuming one is on help intent. --- code/datums/skills/occupational/operations.dm | 4 +- code/modules/surgery/facial_surgery.dm | 47 +++++++++++++++++++ code/modules/surgery/surgery.dm | 8 +++- html/changelogs/IPCSurgeryFix.yml | 7 +++ 4 files changed, 62 insertions(+), 4 deletions(-) create mode 100644 html/changelogs/IPCSurgeryFix.yml diff --git a/code/datums/skills/occupational/operations.dm b/code/datums/skills/occupational/operations.dm index 10a6edd4a8b..dcf4b060001 100644 --- a/code/datums/skills/occupational/operations.dm +++ b/code/datums/skills/occupational/operations.dm @@ -30,7 +30,7 @@ + " - Cutting someone out of a hardsuit." \ + " - Fully opening or closing mechanical parts to access internal systems, allowing repairs to any amount of damage.
" \ + " - Repairing, removing, or adding mechanical organs.
" \ - + " - Facial Reconstructions performed on Shell IPCs.
" \ + + " - Facial reconstructions performed on IPCs.
" \ + " - Attaching mechanical limbs (including to organics).
" \ + " - Re-attach (organic) limbs. Robotic limbs require the Robotics skill instead.
" \ + " - Perform all forms of internal repairs to IPCs.
" \ @@ -44,7 +44,7 @@ + " - Cutting someone out of a hardsuit." \ + " - Fully opening or closing mechanical parts to access internal systems, allowing repairs to any amount of damage.
" \ + " - Repairing, removing, or adding mechanical organs.
" \ - + " - Facial Reconstructions performed on Shell IPCs.
" \ + + " - Facial reconstructions performed on IPCs.
" \ + " - Attaching mechanical limbs (including to organics).
" \ + " - Re-attach (organic) limbs. Robotic limbs require the Robotics skill instead.
" \ + " - Perform all forms of internal repairs to IPCs.
" \ diff --git a/code/modules/surgery/facial_surgery.dm b/code/modules/surgery/facial_surgery.dm index 6c19a1fa94d..5aa69b479ae 100644 --- a/code/modules/surgery/facial_surgery.dm +++ b/code/modules/surgery/facial_surgery.dm @@ -138,6 +138,53 @@ /singleton/surgery_step/robotics/face/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) return ..() && target_zone == BP_MOUTH +/singleton/surgery_step/robotics/face/reconstruct_chassis + name = "Reconstruct Faceplate" + allowed_tools = list( + /obj/item/stack/material/steel = 100 + ) + base_surgery_time = 10 SECONDS + skill_requirements = alist(ROBOTICS_SKILL_COMPONENT = SKILL_LEVEL_TRAINED) + skill_diff_fail_modifier = SURGERY_DIFFICULTY_MEDIUM + +/singleton/surgery_step/robotics/face/reconstruct_chassis/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) + if(!..() || !isipc(target) || target.get_species() == SPECIES_IPC_SHELL) + return FALSE + + var/obj/item/organ/external/head/head = target.get_organ(target_zone) + if(head.open != ORGAN_ENCASED_RETRACTED) + return FALSE + + var/obj/item/stack/material/steel/steel = tool + return head?.disfigured && steel.get_amount() >= 5 + +/singleton/surgery_step/robotics/face/reconstruct_chassis/begin_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) + user.visible_message( + SPAN_NOTICE("[user] begins reshaping a steel sheet to reconstruct [target]'s mangled face plating."), + SPAN_NOTICE("You begin reshaping a steel sheet to reconstruct [target]'s mangled face plating.") + ) + ..() + +/singleton/surgery_step/robotics/face/reconstruct_chassis/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) + var/obj/item/organ/external/head/head = target.get_organ(target_zone) + var/obj/item/stack/material/steel/steel = tool + if(!head?.disfigured || !steel.use(5)) + to_chat(user, SPAN_WARNING("You can no longer complete the facial reconstruction.")) + return + + head.disfigured = FALSE + target.update_body() + user.visible_message( + SPAN_NOTICE("[user] finishes reconstructing [target]'s faceplate."), + SPAN_NOTICE("You successfully reconstruct [target]'s faceplate.") + ) + +/singleton/surgery_step/robotics/face/reconstruct_chassis/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) + user.visible_message( + SPAN_WARNING("[user] fails to properly shape the replacement plating for [target]'s faceplate."), + SPAN_WARNING("You fail to properly shape the replacement facial plating.") + ) + /singleton/surgery_step/robotics/face/synthskinopen name = "Retract facial incisions" allowed_tools = list( diff --git a/code/modules/surgery/surgery.dm b/code/modules/surgery/surgery.dm index 787669bd531..95b34cdfef6 100644 --- a/code/modules/surgery/surgery.dm +++ b/code/modules/surgery/surgery.dm @@ -124,10 +124,14 @@ // What surgeries does our tool/target enable? var/list/possible_surgeries + var/is_surgery_tool = FALSE var/list/all_surgeries = GET_SINGLETON_SUBTYPE_MAP(/singleton/surgery_step) for(var/decl in all_surgeries) var/singleton/surgery_step/S = all_surgeries[decl] - if(S.tool_quality(tool) && S.can_use(user, M, zone, tool)) + if(!S.tool_quality(tool)) + continue + is_surgery_tool = TRUE + if(S.can_use(user, M, zone, tool)) LAZYSET(possible_surgeries, S, TRUE) // Which surgery, if any, do we actually want to do? @@ -140,7 +144,7 @@ // We didn't find a surgery, or decided not to perform one. if(!istype(S)) - if(tool.item_flags & ITEM_FLAG_SURGERY) //Is this supposed to be used for surgery? + if(is_surgery_tool || (tool.item_flags & ITEM_FLAG_SURGERY)) //Is this supposed to be used for surgery? to_chat(user, SPAN_WARNING("You aren't sure what you could do to \the [M] with \the [tool].")) return TRUE return FALSE //Just do the normal use for the tool instead diff --git a/html/changelogs/IPCSurgeryFix.yml b/html/changelogs/IPCSurgeryFix.yml new file mode 100644 index 00000000000..57c45edde4c --- /dev/null +++ b/html/changelogs/IPCSurgeryFix.yml @@ -0,0 +1,7 @@ +author: TheGreyWolf + +delete-after: True + +changes: + - bugfix: "Non-synthskin IPC can now have their faces fixed." + - bugfix: "Using the wrong tool for an IPC surgery will no longer smack them with said item."