From 5da3694877b7dd6c619bec9138678ec75819d8ce Mon Sep 17 00:00:00 2001 From: PollardTheDragon <144391971+PollardTheDragon@users.noreply.github.com> Date: Tue, 15 Apr 2025 10:45:03 -0400 Subject: [PATCH] Makes bits and lenses craft in batches, blackboxes smith upgrade crafting (#28962) --- .../smithing/machinery/kinetic_assembler.dm | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/code/modules/smithing/machinery/kinetic_assembler.dm b/code/modules/smithing/machinery/kinetic_assembler.dm index 29352b821ec..00032834333 100644 --- a/code/modules/smithing/machinery/kinetic_assembler.dm +++ b/code/modules/smithing/machinery/kinetic_assembler.dm @@ -18,6 +18,13 @@ var/obj/item/smithed_item/component/trim /// Finished product var/obj/item/smithed_item/finished_product + /// Products that are produced in batches + var/list/batched_item_types = list( + /obj/item/smithed_item/lens, + /obj/item/smithed_item/tool_bit + ) + /// Amount of extra items made in batches + var/batch_extras = 2 /obj/machinery/smithing/kinetic_assembler/Initialize(mapload) . = ..() @@ -29,6 +36,7 @@ component_parts += new /obj/item/stock_parts/manipulator(null) component_parts += new /obj/item/stock_parts/micro_laser(null) component_parts += new /obj/item/stack/sheet/glass(null) + batched_item_types = typecacheof(batched_item_types) RefreshParts() /obj/machinery/smithing/kinetic_assembler/examine(mob/user) @@ -213,4 +221,13 @@ return playsound(src, 'sound/magic/fellowship_armory.ogg', 50, TRUE) finished_product.forceMove(src.loc) + SSblackbox.record_feedback("tally", "smith_assembler_production", 1, "[finished_product.type]") + if(is_type_in_typecache(finished_product, batched_item_types)) + for(var/iterator in 1 to batch_extras) + var/obj/item/smithed_item/extra_product = new finished_product.type(src.loc) + extra_product.quality = finished_product.quality + extra_product.material = finished_product.material + extra_product.set_stats() + extra_product.update_appearance(UPDATE_NAME) + extra_product.scatter_atom() finished_product = null