Files
Aurora.3/code/modules/surgery/limb_reattach.dm
T
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

147 lines
6.3 KiB
Plaintext

//Procedures in this file: Robotic limbs attachment, meat limbs attachment
//////////////////////////////////////////////////////////////////
// LIMB SURGERY //
//////////////////////////////////////////////////////////////////
/singleton/surgery_step/limb
priority = 3 // Must be higher than /singleton/surgery_step/internal
can_infect = FALSE
skill_requirements = alist(SURGERY_SKILL_COMPONENT = SKILL_LEVEL_TRAINED)
/singleton/surgery_step/limb/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)
if(affected)
return FALSE
var/list/organ_data = target.species.has_limbs["[target_zone]"]
var/obj/item/organ/external/E = tool
if(E?.parent_organ)
var/obj/item/organ/external/P = target.organs_by_name[E.parent_organ]
if(!P || P.is_stump() || !P.supports_children || (BP_IS_ROBOTIC(P) && !BP_IS_ROBOTIC(E)))
return FALSE // Parent organ non-existant or unsuitable
return !isnull(organ_data)
/singleton/surgery_step/limb/attach
name = "Replace Limb"
allowed_tools = list(/obj/item/organ/external = 100)
min_duration = 40
max_duration = 60
skill_requirements = alist(SURGERY_SKILL_COMPONENT = SKILL_LEVEL_TRAINED)
/singleton/surgery_step/limb/attach/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/obj/item/organ/external/E = tool
user.visible_message("<b>[user]</b> starts attaching [E.name] to [target]'s [E.amputation_point].", \
SPAN_NOTICE("You start attaching [E.name] to [target]'s [E.amputation_point]."))
/singleton/surgery_step/limb/attach/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/obj/item/organ/external/E = tool
user.visible_message("<b>[user]</b> attaches [target]'s [E.name] to the [E.amputation_point].", \
SPAN_NOTICE("You have attached [target]'s [E.name] to the [E.amputation_point]."))
user.drop_from_inventory(E)
E.replaced(target)
target.update_body()
target.updatehealth()
target.UpdateDamageIcon()
/singleton/surgery_step/limb/attach/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/obj/item/organ/external/E = tool
user.visible_message(SPAN_WARNING("[user]'s hand slips, damaging [target]'s [E.amputation_point]!"), \
SPAN_WARNING("Your hand slips, damaging [target]'s [E.amputation_point]!"))
target.apply_damage(10, DAMAGE_BRUTE, null, damage_flags = DAMAGE_FLAG_EDGE)
/singleton/surgery_step/limb/connect
name = "Connect Limb"
allowed_tools = list(
TOOL_HEMOSTAT = 100, \
TOOL_CABLECOIL = 75, \
/obj/item/assembly/mousetrap = 20
)
can_infect = TRUE
min_duration = 80
max_duration = 100
skill_requirements = alist(SURGERY_SKILL_COMPONENT = SKILL_LEVEL_TRAINED)
/singleton/surgery_step/limb/connect/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if(!..())
return FALSE
var/obj/item/organ/external/E = target.get_organ(target_zone)
return E && !E.is_stump() && (E.status & ORGAN_DESTROYED)
/singleton/surgery_step/limb/connect/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/obj/item/organ/external/E = target.get_organ(target_zone)
user.visible_message("[user] starts connecting tendons and muscles in [target]'s [E.amputation_point] with [tool].", \
"You start connecting tendons and muscle in [target]'s [E.amputation_point].")
..()
/singleton/surgery_step/limb/connect/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/obj/item/organ/external/E = target.get_organ(target_zone)
user.visible_message("<b>[user]</b> has connected tendons and muscles in [target]'s [E.amputation_point] with [tool].", \
SPAN_NOTICE("You have connected tendons and muscles in [target]'s [E.amputation_point] with [tool]."))
E.status &= ~ORGAN_DESTROYED
if(E.children)
for(var/obj/item/organ/external/C in E.children)
C.status &= ~ORGAN_DESTROYED
target.update_body()
target.updatehealth()
target.UpdateDamageIcon()
/singleton/surgery_step/limb/connect/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/obj/item/organ/external/E = tool
user.visible_message(SPAN_WARNING("[user]'s hand slips, damaging [target]'s [E.amputation_point]!"), \
SPAN_WARNING("Your hand slips, damaging [target]'s [E.amputation_point]!"))
target.apply_damage(10, DAMAGE_BRUTE, null, damage_flags = DAMAGE_FLAG_SHARP)
/singleton/surgery_step/limb/mechanize
name = "Attach Prosthetic Limb"
allowed_tools = list(/obj/item/robot_parts = 100)
min_duration = 60
max_duration = 80
skill_requirements = alist(ROBOTICS_SKILL_COMPONENT = SKILL_LEVEL_TRAINED)
/singleton/surgery_step/limb/mechanize/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if(!..())
return FALSE
var/obj/item/robot_parts/p = tool
if(p.part)
if(!(target_zone in p.part))
return FALSE
return isnull(target.get_organ(target_zone))
/singleton/surgery_step/limb/mechanize/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message("<b>[user]</b> starts attaching \the [tool] to [target].", \
SPAN_NOTICE("You start attaching \the [tool] to [target]."))
/singleton/surgery_step/limb/mechanize/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/obj/item/robot_parts/L = tool
user.visible_message("<b>[user]</b> has attached \the [tool] to [target].", \
SPAN_NOTICE("You have attached \the [tool] to [target]."))
if(L.part)
for(var/part_name in L.part)
if(!isnull(target.get_organ(part_name)))
continue
var/list/organ_data = target.species.has_limbs["[part_name]"]
if(!organ_data)
continue
var/new_limb_type = organ_data["path"]
var/obj/item/organ/external/new_limb = new new_limb_type(target)
new_limb.robotize(L.model_info)
if(L.sabotaged)
new_limb.sabotaged = 1
target.update_body()
target.updatehealth()
target.UpdateDamageIcon()
qdel(tool)
/singleton/surgery_step/limb/mechanize/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message(SPAN_WARNING("[user]'s hand slips, damaging [target]'s flesh!"), \
SPAN_WARNING("Your hand slips, damaging [target]'s flesh!"))
target.apply_damage(10, DAMAGE_BRUTE, null, damage_flags = DAMAGE_FLAG_SHARP)