mirror of
https://github.com/Citadel-Station-13/Citadel-Station-13-RP.git
synced 2026-08-22 05:26:36 +01:00
fixes cyborg gripper issues (#7558)
This commit is contained in:
@@ -439,17 +439,6 @@
|
||||
if(P.contents.len > 0)
|
||||
to_chat(user, "<span class='notice'>Some items are refused.</span>")
|
||||
|
||||
else if(istype(O, /obj/item/gripper)) // Grippers. ~Mechoid.
|
||||
var/obj/item/gripper/B = O //B, for Borg.
|
||||
if(!B.get_item())
|
||||
to_chat(user, "\The [B] is not holding anything.")
|
||||
return
|
||||
else
|
||||
var/B_held = B.get_item()
|
||||
to_chat(user, "You use \the [B] to put \the [B_held] into \the [src] slot.")
|
||||
attackby(B_held, user)
|
||||
return
|
||||
|
||||
else
|
||||
to_chat(user, "<span class='notice'>\The [O] doesn't fit into the [src] slot.</span>")
|
||||
return 1
|
||||
|
||||
@@ -160,17 +160,6 @@
|
||||
if(P.contents.len > 0)
|
||||
to_chat(user, "<span class='notice'>Some items are refused.</span>")
|
||||
|
||||
else if(istype(O, /obj/item/gripper)) // Grippers. ~Mechoid.
|
||||
var/obj/item/gripper/B = O //B, for Borg.
|
||||
if(!B.get_item())
|
||||
to_chat(user, "\The [B] is not holding anything.")
|
||||
return
|
||||
else
|
||||
var/B_held = B.get_item()
|
||||
to_chat(user, "You use \the [B] to put \the [B_held] into \the [src].")
|
||||
attackby(B_held, user)
|
||||
return
|
||||
|
||||
else
|
||||
to_chat(user, "<span class='notice'>\The [src] smartly refuses [O].</span>")
|
||||
return 1
|
||||
|
||||
@@ -12,9 +12,9 @@
|
||||
/mob/living/silicon/robot/death(gibbed)
|
||||
if(camera)
|
||||
camera.status = 0
|
||||
var/obj/item/gripper/G = locate(/obj/item/gripper) in contents
|
||||
if(G)
|
||||
G.drop_item()
|
||||
// drop all gripper items
|
||||
for(var/obj/item/gripper/gripper in get_equipped_items())
|
||||
gripper.drop_item()
|
||||
var/obj/item/robot_builtin/dog_sleeper/S = locate(/obj/item/robot_builtin/dog_sleeper) in contents
|
||||
if(S)
|
||||
S.go_out()
|
||||
|
||||
@@ -1,366 +0,0 @@
|
||||
// todo: this shouldn't be a robot item, this is generic.
|
||||
|
||||
//Simple borg hand.
|
||||
//Limited use.
|
||||
/obj/item/gripper
|
||||
name = "magnetic gripper"
|
||||
desc = "A simple grasping tool specialized in construction and engineering work."
|
||||
description_info = "Ctrl-Clicking on the gripper will drop whatever it is holding.<br>\
|
||||
Using an object on the gripper will interact with the item inside it, if it exists, instead."
|
||||
icon = 'icons/obj/device.dmi'
|
||||
icon_state = "gripper"
|
||||
item_flags = ITEM_NO_BLUDGEON | ITEM_ENCUMBERS_WHILE_HELD
|
||||
|
||||
//Has a list of items that it can hold.
|
||||
var/list/can_hold = list(
|
||||
/obj/item/cell,
|
||||
/obj/item/airlock_electronics,
|
||||
/obj/item/tracker_electronics,
|
||||
/obj/item/module/power_control,
|
||||
/obj/item/stock_parts,
|
||||
/obj/item/frame,
|
||||
/obj/item/camera_assembly,
|
||||
/obj/item/tank,
|
||||
/obj/item/circuitboard,
|
||||
/obj/item/smes_coil,
|
||||
/obj/item/fuelrod/,
|
||||
/obj/item/fuel_assembly/
|
||||
)
|
||||
|
||||
/// currently held item
|
||||
VAR_PRIVATE/obj/item/wrapped
|
||||
|
||||
var/conf_inject_clickchain_flags
|
||||
|
||||
/obj/item/gripper/examine(mob/user, dist)
|
||||
. = ..()
|
||||
if(wrapped)
|
||||
. += "<span class='notice'>\The [src] is holding \the [wrapped].</span>"
|
||||
. += wrapped.examine(user)
|
||||
|
||||
/obj/item/gripper/Destroy()
|
||||
remove_item(drop_location())
|
||||
return ..()
|
||||
|
||||
/obj/item/gripper/proc/insert_item(obj/item/I)
|
||||
if(QDELETED(I))
|
||||
return
|
||||
if(wrapped)
|
||||
remove_item(drop_location())
|
||||
wrapped = I
|
||||
I.forceMove(src)
|
||||
RegisterSignals(I, list(COMSIG_PARENT_QDELETING, COMSIG_MOVABLE_MOVED), PROC_REF(unwrap_hook))
|
||||
|
||||
/**
|
||||
* newloc false to not move
|
||||
*/
|
||||
/obj/item/gripper/proc/remove_item(atom/newloc = FALSE)
|
||||
if(!wrapped)
|
||||
return
|
||||
var/obj/item/old = wrapped
|
||||
UnregisterSignal(wrapped, list(COMSIG_PARENT_QDELETING, COMSIG_MOVABLE_MOVED))
|
||||
wrapped = null
|
||||
switch(newloc)
|
||||
if(null)
|
||||
old.moveToNullspace()
|
||||
if(FALSE)
|
||||
else
|
||||
old.forceMove(newloc)
|
||||
|
||||
/obj/item/gripper/proc/unwrap_hook(datum/source)
|
||||
ASSERT(isitem(source))
|
||||
ASSERT(source == wrapped)
|
||||
remove_item(FALSE)
|
||||
|
||||
/obj/item/gripper/proc/get_item()
|
||||
return wrapped
|
||||
|
||||
/obj/item/gripper/CtrlClick(mob/user)
|
||||
drop_item()
|
||||
|
||||
/obj/item/gripper/attack_self(mob/user, datum/event_args/actor/actor)
|
||||
. = ..()
|
||||
if(.)
|
||||
return
|
||||
if(wrapped)
|
||||
return wrapped.attack_self(user)
|
||||
return ..()
|
||||
|
||||
/obj/item/gripper/attackby(obj/item/I, mob/living/user, list/params, clickchain_flags, damage_multiplier)
|
||||
// todo: items should have a melee_receive_chain or something that
|
||||
// lets us arbitrarily route melee_interaction_chain to something else.
|
||||
if(!isnull(wrapped))
|
||||
. = wrapped.attackby(I, user, params, clickchain_flags, damage_multiplier)
|
||||
if(.)
|
||||
return
|
||||
return clickchain_flags | I.afterattack(src, user, clickchain_flags, params)
|
||||
return ..()
|
||||
|
||||
/obj/item/gripper/melee_interaction_chain(datum/event_args/actor/clickchain/clickchain, clickchain_flags)
|
||||
if(!isnull(wrapped))
|
||||
return wrapped.melee_interaction_chain(clickchain, clickchain_flags | CLICKCHAIN_REDIRECTED | conf_inject_clickchain_flags)
|
||||
return ..()
|
||||
|
||||
/obj/item/gripper/verb/drop_item()
|
||||
set name = "Drop Item"
|
||||
set desc = "Release an item from your magnetic gripper."
|
||||
set category = "Robot Commands"
|
||||
|
||||
if(!wrapped)
|
||||
return
|
||||
|
||||
to_chat(usr, "<span class='danger'>You drop \the [wrapped].</span>")
|
||||
remove_item(drop_location())
|
||||
|
||||
/obj/item/gripper/afterattack(atom/target, mob/user, clickchain_flags, list/params)
|
||||
if(istype(target,/obj/item)) //Check that we're not pocketing a mob.
|
||||
//...and that the item is not in a container.
|
||||
if(!isturf(target.loc))
|
||||
return
|
||||
|
||||
var/obj/item/I = target
|
||||
|
||||
if(I.anchored)
|
||||
to_chat(user,"<span class='notice'>You are unable to lift \the [I] from \the [I.loc].</span>")
|
||||
return
|
||||
|
||||
//Check if the item is blacklisted.
|
||||
var/grab = 0
|
||||
for(var/typepath in can_hold)
|
||||
if(istype(I,typepath))
|
||||
grab = 1
|
||||
break
|
||||
|
||||
//We can grab the item, finally.
|
||||
if(grab)
|
||||
to_chat(user, "You collect \the [I].")
|
||||
insert_item(I)
|
||||
return
|
||||
else
|
||||
to_chat(user, "<span class='danger'>Your gripper cannot hold \the [target].</span>")
|
||||
|
||||
else if(istype(target,/obj/machinery/power/apc))
|
||||
var/obj/machinery/power/apc/A = target
|
||||
if(A.opened)
|
||||
if(A.cell)
|
||||
|
||||
insert_item(A.cell)
|
||||
A.cell.add_fingerprint(user)
|
||||
A.cell.update_icon()
|
||||
A.cell = null
|
||||
|
||||
A.charging = 0
|
||||
A.update_icon()
|
||||
|
||||
user.visible_message("<span class='danger'>[user] removes the power cell from [A]!</span>", "You remove the power cell.")
|
||||
|
||||
else if(istype(target,/mob/living/silicon/robot))
|
||||
var/mob/living/silicon/robot/A = target
|
||||
if(A.opened)
|
||||
if(A.cell)
|
||||
insert_item(A.cell)
|
||||
A.cell.add_fingerprint(user)
|
||||
A.cell.update_icon()
|
||||
A.updateicon()
|
||||
A.cell = null
|
||||
|
||||
user.visible_message("<span class='danger'>[user] removes the power cell from [A]!</span>", "You remove the power cell.")
|
||||
|
||||
/obj/item/gripper/omni
|
||||
name = "omni gripper"
|
||||
desc = "A strange grasping tool that can hold anything a human can, but still maintains the limitations of application its more limited cousins have."
|
||||
icon_state = "gripper-omni"
|
||||
|
||||
can_hold = list(/obj/item) // Testing and Event gripper.
|
||||
|
||||
/obj/item/gripper/omni/no_attack
|
||||
conf_inject_clickchain_flags = CLICKCHAIN_DO_NOT_ATTACK
|
||||
|
||||
// VEEEEERY limited version for mining borgs. Basically only for swapping cells and upgrading the drills.
|
||||
/obj/item/gripper/miner
|
||||
name = "drill maintenance gripper"
|
||||
desc = "A simple grasping tool for the maintenance of heavy drilling machines."
|
||||
icon_state = "gripper-mining"
|
||||
|
||||
can_hold = list(
|
||||
/obj/item/cell,
|
||||
/obj/item/stock_parts
|
||||
)
|
||||
|
||||
/obj/item/gripper/security
|
||||
name = "security gripper"
|
||||
desc = "A simple grasping tool for corporate security work."
|
||||
icon_state = "gripper-sec"
|
||||
|
||||
can_hold = list(
|
||||
/obj/item/paper,
|
||||
/obj/item/paper_bundle,
|
||||
/obj/item/pen,
|
||||
/obj/item/sample,
|
||||
/obj/item/forensics/sample_kit,
|
||||
/obj/item/tape_recorder,
|
||||
/obj/item/barrier_tape_roll,
|
||||
/obj/item/uv_light
|
||||
)
|
||||
|
||||
/obj/item/gripper/paperwork
|
||||
name = "paperwork gripper"
|
||||
desc = "A simple grasping tool for clerical work."
|
||||
|
||||
can_hold = list(
|
||||
/obj/item/clipboard,
|
||||
/obj/item/paper,
|
||||
/obj/item/paper_bundle,
|
||||
/obj/item/card/id,
|
||||
/obj/item/book,
|
||||
/obj/item/newspaper
|
||||
)
|
||||
|
||||
/obj/item/gripper/medical
|
||||
name = "medical gripper"
|
||||
desc = "A simple grasping tool for medical work."
|
||||
|
||||
can_hold = list(
|
||||
/obj/item/reagent_containers/glass,
|
||||
/obj/item/storage/pill_bottle,
|
||||
/obj/item/reagent_containers/pill,
|
||||
/obj/item/reagent_containers/blood,
|
||||
/obj/item/stack/material/phoron,
|
||||
/obj/item/implant,
|
||||
/obj/item/nif
|
||||
)
|
||||
|
||||
/obj/item/gripper/research //A general usage gripper, used for toxins/robotics/xenobio/etc
|
||||
name = "scientific gripper"
|
||||
icon_state = "gripper-sci"
|
||||
desc = "A simple grasping tool suited to assist in a wide array of research applications."
|
||||
|
||||
can_hold = list(
|
||||
/obj/item/cell,
|
||||
/obj/item/stock_parts,
|
||||
/obj/item/mmi,
|
||||
/obj/item/robot_parts,
|
||||
/obj/item/robot_upgrade,
|
||||
/obj/item/flash, //to build borgs,
|
||||
/obj/item/disk,
|
||||
/obj/item/circuitboard,
|
||||
/obj/item/reagent_containers/glass,
|
||||
/obj/item/assembly/prox_sensor,
|
||||
/obj/item/healthanalyzer, //to build medibots,
|
||||
/obj/item/slime_cube,
|
||||
/obj/item/slime_crystal,
|
||||
/obj/item/disposable_teleporter/slime,
|
||||
/obj/item/slimepotion,
|
||||
/obj/item/slime_extract,
|
||||
/obj/item/reagent_containers/food/snacks/monkeycube,
|
||||
/obj/item/nif
|
||||
|
||||
)
|
||||
|
||||
/obj/item/gripper/circuit
|
||||
name = "circuit assembly gripper"
|
||||
icon_state = "gripper-circ"
|
||||
desc = "A complex grasping tool used for working with circuitry."
|
||||
|
||||
can_hold = list(
|
||||
/obj/item/cell,
|
||||
/obj/item/electronic_assembly,
|
||||
/obj/item/assembly/electronic_assembly,
|
||||
/obj/item/clothing/under/circuitry,
|
||||
/obj/item/clothing/gloves/circuitry,
|
||||
/obj/item/clothing/glasses/circuitry,
|
||||
/obj/item/clothing/shoes/circuitry,
|
||||
/obj/item/clothing/head/circuitry,
|
||||
/obj/item/clothing/ears/circuitry,
|
||||
/obj/item/clothing/suit/circuitry,
|
||||
/obj/item/implant/integrated_circuit,
|
||||
/obj/item/integrated_circuit
|
||||
|
||||
)
|
||||
|
||||
/obj/item/gripper/service //Used to handle food, drinks, and seeds.
|
||||
name = "service gripper"
|
||||
icon_state = "gripper"
|
||||
desc = "A simple grasping tool used to perform tasks in the service sector, such as handling food, drinks, and seeds."
|
||||
|
||||
can_hold = list(
|
||||
/obj/item/reagent_containers, //simplifies a lot of redundant categorization and spaghetti with reagents
|
||||
/obj/item/glass_extra,
|
||||
/obj/item/seeds,
|
||||
/obj/item/grown,
|
||||
/obj/item/tray,
|
||||
/obj/item/plantspray,
|
||||
/obj/item/reagent_containers/glass,
|
||||
/obj/item/reagent_containers/food/drinks,
|
||||
/obj/item/storage/box/wings
|
||||
)
|
||||
|
||||
/obj/item/gripper/gravekeeper //Used for handling grave things, flowers, etc.
|
||||
name = "grave gripper"
|
||||
icon_state = "gripper"
|
||||
desc = "A specialized grasping tool used in the preparation and maintenance of graves."
|
||||
|
||||
can_hold = list(
|
||||
/obj/item/seeds,
|
||||
/obj/item/grown,
|
||||
/obj/item/material/gravemarker
|
||||
)
|
||||
|
||||
/obj/item/gripper/no_use/organ/Entered(var/atom/movable/AM)
|
||||
..()
|
||||
if(istype(AM, /obj/item/organ))
|
||||
var/obj/item/organ/O = AM
|
||||
O.preserve(GRIPPER_TRAIT)
|
||||
|
||||
/obj/item/gripper/no_use/organ/Exited(var/atom/movable/AM)
|
||||
..()
|
||||
if(istype(AM, /obj/item/organ))
|
||||
var/obj/item/organ/O = AM
|
||||
O.unpreserve(GRIPPER_TRAIT)
|
||||
|
||||
/obj/item/gripper/no_use //Used when you want to hold and put items in other things, but not able to 'use' the item
|
||||
|
||||
/obj/item/gripper/no_use/attack_self(mob/user, datum/event_args/actor/actor)
|
||||
return
|
||||
|
||||
/obj/item/gripper/no_use/organ/robotics
|
||||
name = "robotics organ gripper"
|
||||
icon_state = "gripper-flesh"
|
||||
desc = "A specialized grasping tool used in robotics work."
|
||||
|
||||
can_hold = list(
|
||||
/obj/item/organ/external,
|
||||
/obj/item/organ/internal/brain, //to insert into MMIs,
|
||||
/obj/item/organ/internal/cell,
|
||||
/obj/item/organ/internal/eyes/robot
|
||||
)
|
||||
|
||||
/obj/item/gripper/no_use/mech
|
||||
name = "exosuit gripper"
|
||||
icon_state = "gripper-mech"
|
||||
desc = "A large, heavy-duty grasping tool used in construction of mechs."
|
||||
|
||||
can_hold = list(
|
||||
/obj/item/vehicle_part,
|
||||
/obj/item/vehicle_part/micro,
|
||||
/obj/item/vehicle_module,
|
||||
/obj/item/vehicle_tracking_beacon
|
||||
)
|
||||
|
||||
/obj/item/gripper/no_use/loader //This is used to disallow building with metal.
|
||||
name = "sheet loader"
|
||||
desc = "A specialized loading device, designed to pick up and insert sheets of materials inside machines."
|
||||
icon_state = "gripper-sheet"
|
||||
|
||||
can_hold = list(
|
||||
/obj/item/stack/material
|
||||
)
|
||||
|
||||
/obj/item/gripper/no_use/organ
|
||||
name = "organ gripper"
|
||||
icon_state = "gripper-flesh"
|
||||
desc = "A specialized grasping tool used to preserve and manipulate organic material."
|
||||
|
||||
can_hold = list(
|
||||
/obj/item/organ
|
||||
)
|
||||
@@ -34,7 +34,7 @@
|
||||
/obj/item/tool/wirecutters/cyborg,
|
||||
/obj/item/multitool,
|
||||
/obj/item/lightreplacer,
|
||||
/obj/item/gripper,
|
||||
/obj/item/gripper/engineering,
|
||||
/obj/item/mop,
|
||||
/obj/item/gripper/no_use/loader,
|
||||
/obj/item/extinguisher,
|
||||
|
||||
@@ -81,7 +81,7 @@ GENERATE_ROBOT_MODULE_PRESET(/nanotrasen/engineering)
|
||||
/obj/item/geiger_counter/cyborg,
|
||||
/obj/item/pipe_painter,
|
||||
/obj/item/floor_painter,
|
||||
/obj/item/gripper,
|
||||
/obj/item/gripper/engineering,
|
||||
/obj/item/gripper/no_use/loader,
|
||||
/obj/item/pipe_dispenser,
|
||||
/obj/item/gripper/circuit,
|
||||
|
||||
@@ -136,7 +136,7 @@
|
||||
if(module_provisioning)
|
||||
QDEL_NULL(module_provisioning)
|
||||
if(module_legacy)
|
||||
module_legacy.Reset()
|
||||
module_legacy.Reset(src)
|
||||
QDEL_NULL(module_legacy)
|
||||
// set
|
||||
src.module = module
|
||||
|
||||
@@ -7,10 +7,3 @@
|
||||
|
||||
/mob/living/silicon/robot/should_allow_pickup(obj/item/item, datum/event_args/actor/actor, silent)
|
||||
return item in robot_inventory?.provided_items
|
||||
|
||||
/mob/living/silicon/robot/is_in_inventory(obj/item/item)
|
||||
return ..() || is_in_inventory_robot(item)
|
||||
|
||||
/mob/living/silicon/robot/proc/is_in_inventory_robot(obj/item/item)
|
||||
// Bespoke check that an item is in gripper, as grippers don't count as an inventory slot.
|
||||
return istype(item.loc, /obj/item/gripper) && item.loc.loc == src
|
||||
|
||||
@@ -957,7 +957,7 @@
|
||||
cleaned_human.clean_blood(1)
|
||||
to_chat(cleaned_human, "<font color='red'>[src] cleans your face!</font>")
|
||||
|
||||
for(var/obj/item/storage/bag/ore/ore_bag in inventory.get_held_items())
|
||||
for(var/obj/item/storage/bag/ore/ore_bag in inventory?.get_held_items())
|
||||
if(ore_bag)
|
||||
if(isturf(loc))
|
||||
var/turf/tile = loc
|
||||
@@ -997,6 +997,11 @@
|
||||
state = 1
|
||||
lockdown = state
|
||||
lockcharge = state
|
||||
if(lockdown)
|
||||
// we still need a better way of prying shit out of these guys
|
||||
// but for now this is fine
|
||||
for(var/obj/item/gripper/gripper in get_equipped_items())
|
||||
gripper.drop_item()
|
||||
update_mobility()
|
||||
|
||||
/mob/living/silicon/robot/proc/sensor_mode() //Medical/Security HUD controller for borgs
|
||||
|
||||
@@ -127,18 +127,6 @@
|
||||
src.updateUsrDialog()
|
||||
return 0
|
||||
|
||||
if(istype(O,/obj/item/gripper))
|
||||
var/obj/item/gripper/B = O //B, for Borg.
|
||||
if(!B.get_item())
|
||||
to_chat(user, "\The [B] is not holding anything.")
|
||||
return 0
|
||||
else
|
||||
var/B_held = B.get_item()
|
||||
to_chat(user, "You use \the [B] to load \the [src] with \the [B_held].")
|
||||
attackby(B_held, user)
|
||||
|
||||
return 0
|
||||
|
||||
if(!sheet_reagents[O.type] && (!O.reagents || !O.reagents.total_volume))
|
||||
to_chat(user, "\The [O] is not suitable for blending.")
|
||||
return 1
|
||||
|
||||
Reference in New Issue
Block a user