[MIRROR] cleans up robot gripper code (#12388)

Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
Co-authored-by: Cameron Lennox <killer65311@gmail.com>
This commit is contained in:
CHOMPStation2StaffMirrorBot
2026-02-08 07:14:07 +01:00
committed by GitHub
co-authored by Kashargul Cameron Lennox
parent a450bdfcf0
commit cbb200e0db
20 changed files with 515 additions and 439 deletions
@@ -271,40 +271,32 @@
if(istype(I, /obj/item/gripper))
var/obj/item/gripper/GR = I
var/obj/item/wrap = GR.get_current_pocket()
var/obj/item/wrap = GR.get_wrapped_item()
if(wrap)
wrap.loc = get_turf(src)
var/result = can_insert(wrap, user)
if(!result)
wrap.forceMove(GR)
if(!(default_deconstruction_screwdriver(user, I)))
default_part_replacement(user, I)
return
return TRUE
add_content(wrap, user)
update_icon()
return FALSE
if(QDELETED(wrap))
GR.update_ref(null)
attack_hand(user)
return TRUE
if(wrap.loc != src)
GR.drop_item_nm()
var/result = can_insert(I, user)
if(!result)
if(!(default_deconstruction_screwdriver(user, I)))
default_part_replacement(user, I)
return
ToCook = wrap
else
attack_hand(user)
if(result == 2)
var/obj/item/grab/G = I
if (G && istype(G) && G.affecting)
cook_mob(G.affecting, user)
return
else
var/result = can_insert(I, user)
if(!result)
if(!(default_deconstruction_screwdriver(user, I)))
default_part_replacement(user, I)
return
if(result == 2)
var/obj/item/grab/G = I
if (G && istype(G) && G.affecting)
cook_mob(G.affecting, user)
return
//From here we can start cooking food
add_content(ToCook, user)
update_icon()
@@ -39,17 +39,10 @@
/obj/item/reagent_containers/cooking_container/attackby(var/obj/item/I as obj, var/mob/user as mob)
if(istype(I, /obj/item/gripper))
var/obj/item/gripper/GR = I
var/obj/item/wrapped = GR.get_current_pocket()
var/obj/item/wrapped = GR.get_wrapped_item()
if(wrapped)
wrapped.forceMove(get_turf(src))
attackby(wrapped, user)
if(QDELETED(wrapped))
wrapped = null
else if(wrapped.loc != src)
wrapped = null
return
return FALSE
for (var/possible_type in insertable)
if (istype(I, possible_type))
@@ -155,24 +155,24 @@
else if(istype(O, /obj/item/gripper)) // Grippers. ~Mechoid.
var/obj/item/gripper/B = O //B, for Borg.
var/obj/item/wrapped = B.get_current_pocket()
var/obj/item/wrapped = B.get_wrapped_item()
if(!wrapped)
to_chat(user, span_filter_notice("\The [B] is not holding anything."))
return
return TRUE
else
to_chat(user, span_filter_notice("You use \the [B] to put \the [wrapped] into \the [src]."))
return
return FALSE
else
to_chat(user, span_notice("\The [src] smartly refuses [O]."))
return 1
return TRUE
/obj/machinery/smartfridge/secure/emag_act(var/remaining_charges, var/mob/user)
if(!emagged)
emagged = 1
locked = -1
to_chat(user, span_filter_notice("You short out the product lock on [src]."))
return 1
return TRUE
/obj/machinery/smartfridge/proc/find_record(var/obj/item/O)
for(var/datum/stored_item/I as anything in item_records)