From 53b938f1c37878c9362ca308d63b4f3a78f5c7b7 Mon Sep 17 00:00:00 2001 From: Aranclanos Date: Fri, 12 Sep 2014 07:35:21 -0300 Subject: [PATCH] The RnD console won't break anymore when the floral gun is possible to build. --- code/modules/research/protolathe.dm | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/code/modules/research/protolathe.dm b/code/modules/research/protolathe.dm index f0c4f55f715..d37119fa05b 100644 --- a/code/modules/research/protolathe.dm +++ b/code/modules/research/protolathe.dm @@ -23,7 +23,7 @@ Note: Must be placed west/left of and R&D console to function. var/clown_amount = 0.0 var/adamantine_amount = 0.0 var/efficiency_coeff - + reagents = new() @@ -38,7 +38,7 @@ Note: Must be placed west/left of and R&D console to function. component_parts += new /obj/item/weapon/reagent_containers/glass/beaker(src) component_parts += new /obj/item/weapon/reagent_containers/glass/beaker(src) RefreshParts() - + reagents.my_atom = src /obj/machinery/r_n_d/protolathe/proc/TotalMaterials() //returns the total of all the stored materials. Makes code neater. @@ -57,25 +57,28 @@ Note: Must be placed west/left of and R&D console to function. efficiency_coeff = max(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 + var/A = 0 switch(M) if("$metal") - return (m_amount / max(1, (being_built.materials[M]/efficiency_coeff))) + A = m_amount if("$glass") - return (g_amount / max(1, (being_built.materials[M]/efficiency_coeff))) + A = g_amount if("$gold") - return (gold_amount / max(1, (being_built.materials[M]/efficiency_coeff))) + A = gold_amount if("$silver") - return (silver_amount / max(1, (being_built.materials[M]/efficiency_coeff))) + A = silver_amount if("$plasma") - return (plasma_amount / max(1, (being_built.materials[M]/efficiency_coeff))) + A = plasma_amount if("$uranium") - return (uranium_amount / max(1, (being_built.materials[M]/efficiency_coeff))) + A = uranium_amount if("$diamond") - return (diamond_amount / max(1, (being_built.materials[M]/efficiency_coeff))) + A = diamond_amount if("$clown") - return (clown_amount / max(1, (being_built.materials[M]/efficiency_coeff))) + A = clown_amount else - return (reagents.has_reagent(M, (being_built.materials[M]/efficiency_coeff))) + A = reagents.get_reagent_amount(M) + 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) if (shocked)