Makes surgery steps have names. Exclusive Steps.

This commit is contained in:
C.L
2022-10-03 04:44:49 -04:00
parent 366533390e
commit 47230cac4f
13 changed files with 112 additions and 14 deletions
+6 -1
View File
@@ -8,6 +8,7 @@
///////////////////////////////////////////////////////////////
/datum/surgery_step/glue_bone
surgery_name = "Glue Bone"
allowed_tools = list(
/obj/item/weapon/surgical/bonegel = 100
)
@@ -52,6 +53,7 @@
///////////////////////////////////////////////////////////////
/datum/surgery_step/set_bone
surgery_name = "Set Bone"
allowed_tools = list(
/obj/item/weapon/surgical/bonesetter = 100
)
@@ -98,6 +100,7 @@
///////////////////////////////////////////////////////////////
/datum/surgery_step/mend_skull
surgery_name = "Mend Skull"
allowed_tools = list(
/obj/item/weapon/surgical/bonesetter = 100
)
@@ -139,6 +142,7 @@
///////////////////////////////////////////////////////////////
/datum/surgery_step/finish_bone
surgery_name = "Finish Mending Bone"
allowed_tools = list(
/obj/item/weapon/surgical/bonegel = 100
)
@@ -182,6 +186,7 @@
///////////////////////////////////////////////////////////////
/datum/surgery_step/clamp_bone
surgery_name = "Clamp Bone"
allowed_tools = list(
/obj/item/weapon/surgical/bone_clamp = 100
)
@@ -218,4 +223,4 @@
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("<span class='danger'>[user]'s hand slips, damaging the bone in [target]'s [affected.name] with \the [tool]!</span>" , \
"<span class='danger'>Your hand slips, damaging the bone in [target]'s [affected.name] with \the [tool]!</span>")
affected.createwound(BRUISE, 5)
affected.createwound(BRUISE, 5)
+8
View File
@@ -3,6 +3,7 @@
// GENERIC RIBCAGE SURGERY //
//////////////////////////////////////////////////////////////////
/datum/surgery_step/open_encased
surgery_name = "Open Encased"
priority = 2
can_infect = 1
blood_level = 1
@@ -21,6 +22,7 @@
///////////////////////////////////////////////////////////////
/datum/surgery_step/open_encased/saw
surgery_name = "Cut Ribs"
allowed_tools = list(
/obj/item/weapon/surgical/circular_saw = 100, \
/obj/item/weapon/material/knife/machete/hatchet = 75
@@ -70,6 +72,7 @@
///////////////////////////////////////////////////////////////
/datum/surgery_step/open_encased/retract
surgery_name = "Retract Ribs Open"
allowed_tools = list(
/obj/item/weapon/surgical/retractor = 100
)
@@ -123,6 +126,7 @@
///////////////////////////////////////////////////////////////
/datum/surgery_step/open_encased/close
surgery_name = "Retract Ribs Closed"
allowed_tools = list(
/obj/item/weapon/surgical/retractor = 100,
)
@@ -181,6 +185,7 @@
///////////////////////////////////////////////////////////////
/datum/surgery_step/open_encased/mend
surgery_name = "Mend Bones"
allowed_tools = list(
/obj/item/weapon/surgical/bonegel = 100
)
@@ -222,6 +227,7 @@
// Saw/Retractor/Gel Combi-open and close.
///////////////////////////////////////////////////////////////
/datum/surgery_step/open_encased/advancedsaw_open
surgery_name = "Advanced Cut Ribs"
allowed_tools = list(
/obj/item/weapon/surgical/circular_saw/manager = 100
)
@@ -230,6 +236,7 @@
min_duration = 60
max_duration = 90
excludes_steps = list(/datum/surgery_step/open_encased/saw)
/datum/surgery_step/open_encased/advancedsaw_open/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (!hasorgans(target))
@@ -271,6 +278,7 @@
/datum/surgery_step/open_encased/advancedsaw_mend
surgery_name = "Advanced Mend Ribs"
allowed_tools = list(
/obj/item/weapon/surgical/circular_saw/manager = 100
)
+4
View File
@@ -3,6 +3,7 @@
// LIMB REPAIR SURGERY //
//////////////////////////////////////////////////////////////////
/datum/surgery_step/repairflesh/
surgery_name = "Repair Flesh"
priority = 1
can_infect = 1
blood_level = 1
@@ -36,6 +37,7 @@
//////////////////////////////////////////////////////////////////
/datum/surgery_step/repairflesh/scan_injury
surgery_name = "Scan Injury"
allowed_tools = list(
/obj/item/weapon/autopsy_scanner = 100,
/obj/item/device/analyzer = 10
@@ -86,6 +88,7 @@
//////////////////////////////////////////////////////////////////
/datum/surgery_step/repairflesh/repair_burns
surgery_name = "Repair Burns"
allowed_tools = list(
/obj/item/stack/medical/advanced/ointment = 100,
/obj/item/stack/medical/ointment = 50,
@@ -152,6 +155,7 @@
//////////////////////////////////////////////////////////////////
/datum/surgery_step/repairflesh/repair_brute
surgery_name = "Repair Brute"
allowed_tools = list(
/obj/item/stack/medical/advanced/bruise_pack = 100,
/obj/item/stack/medical/bruise_pack = 50,
+6 -1
View File
@@ -4,6 +4,7 @@
//////////////////////////////////////////////////////////////////
/datum/surgery_step/face
surgery_name = "Facial Surgery"
priority = 2
req_open = 0
can_infect = 0
@@ -23,6 +24,7 @@
///////////////////////////////////////////////////////////////
/datum/surgery_step/generic/cut_face
surgery_name = "Cut Face"
allowed_tools = list(
/obj/item/weapon/surgical/scalpel = 100, \
/obj/item/weapon/material/knife = 75, \
@@ -57,6 +59,7 @@
///////////////////////////////////////////////////////////////
/datum/surgery_step/face/mend_vocal
surgery_name = "Mend Vocal Cords"
allowed_tools = list(
/obj/item/weapon/surgical/hemostat = 100, \
/obj/item/stack/cable_coil = 75, \
@@ -89,6 +92,7 @@
///////////////////////////////////////////////////////////////
/datum/surgery_step/face/fix_face
surgery_name = "Fix Face"
allowed_tools = list(
/obj/item/weapon/surgical/retractor = 100, \
/obj/item/weapon/material/kitchen/utensil/fork = 75
@@ -123,6 +127,7 @@
///////////////////////////////////////////////////////////////
/datum/surgery_step/face/cauterize
surgery_name = "Cauterize Face"
allowed_tools = list(
/obj/item/weapon/surgical/cautery = 100, \
/obj/item/clothing/mask/smokable/cigarette = 75, \
@@ -156,4 +161,4 @@
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("<span class='danger'>[user]'s hand slips, leaving a small burn on [target]'s face with \the [tool]!</span>", \
"<span class='danger'>Your hand slips, leaving a small burn on [target]'s face with \the [tool]!</span>")
target.apply_damage(4, BURN, affected)
target.apply_damage(4, BURN, affected)
+21 -4
View File
@@ -29,6 +29,7 @@
///////////////////////////////////////////////////////////////
/datum/surgery_step/generic/cut_open
surgery_name = "Create Incision"
allowed_tools = list(
/obj/item/weapon/surgical/scalpel = 100, \
/obj/item/weapon/material/knife = 75, \
@@ -73,16 +74,18 @@
///////////////////////////////////////////////////////////////
/datum/surgery_step/generic/cut_with_laser
surgery_name = "Create Bloodless Incision"
allowed_tools = list(
/obj/item/weapon/surgical/scalpel/laser3 = 95, \
/obj/item/weapon/surgical/scalpel/laser2 = 85, \
/obj/item/weapon/surgical/scalpel/laser1 = 75, \
/obj/item/weapon/surgical/scalpel/laser3 = 100, \
/obj/item/weapon/surgical/scalpel/laser2 = 100, \
/obj/item/weapon/surgical/scalpel/laser1 = 100, \
/obj/item/weapon/melee/energy/sword = 5
)
priority = 2
req_open = 0
min_duration = 90
max_duration = 110
excludes_steps = list(/datum/surgery_step/generic/cut_open)
/datum/surgery_step/generic/cut_with_laser/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if(..())
@@ -104,7 +107,15 @@
affected.open = 1
affected.createwound(CUT, 1)
affected.organ_clamp()
var/clamp_chance = 0 //I hate this. Make all laser scalpels a /laser subtype and give them a clamp_chance var???
if(istype(tool,/obj/item/weapon/surgical/scalpel/laser1))
clamp_chance = 75
if(istype(tool,/obj/item/weapon/surgical/scalpel/laser2))
clamp_chance = 85
if(istype(tool,/obj/item/weapon/surgical/scalpel/laser3))
clamp_chance = 95
if(clamp_chance)
affected.organ_clamp()
spread_germs_to_organ(affected, user)
/datum/surgery_step/generic/cut_with_laser/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
@@ -119,6 +130,7 @@
///////////////////////////////////////////////////////////////
/datum/surgery_step/generic/incision_manager
surgery_name = "Create Prepared Incision"
allowed_tools = list(
/obj/item/weapon/surgical/scalpel/manager = 100
)
@@ -127,6 +139,7 @@
req_open = 0
min_duration = 80
max_duration = 120
excludes_steps = list(/datum/surgery_step/generic/cut_open)
/datum/surgery_step/generic/incision_manager/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if(..())
@@ -165,6 +178,7 @@
///////////////////////////////////////////////////////////////
/datum/surgery_step/generic/clamp_bleeders
surgery_name = "Clamp Bleeders"
allowed_tools = list(
/obj/item/weapon/surgical/hemostat = 100, \
/obj/item/stack/cable_coil = 75, \
@@ -204,6 +218,7 @@
///////////////////////////////////////////////////////////////
/datum/surgery_step/generic/retract_skin
surgery_name = "Retract Skin"
allowed_tools = list(
/obj/item/weapon/surgical/retractor = 100, \
/obj/item/weapon/material/kitchen/utensil/fork = 50
@@ -264,6 +279,7 @@
///////////////////////////////////////////////////////////////
/datum/surgery_step/generic/cauterize
surgery_name = "Cauterize Incision"
allowed_tools = list(
/obj/item/weapon/surgical/cautery = 100, \
/obj/item/clothing/mask/smokable/cigarette = 75, \
@@ -305,6 +321,7 @@
///////////////////////////////////////////////////////////////
/datum/surgery_step/generic/amputate
surgery_name = "Amputate Limb"
allowed_tools = list(
/obj/item/weapon/surgical/circular_saw = 100, \
/obj/item/weapon/material/knife/machete/hatchet = 75
+5
View File
@@ -5,6 +5,7 @@
//////////////////////////////////////////////////////////////////
/datum/surgery_step/cavity
surgery_name = "Cavity"
priority = 1
/datum/surgery_step/cavity/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
@@ -46,6 +47,7 @@
///////////////////////////////////////////////////////////////
/datum/surgery_step/cavity/make_space
surgery_name = "Create Cavity"
allowed_tools = list(
/obj/item/weapon/surgical/surgicaldrill = 100, \
/obj/item/weapon/pen = 75, \
@@ -78,6 +80,7 @@
///////////////////////////////////////////////////////////////
/datum/surgery_step/cavity/close_space
surgery_name = "Close Cavity"
priority = 2
allowed_tools = list(
/obj/item/weapon/surgical/cautery = 100, \
@@ -112,6 +115,7 @@
///////////////////////////////////////////////////////////////
/datum/surgery_step/cavity/place_item
surgery_name = "Implant Object"
priority = 0
allowed_tools = list(/obj/item = 100)
@@ -175,6 +179,7 @@
//////////////////////////////////////////////////////////////////
/datum/surgery_step/cavity/implant_removal
surgery_name = "Remove Implant"
allowed_tools = list(
/obj/item/weapon/surgical/hemostat = 100, \
/obj/item/weapon/material/kitchen/utensil/fork = 20
+4
View File
@@ -4,6 +4,7 @@
//////////////////////////////////////////////////////////////////
/datum/surgery_step/limb/
surgery_name = "Limb"
priority = 3 // Must be higher than /datum/surgery_step/internal
req_open = 0
can_infect = 0
@@ -22,6 +23,7 @@
///////////////////////////////////////////////////////////////
/datum/surgery_step/limb/attach
surgery_name = "Attach Limb"
allowed_tools = list(/obj/item/organ/external = 100)
min_duration = 50
@@ -81,6 +83,7 @@
///////////////////////////////////////////////////////////////
/datum/surgery_step/limb/connect
surgery_name = "Connect Limb"
allowed_tools = list(
/obj/item/weapon/surgical/hemostat = 100, \
/obj/item/stack/cable_coil = 75, \
@@ -120,6 +123,7 @@
///////////////////////////////////////////////////////////////
/datum/surgery_step/limb/mechanize
surgery_name = "Mechanize Limb"
allowed_tools = list(/obj/item/robot_parts = 100)
min_duration = 80
+7
View File
@@ -4,6 +4,7 @@
//////////////////////////////////////////////////////////////////////
/datum/surgery_step/brainstem
surgery_name = "Brainstem"
priority = 2
req_open = 1
can_infect = 1
@@ -23,6 +24,7 @@
/////////////////////////////
/datum/surgery_step/brainstem/mend_vessels
surgery_name = "Mend Vessels"
priority = 1
allowed_tools = list(
/obj/item/weapon/surgical/FixOVein = 100,
@@ -57,6 +59,7 @@
/////////////////////////////
/datum/surgery_step/brainstem/drill_vertebrae
surgery_name = "Drill Vertebrae"
priority = 3 //Do this instead of expanding the skull cavity
allowed_tools = list(
/obj/item/weapon/surgical/surgicaldrill = 100,
@@ -100,6 +103,7 @@
/////////////////////////////
/datum/surgery_step/brainstem/clean_chips
surgery_name = "Remove Bone Chips"
priority = 3 //Do this instead of picking around for implants.
allowed_tools = list(
/obj/item/weapon/surgical/hemostat = 100,
@@ -139,6 +143,7 @@
/////////////////////////////
/datum/surgery_step/brainstem/mend_cord
surgery_name = "Mend Spinal Cord"
priority = 1 //Do this after IB.
allowed_tools = list(
/obj/item/weapon/surgical/FixOVein = 100,
@@ -179,6 +184,7 @@
/////////////////////////////
/datum/surgery_step/brainstem/mend_vertebrae
surgery_name = "Mend Vertebrae"
priority = 3 //Do this instead of fixing bones.
allowed_tools = list(
/obj/item/weapon/surgical/bonegel = 100,
@@ -217,6 +223,7 @@
/////////////////////////////
/datum/surgery_step/brainstem/realign_tissue
surgery_name = "Realign Tissue"
priority = 3 //Do this instead of searching for objects in the skull.
allowed_tools = list(
/obj/item/weapon/surgical/hemostat = 100,
+1
View File
@@ -445,6 +445,7 @@
///////////////////////////////////////////////////////////////
/datum/surgery_step/internal/rip_organ
surgery_name = "Rip Organ"
allowed_tools = list(
/obj/item/weapon/surgical/scalpel/ripper = 100
+10 -1
View File
@@ -8,6 +8,7 @@
///////////////////////////////////////////////////////////////
/datum/surgery_step/fix_vein
surgery_name = "Fix Vein"
priority = 2
allowed_tools = list(
/obj/item/weapon/surgical/FixOVein = 100, \
@@ -61,6 +62,7 @@
// Necrosis Surgery Step 1
///////////////////////////////////////////////////////////////
/datum/surgery_step/fix_dead_tissue //Debridement
surgery_name = "Remove Dead Tissue"
priority = 2
allowed_tools = list(
/obj/item/weapon/surgical/scalpel = 100, \
@@ -110,6 +112,7 @@
// Necrosis Surgery Step 2
///////////////////////////////////////////////////////////////
/datum/surgery_step/treat_necrosis
surgery_name = "Treat Necrosis"
priority = 2
allowed_tools = list(
/obj/item/weapon/reagent_containers/dropper = 100,
@@ -187,6 +190,7 @@
///////////////////////////////////////////////////////////////
/datum/surgery_step/hardsuit
surgery_name = "Remove Hardsuit"
allowed_tools = list(
/obj/item/weapon/weldingtool = 80,
/obj/item/weapon/surgical/circular_saw = 60,
@@ -241,6 +245,7 @@
var/dehusk = 0
/datum/surgery_step/dehusk/
surgery_name = "Dehusk"
priority = 1
can_infect = 0
blood_level = 1
@@ -256,6 +261,7 @@
return target_zone == BP_TORSO && (HUSK in target.mutations)
/datum/surgery_step/dehusk/structinitial
surgery_name = "Create Structure"
allowed_tools = list(
/obj/item/weapon/surgical/bioregen = 100
)
@@ -285,6 +291,7 @@
..()
/datum/surgery_step/dehusk/relocateflesh
surgery_name = "Relocate Flesh"
allowed_tools = list(
/obj/item/weapon/surgical/hemostat = 100, \
/obj/item/stack/cable_coil = 75, \
@@ -316,6 +323,7 @@
..()
/datum/surgery_step/dehusk/structfinish
surgery_name = "Finish Structure"
allowed_tools = list(
/obj/item/weapon/surgical/bioregen = 100, \
/obj/item/weapon/surgical/FixOVein = 30
@@ -357,6 +365,7 @@
..()
/datum/surgery_step/internal/detoxify
surgery_name = "Detoxify"
blood_level = 1
allowed_tools = list(/obj/item/weapon/surgical/bioregen=100)
min_duration = 90
@@ -385,4 +394,4 @@
"<span class='danger'>Your hand slips, failing to finish the surgery, and damaging [target] with \the [tool].</span>")
affected.createwound(CUT, 15)
affected.createwound(BRUISE, 10)
..()
..()
+11 -1
View File
@@ -4,6 +4,7 @@
//////////////////////////////////////////////////////////////////
/datum/surgery_step/robotics/
surgery_name = "Robotic Surgery"
can_infect = 0
/datum/surgery_step/robotics/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
@@ -29,6 +30,7 @@
///////////////////////////////////////////////////////////////
/datum/surgery_step/robotics/unscrew_hatch
surgery_name = "Unscrew Hatch"
allowed_tools = list(
/obj/item/weapon/coin = 50,
/obj/item/weapon/material/knife = 50
@@ -68,6 +70,7 @@
///////////////////////////////////////////////////////////////
/datum/surgery_step/robotics/open_hatch
surgery_name = "Open Hatch"
allowed_tools = list(
/obj/item/weapon/surgical/retractor = 100,
/obj/item/weapon/material/kitchen/utensil = 50
@@ -105,6 +108,7 @@
///////////////////////////////////////////////////////////////
/datum/surgery_step/robotics/close_hatch
surgery_name = "Close Hatch"
allowed_tools = list(
/obj/item/weapon/surgical/retractor = 100,
/obj/item/weapon/material/kitchen/utensil = 50
@@ -143,6 +147,7 @@
///////////////////////////////////////////////////////////////
/datum/surgery_step/robotics/repair_brute
surgery_name = "Repair Brute"
allowed_tools = list(
/obj/item/weapon/weldingtool = 100,
/obj/item/weapon/pickaxe/plasmacutter = 50
@@ -184,6 +189,7 @@
///////////////////////////////////////////////////////////////
/datum/surgery_step/robotics/repair_burn
surgery_name = "Repair Burn"
allowed_tools = list(
/obj/item/stack/cable_coil = 100
)
@@ -232,6 +238,7 @@
///////////////////////////////////////////////////////////////
/datum/surgery_step/robotics/fix_organ_robotic //For artificial organs
surgery_name = "Fix Internal Components"
allowed_tools = list(
/obj/item/stack/nanopaste = 100, \
/obj/item/weapon/surgical/bonegel = 30, \
@@ -302,7 +309,7 @@
///////////////////////////////////////////////////////////////
/datum/surgery_step/robotics/detatch_organ_robotic
surgery_name = "Remove Organ"
allowed_tools = list(
/obj/item/device/multitool = 100
)
@@ -355,6 +362,7 @@
///////////////////////////////////////////////////////////////
/datum/surgery_step/robotics/attach_organ_robotic
surgery_name = "Attach Organ"
allowed_procs = list(IS_SCREWDRIVER = 100)
min_duration = 100
@@ -404,6 +412,7 @@
///////////////////////////////////////////////////////////////
/datum/surgery_step/robotics/install_mmi
surgery_name = "Install MMI"
allowed_tools = list(
/obj/item/device/mmi = 100
)
@@ -488,6 +497,7 @@
*/
/datum/surgery_step/robotics/install_nymph
surgery_name = "Install Nymph"
allowed_tools = list(
/obj/item/weapon/holder/diona = 100
)
+5 -1
View File
@@ -3,6 +3,7 @@
//////////////////////////////////////////////////////////////////
/datum/surgery_step/slime
surgery_name = "Slime Surgery"
is_valid_target(mob/living/simple_mob/slime/target)
return istype(target, /mob/living/simple_mob/slime/)
@@ -12,6 +13,7 @@
/datum/surgery_step/slime/cut_flesh
surgery_name = "Cut Flesh"
allowed_tools = list(
/obj/item/weapon/surgical/scalpel = 100, \
/obj/item/weapon/material/knife = 75, \
@@ -40,6 +42,7 @@
/datum/surgery_step/slime/cut_innards
surgery_name = "Cut Innards"
allowed_tools = list(
/obj/item/weapon/surgical/scalpel = 100, \
/obj/item/weapon/material/knife = 75, \
@@ -68,6 +71,7 @@
/datum/surgery_step/slime/saw_core
surgery_name = "Remove Core"
allowed_tools = list(
/obj/item/weapon/surgical/circular_saw = 100, \
/obj/item/weapon/material/knife/machete/hatchet = 75
@@ -97,4 +101,4 @@
/datum/surgery_step/slime/saw_core/fail_step(mob/living/user, mob/living/simple_mob/slime/target, target_zone, obj/item/tool)
var/datum/gender/T = gender_datums[user.get_visible_gender()]
user.visible_message("<span class='danger'>[user]'s hand slips, causing [T.him] to miss the core!</span>", \
"<span class='danger'>Your hand slips, causing you to miss the core!</span>")
"<span class='danger'>Your hand slips, causing you to miss the core!</span>")
+24 -5
View File
@@ -27,7 +27,10 @@
// How much blood this step can get on surgeon. 1 - hands, 2 - full body.
var/blood_level = 0
// What the surgery will be called in the rare event of multiple surgery steps being shown to the user.
var/surgery_name
var/surgery_name = "CONTACT A DEVELOPER TO NAME THIS STEP."
// If the surgery stops you from being able to perform another surgery.
var/list/excludes_steps = list()
//returns how well tool is suited for this step
/datum/surgery_step/proc/tool_quality(obj/item/tool)
@@ -136,13 +139,14 @@
if(!istype(M))
return 0
if (user.a_intent == I_HURT) //check for Hippocratic Oath
//Insert intentional hurt medical code here.
return 0
var/zone = user.zone_sel.selecting
if(zone in M.op_stage.in_progress) //Can't operate on someone repeatedly.
to_chat(user, "<span class='warning'>You can't operate on this area while surgery is already in progress.</span>")
return 1
var/list/available_surgeries = list()
var/list/datum/surgery_step/available_surgeries = list()
for(var/datum/surgery_step/S in surgery_steps)
//check if tool is right or close enough and if this step is possible
if(S.tool_quality(src))
@@ -150,26 +154,41 @@
if(step_is_valid && S.is_valid_target(M))
if(step_is_valid == SURGERY_FAILURE)
continue
available_surgeries += S //Add the surgery to a list of 'We can perform this step'
available_surgeries[S.surgery_name] = S //Adds the surgery name to the list and sets it equal to S. (Ex: "Cauterize" = surgery_step/cauterize)
continue
if(!available_surgeries.len) //No available surgeries. Failure.
return 0
// Having trouble with an ASSOSCIATED LIST? or REMOVING SOMETHING FROM AN ASSOCIATED LIST? Look here for a quick guide, developed out of frustration.
// Note: This is an ultra edge case. Like, what is being done here is horrible and is so rare this should never happen again in the code.
// This block of code caused hours of suffering.
for(var/surgical_check_name in available_surgeries) // Get the name from available_surgeries. available_surgeries = list("NAME" = DATUM)
var/datum/surgery_step/surgical_check = available_surgeries[surgical_check_name] // We then get the datum.
if(isnull(surgical_check)) // This is here so it doesn't try to keep searching if the thing we're about to check has been deleted.
continue
if(surgical_check.excludes_steps.len) // We check for it's 'excluded_steps' list and see if it has anything in it.
for(var/removal_candidate_name in available_surgeries) // We then look in available_surgeries once again, grabbing the name.
var/datum/surgery_step/removal_candidate = available_surgeries[removal_candidate_name] // We then get the datum while searching.
if(is_path_in_list(removal_candidate.type, surgical_check.excludes_steps)) // We then check the datum and see if it's a path in the list that we want to remove.
available_surgeries -= removal_candidate_name // We then, finally, remove the surgery step.
// All of this just to make it so you are forced to do bloodless surgery with a laser scalpel.
if(M == user) // Once we determine if we can actually do a step at all, give a slight delay to self-surgery to confirm attempts.
to_chat(user, "<span class='critical'>You focus on attempting to perform surgery upon yourself.</span>")
if(!do_after(user, 3 SECONDS, M))
return 0
var/datum/surgery_step/selected_surgery
if(available_surgeries.len > 1) //More than one possible? Ask them which one.
selected_surgery = tgui_input_list(user, "Select which surgery step you wish to perform", "Surgery Select", available_surgeries)
selected_surgery = tgui_input_list(user, "Select which surgery step you wish to perform", "Surgery Select", available_surgeries) //Shows the name in the list.
else
selected_surgery = pick(available_surgeries)
if(isnull(selected_surgery)) //They clicked 'cancel'
return 1
selected_surgery = available_surgeries[selected_surgery] //Sets the name they selected to be the datum.
M.op_stage.in_progress += zone
selected_surgery.begin_step(user, M, zone, src) //start on it