mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-29 08:08:49 +01:00
Fixed protolathe not printing things that required reagents.
Better Coefficient
This commit is contained in:
@@ -40,7 +40,7 @@ other types of metals and chemistry for reagents).
|
||||
var/construction_time //Amount of time required for building the object
|
||||
var/build_path = "" //The file path of the object that gets created
|
||||
var/list/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.
|
||||
|
||||
@@ -69,7 +69,8 @@
|
||||
id = "decloner"
|
||||
req_tech = list("combat" = 8, "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
|
||||
category = list("Weapons")
|
||||
|
||||
@@ -110,7 +111,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")
|
||||
|
||||
|
||||
@@ -67,7 +67,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(obj/item/O, mob/user, params)
|
||||
|
||||
@@ -385,9 +385,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, being_built.reagents[R]/coeff))
|
||||
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]/coeff)
|
||||
|
||||
var/P = being_built.build_path //lets save these values before the spawn() just in case. Nobody likes runtimes.
|
||||
var/R = being_built.reliability
|
||||
@@ -823,6 +831,15 @@ 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)
|
||||
|
||||
Reference in New Issue
Block a user