diff --git a/code/modules/research/designs.dm b/code/modules/research/designs.dm index febd1a02a1d..8c74c89ac05 100644 --- a/code/modules/research/designs.dm +++ b/code/modules/research/designs.dm @@ -45,7 +45,7 @@ other types of metals and chemistry for reagents). var/build_path = "" //The file path of the object that gets created var/locked = 0 //If true it will spawn inside a lockbox with currently sec access var/category = null //Primarily used for Mech Fabricators, but can be used for anything - var/reagents + var/list/reagents = list() //List of reagents. Format: "id" = amount. //A proc to calculate the reliability of a design based on tech levels and innate modifiers. //Input: A list of /datum/tech; Output: The new reliabilty. diff --git a/code/modules/research/designs/weapon_designs.dm b/code/modules/research/designs/weapon_designs.dm index bacf0fdf538..545e22d0822 100644 --- a/code/modules/research/designs/weapon_designs.dm +++ b/code/modules/research/designs/weapon_designs.dm @@ -20,7 +20,8 @@ id = "decloner" req_tech = list("combat" = 6, "materials" = 7, "biotech" = 5, "powerstorage" = 6) build_type = PROTOLATHE - materials = list(MAT_GOLD = 5000,MAT_URANIUM = 10000, "mutagen" = 40) + materials = list(MAT_GOLD = 5000,MAT_URANIUM = 10000) + reagents = list("mutagen" = 40) build_path = /obj/item/weapon/gun/energy/decloner locked = 1 category = list("Weapons") @@ -43,7 +44,8 @@ id = "flora_gun" req_tech = list("materials" = 2, "biotech" = 3, "powerstorage" = 3) build_type = PROTOLATHE - materials = list(MAT_METAL = 2000, MAT_GLASS = 500, "radium" = 20) + materials = list(MAT_METAL = 2000, MAT_GLASS = 500) + reagents = list("radium" = 20) build_path = /obj/item/weapon/gun/energy/floragun category = list("Weapons") diff --git a/code/modules/research/protolathe.dm b/code/modules/research/protolathe.dm index d4348ffb505..0bac36ea35b 100644 --- a/code/modules/research/protolathe.dm +++ b/code/modules/research/protolathe.dm @@ -80,7 +80,9 @@ Note: Must be placed west/left of and R&D console to function. var/A = materials.amount(M) if(!A) A = reagents.get_reagent_amount(M) - A = A / max(1, (being_built.materials[M]/efficiency_coeff)) + A = A / max(1, (being_built.reagents[M]/efficiency_coeff)) + else + A = A / max(1, (being_built.materials[M]/efficiency_coeff)) return A /obj/machinery/r_n_d/protolathe/attackby(var/obj/item/O as obj, var/mob/user as mob, params) diff --git a/code/modules/research/rdconsole.dm b/code/modules/research/rdconsole.dm index db5790d643c..44687b0cd49 100644 --- a/code/modules/research/rdconsole.dm +++ b/code/modules/research/rdconsole.dm @@ -405,9 +405,17 @@ won't update every console in existence) but it's more of a hassle to do. Also, src.visible_message("The [src.name] beeps, \"Not enough materials to complete prototype.\"") enough_materials = 0 g2g = 0 + else + for(var/R in being_built.reagents) + if(!linked_lathe.reagents.has_reagent(R)) + src.visible_message("The [src.name] beeps, \"Not enough reagents to complete prototype.\"") + enough_materials = 0 + g2g = 0 if(enough_materials) linked_lathe.materials.use_amount(efficient_mats, amount) + for(var/R in being_built.reagents) + linked_lathe.reagents.remove_reagent(R, being_built.reagents[R]) var/P = being_built.build_path //lets save these values before the spawn() just in case. Nobody likes runtimes. var/O = being_built.locked @@ -843,6 +851,16 @@ won't update every console in existence) but it's more of a hassle to do. Also, temp_material += " [D.materials[M]/coeff] [CallMaterialName(M)]" c = min(c,t) + + for(var/R in D.reagents) + t = linked_lathe.check_mat(D, R) + temp_material += " | " + if (t < 1) + temp_material += "[D.reagents[R]/coeff] [CallMaterialName(R)]" + else + temp_material += " [D.reagents[R]/coeff] [CallMaterialName(R)]" + c = min(c,t) + if (c >= 1) dat += "[D.name]" if(c >= 5)