diff --git a/code/game/machinery/autolathe.dm b/code/game/machinery/autolathe.dm index f6600942cde..ba9667b3e58 100644 --- a/code/game/machinery/autolathe.dm +++ b/code/game/machinery/autolathe.dm @@ -97,7 +97,8 @@ flick("autolathe_[item_inserted.has_material_type(/datum/material/glass) ? "r" : "o"]", src) - directly_use_power(round((amount_inserted / SHEET_MATERIAL_AMOUNT) * active_power_usage * 0.0025)) + //we use initial(active_power_usage) because higher tier parts will have higher active usage but we have no benifit from it + directly_use_power(ROUND_UP((amount_inserted / (MAX_STACK_SIZE * SHEET_MATERIAL_AMOUNT)) * 0.01 * initial(active_power_usage))) /obj/machinery/autolathe/ui_interact(mob/user, datum/tgui/ui) if(!is_operational) @@ -273,7 +274,7 @@ var/charge_per_item = 0 for(var/material in design.materials) charge_per_item += design.materials[material] - charge_per_item = min(active_power_usage, round(charge_per_item * material_cost_coefficient)) + charge_per_item = ROUND_UP((charge_per_item / (MAX_STACK_SIZE * SHEET_MATERIAL_AMOUNT)) * material_cost_coefficient * 0.05 * active_power_usage) var/build_time_per_item = (design.construction_time * design.lathe_time_factor) ** 0.8 //do the printing sequentially diff --git a/code/modules/research/machinery/_production.dm b/code/modules/research/machinery/_production.dm index d71e6244e88..f95145b4b94 100644 --- a/code/modules/research/machinery/_production.dm +++ b/code/modules/research/machinery/_production.dm @@ -23,6 +23,7 @@ . = ..() cached_designs = list() + materials = AddComponent( /datum/component/remote_materials, \ mapload, \ @@ -65,7 +66,6 @@ stripe.color = stripe_color . += stripe - /obj/machinery/rnd/production/examine(mob/user) . = ..() if(!in_range(user, src) && !isobserver(user)) @@ -144,7 +144,8 @@ /obj/machinery/rnd/proc/process_item(obj/item/item_inserted, list/mats_consumed, amount_inserted) PRIVATE_PROC(TRUE) - if(directly_use_power(round((amount_inserted / SHEET_MATERIAL_AMOUNT) * active_power_usage * 0.00025))) + //we use initial(active_power_usage) because higher tier parts will have higher active usage but we have no benifit from it + if(directly_use_power(ROUND_UP((amount_inserted / (MAX_STACK_SIZE * SHEET_MATERIAL_AMOUNT)) * 0.01 * initial(active_power_usage)))) var/mat_name = "iron" var/highest_mat = 0 @@ -206,6 +207,7 @@ */ /obj/machinery/rnd/production/proc/build_efficiency(path) PRIVATE_PROC(TRUE) + SHOULD_BE_PURE(TRUE) if(ispath(path, /obj/item/stack/sheet) || ispath(path, /obj/item/stack/ore/bluespace_crystal)) return 1 @@ -285,6 +287,11 @@ if(isnull(amount)) return + //we use initial(active_power_usage) because higher tier parts will have higher active usage but we have no benifit from it + if(!directly_use_power(ROUND_UP((amount / MAX_STACK_SIZE) * 0.01 * initial(active_power_usage)))) + say("No power to dispense sheets") + return + materials.eject_sheets(material, amount) return TRUE @@ -330,7 +337,7 @@ var/charge_per_item = 0 for(var/material in design.materials) charge_per_item += design.materials[material] - charge_per_item = min(active_power_usage, round(charge_per_item * coefficient)) + charge_per_item = ROUND_UP((charge_per_item / (MAX_STACK_SIZE * SHEET_MATERIAL_AMOUNT)) * coefficient * 0.05 * active_power_usage) var/build_time_per_item = (design.construction_time * design.lathe_time_factor) ** 0.8 //start production