From 8116f28aab3d03af0a0751b9bd76b0eb6b787ef7 Mon Sep 17 00:00:00 2001 From: Len Kagamine Date: Mon, 26 Feb 2024 20:58:13 -0500 Subject: [PATCH 01/35] Working Prototype YIP --- code/__HELPERS/global_lists.dm | 5 + code/_globalvars/lists/objects.dm | 1 + .../surgery/omnisurgery/bone_repair.dm | 22 +++ .../surgery/omnisurgery/omni_healing.dm | 131 ++++++++++++++++++ .../surgery/omnisurgery/omni_movelayer.dm | 25 ++++ .../surgery/omnisurgery/omnisurgery.dm | 66 +++++++++ .../surgery/omnisurgery/omnisurgery_step.dm | 95 +++++++++++++ shiptest.dme | 5 + 8 files changed, 350 insertions(+) create mode 100644 code/modules/surgery/omnisurgery/bone_repair.dm create mode 100644 code/modules/surgery/omnisurgery/omni_healing.dm create mode 100644 code/modules/surgery/omnisurgery/omni_movelayer.dm create mode 100644 code/modules/surgery/omnisurgery/omnisurgery.dm create mode 100644 code/modules/surgery/omnisurgery/omnisurgery_step.dm diff --git a/code/__HELPERS/global_lists.dm b/code/__HELPERS/global_lists.dm index e44755574eea..212e9f11b789 100644 --- a/code/__HELPERS/global_lists.dm +++ b/code/__HELPERS/global_lists.dm @@ -65,6 +65,11 @@ GLOB.surgeries_list += new path() sortList(GLOB.surgeries_list, /proc/cmp_typepaths_asc) + //Omni-surgery steps + for(var/path in subtypesof(/datum/surgery_step/omni)) + GLOB.omnisurgerysteps_list += new path() + sortList(GLOB.omnisurgerysteps_list, /proc/cmp_typepaths_asc) + // Hair Gradients - Initialise all /datum/sprite_accessory/hair_gradient into an list indexed by gradient-style name for(var/path in subtypesof(/datum/sprite_accessory/hair_gradient)) var/datum/sprite_accessory/hair_gradient/H = new path() diff --git a/code/_globalvars/lists/objects.dm b/code/_globalvars/lists/objects.dm index ac54c7a39b33..08065940458f 100644 --- a/code/_globalvars/lists/objects.dm +++ b/code/_globalvars/lists/objects.dm @@ -18,6 +18,7 @@ GLOBAL_LIST(chemical_reagents_list) //list of all /datum/reagent datums index GLOBAL_LIST_EMPTY(materials_list) //list of all /datum/material datums indexed by material id. GLOBAL_LIST_EMPTY(tech_list) //list of all /datum/tech datums indexed by id. GLOBAL_LIST_EMPTY(surgeries_list) //list of all surgeries by name, associated with their path. +GLOBAL_LIST_EMPTY(omnisurgerysteps_list) //List of all Omni-Surgery steps, associated with their path. GLOBAL_LIST_EMPTY(crafting_recipes) //list of all table craft recipes GLOBAL_LIST_EMPTY(rcd_list) //list of Rapid Construction Devices. GLOBAL_LIST_EMPTY(apcs_list) //list of all Area Power Controller machines, separate from machines for powernet speeeeeeed. diff --git a/code/modules/surgery/omnisurgery/bone_repair.dm b/code/modules/surgery/omnisurgery/bone_repair.dm new file mode 100644 index 000000000000..34a74784a1e3 --- /dev/null +++ b/code/modules/surgery/omnisurgery/bone_repair.dm @@ -0,0 +1,22 @@ +/datum/surgery_step/omni/set_bone + name = "set bone" + time = 6.4 SECONDS + implements = list( + TOOL_HEMOSTAT = 100, + TOOL_WRENCH = 40) + show = TRUE + preop_sound = 'sound/surgery/bone1.ogg' + success_sound = 'sound/surgery/bone3.ogg' + required_layer = 2 + priority = 15 + +/datum/surgery_step/omni/set_bone/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) + if(target_zone == BODY_ZONE_HEAD) + user.visible_message("[user] begins to set [target]'s skull with [tool]...", "You begin to set [target]'s skull with [tool]...") + else + user.visible_message("[user] begins to set the bones in [target]'s [parse_zone(target_zone)] with [tool]...", "You begin setting the bones in [target]'s [parse_zone(target_zone)] with [tool]...") + +/datum/surgery_step/omni/set_bone/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) + user.visible_message("[user] successfully sets the bones in [target]'s [parse_zone(target_zone)]!", "You successfully set the bones in [target]'s [parse_zone(target_zone)].") + surgery.operated_bodypart.fix_bone() + return TRUE diff --git a/code/modules/surgery/omnisurgery/omni_healing.dm b/code/modules/surgery/omnisurgery/omni_healing.dm new file mode 100644 index 000000000000..5e592ced5522 --- /dev/null +++ b/code/modules/surgery/omnisurgery/omni_healing.dm @@ -0,0 +1,131 @@ +#define PER_ITERATION_XP_CAP MEDICAL_SKILL_MEDIUM //TW XP gain scales with repeated iterations so we cap it. +/datum/surgery_step/omni/heal + name = "repair body" + implements = list( + TOOL_HEMOSTAT = 100, + TOOL_SCREWDRIVER = 40)//something else could be added here - but I would prefer not. Hemostat is not that hard to come by and SHOULD be standard for ship equipment. + repeatable = TRUE + time = 2.5 SECONDS + success_sound = 'sound/surgery/retractor2.ogg' + failure_sound = 'sound/surgery/organ2.ogg' + var/brutehealing = 0 + var/burnhealing = 0 + var/missinghpbonus = 0 //heals an extra point of damager per X missing damage of type (burn damage for burn healing, brute for brute). Smaller Number = More Healing! + + show = TRUE + required_layer = 1 + + +/datum/surgery_step/omni/heal/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) + var/woundtype + if(brutehealing && burnhealing) + woundtype = "wounds" + else if(brutehealing) + woundtype = "bruises" + else //why are you trying to 0,0...? + woundtype = "burns" + if(istype(surgery,/datum/surgery/healing)) + var/datum/surgery/healing/the_surgery = surgery + if(!the_surgery.antispam) + display_results(user, target, "You attempt to patch some of [target]'s [woundtype].", + "[user] attempts to patch some of [target]'s [woundtype].", + "[user] attempts to patch some of [target]'s [woundtype].") + +/datum/surgery_step/omni/heal/initiate(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery, try_to_fail = FALSE) + if(!..()) + return + while((brutehealing && target.getBruteLoss()) || (burnhealing && target.getFireLoss())) + if(!..()) + break + +/datum/surgery_step/omni/heal/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery, default_display_results = FALSE) + var/umsg = "You succeed in fixing some of [target]'s wounds" //no period, add initial space to "addons" + var/tmsg = "[user] fixes some of [target]'s wounds" //see above + var/urhealedamt_brute = brutehealing + var/urhealedamt_burn = burnhealing + if(missinghpbonus) + if(target.stat != DEAD) + urhealedamt_brute += brutehealing ? round((target.getBruteLoss()/ missinghpbonus),0.1) : 0 + urhealedamt_burn += burnhealing ? round((target.getFireLoss()/ missinghpbonus),0.1) : 0 + else //less healing bonus for the dead since they're expected to have lots of damage to begin with (to make TW into defib not TOO simple) + urhealedamt_brute += brutehealing ? round((target.getBruteLoss()/ (missinghpbonus*5)),0.1) : 0 + urhealedamt_burn += burnhealing ? round((target.getFireLoss()/ (missinghpbonus*5)),0.1) : 0 + if(!get_location_accessible(target, target_zone)) + urhealedamt_brute *= 0.55 + urhealedamt_burn *= 0.55 + umsg += " as best as you can while they have clothing on" + tmsg += " as best as they can while [target] has clothing on" + experience_given = CEILING((target.heal_bodypart_damage(urhealedamt_brute,urhealedamt_burn)/5),1) + display_results(user, target, "[umsg].", + "[tmsg].", + "[tmsg].") + if(istype(surgery, /datum/surgery/healing)) + var/datum/surgery/healing/the_surgery = surgery + the_surgery.antispam = TRUE + return ..() + +/datum/surgery_step/omni/heal/failure(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) + display_results(user, target, "You screwed up!", + "[user] screws up!", + "[user] fixes some of [target]'s wounds.", TRUE) + var/urdamageamt_burn = brutehealing * 0.8 + var/urdamageamt_brute = burnhealing * 0.8 + if(missinghpbonus) + urdamageamt_brute += round((target.getBruteLoss()/ (missinghpbonus*2)),0.1) + urdamageamt_burn += round((target.getFireLoss()/ (missinghpbonus*2)),0.1) + + target.take_bodypart_damage(urdamageamt_brute, urdamageamt_burn) + return FALSE +/********************BRUTE STEPS********************/ +/* +/datum/surgery_step/omni/heal/brute/basic + name = "tend bruises" + brutehealing = 5 + missinghpbonus = 15 +/datum/surgery_step/omni/heal/brute/upgraded + brutehealing = 5 + missinghpbonus = 10 + +/datum/surgery_step/omni/heal/brute/upgraded/femto + brutehealing = 5 + missinghpbonus = 5 +*/ +/********************BURN STEPS********************/ +/* +/datum/surgery_step/omni/heal/burn/basic + name = "tend burn wounds" + burnhealing = 5 + missinghpbonus = 15 +/datum/surgery_step/omni/heal/burn/upgraded + burnhealing = 5 + missinghpbonus = 10 + +/datum/surgery_step/omni/heal/burn/upgraded/femto + burnhealing = 5 + missinghpbonus = 5 +*/ +/********************COMBO STEPS********************/ +/datum/surgery_step/omni/heal/combo + name = "tend physical wounds" + brutehealing = 3 + burnhealing = 3 + missinghpbonus = 15 + time = 10 +/* +/datum/surgery_step/omni/heal/combo/upgraded + brutehealing = 3 + burnhealing = 3 + missinghpbonus = 10 + +/datum/surgery_step/omni/heal/combo/upgraded/femto + brutehealing = 1 + burnhealing = 1 + missinghpbonus = 2.5 + +/datum/surgery_step/omni/heal/combo/upgraded/femto/failure(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) + display_results(user, target, "You screwed up!", + "[user] screws up!", + "[user] fixes some of [target]'s wounds.", TRUE) + target.take_bodypart_damage(5,5) +*/ +#undef PER_ITERATION_XP_CAP diff --git a/code/modules/surgery/omnisurgery/omni_movelayer.dm b/code/modules/surgery/omnisurgery/omni_movelayer.dm new file mode 100644 index 000000000000..01360392d999 --- /dev/null +++ b/code/modules/surgery/omnisurgery/omni_movelayer.dm @@ -0,0 +1,25 @@ +/datum/surgery_step/omni/skindown + name = "Dermal Incision" + implements = list( + TOOL_SCALPEL = 100) + time = 2.5 SECONDS + priority = 99 + show = TRUE + required_layer = 0 + +/datum/surgery_step/omni/skindown/success(mob/user, mob/living/target, target_zone, obj/item/tool, datum/surgery/omni/surgery, default_display_results) + surgery.atlayer++ + return ..() + +/datum/surgery_step/omni/muscledown + name = "Retract Muscle" + implements = list( + TOOL_RETRACTOR = 100) + time = 2.5 SECONDS + priority = 99 + show = TRUE + required_layer = 1 + +/datum/surgery_step/omni/muscledown/success(mob/user, mob/living/target, target_zone, obj/item/tool, datum/surgery/omni/surgery, default_display_results) + surgery.atlayer++ + return ..() diff --git a/code/modules/surgery/omnisurgery/omnisurgery.dm b/code/modules/surgery/omnisurgery/omnisurgery.dm new file mode 100644 index 000000000000..c2e7842c6a3f --- /dev/null +++ b/code/modules/surgery/omnisurgery/omnisurgery.dm @@ -0,0 +1,66 @@ +/datum/surgery/omni + name = "omni-surgery" + desc = "allows multiple surgeries on one part based on tissue layers" + status = 1 + steps = list() //We ballin + target_mobtypes = list(/mob/living/carbon/human) //Acceptable Species + possible_locs = list(BODY_ZONE_CHEST,BODY_ZONE_HEAD,BODY_ZONE_L_ARM,BODY_ZONE_L_LEG,BODY_ZONE_R_ARM,BODY_ZONE_R_LEG) + speed_modifier = 1 //Step speed modifier + var/atlayer = 0 // 0/1/2 -> skin/muscle/bone + +/datum/surgery/omni/next_step(mob/user, intent) + if(location != user.zone_selected) + return FALSE + if(step_in_progress) + return TRUE + + var/try_to_fail = FALSE + if(intent == INTENT_DISARM) + try_to_fail = TRUE + var/obj/item/tool = user.get_active_held_item() + var/datum/surgery_step/omni/S = get_surgery_step(tool) + if(S) + if(S.try_op(user, target, user.zone_selected, tool, src, try_to_fail)) + return TRUE + if(tool && tool.item_flags & SURGICAL_TOOL) //Just because you used the wrong tool it doesn't mean you meant to whack the patient with it + var/required_tool_type = TOOL_CAUTERY + if(requires_bodypart_type == BODYTYPE_ROBOTIC) + required_tool_type = TOOL_SCREWDRIVER + + if(tool.tool_behaviour == required_tool_type) + // Cancel the surgery if a cautery is used AND it's not the tool used in the next step. + attempt_cancel_surgery(src, tool, target, user) + return TRUE + to_chat(user, "This step requires a different tool!") + return TRUE + else if(tool && tool.item_flags & SURGICAL_TOOL) + var/required_tool_type = TOOL_CAUTERY + if(requires_bodypart_type == BODYTYPE_ROBOTIC) + required_tool_type = TOOL_SCREWDRIVER + if(tool.tool_behaviour == required_tool_type) + attempt_cancel_surgery(src, tool, target, user) + return TRUE + return FALSE + +/datum/surgery/omni/get_surgery_step(obj/item/tool) + var/list/all_steps = GLOB.omnisurgerysteps_list.Copy() + var/datum/surgery_step/omni/beststep = null + for(var/datum/surgery_step/omni/S in all_steps) + if(!S.show) + continue + if(!S.valid_locations.Find(location)) + continue + if(S.required_layer != atlayer) + continue + if(!(S.accept_any_item || S.accept_hand) && !S.implements.Find(tool.tool_behaviour)) + continue + if(beststep == null) + beststep = S + else + if(beststep.priority > S.priority) + beststep = S + if(beststep) + return new beststep.type + return null +/datum/surgery/omni/get_surgery_next_step() + return null diff --git a/code/modules/surgery/omnisurgery/omnisurgery_step.dm b/code/modules/surgery/omnisurgery/omnisurgery_step.dm new file mode 100644 index 000000000000..2f1b218a64dd --- /dev/null +++ b/code/modules/surgery/omnisurgery/omnisurgery_step.dm @@ -0,0 +1,95 @@ +/datum/surgery_step/omni + var/required_layer = 0 //What layer is needed to do this step. + var/priority = 10 //low priority -> executed before others + var/list/valid_locations = list(BODY_ZONE_CHEST,BODY_ZONE_HEAD,BODY_ZONE_L_ARM,BODY_ZONE_L_LEG,BODY_ZONE_R_ARM,BODY_ZONE_R_LEG) //List of all places this step can be preformed + var/show = FALSE //if false, isn't considered a 'valid' step, and cant be preformed. Used for 'base' step + +/datum/surgery_step/omni/try_op(mob/user, mob/living/target, target_zone, obj/item/tool, datum/surgery/omni/surgery, try_to_fail = FALSE) + var/success = FALSE + if(surgery.atlayer != required_layer) + return FALSE + if(accept_hand) + if(!tool) + success = TRUE + if(iscyborg(user)) + success = TRUE + + if(accept_any_item) + if(tool && tool_check(user, tool)) + success = TRUE + + else if(tool) + for(var/key in implements) + var/match = FALSE + if(ispath(key) && istype(tool, key)) + match = TRUE + else if(tool.tool_behaviour == key) + match = TRUE + + if(match) + implement_type = key + if(tool_check(user, tool)) + success = TRUE + break + + if(success) + if(target_zone == surgery.location) + if(get_location_accessible(target, target_zone) || surgery.ignore_clothes) + initiate(user, target, target_zone, tool, surgery, try_to_fail) + else + to_chat(user, "You need to expose [target]'s [parse_zone(target_zone)] to perform surgery on it!") + return TRUE //returns TRUE so we don't stab the guy in the dick or wherever. + + if(repeatable) + if(try_op(user, target, user.zone_selected, user.get_active_held_item(), surgery)) + return TRUE + return FALSE + +/datum/surgery_step/omni/initiate(mob/user, mob/living/target, target_zone, obj/item/tool, datum/surgery/surgery, try_to_fail = FALSE) + surgery.step_in_progress = TRUE + var/speed_mod = 1 + var/fail_prob = 0//100 - fail_prob = success_prob + var/advance = FALSE + + if(preop(user, target, target_zone, tool, surgery) == -1) + surgery.step_in_progress = FALSE + return FALSE + play_preop_sound(user, target, target_zone, tool, surgery) + + if(tool) + speed_mod = tool.toolspeed + + var/implement_speed_mod = 1 + if(implement_type) //this means it isn't a require hand or any item step. + implement_speed_mod = implements[implement_type] / 100.0 + + speed_mod /= (get_location_modifier(target) * (1 + surgery.speed_modifier) * implement_speed_mod) + var/modded_time = time * speed_mod * user.mind.get_skill_modifier(/datum/skill/healing, SKILL_SPEED_MODIFIER) + + + fail_prob = min(max(0, modded_time - (time * 2)),99)//if modded_time > time * modifier, then fail_prob = modded_time - time*modifier. starts at 0, caps at 99 + modded_time = min(modded_time, time * 2)//also if that, then cap modded_time at time*modifier + + if(iscyborg(user))//any immunities to surgery slowdown should go in this check. + modded_time = time + + var/was_sleeping = (target.stat != DEAD && target.IsSleeping()) + + if(do_after(user, modded_time, target = target)) + + var/chem_check_result = chem_check(target) + if((prob(100-fail_prob) || (iscyborg(user) && !silicons_obey_prob)) && chem_check_result && !try_to_fail) + if(success(user, target, target_zone, tool, surgery)) + play_success_sound(user, target, target_zone, tool, surgery) + advance = TRUE + else + if(failure(user, target, target_zone, tool, surgery, fail_prob)) + play_failure_sound(user, target, target_zone, tool, surgery) + advance = TRUE + if(chem_check_result) + return .(user, target, target_zone, tool, surgery, try_to_fail) //automatically re-attempt if failed for reason other than lack of required chemical + if(target.stat == DEAD && was_sleeping && user.client) + user.client.give_award(/datum/award/achievement/misc/sandman, user) + + surgery.step_in_progress = FALSE + return advance diff --git a/shiptest.dme b/shiptest.dme index 939934ea7b06..1ed456843d1b 100644 --- a/shiptest.dme +++ b/shiptest.dme @@ -3366,6 +3366,11 @@ #include "code\modules\surgery\bodyparts\species_parts\plasmaman_bodyparts.dm" #include "code\modules\surgery\bodyparts\species_parts\rachnid_bodyparts.dm" #include "code\modules\surgery\bodyparts\species_parts\vox_bodyparts.dm" +#include "code\modules\surgery\omnisurgery\bone_repair.dm" +#include "code\modules\surgery\omnisurgery\omni_healing.dm" +#include "code\modules\surgery\omnisurgery\omni_movelayer.dm" +#include "code\modules\surgery\omnisurgery\omnisurgery.dm" +#include "code\modules\surgery\omnisurgery\omnisurgery_step.dm" #include "code\modules\surgery\organs\appendix.dm" #include "code\modules\surgery\organs\augments_arms.dm" #include "code\modules\surgery\organs\augments_chest.dm" From 2913d3ea420a075588fefce3aa9c102ecd9aa41a Mon Sep 17 00:00:00 2001 From: Len Kagamine Date: Mon, 26 Feb 2024 21:32:52 -0500 Subject: [PATCH 02/35] Oops Fixes minor logic error meaning a tool was not itself. --- code/modules/surgery/omnisurgery/omnisurgery.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/surgery/omnisurgery/omnisurgery.dm b/code/modules/surgery/omnisurgery/omnisurgery.dm index c2e7842c6a3f..64e4d78c519e 100644 --- a/code/modules/surgery/omnisurgery/omnisurgery.dm +++ b/code/modules/surgery/omnisurgery/omnisurgery.dm @@ -52,7 +52,7 @@ continue if(S.required_layer != atlayer) continue - if(!(S.accept_any_item || S.accept_hand) && !S.implements.Find(tool.tool_behaviour)) + if(!(S.accept_any_item || S.accept_hand) && (!S.implements.Find(tool.tool_behaviour) || !S.implements.Find(tool))) continue if(beststep == null) beststep = S From 3a87c06e3339dd36d6511efba6bc072cc25e97dc Mon Sep 17 00:00:00 2001 From: Len Kagamine Date: Mon, 26 Feb 2024 21:48:18 -0500 Subject: [PATCH 03/35] Fix inverted !s oops again --- code/modules/surgery/omnisurgery/omnisurgery.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/surgery/omnisurgery/omnisurgery.dm b/code/modules/surgery/omnisurgery/omnisurgery.dm index 64e4d78c519e..e5e0190bd9bb 100644 --- a/code/modules/surgery/omnisurgery/omnisurgery.dm +++ b/code/modules/surgery/omnisurgery/omnisurgery.dm @@ -52,7 +52,7 @@ continue if(S.required_layer != atlayer) continue - if(!(S.accept_any_item || S.accept_hand) && (!S.implements.Find(tool.tool_behaviour) || !S.implements.Find(tool))) + if(!(S.accept_any_item || S.accept_hand) && !(S.implements.Find(tool.tool_behaviour) || S.implements.Find(tool))) continue if(beststep == null) beststep = S From 16f58c2827150259cc741a9fb30deaac70adad9d Mon Sep 17 00:00:00 2001 From: Len Kagamine Date: Tue, 27 Feb 2024 17:37:56 -0500 Subject: [PATCH 04/35] Omni-MKII Now including selectors and auto-redo for repeatables! --- .../omnisurgery/omni_coronary_bypass.dm | 105 ++++++++++++++++++ .../surgery/omnisurgery/omnisurgery.dm | 41 +++++-- .../surgery/omnisurgery/omnisurgery_step.dm | 12 +- shiptest.dme | 1 + 4 files changed, 148 insertions(+), 11 deletions(-) create mode 100644 code/modules/surgery/omnisurgery/omni_coronary_bypass.dm diff --git a/code/modules/surgery/omnisurgery/omni_coronary_bypass.dm b/code/modules/surgery/omnisurgery/omni_coronary_bypass.dm new file mode 100644 index 000000000000..47b0d9ac3000 --- /dev/null +++ b/code/modules/surgery/omnisurgery/omni_coronary_bypass.dm @@ -0,0 +1,105 @@ +/datum/surgery/omni/coronary_bypass/can_start(mob/user, mob/living/carbon/target) + var/obj/item/organ/heart/H = target.getorganslot(ORGAN_SLOT_HEART) + if(H) + if(H.damage > 60 && !H.operated) + return TRUE + return FALSE + +//an incision but with greater bleed, and a 90% base success chance +/datum/surgery_step/omni/incise_heart + name = "incise heart" + implements = list( + TOOL_SCALPEL = 90, + /obj/item/kitchen/knife = 40, + /obj/item/shard = 33) + time = 1.6 SECONDS + preop_sound = 'sound/surgery/scalpel1.ogg' + success_sound = 'sound/surgery/scalpel2.ogg' + failure_sound = 'sound/surgery/organ2.ogg' + required_layer = 2 + priority = 3 + show = TRUE + valid_locations = list(BODY_ZONE_CHEST) + +/datum/surgery_step/omni/incise_heart/test_op(mob/user, mob/living/target, target_zone, obj/item/tool, datum/surgery/omni, try_to_fail) + var/obj/item/organ/heart/H = target.getorganslot(ORGAN_SLOT_HEART) + if(H) + if(H.damage > 60 && !H.operated) + return TRUE + return FALSE + +/datum/surgery_step/omni/incise_heart/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) + display_results(user, target, "You begin to make an incision in [target]'s heart...", + "[user] begins to make an incision in [target]'s heart.", + "[user] begins to make an incision in [target]'s heart.") + +/datum/surgery_step/omni/incise_heart/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery, default_display_results = FALSE) + if(ishuman(target)) + var/mob/living/carbon/human/H = target + if (!(NOBLOOD in H.dna.species.species_traits)) + display_results(user, target, "Blood pools around the incision in [H]'s heart.", + "Blood pools around the incision in [H]'s heart.", + "") + H.bleed_rate += 10 + target.apply_damage(15, BRUTE, "[target_zone]") + return ..() + +/datum/surgery_step/omni/incise_heart/failure(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) + if(ishuman(target)) + var/mob/living/carbon/human/H = target + display_results(user, target, "You screw up, cutting too deeply into the heart!", + "[user] screws up, causing blood to spurt out of [H]'s chest!", + "[user] screws up, causing blood to spurt out of [H]'s chest!") + H.bleed_rate += 20 + H.adjustOrganLoss(ORGAN_SLOT_HEART, 10) + target.apply_damage(15, BRUTE, "[target_zone]") + +//grafts a coronary bypass onto the individual's heart, success chance is 90% base again +/datum/surgery_step/omni/coronary_bypass + name = "graft coronary bypass" + implements = list( + TOOL_HEMOSTAT = 90, + TOOL_WIRECUTTER = 40, + /obj/item/stack/cable_coil = 5) + time = 9 SECONDS + preop_sound = 'sound/surgery/hemostat1.ogg' + success_sound = 'sound/surgery/hemostat1.ogg' + failure_sound = 'sound/surgery/organ2.ogg' + experience_given = MEDICAL_SKILL_ORGAN_FIX + required_layer = 2 + priority = 0 + show = TRUE + valid_locations = list(BODY_ZONE_CHEST) + +/datum/surgery_step/omni/coronary_bypass/test_op(mob/user, mob/living/target, target_zone, obj/item/tool, datum/surgery/omni, try_to_fail) + var/obj/item/organ/heart/H = target.getorganslot(ORGAN_SLOT_HEART) + if(H) + if(H.damage > 60 && !H.operated) + return TRUE + return FALSE + + +/datum/surgery_step/omni/coronary_bypass/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) + display_results(user, target, "You begin to graft a bypass onto [target]'s heart...", + "[user] begins to graft something onto [target]'s heart!", + "[user] begins to graft something onto [target]'s heart!") + +/datum/surgery_step/omni/coronary_bypass/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery, default_display_results = FALSE) + target.setOrganLoss(ORGAN_SLOT_HEART, 60) + var/obj/item/organ/heart/heart = target.getorganslot(ORGAN_SLOT_HEART) + if(heart) //slightly worrying if we lost our heart mid-operation, but that's life + heart.operated = TRUE + display_results(user, target, "You successfully graft a bypass onto [target]'s heart.", + "[user] finishes grafting something onto [target]'s heart.", + "[user] finishes grafting something onto [target]'s heart.") + return ..() + +/datum/surgery_step/omni/coronary_bypass/failure(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) + if(ishuman(target)) + var/mob/living/carbon/human/H = target + display_results(user, target, "You screw up in attaching the graft, and it tears off, tearing part of the heart!", + "[user] screws up, causing blood to spurt out of [H]'s chest profusely!", + "[user] screws up, causing blood to spurt out of [H]'s chest profusely!") + H.adjustOrganLoss(ORGAN_SLOT_HEART, 30) + H.bleed_rate += 30 + return FALSE diff --git a/code/modules/surgery/omnisurgery/omnisurgery.dm b/code/modules/surgery/omnisurgery/omnisurgery.dm index e5e0190bd9bb..d4d6bd4dfdc0 100644 --- a/code/modules/surgery/omnisurgery/omnisurgery.dm +++ b/code/modules/surgery/omnisurgery/omnisurgery.dm @@ -1,5 +1,5 @@ /datum/surgery/omni - name = "omni-surgery" + name = "Omni-surgery" desc = "allows multiple surgeries on one part based on tissue layers" status = 1 steps = list() //We ballin @@ -7,6 +7,7 @@ possible_locs = list(BODY_ZONE_CHEST,BODY_ZONE_HEAD,BODY_ZONE_L_ARM,BODY_ZONE_L_LEG,BODY_ZONE_R_ARM,BODY_ZONE_R_LEG) speed_modifier = 1 //Step speed modifier var/atlayer = 0 // 0/1/2 -> skin/muscle/bone + var/datum/surgery_step/omni/last_step //The last step preformed /datum/surgery/omni/next_step(mob/user, intent) if(location != user.zone_selected) @@ -18,9 +19,28 @@ if(intent == INTENT_DISARM) try_to_fail = TRUE var/obj/item/tool = user.get_active_held_item() - var/datum/surgery_step/omni/S = get_surgery_step(tool) - if(S) + var/list/L = get_surgery_step(tool,user,target) + if(L) + var/datum/surgery_step/omni/S = null + if(L.len == 1) + var/datum/surgery_step/omni/val = L[1] + S = new val.type + else/* + if(last_step.repeatable && locate(last_step.type) in L) + S = new last_step.type + else + */ + var/P = input("Begin which procedure?", "Surgery", null, null) as null|anything in sortList(L) + if(P && user && user.Adjacent(target) && (tool in user)) + var/datum/surgery_step/omni/T = locate(P) in L // Why tf does L[P] not work here. + for(var/datum/surgery/other in target.surgeries) + if(other == src) + continue + if(other.location == user.zone_selected) + return FALSE + S = new T.type if(S.try_op(user, target, user.zone_selected, tool, src, try_to_fail)) + last_step = S return TRUE if(tool && tool.item_flags & SURGICAL_TOOL) //Just because you used the wrong tool it doesn't mean you meant to whack the patient with it var/required_tool_type = TOOL_CAUTERY @@ -31,7 +51,7 @@ // Cancel the surgery if a cautery is used AND it's not the tool used in the next step. attempt_cancel_surgery(src, tool, target, user) return TRUE - to_chat(user, "This step requires a different tool!") + to_chat(user, "Somethings wrong, I can feel it!") return TRUE else if(tool && tool.item_flags & SURGICAL_TOOL) var/required_tool_type = TOOL_CAUTERY @@ -42,8 +62,9 @@ return TRUE return FALSE -/datum/surgery/omni/get_surgery_step(obj/item/tool) +/datum/surgery/omni/get_surgery_step(obj/item/tool,mob/user,mob/living/target) var/list/all_steps = GLOB.omnisurgerysteps_list.Copy() + var/list/valid_steps = list() var/datum/surgery_step/omni/beststep = null for(var/datum/surgery_step/omni/S in all_steps) if(!S.show) @@ -54,13 +75,19 @@ continue if(!(S.accept_any_item || S.accept_hand) && !(S.implements.Find(tool.tool_behaviour) || S.implements.Find(tool))) continue + if(!S.test_op(user,target)) + continue if(beststep == null) beststep = S + valid_steps += list(S) else if(beststep.priority > S.priority) beststep = S - if(beststep) - return new beststep.type + valid_steps += list(S) + if(beststep && valid_steps.len == 1) + return list(beststep) + else if (valid_steps.len > 1) + return valid_steps return null /datum/surgery/omni/get_surgery_next_step() return null diff --git a/code/modules/surgery/omnisurgery/omnisurgery_step.dm b/code/modules/surgery/omnisurgery/omnisurgery_step.dm index 2f1b218a64dd..3898de07a0ad 100644 --- a/code/modules/surgery/omnisurgery/omnisurgery_step.dm +++ b/code/modules/surgery/omnisurgery/omnisurgery_step.dm @@ -4,6 +4,12 @@ var/list/valid_locations = list(BODY_ZONE_CHEST,BODY_ZONE_HEAD,BODY_ZONE_L_ARM,BODY_ZONE_L_LEG,BODY_ZONE_R_ARM,BODY_ZONE_R_LEG) //List of all places this step can be preformed var/show = FALSE //if false, isn't considered a 'valid' step, and cant be preformed. Used for 'base' step + //For any additional logic needing done before we say this step is 'valid' Why not try_op? Couple reasons. + // One: We already are testing half of try_op before calling test_op + // Two: We only want if the surgery is a valid step that can be taken, we don't necissarily want to initiate it. +/datum/surgery_step/omni/proc/test_op(mob/user,mob/living/target) + return TRUE + /datum/surgery_step/omni/try_op(mob/user, mob/living/target, target_zone, obj/item/tool, datum/surgery/omni/surgery, try_to_fail = FALSE) var/success = FALSE if(surgery.atlayer != required_layer) @@ -39,10 +45,6 @@ else to_chat(user, "You need to expose [target]'s [parse_zone(target_zone)] to perform surgery on it!") return TRUE //returns TRUE so we don't stab the guy in the dick or wherever. - - if(repeatable) - if(try_op(user, target, user.zone_selected, user.get_active_held_item(), surgery)) - return TRUE return FALSE /datum/surgery_step/omni/initiate(mob/user, mob/living/target, target_zone, obj/item/tool, datum/surgery/surgery, try_to_fail = FALSE) @@ -82,6 +84,8 @@ if(success(user, target, target_zone, tool, surgery)) play_success_sound(user, target, target_zone, tool, surgery) advance = TRUE + if(repeatable) + return .(user, target, target_zone, tool, surgery, try_to_fail) else if(failure(user, target, target_zone, tool, surgery, fail_prob)) play_failure_sound(user, target, target_zone, tool, surgery) diff --git a/shiptest.dme b/shiptest.dme index 1ed456843d1b..11085586491d 100644 --- a/shiptest.dme +++ b/shiptest.dme @@ -3367,6 +3367,7 @@ #include "code\modules\surgery\bodyparts\species_parts\rachnid_bodyparts.dm" #include "code\modules\surgery\bodyparts\species_parts\vox_bodyparts.dm" #include "code\modules\surgery\omnisurgery\bone_repair.dm" +#include "code\modules\surgery\omnisurgery\omni_coronary_bypass.dm" #include "code\modules\surgery\omnisurgery\omni_healing.dm" #include "code\modules\surgery\omnisurgery\omni_movelayer.dm" #include "code\modules\surgery\omnisurgery\omnisurgery.dm" From 20948b34028232660813ba7cf33908407d222204 Mon Sep 17 00:00:00 2001 From: Len Kagamine Date: Tue, 27 Feb 2024 17:44:26 -0500 Subject: [PATCH 05/35] Minor Cleanup Whoops forgot to remove bad code. --- code/modules/surgery/omnisurgery/omnisurgery.dm | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/code/modules/surgery/omnisurgery/omnisurgery.dm b/code/modules/surgery/omnisurgery/omnisurgery.dm index d4d6bd4dfdc0..a099bc13ded5 100644 --- a/code/modules/surgery/omnisurgery/omnisurgery.dm +++ b/code/modules/surgery/omnisurgery/omnisurgery.dm @@ -7,7 +7,6 @@ possible_locs = list(BODY_ZONE_CHEST,BODY_ZONE_HEAD,BODY_ZONE_L_ARM,BODY_ZONE_L_LEG,BODY_ZONE_R_ARM,BODY_ZONE_R_LEG) speed_modifier = 1 //Step speed modifier var/atlayer = 0 // 0/1/2 -> skin/muscle/bone - var/datum/surgery_step/omni/last_step //The last step preformed /datum/surgery/omni/next_step(mob/user, intent) if(location != user.zone_selected) @@ -25,11 +24,7 @@ if(L.len == 1) var/datum/surgery_step/omni/val = L[1] S = new val.type - else/* - if(last_step.repeatable && locate(last_step.type) in L) - S = new last_step.type - else - */ + else var/P = input("Begin which procedure?", "Surgery", null, null) as null|anything in sortList(L) if(P && user && user.Adjacent(target) && (tool in user)) var/datum/surgery_step/omni/T = locate(P) in L // Why tf does L[P] not work here. @@ -40,7 +35,6 @@ return FALSE S = new T.type if(S.try_op(user, target, user.zone_selected, tool, src, try_to_fail)) - last_step = S return TRUE if(tool && tool.item_flags & SURGICAL_TOOL) //Just because you used the wrong tool it doesn't mean you meant to whack the patient with it var/required_tool_type = TOOL_CAUTERY From 3f6d85541eaed5249e5b8f944e60d2b4f39c0ee7 Mon Sep 17 00:00:00 2001 From: Len Kagamine Date: Tue, 27 Feb 2024 19:45:40 -0500 Subject: [PATCH 06/35] I hate this Nuke priority, layer now a list, way to complete surgery --- .../surgery/omnisurgery/bone_repair.dm | 3 +- .../omnisurgery/omni_coronary_bypass.dm | 15 ++++--- .../surgery/omnisurgery/omni_healing.dm | 3 +- .../surgery/omnisurgery/omni_movelayer.dm | 38 +++++++++++++++-- .../surgery/omnisurgery/omnisurgery.dm | 41 ++++++------------- .../surgery/omnisurgery/omnisurgery_step.dm | 8 +--- 6 files changed, 57 insertions(+), 51 deletions(-) diff --git a/code/modules/surgery/omnisurgery/bone_repair.dm b/code/modules/surgery/omnisurgery/bone_repair.dm index 34a74784a1e3..fdc6abc11dd4 100644 --- a/code/modules/surgery/omnisurgery/bone_repair.dm +++ b/code/modules/surgery/omnisurgery/bone_repair.dm @@ -7,8 +7,7 @@ show = TRUE preop_sound = 'sound/surgery/bone1.ogg' success_sound = 'sound/surgery/bone3.ogg' - required_layer = 2 - priority = 15 + required_layer = list(2) /datum/surgery_step/omni/set_bone/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) if(target_zone == BODY_ZONE_HEAD) diff --git a/code/modules/surgery/omnisurgery/omni_coronary_bypass.dm b/code/modules/surgery/omnisurgery/omni_coronary_bypass.dm index 47b0d9ac3000..8040a376abd3 100644 --- a/code/modules/surgery/omnisurgery/omni_coronary_bypass.dm +++ b/code/modules/surgery/omnisurgery/omni_coronary_bypass.dm @@ -16,12 +16,11 @@ preop_sound = 'sound/surgery/scalpel1.ogg' success_sound = 'sound/surgery/scalpel2.ogg' failure_sound = 'sound/surgery/organ2.ogg' - required_layer = 2 - priority = 3 + required_layer = list(2) show = TRUE valid_locations = list(BODY_ZONE_CHEST) -/datum/surgery_step/omni/incise_heart/test_op(mob/user, mob/living/target, target_zone, obj/item/tool, datum/surgery/omni, try_to_fail) +/datum/surgery_step/omni/incise_heart/test_op(mob/user, mob/living/target,datum/surgery/omni/surgery) var/obj/item/organ/heart/H = target.getorganslot(ORGAN_SLOT_HEART) if(H) if(H.damage > 60 && !H.operated) @@ -66,28 +65,28 @@ success_sound = 'sound/surgery/hemostat1.ogg' failure_sound = 'sound/surgery/organ2.ogg' experience_given = MEDICAL_SKILL_ORGAN_FIX - required_layer = 2 - priority = 0 + required_layer = list(2) show = TRUE valid_locations = list(BODY_ZONE_CHEST) -/datum/surgery_step/omni/coronary_bypass/test_op(mob/user, mob/living/target, target_zone, obj/item/tool, datum/surgery/omni, try_to_fail) +/datum/surgery_step/omni/coronary_bypass/test_op(mob/user, mob/living/target,datum/surgery/omni/surgery) var/obj/item/organ/heart/H = target.getorganslot(ORGAN_SLOT_HEART) + if(!istype(surgery.last_step,/datum/surgery_step/omni/incise_heart)) + return FALSE if(H) if(H.damage > 60 && !H.operated) return TRUE return FALSE - /datum/surgery_step/omni/coronary_bypass/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) display_results(user, target, "You begin to graft a bypass onto [target]'s heart...", "[user] begins to graft something onto [target]'s heart!", "[user] begins to graft something onto [target]'s heart!") /datum/surgery_step/omni/coronary_bypass/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery, default_display_results = FALSE) - target.setOrganLoss(ORGAN_SLOT_HEART, 60) var/obj/item/organ/heart/heart = target.getorganslot(ORGAN_SLOT_HEART) if(heart) //slightly worrying if we lost our heart mid-operation, but that's life + target.setOrganLoss(ORGAN_SLOT_HEART, 60) heart.operated = TRUE display_results(user, target, "You successfully graft a bypass onto [target]'s heart.", "[user] finishes grafting something onto [target]'s heart.", diff --git a/code/modules/surgery/omnisurgery/omni_healing.dm b/code/modules/surgery/omnisurgery/omni_healing.dm index 5e592ced5522..af9fbf6383d6 100644 --- a/code/modules/surgery/omnisurgery/omni_healing.dm +++ b/code/modules/surgery/omnisurgery/omni_healing.dm @@ -11,9 +11,8 @@ var/brutehealing = 0 var/burnhealing = 0 var/missinghpbonus = 0 //heals an extra point of damager per X missing damage of type (burn damage for burn healing, brute for brute). Smaller Number = More Healing! - show = TRUE - required_layer = 1 + required_layer = list(1) /datum/surgery_step/omni/heal/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) diff --git a/code/modules/surgery/omnisurgery/omni_movelayer.dm b/code/modules/surgery/omnisurgery/omni_movelayer.dm index 01360392d999..6a12dfda099c 100644 --- a/code/modules/surgery/omnisurgery/omni_movelayer.dm +++ b/code/modules/surgery/omnisurgery/omni_movelayer.dm @@ -3,9 +3,8 @@ implements = list( TOOL_SCALPEL = 100) time = 2.5 SECONDS - priority = 99 show = TRUE - required_layer = 0 + required_layer = list(0) /datum/surgery_step/omni/skindown/success(mob/user, mob/living/target, target_zone, obj/item/tool, datum/surgery/omni/surgery, default_display_results) surgery.atlayer++ @@ -16,10 +15,41 @@ implements = list( TOOL_RETRACTOR = 100) time = 2.5 SECONDS - priority = 99 show = TRUE - required_layer = 1 + required_layer = list(1) /datum/surgery_step/omni/muscledown/success(mob/user, mob/living/target, target_zone, obj/item/tool, datum/surgery/omni/surgery, default_display_results) surgery.atlayer++ return ..() + +/datum/surgery_step/omni/close + name = "Finish Surgery" + implements = list( + TOOL_CAUTERY = 100, + TOOL_WELDER = 40, + /obj/item/gun/energy/laser = 60, + /obj/item = 30) // 30% success with any hot item. //this is fine, and decently reasonable + time = 2.4 SECONDS + preop_sound = 'sound/surgery/cautery1.ogg' + success_sound = 'sound/surgery/cautery2.ogg' + show = TRUE + required_layer = list(0,1,2) + + +/datum/surgery_step/omni/close/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) + display_results(user, target, "You begin to mend the incision in [target]'s [parse_zone(target_zone)]...", + "[user] begins to mend the incision in [target]'s [parse_zone(target_zone)].", + "[user] begins to mend the incision in [target]'s [parse_zone(target_zone)].") + +/datum/surgery_step/omni/close/tool_check(mob/user, obj/item/tool) + if(implement_type == TOOL_WELDER || implement_type == /obj/item) + return tool.get_temperature() + + return TRUE + +/datum/surgery_step/omni/close/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery, default_display_results) + if (ishuman(target)) + var/mob/living/carbon/human/H = target + H.bleed_rate = max((H.bleed_rate - 3), 0) + surgery.complete() + return ..() diff --git a/code/modules/surgery/omnisurgery/omnisurgery.dm b/code/modules/surgery/omnisurgery/omnisurgery.dm index a099bc13ded5..bf17c86ee3d6 100644 --- a/code/modules/surgery/omnisurgery/omnisurgery.dm +++ b/code/modules/surgery/omnisurgery/omnisurgery.dm @@ -6,7 +6,8 @@ target_mobtypes = list(/mob/living/carbon/human) //Acceptable Species possible_locs = list(BODY_ZONE_CHEST,BODY_ZONE_HEAD,BODY_ZONE_L_ARM,BODY_ZONE_L_LEG,BODY_ZONE_R_ARM,BODY_ZONE_R_LEG) speed_modifier = 1 //Step speed modifier - var/atlayer = 0 // 0/1/2 -> skin/muscle/bone + var/atlayer = 0 // 0/1/2 skin/muscle/bone + var/datum/surgery_step/omni/last_step //The last step preformed in the surgery /datum/surgery/omni/next_step(mob/user, intent) if(location != user.zone_selected) @@ -34,52 +35,34 @@ if(other.location == user.zone_selected) return FALSE S = new T.type - if(S.try_op(user, target, user.zone_selected, tool, src, try_to_fail)) - return TRUE - if(tool && tool.item_flags & SURGICAL_TOOL) //Just because you used the wrong tool it doesn't mean you meant to whack the patient with it - var/required_tool_type = TOOL_CAUTERY - if(requires_bodypart_type == BODYTYPE_ROBOTIC) - required_tool_type = TOOL_SCREWDRIVER - - if(tool.tool_behaviour == required_tool_type) - // Cancel the surgery if a cautery is used AND it's not the tool used in the next step. - attempt_cancel_surgery(src, tool, target, user) + if(S) + if(S.try_op(user, target, user.zone_selected, tool, src, try_to_fail)) + last_step = S return TRUE - to_chat(user, "Somethings wrong, I can feel it!") - return TRUE - else if(tool && tool.item_flags & SURGICAL_TOOL) - var/required_tool_type = TOOL_CAUTERY - if(requires_bodypart_type == BODYTYPE_ROBOTIC) - required_tool_type = TOOL_SCREWDRIVER - if(tool.tool_behaviour == required_tool_type) - attempt_cancel_surgery(src, tool, target, user) - return TRUE return FALSE /datum/surgery/omni/get_surgery_step(obj/item/tool,mob/user,mob/living/target) var/list/all_steps = GLOB.omnisurgerysteps_list.Copy() var/list/valid_steps = list() - var/datum/surgery_step/omni/beststep = null + var/datum/surgery_step/omni/firststep = null for(var/datum/surgery_step/omni/S in all_steps) if(!S.show) continue if(!S.valid_locations.Find(location)) continue - if(S.required_layer != atlayer) + if(!(atlayer in S.required_layer)) continue if(!(S.accept_any_item || S.accept_hand) && !(S.implements.Find(tool.tool_behaviour) || S.implements.Find(tool))) continue - if(!S.test_op(user,target)) + if(!S.test_op(user,target,src)) continue - if(beststep == null) - beststep = S + if(firststep == null) + firststep = S valid_steps += list(S) else - if(beststep.priority > S.priority) - beststep = S valid_steps += list(S) - if(beststep && valid_steps.len == 1) - return list(beststep) + if(firststep && valid_steps.len == 1) + return list(firststep) else if (valid_steps.len > 1) return valid_steps return null diff --git a/code/modules/surgery/omnisurgery/omnisurgery_step.dm b/code/modules/surgery/omnisurgery/omnisurgery_step.dm index 3898de07a0ad..baa479099508 100644 --- a/code/modules/surgery/omnisurgery/omnisurgery_step.dm +++ b/code/modules/surgery/omnisurgery/omnisurgery_step.dm @@ -1,19 +1,16 @@ /datum/surgery_step/omni - var/required_layer = 0 //What layer is needed to do this step. - var/priority = 10 //low priority -> executed before others + var/list/required_layer = list(0,1,2) //What layers can this step be preformed at? var/list/valid_locations = list(BODY_ZONE_CHEST,BODY_ZONE_HEAD,BODY_ZONE_L_ARM,BODY_ZONE_L_LEG,BODY_ZONE_R_ARM,BODY_ZONE_R_LEG) //List of all places this step can be preformed var/show = FALSE //if false, isn't considered a 'valid' step, and cant be preformed. Used for 'base' step //For any additional logic needing done before we say this step is 'valid' Why not try_op? Couple reasons. // One: We already are testing half of try_op before calling test_op // Two: We only want if the surgery is a valid step that can be taken, we don't necissarily want to initiate it. -/datum/surgery_step/omni/proc/test_op(mob/user,mob/living/target) +/datum/surgery_step/omni/proc/test_op(mob/user,mob/living/target,datum/surgery/omni/surgery) return TRUE /datum/surgery_step/omni/try_op(mob/user, mob/living/target, target_zone, obj/item/tool, datum/surgery/omni/surgery, try_to_fail = FALSE) var/success = FALSE - if(surgery.atlayer != required_layer) - return FALSE if(accept_hand) if(!tool) success = TRUE @@ -37,7 +34,6 @@ if(tool_check(user, tool)) success = TRUE break - if(success) if(target_zone == surgery.location) if(get_location_accessible(target, target_zone) || surgery.ignore_clothes) From 257ecf877cf7256ba43f2987a521c65379a8d300 Mon Sep 17 00:00:00 2001 From: Len Kagamine Date: Tue, 27 Feb 2024 22:55:12 -0500 Subject: [PATCH 07/35] Radial instead of input for conflicts also AXE HEALING AXE HEALING AXE HEALING --- code/modules/surgery/omnisurgery/bone_repair.dm | 1 + code/modules/surgery/omnisurgery/omni_healing.dm | 2 +- code/modules/surgery/omnisurgery/omnisurgery.dm | 16 ++++------------ .../surgery/omnisurgery/omnisurgery_step.dm | 1 + 4 files changed, 7 insertions(+), 13 deletions(-) diff --git a/code/modules/surgery/omnisurgery/bone_repair.dm b/code/modules/surgery/omnisurgery/bone_repair.dm index fdc6abc11dd4..0b0d2ad26109 100644 --- a/code/modules/surgery/omnisurgery/bone_repair.dm +++ b/code/modules/surgery/omnisurgery/bone_repair.dm @@ -8,6 +8,7 @@ preop_sound = 'sound/surgery/bone1.ogg' success_sound = 'sound/surgery/bone3.ogg' required_layer = list(2) + radial_icon = /obj/item/kinetic_crusher /datum/surgery_step/omni/set_bone/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) if(target_zone == BODY_ZONE_HEAD) diff --git a/code/modules/surgery/omnisurgery/omni_healing.dm b/code/modules/surgery/omnisurgery/omni_healing.dm index af9fbf6383d6..6cfe8e84d701 100644 --- a/code/modules/surgery/omnisurgery/omni_healing.dm +++ b/code/modules/surgery/omnisurgery/omni_healing.dm @@ -13,7 +13,7 @@ var/missinghpbonus = 0 //heals an extra point of damager per X missing damage of type (burn damage for burn healing, brute for brute). Smaller Number = More Healing! show = TRUE required_layer = list(1) - + radial_icon = /obj/item/kinetic_crusher /datum/surgery_step/omni/heal/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) var/woundtype diff --git a/code/modules/surgery/omnisurgery/omnisurgery.dm b/code/modules/surgery/omnisurgery/omnisurgery.dm index bf17c86ee3d6..ea841d21bfd6 100644 --- a/code/modules/surgery/omnisurgery/omnisurgery.dm +++ b/code/modules/surgery/omnisurgery/omnisurgery.dm @@ -26,7 +26,7 @@ var/datum/surgery_step/omni/val = L[1] S = new val.type else - var/P = input("Begin which procedure?", "Surgery", null, null) as null|anything in sortList(L) + var/P = show_radial_menu(user,target,L,require_near = TRUE) if(P && user && user.Adjacent(target) && (tool in user)) var/datum/surgery_step/omni/T = locate(P) in L // Why tf does L[P] not work here. for(var/datum/surgery/other in target.surgeries) @@ -44,7 +44,6 @@ /datum/surgery/omni/get_surgery_step(obj/item/tool,mob/user,mob/living/target) var/list/all_steps = GLOB.omnisurgerysteps_list.Copy() var/list/valid_steps = list() - var/datum/surgery_step/omni/firststep = null for(var/datum/surgery_step/omni/S in all_steps) if(!S.show) continue @@ -56,15 +55,8 @@ continue if(!S.test_op(user,target,src)) continue - if(firststep == null) - firststep = S - valid_steps += list(S) - else - valid_steps += list(S) - if(firststep && valid_steps.len == 1) - return list(firststep) - else if (valid_steps.len > 1) - return valid_steps - return null + valid_steps[S] = S.radial_icon != null ? S.radial_icon : null + return valid_steps + /datum/surgery/omni/get_surgery_next_step() return null diff --git a/code/modules/surgery/omnisurgery/omnisurgery_step.dm b/code/modules/surgery/omnisurgery/omnisurgery_step.dm index baa479099508..ec767d51802c 100644 --- a/code/modules/surgery/omnisurgery/omnisurgery_step.dm +++ b/code/modules/surgery/omnisurgery/omnisurgery_step.dm @@ -2,6 +2,7 @@ var/list/required_layer = list(0,1,2) //What layers can this step be preformed at? var/list/valid_locations = list(BODY_ZONE_CHEST,BODY_ZONE_HEAD,BODY_ZONE_L_ARM,BODY_ZONE_L_LEG,BODY_ZONE_R_ARM,BODY_ZONE_R_LEG) //List of all places this step can be preformed var/show = FALSE //if false, isn't considered a 'valid' step, and cant be preformed. Used for 'base' step + var/radial_icon = null // If not null, is the image for the radial //For any additional logic needing done before we say this step is 'valid' Why not try_op? Couple reasons. // One: We already are testing half of try_op before calling test_op From b0c9786bdf5e6f58f4e77058d1e25a9dc40504b5 Mon Sep 17 00:00:00 2001 From: NinMario64 Date: Thu, 29 Feb 2024 18:25:03 -0500 Subject: [PATCH 08/35] Organ movement refactor *Un-nullspaces your organs* (#79687) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit closes #53931, #70916, #53931 Organs were previously stored in nullspace. Now they are stored in their prospective bodyparts. Bodyparts are now stored in the mob. I've also had to refactor a lot of code concerning organ movement. Previously, organs were only moved into bodyparts once the bodyparts were removed. To accomodate this change, two major distinctions have been made: **Bodypart removal/insertion** Called only when an organ is taken out of a bodypart. Bodypart overlays, damage modifiers or other changes that should affect a bodypart itself goes here. **Mob insertion/removal** Called when an organ is removed from a mob. This can either be directly, by taking the organ out of a mob, or by removing the bodypart that contains the organ. This lets you add and remove organ effects safely without having to worry about the bodypart. Now that we controle the movement of bodyparts and organs, we can fuck around with them more. Summoning someones head or chest or heart will actually kill them now (and quite violently I must say (chest summoning gibs lol)). https://github.com/tgstation/tgstation/assets/7501474/5efc9dd3-cfd5-4ce4-b70f-d0d74894626e I´ve also added a unit test that violently tears apart and reconstructs a person in different ways to see if they get put toghether the right way This will definitely need a testmerge. I've done a lot of testing to make sure interactions work, but more niche stuff or my own incompetence can always slip through. A lot of organ work is quite restricted. You can't C4 someones heart, you cant summon their organs and a lot of exceptions have to be made to keep organs in nullspace. This lets organs (and bodyparts) play more nicely with the rest of the game. This also makes it a lot easier to move away from extorgans since a lot of their unique movement code has been removed and or generalized. I don't like making PRs of this size (I'm so sorry reviewers), but I was in a unique position to replace the entire system in a way I couldn't have done conveniently in multiple PRs :cl: refactor: Your organs are now inside your body. Please report any issues with bodypart and organ movement, including exotic organ, on github and scream at me fix: Cases of unexpected organ movement, such as teleporting bodyparts and organs with spells, now invokes a proper reaction (usually violent death) runtime: Fixes HARS runtiming on activation/deactivation fix: Fixes lag when species swapping /:cl: --- .../surgery/omnisurgery/omni_amputation.dm | 35 ++++ .../surgery/omnisurgery/omni_brain_surgery.dm | 50 ++++++ .../surgery/omnisurgery/omni_eye_surgery.dm | 48 ++++++ .../surgery/omnisurgery/omni_gastrectomy.dm | 39 +++++ .../surgery/omnisurgery/omni_hepatectomy.dm | 39 +++++ .../omnisurgery/omni_implant_removal.dm | 54 ++++++ .../surgery/omnisurgery/omni_lobectomy.dm | 51 ++++++ .../omnisurgery/omni_organ_manipulation.dm | 154 ++++++++++++++++++ .../omnisurgery/omni_plastic_surgery.dm | 54 ++++++ .../omni_remove_embedded_object.dm | 41 +++++ .../surgery/omnisurgery/omni_revival.dm | 111 +++++++++++++ .../surgery/omnisurgery/omni_stomachpump.dm | 49 ++++++ shiptest.dme | 10 ++ 13 files changed, 735 insertions(+) create mode 100644 code/modules/surgery/omnisurgery/omni_amputation.dm create mode 100644 code/modules/surgery/omnisurgery/omni_brain_surgery.dm create mode 100644 code/modules/surgery/omnisurgery/omni_eye_surgery.dm create mode 100644 code/modules/surgery/omnisurgery/omni_gastrectomy.dm create mode 100644 code/modules/surgery/omnisurgery/omni_hepatectomy.dm create mode 100644 code/modules/surgery/omnisurgery/omni_implant_removal.dm create mode 100644 code/modules/surgery/omnisurgery/omni_lobectomy.dm create mode 100644 code/modules/surgery/omnisurgery/omni_organ_manipulation.dm create mode 100644 code/modules/surgery/omnisurgery/omni_plastic_surgery.dm create mode 100644 code/modules/surgery/omnisurgery/omni_remove_embedded_object.dm create mode 100644 code/modules/surgery/omnisurgery/omni_revival.dm create mode 100644 code/modules/surgery/omnisurgery/omni_stomachpump.dm diff --git a/code/modules/surgery/omnisurgery/omni_amputation.dm b/code/modules/surgery/omnisurgery/omni_amputation.dm new file mode 100644 index 000000000000..bc6ce9133914 --- /dev/null +++ b/code/modules/surgery/omnisurgery/omni_amputation.dm @@ -0,0 +1,35 @@ +/datum/surgery_step/omni/sever_limb + name = "sever limb" + implements = list(//this is fine, detaching limbs doesn't require precision - this is only more precise because zone targeting is randomized + /obj/item/shears = 300, + TOOL_SCALPEL = 100, + TOOL_SAW = 100, + /obj/item/melee/arm_blade = 80, + /obj/item/fireaxe = 50, + /obj/item/hatchet = 40, + /obj/item/kitchen/knife/butcher = 25) + time = 6.4 SECONDS + preop_sound = 'sound/surgery/scalpel1.ogg' + success_sound = 'sound/surgery/organ2.ogg' + time = 64 + experience_given = MEDICAL_SKILL_ORGAN_FIX + required_layer = list(2) + show = TRUE + valid_locations = list(BODY_ZONE_R_ARM, BODY_ZONE_L_ARM, BODY_ZONE_L_LEG, BODY_ZONE_R_LEG, BODY_ZONE_HEAD) + +/datum/surgery_step/omni/sever_limb/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) + display_results(user, target, "You begin to sever [target]'s [parse_zone(target_zone)]...", + "[user] begins to sever [target]'s [parse_zone(target_zone)]!", + "[user] begins to sever [target]'s [parse_zone(target_zone)]!") + +/datum/surgery_step/omni/sever_limb/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery, default_display_results = FALSE) + var/mob/living/carbon/human/L = target + display_results(user, target, "You sever [L]'s [parse_zone(target_zone)].", + "[user] severs [L]'s [parse_zone(target_zone)]!", + "[user] severs [L]'s [parse_zone(target_zone)]!") + if(surgery.operated_bodypart) + var/obj/item/bodypart/target_limb = surgery.operated_bodypart + target_limb.drop_limb() + if(user.mind) + user.mind.adjust_experience(/datum/skill/healing, experience_given) + return ..() diff --git a/code/modules/surgery/omnisurgery/omni_brain_surgery.dm b/code/modules/surgery/omnisurgery/omni_brain_surgery.dm new file mode 100644 index 000000000000..66d652922613 --- /dev/null +++ b/code/modules/surgery/omnisurgery/omni_brain_surgery.dm @@ -0,0 +1,50 @@ +/datum/surgery_step/omni/fix_brain + name = "fix brain" + implements = list( + TOOL_HEMOSTAT = 85, + TOOL_SCREWDRIVER = 40, + /obj/item/pen = 5) //don't worry, pouring some alcohol on their open brain will get that chance to 100 //will it? i don't know. + repeatable = TRUE + time = 10 SECONDS //long and complicated + preop_sound = 'sound/surgery/hemostat1.ogg' + success_sound = 'sound/surgery/hemostat1.ogg' + failure_sound = 'sound/surgery/organ2.ogg' + experience_given = 0 // per_trauma + required_layer = list(2) + show = TRUE + valid_locations = list(BODY_ZONE_HEAD) + +/datum/surgery/omni/omni_brain_surgery/can_start(mob/user, mob/living/carbon/target) + var/obj/item/organ/brain/B = target.getorganslot(ORGAN_SLOT_BRAIN) + if(!B) + return FALSE + return TRUE + +/datum/surgery_step/omni/fix_brain/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) + display_results(user, target, "You begin to fix [target]'s brain...", + "[user] begins to fix [target]'s brain.", + "[user] begins to perform surgery on [target]'s brain.") + +/datum/surgery_step/omni/fix_brain/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery, default_display_results = FALSE) + display_results(user, target, "You succeed in fixing [target]'s brain.", + "[user] successfully fixes [target]'s brain!", + "[user] completes the surgery on [target]'s brain.") + if(target.mind?.has_antag_datum(/datum/antagonist/brainwashed)) + target.mind.remove_antag_datum(/datum/antagonist/brainwashed) + target.setOrganLoss(ORGAN_SLOT_BRAIN, target.getOrganLoss(ORGAN_SLOT_BRAIN) - 50) //we set damage in this case in order to clear the "failing" flag + var/cured_num = target.cure_all_traumas(TRAUMA_RESILIENCE_SURGERY) + experience_given = (MEDICAL_SKILL_EASY*2*cured_num) + if(target.getOrganLoss(ORGAN_SLOT_BRAIN) > 0) + to_chat(user, "[target]'s brain looks like it could be fixed further.") + return ..() + +/datum/surgery_step/omni/fix_brain/failure(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) + if(target.getorganslot(ORGAN_SLOT_BRAIN)) + display_results(user, target, "You screw up, causing more damage!", + "[user] screws up, causing brain damage!", + "[user] completes the surgery on [target]'s brain.") + target.adjustOrganLoss(ORGAN_SLOT_BRAIN, 60) + target.gain_trauma_type(BRAIN_TRAUMA_SEVERE, TRAUMA_RESILIENCE_LOBOTOMY) + else + user.visible_message("[user] suddenly notices that the brain [user.p_they()] [user.p_were()] working on is not there anymore.", "You suddenly notice that the brain you were working on is not there anymore.") + return FALSE diff --git a/code/modules/surgery/omnisurgery/omni_eye_surgery.dm b/code/modules/surgery/omnisurgery/omni_eye_surgery.dm new file mode 100644 index 000000000000..ab179d3826fc --- /dev/null +++ b/code/modules/surgery/omnisurgery/omni_eye_surgery.dm @@ -0,0 +1,48 @@ +//fix eyes +/datum/surgery_step/omni/fix_eyes + name = "fix eyes" + implements = list( + TOOL_HEMOSTAT = 100, + TOOL_SCREWDRIVER = 40) //ow! my eyes ! + time = 64 + experience_given = (MEDICAL_SKILL_ORGAN_FIX*0.6) //repeatable and can be done at any damage + valid_locations = list(BODY_ZONE_PRECISE_EYES) + required_layer = list(1) + show = TRUE + +/datum/surgery/omni/eye_surgery/can_start(mob/user, mob/living/carbon/target) + var/obj/item/organ/eyes/E = target.getorganslot(ORGAN_SLOT_EYES) + if(!E) + to_chat(user, "It's hard to do surgery on someone's eyes when [target.p_they()] [target.p_do()]n't have any.") + return FALSE + return TRUE + +/datum/surgery_step/omni/fix_eyes/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) + display_results(user, target, "You begin to fix [target]'s eyes...", + "[user] begins to fix [target]'s eyes.", + "[user] begins to perform surgery on [target]'s eyes.") + +/datum/surgery_step/omni/fix_eyes/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery, default_display_results = FALSE) + var/obj/item/organ/eyes/E = target.getorganslot(ORGAN_SLOT_EYES) + user.visible_message("[user] successfully fixes [target]'s eyes!", "You succeed in fixing [target]'s eyes.") + display_results(user, target, "You succeed in fixing [target]'s eyes.", + "[user] successfully fixes [target]'s eyes!", + "[user] completes the surgery on [target]'s eyes.") + target.cure_blind(list(EYE_DAMAGE)) + target.set_blindness(0) + target.cure_nearsighted(list(EYE_DAMAGE)) + target.blur_eyes(35) //this will fix itself slowly. + E.setOrganDamage(0) + return ..() + +/datum/surgery_step/omni/fix_eyes/failure(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) + if(target.getorgan(/obj/item/organ/brain)) + display_results(user, target, "You accidentally stab [target] right in the brain!", + "[user] accidentally stabs [target] right in the brain!", + "[user] accidentally stabs [target] right in the brain!") + target.adjustOrganLoss(ORGAN_SLOT_BRAIN, 70) + else + display_results(user, target, "You accidentally stab [target] right in the brain! Or would have, if [target] had a brain.", + "[user] accidentally stabs [target] right in the brain! Or would have, if [target] had a brain.", + "[user] accidentally stabs [target] right in the brain!") + return FALSE diff --git a/code/modules/surgery/omnisurgery/omni_gastrectomy.dm b/code/modules/surgery/omnisurgery/omni_gastrectomy.dm new file mode 100644 index 000000000000..9395755ad4e3 --- /dev/null +++ b/code/modules/surgery/omnisurgery/omni_gastrectomy.dm @@ -0,0 +1,39 @@ +/datum/surgery/omni/gastrectomy/can_start(mob/user, mob/living/carbon/target) + var/obj/item/organ/stomach/L = target.getorganslot(ORGAN_SLOT_STOMACH) + if(L?.damage > 50 && !(L.organ_flags & ORGAN_FAILING)) + return TRUE + +////Gastrectomy, because we truly needed a way to repair stomachs. +//95% chance of success to be consistent with most organ-repairing surgeries. +/datum/surgery_step/omni/gastrectomy + name = "remove lower duodenum" + implements = list( + TOOL_SCALPEL = 95, + /obj/item/melee/transforming/energy/sword = 33, + /obj/item/kitchen/knife = 40, + /obj/item/shard = 10) + time = 52 + experience_given = (MEDICAL_SKILL_ORGAN_FIX*0.8) //for consistency across organ surgeries + required_layer = list(2) + show = TRUE + valid_locations = list(BODY_ZONE_CHEST) + +/datum/surgery_step/omni/gastrectomy/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) + display_results(user, target, "You begin to cut out a damaged piece of [target]'s stomach...", + "[user] begins to make an incision in [target].", + "[user] begins to make an incision in [target].") + +/datum/surgery_step/omni/gastrectomy/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery, default_display_results = FALSE) + var/mob/living/carbon/human/H = target + H.setOrganLoss(ORGAN_SLOT_STOMACH, 10) // Stomachs have a threshold for being able to even digest food, so I might tweak this number + display_results(user, target, "You successfully remove the damaged part of [target]'s stomach.", + "[user] successfully removes the damaged part of [target]'s stomach.", + "[user] successfully removes the damaged part of [target]'s stomach.") + return ..() + +/datum/surgery_step/omni/gastrectomy/failure(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery) + var/mob/living/carbon/human/H = target + H.adjustOrganLoss(ORGAN_SLOT_STOMACH, 20) + display_results(user, target, "You cut the wrong part of [target]'s stomach!", + "[user] cuts the wrong part of [target]'s stomach!", + "[user] cuts the wrong part of [target]'s stomach!") diff --git a/code/modules/surgery/omnisurgery/omni_hepatectomy.dm b/code/modules/surgery/omnisurgery/omni_hepatectomy.dm new file mode 100644 index 000000000000..8e17b52e759f --- /dev/null +++ b/code/modules/surgery/omnisurgery/omni_hepatectomy.dm @@ -0,0 +1,39 @@ +/datum/surgery/omni/hepatectomy/can_start(mob/user, mob/living/carbon/target) + var/obj/item/organ/liver/L = target.getorganslot(ORGAN_SLOT_LIVER) + if(L?.damage > 50 && !(L.organ_flags & ORGAN_FAILING)) + return TRUE + +////hepatectomy, removes damaged parts of the liver so that the liver may regenerate properly +//95% chance of success, not 100 because organs are delicate +/datum/surgery_step/omni/hepatectomy + name = "remove damaged liver section" + implements = list( + TOOL_SCALPEL = 95, + /obj/item/melee/transforming/energy/sword = 33, + /obj/item/kitchen/knife = 40, + /obj/item/shard = 25) + time = 52 + experience_given = (MEDICAL_SKILL_ORGAN_FIX*0.8) //repeatable so not as much xp + valid_locations = list(BODY_ZONE_CHEST) + required_layer = list(2) + show = TRUE + +/datum/surgery_step/omni/hepatectomy/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) + display_results(user, target, "You begin to cut out a damaged peice of [target]'s liver...", + "[user] begins to make an incision in [target].", + "[user] begins to make an incision in [target].") + +/datum/surgery_step/omni/hepatectomy/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery, default_display_results = FALSE) + var/mob/living/carbon/human/H = target + H.setOrganLoss(ORGAN_SLOT_LIVER, 10) //not bad, not great + display_results(user, target, "You successfully remove the damaged part of [target]'s liver.", + "[user] successfully removes the damaged part of [target]'s liver.", + "[user] successfully removes the damaged part of [target]'s liver.") + return ..() + +/datum/surgery_step/omni/hepatectomy/failure(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery) + var/mob/living/carbon/human/H = target + H.adjustOrganLoss(ORGAN_SLOT_LIVER, 20) + display_results(user, target, "You cut the wrong part of [target]'s liver!", + "[user] cuts the wrong part of [target]'s liver!", + "[user] cuts the wrong part of [target]'s liver!") diff --git a/code/modules/surgery/omnisurgery/omni_implant_removal.dm b/code/modules/surgery/omnisurgery/omni_implant_removal.dm new file mode 100644 index 000000000000..413629e5459a --- /dev/null +++ b/code/modules/surgery/omnisurgery/omni_implant_removal.dm @@ -0,0 +1,54 @@ +//extract implant +/datum/surgery_step/omni/extract_implant + name = "extract implant" + implements = list( + TOOL_HEMOSTAT = 100, + TOOL_CROWBAR = 40, + /obj/item/kitchen/fork = 33) + time = 6.4 SECONDS + success_sound = 'sound/surgery/hemostat1.ogg' + experience_given = MEDICAL_SKILL_MEDIUM + var/obj/item/implant/I = null + required_layer = list(2) + show = TRUE + valid_locations = list(BODY_ZONE_CHEST) + +/datum/surgery_step/omni/extract_implant/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) + for(var/obj/item/O in target.implants) + I = O + break + if(I) + display_results(user, target, "You begin to extract [I] from [target]'s [target_zone]...", + "[user] begins to extract [I] from [target]'s [target_zone].", + "[user] begins to extract something from [target]'s [target_zone].") + else + display_results(user, target, "You look for an implant in [target]'s [target_zone]...", + "[user] looks for an implant in [target]'s [target_zone].", + "[user] looks for something in [target]'s [target_zone].") + +/datum/surgery_step/omni/extract_implant/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery, default_display_results = FALSE) + if(I) + display_results(user, target, "You successfully remove [I] from [target]'s [target_zone].", + "[user] successfully removes [I] from [target]'s [target_zone]!", + "[user] successfully removes something from [target]'s [target_zone]!") + I.removed(target) + + var/obj/item/implantcase/case + for(var/obj/item/implantcase/ic in user.held_items) + case = ic + break + if(!case) + case = locate(/obj/item/implantcase) in get_turf(target) + if(case && !case.imp) + case.imp = I + I.forceMove(case) + case.update_appearance() + display_results(user, target, "You place [I] into [case].", + "[user] places [I] into [case]!", + "[user] places it into [case]!") + else + qdel(I) + + else + to_chat(user, "You can't find anything in [target]'s [target_zone]!") + return ..() diff --git a/code/modules/surgery/omnisurgery/omni_lobectomy.dm b/code/modules/surgery/omnisurgery/omni_lobectomy.dm new file mode 100644 index 000000000000..8947894a6105 --- /dev/null +++ b/code/modules/surgery/omnisurgery/omni_lobectomy.dm @@ -0,0 +1,51 @@ +/datum/surgery/omni/lobectomy/can_start(mob/user, mob/living/carbon/target) + var/obj/item/organ/lungs/L = target.getorganslot(ORGAN_SLOT_LUNGS) + if(L) + if(L.damage > 60 && !L.operated) + return TRUE + return FALSE + + +//lobectomy, removes the most damaged lung lobe with a 95% base success chance +/datum/surgery_step/omni/lobectomy + name = "excise damaged lung node" + implements = list( + TOOL_SCALPEL = 95, + /obj/item/melee/transforming/energy/sword = 33, + /obj/item/kitchen/knife = 40, + /obj/item/shard = 25) + time = 4.2 SECONDS + preop_sound = 'sound/surgery/scalpel1.ogg' + success_sound = 'sound/surgery/organ1.ogg' + failure_sound = 'sound/surgery/organ2.ogg' + experience_given = MEDICAL_SKILL_ORGAN_FIX + required_layer = list(2) + show = TRUE + valid_locations = list(BODY_ZONE_CHEST) + + +/datum/surgery_step/omni/lobectomy/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) + display_results(user, target, "You begin to make an incision in [target]'s lungs...", + "[user] begins to make an incision in [target].", + "[user] begins to make an incision in [target].") + +/datum/surgery_step/omni/lobectomy/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery, default_display_results = FALSE) + if(ishuman(target)) + var/mob/living/carbon/human/H = target + var/obj/item/organ/lungs/L = H.getorganslot(ORGAN_SLOT_LUNGS) + L.operated = TRUE + H.setOrganLoss(ORGAN_SLOT_LUNGS, 25) + display_results(user, target, "You successfully excise [H]'s most damaged lobe.", + "Successfully removes a piece of [H]'s lungs.", + "") + return ..() + +/datum/surgery_step/omni/lobectomy/failure(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) + if(ishuman(target)) + var/mob/living/carbon/human/H = target + display_results(user, target, "You screw up, failing to excise [H]'s damaged lobe!", + "[user] screws up!", + "[user] screws up!") + H.losebreath += 10 + H.adjustOrganLoss(ORGAN_SLOT_LUNGS, 20) + return FALSE diff --git a/code/modules/surgery/omnisurgery/omni_organ_manipulation.dm b/code/modules/surgery/omnisurgery/omni_organ_manipulation.dm new file mode 100644 index 000000000000..e75fe16b3887 --- /dev/null +++ b/code/modules/surgery/omnisurgery/omni_organ_manipulation.dm @@ -0,0 +1,154 @@ +/datum/surgery_step/omni/manipulate_organs + time = 6.4 SECONDS + name = "manipulate organs" + repeatable = TRUE + implements = list(/obj/item/organ = 100, + /obj/item/organ_storage = 100, + /obj/item/mmi = 100) + preop_sound = 'sound/surgery/organ2.ogg' + success_sound = 'sound/surgery/organ1.ogg' + var/implements_extract = list(TOOL_HEMOSTAT = 100, TOOL_CROWBAR = 55, /obj/item/kitchen/fork = 35) + var/current_type + var/obj/item/organ/manipulated_organ = null + required_layer = list(2) + show = TRUE + valid_locations = list(BODY_ZONE_CHEST) + +/datum/surgery_step/omni/manipulate_organs/New() + ..() + implements = implements + implements_extract + +/datum/surgery_step/omni/manipulate_organs/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) + manipulated_organ = null + if(istype(tool, /obj/item/organ_storage)) + preop_sound = initial(preop_sound) + success_sound = initial(success_sound) + if(!tool.contents.len) + to_chat(user, "There is nothing inside [tool]!") + return -1 + manipulated_organ = tool.contents[1] + if(!isorgan(manipulated_organ)) + to_chat(user, "You cannot put [manipulated_organ] into [target]'s [parse_zone(target_zone)]!") + return -1 + tool = manipulated_organ + if(isorgan(tool)) + current_type = "insert" + preop_sound = initial(preop_sound) + success_sound = initial(success_sound) + manipulated_organ = tool + if(target_zone != manipulated_organ.zone || target.getorganslot(manipulated_organ.slot)) + to_chat(user, "There is no room for [manipulated_organ] in [target]'s [parse_zone(target_zone)]!") + return -1 + var/obj/item/organ/meatslab = tool + if(!meatslab.useable) + to_chat(user, "[manipulated_organ] seems to have been chewed on, you can't use this!") + return -1 + display_results(user, target, "You begin to insert [tool] into [target]'s [parse_zone(target_zone)]...", + "[user] begins to insert [tool] into [target]'s [parse_zone(target_zone)].", + "[user] begins to insert something into [target]'s [parse_zone(target_zone)].") + + if(istype(tool, /obj/item/mmi))//this whole thing is only used for robotic surgery in organ_mani_robotic.dm :* + current_type = "posibrain" + preop_sound = 'sound/items/tape_flip.ogg' + success_sound = 'sound/items/taperecorder_close.ogg' + var/obj/item/bodypart/affected = target.get_bodypart(check_zone(target_zone)) + var/obj/item/mmi/target_mmi = tool + if(!affected) + return -1 + + if(IS_ORGANIC_LIMB(affected)) + to_chat(user, "You can't put [tool] into a meat enclosure!") + return -1 + if(!isipc(target)) + to_chat(user, "[target] does not have the proper connectors to interface with [tool].") + return -1 + if(target_zone != "chest") + to_chat(user, "You have to install [tool] in [target]'s chest!") + return -1 + if(target.internal_organs_slot[ORGAN_SLOT_BRAIN]) + to_chat(user, "[target] already has a brain! You'd rather not find out what would happen with two in there.") + return -1 + if(!target_mmi.brainmob || !target_mmi.brainmob.client) + to_chat(user, "[tool] has no life in it, this would be pointless!") + return -1 + + //WS End + + else if(implement_type in implements_extract) + current_type = "extract" + preop_sound = 'sound/surgery/hemostat1.ogg' + success_sound = 'sound/surgery/organ2.ogg' + var/list/organs = target.getorganszone(target_zone) + + var/mob/living/simple_animal/borer/B = target.has_brain_worms() //WS Begin - Borers + if(target.has_brain_worms()) + user.visible_message("[user] begins to extract [B] from [target]'s [parse_zone(target_zone)].", + "You begin to extract [B] from [target]'s [parse_zone(target_zone)]...") + return TRUE //WS End + + if(!organs.len) + to_chat(user, "There are no removable organs in [target]'s [parse_zone(target_zone)]!") + return -1 + else + for(var/obj/item/organ/O in organs) + O.on_find(user) + organs -= O + organs[O.name] = O + + manipulated_organ = input("Remove which organ?", "Surgery", null, null) as null|anything in sortList(organs) + if(manipulated_organ && user && target && user.Adjacent(target) && user.get_active_held_item() == tool) + manipulated_organ = organs[manipulated_organ] + if(!manipulated_organ) + return -1 + display_results(user, target, "You begin to extract [manipulated_organ] from [target]'s [parse_zone(target_zone)]...", + "[user] begins to extract [manipulated_organ] from [target]'s [parse_zone(target_zone)].", + "[user] begins to extract something from [target]'s [parse_zone(target_zone)].") + else + return -1 + +/datum/surgery_step/omni/manipulate_organs/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery, default_display_results) + if(current_type == "posibrain") + user.temporarilyRemoveItemFromInventory(tool, TRUE) + manipulated_organ = new /obj/item/organ/brain/mmi_holder/posibrain(null, tool) + manipulated_organ.Insert(target) + display_results(user, target, "You insert [tool] into [target]'s [parse_zone(target_zone)].", + "[user] inserts [tool] into [target]'s [parse_zone(target_zone)]!", + "[user] inserts something into [target]'s [parse_zone(target_zone)]!") + + else if(current_type == "insert") + if(istype(tool, /obj/item/organ_storage)) + manipulated_organ = tool.contents[1] + tool.icon_state = initial(tool.icon_state) + tool.desc = initial(tool.desc) + tool.cut_overlays() + tool = manipulated_organ + else + manipulated_organ = tool + user.temporarilyRemoveItemFromInventory(manipulated_organ, TRUE) + manipulated_organ.Insert(target) + display_results(user, target, "You insert [tool] into [target]'s [parse_zone(target_zone)].", + "[user] inserts [tool] into [target]'s [parse_zone(target_zone)]!", + "[user] inserts something into [target]'s [parse_zone(target_zone)]!") + + else if(current_type == "extract") + //WS begin - borers + var/mob/living/simple_animal/borer/B = target.has_brain_worms() + if(B && B.victim == target) + user.visible_message("[user] successfully extracts [B] from [target]'s [parse_zone(target_zone)]!", + "You successfully extract [B] from [target]'s [parse_zone(target_zone)].") + log_combat(user, target, "surgically removed [B] from", addition="INTENT: [uppertext(user.a_intent)]") + B.leave_victim() + return FALSE + //WS end + if(manipulated_organ && manipulated_organ.owner == target) + display_results(user, target, "You successfully extract [manipulated_organ] from [target]'s [parse_zone(target_zone)].", + "[user] successfully extracts [manipulated_organ] from [target]'s [parse_zone(target_zone)]!", + "[user] successfully extracts something from [target]'s [parse_zone(target_zone)]!") + log_combat(user, target, "surgically removed [manipulated_organ.name] from", addition="INTENT: [uppertext(user.a_intent)]") + manipulated_organ.Remove(target) + manipulated_organ.forceMove(get_turf(target)) + else + display_results(user, target, "You can't extract anything from [target]'s [parse_zone(target_zone)]!", + "[user] can't seem to extract anything from [target]'s [parse_zone(target_zone)]!", + "[user] can't seem to extract anything from [target]'s [parse_zone(target_zone)]!") + return 0 diff --git a/code/modules/surgery/omnisurgery/omni_plastic_surgery.dm b/code/modules/surgery/omnisurgery/omni_plastic_surgery.dm new file mode 100644 index 000000000000..26e497e76911 --- /dev/null +++ b/code/modules/surgery/omnisurgery/omni_plastic_surgery.dm @@ -0,0 +1,54 @@ +//reshape_face +/datum/surgery_step/omni/reshape_face + name = "reshape face" + implements = list( + TOOL_SCALPEL = 100, + /obj/item/kitchen/knife = 40, + TOOL_WIRECUTTER = 33) + time = 64 + experience_given = MEDICAL_SKILL_MEDIUM + required_layer = list(1) + show = TRUE + valid_locations = list(BODY_ZONE_HEAD) + +/datum/surgery_step/omni/reshape_face/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) + user.visible_message("[user] begins to alter [target]'s appearance.", "You begin to alter [target]'s appearance...") + display_results(user, target, "You begin to alter [target]'s appearance...", + "[user] begins to alter [target]'s appearance.", + "[user] begins to make an incision in [target]'s face.") + +/datum/surgery_step/omni/reshape_face/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery, default_display_results = FALSE) + if(HAS_TRAIT_FROM(target, TRAIT_DISFIGURED, TRAIT_GENERIC)) + REMOVE_TRAIT(target, TRAIT_DISFIGURED, TRAIT_GENERIC) + display_results(user, target, "You successfully restore [target]'s appearance.", + "[user] successfully restores [target]'s appearance!", + "[user] finishes the operation on [target]'s face.") + else + var/list/names = list() + if(!isabductor(user)) + for(var/i in 1 to 10) + names += target.dna.species.random_name(target.gender, TRUE) + else + for(var/_i in 1 to 9) + names += "Subject [target.gender == MALE ? "i" : "o"]-[pick("a", "b", "c", "d", "e")]-[rand(10000, 99999)]" + names += target.dna.species.random_name(target.gender, TRUE) //give one normal name in case they want to do regular plastic surgery + var/chosen_name = input(user, "Choose a new name to assign.", "Plastic Surgery") as null|anything in names + if(!chosen_name) + return + var/oldname = target.real_name + target.real_name = chosen_name + var/newname = target.real_name //something about how the code handles names required that I use this instead of target.real_name + display_results(user, target, "You alter [oldname]'s appearance completely, [target.p_they()] is now [newname].", + "[user] alters [oldname]'s appearance completely, [target.p_they()] is now [newname]!", + "[user] finishes the operation on [target]'s face.") + if(ishuman(target)) + var/mob/living/carbon/human/H = target + H.sec_hud_set_ID() + return ..() + +/datum/surgery_step/omni/reshape_face/failure(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) + display_results(user, target, "You screw up, leaving [target]'s appearance disfigured!", + "[user] screws up, disfiguring [target]'s appearance!", + "[user] finishes the operation on [target]'s face.") + ADD_TRAIT(target, TRAIT_DISFIGURED, TRAIT_GENERIC) + return FALSE diff --git a/code/modules/surgery/omnisurgery/omni_remove_embedded_object.dm b/code/modules/surgery/omnisurgery/omni_remove_embedded_object.dm new file mode 100644 index 000000000000..84a9c866c381 --- /dev/null +++ b/code/modules/surgery/omnisurgery/omni_remove_embedded_object.dm @@ -0,0 +1,41 @@ +/datum/surgery_step/omni/remove_object + name = "remove embedded objects" + time = 32 + accept_hand = 1 + experience_given = MEDICAL_SKILL_MEDIUM + var/obj/item/bodypart/L = null + required_layer = list(2) + show = TRUE + valid_locations = list(BODY_ZONE_R_ARM,BODY_ZONE_L_ARM,BODY_ZONE_R_LEG,BODY_ZONE_L_LEG,BODY_ZONE_CHEST,BODY_ZONE_HEAD) + +/datum/surgery_step/omni/remove_object/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) + L = surgery.operated_bodypart + if(L) + user.visible_message("[user] looks for objects embedded in [target]'s [parse_zone(user.zone_selected)].", "You look for objects embedded in [target]'s [parse_zone(user.zone_selected)]...") + display_results(user, target, "You look for objects embedded in [target]'s [parse_zone(user.zone_selected)]...", + "[user] looks for objects embedded in [target]'s [parse_zone(user.zone_selected)].", + "[user] looks for something in [target]'s [parse_zone(user.zone_selected)].") + else + user.visible_message("[user] looks for [target]'s [parse_zone(user.zone_selected)].", "You look for [target]'s [parse_zone(user.zone_selected)]...") + +/datum/surgery_step/omni/remove_object/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery, default_display_results = FALSE) + if(L) + if(ishuman(target)) + var/mob/living/carbon/human/H = target + var/objects = 0 + for(var/obj/item/I in L.embedded_objects) + objects++ + H.remove_embedded_object(I) + + if(objects > 0) + display_results(user, target, "You successfully remove [objects] objects from [H]'s [L.name].", + "[user] successfully removes [objects] objects from [H]'s [L]!", + "[user] successfully removes [objects] objects from [H]'s [L]!") + experience_given = MEDICAL_SKILL_MEDIUM*(objects*0.75) + else + to_chat(user, "You find no objects embedded in [H]'s [L]!") + + else + to_chat(user, "You can't find [target]'s [parse_zone(user.zone_selected)], let alone any objects embedded in it!") + + return ..() diff --git a/code/modules/surgery/omnisurgery/omni_revival.dm b/code/modules/surgery/omnisurgery/omni_revival.dm new file mode 100644 index 000000000000..669b82b2cfab --- /dev/null +++ b/code/modules/surgery/omnisurgery/omni_revival.dm @@ -0,0 +1,111 @@ +//an incision but with greater bleed, and a 90% base success chance +/datum/surgery_step/omni/incise_head + name = "incise head" + implements = list( + TOOL_SCALPEL = 90, + /obj/item/kitchen/knife = 40, + /obj/item/shard = 33) + time = 1.6 SECONDS + preop_sound = 'sound/surgery/scalpel1.ogg' + success_sound = 'sound/surgery/scalpel2.ogg' + failure_sound = 'sound/surgery/organ2.ogg' + required_layer = list(2) + show = TRUE + valid_locations = list(BODY_ZONE_HEAD) + +/datum/surgery_step/omni/incise_head/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) + display_results(user, target, "You begin to make an incision in [target]'s head...", + "[user] begins to make an incision in [target]'s head.", + "[user] begins to make an incision in [target]'s head.") + +/datum/surgery_step/omni/incise_head/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery, default_display_results = FALSE) + if(ishuman(target)) + var/mob/living/carbon/human/H = target + if (!(NOBLOOD in H.dna.species.species_traits)) + display_results(user, target, "Blood pools around the incision in [H]'s head.", + "Blood pools around the incision in [H]'s head.", + "") + H.bleed_rate += 10 + target.apply_damage(15, BRUTE, "[target_zone]") + return ..() + +//revive after incision +/datum/surgery_step/omni/revive + name = "shock brain" + implements = list( + /obj/item/shockpaddles = 100, //this is useful for reviving simepeople. + /obj/item/melee/baton = 40, //i hate this a lot + /obj/item/gun/energy = 30, //should be tasers only + /obj/item/inducer = 30) //why not + time = 3 SECONDS + success_sound = 'sound/magic/lightningbolt.ogg' + failure_sound = 'sound/machines/defib_zap.ogg' + repeatable = TRUE + experience_given = MEDICAL_SKILL_ADVANCED + required_layer = list(2) + show = TRUE + valid_locations = list(BODY_ZONE_HEAD) + +/datum/surgery_step/omni/revive/test_op(mob/user, mob/living/target,datum/surgery/omni/surgery) + var/obj/item/organ/heart/H = target.getorganslot(ORGAN_SLOT_HEART) + if(!istype(surgery.last_step,/datum/surgery_step/omni/incise_head)) + return FALSE + if(H) + if(H.damage > 60 && !H.operated) + return TRUE + return FALSE + +/datum/surgery_step/omni/revive/tool_check(mob/user, obj/item/tool) + . = TRUE + if(istype(tool, /obj/item/shockpaddles)) + var/obj/item/shockpaddles/S = tool + if((S.req_defib && !S.defib.powered) || !S.wielded || S.cooldown || S.busy) + to_chat(user, "You need to wield both paddles, and [S.defib] must be powered!") + return FALSE + if(istype(tool, /obj/item/melee/baton)) + var/obj/item/melee/baton/B = tool + if(!B.turned_on) + to_chat(user, "[B] needs to be active!") + return FALSE + if(istype(tool, /obj/item/gun/energy)) + var/obj/item/gun/energy/E = tool + if(E.chambered && istype(E.chambered, /obj/item/ammo_casing/energy/electrode)) + return TRUE + else + to_chat(user, "You need an electrode for this!") + return FALSE + +/datum/surgery_step/omni/revive/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) + display_results(user, target, "You prepare to give [target]'s brain the spark of life with [tool].", + "[user] prepares to shock [target]'s brain with [tool].", + "[user] prepares to shock [target]'s brain with [tool].") + target.notify_ghost_cloning("Someone is trying to zap your brain. Re-enter your corpse if you want to be revived!", source = target) + +/datum/surgery_step/omni/revive/play_preop_sound(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) + if(istype(tool, /obj/item/shockpaddles)) + playsound(tool, 'sound/machines/defib_charge.ogg', 75, 0) + else + ..() + +/datum/surgery_step/omni/revive/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery, default_display_results) + display_results(user, target, "You successfully shock [target]'s brain with [tool]...", + "[user] send a powerful shock to [target]'s brain with [tool]...", + "[user] send a powerful shock to [target]'s brain with [tool]...") + target.adjustOxyLoss(-50, 0) + target.updatehealth() + if(target.revive(full_heal = FALSE, admin_revive = FALSE)) + target.visible_message("...[target] wakes up, alive and aware!") + target.emote("gasp") + target.adjustOrganLoss(ORGAN_SLOT_BRAIN, 50, 199) //MAD SCIENCE + return TRUE + else + target.visible_message("...[target.p_they()] convulses, then lies still.") + return FALSE + +/datum/surgery_step/omni/revive/failure(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) + display_results(user, target, "You shock [target]'s brain with [tool], but [target.p_they()] doesn't react.", + "[user] send a powerful shock to [target]'s brain with [tool], but [target.p_they()] doesn't react.", + "[user] send a powerful shock to [target]'s brain with [tool], but [target.p_they()] doesn't react.") + playsound(get_turf(target), 'sound/magic/lightningbolt.ogg', 50, TRUE) + target.adjustOrganLoss(ORGAN_SLOT_BRAIN, 20, 180) + return FALSE diff --git a/code/modules/surgery/omnisurgery/omni_stomachpump.dm b/code/modules/surgery/omnisurgery/omni_stomachpump.dm new file mode 100644 index 000000000000..4c428fa643db --- /dev/null +++ b/code/modules/surgery/omnisurgery/omni_stomachpump.dm @@ -0,0 +1,49 @@ +/datum/surgery/omni/stomach_pump/can_start(mob/user, mob/living/carbon/target) + var/obj/item/organ/stomach/S = target.getorganslot(ORGAN_SLOT_STOMACH) + if(target.stat != DEAD) //shamelessly lifted off the revival surgery but we're looking for the same critera here, a dead, non-husked, revivable patient. + return FALSE + if(HAS_TRAIT(target, TRAIT_HUSK)) + return FALSE + if(!S) + return FALSE + return ..() + +//Working the stomach by hand in such a way that you induce vomiting. +/datum/surgery_step/omni/stomach_pump + name = "Pump Stomach" + accept_hand = TRUE + repeatable = TRUE + time = 20 + experience_given = 0 + required_layer = list(2) + show = TRUE + valid_locations = list(BODY_ZONE_CHEST) + +/datum/surgery_step/omni/stomach_pump/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) + display_results(user, target, "You begin pumping [target]'s stomach...", + "[user] begins to pump [target]'s stomach.", + "[user] begins to press on [target]'s chest.") + +/datum/surgery_step/omni/stomach_pump/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery, default_display_results = FALSE) + if(ishuman(target)) + var/mob/living/carbon/human/H = target + var/reagents_volume_before_pump = H.reagents.total_volume + display_results(user, target, "[user] forces [H] to vomit, cleansing their stomach of some chemicals!", + "[user] forces [H] to vomit, cleansing their stomach of some chemicals!", + "[user] forces [H] to vomit!") + H.vomit(20, FALSE, TRUE, 1, TRUE, FALSE, purge = TRUE) //called with purge as true to lose more reagents + if(istype(surgery,/datum/surgery/stomach_pump)) + var/datum/surgery/stomach_pump/stom_pump = surgery + if(stom_pump.accumulated_experience > MEDICAL_SKILL_MEDIUM*10) //capped so you can't dope bodies and purge for ezxp + experience_given = (H.reagents.total_volume - reagents_volume_before_pump)/(MEDICAL_SKILL_MEDIUM) + stom_pump.accumulated_experience += experience_given + return ..() + +/datum/surgery_step/omni/stomach_pump/failure(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) + if(ishuman(target)) + var/mob/living/carbon/human/H = target + display_results(user, target, "You screw up, brusing [H]'s chest!", + "[user] screws up, brusing [H]'s chest!", + "[user] screws up!") + H.adjustOrganLoss(ORGAN_SLOT_STOMACH, 5) + target.apply_damage(15, BRUTE, "[target_zone]") diff --git a/shiptest.dme b/shiptest.dme index 11085586491d..0e1e186f3f5c 100644 --- a/shiptest.dme +++ b/shiptest.dme @@ -3367,9 +3367,19 @@ #include "code\modules\surgery\bodyparts\species_parts\rachnid_bodyparts.dm" #include "code\modules\surgery\bodyparts\species_parts\vox_bodyparts.dm" #include "code\modules\surgery\omnisurgery\bone_repair.dm" +#include "code\modules\surgery\omnisurgery\omni_amputation.dm" #include "code\modules\surgery\omnisurgery\omni_coronary_bypass.dm" +#include "code\modules\surgery\omnisurgery\omni_gastrectomy.dm" #include "code\modules\surgery\omnisurgery\omni_healing.dm" +#include "code\modules\surgery\omnisurgery\omni_hepatectomy.dm" +#include "code\modules\surgery\omnisurgery\omni_implant_removal.dm" +#include "code\modules\surgery\omnisurgery\omni_lobectomy.dm" #include "code\modules\surgery\omnisurgery\omni_movelayer.dm" +#include "code\modules\surgery\omnisurgery\omni_organ_manipulation.dm" +#include "code\modules\surgery\omnisurgery\omni_plastic_surgery.dm" +#include "code\modules\surgery\omnisurgery\omni_remove_embedded_object.dm" +#include "code\modules\surgery\omnisurgery\omni_revival.dm" +#include "code\modules\surgery\omnisurgery\omni_stomachpump.dm" #include "code\modules\surgery\omnisurgery\omnisurgery.dm" #include "code\modules\surgery\omnisurgery\omnisurgery_step.dm" #include "code\modules\surgery\organs\appendix.dm" From f1e974abbb6f8baf7d1941b6c938d5ef53e28e37 Mon Sep 17 00:00:00 2001 From: Len Kagamine Date: Thu, 29 Feb 2024 19:01:23 -0500 Subject: [PATCH 09/35] Few tweakups Fixes minor miscalculations from porting. Did not check all. --- .../surgery/omnisurgery/omni_brain_surgery.dm | 2 +- .../surgery/omnisurgery/omni_gastrectomy.dm | 11 +++++----- .../surgery/omnisurgery/omni_hepatectomy.dm | 11 +++++----- .../surgery/omnisurgery/omni_lobectomy.dm | 14 ++++++------- .../surgery/omnisurgery/omni_revival.dm | 13 +++++++----- .../surgery/omnisurgery/omni_stomachpump.dm | 21 ++++++++++--------- .../surgery/omnisurgery/omnisurgery.dm | 5 +++-- 7 files changed, 41 insertions(+), 36 deletions(-) diff --git a/code/modules/surgery/omnisurgery/omni_brain_surgery.dm b/code/modules/surgery/omnisurgery/omni_brain_surgery.dm index 66d652922613..6f0037b2697c 100644 --- a/code/modules/surgery/omnisurgery/omni_brain_surgery.dm +++ b/code/modules/surgery/omnisurgery/omni_brain_surgery.dm @@ -14,7 +14,7 @@ show = TRUE valid_locations = list(BODY_ZONE_HEAD) -/datum/surgery/omni/omni_brain_surgery/can_start(mob/user, mob/living/carbon/target) +/datum/surgery_step/omni/fix_brain/test_op(mob/user, mob/living/target, datum/surgery/omni/surgery) var/obj/item/organ/brain/B = target.getorganslot(ORGAN_SLOT_BRAIN) if(!B) return FALSE diff --git a/code/modules/surgery/omnisurgery/omni_gastrectomy.dm b/code/modules/surgery/omnisurgery/omni_gastrectomy.dm index 9395755ad4e3..758162330ee0 100644 --- a/code/modules/surgery/omnisurgery/omni_gastrectomy.dm +++ b/code/modules/surgery/omnisurgery/omni_gastrectomy.dm @@ -1,8 +1,3 @@ -/datum/surgery/omni/gastrectomy/can_start(mob/user, mob/living/carbon/target) - var/obj/item/organ/stomach/L = target.getorganslot(ORGAN_SLOT_STOMACH) - if(L?.damage > 50 && !(L.organ_flags & ORGAN_FAILING)) - return TRUE - ////Gastrectomy, because we truly needed a way to repair stomachs. //95% chance of success to be consistent with most organ-repairing surgeries. /datum/surgery_step/omni/gastrectomy @@ -18,6 +13,12 @@ show = TRUE valid_locations = list(BODY_ZONE_CHEST) +/datum/surgery_step/omni/gastrectomy/test_op(mob/user, mob/living/target, datum/surgery/omni/surgery) + var/obj/item/organ/stomach/L = target.getorganslot(ORGAN_SLOT_STOMACH) + if(L?.damage > 50 && !(L.organ_flags & ORGAN_FAILING)) + return TRUE + return FALSE + /datum/surgery_step/omni/gastrectomy/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) display_results(user, target, "You begin to cut out a damaged piece of [target]'s stomach...", "[user] begins to make an incision in [target].", diff --git a/code/modules/surgery/omnisurgery/omni_hepatectomy.dm b/code/modules/surgery/omnisurgery/omni_hepatectomy.dm index 8e17b52e759f..24b2119e1f2d 100644 --- a/code/modules/surgery/omnisurgery/omni_hepatectomy.dm +++ b/code/modules/surgery/omnisurgery/omni_hepatectomy.dm @@ -1,8 +1,3 @@ -/datum/surgery/omni/hepatectomy/can_start(mob/user, mob/living/carbon/target) - var/obj/item/organ/liver/L = target.getorganslot(ORGAN_SLOT_LIVER) - if(L?.damage > 50 && !(L.organ_flags & ORGAN_FAILING)) - return TRUE - ////hepatectomy, removes damaged parts of the liver so that the liver may regenerate properly //95% chance of success, not 100 because organs are delicate /datum/surgery_step/omni/hepatectomy @@ -17,6 +12,12 @@ valid_locations = list(BODY_ZONE_CHEST) required_layer = list(2) show = TRUE +/datum/surgery_step/omni/hepatectomy/test_op(mob/user, mob/living/target, datum/surgery/omni/surgery) + var/obj/item/organ/liver/L = target.getorganslot(ORGAN_SLOT_LIVER) + if(L?.damage > 50 && !(L.organ_flags & ORGAN_FAILING)) + return TRUE + return FALSE + /datum/surgery_step/omni/hepatectomy/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) display_results(user, target, "You begin to cut out a damaged peice of [target]'s liver...", diff --git a/code/modules/surgery/omnisurgery/omni_lobectomy.dm b/code/modules/surgery/omnisurgery/omni_lobectomy.dm index 8947894a6105..9d611142a547 100644 --- a/code/modules/surgery/omnisurgery/omni_lobectomy.dm +++ b/code/modules/surgery/omnisurgery/omni_lobectomy.dm @@ -1,11 +1,3 @@ -/datum/surgery/omni/lobectomy/can_start(mob/user, mob/living/carbon/target) - var/obj/item/organ/lungs/L = target.getorganslot(ORGAN_SLOT_LUNGS) - if(L) - if(L.damage > 60 && !L.operated) - return TRUE - return FALSE - - //lobectomy, removes the most damaged lung lobe with a 95% base success chance /datum/surgery_step/omni/lobectomy name = "excise damaged lung node" @@ -23,6 +15,12 @@ show = TRUE valid_locations = list(BODY_ZONE_CHEST) +/datum/surgery_step/omni/lobectomy/test_op(mob/user, mob/living/target, datum/surgery/omni/surgery) + var/obj/item/organ/lungs/L = target.getorganslot(ORGAN_SLOT_LUNGS) + if(L) + if(L.damage > 60 && !L.operated) + return TRUE + return FALSE /datum/surgery_step/omni/lobectomy/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) display_results(user, target, "You begin to make an incision in [target]'s lungs...", diff --git a/code/modules/surgery/omnisurgery/omni_revival.dm b/code/modules/surgery/omnisurgery/omni_revival.dm index 669b82b2cfab..96e711c83386 100644 --- a/code/modules/surgery/omnisurgery/omni_revival.dm +++ b/code/modules/surgery/omnisurgery/omni_revival.dm @@ -47,13 +47,16 @@ valid_locations = list(BODY_ZONE_HEAD) /datum/surgery_step/omni/revive/test_op(mob/user, mob/living/target,datum/surgery/omni/surgery) - var/obj/item/organ/heart/H = target.getorganslot(ORGAN_SLOT_HEART) if(!istype(surgery.last_step,/datum/surgery_step/omni/incise_head)) return FALSE - if(H) - if(H.damage > 60 && !H.operated) - return TRUE - return FALSE + if(target.stat != DEAD) + return FALSE + if(target.hellbound || HAS_TRAIT(target, TRAIT_HUSK)) + return FALSE + var/obj/item/organ/brain/B = target.getorganslot(ORGAN_SLOT_BRAIN) + if(!B) + return FALSE + return TRUE /datum/surgery_step/omni/revive/tool_check(mob/user, obj/item/tool) . = TRUE diff --git a/code/modules/surgery/omnisurgery/omni_stomachpump.dm b/code/modules/surgery/omnisurgery/omni_stomachpump.dm index 4c428fa643db..5429cf0da905 100644 --- a/code/modules/surgery/omnisurgery/omni_stomachpump.dm +++ b/code/modules/surgery/omnisurgery/omni_stomachpump.dm @@ -1,13 +1,3 @@ -/datum/surgery/omni/stomach_pump/can_start(mob/user, mob/living/carbon/target) - var/obj/item/organ/stomach/S = target.getorganslot(ORGAN_SLOT_STOMACH) - if(target.stat != DEAD) //shamelessly lifted off the revival surgery but we're looking for the same critera here, a dead, non-husked, revivable patient. - return FALSE - if(HAS_TRAIT(target, TRAIT_HUSK)) - return FALSE - if(!S) - return FALSE - return ..() - //Working the stomach by hand in such a way that you induce vomiting. /datum/surgery_step/omni/stomach_pump name = "Pump Stomach" @@ -19,6 +9,17 @@ show = TRUE valid_locations = list(BODY_ZONE_CHEST) +/datum/surgery_step/omni/stomach_pump/test_op(mob/user, mob/living/target, datum/surgery/omni/surgery) + var/obj/item/organ/stomach/S = target.getorganslot(ORGAN_SLOT_STOMACH) + if(target.stat != DEAD) //shamelessly lifted off the revival surgery but we're looking for the same critera here, a dead, non-husked, revivable patient. + return FALSE + if(HAS_TRAIT(target, TRAIT_HUSK)) + return FALSE + if(!S) + return FALSE + return TRUE + + /datum/surgery_step/omni/stomach_pump/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) display_results(user, target, "You begin pumping [target]'s stomach...", "[user] begins to pump [target]'s stomach.", diff --git a/code/modules/surgery/omnisurgery/omnisurgery.dm b/code/modules/surgery/omnisurgery/omnisurgery.dm index ea841d21bfd6..2d319655d4b6 100644 --- a/code/modules/surgery/omnisurgery/omnisurgery.dm +++ b/code/modules/surgery/omnisurgery/omnisurgery.dm @@ -51,8 +51,9 @@ continue if(!(atlayer in S.required_layer)) continue - if(!(S.accept_any_item || S.accept_hand) && !(S.implements.Find(tool.tool_behaviour) || S.implements.Find(tool))) - continue + if(!(S.accept_any_item || S.accept_hand)) + if(!(S.implements.Find(tool.tool_behaviour) || S.implements.Find(tool))) + continue if(!S.test_op(user,target,src)) continue valid_steps[S] = S.radial_icon != null ? S.radial_icon : null From 1c46cf24574fad9a3e569365f4e2332a23406009 Mon Sep 17 00:00:00 2001 From: Len Kagamine Date: Fri, 1 Mar 2024 22:12:29 -0500 Subject: [PATCH 10/35] Make organ manip radial ez pz no testing at all --- code/modules/surgery/omnisurgery/omni_organ_manipulation.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/modules/surgery/omnisurgery/omni_organ_manipulation.dm b/code/modules/surgery/omnisurgery/omni_organ_manipulation.dm index e75fe16b3887..36a5b7111cc0 100644 --- a/code/modules/surgery/omnisurgery/omni_organ_manipulation.dm +++ b/code/modules/surgery/omnisurgery/omni_organ_manipulation.dm @@ -93,9 +93,9 @@ for(var/obj/item/organ/O in organs) O.on_find(user) organs -= O - organs[O.name] = O + organs[O.name] = O.type - manipulated_organ = input("Remove which organ?", "Surgery", null, null) as null|anything in sortList(organs) + manipulated_organ = show_radial_menu(user,target,organs,require_near = TRUE) if(manipulated_organ && user && target && user.Adjacent(target) && user.get_active_held_item() == tool) manipulated_organ = organs[manipulated_organ] if(!manipulated_organ) From 89c38363267128cd27ea12a4f7a26aef34d85fe6 Mon Sep 17 00:00:00 2001 From: Len Kagamine Date: Sat, 2 Mar 2024 14:53:59 -0500 Subject: [PATCH 11/35] Oops Fixes inability to organ. --- code/modules/surgery/omnisurgery/omni_organ_manipulation.dm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/code/modules/surgery/omnisurgery/omni_organ_manipulation.dm b/code/modules/surgery/omnisurgery/omni_organ_manipulation.dm index 36a5b7111cc0..9cc7276e4cd8 100644 --- a/code/modules/surgery/omnisurgery/omni_organ_manipulation.dm +++ b/code/modules/surgery/omnisurgery/omni_organ_manipulation.dm @@ -90,12 +90,14 @@ to_chat(user, "There are no removable organs in [target]'s [parse_zone(target_zone)]!") return -1 else + var/list/toshow = list() for(var/obj/item/organ/O in organs) O.on_find(user) organs -= O - organs[O.name] = O.type + organs[O.name] = O + toshow[O.name] = O.type - manipulated_organ = show_radial_menu(user,target,organs,require_near = TRUE) + manipulated_organ = show_radial_menu(user,target,toshow,require_near = TRUE) if(manipulated_organ && user && target && user.Adjacent(target) && user.get_active_held_item() == tool) manipulated_organ = organs[manipulated_organ] if(!manipulated_organ) From 5d920dcff3b9027c98ee750e9949a9dbb96d350e Mon Sep 17 00:00:00 2001 From: Len Kagamine Date: Sun, 3 Mar 2024 16:01:04 -0500 Subject: [PATCH 12/35] Opti-mas-fix Yeeeeeeeeeee boi --- code/modules/surgery/omnisurgery/omni_movelayer.dm | 3 +-- code/modules/surgery/omnisurgery/omnisurgery.dm | 12 ++++++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/code/modules/surgery/omnisurgery/omni_movelayer.dm b/code/modules/surgery/omnisurgery/omni_movelayer.dm index 6a12dfda099c..d0fff3a94361 100644 --- a/code/modules/surgery/omnisurgery/omni_movelayer.dm +++ b/code/modules/surgery/omnisurgery/omni_movelayer.dm @@ -27,8 +27,7 @@ implements = list( TOOL_CAUTERY = 100, TOOL_WELDER = 40, - /obj/item/gun/energy/laser = 60, - /obj/item = 30) // 30% success with any hot item. //this is fine, and decently reasonable + /obj/item/gun/energy/laser = 60) time = 2.4 SECONDS preop_sound = 'sound/surgery/cautery1.ogg' success_sound = 'sound/surgery/cautery2.ogg' diff --git a/code/modules/surgery/omnisurgery/omnisurgery.dm b/code/modules/surgery/omnisurgery/omnisurgery.dm index 2d319655d4b6..ad3ed1b4d346 100644 --- a/code/modules/surgery/omnisurgery/omnisurgery.dm +++ b/code/modules/surgery/omnisurgery/omnisurgery.dm @@ -47,12 +47,20 @@ for(var/datum/surgery_step/omni/S in all_steps) if(!S.show) continue - if(!S.valid_locations.Find(location)) + if(!(location in S.valid_locations)) continue if(!(atlayer in S.required_layer)) continue if(!(S.accept_any_item || S.accept_hand)) - if(!(S.implements.Find(tool.tool_behaviour) || S.implements.Find(tool))) + var/good = FALSE + for(var/obj in S.implements) + if(istype(tool,obj)) + good = TRUE + break + if((tool.tool_behaviour in S.implements) || (tool in S.implements)) + good = TRUE + break + if (!good) continue if(!S.test_op(user,target,src)) continue From cb3f58a6ee57cde13911ed8e4a7bfee28e8c99f5 Mon Sep 17 00:00:00 2001 From: NinMario64 Date: Tue, 5 Mar 2024 19:40:43 -0500 Subject: [PATCH 13/35] Moves all general chest organ surgeries to layer 4 Also adds two new layers to the movelayer.dmi --- .../surgery/omnisurgery/omni_brain_surgery.dm | 2 +- .../omnisurgery/omni_coronary_bypass.dm | 4 +- .../surgery/omnisurgery/omni_gastrectomy.dm | 2 +- .../surgery/omnisurgery/omni_healing.dm | 9 ++- .../surgery/omnisurgery/omni_hepatectomy.dm | 2 +- .../omnisurgery/omni_implant_removal.dm | 2 +- .../surgery/omnisurgery/omni_lobectomy.dm | 2 +- .../surgery/omnisurgery/omni_movelayer.dm | 67 ++++++++++++++++++- .../omnisurgery/omni_organ_manipulation.dm | 38 ++++++++++- .../omni_remove_embedded_object.dm | 3 +- .../surgery/omnisurgery/omni_stomachpump.dm | 2 +- 11 files changed, 118 insertions(+), 15 deletions(-) diff --git a/code/modules/surgery/omnisurgery/omni_brain_surgery.dm b/code/modules/surgery/omnisurgery/omni_brain_surgery.dm index 6f0037b2697c..948b8b158156 100644 --- a/code/modules/surgery/omnisurgery/omni_brain_surgery.dm +++ b/code/modules/surgery/omnisurgery/omni_brain_surgery.dm @@ -10,7 +10,7 @@ success_sound = 'sound/surgery/hemostat1.ogg' failure_sound = 'sound/surgery/organ2.ogg' experience_given = 0 // per_trauma - required_layer = list(2) + required_layer = list(4) show = TRUE valid_locations = list(BODY_ZONE_HEAD) diff --git a/code/modules/surgery/omnisurgery/omni_coronary_bypass.dm b/code/modules/surgery/omnisurgery/omni_coronary_bypass.dm index 8040a376abd3..05c6774e955d 100644 --- a/code/modules/surgery/omnisurgery/omni_coronary_bypass.dm +++ b/code/modules/surgery/omnisurgery/omni_coronary_bypass.dm @@ -16,7 +16,7 @@ preop_sound = 'sound/surgery/scalpel1.ogg' success_sound = 'sound/surgery/scalpel2.ogg' failure_sound = 'sound/surgery/organ2.ogg' - required_layer = list(2) + required_layer = list(4) show = TRUE valid_locations = list(BODY_ZONE_CHEST) @@ -65,7 +65,7 @@ success_sound = 'sound/surgery/hemostat1.ogg' failure_sound = 'sound/surgery/organ2.ogg' experience_given = MEDICAL_SKILL_ORGAN_FIX - required_layer = list(2) + required_layer = list(4) show = TRUE valid_locations = list(BODY_ZONE_CHEST) diff --git a/code/modules/surgery/omnisurgery/omni_gastrectomy.dm b/code/modules/surgery/omnisurgery/omni_gastrectomy.dm index 758162330ee0..394af46cf3af 100644 --- a/code/modules/surgery/omnisurgery/omni_gastrectomy.dm +++ b/code/modules/surgery/omnisurgery/omni_gastrectomy.dm @@ -9,7 +9,7 @@ /obj/item/shard = 10) time = 52 experience_given = (MEDICAL_SKILL_ORGAN_FIX*0.8) //for consistency across organ surgeries - required_layer = list(2) + required_layer = list(4) show = TRUE valid_locations = list(BODY_ZONE_CHEST) diff --git a/code/modules/surgery/omnisurgery/omni_healing.dm b/code/modules/surgery/omnisurgery/omni_healing.dm index 6cfe8e84d701..f3979f06c845 100644 --- a/code/modules/surgery/omnisurgery/omni_healing.dm +++ b/code/modules/surgery/omnisurgery/omni_healing.dm @@ -8,9 +8,9 @@ time = 2.5 SECONDS success_sound = 'sound/surgery/retractor2.ogg' failure_sound = 'sound/surgery/organ2.ogg' - var/brutehealing = 0 - var/burnhealing = 0 - var/missinghpbonus = 0 //heals an extra point of damager per X missing damage of type (burn damage for burn healing, brute for brute). Smaller Number = More Healing! + var/brutehealing = 5 + var/burnhealing = 5 + var/missinghpbonus = 5 //heals an extra point of damager per X missing damage of type (burn damage for burn healing, brute for brute). Smaller Number = More Healing! show = TRUE required_layer = list(1) radial_icon = /obj/item/kinetic_crusher @@ -95,6 +95,7 @@ name = "tend burn wounds" burnhealing = 5 missinghpbonus = 15 + /datum/surgery_step/omni/heal/burn/upgraded burnhealing = 5 missinghpbonus = 10 @@ -104,12 +105,14 @@ missinghpbonus = 5 */ /********************COMBO STEPS********************/ +/* /datum/surgery_step/omni/heal/combo name = "tend physical wounds" brutehealing = 3 burnhealing = 3 missinghpbonus = 15 time = 10 +*/ /* /datum/surgery_step/omni/heal/combo/upgraded brutehealing = 3 diff --git a/code/modules/surgery/omnisurgery/omni_hepatectomy.dm b/code/modules/surgery/omnisurgery/omni_hepatectomy.dm index 24b2119e1f2d..b309a0ea23cb 100644 --- a/code/modules/surgery/omnisurgery/omni_hepatectomy.dm +++ b/code/modules/surgery/omnisurgery/omni_hepatectomy.dm @@ -10,7 +10,7 @@ time = 52 experience_given = (MEDICAL_SKILL_ORGAN_FIX*0.8) //repeatable so not as much xp valid_locations = list(BODY_ZONE_CHEST) - required_layer = list(2) + required_layer = list(4) show = TRUE /datum/surgery_step/omni/hepatectomy/test_op(mob/user, mob/living/target, datum/surgery/omni/surgery) var/obj/item/organ/liver/L = target.getorganslot(ORGAN_SLOT_LIVER) diff --git a/code/modules/surgery/omnisurgery/omni_implant_removal.dm b/code/modules/surgery/omnisurgery/omni_implant_removal.dm index 413629e5459a..41022ccd5df0 100644 --- a/code/modules/surgery/omnisurgery/omni_implant_removal.dm +++ b/code/modules/surgery/omnisurgery/omni_implant_removal.dm @@ -9,7 +9,7 @@ success_sound = 'sound/surgery/hemostat1.ogg' experience_given = MEDICAL_SKILL_MEDIUM var/obj/item/implant/I = null - required_layer = list(2) + required_layer = list(3) show = TRUE valid_locations = list(BODY_ZONE_CHEST) diff --git a/code/modules/surgery/omnisurgery/omni_lobectomy.dm b/code/modules/surgery/omnisurgery/omni_lobectomy.dm index 9d611142a547..c4a0bc7ac893 100644 --- a/code/modules/surgery/omnisurgery/omni_lobectomy.dm +++ b/code/modules/surgery/omnisurgery/omni_lobectomy.dm @@ -11,7 +11,7 @@ success_sound = 'sound/surgery/organ1.ogg' failure_sound = 'sound/surgery/organ2.ogg' experience_given = MEDICAL_SKILL_ORGAN_FIX - required_layer = list(2) + required_layer = list(4) show = TRUE valid_locations = list(BODY_ZONE_CHEST) diff --git a/code/modules/surgery/omnisurgery/omni_movelayer.dm b/code/modules/surgery/omnisurgery/omni_movelayer.dm index d0fff3a94361..e566ee51cd2d 100644 --- a/code/modules/surgery/omnisurgery/omni_movelayer.dm +++ b/code/modules/surgery/omnisurgery/omni_movelayer.dm @@ -1,3 +1,4 @@ +// [Going Down Layers] /datum/surgery_step/omni/skindown name = "Dermal Incision" implements = list( @@ -11,7 +12,7 @@ return ..() /datum/surgery_step/omni/muscledown - name = "Retract Muscle" + name = "Retract Muscle" //Should cause minor bleeding implements = list( TOOL_RETRACTOR = 100) time = 2.5 SECONDS @@ -22,6 +23,68 @@ surgery.atlayer++ return ..() +/datum/surgery_step/omni/bonedown + name = "Saw Bone" //Should not cause bleeding, but should cause damage + implements = list( + TOOL_SAW = 100) + time = 2.5 SECONDS + show = TRUE + required_layer = list(2) + +/datum/surgery_step/omni/bonedown/success(mob/user, mob/living/target, target_zone, obj/item/tool, datum/surgery/omni/surgery, default_display_results) + surgery.atlayer++ + return ..() + +/datum/surgery_step/omni/membranedown + name = "Pierce Membrane" //Must implement bleeding + implements = list( + TOOL_SCALPEL = 100) + time = 2.5 SECONDS + show = TRUE + required_layer = list(3) + +/datum/surgery_step/omni/membranedown/success(mob/user, mob/living/target, target_zone, obj/item/tool, datum/surgery/omni/surgery, default_display_results) + surgery.atlayer++ + return ..() + +// [Going Up Layers] (All cautery for now for the sake of simplicity, otherwise there'll be lots of radial menus) + +/datum/surgery_step/omni/membraneup + name = "Seal Membrane" + implements = list( + TOOL_CAUTERY = 100) + time = 2.5 SECONDS + show = TRUE + required_layer = list(4) + +/datum/surgery_step/omni/membraneup/success(mob/user, mob/living/target, target_zone, obj/item/tool, datum/surgery/omni/surgery, default_display_results) + surgery.atlayer-- + return ..() + +/datum/surgery_step/omni/boneup + name = "Mend Bone" + implements = list( + TOOL_CAUTERY = 100) + time = 2.5 SECONDS + show = TRUE + required_layer = list(3) + +/datum/surgery_step/omni/boneup/success(mob/user, mob/living/target, target_zone, obj/item/tool, datum/surgery/omni/surgery, default_display_results) + surgery.atlayer-- + return ..() + +/datum/surgery_step/omni/muscleup + name = "Mend Muscle" + implements = list( + TOOL_CAUTERY = 100) + time = 2.5 SECONDS + show = TRUE + required_layer = list(2) + +/datum/surgery_step/omni/muscleup/success(mob/user, mob/living/target, target_zone, obj/item/tool, datum/surgery/omni/surgery, default_display_results) + surgery.atlayer-- + return ..() + /datum/surgery_step/omni/close name = "Finish Surgery" implements = list( @@ -32,7 +95,7 @@ preop_sound = 'sound/surgery/cautery1.ogg' success_sound = 'sound/surgery/cautery2.ogg' show = TRUE - required_layer = list(0,1,2) + required_layer = list(0,1) /datum/surgery_step/omni/close/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) diff --git a/code/modules/surgery/omnisurgery/omni_organ_manipulation.dm b/code/modules/surgery/omnisurgery/omni_organ_manipulation.dm index 9cc7276e4cd8..d7edaca7aec2 100644 --- a/code/modules/surgery/omnisurgery/omni_organ_manipulation.dm +++ b/code/modules/surgery/omnisurgery/omni_organ_manipulation.dm @@ -1,3 +1,34 @@ +//an incision but with greater bleed, and a 90% base success chance +/datum/surgery_step/omni/incise_chest + name = "incise chest" + implements = list( + TOOL_SCALPEL = 90, + /obj/item/kitchen/knife = 40, + /obj/item/shard = 33) + time = 1.6 SECONDS + preop_sound = 'sound/surgery/scalpel1.ogg' + success_sound = 'sound/surgery/scalpel2.ogg' + failure_sound = 'sound/surgery/organ2.ogg' + required_layer = list(4) + show = TRUE + valid_locations = list(BODY_ZONE_CHEST) + +/datum/surgery_step/omni/incise_chest/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) + display_results(user, target, "You begin to make an incision in [target]'s chest...", + "[user] begins to make an incision in [target]'s chest.", + "[user] begins to make an incision in [target]'s chest.") + +/datum/surgery_step/omni/incise_chest/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery, default_display_results = FALSE) + if(ishuman(target)) + var/mob/living/carbon/human/H = target + if (!(NOBLOOD in H.dna.species.species_traits)) + display_results(user, target, "Blood pools around the incision in [H]'s chest.", + "Blood pools around the incision in [H]'s chest.", + "") + H.bleed_rate += 10 + target.apply_damage(15, BRUTE, "[target_zone]") + return ..() + /datum/surgery_step/omni/manipulate_organs time = 6.4 SECONDS name = "manipulate organs" @@ -10,10 +41,15 @@ var/implements_extract = list(TOOL_HEMOSTAT = 100, TOOL_CROWBAR = 55, /obj/item/kitchen/fork = 35) var/current_type var/obj/item/organ/manipulated_organ = null - required_layer = list(2) + required_layer = list(4) show = TRUE valid_locations = list(BODY_ZONE_CHEST) +/datum/surgery_step/omni/manipulate_organs/test_op(mob/user, mob/living/target,datum/surgery/omni/surgery) + if(!istype(surgery.last_step,/datum/surgery_step/omni/incise_chest)) + return FALSE + return TRUE + /datum/surgery_step/omni/manipulate_organs/New() ..() implements = implements + implements_extract diff --git a/code/modules/surgery/omnisurgery/omni_remove_embedded_object.dm b/code/modules/surgery/omnisurgery/omni_remove_embedded_object.dm index 84a9c866c381..ad2287efb3e0 100644 --- a/code/modules/surgery/omnisurgery/omni_remove_embedded_object.dm +++ b/code/modules/surgery/omnisurgery/omni_remove_embedded_object.dm @@ -1,7 +1,8 @@ /datum/surgery_step/omni/remove_object name = "remove embedded objects" + implements = list( + TOOL_HEMOSTAT = 90) time = 32 - accept_hand = 1 experience_given = MEDICAL_SKILL_MEDIUM var/obj/item/bodypart/L = null required_layer = list(2) diff --git a/code/modules/surgery/omnisurgery/omni_stomachpump.dm b/code/modules/surgery/omnisurgery/omni_stomachpump.dm index 5429cf0da905..53fbe09ce68b 100644 --- a/code/modules/surgery/omnisurgery/omni_stomachpump.dm +++ b/code/modules/surgery/omnisurgery/omni_stomachpump.dm @@ -5,7 +5,7 @@ repeatable = TRUE time = 20 experience_given = 0 - required_layer = list(2) + required_layer = list(4) show = TRUE valid_locations = list(BODY_ZONE_CHEST) From 517ed4dcd19e9140bf00a111b94a2eee2ed66c3c Mon Sep 17 00:00:00 2001 From: NinMario64 Date: Tue, 5 Mar 2024 21:16:17 -0500 Subject: [PATCH 14/35] Reverts organ manipulation surgery No longer requires an initial incision step. Can simply be accessed on layer 4 with hemostat. Looks much better. --- .../omnisurgery/omni_organ_manipulation.dm | 36 ------------------- 1 file changed, 36 deletions(-) diff --git a/code/modules/surgery/omnisurgery/omni_organ_manipulation.dm b/code/modules/surgery/omnisurgery/omni_organ_manipulation.dm index d7edaca7aec2..6a87110864f5 100644 --- a/code/modules/surgery/omnisurgery/omni_organ_manipulation.dm +++ b/code/modules/surgery/omnisurgery/omni_organ_manipulation.dm @@ -1,34 +1,3 @@ -//an incision but with greater bleed, and a 90% base success chance -/datum/surgery_step/omni/incise_chest - name = "incise chest" - implements = list( - TOOL_SCALPEL = 90, - /obj/item/kitchen/knife = 40, - /obj/item/shard = 33) - time = 1.6 SECONDS - preop_sound = 'sound/surgery/scalpel1.ogg' - success_sound = 'sound/surgery/scalpel2.ogg' - failure_sound = 'sound/surgery/organ2.ogg' - required_layer = list(4) - show = TRUE - valid_locations = list(BODY_ZONE_CHEST) - -/datum/surgery_step/omni/incise_chest/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) - display_results(user, target, "You begin to make an incision in [target]'s chest...", - "[user] begins to make an incision in [target]'s chest.", - "[user] begins to make an incision in [target]'s chest.") - -/datum/surgery_step/omni/incise_chest/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery, default_display_results = FALSE) - if(ishuman(target)) - var/mob/living/carbon/human/H = target - if (!(NOBLOOD in H.dna.species.species_traits)) - display_results(user, target, "Blood pools around the incision in [H]'s chest.", - "Blood pools around the incision in [H]'s chest.", - "") - H.bleed_rate += 10 - target.apply_damage(15, BRUTE, "[target_zone]") - return ..() - /datum/surgery_step/omni/manipulate_organs time = 6.4 SECONDS name = "manipulate organs" @@ -45,11 +14,6 @@ show = TRUE valid_locations = list(BODY_ZONE_CHEST) -/datum/surgery_step/omni/manipulate_organs/test_op(mob/user, mob/living/target,datum/surgery/omni/surgery) - if(!istype(surgery.last_step,/datum/surgery_step/omni/incise_chest)) - return FALSE - return TRUE - /datum/surgery_step/omni/manipulate_organs/New() ..() implements = implements + implements_extract From 731beb59d810643d9af792225c8d05c62d4e409f Mon Sep 17 00:00:00 2001 From: NinMario64 Date: Tue, 5 Mar 2024 21:51:42 -0500 Subject: [PATCH 15/35] Adds sounds to all movelayer surgeries Also disables implant removal temporarily to allow for hemostat to be used as a movelayer tool without redundancies. --- .../omnisurgery/omni_implant_removal.dm | 9 ++++---- .../surgery/omnisurgery/omni_movelayer.dm | 22 +++++++++++++++---- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/code/modules/surgery/omnisurgery/omni_implant_removal.dm b/code/modules/surgery/omnisurgery/omni_implant_removal.dm index 41022ccd5df0..0954339aff31 100644 --- a/code/modules/surgery/omnisurgery/omni_implant_removal.dm +++ b/code/modules/surgery/omnisurgery/omni_implant_removal.dm @@ -1,10 +1,11 @@ -//extract implant +//extract implant (CREATE A TOOL SPECIFICALLY TO DO THIS PLEASE or just add in forceps [when you sprite it]) /datum/surgery_step/omni/extract_implant name = "extract implant" implements = list( - TOOL_HEMOSTAT = 100, - TOOL_CROWBAR = 40, - /obj/item/kitchen/fork = 33) + //TOOL_HEMOSTAT = 100, + //TOOL_CROWBAR = 40, + ///obj/item/kitchen/fork = 33 + ) time = 6.4 SECONDS success_sound = 'sound/surgery/hemostat1.ogg' experience_given = MEDICAL_SKILL_MEDIUM diff --git a/code/modules/surgery/omnisurgery/omni_movelayer.dm b/code/modules/surgery/omnisurgery/omni_movelayer.dm index e566ee51cd2d..14ff15c4a842 100644 --- a/code/modules/surgery/omnisurgery/omni_movelayer.dm +++ b/code/modules/surgery/omnisurgery/omni_movelayer.dm @@ -3,6 +3,8 @@ name = "Dermal Incision" implements = list( TOOL_SCALPEL = 100) + preop_sound = 'sound/surgery/scalpel1.ogg' + success_sound = 'sound/surgery/scalpel2.ogg' time = 2.5 SECONDS show = TRUE required_layer = list(0) @@ -15,7 +17,9 @@ name = "Retract Muscle" //Should cause minor bleeding implements = list( TOOL_RETRACTOR = 100) - time = 2.5 SECONDS + time = 3.5 SECONDS + preop_sound = 'sound/surgery/retractor1.ogg' + success_sound = 'sound/surgery/retractor2.ogg' show = TRUE required_layer = list(1) @@ -27,7 +31,9 @@ name = "Saw Bone" //Should not cause bleeding, but should cause damage implements = list( TOOL_SAW = 100) - time = 2.5 SECONDS + time = 10 SECONDS + preop_sound = 'sound/surgery/saw.ogg' + success_sound = 'sound/surgery/bone3.ogg' show = TRUE required_layer = list(2) @@ -40,6 +46,8 @@ implements = list( TOOL_SCALPEL = 100) time = 2.5 SECONDS + preop_sound = 'sound/surgery/scalpel1.ogg' + success_sound = 'sound/surgery/scalpel2.ogg' show = TRUE required_layer = list(3) @@ -54,6 +62,8 @@ implements = list( TOOL_CAUTERY = 100) time = 2.5 SECONDS + preop_sound = 'sound/surgery/cautery1.ogg' + success_sound = 'sound/surgery/retractor2.ogg' show = TRUE required_layer = list(4) @@ -64,8 +74,10 @@ /datum/surgery_step/omni/boneup name = "Mend Bone" implements = list( - TOOL_CAUTERY = 100) + TOOL_HEMOSTAT = 100) time = 2.5 SECONDS + preop_sound = 'sound/surgery/cautery1.ogg' + success_sound = 'sound/surgery/bone3.ogg' show = TRUE required_layer = list(3) @@ -78,6 +90,8 @@ implements = list( TOOL_CAUTERY = 100) time = 2.5 SECONDS + preop_sound = 'sound/surgery/cautery1.ogg' + success_sound = 'sound/surgery/retractor2.ogg' show = TRUE required_layer = list(2) @@ -91,7 +105,7 @@ TOOL_CAUTERY = 100, TOOL_WELDER = 40, /obj/item/gun/energy/laser = 60) - time = 2.4 SECONDS + time = 2.5 SECONDS preop_sound = 'sound/surgery/cautery1.ogg' success_sound = 'sound/surgery/cautery2.ogg' show = TRUE From 327f2622351c2ea4621892f8599df1986f1e6dab Mon Sep 17 00:00:00 2001 From: NinMario64 Date: Wed, 6 Mar 2024 00:06:46 -0500 Subject: [PATCH 16/35] Bleed removed upon exiting omnisurgery (Temporary Debug) --- code/modules/surgery/omnisurgery/omni_movelayer.dm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/modules/surgery/omnisurgery/omni_movelayer.dm b/code/modules/surgery/omnisurgery/omni_movelayer.dm index 14ff15c4a842..7f1ab99809dc 100644 --- a/code/modules/surgery/omnisurgery/omni_movelayer.dm +++ b/code/modules/surgery/omnisurgery/omni_movelayer.dm @@ -126,6 +126,7 @@ /datum/surgery_step/omni/close/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery, default_display_results) if (ishuman(target)) var/mob/living/carbon/human/H = target - H.bleed_rate = max((H.bleed_rate - 3), 0) + //H.bleed_rate = max((H.bleed_rate - 3), 0) Disabling for test purposes + H.bleed_rate = 0 //Setting this to 0 until Clamp Bleeders gets figured out surgery.complete() return ..() From 26bb5c5ec74ddfcec41780b6c485d75e3a4ecd7c Mon Sep 17 00:00:00 2001 From: Len Kagamine Date: Wed, 6 Mar 2024 17:28:14 -0500 Subject: [PATCH 17/35] De-mystify omnisurgery steps It compiles did not test hope it worksws --- .../surgery/omnisurgery/omnisurgery.dm | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/code/modules/surgery/omnisurgery/omnisurgery.dm b/code/modules/surgery/omnisurgery/omnisurgery.dm index ad3ed1b4d346..9c95e5a0ed68 100644 --- a/code/modules/surgery/omnisurgery/omnisurgery.dm +++ b/code/modules/surgery/omnisurgery/omnisurgery.dm @@ -19,16 +19,16 @@ if(intent == INTENT_DISARM) try_to_fail = TRUE var/obj/item/tool = user.get_active_held_item() - var/list/L = get_surgery_step(tool,user,target) - if(L) + var/list/possible_steps = get_surgery_step(tool,user,target) + if(possible_steps) var/datum/surgery_step/omni/S = null - if(L.len == 1) - var/datum/surgery_step/omni/val = L[1] + if(possible_steps.len == 1) + var/datum/surgery_step/omni/val = possible_steps[1] S = new val.type else - var/P = show_radial_menu(user,target,L,require_near = TRUE) + var/P = show_radial_menu(user,target,possible_steps,require_near = TRUE) if(P && user && user.Adjacent(target) && (tool in user)) - var/datum/surgery_step/omni/T = locate(P) in L // Why tf does L[P] not work here. + var/datum/surgery_step/omni/T = locate(P) in possible_steps // Why tf does L[P] not work here. for(var/datum/surgery/other in target.surgeries) if(other == src) continue @@ -44,27 +44,27 @@ /datum/surgery/omni/get_surgery_step(obj/item/tool,mob/user,mob/living/target) var/list/all_steps = GLOB.omnisurgerysteps_list.Copy() var/list/valid_steps = list() - for(var/datum/surgery_step/omni/S in all_steps) - if(!S.show) + for(var/datum/surgery_step/omni/Step in all_steps) + if(!Step.show) continue - if(!(location in S.valid_locations)) + if(!(location in Step.valid_locations)) continue - if(!(atlayer in S.required_layer)) + if(!(atlayer in Step.required_layer)) continue - if(!(S.accept_any_item || S.accept_hand)) + if(!(Step.accept_any_item || Step.accept_hand)) var/good = FALSE - for(var/obj in S.implements) + for(var/obj in Step.implements) if(istype(tool,obj)) good = TRUE break - if((tool.tool_behaviour in S.implements) || (tool in S.implements)) + if((tool.tool_behaviour in Step.implements) || (tool in Step.implements)) good = TRUE break if (!good) continue - if(!S.test_op(user,target,src)) + if(!Step.test_op(user,target,src)) continue - valid_steps[S] = S.radial_icon != null ? S.radial_icon : null + valid_steps[Step] = Step.radial_icon != null ? Step.radial_icon : null return valid_steps /datum/surgery/omni/get_surgery_next_step() From 40f7973a6f2df3b70de0cee61f36f0e287a057c6 Mon Sep 17 00:00:00 2001 From: NinMario64 Date: Fri, 8 Mar 2024 16:58:08 -0500 Subject: [PATCH 18/35] Tend Wounds adjustment until it gets a rework --- code/modules/surgery/omnisurgery/omni_healing.dm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/code/modules/surgery/omnisurgery/omni_healing.dm b/code/modules/surgery/omnisurgery/omni_healing.dm index f3979f06c845..418a0a76f884 100644 --- a/code/modules/surgery/omnisurgery/omni_healing.dm +++ b/code/modules/surgery/omnisurgery/omni_healing.dm @@ -1,6 +1,6 @@ #define PER_ITERATION_XP_CAP MEDICAL_SKILL_MEDIUM //TW XP gain scales with repeated iterations so we cap it. /datum/surgery_step/omni/heal - name = "repair body" + name = "Tend Wounds" implements = list( TOOL_HEMOSTAT = 100, TOOL_SCREWDRIVER = 40)//something else could be added here - but I would prefer not. Hemostat is not that hard to come by and SHOULD be standard for ship equipment. @@ -8,9 +8,9 @@ time = 2.5 SECONDS success_sound = 'sound/surgery/retractor2.ogg' failure_sound = 'sound/surgery/organ2.ogg' - var/brutehealing = 5 - var/burnhealing = 5 - var/missinghpbonus = 5 //heals an extra point of damager per X missing damage of type (burn damage for burn healing, brute for brute). Smaller Number = More Healing! + var/brutehealing = 3 + var/burnhealing = 3 + var/missinghpbonus = 15 //heals an extra point of damager per X missing damage of type (burn damage for burn healing, brute for brute). Smaller Number = More Healing! show = TRUE required_layer = list(1) radial_icon = /obj/item/kinetic_crusher @@ -75,6 +75,7 @@ target.take_bodypart_damage(urdamageamt_brute, urdamageamt_burn) return FALSE + /********************BRUTE STEPS********************/ /* /datum/surgery_step/omni/heal/brute/basic From b0b71ffad38d15cbda9b3149b965bce28d36842d Mon Sep 17 00:00:00 2001 From: NinMario64 Date: Fri, 8 Mar 2024 17:09:19 -0500 Subject: [PATCH 19/35] Comments out Improved Wound Tending research and its upgrades Makes Advanced Surgery now only require Biotech as well to make up for this adjustment until R&D is successfully nuked from orbit --- code/modules/research/techweb/all_nodes.dm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/code/modules/research/techweb/all_nodes.dm b/code/modules/research/techweb/all_nodes.dm index 28de68605681..7f80cbe4f98b 100644 --- a/code/modules/research/techweb/all_nodes.dm +++ b/code/modules/research/techweb/all_nodes.dm @@ -124,7 +124,7 @@ export_price = 5000 /////////////////////////Advanced Surgery///////////////////////// -/datum/techweb_node/imp_wt_surgery +/* /datum/techweb_node/imp_wt_surgery id = "imp_wt_surgery" display_name = "Improved Wound-Tending Surgery" description = "Who would have known being more gentle with a hemostat decreases patient pain?" @@ -132,14 +132,14 @@ design_ids = list("surgery_heal_brute_upgrade","surgery_heal_burn_upgrade") research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 1000) export_price = 1000 - +*/ /datum/techweb_node/adv_surgery id = "adv_surgery" display_name = "Advanced Surgery" description = "When simple medicine doesn't cut it." - prereq_ids = list("imp_wt_surgery") - design_ids = list("surgery_lobotomy", "surgery_heal_brute_upgrade_femto", "surgery_heal_burn_upgrade_femto","surgery_heal_combo","surgery_adv_dissection") + prereq_ids = list("biotech") + design_ids = list("surgery_lobotomy"/*, "surgery_heal_brute_upgrade_femto", "surgery_heal_burn_upgrade_femto","surgery_heal_combo"*/,"surgery_adv_dissection") research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 1500) export_price = 4000 @@ -148,7 +148,7 @@ display_name = "Experimental Surgery" description = "When evolution isn't fast enough." prereq_ids = list("adv_surgery") - design_ids = list("surgery_pacify","surgery_vein_thread","surgery_muscled_veins","surgery_nerve_splice","surgery_nerve_ground","surgery_ligament_hook","surgery_ligament_reinforcement","surgery_viral_bond", "surgery_heal_combo_upgrade", "surgery_exp_dissection", "surgery_cortex_imprint","surgery_cortex_folding") + design_ids = list("surgery_pacify","surgery_vein_thread","surgery_muscled_veins","surgery_nerve_splice","surgery_nerve_ground","surgery_ligament_hook","surgery_ligament_reinforcement","surgery_viral_bond", /*"surgery_heal_combo_upgrade",*/ "surgery_exp_dissection", "surgery_cortex_imprint","surgery_cortex_folding") research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 5000) export_price = 5000 @@ -157,7 +157,7 @@ display_name = "Alien Surgery" description = "Abductors did nothing wrong." prereq_ids = list("exp_surgery", "alientech") - design_ids = list("surgery_brainwashing","surgery_zombie","surgery_heal_combo_upgrade_femto", "surgery_ext_dissection") + design_ids = list("surgery_brainwashing","surgery_zombie"/*,"surgery_heal_combo_upgrade_femto"*/, "surgery_ext_dissection") research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 10000) export_price = 5000 From 34aae5eca6d698dfecb004f8ae271ae14f9b2043 Mon Sep 17 00:00:00 2001 From: NinMario64 Date: Fri, 8 Mar 2024 20:48:12 -0500 Subject: [PATCH 20/35] Removes Advanced and Experimental Surgeries (can i get my contributor role yet) I'm now officially a c*der. - Removes Advanced and Experimental surgeries as a means of reducing bloat. Not many people use these, and a lot of these surgeries should be done with other systems. Less means more in the longrun, especially if we want to move away from TG code. - Makes omnisurgery much easier to complete given we no longer have to worry about researchstuff for omnisurgery and whatnot. - Give a LOT more room to add new content that fits Shiptest's main theme - Removes brainwash uplink objective from uplink (not like we're using that anyway) - Comments out medical research disks from ruin loot --- .../research/designs/medical_designs.dm | 148 ------------------ code/modules/research/techweb/all_nodes.dm | 25 +-- .../ruins/spaceruin_code/forgottenship.dm | 5 +- .../surgery/advanced/bioware/bioware.dm | 35 ----- .../advanced/bioware/bioware_surgery.dm | 14 -- .../advanced/bioware/cortex_folding.dm | 61 -------- .../advanced/bioware/cortex_imprint.dm | 58 ------- .../surgery/advanced/bioware/ligament_hook.dm | 46 ------ .../bioware/ligament_reinforcement.dm | 46 ------ .../surgery/advanced/bioware/muscled_veins.dm | 43 ----- .../advanced/bioware/nerve_grounding.dm | 43 ----- .../advanced/bioware/nerve_splicing.dm | 43 ----- .../advanced/bioware/vein_threading.dm | 43 ----- code/modules/surgery/advanced/brainwashing.dm | 75 --------- code/modules/surgery/advanced/lobotomy.dm | 89 ----------- .../surgery/advanced/necrotic_revival.dm | 41 ----- code/modules/surgery/advanced/pacification.dm | 50 ------ .../modules/surgery/advanced/viral_bonding.dm | 49 ------ code/modules/uplink/uplink_items.dm | 8 - shiptest.dme | 15 -- 20 files changed, 6 insertions(+), 931 deletions(-) delete mode 100644 code/modules/surgery/advanced/bioware/bioware.dm delete mode 100644 code/modules/surgery/advanced/bioware/bioware_surgery.dm delete mode 100644 code/modules/surgery/advanced/bioware/cortex_folding.dm delete mode 100644 code/modules/surgery/advanced/bioware/cortex_imprint.dm delete mode 100644 code/modules/surgery/advanced/bioware/ligament_hook.dm delete mode 100644 code/modules/surgery/advanced/bioware/ligament_reinforcement.dm delete mode 100644 code/modules/surgery/advanced/bioware/muscled_veins.dm delete mode 100644 code/modules/surgery/advanced/bioware/nerve_grounding.dm delete mode 100644 code/modules/surgery/advanced/bioware/nerve_splicing.dm delete mode 100644 code/modules/surgery/advanced/bioware/vein_threading.dm delete mode 100644 code/modules/surgery/advanced/brainwashing.dm delete mode 100644 code/modules/surgery/advanced/lobotomy.dm delete mode 100644 code/modules/surgery/advanced/necrotic_revival.dm delete mode 100644 code/modules/surgery/advanced/pacification.dm delete mode 100644 code/modules/surgery/advanced/viral_bonding.dm diff --git a/code/modules/research/designs/medical_designs.dm b/code/modules/research/designs/medical_designs.dm index 6e4a1b61d06f..dea6d8b3b35b 100644 --- a/code/modules/research/designs/medical_designs.dm +++ b/code/modules/research/designs/medical_designs.dm @@ -649,157 +649,9 @@ surgery = /datum/surgery/advanced/experimental_dissection/alien departmental_flags = DEPARTMENTAL_FLAG_MEDICAL -/datum/design/surgery/lobotomy - name = "Lobotomy" - desc = "An invasive surgical procedure which guarantees removal of almost all brain traumas, but might cause another permanent trauma in return." - id = "surgery_lobotomy" - surgery = /datum/surgery/advanced/lobotomy - research_icon_state = "surgery_head" - departmental_flags = DEPARTMENTAL_FLAG_MEDICAL - -/datum/design/surgery/pacify - name = "Pacification" - desc = "A surgical procedure which permanently inhibits the aggression center of the brain, making the patient unwilling to cause direct harm." - id = "surgery_pacify" - surgery = /datum/surgery/advanced/pacify - research_icon_state = "surgery_head" - departmental_flags = DEPARTMENTAL_FLAG_MEDICAL - -/datum/design/surgery/viral_bonding - name = "Viral Bonding" - desc = "A surgical procedure that forces a symbiotic relationship between a virus and its host. The patient must be dosed with spaceacillin, virus food, and formaldehyde." - id = "surgery_viral_bond" - surgery = /datum/surgery/advanced/viral_bonding - research_icon_state = "surgery_chest" - departmental_flags = DEPARTMENTAL_FLAG_MEDICAL - /datum/design/surgery/healing //PLEASE ACCOUNT FOR UNIQUE HEALING BRANCHES IN THE hptech HREF (currently 2 for Brute/Burn; Combo is bonus) name = "Tend Wounds" desc = "An upgraded version of the original surgery." id = "surgery_healing_base" //holder because CI cries otherwise. Not used in techweb unlocks. research_icon_state = "surgery_chest" departmental_flags = DEPARTMENTAL_FLAG_MEDICAL - -/datum/design/surgery/healing/brute_upgrade - name = "Tend Wounds (Brute) Upgrade" - surgery = /datum/surgery/healing/brute/upgraded - id = "surgery_heal_brute_upgrade" - -/datum/design/surgery/healing/brute_upgrade_2 - name = "Tend Wounds (Brute) Upgrade" - surgery = /datum/surgery/healing/brute/upgraded/femto - id = "surgery_heal_brute_upgrade_femto" - departmental_flags = DEPARTMENTAL_FLAG_MEDICAL - -/datum/design/surgery/healing/burn_upgrade - name = "Tend Wounds (Burn) Upgrade" - surgery = /datum/surgery/healing/burn/upgraded - id = "surgery_heal_burn_upgrade" - departmental_flags = DEPARTMENTAL_FLAG_MEDICAL - -/datum/design/surgery/healing/burn_upgrade_2 - name = "Tend Wounds (Burn) Upgrade" - surgery = /datum/surgery/healing/burn/upgraded/femto - id = "surgery_heal_burn_upgrade_femto" - departmental_flags = DEPARTMENTAL_FLAG_MEDICAL - -/datum/design/surgery/healing/combo - name = "Tend Wounds (Physical)" - desc = "A surgical procedure that repairs both bruises and burns. Repair efficiency is not as high as the individual surgeries but it is faster." - surgery = /datum/surgery/healing/combo - id = "surgery_heal_combo" - departmental_flags = DEPARTMENTAL_FLAG_MEDICAL - -/datum/design/surgery/healing/combo_upgrade - name = "Tend Wounds (Physical) Upgrade" - surgery = /datum/surgery/healing/combo/upgraded - id = "surgery_heal_combo_upgrade" - departmental_flags = DEPARTMENTAL_FLAG_MEDICAL - -/datum/design/surgery/healing/combo_upgrade_2 - name = "Tend Wounds (Physical) Upgrade" - desc = "A surgical procedure that repairs both bruises and burns faster than their individual counterparts. It is more effective than both the individual surgeries." - surgery = /datum/surgery/healing/combo/upgraded/femto - id = "surgery_heal_combo_upgrade_femto" - departmental_flags = DEPARTMENTAL_FLAG_MEDICAL - -/datum/design/surgery/brainwashing - name = "Brainwashing" - desc = "A surgical procedure which directly implants a directive into the patient's brain, making it their absolute priority. It can be cleared using a mindshield implant." - id = "surgery_brainwashing" - surgery = /datum/surgery/advanced/brainwashing - research_icon_state = "surgery_head" - departmental_flags = DEPARTMENTAL_FLAG_MEDICAL - -/datum/design/surgery/nerve_splicing - name = "Nerve Splicing" - desc = "A surgical procedure which splices the patient's nerves, making them more resistant to stuns." - id = "surgery_nerve_splice" - surgery = /datum/surgery/advanced/bioware/nerve_splicing - research_icon_state = "surgery_chest" - departmental_flags = DEPARTMENTAL_FLAG_MEDICAL - -/datum/design/surgery/nerve_grounding - name = "Nerve Grounding" - desc = "A surgical procedure which makes the patient's nerves act as grounding rods, protecting them from electrical shocks." - id = "surgery_nerve_ground" - surgery = /datum/surgery/advanced/bioware/nerve_grounding - research_icon_state = "surgery_chest" - departmental_flags = DEPARTMENTAL_FLAG_MEDICAL - -/datum/design/surgery/vein_threading - name = "Vein Threading" - desc = "A surgical procedure which severely reduces the amount of blood lost in case of injury." - id = "surgery_vein_thread" - surgery = /datum/surgery/advanced/bioware/vein_threading - research_icon_state = "surgery_chest" - departmental_flags = DEPARTMENTAL_FLAG_MEDICAL - -/datum/design/surgery/muscled_veins - name = "Vein Muscle Membrane" - desc = "A surgical procedure which adds a muscled membrane to blood vessels, allowing them to pump blood without a heart." - id = "surgery_muscled_veins" - surgery = /datum/surgery/advanced/bioware/muscled_veins - research_icon_state = "surgery_chest" - departmental_flags = DEPARTMENTAL_FLAG_MEDICAL - -/datum/design/surgery/ligament_hook - name = "Ligament Hook" - desc = "A surgical procedure which reshapes the connections between torso and limbs, making it so limbs can be attached manually if severed. \ - However this weakens the connection, making them easier to detach as well." - id = "surgery_ligament_hook" - surgery = /datum/surgery/advanced/bioware/ligament_hook - research_icon_state = "surgery_chest" - departmental_flags = DEPARTMENTAL_FLAG_MEDICAL - -/datum/design/surgery/ligament_reinforcement - name = "Ligament Reinforcement" - desc = "A surgical procedure which adds a protective tissue and bone cage around the connections between the torso and limbs, preventing dismemberment. \ - However, the nerve connections as a result are more easily interrupted, making it easier to disable limbs with damage." - id = "surgery_ligament_reinforcement" - surgery = /datum/surgery/advanced/bioware/ligament_reinforcement - research_icon_state = "surgery_chest" - departmental_flags = DEPARTMENTAL_FLAG_MEDICAL - -/datum/design/surgery/cortex_imprint - name = "Cortex Imprint" - desc = "A surgical procedure which modifies the cerebral cortex into a redundant neural pattern, making the brain able to bypass damage caused by minor brain traumas." - id = "surgery_cortex_imprint" - surgery = /datum/surgery/advanced/bioware/cortex_imprint - research_icon_state = "surgery_head" - -/datum/design/surgery/cortex_folding - name = "Cortex Folding" - desc = "A surgical procedure which modifies the cerebral cortex into a complex fold, giving space to non-standard neural patterns." - id = "surgery_cortex_folding" - surgery = /datum/surgery/advanced/bioware/cortex_folding - research_icon_state = "surgery_head" - departmental_flags = DEPARTMENTAL_FLAG_MEDICAL - -/datum/design/surgery/necrotic_revival - name = "Necrotic Revival" - desc = "An experimental surgical procedure that stimulates the growth of a Romerol tumor inside the patient's brain. Requires zombie powder or rezadone." - id = "surgery_zombie" - surgery = /datum/surgery/advanced/necrotic_revival - research_icon_state = "surgery_head" - departmental_flags = DEPARTMENTAL_FLAG_MEDICAL diff --git a/code/modules/research/techweb/all_nodes.dm b/code/modules/research/techweb/all_nodes.dm index 7f80cbe4f98b..4a87b65ed1ce 100644 --- a/code/modules/research/techweb/all_nodes.dm +++ b/code/modules/research/techweb/all_nodes.dm @@ -124,40 +124,21 @@ export_price = 5000 /////////////////////////Advanced Surgery///////////////////////// -/* /datum/techweb_node/imp_wt_surgery - id = "imp_wt_surgery" - display_name = "Improved Wound-Tending Surgery" - description = "Who would have known being more gentle with a hemostat decreases patient pain?" - prereq_ids = list("biotech") - design_ids = list("surgery_heal_brute_upgrade","surgery_heal_burn_upgrade") - research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 1000) - export_price = 1000 -*/ - /datum/techweb_node/adv_surgery id = "adv_surgery" display_name = "Advanced Surgery" description = "When simple medicine doesn't cut it." prereq_ids = list("biotech") - design_ids = list("surgery_lobotomy"/*, "surgery_heal_brute_upgrade_femto", "surgery_heal_burn_upgrade_femto","surgery_heal_combo"*/,"surgery_adv_dissection") + design_ids = list("surgery_adv_dissection") research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 1500) export_price = 4000 -/datum/techweb_node/exp_surgery - id = "exp_surgery" - display_name = "Experimental Surgery" - description = "When evolution isn't fast enough." - prereq_ids = list("adv_surgery") - design_ids = list("surgery_pacify","surgery_vein_thread","surgery_muscled_veins","surgery_nerve_splice","surgery_nerve_ground","surgery_ligament_hook","surgery_ligament_reinforcement","surgery_viral_bond", /*"surgery_heal_combo_upgrade",*/ "surgery_exp_dissection", "surgery_cortex_imprint","surgery_cortex_folding") - research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 5000) - export_price = 5000 - /datum/techweb_node/alien_surgery id = "alien_surgery" display_name = "Alien Surgery" description = "Abductors did nothing wrong." - prereq_ids = list("exp_surgery", "alientech") - design_ids = list("surgery_brainwashing","surgery_zombie"/*,"surgery_heal_combo_upgrade_femto"*/, "surgery_ext_dissection") + prereq_ids = list("alientech") + design_ids = list("surgery_ext_dissection") research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 10000) export_price = 5000 diff --git a/code/modules/ruins/spaceruin_code/forgottenship.dm b/code/modules/ruins/spaceruin_code/forgottenship.dm index 8e3ae585d73d..cc8da89fb120 100644 --- a/code/modules/ruins/spaceruin_code/forgottenship.dm +++ b/code/modules/ruins/spaceruin_code/forgottenship.dm @@ -33,10 +33,11 @@ GLOBAL_VAR_INIT(fscpassword, generate_password()) default_raw_text = "Greetings, operatives. You are assigned to SCSBC-12(Syndicate Cyber Sun Battle Cruiser 12) to protect our high-ranking officer while he is on his way to next outpost. While you are travelling, he is the captain of this ship and you must obey his orders.

Remember, disobeying high-ranking officer orders is a reason for termination." /////////// forgottenship items -/obj/item/disk/surgery/forgottenship +/*/obj/item/disk/surgery/forgottenship name = "Advanced Surgery Disk" desc = "A disk that contains advanced surgery procedures, must be loaded into an Operating Console." - surgeries = list(/datum/surgery/advanced/lobotomy, /datum/surgery/advanced/bioware/vein_threading, /datum/surgery/advanced/bioware/nerve_splicing) + surgeries = list(/datum/surgery/advanced/lobotomy, /datum/surgery/advanced/bioware/vein_threading, /datum/surgery/advanced/bioware/nerve_splicing) */ + // Might use this later honestly; leaving it commented because I'm unsure /obj/structure/fluff/empty_sleeper/syndicate/captain icon_state = "sleeper_s-open" diff --git a/code/modules/surgery/advanced/bioware/bioware.dm b/code/modules/surgery/advanced/bioware/bioware.dm deleted file mode 100644 index badf7e91d344..000000000000 --- a/code/modules/surgery/advanced/bioware/bioware.dm +++ /dev/null @@ -1,35 +0,0 @@ -//Bioware -//Body modifications applied through surgery. They generally affect physiology. - -/datum/bioware - var/name = "Generic Bioware" - var/mob/living/carbon/human/owner - var/desc = "If you see this something's wrong, warn a coder." - var/active = FALSE - var/can_process = FALSE - var/mod_type = BIOWARE_GENERIC - -/datum/bioware/New(mob/living/carbon/human/_owner) - owner = _owner - for(var/X in owner.bioware) - var/datum/bioware/B = X - if(B.mod_type == mod_type) - qdel(src) - return - owner.bioware += src - on_gain() - -/datum/bioware/Destroy() - owner = null - if(active) - on_lose() - return ..() - -/datum/bioware/proc/on_gain() - active = TRUE - if(can_process) - START_PROCESSING(SSobj, src) - -/datum/bioware/proc/on_lose() - STOP_PROCESSING(SSobj, src) - return diff --git a/code/modules/surgery/advanced/bioware/bioware_surgery.dm b/code/modules/surgery/advanced/bioware/bioware_surgery.dm deleted file mode 100644 index 74834345e69c..000000000000 --- a/code/modules/surgery/advanced/bioware/bioware_surgery.dm +++ /dev/null @@ -1,14 +0,0 @@ -/datum/surgery/advanced/bioware - name = "Enhancement surgery" - var/bioware_target = BIOWARE_GENERIC - -/datum/surgery/advanced/bioware/can_start(mob/user, mob/living/carbon/human/target) - if(!..()) - return FALSE - if(!istype(target)) - return FALSE - for(var/X in target.bioware) - var/datum/bioware/B = X - if(B.mod_type == bioware_target) - return FALSE - return TRUE diff --git a/code/modules/surgery/advanced/bioware/cortex_folding.dm b/code/modules/surgery/advanced/bioware/cortex_folding.dm deleted file mode 100644 index ecced370484f..000000000000 --- a/code/modules/surgery/advanced/bioware/cortex_folding.dm +++ /dev/null @@ -1,61 +0,0 @@ -/datum/surgery/advanced/bioware/cortex_folding - name = "Cortex Folding" - desc = "A surgical procedure which modifies the cerebral cortex into a complex fold, giving space to non-standard neural patterns." - steps = list(/datum/surgery_step/incise, - /datum/surgery_step/retract_skin, - /datum/surgery_step/clamp_bleeders, - /datum/surgery_step/incise, - /datum/surgery_step/incise, - /datum/surgery_step/fold_cortex, - /datum/surgery_step/close) - possible_locs = list(BODY_ZONE_HEAD) - target_mobtypes = list(/mob/living/carbon/human, /mob/living/carbon/monkey) - bioware_target = BIOWARE_LIGAMENTS - -/datum/surgery/advanced/bioware/cortex_folding/can_start(mob/user, mob/living/carbon/target) - var/obj/item/organ/brain/B = target.getorganslot(ORGAN_SLOT_BRAIN) - if(!B) - return FALSE - return ..() - -/datum/surgery_step/fold_cortex - name = "fold cortex" - accept_hand = TRUE - time = 125 - experience_given = MEDICAL_SKILL_ADVANCED - -/datum/surgery_step/fold_cortex/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) - display_results(user, target, "You start folding [target]'s outer cerebral cortex into a fractal pattern.", - "[user] starts folding [target]'s outer cerebral cortex into a fractal pattern.", - "[user] begins to perform surgery on [target]'s brain.") - -/datum/surgery_step/fold_cortex/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery, default_display_results = FALSE) - display_results(user, target, "You fold [target]'s outer cerebral cortex into a fractal pattern!", - "[user] folds [target]'s outer cerebral cortex into a fractal pattern!", - "[user] completes the surgery on [target]'s brain.") - new /datum/bioware/cortex_fold(target) - return ..() - -/datum/surgery_step/fold_cortex/failure(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) - if(target.getorganslot(ORGAN_SLOT_BRAIN)) - display_results(user, target, "You screw up, damaging the brain!", - "[user] screws up, damaging the brain!", - "[user] completes the surgery on [target]'s brain.") - target.adjustOrganLoss(ORGAN_SLOT_BRAIN, 60) - target.gain_trauma_type(BRAIN_TRAUMA_SEVERE, TRAUMA_RESILIENCE_LOBOTOMY) - else - user.visible_message("[user] suddenly notices that the brain [user.p_they()] [user.p_were()] working on is not there anymore.", "You suddenly notice that the brain you were working on is not there anymore.") - return FALSE - -/datum/bioware/cortex_fold - name = "Cortex Fold" - desc = "The cerebral cortex has been folded into a complex fractal pattern, and can support non-standard neural patterns." - mod_type = BIOWARE_CORTEX - -/datum/bioware/cortex_fold/on_gain() - . = ..() - ADD_TRAIT(owner, TRAIT_SPECIAL_TRAUMA_BOOST, "cortex_fold") - -/datum/bioware/cortex_fold/on_lose() - REMOVE_TRAIT(owner, TRAIT_SPECIAL_TRAUMA_BOOST, "cortex_fold") - return ..() diff --git a/code/modules/surgery/advanced/bioware/cortex_imprint.dm b/code/modules/surgery/advanced/bioware/cortex_imprint.dm deleted file mode 100644 index 951fd800ac55..000000000000 --- a/code/modules/surgery/advanced/bioware/cortex_imprint.dm +++ /dev/null @@ -1,58 +0,0 @@ -/datum/surgery/advanced/bioware/cortex_imprint - name = "Cortex Imprint" - desc = "A surgical procedure which modifies the cerebral cortex into a redundant neural pattern, making the brain able to bypass damage caused by minor brain traumas." - steps = list(/datum/surgery_step/incise, - /datum/surgery_step/retract_skin, - /datum/surgery_step/clamp_bleeders, - /datum/surgery_step/incise, - /datum/surgery_step/incise, - /datum/surgery_step/imprint_cortex, - /datum/surgery_step/close) - possible_locs = list(BODY_ZONE_HEAD) - target_mobtypes = list(/mob/living/carbon/human, /mob/living/carbon/monkey) - bioware_target = BIOWARE_LIGAMENTS - -/datum/surgery/advanced/bioware/cortex_imprint/can_start(mob/user, mob/living/carbon/target) - var/obj/item/organ/brain/B = target.getorganslot(ORGAN_SLOT_BRAIN) - if(!B) - return FALSE - return ..() - -/datum/surgery_step/imprint_cortex - name = "imprint cortex" - accept_hand = TRUE - time = 125 - experience_given = MEDICAL_SKILL_ADVANCED - -/datum/surgery_step/imprint_cortex/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) - display_results(user, target, "You start carving [target]'s outer cerebral cortex into a self-imprinting pattern.", - "[user] starts carving [target]'s outer cerebral cortex into a self-imprinting pattern.", - "[user] begins to perform surgery on [target]'s brain.") - -/datum/surgery_step/imprint_cortex/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery, default_display_results = FALSE) - display_results(user, target, "You reshape [target]'s outer cerebral cortex into a self-imprinting pattern!", - "[user] reshapes [target]'s outer cerebral cortex into a self-imprinting pattern!", - "[user] completes the surgery on [target]'s brain.") - new /datum/bioware/cortex_imprint(target) - return ..() - -/datum/surgery_step/imprint_cortex/failure(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) - if(target.getorganslot(ORGAN_SLOT_BRAIN)) - display_results(user, target, "You screw up, damaging the brain!", - "[user] screws up, damaging the brain!", - "[user] completes the surgery on [target]'s brain.") - target.adjustOrganLoss(ORGAN_SLOT_BRAIN, 60) - target.gain_trauma_type(BRAIN_TRAUMA_SEVERE, TRAUMA_RESILIENCE_LOBOTOMY) - else - user.visible_message("[user] suddenly notices that the brain [user.p_they()] [user.p_were()] working on is not there anymore.", "You suddenly notice that the brain you were working on is not there anymore.") - return FALSE - -/datum/bioware/cortex_imprint - name = "Cortex Imprint" - desc = "The cerebral cortex has been reshaped into a redundant neural pattern, making the brain able to bypass damage caused by minor brain traumas." - mod_type = BIOWARE_CORTEX - can_process = TRUE - -/datum/bioware/cortex_imprint/process() - owner.cure_trauma_type(resilience = TRAUMA_RESILIENCE_BASIC) - diff --git a/code/modules/surgery/advanced/bioware/ligament_hook.dm b/code/modules/surgery/advanced/bioware/ligament_hook.dm deleted file mode 100644 index 244ec6ef6306..000000000000 --- a/code/modules/surgery/advanced/bioware/ligament_hook.dm +++ /dev/null @@ -1,46 +0,0 @@ -/datum/surgery/advanced/bioware/ligament_hook - name = "Ligament Hook" - desc = "A surgical procedure which reshapes the connections between torso and limbs, making it so limbs can be attached manually if severed. \ - However this weakens the connection, making them easier to detach as well." - steps = list(/datum/surgery_step/incise, - /datum/surgery_step/retract_skin, - /datum/surgery_step/clamp_bleeders, - /datum/surgery_step/incise, - /datum/surgery_step/incise, - /datum/surgery_step/reshape_ligaments, - /datum/surgery_step/close) - possible_locs = list(BODY_ZONE_CHEST) - bioware_target = BIOWARE_LIGAMENTS - -/datum/surgery_step/reshape_ligaments - name = "reshape ligaments" - accept_hand = TRUE - time = 125 - experience_given = MEDICAL_SKILL_ADVANCED - -/datum/surgery_step/reshape_ligaments/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) - display_results(user, target, "You start reshaping [target]'s ligaments into a hook-like shape.", - "[user] starts reshaping [target]'s ligaments into a hook-like shape.", - "[user] starts manipulating [target]'s ligaments.") - -/datum/surgery_step/reshape_ligaments/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery, default_display_results = FALSE) - display_results(user, target, "You reshape [target]'s ligaments into a connective hook!", - "[user] reshapes [target]'s ligaments into a connective hook!", - "[user] finishes manipulating [target]'s ligaments.") - new /datum/bioware/hooked_ligaments(target) - return ..() - -/datum/bioware/hooked_ligaments - name = "Hooked Ligaments" - desc = "The ligaments and nerve endings that connect the torso to the limbs are formed into a hook-like shape, so limbs can be attached without requiring surgery, but are easier to sever." - mod_type = BIOWARE_LIGAMENTS - -/datum/bioware/hooked_ligaments/on_gain() - ..() - ADD_TRAIT(owner, TRAIT_LIMBATTACHMENT, "ligament_hook") - ADD_TRAIT(owner, TRAIT_EASYDISMEMBER, "ligament_hook") - -/datum/bioware/hooked_ligaments/on_lose() - ..() - REMOVE_TRAIT(owner, TRAIT_LIMBATTACHMENT, "ligament_hook") - REMOVE_TRAIT(owner, TRAIT_EASYDISMEMBER, "ligament_hook") diff --git a/code/modules/surgery/advanced/bioware/ligament_reinforcement.dm b/code/modules/surgery/advanced/bioware/ligament_reinforcement.dm deleted file mode 100644 index 624306009b9e..000000000000 --- a/code/modules/surgery/advanced/bioware/ligament_reinforcement.dm +++ /dev/null @@ -1,46 +0,0 @@ -/datum/surgery/advanced/bioware/ligament_reinforcement - name = "Ligament Reinforcement" - desc = "A surgical procedure which adds a protective tissue and bone cage around the connections between the torso and limbs, preventing dismemberment. \ - However, the nerve connections as a result are more easily interrupted, making it easier to disable limbs with damage." - steps = list(/datum/surgery_step/incise, - /datum/surgery_step/retract_skin, - /datum/surgery_step/clamp_bleeders, - /datum/surgery_step/incise, - /datum/surgery_step/incise, - /datum/surgery_step/reinforce_ligaments, - /datum/surgery_step/close) - possible_locs = list(BODY_ZONE_CHEST) - bioware_target = BIOWARE_LIGAMENTS - -/datum/surgery_step/reinforce_ligaments - name = "reinforce ligaments" - accept_hand = TRUE - time = 125 - experience_given = MEDICAL_SKILL_ADVANCED - -/datum/surgery_step/reinforce_ligaments/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) - display_results(user, target, "You start reinforcing [target]'s ligaments.", - "[user] starts reinforce [target]'s ligaments.", - "[user] starts manipulating [target]'s ligaments.") - -/datum/surgery_step/reinforce_ligaments/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery, default_display_results = FALSE) - display_results(user, target, "You reinforce [target]'s ligaments!", - "[user] reinforces [target]'s ligaments!", - "[user] finishes manipulating [target]'s ligaments.") - new /datum/bioware/reinforced_ligaments(target) - return ..() - -/datum/bioware/reinforced_ligaments - name = "Reinforced Ligaments" - desc = "The ligaments and nerve endings that connect the torso to the limbs are protected by a mix of bone and tissues, and are much harder to separate from the body, but are also easier to disable." - mod_type = BIOWARE_LIGAMENTS - -/datum/bioware/reinforced_ligaments/on_gain() - ..() - ADD_TRAIT(owner, TRAIT_NODISMEMBER, "reinforced_ligaments") - ADD_TRAIT(owner, TRAIT_EASYLIMBDISABLE, "reinforced_ligaments") - -/datum/bioware/reinforced_ligaments/on_lose() - ..() - REMOVE_TRAIT(owner, TRAIT_NODISMEMBER, "reinforced_ligaments") - REMOVE_TRAIT(owner, TRAIT_EASYLIMBDISABLE, "reinforced_ligaments") diff --git a/code/modules/surgery/advanced/bioware/muscled_veins.dm b/code/modules/surgery/advanced/bioware/muscled_veins.dm deleted file mode 100644 index 63f624d81f5d..000000000000 --- a/code/modules/surgery/advanced/bioware/muscled_veins.dm +++ /dev/null @@ -1,43 +0,0 @@ -/datum/surgery/advanced/bioware/muscled_veins - name = "Vein Muscle Membrane" - desc = "A surgical procedure which adds a muscled membrane to blood vessels, allowing them to pump blood without a heart." - steps = list(/datum/surgery_step/incise, - /datum/surgery_step/retract_skin, - /datum/surgery_step/clamp_bleeders, - /datum/surgery_step/incise, - /datum/surgery_step/incise, - /datum/surgery_step/muscled_veins, - /datum/surgery_step/close) - possible_locs = list(BODY_ZONE_CHEST) - bioware_target = BIOWARE_CIRCULATION - -/datum/surgery_step/muscled_veins - name = "shape vein muscles" - accept_hand = TRUE - time = 125 - experience_given = MEDICAL_SKILL_ADVANCED - -/datum/surgery_step/muscled_veins/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) - display_results(user, target, "You start wrapping muscles around [target]'s circulatory system.", - "[user] starts wrapping muscles around [target]'s circulatory system.", - "[user] starts manipulating [target]'s circulatory system.") - -/datum/surgery_step/muscled_veins/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery, default_display_results = FALSE) - display_results(user, target, "You reshape [target]'s circulatory system, adding a muscled membrane!", - "[user] reshapes [target]'s circulatory system, adding a muscled membrane!", - "[user] finishes manipulating [target]'s circulatory system.") - new /datum/bioware/muscled_veins(target) - return ..() - -/datum/bioware/muscled_veins - name = "Threaded Veins" - desc = "The circulatory system is woven into a mesh, severely reducing the amount of blood lost from wounds." - mod_type = BIOWARE_CIRCULATION - -/datum/bioware/muscled_veins/on_gain() - ..() - ADD_TRAIT(owner, TRAIT_STABLEHEART, "muscled_veins") - -/datum/bioware/muscled_veins/on_lose() - ..() - REMOVE_TRAIT(owner, TRAIT_STABLEHEART, "muscled_veins") diff --git a/code/modules/surgery/advanced/bioware/nerve_grounding.dm b/code/modules/surgery/advanced/bioware/nerve_grounding.dm deleted file mode 100644 index a624422af0c3..000000000000 --- a/code/modules/surgery/advanced/bioware/nerve_grounding.dm +++ /dev/null @@ -1,43 +0,0 @@ -/datum/surgery/advanced/bioware/nerve_grounding - name = "Nerve Grounding" - desc = "A surgical procedure which makes the patient's nerves act as grounding rods, protecting them from electrical shocks." - steps = list(/datum/surgery_step/incise, - /datum/surgery_step/retract_skin, - /datum/surgery_step/clamp_bleeders, - /datum/surgery_step/incise, - /datum/surgery_step/incise, - /datum/surgery_step/ground_nerves, - /datum/surgery_step/close) - possible_locs = list(BODY_ZONE_CHEST) - bioware_target = BIOWARE_NERVES - -/datum/surgery_step/ground_nerves - name = "ground nerves" - accept_hand = TRUE - time = 155 - experience_given = MEDICAL_SKILL_ADVANCED - -/datum/surgery_step/ground_nerves/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) - display_results(user, target, "You start rerouting [target]'s nerves.", - "[user] starts rerouting [target]'s nerves.", - "[user] starts manipulating [target]'s nervous system.") - -/datum/surgery_step/ground_nerves/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery, default_display_results = FALSE) - display_results(user, target, "You successfully reroute [target]'s nervous system!", - "[user] successfully reroutes [target]'s nervous system!", - "[user] finishes manipulating [target]'s nervous system.") - new /datum/bioware/grounded_nerves(target) - return ..() - -/datum/bioware/grounded_nerves - name = "Grounded Nerves" - desc = "Nerves form a safe path for electricity to traverse, protecting the body from electric shocks." - mod_type = BIOWARE_NERVES - -/datum/bioware/grounded_nerves/on_gain() - ..() - ADD_TRAIT(owner, TRAIT_SHOCKIMMUNE, "grounded_nerves") - -/datum/bioware/grounded_nerves/on_lose() - ..() - REMOVE_TRAIT(owner, TRAIT_SHOCKIMMUNE, "grounded_nerves") diff --git a/code/modules/surgery/advanced/bioware/nerve_splicing.dm b/code/modules/surgery/advanced/bioware/nerve_splicing.dm deleted file mode 100644 index f50d45dab67a..000000000000 --- a/code/modules/surgery/advanced/bioware/nerve_splicing.dm +++ /dev/null @@ -1,43 +0,0 @@ -/datum/surgery/advanced/bioware/nerve_splicing - name = "Nerve Splicing" - desc = "A surgical procedure which splices the patient's nerves, making them more resistant to stuns." - steps = list(/datum/surgery_step/incise, - /datum/surgery_step/retract_skin, - /datum/surgery_step/clamp_bleeders, - /datum/surgery_step/incise, - /datum/surgery_step/incise, - /datum/surgery_step/splice_nerves, - /datum/surgery_step/close) - possible_locs = list(BODY_ZONE_CHEST) - bioware_target = BIOWARE_NERVES - -/datum/surgery_step/splice_nerves - name = "splice nerves" - accept_hand = TRUE - time = 155 - experience_given = MEDICAL_SKILL_ADVANCED - -/datum/surgery_step/splice_nerves/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) - display_results(user, target, "You start splicing together [target]'s nerves.", - "[user] starts splicing together [target]'s nerves.", - "[user] starts manipulating [target]'s nervous system.") - -/datum/surgery_step/splice_nerves/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery, default_display_results = FALSE) - display_results(user, target, "You successfully splice [target]'s nervous system!", - "[user] successfully splices [target]'s nervous system!", - "[user] finishes manipulating [target]'s nervous system.") - new /datum/bioware/spliced_nerves(target) - return ..() - -/datum/bioware/spliced_nerves - name = "Spliced Nerves" - desc = "Nerves are connected to each other multiple times, greatly reducing the impact of stunning effects." - mod_type = BIOWARE_NERVES - -/datum/bioware/spliced_nerves/on_gain() - ..() - owner.physiology.stun_mod *= 0.5 - -/datum/bioware/spliced_nerves/on_lose() - ..() - owner.physiology.stun_mod *= 2 diff --git a/code/modules/surgery/advanced/bioware/vein_threading.dm b/code/modules/surgery/advanced/bioware/vein_threading.dm deleted file mode 100644 index cf3fe0633a8b..000000000000 --- a/code/modules/surgery/advanced/bioware/vein_threading.dm +++ /dev/null @@ -1,43 +0,0 @@ -/datum/surgery/advanced/bioware/vein_threading - name = "Vein Threading" - desc = "A surgical procedure which severely reduces the amount of blood lost in case of injury." - steps = list(/datum/surgery_step/incise, - /datum/surgery_step/retract_skin, - /datum/surgery_step/clamp_bleeders, - /datum/surgery_step/incise, - /datum/surgery_step/incise, - /datum/surgery_step/thread_veins, - /datum/surgery_step/close) - possible_locs = list(BODY_ZONE_CHEST) - bioware_target = BIOWARE_CIRCULATION - -/datum/surgery_step/thread_veins - name = "thread veins" - accept_hand = TRUE - time = 125 - experience_given = MEDICAL_SKILL_ADVANCED - -/datum/surgery_step/thread_veins/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) - display_results(user, target, "You start weaving [target]'s circulatory system.", - "[user] starts weaving [target]'s circulatory system.", - "[user] starts manipulating [target]'s circulatory system.") - -/datum/surgery_step/thread_veins/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery, default_display_results = FALSE) - display_results(user, target, "You weave [target]'s circulatory system into a resistant mesh!", - "[user] weaves [target]'s circulatory system into a resistant mesh!", - "[user] finishes manipulating [target]'s circulatory system.") - new /datum/bioware/threaded_veins(target) - return ..() - -/datum/bioware/threaded_veins - name = "Threaded Veins" - desc = "The circulatory system is woven into a mesh, severely reducing the amount of blood lost from wounds." - mod_type = BIOWARE_CIRCULATION - -/datum/bioware/threaded_veins/on_gain() - ..() - owner.physiology.bleed_mod *= 0.25 - -/datum/bioware/threaded_veins/on_lose() - ..() - owner.physiology.bleed_mod *= 4 diff --git a/code/modules/surgery/advanced/brainwashing.dm b/code/modules/surgery/advanced/brainwashing.dm deleted file mode 100644 index a2ff0f588506..000000000000 --- a/code/modules/surgery/advanced/brainwashing.dm +++ /dev/null @@ -1,75 +0,0 @@ -/obj/item/disk/surgery/brainwashing - name = "Brainwashing Surgery Disk" - desc = "The disk provides instructions on how to impress an order on a brain, making it the primary objective of the patient." - surgeries = list(/datum/surgery/advanced/brainwashing) - -/datum/surgery/advanced/brainwashing - name = "Brainwashing" - desc = "A surgical procedure which directly implants a directive into the patient's brain, making it their absolute priority. It can be cleared using a mindshield implant." - steps = list( - /datum/surgery_step/incise, - /datum/surgery_step/retract_skin, - /datum/surgery_step/saw, - /datum/surgery_step/clamp_bleeders, - /datum/surgery_step/brainwash, - /datum/surgery_step/close) - - target_mobtypes = list(/mob/living/carbon/human) - possible_locs = list(BODY_ZONE_HEAD) - -/datum/surgery/advanced/brainwashing/can_start(mob/user, mob/living/carbon/target) - if(!..()) - return FALSE - var/obj/item/organ/brain/B = target.getorganslot(ORGAN_SLOT_BRAIN) - if(!B) - return FALSE - return TRUE - -/datum/surgery_step/brainwash - name = "brainwash" - implements = list( - TOOL_HEMOSTAT = 85, - /obj/item/soap = 60, //haha. brainwashing. get it? - TOOL_WIRECUTTER = 30, - /obj/item/stack/packageWrap = 20, - /obj/item/stack/cable_coil = 10) - time = 20 SECONDS - preop_sound = 'sound/surgery/hemostat1.ogg' - success_sound = 'sound/surgery/hemostat1.ogg' - failure_sound = 'sound/surgery/organ2.ogg' - experience_given = MEDICAL_SKILL_ADVANCED - var/objective - -/datum/surgery_step/brainwash/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) - objective = stripped_input(user, "Choose the objective to imprint on your victim's brain.", "Brainwashing", null, MAX_MESSAGE_LEN) - if(!objective) - return -1 - display_results(user, target, "You begin to brainwash [target]...", - "[user] begins to fix [target]'s brain.", - "[user] begins to perform surgery on [target]'s brain.") - -/datum/surgery_step/brainwash/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery, default_display_results = FALSE) - if(!target.mind) - to_chat(user, "[target] doesn't respond to the brainwashing, as if [target.p_they()] lacked a mind...") - return FALSE - if(HAS_TRAIT(target, TRAIT_MINDSHIELD)) - to_chat(user, "You hear a faint buzzing from a device inside [target]'s brain, and the brainwashing is erased.") - return FALSE - display_results(user, target, "You succeed in brainwashing [target].", - "[user] successfully fixes [target]'s brain!", - "[user] completes the surgery on [target]'s brain.") - to_chat(target, "A new compulsion fills your mind... you feel forced to obey it!") - brainwash(target, objective) - message_admins("[ADMIN_LOOKUPFLW(user)] surgically brainwashed [ADMIN_LOOKUPFLW(target)] with the objective '[objective]'.") - log_game("[key_name(user)] surgically brainwashed [key_name(target)] with the objective '[objective]'.") - return ..() - -/datum/surgery_step/brainwash/failure(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) - if(target.getorganslot(ORGAN_SLOT_BRAIN)) - display_results(user, target, "You screw up, bruising the brain tissue!", - "[user] screws up, causing brain damage!", - "[user] completes the surgery on [target]'s brain.") - target.adjustOrganLoss(ORGAN_SLOT_BRAIN, 40) - else - user.visible_message("[user] suddenly notices that the brain [user.p_they()] [user.p_were()] working on is not there anymore.", "You suddenly notice that the brain you were working on is not there anymore.") - return FALSE diff --git a/code/modules/surgery/advanced/lobotomy.dm b/code/modules/surgery/advanced/lobotomy.dm deleted file mode 100644 index d1c882f96620..000000000000 --- a/code/modules/surgery/advanced/lobotomy.dm +++ /dev/null @@ -1,89 +0,0 @@ -/datum/surgery/advanced/lobotomy - name = "Lobotomy" - desc = "An invasive surgical procedure which guarantees removal of almost all brain traumas, but might cause another permanent trauma in return." - steps = list( - /datum/surgery_step/incise, - /datum/surgery_step/retract_skin, - /datum/surgery_step/saw, - /datum/surgery_step/clamp_bleeders, - /datum/surgery_step/lobotomize, - /datum/surgery_step/close) - - target_mobtypes = list(/mob/living/carbon/human, /mob/living/carbon/monkey) - possible_locs = list(BODY_ZONE_HEAD) - requires_bodypart_type = 0 - -/datum/surgery/advanced/lobotomy/can_start(mob/user, mob/living/carbon/target) - if(!..()) - return FALSE - var/obj/item/organ/brain/B = target.getorganslot(ORGAN_SLOT_BRAIN) - if(!B) - return FALSE - return TRUE - -/datum/surgery_step/lobotomize - name = "perform lobotomy" - implements = list( - TOOL_SCALPEL = 85, // there is no way this should be reasonable to do basically at all without a real surgery. ghetto lobotomy, for real? - /obj/item/melee/transforming/energy/sword = 25, - /obj/item/kitchen/knife = 15, - /obj/item/shard = 10, - /obj/item = 5) - time = 10 SECONDS - preop_sound = 'sound/surgery/scalpel1.ogg' - success_sound = 'sound/surgery/scalpel2.ogg' - failure_sound = 'sound/surgery/organ2.ogg' - experience_given = MEDICAL_SKILL_ADVANCED //lose XP if you end up giving them bad traumas - -/datum/surgery_step/lobotomize/tool_check(mob/user, obj/item/tool) - if(implement_type == /obj/item && !tool.get_sharpness()) - return FALSE - return TRUE - -/datum/surgery_step/lobotomize/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) - display_results(user, target, "You begin to perform a lobotomy on [target]'s brain...", - "[user] begins to perform a lobotomy on [target]'s brain.", - "[user] begins to perform surgery on [target]'s brain.") - -/datum/surgery_step/lobotomize/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery, default_display_results = FALSE) - display_results(user, target, "You succeed in lobotomizing [target].", - "[user] successfully lobotomizes [target]!", - "[user] completes the surgery on [target]'s brain.") - target.cure_all_traumas(TRAUMA_RESILIENCE_LOBOTOMY) - if(target.mind && target.mind.has_antag_datum(/datum/antagonist/brainwashed)) - target.mind.remove_antag_datum(/datum/antagonist/brainwashed) - switch(rand(1,3))//Now let's see what hopefully-not-important part of the brain we cut off - if(1) - target.gain_trauma_type(BRAIN_TRAUMA_MILD, TRAUMA_RESILIENCE_MAGIC) - experience_given = MEDICAL_SKILL_ADVANCED*0.9 - if(2) - if(HAS_TRAIT(target, TRAIT_SPECIAL_TRAUMA_BOOST) && prob(50)) - target.gain_trauma_type(BRAIN_TRAUMA_SPECIAL, TRAUMA_RESILIENCE_MAGIC) - else - target.gain_trauma_type(BRAIN_TRAUMA_SEVERE, TRAUMA_RESILIENCE_MAGIC) - experience_given = MEDICAL_SKILL_ADVANCED*0.8 - if(3) - target.gain_trauma_type(BRAIN_TRAUMA_SPECIAL, TRAUMA_RESILIENCE_MAGIC) - experience_given = MEDICAL_SKILL_ADVANCED*0.5 - return ..() - -/datum/surgery_step/lobotomize/failure(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) - var/obj/item/organ/brain/B = target.getorganslot(ORGAN_SLOT_BRAIN) - if(B) - display_results(user, target, "You remove the wrong part, causing more damage!", - "[user] successfully lobotomizes [target]!", - "[user] completes the surgery on [target]'s brain.") - B.applyOrganDamage(80) - switch(rand(1,3)) - if(1) - target.gain_trauma_type(BRAIN_TRAUMA_MILD, TRAUMA_RESILIENCE_MAGIC) - if(2) - if(HAS_TRAIT(target, TRAIT_SPECIAL_TRAUMA_BOOST) && prob(50)) - target.gain_trauma_type(BRAIN_TRAUMA_SPECIAL, TRAUMA_RESILIENCE_MAGIC) - else - target.gain_trauma_type(BRAIN_TRAUMA_SEVERE, TRAUMA_RESILIENCE_MAGIC) - if(3) - target.gain_trauma_type(BRAIN_TRAUMA_SPECIAL, TRAUMA_RESILIENCE_MAGIC) - else - user.visible_message("[user] suddenly notices that the brain [user.p_they()] [user.p_were()] working on is not there anymore.", "You suddenly notice that the brain you were working on is not there anymore.") - return FALSE diff --git a/code/modules/surgery/advanced/necrotic_revival.dm b/code/modules/surgery/advanced/necrotic_revival.dm deleted file mode 100644 index 8018b0f910b2..000000000000 --- a/code/modules/surgery/advanced/necrotic_revival.dm +++ /dev/null @@ -1,41 +0,0 @@ -/datum/surgery/advanced/necrotic_revival - name = "Necrotic Revival" - desc = "An experimental surgical procedure that stimulates the growth of a Romerol tumor inside the patient's brain. Requires zombie powder or rezadone." - steps = list(/datum/surgery_step/incise, - /datum/surgery_step/retract_skin, - /datum/surgery_step/saw, - /datum/surgery_step/clamp_bleeders, - /datum/surgery_step/bionecrosis, - /datum/surgery_step/close) - - possible_locs = list(BODY_ZONE_HEAD) - -/datum/surgery/advanced/necrotic_revival/can_start(mob/user, mob/living/carbon/target) - . = ..() - var/obj/item/organ/zombie_infection/ZI = target.getorganslot(ORGAN_SLOT_ZOMBIE) - if(ZI) - return FALSE - -/datum/surgery_step/bionecrosis - name = "start bionecrosis" - implements = list( - /obj/item/reagent_containers/syringe = 100, - /obj/item/pen = 30) - time = 50 - chems_needed = list(/datum/reagent/toxin/zombiepowder, /datum/reagent/medicine/rezadone) - require_all_chems = FALSE - experience_given = MEDICAL_SKILL_ADVANCED - -/datum/surgery_step/bionecrosis/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) - display_results(user, target, "You begin to grow a romerol tumor on [target]'s brain...", - "[user] begins to tinker with [target]'s brain...", - "[user] begins to perform surgery on [target]'s brain.") - -/datum/surgery_step/bionecrosis/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery, default_display_results = FALSE) - display_results(user, target, "You succeed in growing a romerol tumor on [target]'s brain.", - "[user] successfully grows a romerol tumor on [target]'s brain!", - "[user] completes the surgery on [target]'s brain.") - if(!target.getorganslot(ORGAN_SLOT_ZOMBIE)) - var/obj/item/organ/zombie_infection/ZI = new() - ZI.Insert(target) - return ..() diff --git a/code/modules/surgery/advanced/pacification.dm b/code/modules/surgery/advanced/pacification.dm deleted file mode 100644 index c276faa2de7a..000000000000 --- a/code/modules/surgery/advanced/pacification.dm +++ /dev/null @@ -1,50 +0,0 @@ -/datum/surgery/advanced/pacify - name = "Pacification" - desc = "A surgical procedure which permanently inhibits the aggression center of the brain, making the patient unwilling to cause direct harm." - steps = list(/datum/surgery_step/incise, - /datum/surgery_step/retract_skin, - /datum/surgery_step/saw, - /datum/surgery_step/clamp_bleeders, - /datum/surgery_step/pacify, - /datum/surgery_step/close) - - target_mobtypes = list(/mob/living/carbon/human, /mob/living/carbon/monkey) - possible_locs = list(BODY_ZONE_HEAD) - requires_bodypart_type = 0 - -/datum/surgery/advanced/pacify/can_start(mob/user, mob/living/carbon/target) - . = ..() - var/obj/item/organ/brain/B = target.getorganslot(ORGAN_SLOT_BRAIN) - if(!B) - return FALSE - -/datum/surgery_step/pacify - name = "rewire brain" - implements = list( - TOOL_HEMOSTAT = 100, - TOOL_SCREWDRIVER = 15, //brain surgery with a screwdriver. Ouch! - /obj/item/pen = 5) - time = 4 SECONDS - preop_sound = 'sound/surgery/hemostat1.ogg' - success_sound = 'sound/surgery/hemostat1.ogg' - failure_sound = 'sound/surgery/organ2.ogg' - experience_given = MEDICAL_SKILL_ADVANCED - -/datum/surgery_step/pacify/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) - display_results(user, target, "You begin to pacify [target]...", - "[user] begins to fix [target]'s brain.", - "[user] begins to perform surgery on [target]'s brain.") - -/datum/surgery_step/pacify/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery, default_display_results = FALSE) - display_results(user, target, "You succeed in neurologically pacifying [target].", - "[user] successfully fixes [target]'s brain!", - "[user] completes the surgery on [target]'s brain.") - target.gain_trauma(/datum/brain_trauma/severe/pacifism, TRAUMA_RESILIENCE_LOBOTOMY) - return ..() - -/datum/surgery_step/pacify/failure(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) - display_results(user, target, "You screw up, rewiring [target]'s brain the wrong way around...", - "[user] screws up, causing brain damage!", - "[user] completes the surgery on [target]'s brain.") - target.gain_trauma_type(BRAIN_TRAUMA_SEVERE, TRAUMA_RESILIENCE_LOBOTOMY) - return FALSE diff --git a/code/modules/surgery/advanced/viral_bonding.dm b/code/modules/surgery/advanced/viral_bonding.dm deleted file mode 100644 index 889d894e3d88..000000000000 --- a/code/modules/surgery/advanced/viral_bonding.dm +++ /dev/null @@ -1,49 +0,0 @@ -/datum/surgery/advanced/viral_bonding - name = "Viral Bonding" - desc = "A surgical procedure that forces a symbiotic relationship between a virus and its host. The patient must be dosed with spaceacillin, virus food, and formaldehyde." - steps = list(/datum/surgery_step/incise, - /datum/surgery_step/retract_skin, - /datum/surgery_step/clamp_bleeders, - /datum/surgery_step/incise, - /datum/surgery_step/viral_bond, - /datum/surgery_step/close) - - target_mobtypes = list(/mob/living/carbon/human, /mob/living/carbon/monkey) - possible_locs = list(BODY_ZONE_CHEST) - -/datum/surgery/advanced/viral_bonding/can_start(mob/user, mob/living/carbon/target) - if(!..()) - return FALSE - if(!LAZYLEN(target.diseases)) - return FALSE - return TRUE - -/datum/surgery_step/viral_bond - name = "viral bond" - implements = list( - TOOL_CAUTERY = 100, - TOOL_WELDER = 40, - /obj/item = 20) // 30% success with any hot item. - time = 100 - chems_needed = list(/datum/reagent/medicine/spaceacillin,/datum/reagent/consumable/virus_food,/datum/reagent/toxin/formaldehyde) - experience_given = MEDICAL_SKILL_ADVANCED - -/datum/surgery_step/viral_bond/tool_check(mob/user, obj/item/tool) - if(implement_type == TOOL_WELDER || implement_type == /obj/item) - return tool.get_temperature() - - return TRUE - -/datum/surgery_step/viral_bond/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) - display_results(user, target, "You start heating [target]'s bone marrow with [tool]...", - "[user] starts heating [target]'s bone marrow with [tool]...", - "[user] starts heating something in [target]'s chest with [tool]...") - -/datum/surgery_step/viral_bond/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery, default_display_results) - display_results(user, target, "[target]'s bone marrow begins pulsing slowly. The viral bonding is complete.", - "[target]'s bone marrow begins pulsing slowly.", - "[user] finishes the operation.") - for(var/X in target.diseases) - var/datum/disease/D = X - D.carrier = TRUE - return TRUE diff --git a/code/modules/uplink/uplink_items.dm b/code/modules/uplink/uplink_items.dm index 48c79382444e..5c7f96669861 100644 --- a/code/modules/uplink/uplink_items.dm +++ b/code/modules/uplink/uplink_items.dm @@ -1804,14 +1804,6 @@ GLOBAL_LIST_INIT(uplink_items, subtypesof(/datum/uplink_item)) cost = 6 restricted_roles = list("Geneticist", "Chief Medical Officer") -/datum/uplink_item/role_restricted/brainwash_disk - name = "Brainwashing Surgery Program" - desc = "A disk containing the procedure to perform a brainwashing surgery, allowing you to implant an objective onto a target. \ - Insert into an Operating Console to enable the procedure." - item = /obj/item/disk/surgery/brainwashing - restricted_roles = list("Medical Doctor", "Chief Medical Officer", "Roboticist") - cost = 5 - /datum/uplink_item/role_restricted/clown_bomb name = "Clown Bomb" desc = "The Clown bomb is a hilarious device capable of massive pranks. It has an adjustable timer, \ diff --git a/shiptest.dme b/shiptest.dme index cab801ea7fe4..bde3aeeb3d45 100644 --- a/shiptest.dme +++ b/shiptest.dme @@ -3346,21 +3346,6 @@ #include "code\modules\surgery\surgery_helpers.dm" #include "code\modules\surgery\surgery_step.dm" #include "code\modules\surgery\tools.dm" -#include "code\modules\surgery\advanced\brainwashing.dm" -#include "code\modules\surgery\advanced\lobotomy.dm" -#include "code\modules\surgery\advanced\necrotic_revival.dm" -#include "code\modules\surgery\advanced\pacification.dm" -#include "code\modules\surgery\advanced\viral_bonding.dm" -#include "code\modules\surgery\advanced\bioware\bioware.dm" -#include "code\modules\surgery\advanced\bioware\bioware_surgery.dm" -#include "code\modules\surgery\advanced\bioware\cortex_folding.dm" -#include "code\modules\surgery\advanced\bioware\cortex_imprint.dm" -#include "code\modules\surgery\advanced\bioware\ligament_hook.dm" -#include "code\modules\surgery\advanced\bioware\ligament_reinforcement.dm" -#include "code\modules\surgery\advanced\bioware\muscled_veins.dm" -#include "code\modules\surgery\advanced\bioware\nerve_grounding.dm" -#include "code\modules\surgery\advanced\bioware\nerve_splicing.dm" -#include "code\modules\surgery\advanced\bioware\vein_threading.dm" #include "code\modules\surgery\bodyparts\bodyparts.dm" #include "code\modules\surgery\bodyparts\dismemberment.dm" #include "code\modules\surgery\bodyparts\head.dm" From 8cc3d3af009e8bc17b60f33b823d08ba25886641 Mon Sep 17 00:00:00 2001 From: NinMario64 Date: Fri, 8 Mar 2024 21:28:10 -0500 Subject: [PATCH 21/35] when she mixes my till i [PLEASE STICK TO TAB INDENTATION] --- code/modules/ruins/spaceruin_code/forgottenship.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/modules/ruins/spaceruin_code/forgottenship.dm b/code/modules/ruins/spaceruin_code/forgottenship.dm index cc8da89fb120..2fe19a7f959e 100644 --- a/code/modules/ruins/spaceruin_code/forgottenship.dm +++ b/code/modules/ruins/spaceruin_code/forgottenship.dm @@ -36,8 +36,8 @@ GLOBAL_VAR_INIT(fscpassword, generate_password()) /*/obj/item/disk/surgery/forgottenship name = "Advanced Surgery Disk" desc = "A disk that contains advanced surgery procedures, must be loaded into an Operating Console." - surgeries = list(/datum/surgery/advanced/lobotomy, /datum/surgery/advanced/bioware/vein_threading, /datum/surgery/advanced/bioware/nerve_splicing) */ - // Might use this later honestly; leaving it commented because I'm unsure + surgeries = list(/datum/surgery/advanced/lobotomy, /datum/surgery/advanced/bioware/vein_threading, /datum/surgery/advanced/bioware/nerve_splicing) + Might be used later; leaving it commented because I'm unsure */ /obj/structure/fluff/empty_sleeper/syndicate/captain icon_state = "sleeper_s-open" From 11a2a20d847ed4cffc96b1ac969eca2cd3a55f71 Mon Sep 17 00:00:00 2001 From: NinMario64 Date: Sat, 9 Mar 2024 17:17:13 -0500 Subject: [PATCH 22/35] Bone Setter and Bone Gel readded; Revival Fixed Also made sure omnisurgery can't be done on a limb that no longer exists --- code/__DEFINES/tools.dm | 2 + code/game/objects/items/storage/backpack.dm | 2 + .../surgery/omnisurgery/omni_movelayer.dm | 6 + .../omni_prosthetic_replacement.dm | 108 ++++++++++++++++++ .../surgery/omnisurgery/omni_revival.dm | 9 +- code/modules/surgery/tools.dm | 44 +++++++ shiptest.dme | 1 + 7 files changed, 168 insertions(+), 4 deletions(-) create mode 100644 code/modules/surgery/omnisurgery/omni_prosthetic_replacement.dm diff --git a/code/__DEFINES/tools.dm b/code/__DEFINES/tools.dm index 320648170b44..17e427e8e948 100644 --- a/code/__DEFINES/tools.dm +++ b/code/__DEFINES/tools.dm @@ -14,6 +14,8 @@ #define TOOL_DRILL "drill" #define TOOL_SCALPEL "scalpel" #define TOOL_SAW "saw" +#define TOOL_BONEGEL "bonegel" +#define TOOL_BONESETTER "bonesetter" // If delay between the start and the end of tool operation is less than MIN_TOOL_SOUND_DELAY, // tool sound is only played when op is started. If not, it's played twice. diff --git a/code/game/objects/items/storage/backpack.dm b/code/game/objects/items/storage/backpack.dm index ac5b14568dad..0cec21581a02 100644 --- a/code/game/objects/items/storage/backpack.dm +++ b/code/game/objects/items/storage/backpack.dm @@ -460,6 +460,8 @@ new /obj/item/cautery(src) new /obj/item/clothing/mask/surgical(src) new /obj/item/razor(src) + new /obj/item/bonegel(src) + new /obj/item/bonesetter(src) /obj/item/storage/backpack/duffelbag/sec name = "security duffel bag" diff --git a/code/modules/surgery/omnisurgery/omni_movelayer.dm b/code/modules/surgery/omnisurgery/omni_movelayer.dm index 7f1ab99809dc..cc5e9bb27d9f 100644 --- a/code/modules/surgery/omnisurgery/omni_movelayer.dm +++ b/code/modules/surgery/omnisurgery/omni_movelayer.dm @@ -9,6 +9,12 @@ show = TRUE required_layer = list(0) +/datum/surgery_step/omni/skindown/test_op(mob/user, mob/living/target, datum/surgery/omni/surgery) + var/mob/living/carbon/C = target + if(!C.get_bodypart(user.zone_selected)) //You can't do surgery on air; I'm sorry + return FALSE + return TRUE + /datum/surgery_step/omni/skindown/success(mob/user, mob/living/target, target_zone, obj/item/tool, datum/surgery/omni/surgery, default_display_results) surgery.atlayer++ return ..() diff --git a/code/modules/surgery/omnisurgery/omni_prosthetic_replacement.dm b/code/modules/surgery/omnisurgery/omni_prosthetic_replacement.dm new file mode 100644 index 000000000000..2f4d3b4515fd --- /dev/null +++ b/code/modules/surgery/omnisurgery/omni_prosthetic_replacement.dm @@ -0,0 +1,108 @@ +/datum/surgery_step/omni/add_prosthetic + name = "add prosthetic" + implements = list( + /obj/item/bodypart = 100, + /obj/item/organ_storage = 100, + /obj/item/chainsaw = 100, + /obj/item/melee/synthetic_arm_blade = 100) + time = 32 + experience_given = MEDICAL_SKILL_ORGAN_FIX //won't get full XP if rejected + valid_locations = list(BODY_ZONE_R_ARM, BODY_ZONE_L_ARM, BODY_ZONE_L_LEG, BODY_ZONE_R_LEG, BODY_ZONE_HEAD) + show = TRUE + required_layer = list(0) + var/organ_rejection_dam = 0 + +/datum/surgery_step/omni/prosthetic_replacement/test_op(mob/user, mob/living/carbon/target) + if(!iscarbon(target)) + return FALSE + var/mob/living/carbon/C = target + if(!C.get_bodypart(user.zone_selected)) //can only start if limb is missing + return TRUE + return FALSE + +/datum/surgery_step/omni/add_prosthetic/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) + if(istype(tool, /obj/item/organ_storage)) + if(!tool.contents.len) + to_chat(user, "There is nothing inside [tool]!") + return FALSE + var/obj/item/I = tool.contents[1] + if(!isbodypart(I)) + to_chat(user, "[I] cannot be attached!") + return FALSE + tool = I + if(istype(tool, /obj/item/bodypart)) + var/obj/item/bodypart/BP = tool + if(ismonkey(target))// monkey patient only accept organic monkey limbs + if(!IS_ORGANIC_LIMB(BP) || BP.animal_origin != MONKEY_BODYPART) + to_chat(user, "[BP] doesn't match the patient's morphology.") + return FALSE + if(IS_ORGANIC_LIMB(BP)) + organ_rejection_dam = 10 + if(ishuman(target)) + if(BP.animal_origin) + to_chat(user, "[BP] doesn't match the patient's morphology.") + return FALSE + var/mob/living/carbon/human/H = target + if(H.dna.species.id != BP.limb_id) + organ_rejection_dam = 30 + + if(target_zone == BP.body_zone) //so we can't replace a leg with an arm, or a human arm with a monkey arm. + display_results(user, target, "You begin to replace [target]'s [parse_zone(target_zone)] with [tool]...", + "[user] begins to replace [target]'s [parse_zone(target_zone)] with [tool].", + "[user] begins to replace [target]'s [parse_zone(target_zone)].") + else + to_chat(user, "[tool] isn't the right type for [parse_zone(target_zone)].") + return -1 + else if(target_zone == BODY_ZONE_L_ARM || target_zone == BODY_ZONE_R_ARM) + display_results(user, target, "You begin to attach [tool] onto [target]...", + "[user] begins to attach [tool] onto [target]'s [parse_zone(target_zone)].", + "[user] begins to attach something onto [target]'s [parse_zone(target_zone)].") + else + to_chat(user, "[tool] must be installed onto an arm.") + return -1 + +/datum/surgery_step/omni/add_prosthetic/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery, default_display_results = FALSE) + . = ..() + if(istype(tool, /obj/item/organ_storage)) + tool.icon_state = initial(tool.icon_state) + tool.desc = initial(tool.desc) + tool.cut_overlays() + tool = tool.contents[1] + if(istype(tool, /obj/item/bodypart) && user.temporarilyRemoveItemFromInventory(tool)) + var/obj/item/bodypart/L = tool + if(!L.attach_limb(target)) + display_results(user, target, "You fail in replacing [target]'s [parse_zone(target_zone)]! Their body has rejected [L]!", + "[user] fails to replace [target]'s [parse_zone(target_zone)]!", + "[user] fails to replaces [target]'s [parse_zone(target_zone)]!") + L.forceMove(target.loc) + return + if(organ_rejection_dam) + target.adjustToxLoss(organ_rejection_dam) + experience_given -= (round(organ_rejection_dam/10)) + display_results(user, target, "You succeed in replacing [target]'s [parse_zone(target_zone)].", + "[user] successfully replaces [target]'s [parse_zone(target_zone)] with [tool]!", + "[user] successfully replaces [target]'s [parse_zone(target_zone)]!") + return + else + var/obj/item/bodypart/L = target.new_body_part(target_zone, FALSE, FALSE) + L.is_pseudopart = TRUE + if(!L.attach_limb(target)) + display_results(user, target, "You fail in attaching [target]'s [parse_zone(target_zone)]! Their body has rejected [L]!", + "[user] fails to attach [target]'s [parse_zone(target_zone)]!", + "[user] fails to attach [target]'s [parse_zone(target_zone)]!") + L.forceMove(target.loc) + return + user.visible_message("[user] finishes attaching [tool]!", "You attach [tool].") + display_results(user, target, "You attach [tool].", + "[user] finishes attaching [tool]!", + "[user] finishes the attachment procedure!") + qdel(tool) + if(istype(tool, /obj/item/chainsaw)) + var/obj/item/mounted_chainsaw/new_arm = new(target) + target_zone == BODY_ZONE_R_ARM ? target.put_in_r_hand(new_arm) : target.put_in_l_hand(new_arm) + return + else if(istype(tool, /obj/item/melee/synthetic_arm_blade)) + var/obj/item/melee/arm_blade/new_arm = new(target,TRUE,TRUE) + target_zone == BODY_ZONE_R_ARM ? target.put_in_r_hand(new_arm) : target.put_in_l_hand(new_arm) + return + return ..() //if for some reason we fail everything we'll print out some text okay? diff --git a/code/modules/surgery/omnisurgery/omni_revival.dm b/code/modules/surgery/omnisurgery/omni_revival.dm index 96e711c83386..4432de47326e 100644 --- a/code/modules/surgery/omnisurgery/omni_revival.dm +++ b/code/modules/surgery/omnisurgery/omni_revival.dm @@ -1,4 +1,5 @@ //an incision but with greater bleed, and a 90% base success chance +/* /datum/surgery_step/omni/incise_head name = "incise head" implements = list( @@ -27,7 +28,7 @@ "") H.bleed_rate += 10 target.apply_damage(15, BRUTE, "[target_zone]") - return ..() + return ..() */ //revive after incision /datum/surgery_step/omni/revive @@ -42,13 +43,13 @@ failure_sound = 'sound/machines/defib_zap.ogg' repeatable = TRUE experience_given = MEDICAL_SKILL_ADVANCED - required_layer = list(2) + required_layer = list(4) show = TRUE valid_locations = list(BODY_ZONE_HEAD) /datum/surgery_step/omni/revive/test_op(mob/user, mob/living/target,datum/surgery/omni/surgery) - if(!istype(surgery.last_step,/datum/surgery_step/omni/incise_head)) - return FALSE + //if(!istype(surgery.last_step,/datum/surgery_step/omni/incise_head)) + //.return FALSE if(target.stat != DEAD) return FALSE if(target.hellbound || HAS_TRAIT(target, TRAIT_HUSK)) diff --git a/code/modules/surgery/tools.dm b/code/modules/surgery/tools.dm index 317297c4fe8d..c204d39d4fe9 100644 --- a/code/modules/surgery/tools.dm +++ b/code/modules/surgery/tools.dm @@ -421,3 +421,47 @@ limb_snip_candidate.dismember() user.visible_message("[src] violently slams shut, amputating [patient]'s [candidate_name].", "You amputate [patient]'s [candidate_name] with [src].") +/obj/item/bonegel + name = "bone gel" + desc = "A dense bottle of gel meant to be plastered on broken bones before setting them. It says so on the back of the bottle." + icon = 'icons/obj/surgery.dmi' //SHIPTEST edit: cool and new tools + icon_state = "bone-gel" + lefthand_file = 'icons/mob/inhands/equipment/medical_lefthand.dmi' + righthand_file = 'icons/mob/inhands/equipment/medical_righthand.dmi' + pickup_sound = 'sound/items/handling/cardboardbox_pickup.ogg' + drop_sound = 'sound/items/handling/cardboardbox_drop.ogg' + item_state = "bone-gel" + flags_1 = CONDUCT_1 + item_flags = SURGICAL_TOOL + w_class = WEIGHT_CLASS_TINY + throwforce = 5 + throw_speed = 3 + throw_range = 5 + custom_materials = list(/datum/material/iron=4000, /datum/material/glass=1000) + attack_verb = list("glooped","globbed","glomped","gonked","congealed","gelled","gooped") + hitsound = 'sound/weapons/tap.ogg' + tool_behaviour = TOOL_BONEGEL + toolspeed = 1 + +/obj/item/bonesetter + name = "bone setter" + desc = "The 'wrench' of surgery tools whose sole purpose is to set bones back to their original place. Effectively useless without bone gel." + icon = 'icons/obj/surgery.dmi' //SHIPTEST edit: cool and new tools + icon_state = "bone setter" + lefthand_file = 'icons/mob/inhands/equipment/medical_lefthand.dmi' + righthand_file = 'icons/mob/inhands/equipment/medical_righthand.dmi' + pickup_sound = 'sound/items/handling/surgery1_pickup.ogg' + drop_sound = 'sound/items/handling/metal_drop.ogg' + item_state = "bone-setter" + flags_1 = CONDUCT_1 + item_flags = SURGICAL_TOOL + force = 10 + w_class = WEIGHT_CLASS_TINY + throwforce = 5 + throw_speed = 3 + throw_range = 5 + custom_materials = list(/datum/material/iron=4000, /datum/material/glass=1000) + attack_verb = list("bashed","smashed","smacked","bone unset") + hitsound = 'sound/weapons/smash.ogg' + tool_behaviour = TOOL_BONESETTER + toolspeed = 1 diff --git a/shiptest.dme b/shiptest.dme index e64e31d315f7..32781f87e877 100644 --- a/shiptest.dme +++ b/shiptest.dme @@ -3374,6 +3374,7 @@ #include "code\modules\surgery\omnisurgery\omni_movelayer.dm" #include "code\modules\surgery\omnisurgery\omni_organ_manipulation.dm" #include "code\modules\surgery\omnisurgery\omni_plastic_surgery.dm" +#include "code\modules\surgery\omnisurgery\omni_prosthetic_replacement.dm" #include "code\modules\surgery\omnisurgery\omni_remove_embedded_object.dm" #include "code\modules\surgery\omnisurgery\omni_revival.dm" #include "code\modules\surgery\omnisurgery\omni_stomachpump.dm" From 179331afc9f0d8d14d2b4b15b50d61ef163c67b8 Mon Sep 17 00:00:00 2001 From: NinMario64 Date: Sat, 9 Mar 2024 22:34:56 -0500 Subject: [PATCH 23/35] Fixed Null Tool Bug in Omnisurgery.dm Replaced Bone Repair surgery with Bonesetter and Bone Gel tools instead of using Hemostat Updated Shiptest.dme --- .../surgery/omnisurgery/omni_bone_repair.dm | 52 +++++++++++++++++++ .../surgery/omnisurgery/omnisurgery.dm | 13 ++--- shiptest.dme | 2 +- 3 files changed, 60 insertions(+), 7 deletions(-) create mode 100644 code/modules/surgery/omnisurgery/omni_bone_repair.dm diff --git a/code/modules/surgery/omnisurgery/omni_bone_repair.dm b/code/modules/surgery/omnisurgery/omni_bone_repair.dm new file mode 100644 index 000000000000..1073c4357248 --- /dev/null +++ b/code/modules/surgery/omnisurgery/omni_bone_repair.dm @@ -0,0 +1,52 @@ +/datum/surgery_step/omni/apply_bonegel + name = "Apply Bone Gel" + time = 6.4 SECONDS + implements = list( + TOOL_BONEGEL = 100 + ) + show = TRUE + preop_sound = 'sound/surgery/bone1.ogg' + success_sound = 'sound/surgery/bone3.ogg' + required_layer = list(2) + radial_icon = /obj/item/kinetic_crusher + +// Checks if the bone is broken or splinted and Apply Bonegel surgery wasn't done recently +/datum/surgery_step/omni/apply_bonegel/test_op(mob/user, mob/living/target, datum/surgery/omni/surgery) + if(istype(target,/mob/living/carbon/human)) + var/mob/living/carbon/human/H = target + var/obj/item/bodypart/affected = H.get_bodypart(user.zone_selected) + if(affected && affected.bone_status >= BONE_FLAG_BROKEN && !istype(surgery.last_step,/datum/surgery_step/omni/apply_bonegel)) + return TRUE + return FALSE + +/datum/surgery_step/omni/set_bone + name = "Set Bone" + time = 6.4 SECONDS + implements = list( + TOOL_BONESETTER = 100 + ) + show = TRUE + preop_sound = 'sound/surgery/bone1.ogg' + success_sound = 'sound/surgery/bone3.ogg' + required_layer = list(2) + radial_icon = /obj/item/kinetic_crusher + +// Literally the same check as before to ensure we can even do this surgery unless the bone magically repaired itself somehow +/datum/surgery_step/omni/set_bone/test_op(mob/user, mob/living/target, datum/surgery/omni/surgery) + if(istype(target,/mob/living/carbon/human)) + var/mob/living/carbon/human/H = target + var/obj/item/bodypart/affected = H.get_bodypart(user.zone_selected) + if(affected && affected.bone_status >= BONE_FLAG_BROKEN && istype(surgery.last_step,/datum/surgery_step/omni/apply_bonegel)) + return TRUE + return FALSE + +/datum/surgery_step/omni/set_bone/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) + if(target_zone == BODY_ZONE_HEAD) + user.visible_message("[user] begins to set [target]'s skull with [tool]...", "You begin to set [target]'s skull with [tool]...") + else + user.visible_message("[user] begins to set the bones in [target]'s [parse_zone(target_zone)] with [tool]...", "You begin setting the bones in [target]'s [parse_zone(target_zone)] with [tool]...") + +/datum/surgery_step/omni/set_bone/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) + user.visible_message("[user] successfully sets the bones in [target]'s [parse_zone(target_zone)]!", "You successfully set the bones in [target]'s [parse_zone(target_zone)].") + surgery.operated_bodypart.fix_bone() + return TRUE diff --git a/code/modules/surgery/omnisurgery/omnisurgery.dm b/code/modules/surgery/omnisurgery/omnisurgery.dm index 9c95e5a0ed68..eb1d318d1214 100644 --- a/code/modules/surgery/omnisurgery/omnisurgery.dm +++ b/code/modules/surgery/omnisurgery/omnisurgery.dm @@ -54,12 +54,13 @@ if(!(Step.accept_any_item || Step.accept_hand)) var/good = FALSE for(var/obj in Step.implements) - if(istype(tool,obj)) - good = TRUE - break - if((tool.tool_behaviour in Step.implements) || (tool in Step.implements)) - good = TRUE - break + if(tool != null) + if(istype(tool,obj)) + good = TRUE + break + if((tool.tool_behaviour in Step.implements) || (tool in Step.implements)) + good = TRUE + break if (!good) continue if(!Step.test_op(user,target,src)) diff --git a/shiptest.dme b/shiptest.dme index 32781f87e877..f2d25230728b 100644 --- a/shiptest.dme +++ b/shiptest.dme @@ -3363,8 +3363,8 @@ #include "code\modules\surgery\bodyparts\species_parts\plasmaman_bodyparts.dm" #include "code\modules\surgery\bodyparts\species_parts\rachnid_bodyparts.dm" #include "code\modules\surgery\bodyparts\species_parts\vox_bodyparts.dm" -#include "code\modules\surgery\omnisurgery\bone_repair.dm" #include "code\modules\surgery\omnisurgery\omni_amputation.dm" +#include "code\modules\surgery\omnisurgery\omni_bone_repair.dm" #include "code\modules\surgery\omnisurgery\omni_coronary_bypass.dm" #include "code\modules\surgery\omnisurgery\omni_gastrectomy.dm" #include "code\modules\surgery\omnisurgery\omni_healing.dm" From 55c69aad1556c18b637fdecaf966aa9674f0de41 Mon Sep 17 00:00:00 2001 From: NinMario64 Date: Sat, 9 Mar 2024 22:37:52 -0500 Subject: [PATCH 24/35] Renamind this to omni_bone_repair.dm --- .../surgery/omnisurgery/bone_repair.dm | 22 ------------------- 1 file changed, 22 deletions(-) delete mode 100644 code/modules/surgery/omnisurgery/bone_repair.dm diff --git a/code/modules/surgery/omnisurgery/bone_repair.dm b/code/modules/surgery/omnisurgery/bone_repair.dm deleted file mode 100644 index 0b0d2ad26109..000000000000 --- a/code/modules/surgery/omnisurgery/bone_repair.dm +++ /dev/null @@ -1,22 +0,0 @@ -/datum/surgery_step/omni/set_bone - name = "set bone" - time = 6.4 SECONDS - implements = list( - TOOL_HEMOSTAT = 100, - TOOL_WRENCH = 40) - show = TRUE - preop_sound = 'sound/surgery/bone1.ogg' - success_sound = 'sound/surgery/bone3.ogg' - required_layer = list(2) - radial_icon = /obj/item/kinetic_crusher - -/datum/surgery_step/omni/set_bone/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) - if(target_zone == BODY_ZONE_HEAD) - user.visible_message("[user] begins to set [target]'s skull with [tool]...", "You begin to set [target]'s skull with [tool]...") - else - user.visible_message("[user] begins to set the bones in [target]'s [parse_zone(target_zone)] with [tool]...", "You begin setting the bones in [target]'s [parse_zone(target_zone)] with [tool]...") - -/datum/surgery_step/omni/set_bone/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) - user.visible_message("[user] successfully sets the bones in [target]'s [parse_zone(target_zone)]!", "You successfully set the bones in [target]'s [parse_zone(target_zone)].") - surgery.operated_bodypart.fix_bone() - return TRUE From bdf3d5d98eb238f8dc2bd5a2bfa1f9de78219349 Mon Sep 17 00:00:00 2001 From: NinMario64 Date: Sun, 10 Mar 2024 16:43:55 -0400 Subject: [PATCH 25/35] GLOBAL LISTS FIGURED OUT WOOOOOOOOOOOOOOO AND PROSTHETICS SURGERY STILL ISN'T FINISHED YET HAHAHA DYING --- code/_globalvars/lists/surgery.dm | 27 ++++++++ .../omnisurgery/omni_dental_implant.dm | 64 +++++++++++++++++++ .../surgery/omnisurgery/omni_movelayer.dm | 4 +- .../omni_prosthetic_replacement.dm | 19 +++--- .../surgery/omnisurgery/omnisurgery.dm | 2 +- .../surgery/omnisurgery/omnisurgery_step.dm | 2 +- shiptest.dme | 2 + 7 files changed, 108 insertions(+), 12 deletions(-) create mode 100644 code/_globalvars/lists/surgery.dm create mode 100644 code/modules/surgery/omnisurgery/omni_dental_implant.dm diff --git a/code/_globalvars/lists/surgery.dm b/code/_globalvars/lists/surgery.dm new file mode 100644 index 000000000000..ca0aa0b52b31 --- /dev/null +++ b/code/_globalvars/lists/surgery.dm @@ -0,0 +1,27 @@ +GLOBAL_LIST_INIT(all_body_zones, list( + BODY_ZONE_HEAD = "head", + BODY_ZONE_CHEST = "chest", + BODY_ZONE_L_ARM = "l_arm", + BODY_ZONE_R_ARM = "r_arm", + BODY_ZONE_L_LEG = "l_leg", + BODY_ZONE_R_LEG = "r_leg", + BODY_ZONE_PRECISE_EYES = "eyes", + BODY_ZONE_PRECISE_MOUTH = "mouth", + BODY_ZONE_PRECISE_GROIN = "groin" +)) +GLOBAL_LIST_INIT(broad_body_zones, list( + BODY_ZONE_HEAD = "head", + BODY_ZONE_CHEST = "chest", + BODY_ZONE_L_ARM = "l_arm", + BODY_ZONE_R_ARM = "r_arm", + BODY_ZONE_L_LEG = "l_leg", + BODY_ZONE_R_LEG = "r_leg", + BODY_ZONE_PRECISE_EYES = "eyes", + BODY_ZONE_PRECISE_MOUTH = "mouth", + BODY_ZONE_PRECISE_GROIN = "groin" +)) +GLOBAL_LIST_INIT(precise_body_zones, list( + BODY_ZONE_PRECISE_EYES = "eyes", + BODY_ZONE_PRECISE_MOUTH = "mouth", + BODY_ZONE_PRECISE_GROIN = "groin" +)) diff --git a/code/modules/surgery/omnisurgery/omni_dental_implant.dm b/code/modules/surgery/omnisurgery/omni_dental_implant.dm new file mode 100644 index 000000000000..e9fe98e31233 --- /dev/null +++ b/code/modules/surgery/omnisurgery/omni_dental_implant.dm @@ -0,0 +1,64 @@ +/datum/surgery_step/omni/drill_tooth + name = "Drill Tooth" + implements = list( + TOOL_DRILL = 100 + ) + valid_locations = list(BODY_ZONE_PRECISE_MOUTH) + required_layer = list(1) + show = TRUE + time = 16 + +// Ensure last surgery wasn't drill tooth. Otherwise you could infinitely drill holes into someone's mouth. +/datum/surgery_step/omni/drill_tooth/test_op(mob/user, mob/living/target, datum/surgery/omni/surgery) + if(!istype(surgery.last_step,/datum/surgery_step/omni/drill_tooth)) + return TRUE + return FALSE + +/datum/surgery_step/omni/implant_pill + name = "Implant Pill" + implements = list( + /obj/item/reagent_containers/pill = 100) + valid_locations = list(BODY_ZONE_PRECISE_MOUTH) + required_layer = list(1) + time = 16 + experience_given = (MEDICAL_SKILL_MEDIUM*0.4) //quick to do + +// Ensure last surgery wasn't to implant the pill to ensure you can't keep looping pills into the same tooth infinitely +/datum/surgery_step/omni/implant_pill/test_op(mob/user, mob/living/target, datum/surgery/omni/surgery) + if(!istype(surgery.last_step,/datum/surgery_step/omni/implant_pill)) + return TRUE + return FALSE + +/datum/surgery_step/omni/implant_pill/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) + display_results(user, target, "You begin to wedge [tool] in [target]'s [parse_zone(target_zone)]...", + "[user] begins to wedge \the [tool] in [target]'s [parse_zone(target_zone)].", + "[user] begins to wedge something in [target]'s [parse_zone(target_zone)].") + +/datum/surgery_step/omni/implant_pill/success(mob/user, mob/living/carbon/target, target_zone, obj/item/reagent_containers/pill/tool, datum/surgery/surgery, default_display_results = FALSE) + if(!istype(tool)) + return 0 + + user.transferItemToLoc(tool, target, TRUE) + + var/datum/action/item_action/hands_free/activate_pill/P = new(tool) + P.button.name = "Activate [tool.name]" + P.target = tool + P.Grant(target) //The pill never actually goes in an inventory slot, so the owner doesn't inherit actions from it + + display_results(user, target, "You wedge [tool] into [target]'s [parse_zone(target_zone)].", + "[user] wedges \the [tool] into [target]'s [parse_zone(target_zone)]!", + "[user] wedges something into [target]'s [parse_zone(target_zone)]!") + return ..() + +/datum/action/item_action/hands_free/activate_pill + name = "Activate Pill" + +/datum/action/item_action/hands_free/activate_pill/Trigger() + if(!..()) + return FALSE + to_chat(owner, "You grit your teeth and burst the implanted [target.name]!") + log_combat(owner, null, "swallowed an implanted pill", target) + if(target.reagents.total_volume) + target.reagents.trans_to(owner, target.reagents.total_volume, transfered_by = owner, method = INGEST) + qdel(target) + return TRUE diff --git a/code/modules/surgery/omnisurgery/omni_movelayer.dm b/code/modules/surgery/omnisurgery/omni_movelayer.dm index cc5e9bb27d9f..3992f97b1587 100644 --- a/code/modules/surgery/omnisurgery/omni_movelayer.dm +++ b/code/modules/surgery/omnisurgery/omni_movelayer.dm @@ -1,3 +1,5 @@ +// Assume surgeries with no valid_locations in this file can be done at any location + // [Going Down Layers] /datum/surgery_step/omni/skindown name = "Dermal Incision" @@ -11,7 +13,7 @@ /datum/surgery_step/omni/skindown/test_op(mob/user, mob/living/target, datum/surgery/omni/surgery) var/mob/living/carbon/C = target - if(!C.get_bodypart(user.zone_selected)) //You can't do surgery on air; I'm sorry + if(!C.get_bodypart(user.zone_selected) && !(user.zone_selected in GLOB.precise_body_zones)) //You can't do surgery on air; sorry return FALSE return TRUE diff --git a/code/modules/surgery/omnisurgery/omni_prosthetic_replacement.dm b/code/modules/surgery/omnisurgery/omni_prosthetic_replacement.dm index 2f4d3b4515fd..326ce335f18f 100644 --- a/code/modules/surgery/omnisurgery/omni_prosthetic_replacement.dm +++ b/code/modules/surgery/omnisurgery/omni_prosthetic_replacement.dm @@ -1,3 +1,12 @@ + +/datum/surgery_step/omni/prosthetic_replacement/test_op(mob/user, mob/living/carbon/target) + if(!iscarbon(target)) + return FALSE + var/mob/living/carbon/C = target + if(!C.get_bodypart(user.zone_selected)) //can only start if limb is missing + return TRUE + return FALSE + /datum/surgery_step/omni/add_prosthetic name = "add prosthetic" implements = list( @@ -7,19 +16,11 @@ /obj/item/melee/synthetic_arm_blade = 100) time = 32 experience_given = MEDICAL_SKILL_ORGAN_FIX //won't get full XP if rejected - valid_locations = list(BODY_ZONE_R_ARM, BODY_ZONE_L_ARM, BODY_ZONE_L_LEG, BODY_ZONE_R_LEG, BODY_ZONE_HEAD) + valid_locations = GLOB.broad_body_zones show = TRUE required_layer = list(0) var/organ_rejection_dam = 0 -/datum/surgery_step/omni/prosthetic_replacement/test_op(mob/user, mob/living/carbon/target) - if(!iscarbon(target)) - return FALSE - var/mob/living/carbon/C = target - if(!C.get_bodypart(user.zone_selected)) //can only start if limb is missing - return TRUE - return FALSE - /datum/surgery_step/omni/add_prosthetic/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) if(istype(tool, /obj/item/organ_storage)) if(!tool.contents.len) diff --git a/code/modules/surgery/omnisurgery/omnisurgery.dm b/code/modules/surgery/omnisurgery/omnisurgery.dm index eb1d318d1214..de0829871895 100644 --- a/code/modules/surgery/omnisurgery/omnisurgery.dm +++ b/code/modules/surgery/omnisurgery/omnisurgery.dm @@ -4,7 +4,7 @@ status = 1 steps = list() //We ballin target_mobtypes = list(/mob/living/carbon/human) //Acceptable Species - possible_locs = list(BODY_ZONE_CHEST,BODY_ZONE_HEAD,BODY_ZONE_L_ARM,BODY_ZONE_L_LEG,BODY_ZONE_R_ARM,BODY_ZONE_R_LEG) + possible_locs = GLOB.all_body_zones speed_modifier = 1 //Step speed modifier var/atlayer = 0 // 0/1/2 skin/muscle/bone var/datum/surgery_step/omni/last_step //The last step preformed in the surgery diff --git a/code/modules/surgery/omnisurgery/omnisurgery_step.dm b/code/modules/surgery/omnisurgery/omnisurgery_step.dm index ec767d51802c..88ad95aad4b0 100644 --- a/code/modules/surgery/omnisurgery/omnisurgery_step.dm +++ b/code/modules/surgery/omnisurgery/omnisurgery_step.dm @@ -1,6 +1,6 @@ /datum/surgery_step/omni var/list/required_layer = list(0,1,2) //What layers can this step be preformed at? - var/list/valid_locations = list(BODY_ZONE_CHEST,BODY_ZONE_HEAD,BODY_ZONE_L_ARM,BODY_ZONE_L_LEG,BODY_ZONE_R_ARM,BODY_ZONE_R_LEG) //List of all places this step can be preformed + var/list/valid_locations = list(BODY_ZONE_CHEST,BODY_ZONE_HEAD,BODY_ZONE_L_ARM,BODY_ZONE_L_LEG,BODY_ZONE_R_ARM,BODY_ZONE_R_LEG,BODY_ZONE_PRECISE_EYES,BODY_ZONE_PRECISE_GROIN,BODY_ZONE_PRECISE_MOUTH) //List of all places this step can be preformed var/show = FALSE //if false, isn't considered a 'valid' step, and cant be preformed. Used for 'base' step var/radial_icon = null // If not null, is the image for the radial diff --git a/shiptest.dme b/shiptest.dme index f2d25230728b..568274ac0c29 100644 --- a/shiptest.dme +++ b/shiptest.dme @@ -232,6 +232,7 @@ #include "code\_globalvars\lists\names.dm" #include "code\_globalvars\lists\objects.dm" #include "code\_globalvars\lists\poll_ignore.dm" +#include "code\_globalvars\lists\surgery.dm" #include "code\_globalvars\lists\typecache.dm" #include "code\_js\byjax.dm" #include "code\_js\menus.dm" @@ -3366,6 +3367,7 @@ #include "code\modules\surgery\omnisurgery\omni_amputation.dm" #include "code\modules\surgery\omnisurgery\omni_bone_repair.dm" #include "code\modules\surgery\omnisurgery\omni_coronary_bypass.dm" +#include "code\modules\surgery\omnisurgery\omni_dental_implant.dm" #include "code\modules\surgery\omnisurgery\omni_gastrectomy.dm" #include "code\modules\surgery\omnisurgery\omni_healing.dm" #include "code\modules\surgery\omnisurgery\omni_hepatectomy.dm" From 7f77c1a7e3cd5ccb7c39a6d55c173981d0167c16 Mon Sep 17 00:00:00 2001 From: NinMario64 Date: Sun, 10 Mar 2024 17:22:15 -0400 Subject: [PATCH 26/35] Nevermind I fucked up; defines :) death of global list ig --- code/_globalvars/lists/surgery.dm | 27 ----------------- .../surgery/omnisurgery/omni_movelayer.dm | 2 +- .../omni_prosthetic_replacement.dm | 2 +- .../surgery/omnisurgery/omnisurgery.dm | 2 +- .../surgery/omnisurgery/surgery_defines.dm | 29 +++++++++++++++++++ shiptest.dme | 2 +- 6 files changed, 33 insertions(+), 31 deletions(-) delete mode 100644 code/_globalvars/lists/surgery.dm create mode 100644 code/modules/surgery/omnisurgery/surgery_defines.dm diff --git a/code/_globalvars/lists/surgery.dm b/code/_globalvars/lists/surgery.dm deleted file mode 100644 index ca0aa0b52b31..000000000000 --- a/code/_globalvars/lists/surgery.dm +++ /dev/null @@ -1,27 +0,0 @@ -GLOBAL_LIST_INIT(all_body_zones, list( - BODY_ZONE_HEAD = "head", - BODY_ZONE_CHEST = "chest", - BODY_ZONE_L_ARM = "l_arm", - BODY_ZONE_R_ARM = "r_arm", - BODY_ZONE_L_LEG = "l_leg", - BODY_ZONE_R_LEG = "r_leg", - BODY_ZONE_PRECISE_EYES = "eyes", - BODY_ZONE_PRECISE_MOUTH = "mouth", - BODY_ZONE_PRECISE_GROIN = "groin" -)) -GLOBAL_LIST_INIT(broad_body_zones, list( - BODY_ZONE_HEAD = "head", - BODY_ZONE_CHEST = "chest", - BODY_ZONE_L_ARM = "l_arm", - BODY_ZONE_R_ARM = "r_arm", - BODY_ZONE_L_LEG = "l_leg", - BODY_ZONE_R_LEG = "r_leg", - BODY_ZONE_PRECISE_EYES = "eyes", - BODY_ZONE_PRECISE_MOUTH = "mouth", - BODY_ZONE_PRECISE_GROIN = "groin" -)) -GLOBAL_LIST_INIT(precise_body_zones, list( - BODY_ZONE_PRECISE_EYES = "eyes", - BODY_ZONE_PRECISE_MOUTH = "mouth", - BODY_ZONE_PRECISE_GROIN = "groin" -)) diff --git a/code/modules/surgery/omnisurgery/omni_movelayer.dm b/code/modules/surgery/omnisurgery/omni_movelayer.dm index 3992f97b1587..f322b14c9bd8 100644 --- a/code/modules/surgery/omnisurgery/omni_movelayer.dm +++ b/code/modules/surgery/omnisurgery/omni_movelayer.dm @@ -13,7 +13,7 @@ /datum/surgery_step/omni/skindown/test_op(mob/user, mob/living/target, datum/surgery/omni/surgery) var/mob/living/carbon/C = target - if(!C.get_bodypart(user.zone_selected) && !(user.zone_selected in GLOB.precise_body_zones)) //You can't do surgery on air; sorry + if(!C.get_bodypart(user.zone_selected) && !(user.zone_selected in PRECISE_BODY_ZONES)) //You can't do surgery on air; sorry return FALSE return TRUE diff --git a/code/modules/surgery/omnisurgery/omni_prosthetic_replacement.dm b/code/modules/surgery/omnisurgery/omni_prosthetic_replacement.dm index 326ce335f18f..f2ac020705fd 100644 --- a/code/modules/surgery/omnisurgery/omni_prosthetic_replacement.dm +++ b/code/modules/surgery/omnisurgery/omni_prosthetic_replacement.dm @@ -16,7 +16,7 @@ /obj/item/melee/synthetic_arm_blade = 100) time = 32 experience_given = MEDICAL_SKILL_ORGAN_FIX //won't get full XP if rejected - valid_locations = GLOB.broad_body_zones + valid_locations = ALL_BODY_ZONES show = TRUE required_layer = list(0) var/organ_rejection_dam = 0 diff --git a/code/modules/surgery/omnisurgery/omnisurgery.dm b/code/modules/surgery/omnisurgery/omnisurgery.dm index de0829871895..f4887870c8d4 100644 --- a/code/modules/surgery/omnisurgery/omnisurgery.dm +++ b/code/modules/surgery/omnisurgery/omnisurgery.dm @@ -4,7 +4,7 @@ status = 1 steps = list() //We ballin target_mobtypes = list(/mob/living/carbon/human) //Acceptable Species - possible_locs = GLOB.all_body_zones + possible_locs = BROAD_BODY_ZONES speed_modifier = 1 //Step speed modifier var/atlayer = 0 // 0/1/2 skin/muscle/bone var/datum/surgery_step/omni/last_step //The last step preformed in the surgery diff --git a/code/modules/surgery/omnisurgery/surgery_defines.dm b/code/modules/surgery/omnisurgery/surgery_defines.dm new file mode 100644 index 000000000000..86aaa3bda5ee --- /dev/null +++ b/code/modules/surgery/omnisurgery/surgery_defines.dm @@ -0,0 +1,29 @@ +#define ALL_BODY_ZONES list(\ + BODY_ZONE_HEAD = "head",\ + BODY_ZONE_CHEST = "chest",\ + BODY_ZONE_L_ARM = "l_arm",\ + BODY_ZONE_R_ARM = "r_arm",\ + BODY_ZONE_L_LEG = "l_leg",\ + BODY_ZONE_R_LEG = "r_leg",\ + BODY_ZONE_PRECISE_EYES = "eyes",\ + BODY_ZONE_PRECISE_MOUTH = "mouth",\ + BODY_ZONE_PRECISE_GROIN = "groin"\ +) + +#define BROAD_BODY_ZONES list(\ + BODY_ZONE_HEAD = "head",\ + BODY_ZONE_CHEST = "chest",\ + BODY_ZONE_L_ARM = "l_arm",\ + BODY_ZONE_R_ARM = "r_arm",\ + BODY_ZONE_L_LEG = "l_leg",\ + BODY_ZONE_R_LEG = "r_leg",\ + BODY_ZONE_PRECISE_EYES = "eyes",\ + BODY_ZONE_PRECISE_MOUTH = "mouth",\ + BODY_ZONE_PRECISE_GROIN = "groin"\ +) + +#define PRECISE_BODY_ZONES list(\ + BODY_ZONE_PRECISE_EYES = "eyes",\ + BODY_ZONE_PRECISE_MOUTH = "mouth",\ + BODY_ZONE_PRECISE_GROIN = "groin"\ +) diff --git a/shiptest.dme b/shiptest.dme index 568274ac0c29..f768c8ff6195 100644 --- a/shiptest.dme +++ b/shiptest.dme @@ -232,7 +232,6 @@ #include "code\_globalvars\lists\names.dm" #include "code\_globalvars\lists\objects.dm" #include "code\_globalvars\lists\poll_ignore.dm" -#include "code\_globalvars\lists\surgery.dm" #include "code\_globalvars\lists\typecache.dm" #include "code\_js\byjax.dm" #include "code\_js\menus.dm" @@ -3364,6 +3363,7 @@ #include "code\modules\surgery\bodyparts\species_parts\plasmaman_bodyparts.dm" #include "code\modules\surgery\bodyparts\species_parts\rachnid_bodyparts.dm" #include "code\modules\surgery\bodyparts\species_parts\vox_bodyparts.dm" +#include "code\modules\surgery\omnisurgery\surgery_defines.dm" #include "code\modules\surgery\omnisurgery\omni_amputation.dm" #include "code\modules\surgery\omnisurgery\omni_bone_repair.dm" #include "code\modules\surgery\omnisurgery\omni_coronary_bypass.dm" From 64f144a2b92075e4428c2ab236e49ec4c6bb639e Mon Sep 17 00:00:00 2001 From: NinMario64 Date: Tue, 12 Mar 2024 20:49:25 -0400 Subject: [PATCH 27/35] Hmm. Today I will port prosthetic surgery. (Dies) Includes numerous bug fixes, some unabstraction of surgery_helper file, and actual working limb grafting surgery. This surgery has revealed to me that there is no god and I am not even close to finished. --- code/_onclick/item_attack.dm | 16 +-- .../surgery/omnisurgery/omni_amputation.dm | 1 + .../surgery/omnisurgery/omni_limb_grafting.dm | 120 ++++++++++++++++++ .../surgery/omnisurgery/omni_movelayer.dm | 5 +- .../omni_prosthetic_replacement.dm | 27 +++- .../surgery/omnisurgery/omnisurgery_step.dm | 17 ++- code/modules/surgery/surgery.dm | 32 +++++ code/modules/surgery/surgery_helpers.dm | 16 +-- code/modules/surgery/surgery_step.dm | 1 + shiptest.dme | 1 + 10 files changed, 207 insertions(+), 29 deletions(-) create mode 100644 code/modules/surgery/omnisurgery/omni_limb_grafting.dm diff --git a/code/_onclick/item_attack.dm b/code/_onclick/item_attack.dm index 1cf0585c0ed4..f832ae62c997 100644 --- a/code/_onclick/item_attack.dm +++ b/code/_onclick/item_attack.dm @@ -58,22 +58,22 @@ /obj/attackby(obj/item/I, mob/living/user, params) return ..() || ((obj_flags & CAN_BE_HIT) && I.attack_obj(src, user)) -/mob/living/attackby(obj/item/I, mob/living/user, params) +/mob/living/attackby(obj/item/item, mob/living/user, params) if(..()) return TRUE if(user.a_intent == INTENT_HELP || user.a_intent == INTENT_DISARM) - for(var/datum/surgery/S in surgeries) - if(body_position != LYING_DOWN && S.lying_required) + for(var/datum/surgery/surgery in surgeries) + if(body_position != LYING_DOWN && surgery.lying_required) continue - if(!S.self_operable && user == src) + if(!surgery.self_operable && user == src) //STOP USING ONE-LETTER VARIABLES IM LITERALLY HERE BECAUSE OF THIS continue - if(S.next_step(user, user.a_intent)) + if(surgery.next_step(user, user.a_intent)) return TRUE - if((I.item_flags & SURGICAL_TOOL) && user.a_intent == INTENT_HELP) - if(attempt_initiate_surgery(I, src, user)) + if((item.item_flags & SURGICAL_TOOL) && user.a_intent == INTENT_HELP) + if(attempt_initiate_surgery(item, src, user)) return TRUE user.changeNext_move(CLICK_CD_MELEE) - return I.attack(src, user) + return item.attack(src, user) /mob/living/attack_hand(mob/living/user) if(..()) diff --git a/code/modules/surgery/omnisurgery/omni_amputation.dm b/code/modules/surgery/omnisurgery/omni_amputation.dm index bc6ce9133914..8262ee26fcae 100644 --- a/code/modules/surgery/omnisurgery/omni_amputation.dm +++ b/code/modules/surgery/omnisurgery/omni_amputation.dm @@ -32,4 +32,5 @@ target_limb.drop_limb() if(user.mind) user.mind.adjust_experience(/datum/skill/healing, experience_given) + surgery.complete() return ..() diff --git a/code/modules/surgery/omnisurgery/omni_limb_grafting.dm b/code/modules/surgery/omnisurgery/omni_limb_grafting.dm new file mode 100644 index 000000000000..92c957309dbc --- /dev/null +++ b/code/modules/surgery/omnisurgery/omni_limb_grafting.dm @@ -0,0 +1,120 @@ +// Formerly prosthetic_replacement.dm + +///datum/surgery/limb_grafting +// name = "Limb grafting" +// steps = list(/datum/surgery_step/incise, /datum/surgery_step/clamp_bleeders, /datum/surgery_step/retract_skin, /datum/surgery_step/graft_limb) +// target_mobtypes = list(/mob/living/carbon/human, /mob/living/carbon/monkey) +// possible_locs = list(BODY_ZONE_R_ARM, BODY_ZONE_L_ARM, BODY_ZONE_L_LEG, BODY_ZONE_R_LEG, BODY_ZONE_HEAD) + + +// /datum/surgery/limb_grafting/can_start(mob/user, mob/living/carbon/target) +// if(!iscarbon(target)) +// return 0 +// var/mob/living/carbon/C = target +// if(!C.get_bodypart(user.zone_selected)) //can only start if limb is missing +// return 1 + +/datum/surgery_step/omni/graft_limb + name = "graft limb" + implements = list( + /obj/item/bodypart = 100, + /obj/item/organ_storage = 100) +// /obj/item/chainsaw = 100, +// /obj/item/melee/synthetic_arm_blade = 100) +// Frankly these have always bothered me. They fill like a bad fit for Shiptest. +// Marking out for now. Keeping the later code used to install unconventional prostheses just in case someone finds a good use for it. + time = 32 + show = TRUE + valid_locations = list(BODY_ZONE_R_ARM, BODY_ZONE_L_ARM, BODY_ZONE_L_LEG, BODY_ZONE_R_LEG, BODY_ZONE_HEAD) +// target_mobtypes = list(/mob/living/carbon/human, /mob/living/carbon/monkey) + experience_given = MEDICAL_SKILL_ORGAN_FIX //won't get full XP if rejected + requires_bodypart = FALSE + required_layer = list(0) + var/organ_rejection_dam = 0 + +/datum/surgery_step/omni/graft_limb/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) + if(istype(tool, /obj/item/organ_storage)) + if(!tool.contents.len) + to_chat(user, "There is nothing inside [tool]!") + return -1 + var/obj/item/I = tool.contents[1] + if(!isbodypart(I)) + to_chat(user, "[I] cannot be attached!") + return -1 + tool = I + if(istype(tool, /obj/item/bodypart)) + var/obj/item/bodypart/BP = tool + if(ismonkey(target))// monkey patient only accept organic monkey limbs + if(!IS_ORGANIC_LIMB(BP) || BP.animal_origin != MONKEY_BODYPART) + to_chat(user, "[BP] doesn't match the patient's morphology.") + return -1 + if(IS_ORGANIC_LIMB(BP)) + organ_rejection_dam = 10 + if(ishuman(target)) + if(BP.animal_origin) + to_chat(user, "[BP] doesn't match the patient's morphology.") + return -1 + var/mob/living/carbon/human/H = target + if(H.dna.species.id != BP.limb_id) + organ_rejection_dam = 30 + + if(target_zone == BP.body_zone) //so we can't replace a leg with an arm, or a human arm with a monkey arm. + display_results(user, target, "You begin to replace [target]'s [parse_zone(target_zone)] with [tool]...", + "[user] begins to replace [target]'s [parse_zone(target_zone)] with [tool].", + "[user] begins to replace [target]'s [parse_zone(target_zone)].") + else + to_chat(user, "[tool] isn't the right type for [parse_zone(target_zone)].") + return -1 + else if(target_zone == BODY_ZONE_L_ARM || target_zone == BODY_ZONE_R_ARM) + display_results(user, target, "You begin to attach [tool] onto [target]...", + "[user] begins to attach [tool] onto [target]'s [parse_zone(target_zone)].", + "[user] begins to attach something onto [target]'s [parse_zone(target_zone)].") + else + to_chat(user, "[tool] must be installed onto an arm.") + return -1 + +/datum/surgery_step/omni/graft_limb/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery, default_display_results = FALSE) + . = ..() + if(istype(tool, /obj/item/organ_storage)) + tool.icon_state = initial(tool.icon_state) + tool.desc = initial(tool.desc) + tool.cut_overlays() + tool = tool.contents[1] + if(istype(tool, /obj/item/bodypart) && user.temporarilyRemoveItemFromInventory(tool)) + var/obj/item/bodypart/L = tool + if(!L.attach_limb(target)) + display_results(user, target, "You fail in replacing [target]'s [parse_zone(target_zone)]! Their body has rejected [L]!", + "[user] fails to replace [target]'s [parse_zone(target_zone)]!", + "[user] fails to replaces [target]'s [parse_zone(target_zone)]!") + L.forceMove(target.loc) + return + if(organ_rejection_dam) + target.adjustToxLoss(organ_rejection_dam) + experience_given -= (round(organ_rejection_dam/10)) + display_results(user, target, "You succeed in replacing [target]'s [parse_zone(target_zone)].", + "[user] successfully replaces [target]'s [parse_zone(target_zone)] with [tool]!", + "[user] successfully replaces [target]'s [parse_zone(target_zone)]!") + return + else + var/obj/item/bodypart/L = target.new_body_part(target_zone, FALSE, FALSE) + L.is_pseudopart = TRUE + if(!L.attach_limb(target)) + display_results(user, target, "You fail in attaching [target]'s [parse_zone(target_zone)]! Their body has rejected [L]!", + "[user] fails to attach [target]'s [parse_zone(target_zone)]!", + "[user] fails to attach [target]'s [parse_zone(target_zone)]!") + L.forceMove(target.loc) + return + user.visible_message("[user] finishes attaching [tool]!", "You attach [tool].") + display_results(user, target, "You attach [tool].", + "[user] finishes attaching [tool]!", + "[user] finishes the attachment procedure!") + qdel(tool) + if(istype(tool, /obj/item/chainsaw)) + var/obj/item/mounted_chainsaw/new_arm = new(target) + target_zone == BODY_ZONE_R_ARM ? target.put_in_r_hand(new_arm) : target.put_in_l_hand(new_arm) + return + else if(istype(tool, /obj/item/melee/synthetic_arm_blade)) + var/obj/item/melee/arm_blade/new_arm = new(target,TRUE,TRUE) + target_zone == BODY_ZONE_R_ARM ? target.put_in_r_hand(new_arm) : target.put_in_l_hand(new_arm) + return + return ..() //if for some reason we fail everything we'll print out some text okay? diff --git a/code/modules/surgery/omnisurgery/omni_movelayer.dm b/code/modules/surgery/omnisurgery/omni_movelayer.dm index f322b14c9bd8..909a8ed52b3f 100644 --- a/code/modules/surgery/omnisurgery/omni_movelayer.dm +++ b/code/modules/surgery/omnisurgery/omni_movelayer.dm @@ -13,7 +13,7 @@ /datum/surgery_step/omni/skindown/test_op(mob/user, mob/living/target, datum/surgery/omni/surgery) var/mob/living/carbon/C = target - if(!C.get_bodypart(user.zone_selected) && !(user.zone_selected in PRECISE_BODY_ZONES)) //You can't do surgery on air; sorry + if(!C.get_bodypart(user.zone_selected) && !(user.zone_selected in PRECISE_BODY_ZONES)) //Can't remove skin of non-existent limb return FALSE return TRUE @@ -64,7 +64,6 @@ return ..() // [Going Up Layers] (All cautery for now for the sake of simplicity, otherwise there'll be lots of radial menus) - /datum/surgery_step/omni/membraneup name = "Seal Membrane" implements = list( @@ -138,3 +137,5 @@ H.bleed_rate = 0 //Setting this to 0 until Clamp Bleeders gets figured out surgery.complete() return ..() + +// [Lost-Limb Surgeries] Surgeries that can be done on areas with missing limbs.. diff --git a/code/modules/surgery/omnisurgery/omni_prosthetic_replacement.dm b/code/modules/surgery/omnisurgery/omni_prosthetic_replacement.dm index f2ac020705fd..dd426b6b3ffe 100644 --- a/code/modules/surgery/omnisurgery/omni_prosthetic_replacement.dm +++ b/code/modules/surgery/omnisurgery/omni_prosthetic_replacement.dm @@ -1,11 +1,19 @@ +/datum/surgery_step/omni/prepare_bone + name = "Prepare Bone" + implements = list( + TOOL_BONEGEL = 100) + preop_sound = 'sound/surgery/scalpel1.ogg' + success_sound = 'sound/surgery/scalpel2.ogg' + time = 2.5 SECONDS + valid_locations = list(BODY_ZONE_R_ARM, BODY_ZONE_L_ARM, BODY_ZONE_L_LEG, BODY_ZONE_R_LEG, BODY_ZONE_HEAD) + show = TRUE + required_layer = list(0) + requires_bodypart = FALSE -/datum/surgery_step/omni/prosthetic_replacement/test_op(mob/user, mob/living/carbon/target) - if(!iscarbon(target)) +/datum/surgery_step/omni/prepare_bone/test_op(mob/user, mob/living/target,datum/surgery/omni/surgery) + if(istype(surgery.last_step,/datum/surgery_step/omni/prepare_bone)) return FALSE - var/mob/living/carbon/C = target - if(!C.get_bodypart(user.zone_selected)) //can only start if limb is missing - return TRUE - return FALSE + return TRUE /datum/surgery_step/omni/add_prosthetic name = "add prosthetic" @@ -21,6 +29,11 @@ required_layer = list(0) var/organ_rejection_dam = 0 +/datum/surgery_step/omni/add_prosthetic/test_op(mob/user, mob/living/target,datum/surgery/omni/surgery) + if(!istype(surgery.last_step,/datum/surgery_step/omni/prepare_bone)) + return FALSE + return TRUE + /datum/surgery_step/omni/add_prosthetic/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) if(istype(tool, /obj/item/organ_storage)) if(!tool.contents.len) @@ -63,7 +76,6 @@ return -1 /datum/surgery_step/omni/add_prosthetic/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery, default_display_results = FALSE) - . = ..() if(istype(tool, /obj/item/organ_storage)) tool.icon_state = initial(tool.icon_state) tool.desc = initial(tool.desc) @@ -106,4 +118,5 @@ var/obj/item/melee/arm_blade/new_arm = new(target,TRUE,TRUE) target_zone == BODY_ZONE_R_ARM ? target.put_in_r_hand(new_arm) : target.put_in_l_hand(new_arm) return + surgery.complete() return ..() //if for some reason we fail everything we'll print out some text okay? diff --git a/code/modules/surgery/omnisurgery/omnisurgery_step.dm b/code/modules/surgery/omnisurgery/omnisurgery_step.dm index 88ad95aad4b0..ea5ea9f5fbf1 100644 --- a/code/modules/surgery/omnisurgery/omnisurgery_step.dm +++ b/code/modules/surgery/omnisurgery/omnisurgery_step.dm @@ -1,16 +1,21 @@ /datum/surgery_step/omni var/list/required_layer = list(0,1,2) //What layers can this step be preformed at? var/list/valid_locations = list(BODY_ZONE_CHEST,BODY_ZONE_HEAD,BODY_ZONE_L_ARM,BODY_ZONE_L_LEG,BODY_ZONE_R_ARM,BODY_ZONE_R_LEG,BODY_ZONE_PRECISE_EYES,BODY_ZONE_PRECISE_GROIN,BODY_ZONE_PRECISE_MOUTH) //List of all places this step can be preformed - var/show = FALSE //if false, isn't considered a 'valid' step, and cant be preformed. Used for 'base' step + var/requires_bodypart = TRUE //Swap to false if surgery needs to be done on a bodypart that doesn't exist (eg. An amputated limb) + var/show = TRUE //if false, isn't considered a 'valid' step, and cant be preformed. Used for 'base' step var/radial_icon = null // If not null, is the image for the radial + var/lying_required = TRUE //Does the vicitm needs to be lying down. //For any additional logic needing done before we say this step is 'valid' Why not try_op? Couple reasons. // One: We already are testing half of try_op before calling test_op // Two: We only want if the surgery is a valid step that can be taken, we don't necissarily want to initiate it. + +//The main test function that can be inserted into any surgery and functions with the "show" variable. See var/show for more details on how that works. /datum/surgery_step/omni/proc/test_op(mob/user,mob/living/target,datum/surgery/omni/surgery) return TRUE -/datum/surgery_step/omni/try_op(mob/user, mob/living/target, target_zone, obj/item/tool, datum/surgery/omni/surgery, try_to_fail = FALSE) +//Attempts operation and initiates it if success = TRUE. [Do Not Use. Unless you know what you're doing] +/datum/surgery_step/omni/try_op(mob/user, mob/living/target, target_zone, obj/item/tool, datum/surgery/omni/surgery, datum/surgery_step/omni/surgery_step, try_to_fail = FALSE) var/success = FALSE if(accept_hand) if(!tool) @@ -38,12 +43,16 @@ if(success) if(target_zone == surgery.location) if(get_location_accessible(target, target_zone) || surgery.ignore_clothes) - initiate(user, target, target_zone, tool, surgery, try_to_fail) + if(surgery.test_lying(user,target)) + initiate(user, target, target_zone, tool, surgery, try_to_fail) + else + to_chat(user,"Incompatible surgery step: requires_lying returned FALSE.") else to_chat(user, "You need to expose [target]'s [parse_zone(target_zone)] to perform surgery on it!") - return TRUE //returns TRUE so we don't stab the guy in the dick or wherever. + return TRUE //returns TRUE so we don't stab the guy in the dick or wherever. return FALSE +// Initiator of surgery steps. [Do Not Use. Unless you know what you're doing.] /datum/surgery_step/omni/initiate(mob/user, mob/living/target, target_zone, obj/item/tool, datum/surgery/surgery, try_to_fail = FALSE) surgery.step_in_progress = TRUE var/speed_mod = 1 diff --git a/code/modules/surgery/surgery.dm b/code/modules/surgery/surgery.dm index 88323f0056a8..c849c21343d4 100644 --- a/code/modules/surgery/surgery.dm +++ b/code/modules/surgery/surgery.dm @@ -20,6 +20,38 @@ var/requires_tech = FALSE //handles techweb-oriented surgeries, previously restricted to the /advanced subtype (You still need to add designs) var/replaced_by //type; doesn't show up if this type exists. Set to /datum/surgery if you want to hide a "base" surgery (useful for typing parents IE healing.dm just make sure to null it out again) +// [Variable Datums] +/datum/surgery/proc/test_lying(mob/user,mob/living/target) + var/mob/living/carbon/carbon_target + if(iscarbon(target)) + carbon_target = target + else + return FALSE //consider sending message relaying this "Not valid target for this step" + if(!(lying_required) && (carbon_target.body_position != LYING_DOWN)) + return FALSE + if(lying_required && carbon_target.body_position == LYING_DOWN) + return TRUE + return FALSE + +//Tests a bodypart based on the "requires_bodypart" variable +/datum/surgery/proc/test_part(mob/user,mob/living/target) + var/selected_zone = user.zone_selected + var/mob/living/carbon/carbon_target + var/obj/item/bodypart/part_affected + if(iscarbon(target)) + carbon_target = target + part_affected = carbon_target.get_bodypart(check_zone(selected_zone)) + else + return FALSE //consider sending message relaying this "Not valid target for this step" + if(!(requires_bodypart) && part_affected == null) + return TRUE + if(requires_bodypart && part_affected) + return TRUE + if(requires_bodypart == "DYNAMIC") + return TRUE + return FALSE + +// Raw Datums /datum/surgery/New(surgery_target, surgery_location, surgery_bodypart) ..() if(surgery_target) diff --git a/code/modules/surgery/surgery_helpers.dm b/code/modules/surgery/surgery_helpers.dm index c4a769c43ed5..bb274ce71bbd 100644 --- a/code/modules/surgery/surgery_helpers.dm +++ b/code/modules/surgery/surgery_helpers.dm @@ -1,6 +1,6 @@ /proc/attempt_initiate_surgery(obj/item/I, mob/living/M, mob/user) if(!istype(M)) - return + return //Tell me what you're returning please for the love of god var/mob/living/carbon/C var/obj/item/bodypart/affecting @@ -12,7 +12,7 @@ var/datum/surgery/current_surgery - for(var/datum/surgery/S in M.surgeries) + for(var/datum/surgery/S in M.surgeries) // Make this into a callable DEFINED list to allow for multiple forms of omnisurgery if(S.location == selected_zone) current_surgery = S @@ -24,15 +24,15 @@ if(!S.possible_locs.Find(selected_zone)) continue if(affecting) - if(!S.requires_bodypart) + if(!(S.test_part(user,M))) continue if(S.requires_bodypart_type && !(affecting.bodytype & S.requires_bodypart_type)) continue if(S.requires_real_bodypart && affecting.is_pseudopart) continue - else if(C && S.requires_bodypart) //mob with no limb in surgery zone when we need a limb + else if(C && S.test_part(user,M)) //mob with no limb in surgery zone when we need a limb continue - if(S.lying_required && (M.body_position != LYING_DOWN)) + if(!(S.test_lying(user, M))) continue if(!S.can_start(user, M)) continue @@ -56,13 +56,13 @@ if(C) affecting = C.get_bodypart(check_zone(selected_zone)) if(affecting) - if(!S.requires_bodypart) + if(!(S.test_part(user,M))) return if(S.requires_bodypart_type && !(affecting.bodytype & S.requires_bodypart_type)) return - else if(C && S.requires_bodypart) + else if(C && S.test_part(user,M)) return - if(S.lying_required && (M.body_position != LYING_DOWN)) + if(!(S.test_lying(user, M))) return if(!S.can_start(user, M)) return diff --git a/code/modules/surgery/surgery_step.dm b/code/modules/surgery/surgery_step.dm index b7bdd777ae40..5666ba47dcad 100644 --- a/code/modules/surgery/surgery_step.dm +++ b/code/modules/surgery/surgery_step.dm @@ -26,6 +26,7 @@ /// The amount of experience given for successfully completing the step. var/experience_given = MEDICAL_SKILL_EASY + /datum/surgery_step/proc/try_op(mob/user, mob/living/target, target_zone, obj/item/tool, datum/surgery/surgery, try_to_fail = FALSE) var/success = FALSE if(accept_hand) diff --git a/shiptest.dme b/shiptest.dme index 8889debae4a2..db44182f34db 100644 --- a/shiptest.dme +++ b/shiptest.dme @@ -3365,6 +3365,7 @@ #include "code\modules\surgery\bodyparts\species_parts\plasmaman_bodyparts.dm" #include "code\modules\surgery\bodyparts\species_parts\rachnid_bodyparts.dm" #include "code\modules\surgery\bodyparts\species_parts\vox_bodyparts.dm" +#include "code\modules\surgery\omnisurgery\omni_limb_grafting.dm" #include "code\modules\surgery\omnisurgery\surgery_defines.dm" #include "code\modules\surgery\omnisurgery\omni_amputation.dm" #include "code\modules\surgery\omnisurgery\omni_bone_repair.dm" From c834a13ed84844c544b049a66f69890fc7ae2d9f Mon Sep 17 00:00:00 2001 From: NinMario64 Date: Sat, 6 Apr 2024 15:03:27 -0400 Subject: [PATCH 28/35] Stomach Pump Added; Backend stuff modified This took three weeks god help me --- .../surgery/omnisurgery/omni_amputation.dm | 4 +- .../surgery/omnisurgery/omni_limb_grafting.dm | 57 +++++++- .../omni_prosthetic_replacement.dm | 122 ------------------ .../surgery/omnisurgery/omni_stomachpump.dm | 10 +- .../surgery/omnisurgery/omnisurgery.dm | 8 ++ .../surgery/omnisurgery/omnisurgery_step.dm | 1 + code/modules/surgery/surgery.dm | 16 ++- code/modules/surgery/surgery_helpers.dm | 4 - code/modules/surgery/surgery_step.dm | 3 +- shiptest.dme | 1 - 10 files changed, 79 insertions(+), 147 deletions(-) delete mode 100644 code/modules/surgery/omnisurgery/omni_prosthetic_replacement.dm diff --git a/code/modules/surgery/omnisurgery/omni_amputation.dm b/code/modules/surgery/omnisurgery/omni_amputation.dm index 8262ee26fcae..da7db87b4ff5 100644 --- a/code/modules/surgery/omnisurgery/omni_amputation.dm +++ b/code/modules/surgery/omnisurgery/omni_amputation.dm @@ -8,8 +8,8 @@ /obj/item/fireaxe = 50, /obj/item/hatchet = 40, /obj/item/kitchen/knife/butcher = 25) - time = 6.4 SECONDS - preop_sound = 'sound/surgery/scalpel1.ogg' + time = 12 SECONDS + preop_sound = 'sound/surgery/saw.ogg' success_sound = 'sound/surgery/organ2.ogg' time = 64 experience_given = MEDICAL_SKILL_ORGAN_FIX diff --git a/code/modules/surgery/omnisurgery/omni_limb_grafting.dm b/code/modules/surgery/omnisurgery/omni_limb_grafting.dm index 92c957309dbc..40b4499eb3bb 100644 --- a/code/modules/surgery/omnisurgery/omni_limb_grafting.dm +++ b/code/modules/surgery/omnisurgery/omni_limb_grafting.dm @@ -14,8 +14,47 @@ // if(!C.get_bodypart(user.zone_selected)) //can only start if limb is missing // return 1 +/datum/surgery_step/omni/prepare_flesh + name = "Prepare Flesh" + implements = list( + TOOL_HEMOSTAT = 100) + time = 12 + show = TRUE + valid_locations = list(BODY_ZONE_R_ARM, BODY_ZONE_L_ARM, BODY_ZONE_L_LEG, BODY_ZONE_R_LEG, BODY_ZONE_HEAD) + experience_given = MEDICAL_SKILL_ORGAN_FIX //won't get full XP if rejected + requires_bodypart = FALSE + target_mobtypes = list(/mob/living/carbon/human, /mob/living/carbon/monkey) + required_layer = list(0) + var/organ_rejection_dam = 0 + +/datum/surgery_step/omni/prepare_flesh/test_op(mob/user, mob/living/target, datum/surgery/omni/surgery) + if(istype(surgery.last_step,/datum/surgery_step/omni/prepare_flesh)) + return FALSE + if(istype(surgery.last_step,/datum/surgery_step/omni/apply_bonegel_limbgrafting)) + return FALSE + return TRUE + + +/datum/surgery_step/omni/apply_bonegel_limbgrafting + name = "Apply Bonegel" + implements = list( + TOOL_BONEGEL = 100) + time = 12 + show = TRUE + valid_locations = list(BODY_ZONE_R_ARM, BODY_ZONE_L_ARM, BODY_ZONE_L_LEG, BODY_ZONE_R_LEG, BODY_ZONE_HEAD) + experience_given = MEDICAL_SKILL_ORGAN_FIX //won't get full XP if rejected + requires_bodypart = FALSE + target_mobtypes = list(/mob/living/carbon/human, /mob/living/carbon/monkey) + required_layer = list(0) + var/organ_rejection_dam = 0 + +/datum/surgery_step/omni/apply_bonegel_limbgrafting/test_op(mob/user, mob/living/target, datum/surgery/omni/surgery) + if(istype(surgery.last_step,/datum/surgery_step/omni/prepare_flesh)) + return TRUE + return FALSE + /datum/surgery_step/omni/graft_limb - name = "graft limb" + name = "Graft Limb" implements = list( /obj/item/bodypart = 100, /obj/item/organ_storage = 100) @@ -29,9 +68,15 @@ // target_mobtypes = list(/mob/living/carbon/human, /mob/living/carbon/monkey) experience_given = MEDICAL_SKILL_ORGAN_FIX //won't get full XP if rejected requires_bodypart = FALSE + target_mobtypes = list(/mob/living/carbon/human, /mob/living/carbon/monkey) required_layer = list(0) var/organ_rejection_dam = 0 +/datum/surgery_step/omni/graft_limb/test_op(mob/user, mob/living/target, datum/surgery/omni/surgery) + if(istype(surgery.last_step,/datum/surgery_step/omni/apply_bonegel_limbgrafting)) + return TRUE + return FALSE + /datum/surgery_step/omni/graft_limb/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) if(istype(tool, /obj/item/organ_storage)) if(!tool.contents.len) @@ -94,12 +139,13 @@ display_results(user, target, "You succeed in replacing [target]'s [parse_zone(target_zone)].", "[user] successfully replaces [target]'s [parse_zone(target_zone)] with [tool]!", "[user] successfully replaces [target]'s [parse_zone(target_zone)]!") + surgery.complete() return else var/obj/item/bodypart/L = target.new_body_part(target_zone, FALSE, FALSE) L.is_pseudopart = TRUE if(!L.attach_limb(target)) - display_results(user, target, "You fail in attaching [target]'s [parse_zone(target_zone)]! Their body has rejected [L]!", + display_results(user, target, "You fail in attaching [target]'s [parse_zone(target_zone)]! Their body has rejected [L]!", "[user] fails to attach [target]'s [parse_zone(target_zone)]!", "[user] fails to attach [target]'s [parse_zone(target_zone)]!") L.forceMove(target.loc) @@ -109,12 +155,9 @@ "[user] finishes attaching [tool]!", "[user] finishes the attachment procedure!") qdel(tool) - if(istype(tool, /obj/item/chainsaw)) - var/obj/item/mounted_chainsaw/new_arm = new(target) - target_zone == BODY_ZONE_R_ARM ? target.put_in_r_hand(new_arm) : target.put_in_l_hand(new_arm) - return - else if(istype(tool, /obj/item/melee/synthetic_arm_blade)) + if(istype(tool, /obj/item/melee/synthetic_arm_blade)) var/obj/item/melee/arm_blade/new_arm = new(target,TRUE,TRUE) target_zone == BODY_ZONE_R_ARM ? target.put_in_r_hand(new_arm) : target.put_in_l_hand(new_arm) return + surgery.complete() return ..() //if for some reason we fail everything we'll print out some text okay? diff --git a/code/modules/surgery/omnisurgery/omni_prosthetic_replacement.dm b/code/modules/surgery/omnisurgery/omni_prosthetic_replacement.dm deleted file mode 100644 index dd426b6b3ffe..000000000000 --- a/code/modules/surgery/omnisurgery/omni_prosthetic_replacement.dm +++ /dev/null @@ -1,122 +0,0 @@ -/datum/surgery_step/omni/prepare_bone - name = "Prepare Bone" - implements = list( - TOOL_BONEGEL = 100) - preop_sound = 'sound/surgery/scalpel1.ogg' - success_sound = 'sound/surgery/scalpel2.ogg' - time = 2.5 SECONDS - valid_locations = list(BODY_ZONE_R_ARM, BODY_ZONE_L_ARM, BODY_ZONE_L_LEG, BODY_ZONE_R_LEG, BODY_ZONE_HEAD) - show = TRUE - required_layer = list(0) - requires_bodypart = FALSE - -/datum/surgery_step/omni/prepare_bone/test_op(mob/user, mob/living/target,datum/surgery/omni/surgery) - if(istype(surgery.last_step,/datum/surgery_step/omni/prepare_bone)) - return FALSE - return TRUE - -/datum/surgery_step/omni/add_prosthetic - name = "add prosthetic" - implements = list( - /obj/item/bodypart = 100, - /obj/item/organ_storage = 100, - /obj/item/chainsaw = 100, - /obj/item/melee/synthetic_arm_blade = 100) - time = 32 - experience_given = MEDICAL_SKILL_ORGAN_FIX //won't get full XP if rejected - valid_locations = ALL_BODY_ZONES - show = TRUE - required_layer = list(0) - var/organ_rejection_dam = 0 - -/datum/surgery_step/omni/add_prosthetic/test_op(mob/user, mob/living/target,datum/surgery/omni/surgery) - if(!istype(surgery.last_step,/datum/surgery_step/omni/prepare_bone)) - return FALSE - return TRUE - -/datum/surgery_step/omni/add_prosthetic/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) - if(istype(tool, /obj/item/organ_storage)) - if(!tool.contents.len) - to_chat(user, "There is nothing inside [tool]!") - return FALSE - var/obj/item/I = tool.contents[1] - if(!isbodypart(I)) - to_chat(user, "[I] cannot be attached!") - return FALSE - tool = I - if(istype(tool, /obj/item/bodypart)) - var/obj/item/bodypart/BP = tool - if(ismonkey(target))// monkey patient only accept organic monkey limbs - if(!IS_ORGANIC_LIMB(BP) || BP.animal_origin != MONKEY_BODYPART) - to_chat(user, "[BP] doesn't match the patient's morphology.") - return FALSE - if(IS_ORGANIC_LIMB(BP)) - organ_rejection_dam = 10 - if(ishuman(target)) - if(BP.animal_origin) - to_chat(user, "[BP] doesn't match the patient's morphology.") - return FALSE - var/mob/living/carbon/human/H = target - if(H.dna.species.id != BP.limb_id) - organ_rejection_dam = 30 - - if(target_zone == BP.body_zone) //so we can't replace a leg with an arm, or a human arm with a monkey arm. - display_results(user, target, "You begin to replace [target]'s [parse_zone(target_zone)] with [tool]...", - "[user] begins to replace [target]'s [parse_zone(target_zone)] with [tool].", - "[user] begins to replace [target]'s [parse_zone(target_zone)].") - else - to_chat(user, "[tool] isn't the right type for [parse_zone(target_zone)].") - return -1 - else if(target_zone == BODY_ZONE_L_ARM || target_zone == BODY_ZONE_R_ARM) - display_results(user, target, "You begin to attach [tool] onto [target]...", - "[user] begins to attach [tool] onto [target]'s [parse_zone(target_zone)].", - "[user] begins to attach something onto [target]'s [parse_zone(target_zone)].") - else - to_chat(user, "[tool] must be installed onto an arm.") - return -1 - -/datum/surgery_step/omni/add_prosthetic/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery, default_display_results = FALSE) - if(istype(tool, /obj/item/organ_storage)) - tool.icon_state = initial(tool.icon_state) - tool.desc = initial(tool.desc) - tool.cut_overlays() - tool = tool.contents[1] - if(istype(tool, /obj/item/bodypart) && user.temporarilyRemoveItemFromInventory(tool)) - var/obj/item/bodypart/L = tool - if(!L.attach_limb(target)) - display_results(user, target, "You fail in replacing [target]'s [parse_zone(target_zone)]! Their body has rejected [L]!", - "[user] fails to replace [target]'s [parse_zone(target_zone)]!", - "[user] fails to replaces [target]'s [parse_zone(target_zone)]!") - L.forceMove(target.loc) - return - if(organ_rejection_dam) - target.adjustToxLoss(organ_rejection_dam) - experience_given -= (round(organ_rejection_dam/10)) - display_results(user, target, "You succeed in replacing [target]'s [parse_zone(target_zone)].", - "[user] successfully replaces [target]'s [parse_zone(target_zone)] with [tool]!", - "[user] successfully replaces [target]'s [parse_zone(target_zone)]!") - return - else - var/obj/item/bodypart/L = target.new_body_part(target_zone, FALSE, FALSE) - L.is_pseudopart = TRUE - if(!L.attach_limb(target)) - display_results(user, target, "You fail in attaching [target]'s [parse_zone(target_zone)]! Their body has rejected [L]!", - "[user] fails to attach [target]'s [parse_zone(target_zone)]!", - "[user] fails to attach [target]'s [parse_zone(target_zone)]!") - L.forceMove(target.loc) - return - user.visible_message("[user] finishes attaching [tool]!", "You attach [tool].") - display_results(user, target, "You attach [tool].", - "[user] finishes attaching [tool]!", - "[user] finishes the attachment procedure!") - qdel(tool) - if(istype(tool, /obj/item/chainsaw)) - var/obj/item/mounted_chainsaw/new_arm = new(target) - target_zone == BODY_ZONE_R_ARM ? target.put_in_r_hand(new_arm) : target.put_in_l_hand(new_arm) - return - else if(istype(tool, /obj/item/melee/synthetic_arm_blade)) - var/obj/item/melee/arm_blade/new_arm = new(target,TRUE,TRUE) - target_zone == BODY_ZONE_R_ARM ? target.put_in_r_hand(new_arm) : target.put_in_l_hand(new_arm) - return - surgery.complete() - return ..() //if for some reason we fail everything we'll print out some text okay? diff --git a/code/modules/surgery/omnisurgery/omni_stomachpump.dm b/code/modules/surgery/omnisurgery/omni_stomachpump.dm index 53fbe09ce68b..9d75e040af87 100644 --- a/code/modules/surgery/omnisurgery/omni_stomachpump.dm +++ b/code/modules/surgery/omnisurgery/omni_stomachpump.dm @@ -1,6 +1,6 @@ -//Working the stomach by hand in such a way that you induce vomiting. /datum/surgery_step/omni/stomach_pump name = "Pump Stomach" + implements = list() accept_hand = TRUE repeatable = TRUE time = 20 @@ -9,13 +9,11 @@ show = TRUE valid_locations = list(BODY_ZONE_CHEST) -/datum/surgery_step/omni/stomach_pump/test_op(mob/user, mob/living/target, datum/surgery/omni/surgery) - var/obj/item/organ/stomach/S = target.getorganslot(ORGAN_SLOT_STOMACH) - if(target.stat != DEAD) //shamelessly lifted off the revival surgery but we're looking for the same critera here, a dead, non-husked, revivable patient. - return FALSE +/datum/surgery_step/omni/stomach_pump/test_op(mob/user, mob/living/carbon/target, datum/surgery/omni/surgery) + var/obj/item/organ/stomach/Stomach = target.getorganslot(ORGAN_SLOT_STOMACH) if(HAS_TRAIT(target, TRAIT_HUSK)) return FALSE - if(!S) + if(!Stomach) return FALSE return TRUE diff --git a/code/modules/surgery/omnisurgery/omnisurgery.dm b/code/modules/surgery/omnisurgery/omnisurgery.dm index f4887870c8d4..76b37250e22f 100644 --- a/code/modules/surgery/omnisurgery/omnisurgery.dm +++ b/code/modules/surgery/omnisurgery/omnisurgery.dm @@ -57,12 +57,20 @@ if(tool != null) if(istype(tool,obj)) good = TRUE + to_chat(user,"istype(tool,obj) passed True") break if((tool.tool_behaviour in Step.implements) || (tool in Step.implements)) good = TRUE + to_chat(user,"(tool.tool_behaviour in Step.implements) || (tool in Step.implements)") break if (!good) continue + if(Step.accept_hand == TRUE) + var/good = FALSE + if(tool == null) + good = TRUE + if(!good) + continue if(!Step.test_op(user,target,src)) continue valid_steps[Step] = Step.radial_icon != null ? Step.radial_icon : null diff --git a/code/modules/surgery/omnisurgery/omnisurgery_step.dm b/code/modules/surgery/omnisurgery/omnisurgery_step.dm index ea5ea9f5fbf1..4f291c6dc72b 100644 --- a/code/modules/surgery/omnisurgery/omnisurgery_step.dm +++ b/code/modules/surgery/omnisurgery/omnisurgery_step.dm @@ -2,6 +2,7 @@ var/list/required_layer = list(0,1,2) //What layers can this step be preformed at? var/list/valid_locations = list(BODY_ZONE_CHEST,BODY_ZONE_HEAD,BODY_ZONE_L_ARM,BODY_ZONE_L_LEG,BODY_ZONE_R_ARM,BODY_ZONE_R_LEG,BODY_ZONE_PRECISE_EYES,BODY_ZONE_PRECISE_GROIN,BODY_ZONE_PRECISE_MOUTH) //List of all places this step can be preformed var/requires_bodypart = TRUE //Swap to false if surgery needs to be done on a bodypart that doesn't exist (eg. An amputated limb) + var/target_mobtypes = list() var/show = TRUE //if false, isn't considered a 'valid' step, and cant be preformed. Used for 'base' step var/radial_icon = null // If not null, is the image for the radial var/lying_required = TRUE //Does the vicitm needs to be lying down. diff --git a/code/modules/surgery/surgery.dm b/code/modules/surgery/surgery.dm index c849c21343d4..d6d443b582aa 100644 --- a/code/modules/surgery/surgery.dm +++ b/code/modules/surgery/surgery.dm @@ -33,7 +33,7 @@ return TRUE return FALSE -//Tests a bodypart based on the "requires_bodypart" variable +//Tests a bodypart based on the "requires_bodypart", "requires_bodypart_type" and "is_pseudopart" variables /datum/surgery/proc/test_part(mob/user,mob/living/target) var/selected_zone = user.zone_selected var/mob/living/carbon/carbon_target @@ -42,13 +42,21 @@ carbon_target = target part_affected = carbon_target.get_bodypart(check_zone(selected_zone)) else - return FALSE //consider sending message relaying this "Not valid target for this step" + return FALSE + + //Disallows requires_bodypart surgeries to pass if it is FALSE and part_affected is null if(!(requires_bodypart) && part_affected == null) return TRUE if(requires_bodypart && part_affected) return TRUE - if(requires_bodypart == "DYNAMIC") - return TRUE + + //Disallows requires_bodypart_type surgeries to pass if the part affected is a pseudopart or the bodytype of the limb is different from the required bodytype. + if(requires_bodypart_type && !(part_affected == null)) //Necessary else can't check null statement in part_affected.bodytype + if(requires_bodypart_type != part_affected.bodytype) + return TRUE + if(part_affected.is_pseudopart) + return TRUE + return FALSE return FALSE // Raw Datums diff --git a/code/modules/surgery/surgery_helpers.dm b/code/modules/surgery/surgery_helpers.dm index bb274ce71bbd..48a7b5fe1d10 100644 --- a/code/modules/surgery/surgery_helpers.dm +++ b/code/modules/surgery/surgery_helpers.dm @@ -26,10 +26,6 @@ if(affecting) if(!(S.test_part(user,M))) continue - if(S.requires_bodypart_type && !(affecting.bodytype & S.requires_bodypart_type)) - continue - if(S.requires_real_bodypart && affecting.is_pseudopart) - continue else if(C && S.test_part(user,M)) //mob with no limb in surgery zone when we need a limb continue if(!(S.test_lying(user, M))) diff --git a/code/modules/surgery/surgery_step.dm b/code/modules/surgery/surgery_step.dm index 5666ba47dcad..7cde78b0b391 100644 --- a/code/modules/surgery/surgery_step.dm +++ b/code/modules/surgery/surgery_step.dm @@ -30,8 +30,9 @@ /datum/surgery_step/proc/try_op(mob/user, mob/living/target, target_zone, obj/item/tool, datum/surgery/surgery, try_to_fail = FALSE) var/success = FALSE if(accept_hand) - if(!tool) + if(!tool && tool_check(user, tool)) success = TRUE + if(iscyborg(user)) success = TRUE diff --git a/shiptest.dme b/shiptest.dme index db44182f34db..cfa8b917ac37 100644 --- a/shiptest.dme +++ b/shiptest.dme @@ -3379,7 +3379,6 @@ #include "code\modules\surgery\omnisurgery\omni_movelayer.dm" #include "code\modules\surgery\omnisurgery\omni_organ_manipulation.dm" #include "code\modules\surgery\omnisurgery\omni_plastic_surgery.dm" -#include "code\modules\surgery\omnisurgery\omni_prosthetic_replacement.dm" #include "code\modules\surgery\omnisurgery\omni_remove_embedded_object.dm" #include "code\modules\surgery\omnisurgery\omni_revival.dm" #include "code\modules\surgery\omnisurgery\omni_stomachpump.dm" From fdbbfe8dc0a47beddd2d4633555857f907eefbf5 Mon Sep 17 00:00:00 2001 From: NinMario64 Date: Sat, 6 Apr 2024 16:24:15 -0400 Subject: [PATCH 29/35] Remove other debugstuff accidentally left that in --- code/modules/surgery/omnisurgery/omnisurgery.dm | 2 -- 1 file changed, 2 deletions(-) diff --git a/code/modules/surgery/omnisurgery/omnisurgery.dm b/code/modules/surgery/omnisurgery/omnisurgery.dm index 76b37250e22f..51e6c0d25c23 100644 --- a/code/modules/surgery/omnisurgery/omnisurgery.dm +++ b/code/modules/surgery/omnisurgery/omnisurgery.dm @@ -57,11 +57,9 @@ if(tool != null) if(istype(tool,obj)) good = TRUE - to_chat(user,"istype(tool,obj) passed True") break if((tool.tool_behaviour in Step.implements) || (tool in Step.implements)) good = TRUE - to_chat(user,"(tool.tool_behaviour in Step.implements) || (tool in Step.implements)") break if (!good) continue From 9fbd159487d4c9a9d3dc7c55d24d5aae7dbc82c2 Mon Sep 17 00:00:00 2001 From: NinMario64 Date: Mon, 8 Apr 2024 02:27:06 -0400 Subject: [PATCH 30/35] In the Final (Operating computer hell) Moved chemlist fetching to omni datum TRYING to get a proc to recover a list of surgeries at the layer the player is currently on but goddamnit it's not working send help --- code/game/machinery/computer/Operating.dm | 25 ++++++++++--------- .../surgery/omnisurgery/omnisurgery.dm | 8 ++++++ .../surgery/omnisurgery/omnisurgery_step.dm | 11 ++++++++ code/modules/surgery/surgery_step.dm | 11 -------- 4 files changed, 32 insertions(+), 23 deletions(-) diff --git a/code/game/machinery/computer/Operating.dm b/code/game/machinery/computer/Operating.dm index d014b33010d7..0265d7a55926 100644 --- a/code/game/machinery/computer/Operating.dm +++ b/code/game/machinery/computer/Operating.dm @@ -136,23 +136,24 @@ data["patient"]["toxLoss"] = patient.getToxLoss() data["patient"]["oxyLoss"] = patient.getOxyLoss() data["procedures"] = list() + + var/list/atlayer_surgeries = if(patient.surgeries.len) - for(var/datum/surgery/procedure in patient.surgeries) - var/datum/surgery_step/surgery_step = procedure.get_surgery_step() - var/chems_needed = surgery_step.get_chem_list() + for(var/datum/surgery/omni/surgery_step in atlayer_surgeries) +// var/chems_needed = surgery_step.get_chem_list() var/alternative_step var/alt_chems_needed = "" - if(surgery_step.repeatable) - var/datum/surgery_step/next_step = procedure.get_surgery_next_step() - if(next_step) - alternative_step = capitalize(next_step.name) - alt_chems_needed = next_step.get_chem_list() - else - alternative_step = "Finish operation" +// if(surgery_step.repeatable) +// var/datum/surgery/omni/next_step = procedure.get_layer_surgeries() +// if(next_step) +// alternative_step = capitalize(next_step.name) +// alt_chems_needed = next_step.get_chem_list() +// else +// alternative_step = "Finish operation" data["procedures"] += list(list( - "name" = capitalize("[parse_zone(procedure.location)] [procedure.name]"), + "name" = capitalize("[parse_zone(surgery_step.location)] [surgery_step.name]"), "next_step" = capitalize(surgery_step.name), - "chems_needed" = chems_needed, +// "chems_needed" = chems_needed, "alternative_step" = alternative_step, "alt_chems_needed" = alt_chems_needed )) diff --git a/code/modules/surgery/omnisurgery/omnisurgery.dm b/code/modules/surgery/omnisurgery/omnisurgery.dm index 51e6c0d25c23..c700e9b69c1f 100644 --- a/code/modules/surgery/omnisurgery/omnisurgery.dm +++ b/code/modules/surgery/omnisurgery/omnisurgery.dm @@ -9,6 +9,14 @@ var/atlayer = 0 // 0/1/2 skin/muscle/bone var/datum/surgery_step/omni/last_step //The last step preformed in the surgery +/datum/surgery/omni/proc/get_layer_surgeries() + var/list/all_steps = GLOB.omnisurgerysteps_list.Copy() + var/list/atlayer_surgeries = list() + for(var/datum/surgery_step/omni/Step in all_steps) + if(Step.required_layer == atlayer) + atlayer_surgeries += Step.name + return atlayer_surgeries + /datum/surgery/omni/next_step(mob/user, intent) if(location != user.zone_selected) return FALSE diff --git a/code/modules/surgery/omnisurgery/omnisurgery_step.dm b/code/modules/surgery/omnisurgery/omnisurgery_step.dm index 4f291c6dc72b..16b4cd735d7f 100644 --- a/code/modules/surgery/omnisurgery/omnisurgery_step.dm +++ b/code/modules/surgery/omnisurgery/omnisurgery_step.dm @@ -104,3 +104,14 @@ surgery.step_in_progress = FALSE return advance + +/datum/surgery_step/omni/proc/get_chem_list() + if(!LAZYLEN(chems_needed)) + return + var/list/chems = list() + for(var/R in chems_needed) + var/datum/reagent/temp = GLOB.chemical_reagents_list[R] + if(temp) + var/chemname = temp.name + chems += chemname + return english_list(chems, and_text = require_all_chems ? " and " : " or ") diff --git a/code/modules/surgery/surgery_step.dm b/code/modules/surgery/surgery_step.dm index 7cde78b0b391..b97c62517d42 100644 --- a/code/modules/surgery/surgery_step.dm +++ b/code/modules/surgery/surgery_step.dm @@ -216,17 +216,6 @@ if(target.reagents.has_reagent(R)) return TRUE -/datum/surgery_step/proc/get_chem_list() - if(!LAZYLEN(chems_needed)) - return - var/list/chems = list() - for(var/R in chems_needed) - var/datum/reagent/temp = GLOB.chemical_reagents_list[R] - if(temp) - var/chemname = temp.name - chems += chemname - return english_list(chems, and_text = require_all_chems ? " and " : " or ") - //Replaces visible_message during operations so only people looking over the surgeon can tell what they're doing, allowing for shenanigans. /datum/surgery_step/proc/display_results(mob/user, mob/living/carbon/target, self_message, detailed_message, vague_message, target_detailed = FALSE) var/list/detailed_mobs = get_hearers_in_view(1, user) //Only the surgeon and people looking over his shoulder can see the operation clearly From 650d721f0a5400453379e33a2aa371c06699a6c1 Mon Sep 17 00:00:00 2001 From: FalloutFalcon Date: Tue, 9 Apr 2024 18:12:15 -0500 Subject: [PATCH 31/35] fixing step display --- code/game/machinery/computer/Operating.dm | 28 ++++++++----------- .../surgery/omnisurgery/omnisurgery.dm | 7 +++-- .../tgui/interfaces/OperatingComputer.js | 26 +++-------------- 3 files changed, 20 insertions(+), 41 deletions(-) diff --git a/code/game/machinery/computer/Operating.dm b/code/game/machinery/computer/Operating.dm index 0265d7a55926..533f686249be 100644 --- a/code/game/machinery/computer/Operating.dm +++ b/code/game/machinery/computer/Operating.dm @@ -137,25 +137,19 @@ data["patient"]["oxyLoss"] = patient.getOxyLoss() data["procedures"] = list() - var/list/atlayer_surgeries = + if(patient.surgeries.len) - for(var/datum/surgery/omni/surgery_step in atlayer_surgeries) -// var/chems_needed = surgery_step.get_chem_list() - var/alternative_step - var/alt_chems_needed = "" -// if(surgery_step.repeatable) -// var/datum/surgery/omni/next_step = procedure.get_layer_surgeries() -// if(next_step) -// alternative_step = capitalize(next_step.name) -// alt_chems_needed = next_step.get_chem_list() -// else -// alternative_step = "Finish operation" + for(var/datum/surgery/omni/procedure in patient.surgeries) + var/list/atlayer_surgeries = procedure.get_layer_surgeries() + var/list/listed_surgery_steps = list() + for(var/datum/surgery_step/surgery_step in atlayer_surgeries) + listed_surgery_steps += list( + "name" = capitalize(surgery_step.name), + ) + data["procedures"] += list(list( - "name" = capitalize("[parse_zone(surgery_step.location)] [surgery_step.name]"), - "next_step" = capitalize(surgery_step.name), -// "chems_needed" = chems_needed, - "alternative_step" = alternative_step, - "alt_chems_needed" = alt_chems_needed + "name" = capitalize(procedure.name), + "steps" = listed_surgery_steps, )) return data diff --git a/code/modules/surgery/omnisurgery/omnisurgery.dm b/code/modules/surgery/omnisurgery/omnisurgery.dm index c700e9b69c1f..e320bb000b81 100644 --- a/code/modules/surgery/omnisurgery/omnisurgery.dm +++ b/code/modules/surgery/omnisurgery/omnisurgery.dm @@ -13,11 +13,14 @@ var/list/all_steps = GLOB.omnisurgerysteps_list.Copy() var/list/atlayer_surgeries = list() for(var/datum/surgery_step/omni/Step in all_steps) - if(Step.required_layer == atlayer) - atlayer_surgeries += Step.name + if(atlayer in Step.required_layer) + atlayer_surgeries += Step return atlayer_surgeries /datum/surgery/omni/next_step(mob/user, intent) + for(var/datum/surgery_step/omni/Step in get_layer_surgeries()) + user.visible_message("[Step]") + if(location != user.zone_selected) return FALSE if(step_in_progress) diff --git a/tgui/packages/tgui/interfaces/OperatingComputer.js b/tgui/packages/tgui/interfaces/OperatingComputer.js index a2291676c2e5..d12f2045cb5a 100644 --- a/tgui/packages/tgui/interfaces/OperatingComputer.js +++ b/tgui/packages/tgui/interfaces/OperatingComputer.js @@ -96,29 +96,11 @@ const PatientStateView = (props, context) => { {procedures.length === 0 &&
No Active Procedures
} {procedures.map((procedure) => (
- - - {procedure.next_step} - {procedure.chems_needed && ( - <> - Required Chemicals: -
- {procedure.chems_needed} - - )} + + {procedure.steps.map((step) => ( + - {!!data.alternative_step && ( - - {procedure.alternative_step} - {procedure.alt_chems_needed && ( - <> - Required Chemicals: -
- {procedure.alt_chems_needed} - - )} -
- )} + ))}
))} From b15e0557f0aca44fe58dc2787059664b10b8ef14 Mon Sep 17 00:00:00 2001 From: FalloutFalcon Date: Tue, 9 Apr 2024 21:16:37 -0500 Subject: [PATCH 32/35] better --- code/game/machinery/computer/Operating.dm | 11 ++----- .../surgery/omnisurgery/omni_amputation.dm | 2 +- .../surgery/omnisurgery/omni_brain_surgery.dm | 2 +- .../omnisurgery/omni_coronary_bypass.dm | 2 +- .../surgery/omnisurgery/omni_eye_surgery.dm | 2 +- .../surgery/omnisurgery/omni_gastrectomy.dm | 2 +- .../surgery/omnisurgery/omni_hepatectomy.dm | 2 +- .../omnisurgery/omni_implant_removal.dm | 2 +- .../surgery/omnisurgery/omni_lobectomy.dm | 2 +- .../omnisurgery/omni_organ_manipulation.dm | 2 +- .../omnisurgery/omni_plastic_surgery.dm | 2 +- .../omni_remove_embedded_object.dm | 2 +- .../surgery/omnisurgery/omni_revival.dm | 2 +- .../surgery/omnisurgery/omnisurgery.dm | 11 ++++++- .../surgery/omnisurgery/omnisurgery_step.dm | 1 + code/modules/surgery/surgery_helpers.dm | 32 ++----------------- .../tgui/interfaces/OperatingComputer.js | 5 +-- 17 files changed, 30 insertions(+), 54 deletions(-) diff --git a/code/game/machinery/computer/Operating.dm b/code/game/machinery/computer/Operating.dm index 533f686249be..c21dae648e9b 100644 --- a/code/game/machinery/computer/Operating.dm +++ b/code/game/machinery/computer/Operating.dm @@ -140,21 +140,16 @@ if(patient.surgeries.len) for(var/datum/surgery/omni/procedure in patient.surgeries) - var/list/atlayer_surgeries = procedure.get_layer_surgeries() + var/list/atlayer_surgeries = procedure.get_valid_surgeries() var/list/listed_surgery_steps = list() for(var/datum/surgery_step/surgery_step in atlayer_surgeries) - listed_surgery_steps += list( - "name" = capitalize(surgery_step.name), - ) - + listed_surgery_steps += surgery_step.name data["procedures"] += list(list( - "name" = capitalize(procedure.name), + "name" = capitalize("[procedure.name] ([parse_zone(procedure.location)])"), "steps" = listed_surgery_steps, )) return data - - /obj/machinery/computer/operating/ui_act(action, params) . = ..() if(.) diff --git a/code/modules/surgery/omnisurgery/omni_amputation.dm b/code/modules/surgery/omnisurgery/omni_amputation.dm index da7db87b4ff5..440b95babd4e 100644 --- a/code/modules/surgery/omnisurgery/omni_amputation.dm +++ b/code/modules/surgery/omnisurgery/omni_amputation.dm @@ -1,5 +1,5 @@ /datum/surgery_step/omni/sever_limb - name = "sever limb" + name = "Sever limb" implements = list(//this is fine, detaching limbs doesn't require precision - this is only more precise because zone targeting is randomized /obj/item/shears = 300, TOOL_SCALPEL = 100, diff --git a/code/modules/surgery/omnisurgery/omni_brain_surgery.dm b/code/modules/surgery/omnisurgery/omni_brain_surgery.dm index 948b8b158156..4dca61614807 100644 --- a/code/modules/surgery/omnisurgery/omni_brain_surgery.dm +++ b/code/modules/surgery/omnisurgery/omni_brain_surgery.dm @@ -1,5 +1,5 @@ /datum/surgery_step/omni/fix_brain - name = "fix brain" + name = "Fix brain" implements = list( TOOL_HEMOSTAT = 85, TOOL_SCREWDRIVER = 40, diff --git a/code/modules/surgery/omnisurgery/omni_coronary_bypass.dm b/code/modules/surgery/omnisurgery/omni_coronary_bypass.dm index 05c6774e955d..5b8af038f2dc 100644 --- a/code/modules/surgery/omnisurgery/omni_coronary_bypass.dm +++ b/code/modules/surgery/omnisurgery/omni_coronary_bypass.dm @@ -7,7 +7,7 @@ //an incision but with greater bleed, and a 90% base success chance /datum/surgery_step/omni/incise_heart - name = "incise heart" + name = "Incise heart" implements = list( TOOL_SCALPEL = 90, /obj/item/kitchen/knife = 40, diff --git a/code/modules/surgery/omnisurgery/omni_eye_surgery.dm b/code/modules/surgery/omnisurgery/omni_eye_surgery.dm index ab179d3826fc..51b71bdb1d9c 100644 --- a/code/modules/surgery/omnisurgery/omni_eye_surgery.dm +++ b/code/modules/surgery/omnisurgery/omni_eye_surgery.dm @@ -1,6 +1,6 @@ //fix eyes /datum/surgery_step/omni/fix_eyes - name = "fix eyes" + name = "Fix eyes" implements = list( TOOL_HEMOSTAT = 100, TOOL_SCREWDRIVER = 40) //ow! my eyes ! diff --git a/code/modules/surgery/omnisurgery/omni_gastrectomy.dm b/code/modules/surgery/omnisurgery/omni_gastrectomy.dm index 394af46cf3af..f4468c679a54 100644 --- a/code/modules/surgery/omnisurgery/omni_gastrectomy.dm +++ b/code/modules/surgery/omnisurgery/omni_gastrectomy.dm @@ -1,7 +1,7 @@ ////Gastrectomy, because we truly needed a way to repair stomachs. //95% chance of success to be consistent with most organ-repairing surgeries. /datum/surgery_step/omni/gastrectomy - name = "remove lower duodenum" + name = "Remove lower duodenum" implements = list( TOOL_SCALPEL = 95, /obj/item/melee/transforming/energy/sword = 33, diff --git a/code/modules/surgery/omnisurgery/omni_hepatectomy.dm b/code/modules/surgery/omnisurgery/omni_hepatectomy.dm index b309a0ea23cb..4b51ec2d7ce0 100644 --- a/code/modules/surgery/omnisurgery/omni_hepatectomy.dm +++ b/code/modules/surgery/omnisurgery/omni_hepatectomy.dm @@ -1,7 +1,7 @@ ////hepatectomy, removes damaged parts of the liver so that the liver may regenerate properly //95% chance of success, not 100 because organs are delicate /datum/surgery_step/omni/hepatectomy - name = "remove damaged liver section" + name = "Remove damaged liver section" implements = list( TOOL_SCALPEL = 95, /obj/item/melee/transforming/energy/sword = 33, diff --git a/code/modules/surgery/omnisurgery/omni_implant_removal.dm b/code/modules/surgery/omnisurgery/omni_implant_removal.dm index 0954339aff31..46c96c1ddfb3 100644 --- a/code/modules/surgery/omnisurgery/omni_implant_removal.dm +++ b/code/modules/surgery/omnisurgery/omni_implant_removal.dm @@ -1,6 +1,6 @@ //extract implant (CREATE A TOOL SPECIFICALLY TO DO THIS PLEASE or just add in forceps [when you sprite it]) /datum/surgery_step/omni/extract_implant - name = "extract implant" + name = "Extract implant" implements = list( //TOOL_HEMOSTAT = 100, //TOOL_CROWBAR = 40, diff --git a/code/modules/surgery/omnisurgery/omni_lobectomy.dm b/code/modules/surgery/omnisurgery/omni_lobectomy.dm index c4a0bc7ac893..30fbcfffad0d 100644 --- a/code/modules/surgery/omnisurgery/omni_lobectomy.dm +++ b/code/modules/surgery/omnisurgery/omni_lobectomy.dm @@ -1,6 +1,6 @@ //lobectomy, removes the most damaged lung lobe with a 95% base success chance /datum/surgery_step/omni/lobectomy - name = "excise damaged lung node" + name = "Excise damaged lung node" implements = list( TOOL_SCALPEL = 95, /obj/item/melee/transforming/energy/sword = 33, diff --git a/code/modules/surgery/omnisurgery/omni_organ_manipulation.dm b/code/modules/surgery/omnisurgery/omni_organ_manipulation.dm index 6a87110864f5..bc517521b91a 100644 --- a/code/modules/surgery/omnisurgery/omni_organ_manipulation.dm +++ b/code/modules/surgery/omnisurgery/omni_organ_manipulation.dm @@ -1,6 +1,6 @@ /datum/surgery_step/omni/manipulate_organs time = 6.4 SECONDS - name = "manipulate organs" + name = "Manipulate organs" repeatable = TRUE implements = list(/obj/item/organ = 100, /obj/item/organ_storage = 100, diff --git a/code/modules/surgery/omnisurgery/omni_plastic_surgery.dm b/code/modules/surgery/omnisurgery/omni_plastic_surgery.dm index 26e497e76911..8df19ab4e09b 100644 --- a/code/modules/surgery/omnisurgery/omni_plastic_surgery.dm +++ b/code/modules/surgery/omnisurgery/omni_plastic_surgery.dm @@ -1,6 +1,6 @@ //reshape_face /datum/surgery_step/omni/reshape_face - name = "reshape face" + name = "Reshape face" implements = list( TOOL_SCALPEL = 100, /obj/item/kitchen/knife = 40, diff --git a/code/modules/surgery/omnisurgery/omni_remove_embedded_object.dm b/code/modules/surgery/omnisurgery/omni_remove_embedded_object.dm index ad2287efb3e0..78800c142970 100644 --- a/code/modules/surgery/omnisurgery/omni_remove_embedded_object.dm +++ b/code/modules/surgery/omnisurgery/omni_remove_embedded_object.dm @@ -1,5 +1,5 @@ /datum/surgery_step/omni/remove_object - name = "remove embedded objects" + name = "Remove embedded objects" implements = list( TOOL_HEMOSTAT = 90) time = 32 diff --git a/code/modules/surgery/omnisurgery/omni_revival.dm b/code/modules/surgery/omnisurgery/omni_revival.dm index 4432de47326e..433251ee378f 100644 --- a/code/modules/surgery/omnisurgery/omni_revival.dm +++ b/code/modules/surgery/omnisurgery/omni_revival.dm @@ -32,7 +32,7 @@ //revive after incision /datum/surgery_step/omni/revive - name = "shock brain" + name = "Shock brain" implements = list( /obj/item/shockpaddles = 100, //this is useful for reviving simepeople. /obj/item/melee/baton = 40, //i hate this a lot diff --git a/code/modules/surgery/omnisurgery/omnisurgery.dm b/code/modules/surgery/omnisurgery/omnisurgery.dm index e320bb000b81..9c1292c96a05 100644 --- a/code/modules/surgery/omnisurgery/omnisurgery.dm +++ b/code/modules/surgery/omnisurgery/omnisurgery.dm @@ -8,6 +8,7 @@ speed_modifier = 1 //Step speed modifier var/atlayer = 0 // 0/1/2 skin/muscle/bone var/datum/surgery_step/omni/last_step //The last step preformed in the surgery + can_cancel = FALSE /datum/surgery/omni/proc/get_layer_surgeries() var/list/all_steps = GLOB.omnisurgerysteps_list.Copy() @@ -17,8 +18,16 @@ atlayer_surgeries += Step return atlayer_surgeries +/datum/surgery/omni/proc/get_valid_surgeries() + var/list/layers_surgeries = get_layer_surgeries() + var/list/valid_surgeries = list() + for(var/datum/surgery_step/omni/Step in layers_surgeries) + if(location in Step.valid_locations) + valid_surgeries += Step + return valid_surgeries + /datum/surgery/omni/next_step(mob/user, intent) - for(var/datum/surgery_step/omni/Step in get_layer_surgeries()) + for(var/datum/surgery_step/omni/Step in get_valid_surgeries()) user.visible_message("[Step]") if(location != user.zone_selected) diff --git a/code/modules/surgery/omnisurgery/omnisurgery_step.dm b/code/modules/surgery/omnisurgery/omnisurgery_step.dm index 16b4cd735d7f..a35c2652496e 100644 --- a/code/modules/surgery/omnisurgery/omnisurgery_step.dm +++ b/code/modules/surgery/omnisurgery/omnisurgery_step.dm @@ -42,6 +42,7 @@ success = TRUE break if(success) + surgery.status++ if(target_zone == surgery.location) if(get_location_accessible(target, target_zone) || surgery.ignore_clothes) if(surgery.test_lying(user,target)) diff --git a/code/modules/surgery/surgery_helpers.dm b/code/modules/surgery/surgery_helpers.dm index 48a7b5fe1d10..44f8eb8ecc59 100644 --- a/code/modules/surgery/surgery_helpers.dm +++ b/code/modules/surgery/surgery_helpers.dm @@ -80,43 +80,17 @@ /proc/attempt_cancel_surgery(datum/surgery/S, obj/item/I, mob/living/M, mob/user) var/selected_zone = user.zone_selected - to_chat(user, "You begin to cancel \the [S].") - if (!do_mob(user, M, 3 SECONDS)) - return if(S.status == 1) + to_chat(user, "You begin to cancel \the [S].") + if (!do_mob(user, M, 3 SECONDS)) + return M.surgeries -= S user.visible_message("[user] stops the surgery on [M]'s [parse_zone(selected_zone)].", \ "You stop the surgery on [M]'s [parse_zone(selected_zone)].") qdel(S) return - if(S.can_cancel) - var/required_tool_type = TOOL_CAUTERY - // Historically surgical drapes were used with the cautery in the inactive hand, but these drapes don't seem to exist here - var/obj/item/close_tool = user.get_active_held_item() - var/is_robotic = S.requires_bodypart_type == BODYTYPE_ROBOTIC - - if(is_robotic) - required_tool_type = TOOL_SCREWDRIVER - - if(iscyborg(user)) - close_tool = locate(/obj/item/cautery) in user.held_items - if(!close_tool) - to_chat(user, "You need to equip a cautery in an active slot to stop [M]'s surgery!") - return - else if(!close_tool || close_tool.tool_behaviour != required_tool_type) - to_chat(user, "You need to hold a [is_robotic ? "screwdriver" : "cautery"] in your active hand to stop [M]'s surgery!") - return - - if(ishuman(M)) - var/mob/living/carbon/human/H = M - H.bleed_rate = max((H.bleed_rate - 3), 0) - M.surgeries -= S - user.visible_message("[user] closes [M]'s [parse_zone(selected_zone)] with [close_tool] and stops the surgery.", \ - "You close [M]'s [parse_zone(selected_zone)] with [close_tool] and stop the surgery.") - qdel(S) - /proc/get_location_modifier(mob/M) var/turf/T = get_turf(M) diff --git a/tgui/packages/tgui/interfaces/OperatingComputer.js b/tgui/packages/tgui/interfaces/OperatingComputer.js index d12f2045cb5a..78534c313cc0 100644 --- a/tgui/packages/tgui/interfaces/OperatingComputer.js +++ b/tgui/packages/tgui/interfaces/OperatingComputer.js @@ -96,12 +96,9 @@ const PatientStateView = (props, context) => { {procedures.length === 0 &&
No Active Procedures
} {procedures.map((procedure) => (
- {procedure.steps.map((step) => ( - - +
{step}
))} -
))} From 7fc23c6768b4d623e665d59274f3c823eb602a8f Mon Sep 17 00:00:00 2001 From: NinMario64 Date: Thu, 11 Apr 2024 13:16:56 -0400 Subject: [PATCH 33/35] Update shiptest.dme --- shiptest.dme | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shiptest.dme b/shiptest.dme index 73fcc61cc3e1..85d82eacdfc9 100644 --- a/shiptest.dme +++ b/shiptest.dme @@ -3368,8 +3368,6 @@ #include "code\modules\surgery\bodyparts\species_parts\plasmaman_bodyparts.dm" #include "code\modules\surgery\bodyparts\species_parts\rachnid_bodyparts.dm" #include "code\modules\surgery\bodyparts\species_parts\vox_bodyparts.dm" -#include "code\modules\surgery\omnisurgery\omni_limb_grafting.dm" -#include "code\modules\surgery\omnisurgery\surgery_defines.dm" #include "code\modules\surgery\omnisurgery\omni_amputation.dm" #include "code\modules\surgery\omnisurgery\omni_bone_repair.dm" #include "code\modules\surgery\omnisurgery\omni_coronary_bypass.dm" @@ -3378,6 +3376,7 @@ #include "code\modules\surgery\omnisurgery\omni_healing.dm" #include "code\modules\surgery\omnisurgery\omni_hepatectomy.dm" #include "code\modules\surgery\omnisurgery\omni_implant_removal.dm" +#include "code\modules\surgery\omnisurgery\omni_limb_grafting.dm" #include "code\modules\surgery\omnisurgery\omni_lobectomy.dm" #include "code\modules\surgery\omnisurgery\omni_movelayer.dm" #include "code\modules\surgery\omnisurgery\omni_organ_manipulation.dm" @@ -3387,6 +3386,7 @@ #include "code\modules\surgery\omnisurgery\omni_stomachpump.dm" #include "code\modules\surgery\omnisurgery\omnisurgery.dm" #include "code\modules\surgery\omnisurgery\omnisurgery_step.dm" +#include "code\modules\surgery\omnisurgery\surgery_defines.dm" #include "code\modules\surgery\organs\appendix.dm" #include "code\modules\surgery\organs\augments_arms.dm" #include "code\modules\surgery\organs\augments_chest.dm" From 7ffe7c509c7f9f309b87a9a7656ec9042c7728b6 Mon Sep 17 00:00:00 2001 From: NinMario64 Date: Thu, 11 Apr 2024 17:10:16 -0400 Subject: [PATCH 34/35] Moves surgery_defines to __DEFINES and renames it to "surgery.dm" --- .../omnisurgery/surgery_defines.dm => __DEFINES/surgery.dm} | 0 shiptest.dme | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename code/{modules/surgery/omnisurgery/surgery_defines.dm => __DEFINES/surgery.dm} (100%) diff --git a/code/modules/surgery/omnisurgery/surgery_defines.dm b/code/__DEFINES/surgery.dm similarity index 100% rename from code/modules/surgery/omnisurgery/surgery_defines.dm rename to code/__DEFINES/surgery.dm diff --git a/shiptest.dme b/shiptest.dme index 85d82eacdfc9..08e057bad7ca 100644 --- a/shiptest.dme +++ b/shiptest.dme @@ -136,6 +136,7 @@ #include "code\__DEFINES\status_effects.dm" #include "code\__DEFINES\stock_parts.dm" #include "code\__DEFINES\subsystems.dm" +#include "code\__DEFINES\surgery.dm" #include "code\__DEFINES\tgs.config.dm" #include "code\__DEFINES\tgs.dm" #include "code\__DEFINES\tgui.dm" @@ -3386,7 +3387,6 @@ #include "code\modules\surgery\omnisurgery\omni_stomachpump.dm" #include "code\modules\surgery\omnisurgery\omnisurgery.dm" #include "code\modules\surgery\omnisurgery\omnisurgery_step.dm" -#include "code\modules\surgery\omnisurgery\surgery_defines.dm" #include "code\modules\surgery\organs\appendix.dm" #include "code\modules\surgery\organs\augments_arms.dm" #include "code\modules\surgery\organs\augments_chest.dm" From d22a4c8851b2b5bb669c4787a1baf5d5e1623fe3 Mon Sep 17 00:00:00 2001 From: NinMario64 Date: Sat, 13 Apr 2024 16:14:36 -0400 Subject: [PATCH 35/35] Removed last_step var; Operating Computer Fixes /datum/surgery/omni/last_step was a mistake for an open-ended system. Removing it made the Operating Computer able to fetch all surgeries. --- code/game/machinery/computer/Operating.dm | 2 +- .../omnisurgery/omni_coronary_bypass.dm | 2 - .../surgery/omnisurgery/omni_limb_grafting.dm | 45 ------------------- .../surgery/omnisurgery/omnisurgery.dm | 21 +++++---- 4 files changed, 11 insertions(+), 59 deletions(-) diff --git a/code/game/machinery/computer/Operating.dm b/code/game/machinery/computer/Operating.dm index c21dae648e9b..2a68dfcac3f9 100644 --- a/code/game/machinery/computer/Operating.dm +++ b/code/game/machinery/computer/Operating.dm @@ -140,7 +140,7 @@ if(patient.surgeries.len) for(var/datum/surgery/omni/procedure in patient.surgeries) - var/list/atlayer_surgeries = procedure.get_valid_surgeries() + var/list/atlayer_surgeries = procedure.get_valid_surgeries(user, patient) var/list/listed_surgery_steps = list() for(var/datum/surgery_step/surgery_step in atlayer_surgeries) listed_surgery_steps += surgery_step.name diff --git a/code/modules/surgery/omnisurgery/omni_coronary_bypass.dm b/code/modules/surgery/omnisurgery/omni_coronary_bypass.dm index 5b8af038f2dc..4d7ffd5cfed2 100644 --- a/code/modules/surgery/omnisurgery/omni_coronary_bypass.dm +++ b/code/modules/surgery/omnisurgery/omni_coronary_bypass.dm @@ -71,8 +71,6 @@ /datum/surgery_step/omni/coronary_bypass/test_op(mob/user, mob/living/target,datum/surgery/omni/surgery) var/obj/item/organ/heart/H = target.getorganslot(ORGAN_SLOT_HEART) - if(!istype(surgery.last_step,/datum/surgery_step/omni/incise_heart)) - return FALSE if(H) if(H.damage > 60 && !H.operated) return TRUE diff --git a/code/modules/surgery/omnisurgery/omni_limb_grafting.dm b/code/modules/surgery/omnisurgery/omni_limb_grafting.dm index 40b4499eb3bb..3d8484f7cadb 100644 --- a/code/modules/surgery/omnisurgery/omni_limb_grafting.dm +++ b/code/modules/surgery/omnisurgery/omni_limb_grafting.dm @@ -13,46 +13,6 @@ // var/mob/living/carbon/C = target // if(!C.get_bodypart(user.zone_selected)) //can only start if limb is missing // return 1 - -/datum/surgery_step/omni/prepare_flesh - name = "Prepare Flesh" - implements = list( - TOOL_HEMOSTAT = 100) - time = 12 - show = TRUE - valid_locations = list(BODY_ZONE_R_ARM, BODY_ZONE_L_ARM, BODY_ZONE_L_LEG, BODY_ZONE_R_LEG, BODY_ZONE_HEAD) - experience_given = MEDICAL_SKILL_ORGAN_FIX //won't get full XP if rejected - requires_bodypart = FALSE - target_mobtypes = list(/mob/living/carbon/human, /mob/living/carbon/monkey) - required_layer = list(0) - var/organ_rejection_dam = 0 - -/datum/surgery_step/omni/prepare_flesh/test_op(mob/user, mob/living/target, datum/surgery/omni/surgery) - if(istype(surgery.last_step,/datum/surgery_step/omni/prepare_flesh)) - return FALSE - if(istype(surgery.last_step,/datum/surgery_step/omni/apply_bonegel_limbgrafting)) - return FALSE - return TRUE - - -/datum/surgery_step/omni/apply_bonegel_limbgrafting - name = "Apply Bonegel" - implements = list( - TOOL_BONEGEL = 100) - time = 12 - show = TRUE - valid_locations = list(BODY_ZONE_R_ARM, BODY_ZONE_L_ARM, BODY_ZONE_L_LEG, BODY_ZONE_R_LEG, BODY_ZONE_HEAD) - experience_given = MEDICAL_SKILL_ORGAN_FIX //won't get full XP if rejected - requires_bodypart = FALSE - target_mobtypes = list(/mob/living/carbon/human, /mob/living/carbon/monkey) - required_layer = list(0) - var/organ_rejection_dam = 0 - -/datum/surgery_step/omni/apply_bonegel_limbgrafting/test_op(mob/user, mob/living/target, datum/surgery/omni/surgery) - if(istype(surgery.last_step,/datum/surgery_step/omni/prepare_flesh)) - return TRUE - return FALSE - /datum/surgery_step/omni/graft_limb name = "Graft Limb" implements = list( @@ -72,11 +32,6 @@ required_layer = list(0) var/organ_rejection_dam = 0 -/datum/surgery_step/omni/graft_limb/test_op(mob/user, mob/living/target, datum/surgery/omni/surgery) - if(istype(surgery.last_step,/datum/surgery_step/omni/apply_bonegel_limbgrafting)) - return TRUE - return FALSE - /datum/surgery_step/omni/graft_limb/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) if(istype(tool, /obj/item/organ_storage)) if(!tool.contents.len) diff --git a/code/modules/surgery/omnisurgery/omnisurgery.dm b/code/modules/surgery/omnisurgery/omnisurgery.dm index 9c1292c96a05..a5c96ce4dcd4 100644 --- a/code/modules/surgery/omnisurgery/omnisurgery.dm +++ b/code/modules/surgery/omnisurgery/omnisurgery.dm @@ -7,7 +7,6 @@ possible_locs = BROAD_BODY_ZONES speed_modifier = 1 //Step speed modifier var/atlayer = 0 // 0/1/2 skin/muscle/bone - var/datum/surgery_step/omni/last_step //The last step preformed in the surgery can_cancel = FALSE /datum/surgery/omni/proc/get_layer_surgeries() @@ -18,17 +17,18 @@ atlayer_surgeries += Step return atlayer_surgeries -/datum/surgery/omni/proc/get_valid_surgeries() +/datum/surgery/omni/proc/get_valid_surgeries(user, patient) var/list/layers_surgeries = get_layer_surgeries() var/list/valid_surgeries = list() for(var/datum/surgery_step/omni/Step in layers_surgeries) if(location in Step.valid_locations) - valid_surgeries += Step + if(Step.test_op(user, patient, Step)) + valid_surgeries += Step return valid_surgeries /datum/surgery/omni/next_step(mob/user, intent) - for(var/datum/surgery_step/omni/Step in get_valid_surgeries()) - user.visible_message("[Step]") +// for(var/datum/surgery_step/omni/Step in get_valid_surgeries()) +// user.visible_message("[Step]") if(location != user.zone_selected) return FALSE @@ -41,10 +41,10 @@ var/obj/item/tool = user.get_active_held_item() var/list/possible_steps = get_surgery_step(tool,user,target) if(possible_steps) - var/datum/surgery_step/omni/S = null + var/datum/surgery_step/omni/surgery = null if(possible_steps.len == 1) var/datum/surgery_step/omni/val = possible_steps[1] - S = new val.type + surgery = new val.type else var/P = show_radial_menu(user,target,possible_steps,require_near = TRUE) if(P && user && user.Adjacent(target) && (tool in user)) @@ -54,10 +54,9 @@ continue if(other.location == user.zone_selected) return FALSE - S = new T.type - if(S) - if(S.try_op(user, target, user.zone_selected, tool, src, try_to_fail)) - last_step = S + surgery = new T.type + if(surgery) + if(surgery.try_op(user, target, user.zone_selected, tool, src, try_to_fail)) return TRUE return FALSE