From 1be41dbf73ad5939c7d305799b2928da8444be3b Mon Sep 17 00:00:00 2001 From: nicetoolbox Date: Sat, 3 Oct 2020 19:29:11 -0700 Subject: [PATCH] generalize check_mat and categories --- code/modules/research/circuitprinter.dm | 4 ++-- code/modules/research/protolathe.dm | 4 ++-- code/modules/research/rdmachines.dm | 4 ++++ 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/code/modules/research/circuitprinter.dm b/code/modules/research/circuitprinter.dm index f3bf0cc0b08..e083a93fc15 100644 --- a/code/modules/research/circuitprinter.dm +++ b/code/modules/research/circuitprinter.dm @@ -10,7 +10,7 @@ using metal and glass, it uses glass and reagents (usually sulfuric acis). icon_state = "circuit_imprinter" container_type = OPENCONTAINER - var/list/categories = list( + categories = list( "AI Modules", "Computer Boards", "Engineering Machinery", @@ -62,7 +62,7 @@ using metal and glass, it uses glass and reagents (usually sulfuric acis). T += M.rating efficiency_coeff = 2 ** (T - 1) //Only 1 manipulator here, you're making runtimes Razharas -/obj/machinery/r_n_d/circuit_imprinter/proc/check_mat(datum/design/being_built, var/M) +/obj/machinery/r_n_d/circuit_imprinter/check_mat(datum/design/being_built, var/M) var/list/all_materials = being_built.reagents_list + being_built.materials var/A = materials.amount(M) diff --git a/code/modules/research/protolathe.dm b/code/modules/research/protolathe.dm index 4ea24ce7e51..63b6a14860a 100644 --- a/code/modules/research/protolathe.dm +++ b/code/modules/research/protolathe.dm @@ -13,7 +13,7 @@ Note: Must be placed west/left of and R&D console to function. icon_state = "protolathe" container_type = OPENCONTAINER - var/list/categories = list( + categories = list( "Bluespace", "Equipment", "Janitorial", @@ -68,7 +68,7 @@ Note: Must be placed west/left of and R&D console to function. T -= M.rating/10 efficiency_coeff = min(max(0, T), 1) -/obj/machinery/r_n_d/protolathe/proc/check_mat(datum/design/being_built, var/M) // now returns how many times the item can be built with the material +/obj/machinery/r_n_d/protolathe/check_mat(datum/design/being_built, var/M) // now returns how many times the item can be built with the material var/A = materials.amount(M) if(!A) A = reagents.get_reagent_amount(M) diff --git a/code/modules/research/rdmachines.dm b/code/modules/research/rdmachines.dm index 4d9b03b38d3..d2a99e9d957 100644 --- a/code/modules/research/rdmachines.dm +++ b/code/modules/research/rdmachines.dm @@ -19,6 +19,7 @@ var/obj/item/loaded_item = null var/datum/component/material_container/materials //Store for hyper speed! var/efficiency_coeff = 1 + var/list/categories = list() /obj/machinery/r_n_d/New() materials = AddComponent(/datum/component/material_container, list(MAT_METAL, MAT_GLASS, MAT_SILVER, MAT_GOLD, MAT_DIAMOND, MAT_PLASMA, MAT_URANIUM, MAT_BANANIUM, MAT_TRANQUILLITE, MAT_TITANIUM, MAT_BLUESPACE, MAT_PLASTIC), 0, TRUE, /obj/item/stack, CALLBACK(src, .proc/is_insertion_ready), CALLBACK(src, .proc/AfterMaterialInsert)) @@ -130,3 +131,6 @@ overlays += "[initial(name)]_[stack_name]" sleep(10) overlays -= "[initial(name)]_[stack_name]" + +/obj/machinery/r_n_d/proc/check_mat(datum/design/being_built, var/M) + return 0