Merge pull request #4794 from Aranclanos/RnDfloral

The RnD console won't break anymore when the floral gun is possible to build.
This commit is contained in:
Alex
2014-09-15 11:46:33 +01:00
+14 -11
View File
@@ -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)