diff --git a/code/modules/integrated_electronics/core/assemblies.dm b/code/modules/integrated_electronics/core/assemblies.dm
index fcb566fcd8..362342942b 100644
--- a/code/modules/integrated_electronics/core/assemblies.dm
+++ b/code/modules/integrated_electronics/core/assemblies.dm
@@ -250,19 +250,23 @@
assembly_components |= component
-/obj/item/device/electronic_assembly/proc/try_remove_component(obj/item/integrated_circuit/IC, mob/user)
+/obj/item/device/electronic_assembly/proc/try_remove_component(obj/item/integrated_circuit/IC, mob/user, silent)
if(!opened)
- to_chat(user, "[src]'s hatch is closed, so you can't fiddle with the internal components.")
+ if(!silent)
+ to_chat(user, "[src]'s hatch is closed, so you can't fiddle with the internal components.")
return FALSE
if(!IC.removable)
- to_chat(user, "[src] is permanently attached to the case.")
+ if(!silent)
+ to_chat(user, "[src] is permanently attached to the case.")
return FALSE
- to_chat(user, "You pop \the [src] out of the case, and slide it out.")
- playsound(src, 'sound/items/Crowbar.ogg', 50, 1)
-
remove_component(IC)
+ if(!silent)
+ to_chat(user, "You pop \the [IC] out of the case, and slide it out.")
+ playsound(src, 'sound/items/crowbar.ogg', 50, 1)
+ user.put_in_hands(IC)
+
return TRUE
// Actually removes the component, doesn't perform any checks.
diff --git a/code/modules/integrated_electronics/core/printer.dm b/code/modules/integrated_electronics/core/printer.dm
index 61223047eb..7ee035a2ec 100644
--- a/code/modules/integrated_electronics/core/printer.dm
+++ b/code/modules/integrated_electronics/core/printer.dm
@@ -7,6 +7,7 @@
var/upgraded = FALSE // When hit with an upgrade disk, will turn true, allowing it to print the higher tier circuits.
var/can_clone = FALSE // Same for above, but will allow the printer to duplicate a specific assembly.
var/current_category = null
+ var/recycling = FALSE // If an assembly is being emptied into this printer
var/list/program // Currently loaded save, in form of list
/obj/item/device/integrated_circuit_printer/proc/check_interactivity(mob/user)
@@ -18,9 +19,9 @@
/obj/item/device/integrated_circuit_printer/Initialize()
. = ..()
- AddComponent(/datum/component/material_container, list(MAT_METAL), MINERAL_MATERIAL_AMOUNT * 25, TRUE, list(/obj/item/stack, /obj/item/integrated_circuit))
+ AddComponent(/datum/component/material_container, list(MAT_METAL), MINERAL_MATERIAL_AMOUNT * 25, TRUE, list(/obj/item/stack, /obj/item/integrated_circuit, /obj/item/device/electronic_assembly))
-/obj/item/device/integrated_circuit_printer/attackby(var/obj/item/O, var/mob/user)
+/obj/item/device/integrated_circuit_printer/attackby(obj/item/O, mob/user)
if(istype(O, /obj/item/disk/integrated_circuit/upgrade/advanced))
if(upgraded)
to_chat(user, "\The [src] already has this upgrade. ")
@@ -41,9 +42,47 @@
interact(user)
return TRUE
+ if(istype(O, /obj/item/device/electronic_assembly))
+ var/obj/item/device/electronic_assembly/EA = O //microtransactions not included
+ if(EA.assembly_components.len)
+ if(recycling)
+ return
+ if(!EA.opened)
+ to_chat(user, "You can't reach [EA]'s components to remove them!")
+ return
+ if(EA.battery)
+ to_chat(user, "Remove [EA]'s power cell first!")
+ return
+ for(var/V in EA.assembly_components)
+ var/obj/item/integrated_circuit/IC = V
+ if(!IC.removable)
+ to_chat(user, "[EA] has irremovable components in the casing, preventing you from emptying it.")
+ return
+ to_chat(user, "You begin recycling [EA]'s components...")
+ playsound(src, 'sound/items/electronic_assembly_emptying.ogg', 50, TRUE)
+ if(!do_after(user, 30, target = src)) //short channel so you don't accidentally start emptying out a complex assembly
+ return
+ recycling = TRUE
+ var/datum/component/material_container/mats = GetComponent(/datum/component/material_container)
+ for(var/V in EA.assembly_components)
+ var/obj/item/integrated_circuit/IC = V
+ if(!mats.has_space(mats.get_item_material_amount(IC)))
+ to_chat(user, "[src] can't hold any more materials!")
+ break
+ if(!do_after(user, 5, target = user))
+ recycling = FALSE
+ return
+ playsound(src, 'sound/items/crowbar.ogg', 50, TRUE)
+ if(EA.try_remove_component(IC, user, TRUE))
+ mats.user_insert(IC, user)
+ to_chat(user, "You recycle all the components[EA.assembly_components.len ? " you could " : " "]from [EA]!")
+ playsound(src, 'sound/items/electronic_assembly_empty.ogg', 50, TRUE)
+ recycling = FALSE
+ return TRUE
+
return ..()
-/obj/item/device/integrated_circuit_printer/attack_self(var/mob/user)
+/obj/item/device/integrated_circuit_printer/attack_self(mob/user)
interact(user)
/obj/item/device/integrated_circuit_printer/interact(mob/user)
@@ -126,12 +165,16 @@
return TRUE
var/obj/item/built = new build_type(drop_location())
+ usr.put_in_hands(built)
if(istype(built, /obj/item/device/electronic_assembly))
var/obj/item/device/electronic_assembly/E = built
E.opened = TRUE
E.update_icon()
+ to_chat(usr, "[capitalize(built.name)] printed.")
+ playsound(src, 'sound/items/jaws_pry.ogg', 50, TRUE)
+
if(href_list["print"])
if(!CONFIG_GET(flag/ic_printing))
to_chat(usr, "CentCom has disabled printing of custom circuitry due to recent allegations of copyright infringement.")
@@ -175,8 +218,9 @@
else
var/datum/component/material_container/materials = GetComponent(/datum/component/material_container)
if(materials.use_amount_type(program["metal_cost"], MAT_METAL))
- SScircuit.load_electronic_assembly(get_turf(src), program)
- to_chat(usr, "Assembly has been printed.")
+ var/obj/item/assembly = SScircuit.load_electronic_assembly(get_turf(src), program)
+ to_chat(usr, "[assembly] has been printed from the provided template!")
+ playsound(src, 'sound/items/poster_being_created.ogg', 50, TRUE)
else
to_chat(usr, "You need [program["metal_cost"]] metal to build that!")
diff --git a/sound/items/electronic_assembly_empty.ogg b/sound/items/electronic_assembly_empty.ogg
new file mode 100644
index 0000000000..9144b414df
Binary files /dev/null and b/sound/items/electronic_assembly_empty.ogg differ
diff --git a/sound/items/electronic_assembly_emptying.ogg b/sound/items/electronic_assembly_emptying.ogg
new file mode 100644
index 0000000000..70e47e7f83
Binary files /dev/null and b/sound/items/electronic_assembly_emptying.ogg differ