Protolathe Fix

This commit is contained in:
Fox-McCloud
2015-09-17 03:43:36 -04:00
parent ce91a30da3
commit a35a8cef1b
4 changed files with 26 additions and 4 deletions
+1 -1
View File
@@ -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.
@@ -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")
+3 -1
View File
@@ -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)
+18
View File
@@ -405,9 +405,17 @@ won't update every console in existence) but it's more of a hassle to do. Also,
src.visible_message("<span class='notice'>The [src.name] beeps, \"Not enough materials to complete prototype.\"</span>")
enough_materials = 0
g2g = 0
else
for(var/R in being_built.reagents)
if(!linked_lathe.reagents.has_reagent(R))
src.visible_message("<span class='notice'>The [src.name] beeps, \"Not enough reagents to complete prototype.\"</span>")
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 += "<span class='bad'>[D.reagents[R]/coeff] [CallMaterialName(R)]</span>"
else
temp_material += " [D.reagents[R]/coeff] [CallMaterialName(R)]"
c = min(c,t)
if (c >= 1)
dat += "<A href='?src=\ref[src];build=[D.id];amount=1'>[D.name]</A>"
if(c >= 5)