Files
Aurora.3/code/modules/surgery/encased.dm
VMSolidus 260f744906 Skills System Revival: The Things She Remembered Had Never Been Her Own (#21853)
This PR is a revisit to the previously derelict PR #20159 that has been
unfinished for sometime now. More details about it in general can be
found here:
https://github.com/orgs/Aurorastation/projects/2?pane=issue&itemId=53167153

For awhile I've been talking about "Things I've been doing but it would
be really nice to do them with a skills system", or "And here's how I
would put this into the skills system when it's done". The main thing
that was stopping me from building it myself was having poor real life
skills in UI code and in DB code. However, I've gotten permission to
resume this PR, which has already completed the steps I would not have
been able to do myself. The rest of the PR fits well into my skillset as
a dev.

I'm opening this PR as a draft so as to enable my dev environment to
locally track all the previously modified files. I'll take this PR out
of draft and give this a full writeup when I have more work to show for
the PR this weekend.

### TODO

- [x] Rework a decent chunk of the currently existing skills to no
longer require hardcoded inserts into other systems. EG, converting from
classical ss13 methods, to modern /tg/-style ECS coding methods that
work off of component-signal patterns.
- [x] Make sure all of the existing skills have actual game
functionality (I won't PR a 2016 Baystation12 situation where 90% of the
skills are fluff only)
- [x] Add the various skills not yet made but are necessary for
completion sake, EG: Pilot (Spacecraft), Gunnery, Pilot (Walkers).
- [x] Examine each existing job in the game and assess whether it should
have a skill made with it in mind, or if it's covered by an existing
skill.
- [x] TO DISCUSS, BUT NOT ESSENTIAL: Additional skill proposals not
currently in the pre-existing TODO list, proposing subcategories.
- [x] Ensure that the previous TODO list is completed.

### Current Skills
The current list of skills, checkmarked for if I've completed them/they
have actual game mechanics. Or if we're just relegating them to separate
PRs. Originally this list was going to be forced to visit for a bare
minimum "does at least one thing" requirement, but now that is being
forgone due to this PR ballooning out of control and in complexity, as
well as development time overruns.

- [x] Bartending
- [x] Cooking
- [x] Gardening
- [x] Entertaining
- [x] Electrical Engineering
- [x] Mechanical Engineering
- [x] Atmospherics Systems
- [x] Reactor Systems
- [x] Medicine
- [x] Surgery
- [x] Pharmacology
- [x] Anatomy
- [x] Forensics
- [x] Robotics
- [x] Pilot: Spacecraft
- [x] Pilot: Exosuits
- [x] Research
- [x] Xenobotany
- [x] Xenoarchaeology
- [x] Xenobiology
- [x] Unarmed Combat
- [x] Armed Combat
- [x] Firearms
- [x] Leadership

---------

Signed-off-by: VMSolidus <evilexecutive@gmail.com>
Co-authored-by: Matt Atlas <liermattia@gmail.com>
Co-authored-by: FabianK3 <21039694+FabianK3@users.noreply.github.com>
Co-authored-by: Matt Atlas <mattiathebest2000@hotmail.it>
2026-04-18 14:33:48 +00:00

222 lines
9.1 KiB
Plaintext

//Procedures in this file: Generic ribcage opening steps, Removing alien embryo, Fixing internal organs.
//////////////////////////////////////////////////////////////////
// GENERIC RIBCAGE SURGERY //
//////////////////////////////////////////////////////////////////
/singleton/surgery_step/open_encased
name = "Saw Through Bone"
priority = 2
can_infect = TRUE
blood_level = 1
skill_requirements = alist(SURGERY_SKILL_COMPONENT = SKILL_LEVEL_TRAINED)
/singleton/surgery_step/open_encased/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if(!..())
return FALSE
var/obj/item/organ/external/affected = target.get_organ(target_zone)
return affected && !BP_IS_ROBOTIC(affected) && affected.encased && affected.open >= ORGAN_OPEN_RETRACTED
/singleton/surgery_step/open_encased/saw
allowed_tools = list(
TOOL_SAW = 100,
/obj/item/melee/energy = 100,
/obj/item/melee/chainsword = 70,
/obj/item/material/hatchet = 75
)
min_duration = 30
max_duration = 50
/singleton/surgery_step/open_encased/saw/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if(!..())
return FALSE
var/obj/item/organ/external/affected = target.get_organ(target_zone)
return affected && affected.open == ORGAN_OPEN_RETRACTED
/singleton/surgery_step/open_encased/saw/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if(!ishuman(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("[user] begins to cut through [target]'s [affected.encased] with \the [tool].", \
"You begin to cut through [target]'s [affected.encased] with \the [tool].")
target.custom_pain("Something hurts horribly in your [affected.name]!", 75)
..()
/singleton/surgery_step/open_encased/saw/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if(!ishuman(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("<b>[user]</b> has cut [target]'s [affected.encased] open with \the [tool].", \
SPAN_NOTICE("You have cut [target]'s [affected.encased] open with \the [tool]."))
affected.open = ORGAN_ENCASED_OPEN
/singleton/surgery_step/open_encased/saw/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if(!ishuman(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message(SPAN_WARNING("[user]'s hand slips, cracking [target]'s [affected.encased] with \the [tool]!") , \
SPAN_WARNING("Your hand slips, cracking [target]'s [affected.encased] with \the [tool]!") )
target.apply_damage(20, DAMAGE_BRUTE, target_zone, 0, tool, damage_flags = tool.damage_flags())
affected.fracture()
/singleton/surgery_step/open_encased/retract
name = "Retract Sawed Bone"
allowed_tools = list(
TOOL_RETRACTOR = 100, \
TOOL_CROWBAR = 75
)
min_duration = 20
max_duration = 30
skill_requirements = alist(SURGERY_SKILL_COMPONENT = SKILL_LEVEL_TRAINED)
/singleton/surgery_step/open_encased/retract/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if(!..())
return FALSE
var/obj/item/organ/external/affected = target.get_organ(target_zone)
return affected && affected.open == ORGAN_ENCASED_OPEN
/singleton/surgery_step/open_encased/retract/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if(!ishuman(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
var/msg = "[user] starts to force open the [affected.encased] in [target]'s [affected.name] with \the [tool]."
var/self_msg = "You start to force open the [affected.encased] in [target]'s [affected.name] with \the [tool]."
user.visible_message(msg, self_msg)
target.custom_pain("Something hurts horribly in your [affected.name]!", 75)
..()
/singleton/surgery_step/open_encased/retract/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if(!ishuman(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
var/msg = "<b>[user]</b> forces open [target]'s [affected.encased] with \the [tool]."
var/self_msg = "You force open [target]'s [affected.encased] with \the [tool]."
user.visible_message(msg, SPAN_NOTICE(self_msg))
..()
affected.open = ORGAN_ENCASED_RETRACTED
for(var/obj/item/implant/I in affected.implants)
I.exposed()
/singleton/surgery_step/open_encased/retract/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if(!ishuman(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
var/msg = SPAN_WARNING("[user]'s hand slips, cracking [target]'s [affected.encased]!")
var/self_msg = SPAN_WARNING("Your hand slips, cracking [target]'s [affected.encased]!")
user.visible_message(msg, self_msg)
target.apply_damage(20, DAMAGE_BRUTE, target_zone, 0, tool, damage_flags = tool.damage_flags())
affected.fracture()
/singleton/surgery_step/open_encased/close
name = "Bend Sawed Bone Closed"
allowed_tools = list(
TOOL_RETRACTOR = 100, \
TOOL_CROWBAR = 75
)
min_duration = 20
max_duration = 30
skill_requirements = alist(SURGERY_SKILL_COMPONENT = SKILL_LEVEL_TRAINED)
/singleton/surgery_step/open_encased/close/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if(!..())
return FALSE
var/obj/item/organ/external/affected = target.get_organ(target_zone)
return affected && affected.open == ORGAN_ENCASED_RETRACTED
/singleton/surgery_step/open_encased/close/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if(!ishuman(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
var/msg = "[user] starts bending [target]'s [affected.encased] back into place with \the [tool]."
var/self_msg = "You start bending [target]'s [affected.encased] back into place with \the [tool]."
user.visible_message(msg, self_msg)
target.custom_pain("Something hurts horribly in your [affected.name]!", 75)
..()
/singleton/surgery_step/open_encased/close/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if(!ishuman(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
var/msg = "<b>[user]</b> bends [target]'s [affected.encased] back into place with \the [tool]."
var/self_msg = "You bend [target]'s [affected.encased] back into place with \the [tool]."
user.visible_message(msg, SPAN_NOTICE(self_msg))
target.custom_pain("Something hurts horribly in your [affected.name]!", 75)
..()
affected.open = ORGAN_ENCASED_OPEN
/singleton/surgery_step/open_encased/close/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if(!ishuman(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
var/msg = SPAN_WARNING("[user]'s hand slips, bending [target]'s [affected.encased] the wrong way!")
var/self_msg = SPAN_WARNING("Your hand slips, bending [target]'s [affected.encased] the wrong way!")
user.visible_message(msg, self_msg)
target.apply_damage(20, DAMAGE_BRUTE, target_zone, 0, tool, damage_flags = tool.damage_flags())
affected.fracture()
if(affected.internal_organs && affected.internal_organs.len)
if(prob(40))
var/obj/item/organ/O = pick(affected.internal_organs) //TODO weight by organ size
user.visible_message(SPAN_DANGER("A wayward piece of [target]'s [affected.encased] pierces [target.get_pronoun("his")] [O.name]!"))
O.bruise()
/singleton/surgery_step/open_encased/mend
name = "Repair Sawed Bone"
allowed_tools = list(
/obj/item/surgery/bone_gel = 100, \
/obj/item/tape_roll = 60
)
min_duration = 20
max_duration = 30
skill_requirements = alist(SURGERY_SKILL_COMPONENT = SKILL_LEVEL_TRAINED)
/singleton/surgery_step/open_encased/mend/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if(!..())
return FALSE
var/obj/item/organ/external/affected = target.get_organ(target_zone)
return affected && affected.open == ORGAN_ENCASED_OPEN
/singleton/surgery_step/open_encased/mend/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if(!ishuman(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
var/msg = "[user] starts applying \the [tool] to [target]'s [affected.encased]."
var/self_msg = "You start applying \the [tool] to [target]'s [affected.encased]."
user.visible_message(msg, self_msg)
target.custom_pain("Something hurts horribly in your [affected.name]!", 75)
..()
/singleton/surgery_step/open_encased/mend/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if(!ishuman(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
var/msg = "<b>[user]</b> applies some of \the [tool] to [target]'s [affected.encased]."
var/self_msg = "You apply some of \the [tool] to [target]'s [affected.encased]."
user.visible_message(msg, SPAN_NOTICE(self_msg))
target.custom_pain("Something hurts horribly in your [affected.name]!", 75)
..()
affected.open = ORGAN_OPEN_RETRACTED