From 99dd9bc7491911f507d1246f19bdeb378b8179b3 Mon Sep 17 00:00:00 2001 From: Razharas Date: Sun, 9 Mar 2014 02:33:24 +0400 Subject: [PATCH] Exofabs upgrading overlap fix Now tech upgrading and part upgrading do not override eachother Also changes some numbers to be less insane with current stacking --- code/game/mecha/mech_fabricator.dm | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/code/game/mecha/mech_fabricator.dm b/code/game/mecha/mech_fabricator.dm index ff2f4745cf3..b1d92dcd168 100644 --- a/code/game/mecha/mech_fabricator.dm +++ b/code/game/mecha/mech_fabricator.dm @@ -13,8 +13,10 @@ idle_power_usage = 20 active_power_usage = 5000 req_access = list(access_robotics) - var/time_coeff = 1.5 //can be upgraded with research - var/resource_coeff = 1.5 //can be upgraded with research + var/time_coeff = 1 + var/resource_coeff = 1 + var/time_coeff_tech = 1 + var/resource_coeff_tech = 1 var/list/resources = list( "metal"=0, "glass"=0, @@ -164,14 +166,14 @@ T += Ma.rating T -= 1 var/diff - diff = round(initial(resource_coeff) - (initial(resource_coeff)*(T))/6,0.01) + diff = round(initial(resource_coeff) - (initial(resource_coeff)*(T))/8,0.01) if(resource_coeff!=diff) resource_coeff = diff T = 0 for(var/obj/item/weapon/stock_parts/manipulator/Ml in component_parts) T += Ml.rating T -= 1 - diff = round(initial(time_coeff) - (initial(time_coeff)*(T))/4,0.01) + diff = round(initial(time_coeff) - (initial(time_coeff)*(T))/5,0.01) if(time_coeff!=diff) time_coeff = diff @@ -467,9 +469,9 @@ pmat += Ml.rating if(pmat >= 1) pmat -= 1//So the equations don't have to be reworked, upgrading a single part from T1 to T2 is == to 1 tech level - diff = round(initial(resource_coeff) - (initial(resource_coeff)*(T.level+pmat))/25,0.01) - if(resource_coeff!=diff) - resource_coeff = diff + diff = round(initial(resource_coeff_tech) - (initial(resource_coeff_tech)*(T.level+pmat))/30,0.01) + if(resource_coeff_tech>diff) + resource_coeff_tech = diff output+="Production efficiency increased.
" if("programming") var/ptime = 0 @@ -477,9 +479,9 @@ ptime += Ma.rating if(ptime >= 2) ptime -= 2 - diff = round(initial(time_coeff) - (initial(time_coeff)*(T.level+ptime))/25,0.1) - if(time_coeff!=diff) - time_coeff = diff + diff = round(initial(time_coeff_tech) - (initial(time_coeff_tech)*(T.level+ptime))/25,0.1) + if(time_coeff_tech>diff) + time_coeff_tech = diff output+="Production routines updated.
" return output @@ -525,15 +527,15 @@ if(part.vars.Find("construction_time") && part.vars.Find("construction_cost")) var/list/L = part_sets["Misc"] if(L.Find(part.type)) - return round(part:construction_cost[resource]*(resource_coeff/2), roundto) //hacky scary skeletons send shivers down your spine - return round(part:construction_cost[resource]*resource_coeff, roundto) + return round(part:construction_cost[resource]*(resource_coeff/2)*resource_coeff_tech, roundto) //hacky scary skeletons send shivers down your spine + return round(part:construction_cost[resource]*resource_coeff*resource_coeff_tech, roundto) else return 0 /obj/machinery/mecha_part_fabricator/proc/get_construction_time_w_coeff(var/obj/item/part as obj, var/roundto=1) //Be SURE to add any new equipment to this switch, but don't be suprised if it spits out children objects if(part.vars.Find("construction_time") && part.vars.Find("construction_cost")) - return round(part:construction_time*time_coeff, roundto) + return round(part:construction_time*time_coeff*time_coeff_tech, roundto) else return 0