diff --git a/code/game/machinery/frame.dm b/code/game/machinery/frame.dm index 91743a8d23..c8f239869d 100644 --- a/code/game/machinery/frame.dm +++ b/code/game/machinery/frame.dm @@ -631,34 +631,64 @@ GLOBAL_LIST(construction_frame_floor) else if(istype(P, /obj/item)) if(state == FRAME_WIRED) if(frame_type.frame_class == FRAME_CLASS_MACHINE) - for(var/I in req_components) - if(istype(P, I) && (req_components[I] > 0)) - playsound(src, 'sound/items/Deconstruct.ogg', 50, 1) - if(istype(P, /obj/item/stack)) - var/obj/item/stack/ST = P - if(ST.get_amount() > 1) - var/camt = min(ST.get_amount(), req_components[I]) // amount of stack to take, idealy amount required, but limited by amount provided - var/obj/item/stack/NS = new ST.stacktype(src, camt) - NS.update_icon() - ST.use(camt) - components += NS - req_components[I] -= camt - update_desc() - break - - user.drop_item() - P.forceMove(src) - components += P - req_components[I]-- - update_desc() - break - to_chat(user, desc) - if(P && P.loc != src && !istype(P, /obj/item/stack/material)) - to_chat(user, span_warning("You cannot add that component to the machine!")) - return + if(istype(P, /obj/item/storage)) + mass_install_parts(user,P) + else + install_part(user,P) update_icon() +/obj/structure/frame/proc/install_part(var/mob/user, var/obj/item/P, var/defer_feedback = FALSE) + var/installed_part = FALSE + for(var/I in req_components) + if(!istype(P, I) || (req_components[I] == 0)) + continue + + installed_part = TRUE + if(istype(P, /obj/item/stack)) + var/obj/item/stack/ST = P + if(ST.get_amount() > 1) + var/camt = min(ST.get_amount(), req_components[I]) // amount of stack to take, idealy amount required, but limited by amount provided + var/obj/item/stack/NS = new ST.stacktype(src, camt) + NS.update_icon() + ST.use(camt) + components += NS + req_components[I] -= camt + break + + if(istype(P.loc,/obj/item/storage)) + var/obj/item/storage/holder = P.loc + holder.remove_from_storage(P, src) + else + user.drop_item() + P.forceMove(src) + components += P + req_components[I]-- + break + + if(defer_feedback) + return installed_part + + if(installed_part) + playsound(src, 'sound/items/Deconstruct.ogg', 50, 1) + update_desc() + to_chat(user, desc) + return TRUE + + to_chat(user, span_warning("You cannot add that component to the machine!")) + return FALSE + +/obj/structure/frame/proc/mass_install_parts(var/mob/user, var/obj/item/storage/S) + var/installed_part = FALSE + for(var/obj/item/P in S.contents) + installed_part |= install_part(user, P, TRUE) + if(!installed_part) + return FALSE + playsound(src, 'sound/items/Deconstruct.ogg', 50, 1) + update_desc() + to_chat(user, desc) + return TRUE + /obj/structure/frame/verb/rotate_counterclockwise() set name = "Rotate Frame Counter-Clockwise" set category = "Object" diff --git a/code/game/objects/items/weapons/storage/pouches.dm b/code/game/objects/items/weapons/storage/pouches.dm index 49e58e7e12..f9228e7d2a 100644 --- a/code/game/objects/items/weapons/storage/pouches.dm +++ b/code/game/objects/items/weapons/storage/pouches.dm @@ -130,6 +130,16 @@ /obj/item/stack/cable_coil, /obj/item/circuitboard ) + // Because you deal with so many parts, and the borg needs this anyway... + use_to_pickup = TRUE + allow_quick_gather = TRUE + allow_quick_empty = TRUE + collection_mode = TRUE + +/obj/item/storage/pouch/eng_parts/borg + name = "parts storage unit" + desc = "Can only hold machinery components." + max_storage_space = INVENTORY_POUCH_SPACE*5 // Borgs need some love here, so very expanded space /obj/item/storage/pouch/medical name = "storage pouch (medical)" diff --git a/code/modules/mob/living/silicon/robot/robot_modules/station.dm b/code/modules/mob/living/silicon/robot/robot_modules/station.dm index 0a48d3862d..8cf9036cc8 100644 --- a/code/modules/mob/living/silicon/robot/robot_modules/station.dm +++ b/code/modules/mob/living/silicon/robot/robot_modules/station.dm @@ -381,6 +381,7 @@ src.modules += new /obj/item/rcd/electric/mounted/borg(src) src.modules += new /obj/item/pickaxe/plasmacutter/borg(src) src.modules += new /obj/item/dogborg/stasis_clamp(src) + src.modules += new /obj/item/storage/pouch/eng_parts/borg(src) src.modules += new /obj/item/holosign_creator/combifan(src) //CHOMPAdd var/datum/matter_synth/metal = new /datum/matter_synth/metal(40000) diff --git a/code/modules/research/part_replacer.dm b/code/modules/research/part_replacer.dm index ccdc65ce9f..7d2b920556 100644 --- a/code/modules/research/part_replacer.dm +++ b/code/modules/research/part_replacer.dm @@ -116,6 +116,13 @@ if(!(target in view(user))) return ..() + if(istype(target, /obj/structure/frame)) + var/obj/structure/frame/F = target + if(F.mass_install_parts(user,src)) + play_rped_sound() + user.Beam(F, icon_state = "rped_upgrade", time = 0.5 SECONDS) + return + if(!istype(target, /obj/machinery)) return