diff --git a/code/__HELPERS/trait_helpers.dm b/code/__HELPERS/trait_helpers.dm index 7ca2893038cc..65f691e66538 100644 --- a/code/__HELPERS/trait_helpers.dm +++ b/code/__HELPERS/trait_helpers.dm @@ -275,6 +275,9 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai /// An advanced surgical tool. If a surgical tool has this flag, it will be able to automatically repeat steps until they succeed. #define TRAIT_ADVANCED_SURGICAL "advanced_surgical" +/// A surgical tool; If a surgical tool has this flag it can be used as an alternative to an open hand in surgery +#define TRAIT_SURGICAL_OPEN_HAND "surgical_hand_alternative" + /// Prevent mobs on the turf from being affected by anything below that turf, such as a pulse demon going under it. Added by a /obj/structure with creates_cover set to TRUE #define TRAIT_TURF_COVERED "turf_covered" diff --git a/code/game/objects/items/robot/cyborg_gripper.dm b/code/game/objects/items/robot/cyborg_gripper.dm index fc8a1b15ebd7..cc392479255d 100644 --- a/code/game/objects/items/robot/cyborg_gripper.dm +++ b/code/game/objects/items/robot/cyborg_gripper.dm @@ -99,7 +99,7 @@ I.forceMove(src) gripped_item = I return - + to_chat(user, "You hold your gripper over [target], but no matter how hard you try, you cannot make yourself grab it.") return @@ -181,6 +181,10 @@ can_help_up = TRUE can_hold_all_items = TRUE +/obj/item/gripper/universal/Initialize(mapload) + . = ..() + ADD_TRAIT(src,TRAIT_SURGICAL_OPEN_HAND, ROUNDSTART_TRAIT) + //////////////////////////////// // MARK: MEDICAL GRIPPER //////////////////////////////// @@ -194,6 +198,10 @@ // REMOVE actions_types from here if you add a can_hold list for this gripper! actions_types = list() +/obj/item/gripper/medical/Initialize(mapload) + . = ..() + ADD_TRAIT(src,TRAIT_SURGICAL_OPEN_HAND, ROUNDSTART_TRAIT) + //////////////////////////////// // MARK: SERVICE GRIPPER //////////////////////////////// diff --git a/code/modules/surgery/abstract_steps.dm b/code/modules/surgery/abstract_steps.dm index 4465f07ca1bb..2632347347c0 100644 --- a/code/modules/surgery/abstract_steps.dm +++ b/code/modules/surgery/abstract_steps.dm @@ -97,7 +97,7 @@ for(var/datum/surgery/S in branches_init) first_step = S.get_surgery_step() - if(!tool && first_step.accept_hand) + if((!tool || HAS_TRAIT(tool, TRAIT_SURGICAL_OPEN_HAND)) && first_step.accept_hand) if(SURGERY_TOOL_HAND in starting_tools) CRASH("[src] was provided with multiple branches that allow an empty hand.") next_surgery = S // if there's no tool, just proceed forward. @@ -141,7 +141,7 @@ if((SURGERY_TOOL_ANY in starting_tools) && next_surgery_step.accept_any_item) CRASH("[src] has a conflict with the next main step [next_surgery_step] in surgery [surgery]: both accept any item.") - if(!tool && next_surgery_step.accept_hand && !(SURGERY_TOOL_HAND in starting_tools)) + if((!tool || HAS_TRAIT(tool, TRAIT_SURGICAL_OPEN_HAND)) && next_surgery_step.accept_hand && !(SURGERY_TOOL_HAND in starting_tools)) next_surgery = surgery for(var/allowed in next_surgery_step.allowed_tools) diff --git a/code/modules/surgery/surgery.dm b/code/modules/surgery/surgery.dm index 35ae69f16ee4..3184d963abb3 100644 --- a/code/modules/surgery/surgery.dm +++ b/code/modules/surgery/surgery.dm @@ -217,9 +217,7 @@ var/success = FALSE if(accept_hand) - if(!tool) - success = TRUE - if(isrobot(user) && istype(tool, /obj/item/gripper/medical)) + if(!tool || HAS_TRAIT(tool, TRAIT_SURGICAL_OPEN_HAND)) success = TRUE if(accept_any_item)