diff --git a/code/game/machinery/constructable_frame.dm b/code/game/machinery/constructable_frame.dm index aa4027dea35..37442ed5ed1 100644 --- a/code/game/machinery/constructable_frame.dm +++ b/code/game/machinery/constructable_frame.dm @@ -52,8 +52,13 @@ nice_list += list("[req_components[component]] [req_component_names[component]]\s") . += span_info("It requires [english_list(nice_list, "no more components")].") - -/obj/structure/frame/machine/proc/update_namelist() +/** + * Collates the displayed names of the machine's components + * + * Arguments: + * * specific_parts - If true, the component should not use base name, but a specific tier + */ +/obj/structure/frame/machine/proc/update_namelist(specific_parts) if(!req_components) return @@ -72,8 +77,10 @@ if(ispath(component_path, /obj/item/stock_parts)) var/obj/item/stock_parts/stock_part = component_path - if(initial(stock_part.base_name)) + if(!specific_parts && initial(stock_part.base_name)) req_component_names[component_path] = initial(stock_part.base_name) + else + req_component_names[component_path] = initial(stock_part.name) /obj/structure/frame/machine/proc/get_req_components_amt() var/amt = 0 @@ -133,23 +140,23 @@ return if(istype(P, /obj/item/circuitboard/machine)) - var/obj/item/circuitboard/machine/B = P - if(!B.build_path) + var/obj/item/circuitboard/machine/board = P + if(!board.build_path) to_chat(user, span_warning("This circuitboard seems to be broken.")) return - if(!anchored && B.needs_anchored) + if(!anchored && board.needs_anchored) to_chat(user, span_warning("The frame needs to be secured first!")) return - if(!user.transferItemToLoc(B, src)) + if(!user.transferItemToLoc(board, src)) return playsound(src.loc, 'sound/items/deconstruct.ogg', 50, TRUE) to_chat(user, span_notice("You add the circuit board to the frame.")) - circuit = B + circuit = board icon_state = "box_2" state = 3 components = list() - req_components = B.req_components.Copy() - update_namelist() + req_components = board.req_components.Copy() + update_namelist(board.specific_parts) return else if(istype(P, /obj/item/circuitboard)) diff --git a/code/game/objects/items/circuitboards/machines/machine_circuitboards.dm b/code/game/objects/items/circuitboards/machines/machine_circuitboards.dm index bd8b05f53b1..f014f69eb9c 100644 --- a/code/game/objects/items/circuitboards/machines/machine_circuitboards.dm +++ b/code/game/objects/items/circuitboards/machines/machine_circuitboards.dm @@ -653,6 +653,7 @@ /obj/item/circuitboard/machine/chem_dispenser/fullupgrade build_path = /obj/machinery/chem_dispenser/fullupgrade + specific_parts = TRUE req_components = list( /obj/item/stock_parts/matter_bin/bluespace = 2, /obj/item/stock_parts/capacitor/quadratic = 2, @@ -663,6 +664,7 @@ /obj/item/circuitboard/machine/chem_dispenser/mutagensaltpeter build_path = /obj/machinery/chem_dispenser/mutagensaltpeter + specific_parts = TRUE req_components = list( /obj/item/stock_parts/matter_bin/bluespace = 2, /obj/item/stock_parts/capacitor/quadratic = 2, @@ -676,6 +678,7 @@ name_extension = "(Abductor Machine Board)" icon_state = "abductor_mod" build_path = /obj/machinery/chem_dispenser/abductor + specific_parts = TRUE req_components = list( /obj/item/stock_parts/matter_bin/bluespace = 2, /obj/item/stock_parts/capacitor/quadratic = 2,