mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2025-12-26 10:12:17 +00:00
circuit imprinter
This commit is contained in:
@@ -73,11 +73,11 @@ using metal and glass, it uses glass and reagents (usually sulfuric acis).
|
||||
/obj/machinery/r_n_d/circuit_imprinter/proc/check_mat(datum/design/being_built, var/M)
|
||||
switch(M)
|
||||
if(MAT_GLASS)
|
||||
return (g_amount - (being_built.materials[M]) >= 0)
|
||||
return (g_amount - (being_built.materials[M]/efficiency_coeff) >= 0)
|
||||
if(MAT_GOLD)
|
||||
return (gold_amount - (being_built.materials[M]) >= 0)
|
||||
return (gold_amount - (being_built.materials[M]/efficiency_coeff) >= 0)
|
||||
if(MAT_DIAMOND)
|
||||
return (diamond_amount - (being_built.materials[M]) >= 0)
|
||||
return (diamond_amount - (being_built.materials[M]/efficiency_coeff) >= 0)
|
||||
else
|
||||
return (reagents.has_reagent(M, (being_built.materials[M]/efficiency_coeff)) != 0)
|
||||
|
||||
|
||||
@@ -457,6 +457,7 @@ proc/CallMaterialName(ID)
|
||||
updateUsrDialog()
|
||||
|
||||
else if(href_list["imprint"]) //Causes the Circuit Imprinter to build something.
|
||||
var/coeff = linked_imprinter.efficiency_coeff
|
||||
var/g2g = 1
|
||||
if(linked_imprinter)
|
||||
var/datum/design/being_built = null
|
||||
@@ -489,13 +490,13 @@ proc/CallMaterialName(ID)
|
||||
break
|
||||
switch(M)
|
||||
if(MAT_GLASS)
|
||||
linked_imprinter.g_amount = max(0, (linked_imprinter.g_amount-being_built.materials[M]))
|
||||
linked_imprinter.g_amount = max(0, (linked_imprinter.g_amount-being_built.materials[M]/coeff))
|
||||
if(MAT_GOLD)
|
||||
linked_imprinter.gold_amount = max(0, (linked_imprinter.gold_amount-being_built.materials[M]))
|
||||
linked_imprinter.gold_amount = max(0, (linked_imprinter.gold_amount-being_built.materials[M]/coeff))
|
||||
if(MAT_DIAMOND)
|
||||
linked_imprinter.diamond_amount = max(0, (linked_imprinter.diamond_amount-being_built.materials[M]))
|
||||
linked_imprinter.diamond_amount = max(0, (linked_imprinter.diamond_amount-being_built.materials[M]/coeff))
|
||||
else
|
||||
linked_imprinter.reagents.remove_reagent(M, being_built.materials[M])
|
||||
linked_imprinter.reagents.remove_reagent(M, being_built.materials[M]/coeff)
|
||||
|
||||
var/P = being_built.build_path //lets save these values before the spawn() just in case. Nobody likes runtimes.
|
||||
spawn(16)
|
||||
@@ -1076,6 +1077,7 @@ proc/CallMaterialName(ID)
|
||||
dat += "Material Amount: [linked_imprinter.TotalMaterials()]<BR>"
|
||||
dat += "Chemical Volume: [linked_imprinter.reagents.total_volume]<HR>"
|
||||
|
||||
var/coeff = linked_imprinter.efficiency_coeff
|
||||
for(var/datum/design/D in files.known_designs)
|
||||
if(!(selected_category in D.category) || !(D.build_type & IMPRINTER))
|
||||
continue
|
||||
@@ -1085,9 +1087,9 @@ proc/CallMaterialName(ID)
|
||||
temp_materials += " | "
|
||||
if (!linked_imprinter.check_mat(D, M))
|
||||
check_materials = 0
|
||||
temp_materials += " <span class='bad'>[D.materials[M]] [CallMaterialName(M)]</span>"
|
||||
temp_materials += " <span class='bad'>[D.materials[M]/coeff] [CallMaterialName(M)]</span>"
|
||||
else
|
||||
temp_materials += " [D.materials[M]] [CallMaterialName(M)]"
|
||||
temp_materials += " [D.materials[M]/coeff] [CallMaterialName(M)]"
|
||||
if (check_materials)
|
||||
dat += "<A href='?src=\ref[src];imprint=[D.id]'>[D.name]</A>[temp_materials]<BR>"
|
||||
else
|
||||
@@ -1103,6 +1105,7 @@ proc/CallMaterialName(ID)
|
||||
dat += "Material Amount: [linked_imprinter.TotalMaterials()]<BR>"
|
||||
dat += "Chemical Volume: [linked_imprinter.reagents.total_volume]<HR>"
|
||||
|
||||
var/coeff = linked_imprinter.efficiency_coeff
|
||||
for(var/datum/design/D in matching_designs)
|
||||
var/temp_materials
|
||||
var/check_materials = 1
|
||||
@@ -1110,9 +1113,9 @@ proc/CallMaterialName(ID)
|
||||
temp_materials += " | "
|
||||
if (!linked_imprinter.check_mat(D, M))
|
||||
check_materials = 0
|
||||
temp_materials += " <span class='bad'>[D.materials[M]] [CallMaterialName(M)]</span>"
|
||||
temp_materials += " <span class='bad'>[D.materials[M]/coeff] [CallMaterialName(M)]</span>"
|
||||
else
|
||||
temp_materials += " [D.materials[M]] [CallMaterialName(M)]"
|
||||
temp_materials += " [D.materials[M]/coeff] [CallMaterialName(M)]"
|
||||
if (check_materials)
|
||||
dat += "<A href='?src=\ref[src];imprint=[D.id]'>[D.name]</A>[temp_materials]<BR>"
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user