mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-26 13:37:58 +01:00
Make RND machines check for upgraded parts when checking if an item is constructable (#15753)
* Protolathe design buildability check efficiency * Efficiency_coeff rounding error fix Co-authored-by: adrermail@gmail.com <adrermail@gmail.com>
This commit is contained in:
co-authored by
adrermail@gmail.com <adrermail@gmail.com>
parent
cb7aadf62d
commit
53399ff87f
@@ -63,18 +63,18 @@ Note: Must be placed west/left of and R&D console to function.
|
||||
for(var/obj/item/stock_parts/matter_bin/M in component_parts)
|
||||
T += M.rating
|
||||
materials.max_amount = T * 75000
|
||||
T = 1.2
|
||||
T = 12
|
||||
for(var/obj/item/stock_parts/manipulator/M in component_parts)
|
||||
T -= M.rating/10
|
||||
efficiency_coeff = min(max(0, T), 1)
|
||||
T -= M.rating
|
||||
efficiency_coeff = min(max(0, T / 10), 1)
|
||||
|
||||
/obj/machinery/r_n_d/protolathe/check_mat(datum/design/being_built, M) // now returns how many times the item can be built with the material
|
||||
var/A = materials.amount(M)
|
||||
if(!A)
|
||||
A = reagents.get_reagent_amount(M)
|
||||
A = A / max(1, (being_built.reagents_list[M]))
|
||||
A = A / max(1, (being_built.reagents_list[M] * efficiency_coeff))
|
||||
else
|
||||
A = A / max(1, (being_built.materials[M]))
|
||||
A = A / max(1, (being_built.materials[M] * efficiency_coeff))
|
||||
return A
|
||||
|
||||
/obj/machinery/r_n_d/protolathe/attackby(obj/item/O as obj, mob/user as mob, params)
|
||||
|
||||
@@ -427,7 +427,7 @@ won't update every console in existence) but it's more of a hassle to do. Also,
|
||||
|
||||
var/enough_materials = TRUE
|
||||
|
||||
if(!machine.materials.has_materials(efficient_mats, amount))
|
||||
if(!machine.materials.has_materials(being_built.materials, coeff))
|
||||
atom_say("Not enough materials to complete prototype.")
|
||||
enough_materials = FALSE
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user