mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-20 19:44:09 +01:00
Fixed autolathe merge conflict
This commit is contained in:
@@ -179,75 +179,6 @@
|
||||
/obj/machinery/autolathe/Topic(href, href_list)
|
||||
if(..())
|
||||
return 1
|
||||
if (!busy)
|
||||
if(href_list["menu"])
|
||||
screen = text2num(href_list["menu"])
|
||||
|
||||
if(href_list["category"])
|
||||
selected_category = href_list["category"]
|
||||
|
||||
if(href_list["make"])
|
||||
|
||||
var/turf/T = get_step(src.loc, get_dir(src,usr))
|
||||
|
||||
/////////////////
|
||||
//href protection
|
||||
being_built = files.FindDesignByID(href_list["make"]) //check if it's a valid design
|
||||
if(!being_built)
|
||||
return
|
||||
|
||||
//multiplier checks : only stacks can have one and its value is 1, 10 ,25 or max_multiplier
|
||||
var/multiplier = text2num(href_list["multiplier"])
|
||||
var/max_multiplier = min(50, being_built.materials["$metal"] ?round(m_amount/being_built.materials["$metal"]):INFINITY,being_built.materials["$glass"]?round(g_amount/being_built.materials["$glass"]):INFINITY)
|
||||
var/is_stack = ispath(being_built.build_path, /obj/item/stack)
|
||||
|
||||
if(!is_stack && (multiplier > 1))
|
||||
return
|
||||
if (!(multiplier in list(1,10,25,max_multiplier))) //"enough materials ?" is checked further down
|
||||
return
|
||||
/////////////////
|
||||
|
||||
var/coeff = (is_stack ? 1 : 2 ** prod_coeff) //stacks are unaffected by production coefficient
|
||||
var/metal_cost = being_built.materials["$metal"]
|
||||
var/glass_cost = being_built.materials["$glass"]
|
||||
|
||||
var/power = max(2000, (metal_cost+glass_cost)*multiplier/5)
|
||||
|
||||
if((m_amount >= metal_cost*multiplier/coeff) && (g_amount >= glass_cost*multiplier/coeff))
|
||||
busy = 1
|
||||
use_power(power)
|
||||
icon_state = "autolathe"
|
||||
flick("autolathe_n",src)
|
||||
spawn(32/coeff)
|
||||
use_power(power)
|
||||
if(is_stack)
|
||||
m_amount -= metal_cost*multiplier
|
||||
g_amount -= glass_cost*multiplier
|
||||
var/obj/item/stack/S = new being_built.build_path(T)
|
||||
S.amount = multiplier
|
||||
else
|
||||
m_amount -= metal_cost/coeff
|
||||
g_amount -= glass_cost/coeff
|
||||
var/obj/item/new_item = new being_built.build_path(T)
|
||||
new_item.m_amt /= coeff
|
||||
new_item.g_amt /= coeff
|
||||
if(m_amount < 0)
|
||||
m_amount = 0
|
||||
if(g_amount < 0)
|
||||
g_amount = 0
|
||||
busy = 0
|
||||
src.updateUsrDialog()
|
||||
|
||||
if(href_list["search"])
|
||||
matching_designs.Cut()
|
||||
|
||||
for(var/datum/design/D in files.known_designs)
|
||||
if(findtext(D.name,href_list["to_search"]))
|
||||
matching_designs.Add(D)
|
||||
|
||||
else
|
||||
usr << "<span class=\"alert\">The autolathe is busy. Please wait for completion of previous operation.</span>"
|
||||
|
||||
if(href_list["menu"])
|
||||
screen = text2num(href_list["menu"])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user