Merge pull request #12780 from BlackMajor/borgo

Even more engiborg power creep
This commit is contained in:
silicons
2020-07-17 17:08:23 -07:00
committed by GitHub
6 changed files with 58 additions and 20 deletions
+10
View File
@@ -103,8 +103,18 @@
removecell()
/obj/machinery/cell_charger/attack_ai(mob/user)
if(!charging)
return
charging.forceMove(loc)
to_chat(user, "<span class='notice'>You remotely disconnect the battery port and eject [charging] from [src].</span>")
removecell()
return
/obj/machinery/cell_charger/attack_robot(mob/user)
attack_ai(user)
/obj/machinery/cell_charger/emp_act(severity)
. = ..()
+31 -17
View File
@@ -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, "<span class='notice'>You drop the [wrapped].</span>")
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, "<span class='notice'>You collect \the [I].</span>")
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."
@@ -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
@@ -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
@@ -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,
+2 -2
View File
@@ -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