From 37bcc87b39cd98ac49cba7f351663a4fa2274b8a Mon Sep 17 00:00:00 2001
From: PollardTheDragon <144391971+PollardTheDragon@users.noreply.github.com>
Date: Wed, 1 Oct 2025 10:49:32 -0400
Subject: [PATCH] Expanded productivity bit usage (#30476)
---
.../objects/items/storage/storage_base.dm | 4 ++++
code/game/objects/items/weapons/kitchen.dm | 2 ++
.../objects/items/weapons/storage/bags.dm | 13 +++++++++++-
code/modules/food_and_drinks/food_base.dm | 6 ++++++
.../smithing/machinery/kinetic_assembler.dm | 20 +++++++++++--------
.../smithing/smithed_items/tool_bits.dm | 1 +
6 files changed, 37 insertions(+), 9 deletions(-)
diff --git a/code/game/objects/items/storage/storage_base.dm b/code/game/objects/items/storage/storage_base.dm
index 17e1f10ec7b..3bd61ec3c10 100644
--- a/code/game/objects/items/storage/storage_base.dm
+++ b/code/game/objects/items/storage/storage_base.dm
@@ -186,6 +186,8 @@
/obj/item/storage/AltClick(mob/user)
if(ishuman(user) && Adjacent(user) && !user.incapacitated(FALSE, TRUE))
+ if(attached_bits.len > 0)
+ ..()
open(user)
add_fingerprint(user)
else if(isobserver(user))
@@ -631,6 +633,8 @@
var/turf/T = get_turf(src)
hide_from(user)
for(var/obj/item/I in contents)
+ if(I & attached_bits)
+ continue
remove_from_storage(I, T)
I.scatter_atom()
CHECK_TICK
diff --git a/code/game/objects/items/weapons/kitchen.dm b/code/game/objects/items/weapons/kitchen.dm
index fcf08c8221e..28505a6153b 100644
--- a/code/game/objects/items/weapons/kitchen.dm
+++ b/code/game/objects/items/weapons/kitchen.dm
@@ -122,6 +122,8 @@
/obj/item/kitchen/knife/Initialize(mapload)
. = ..()
AddComponent(/datum/component/surgery_initiator/robo)
+ RegisterSignal(src, COMSIG_BIT_ATTACH, PROC_REF(add_bit))
+ RegisterSignal(src, COMSIG_CLICK_ALT, PROC_REF(remove_bit))
/obj/item/kitchen/knife/suicide_act(mob/user)
user.visible_message(pick("[user] is slitting [user.p_their()] wrists with [src]! It looks like [user.p_theyre()] trying to commit suicide!", \
diff --git a/code/game/objects/items/weapons/storage/bags.dm b/code/game/objects/items/weapons/storage/bags.dm
index 9322bfddd4b..a9ac3aeafda 100644
--- a/code/game/objects/items/weapons/storage/bags.dm
+++ b/code/game/objects/items/weapons/storage/bags.dm
@@ -265,6 +265,11 @@
icon_state = "portaseeder"
origin_tech = "biotech=3;engineering=2"
+/obj/item/storage/bag/plants/portaseeder/Initialize(mapload)
+ . = ..()
+ RegisterSignal(src, COMSIG_BIT_ATTACH, PROC_REF(add_bit))
+ RegisterSignal(src, COMSIG_CLICK_ALT, PROC_REF(remove_bit))
+
/obj/item/storage/bag/plants/portaseeder/examine(mob/user)
. = ..()
if(Adjacent(user))
@@ -275,8 +280,14 @@
to_chat(user, "[src] has no seeds inside!")
return
var/had_anything = FALSE
+ var/seed_amount = 1
+ // Multiply seeds by productivity
+ seed_amount = clamp(seed_amount * bit_productivity_mod, 1, 4)
+ // Reduce with low efficiency
+ if(bit_efficiency_mod < 1)
+ seed_amount = max(1, seed_amount * bit_efficiency_mod)
for(var/obj/item/O in contents)
- had_anything |= seedify(O, 1)
+ had_anything |= seedify(O, seed_amount)
hide_from_all()
if(had_anything)
to_chat(user, "[src] whirrs a bit as it converts the plants inside to seeds.")
diff --git a/code/modules/food_and_drinks/food_base.dm b/code/modules/food_and_drinks/food_base.dm
index e49cbbf4230..1de21fbd23a 100644
--- a/code/modules/food_and_drinks/food_base.dm
+++ b/code/modules/food_and_drinks/food_base.dm
@@ -348,6 +348,9 @@
var/initial_volume = 0 // the total some of reagents this food had initially
for(var/ingredient in list_reagents)
initial_volume += list_reagents[ingredient]
+
+ // Total slices after factoring in productivity value of the knife
+ slices_num = clamp(slices_num * used.bit_productivity_mod, 1, round(slices_num * 2.5))
// we want to account for how much has been eaten already, reduce slices by how is left vs. how much food we started with
slices_num = clamp(slices_num * (reagents.total_volume / initial_volume), 1, slices_num)
var/slices_lost
@@ -362,6 +365,9 @@
"You crudely slice [src] with [used], destroying some in the process!"
)
slices_lost = rand(1, min(1, round(slices_num / 2)))
+ // Low efficiency means more loss.
+ if(used.bit_efficiency_mod < 1)
+ slices_lost = slices_num * (1 - used.bit_efficiency_mod)
var/reagents_per_slice = reagents.total_volume/slices_num
for(var/i in 1 to (slices_num - slices_lost))
var/obj/slice = new slice_path (loc, TRUE)
diff --git a/code/modules/smithing/machinery/kinetic_assembler.dm b/code/modules/smithing/machinery/kinetic_assembler.dm
index b7f47bda051..db7baf5d18a 100644
--- a/code/modules/smithing/machinery/kinetic_assembler.dm
+++ b/code/modules/smithing/machinery/kinetic_assembler.dm
@@ -23,7 +23,7 @@
/obj/item/smithed_item/tool_bit
)
/// Amount of extra items made in batches
- var/batch_extras = 2
+ var/batch_extras = 1
/obj/machinery/smithing/kinetic_assembler/Initialize(mapload)
. = ..()
@@ -251,14 +251,18 @@
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]")
+ // Modify based on productivity
+ var/total_extras = clamp(round(1 * i.bit_productivity_mod / 2), 0, 2)
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()
+ total_extras += clamp(round(batch_extras * i.bit_productivity_mod / 2), 1, 4)
+ for(var/iterator in 1 to total_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
// MARK: Scientific Assembler
diff --git a/code/modules/smithing/smithed_items/tool_bits.dm b/code/modules/smithing/smithed_items/tool_bits.dm
index e7dc5853088..8d1b22b7342 100644
--- a/code/modules/smithing/smithed_items/tool_bits.dm
+++ b/code/modules/smithing/smithed_items/tool_bits.dm
@@ -147,6 +147,7 @@
speed_mod = -1
failure_rate = -20
durability = 300
+ productivity_mod = 4
quality = /datum/smith_quality/masterwork
material = /datum/smith_material/platinum