diff --git a/code/game/machinery/cell_charger.dm b/code/game/machinery/cell_charger.dm index 83b0c0ee2d..15df92c37e 100644 --- a/code/game/machinery/cell_charger.dm +++ b/code/game/machinery/cell_charger.dm @@ -103,8 +103,18 @@ removecell() /obj/machinery/cell_charger/attack_ai(mob/user) + if(!charging) + return + + charging.forceMove(loc) + to_chat(user, "You remotely disconnect the battery port and eject [charging] from [src].") + + removecell() return +/obj/machinery/cell_charger/attack_robot(mob/user) + attack_ai(user) + /obj/machinery/cell_charger/emp_act(severity) . = ..() diff --git a/code/game/objects/items/robot/robot_items.dm b/code/game/objects/items/robot/robot_items.dm index 1f69cdae2e..4b2e022da7 100644 --- a/code/game/objects/items/robot/robot_items.dm +++ b/code/game/objects/items/robot/robot_items.dm @@ -746,8 +746,8 @@ ***********************************************************************/ /obj/item/weapon/gripper - name = "circuit gripper" - desc = "A simple grasping tool for inserting circuitboards into machinary." + 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 drop instead of use." icon = 'icons/obj/device.dmi' icon_state = "gripper" @@ -755,18 +755,36 @@ //Has a list of items that it can hold. var/list/can_hold = list( - /obj/item/circuitboard + /obj/item/circuitboard, + /obj/item/light, + /obj/item/electronics, + /obj/item/tank, + /obj/item/conveyor_switch_construct, + /obj/item/stack/conveyor, + /obj/item/wallframe, + /obj/item/vending_refill, + /obj/item/stack/sheet, + /obj/item/stack/tile, + /obj/item/stack/rods, + /obj/item/stock_parts + ) + //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() +//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 ..() -/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 @@ -792,18 +810,21 @@ 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 = 0 + continue //We can grab the item, finally. if(grab) - to_chat(user, "You collect \the [I].") + to_chat(user, "You collect \the [I].") I.loc = src wrapped = I return @@ -812,19 +833,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/game/objects/structures/tank_dispenser.dm b/code/game/objects/structures/tank_dispenser.dm index cf9cf2a830..e2298ac6c5 100644 --- a/code/game/objects/structures/tank_dispenser.dm +++ b/code/game/objects/structures/tank_dispenser.dm @@ -74,6 +74,9 @@ ui = new(user, src, ui_key, "TankDispenser", name, 275, 103, master_ui, state) ui.open() +/obj/structure/tank_dispenser/attack_robot(mob/user) + ui_interact(user) + /obj/structure/tank_dispenser/ui_data(mob/user) var/list/data = list() data["oxygen"] = oxygentanks 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/mob/living/silicon/robot/robot_modules.dm b/code/modules/mob/living/silicon/robot/robot_modules.dm index 8f103c496e..ccf38a547b 100644 --- a/code/modules/mob/living/silicon/robot/robot_modules.dm +++ b/code/modules/mob/living/silicon/robot/robot_modules.dm @@ -444,7 +444,7 @@ /obj/item/t_scanner, /obj/item/analyzer, /obj/item/storage/part_replacer/cyborg, - /obj/item/holosign_creator/atmos, + /obj/item/holosign_creator/combifan, /obj/item/weapon/gripper, /obj/item/lightreplacer/cyborg, /obj/item/geiger_counter/cyborg, diff --git a/code/modules/tgui/states/hands.dm b/code/modules/tgui/states/hands.dm index aedae477dd..d73d1058ea 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