From afe67451656f570080ca100e64db6df87a70b55b Mon Sep 17 00:00:00 2001 From: NovaBot <154629622+NovaBot13@users.noreply.github.com> Date: Thu, 25 Apr 2024 19:08:19 -0400 Subject: [PATCH] [MIRROR] ChemMaster 3000 printing speed based on servo tier (#2179) * ChemMaster 3000 printing speed based on servo tier (#82836) ## About The Pull Request Reverts the maximum number of containers (pills/patches/etc.) the ChemMaster 3000 can print back to 50. (Recently changed to 12.5 per tier in https://github.com/tgstation/tgstation/pull/82002) Instead, the servo tier determines the speed the batch is printed at. ![image](https://github.com/tgstation/tgstation/assets/83487515/d58a2325-55ff-4087-b73b-9d08ebdf98e5) ![image](https://github.com/tgstation/tgstation/assets/83487515/5d078957-dbc4-483f-8e38-62a815370f66) ## Why It's Good For The Game Refilling the buffer and pressing print for every 13 pills is pointless busywork when there is already a delay now implemented per pill printed. ## Changelog :cl: LT3 balance: ChemMaster can again print a maximum of 50 pills/patches per run balance: Higher tier servos increase ChemMaster printing speed /:cl: * ChemMaster 3000 printing speed based on servo tier --------- Co-authored-by: lessthanthree <83487515+lessthnthree@users.noreply.github.com> --- .../chemistry/machinery/chem_master.dm | 23 +++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/code/modules/reagents/chemistry/machinery/chem_master.dm b/code/modules/reagents/chemistry/machinery/chem_master.dm index 27563a246a7..a44b60c44f8 100644 --- a/code/modules/reagents/chemistry/machinery/chem_master.dm +++ b/code/modules/reagents/chemistry/machinery/chem_master.dm @@ -1,3 +1,5 @@ +#define MAX_CONTAINER_PRINT_AMOUNT 50 + /obj/machinery/chem_master name = "ChemMaster 3000" desc = "Used to separate chemicals and distribute them in a variety of forms." @@ -26,8 +28,8 @@ var/printing_progress /// Number of containers to be printed var/printing_total - /// The amount of containers that can be printed in 1 cycle - var/printing_amount = 1 + /// The time it takes to print a container + var/printing_speed = 0.75 SECONDS /obj/machinery/chem_master/Initialize(mapload) create_reagents(100) @@ -76,7 +78,7 @@ /obj/machinery/chem_master/examine(mob/user) . = ..() if(in_range(user, src) || isobserver(user)) - . += span_notice("The status display reads:
Reagent buffer capacity: [reagents.maximum_volume] units.
Number of containers printed per cycle [printing_amount].") + . += span_notice("The status display reads:
Reagent buffer capacity: [reagents.maximum_volume] units.
Printing speed: [0.75 SECONDS / printing_speed * 100]%.") if(!QDELETED(beaker)) . += span_notice("[beaker] of [beaker.reagents.maximum_volume]u capacity inserted") . += span_notice("Right click with empty hand to remove beaker") @@ -149,10 +151,11 @@ for(var/obj/item/reagent_containers/cup/beaker/beaker in component_parts) reagents.maximum_volume += beaker.reagents.maximum_volume - printing_amount = 0 + //Servo tier determines printing speed + printing_speed = 1 SECONDS for(var/datum/stock_part/servo/servo in component_parts) - printing_amount += servo.tier * 12.5 - printing_amount = min(50, ROUND_UP(printing_amount)) + printing_speed -= servo.tier * 0.25 SECONDS + printing_speed = max(printing_speed, 0.25 SECONDS) ///Return a map of category->list of containers this machine can print /obj/machinery/chem_master/proc/load_printable_containers() @@ -266,6 +269,7 @@ /obj/machinery/chem_master/ui_static_data(mob/user) var/list/data = list() + data["maxPrintable"] = MAX_CONTAINER_PRINT_AMOUNT data["categories"] = list() for(var/category in printable_containers) //make the category @@ -295,7 +299,6 @@ .["isPrinting"] = is_printing .["printingProgress"] = printing_progress .["printingTotal"] = printing_total - .["maxPrintable"] = printing_amount //contents of source beaker var/list/beaker_data = null @@ -471,7 +474,7 @@ item_count = text2num(item_count) if(isnull(item_count) || item_count <= 0) return FALSE - item_count = min(item_count, printing_amount) + item_count = min(item_count, MAX_CONTAINER_PRINT_AMOUNT) var/volume_in_each = round(reagents.total_volume / item_count, CHEMICAL_VOLUME_ROUNDING) // Generate item name @@ -535,7 +538,7 @@ //print more items item_count -- if(item_count > 0) - addtimer(CALLBACK(src, PROC_REF(create_containers), user, item_count, item_name, volume_in_each), 0.75 SECONDS) + addtimer(CALLBACK(src, PROC_REF(create_containers), user, item_count, item_name, volume_in_each), printing_speed) else is_printing = FALSE update_appearance(UPDATE_OVERLAYS) @@ -550,3 +553,5 @@ if(!length(containers)) containers = list(CAT_CONDIMENTS = GLOB.reagent_containers[CAT_CONDIMENTS]) return containers + +#undef MAX_CONTAINER_PRINT_AMOUNT