diff --git a/code/game/objects/items/robot/robot_items.dm b/code/game/objects/items/robot/robot_items.dm index 98ac9a52be..ce13e3f24c 100644 --- a/code/game/objects/items/robot/robot_items.dm +++ b/code/game/objects/items/robot/robot_items.dm @@ -747,7 +747,7 @@ /obj/item/weapon/gripper name = "engineering gripper" - desc = "A simple grasping tool for interacting with various engineering related items, such as circuits, gas tanks and conveyer belts. Alt Click to open held item UI" + desc = "A simple grasping tool for interacting with various engineering related items, such as circuits, gas tanks and conveyer belts. Alt click to drop instead of use." icon = 'icons/obj/device.dmi' icon_state = "gripper" @@ -762,27 +762,28 @@ /obj/item/conveyor_switch_construct, /obj/item/stack/conveyor, /obj/item/wallframe, - /obj/item/vending_refill + /obj/item/vending_refill, + /obj/item/stack/sheet, + /obj/item/stack/tile, + /obj/item/stack/rods + ) + //Basically a blacklist for any subtypes above we dont want + var/list/cannot_hold = list( + /obj/item/stack/sheet/mineral/plasma, + /obj/item/stack/sheet/plasteel ) var/obj/item/wrapped = null // Item currently being held. -/obj/item/weapon/gripper/attack_self(mob/user) +//Used to interact with UI's of held items, such as gas tanks and airlock electronics. +/obj/item/weapon/gripper/AltClick(mob/user) if(wrapped) wrapped.forceMove(get_turf(wrapped)) to_chat(user, "You drop the [wrapped].") wrapped = null return ..() -//Used to interact with UI's of held items, such as gas tanks and airlock electronics. -/obj/item/weapon/gripper/AltClick(mob/user) - if(wrapped) - wrapped.loc = user - wrapped.ui_interact(user, "main", null, TRUE, null, GLOB.deep_inventory_state) - wrapped.loc = src - return ..() - -/obj/item/weapon/gripper/afterattack(var/atom/target, var/mob/living/user, proximity, params) +/obj/item/weapon/gripper/afterattack(var/atom/target, var/mob/living/silicon/robot/user, proximity, params) if(!proximity) return @@ -808,14 +809,19 @@ return else if(istype(target,/obj/item)) - var/obj/item/I = target - var/grab = 0 + for(var/typepath in can_hold) if(istype(I,typepath)) - grab = 1 - break + for(var/badpath in cannot_hold) + if(istype(I,badpath)) + if(user.emagged) + grab = 1 + break + else + grab = 1 + break //We can grab the item, finally. if(grab) @@ -828,19 +834,12 @@ /obj/item/weapon/gripper/mining name = "shelter capsule deployer" - desc = "A simple grasping tool for carrying and deploying shelter capsules." + desc = "A simple grasping tool for carrying and deploying shelter capsules. Alt click to drop instead of use." icon_state = "gripper_mining" can_hold = list( /obj/item/survivalcapsule ) -/obj/item/weapon/gripper/mining/attack_self() - if(wrapped) - wrapped.forceMove(get_turf(wrapped)) - wrapped.attack_self() - wrapped = null - return - /obj/item/gun/energy/plasmacutter/cyborg name = "cyborg plasma cutter" desc = "A basic variation of the plasma cutter, compressed into a cyborg chassis. Less effective than normal plasma cutters." diff --git a/code/modules/mob/living/silicon/robot/inventory.dm b/code/modules/mob/living/silicon/robot/inventory.dm index bb6c37a010..0d8a0880a8 100644 --- a/code/modules/mob/living/silicon/robot/inventory.dm +++ b/code/modules/mob/living/silicon/robot/inventory.dm @@ -2,7 +2,18 @@ //as they handle all relevant stuff like adding it to the player's screen and such //Returns the thing in our active hand (whatever is in our active module-slot, in this case) +//This proc has been butchered into a proc that overrides borg item holding for the sake of making grippers work. +//I'd be immensely thankful if anyone can figure out a less obtuse way of making grippers work without breaking functionality. /mob/living/silicon/robot/get_active_held_item() + var/item = module_active + if(istype(item, /obj/item/weapon/gripper)) + var/obj/item/weapon/gripper/G = item + if(G.wrapped) + if(G.wrapped.loc != G) + G.wrapped = null + return module_active + item = G.wrapped + return item return module_active diff --git a/code/modules/tgui/states/hands.dm b/code/modules/tgui/states/hands.dm index 5da0e5d500..1cd4ae38f5 100644 --- a/code/modules/tgui/states/hands.dm +++ b/code/modules/tgui/states/hands.dm @@ -19,7 +19,7 @@ GLOBAL_DATUM_INIT(hands_state, /datum/ui_state/hands_state, new) return UI_INTERACTIVE return UI_CLOSE -/mob/living/silicon/robot/hands_can_use_topic(src_object) - if(activated(src_object)) +/mob/living/silicon/robot/hands_can_use_topic(obj/src_object) + if(activated(src_object) || istype(src_object.loc, /obj/item/weapon/gripper)) return UI_INTERACTIVE return UI_CLOSE