generalize check_mat and categories

This commit is contained in:
nicetoolbox
2020-10-03 19:29:11 -07:00
parent 1a05adf35a
commit 1be41dbf73
3 changed files with 8 additions and 4 deletions
+2 -2
View File
@@ -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)
+2 -2
View File
@@ -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)
+4
View File
@@ -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