/obj/structure/engineeringcart name = "engineering cart" desc = "A cart for storing engineering items." icon = 'icons/obj/engicart.dmi' icon_state = "cart" face_while_pulling = FALSE anchored = FALSE density = TRUE var/obj/item/stack/sheet/glass/myglass = null var/obj/item/stack/sheet/metal/mymetal = null var/obj/item/stack/sheet/plasteel/myplasteel = null var/obj/item/flashlight/myflashlight = null var/obj/item/storage/toolbox/mechanical/mybluetoolbox = null var/obj/item/storage/toolbox/electrical/myyellowtoolbox = null var/obj/item/storage/toolbox/emergency/myredtoolbox = null /obj/structure/engineeringcart/Destroy() QDEL_NULL(myglass) QDEL_NULL(mymetal) QDEL_NULL(myplasteel) QDEL_NULL(myflashlight) QDEL_NULL(mybluetoolbox) QDEL_NULL(myyellowtoolbox) QDEL_NULL(myredtoolbox) return ..() /obj/structure/engineeringcart/proc/put_in_cart(obj/item/I, mob/user) user.drop_item() I.loc = src to_chat(user, "You put [I] into [src].") return /obj/structure/engineeringcart/attackby(obj/item/I, mob/user, params) var/fail_msg = "There is already one of those in [src]." if(!I.is_robot_module()) if(istype(I, /obj/item/stack/sheet/glass)) if(!myglass) put_in_cart(I, user) myglass=I update_icon(UPDATE_OVERLAYS) else to_chat(user, fail_msg) else if(istype(I, /obj/item/stack/sheet/metal)) if(!mymetal) put_in_cart(I, user) mymetal=I update_icon(UPDATE_OVERLAYS) else to_chat(user, fail_msg) else if(istype(I, /obj/item/stack/sheet/plasteel)) if(!myplasteel) put_in_cart(I, user) myplasteel=I update_icon(UPDATE_OVERLAYS) else to_chat(user, fail_msg) else if(istype(I, /obj/item/flashlight)) if(!myflashlight) put_in_cart(I, user) myflashlight=I update_icon(UPDATE_OVERLAYS) else to_chat(user, fail_msg) else if(istype(I, /obj/item/storage/toolbox/mechanical)) if(!mybluetoolbox) put_in_cart(I, user) mybluetoolbox=I update_icon(UPDATE_OVERLAYS) else to_chat(user, fail_msg) else if(istype(I, /obj/item/storage/toolbox/electrical)) if(!myyellowtoolbox) put_in_cart(I, user) myyellowtoolbox=I update_icon(UPDATE_OVERLAYS) else to_chat(user, fail_msg) else if(istype(I, /obj/item/storage/toolbox)) if(!myredtoolbox) put_in_cart(I, user) myredtoolbox=I update_icon(UPDATE_OVERLAYS) else to_chat(user, fail_msg) else to_chat(usr, "You cannot interface your modules [src]!") /obj/structure/engineeringcart/tool_act(mob/living/user, obj/item/I, tool_type) if(I.is_robot_module()) to_chat(user, "You cannot interface your modules [src]!") return FALSE return ..() /obj/structure/engineeringcart/wrench_act(mob/living/user, obj/item/I) if(!anchored && !isinspace()) I.play_tool_sound(src, I.tool_volume) user.visible_message( "[user] tightens [src]'s casters.", "You have tightened [src]'s casters.", "You hear ratchet." ) anchored = TRUE else if(anchored) I.play_tool_sound(src, I.tool_volume) user.visible_message( "[user] loosens [src]'s casters.", " You have loosened [src]'s casters.", "You hear ratchet." ) anchored = FALSE return TRUE /obj/structure/engineeringcart/attack_hand(mob/user) var/list/engicart_items = list() if(myglass) engicart_items["Glass"] = image(icon = myglass.icon, icon_state = myglass.icon_state) if(mymetal) engicart_items["Metal"] = image(icon = mymetal.icon, icon_state = mymetal.icon_state) if(myplasteel) engicart_items["Plasteel"] = image(icon = myplasteel.icon, icon_state = myplasteel.icon_state) if(myflashlight) engicart_items["Flashlight"] = image(icon = myflashlight.icon, icon_state = myflashlight.icon_state) if(mybluetoolbox) engicart_items["Mechanical Toolbox"] = image(icon = mybluetoolbox.icon, icon_state = mybluetoolbox.icon_state) if(myredtoolbox) engicart_items["Emergency Toolbox"] = image(icon = myredtoolbox.icon, icon_state = myredtoolbox.icon_state) if(myyellowtoolbox) engicart_items["Electrical Toolbox"] = image(icon = myyellowtoolbox.icon, icon_state = myyellowtoolbox.icon_state) if(!length(engicart_items)) return var/pick = show_radial_menu(user, src, engicart_items, custom_check = CALLBACK(src, PROC_REF(check_menu), user), require_near = TRUE) if(!pick) return switch(pick) if("Glass") if(!myglass) return user.put_in_hands(myglass) to_chat(user, "You take [myglass] from [src].") myglass = null if("Metal") if(!mymetal) return user.put_in_hands(mymetal) to_chat(user, "You take [mymetal] from [src].") mymetal = null if("Plasteel") if(!myplasteel) return user.put_in_hands(myplasteel) to_chat(user, "You take [myplasteel] from [src].") myplasteel = null if("Flashlight") if(!myflashlight) return user.put_in_hands(myflashlight) to_chat(user, "You take [myflashlight] from [src].") myflashlight = null if("Mechanical Toolbox") if(!mybluetoolbox) return user.put_in_hands(mybluetoolbox) to_chat(user, "You take [mybluetoolbox] from [src].") mybluetoolbox = null if("Emergency Toolbox") if(!myredtoolbox) return user.put_in_hands(myredtoolbox) to_chat(user, "You take [myredtoolbox] from [src].") myredtoolbox = null if("Electrical Toolbox") if(!myyellowtoolbox) return user.put_in_hands(myyellowtoolbox) to_chat(user, "You take [myyellowtoolbox] from [src].") myyellowtoolbox = null update_icon(UPDATE_OVERLAYS) /obj/structure/engineeringcart/proc/check_menu(mob/living/user) return istype(user) && !HAS_TRAIT(user, TRAIT_HANDS_BLOCKED) /obj/structure/engineeringcart/update_overlays() . = ..() if(myplasteel) . += "cart_plasteel" if(mymetal) . += "cart_metal" if(myglass) . += "cart_glass" if(myflashlight) . += "cart_flashlight" if(mybluetoolbox) . += "cart_bluetoolbox" if(myredtoolbox) . += "cart_redtoolbox" if(myyellowtoolbox) . += "cart_yellowtoolbox"