From d546d4efd8c95c362e6b9a2dfb2a686242030119 Mon Sep 17 00:00:00 2001 From: Fox-McCloud Date: Mon, 25 Apr 2016 04:07:49 -0400 Subject: [PATCH 1/4] Science Rebalance Round II --- code/__DEFINES/machines.dm | 2 +- code/game/mecha/mech_fabricator.dm | 37 ++----------------- code/modules/mining/equipment_locker.dm | 10 +++--- code/modules/research/circuitprinter.dm | 8 ++--- code/modules/research/protolathe.dm | 4 +-- code/modules/research/rdconsole.dm | 48 +++++++++++-------------- 6 files changed, 35 insertions(+), 74 deletions(-) diff --git a/code/__DEFINES/machines.dm b/code/__DEFINES/machines.dm index 3153c180817..eb894d7e071 100644 --- a/code/__DEFINES/machines.dm +++ b/code/__DEFINES/machines.dm @@ -15,7 +15,7 @@ #define FILE_DRM 16 // Some files want to not be copied/moved. This is them complaining that you tried. #define NETWORK_FAILURE 32 -#define MINERAL_MATERIAL_AMOUNT 2000 //The amount of materials you get from a sheet of mineral like iron/diamond/glass etc +#define MINERAL_MATERIAL_AMOUNT 1000 //The amount of materials you get from a sheet of mineral like iron/diamond/glass etc #define IMPRINTER 1 //For circuits. Uses glass/chemicals. #define PROTOLATHE 2 //New stuff. Uses glass/metal/chemicals diff --git a/code/game/mecha/mech_fabricator.dm b/code/game/mecha/mech_fabricator.dm index 562e30d834d..a88d1c49bad 100644 --- a/code/game/mecha/mech_fabricator.dm +++ b/code/game/mecha/mech_fabricator.dm @@ -9,9 +9,6 @@ idle_power_usage = 20 active_power_usage = 5000 var/time_coeff = 1 - var/resource_coeff = 1 - var/time_coeff_tech = 1 - var/resource_coeff_tech = 1 var/list/resources = list( MAT_METAL=0, MAT_GLASS=0, @@ -80,12 +77,6 @@ T += M.rating res_max_amount = (187000+(T * 37500)) - //ressources adjustment coefficient (1 -> 0.88 -> 0.75) - T = -1 - for(var/obj/item/weapon/stock_parts/micro_laser/Ma in component_parts) - T += Ma.rating - resource_coeff = round(initial(resource_coeff) - (initial(resource_coeff)*(T))/8,0.01) - //building time adjustment coefficient (1 -> 0.8 -> 0.6) T = -1 for(var/obj/item/weapon/stock_parts/manipulator/Ml in component_parts) @@ -230,29 +221,6 @@ output += "\[Process queue | Clear queue\]" return output -/obj/machinery/mecha_part_fabricator/proc/update_tech() - if(!files) - return - var/output - for(var/datum/tech/T in files.known_tech) - if(T && T.level > 1) - var/diff - switch(T.id) - if("materials") - //one materials level is 1/32, so that max level is 0.75 coefficient - diff = round(initial(resource_coeff_tech) - (initial(resource_coeff_tech)*(T.level-1))/32,0.01) - if(resource_coeff_tech>diff) - resource_coeff_tech = diff - output+="Production efficiency increased.
" - if("programming") - //one materials level is 1/40, so that max level is 0.8 coefficient - diff = round(initial(time_coeff_tech) - (initial(time_coeff_tech)*(T.level-1))/40,0.1) - if(time_coeff_tech>diff) - time_coeff_tech = diff - output+="Production routines updated.
" - return output - - /obj/machinery/mecha_part_fabricator/proc/sync() temp = "Updating local R&D database..." updateUsrDialog() @@ -269,7 +237,6 @@ files.RefreshResearch() temp = "Processed equipment designs.
" //check if the tech coefficients have changed - temp += update_tech() temp += "Return" updateUsrDialog() @@ -281,10 +248,10 @@ return /obj/machinery/mecha_part_fabricator/proc/get_resource_cost_w_coeff(datum/design/D, resource, roundto = 1) - return round(D.materials[resource]*resource_coeff*resource_coeff_tech, roundto) + return round(D.materials[resource], roundto) /obj/machinery/mecha_part_fabricator/proc/get_construction_time_w_coeff(datum/design/D, roundto = 1) //aran - return round(initial(D.construction_time)*time_coeff*time_coeff_tech, roundto) + return round(initial(D.construction_time)*time_coeff, roundto) /obj/machinery/mecha_part_fabricator/attack_ghost(mob/user) interact(user) diff --git a/code/modules/mining/equipment_locker.dm b/code/modules/mining/equipment_locker.dm index c94bfcd0ce8..7414dc6f52b 100644 --- a/code/modules/mining/equipment_locker.dm +++ b/code/modules/mining/equipment_locker.dm @@ -49,11 +49,11 @@ var/point_upgrade_temp = 1 var/sheet_per_ore_temp = 1 for(var/obj/item/weapon/stock_parts/matter_bin/B in component_parts) - sheet_per_ore_temp = B.rating + sheet_per_ore_temp = 0.65 + (0.35 * B.rating) for(var/obj/item/weapon/stock_parts/manipulator/M in component_parts) ore_pickup_rate_temp = 15 * M.rating for(var/obj/item/weapon/stock_parts/micro_laser/L in component_parts) - point_upgrade_temp = L.rating + point_upgrade_temp = 0.65 + (0.35 * L.rating) ore_pickup_rate = ore_pickup_rate_temp point_upgrade = point_upgrade_temp sheet_per_ore = sheet_per_ore_temp @@ -225,7 +225,7 @@ var/obj/item/stack/sheet/inp = stack_list[text2path(href_list["release"])] var/obj/item/stack/sheet/out = new inp.type() var/desired = input("How much?", "How much to eject?", 1) as num - out.amount = min(desired,50,inp.amount) + out.amount = round(min(desired,50,inp.amount)) if(out.amount >= 1) inp.amount -= out.amount unload_mineral(out) @@ -242,7 +242,7 @@ var/desired = input("How much?", "How much would you like to smelt?", 1) as num var/obj/item/stack/sheet/plasteel/plasteelout = new - plasteelout.amount = min(desired,50,metalstack.amount,plasmastack.amount) + plasteelout.amount = round(min(desired,50,metalstack.amount,plasmastack.amount)) if(plasteelout.amount >= 1) metalstack.amount -= plasteelout.amount plasmastack.amount -= plasteelout.amount @@ -258,7 +258,7 @@ var/desired = input("How much?", "How much would you like to smelt?", 1) as num var/obj/item/stack/sheet/plasmaglass/plasglassout = new - plasglassout.amount = min(desired, 50, glassstack.amount, plasmastack.amount) + plasglassout.amount = round(min(desired, 50, glassstack.amount, plasmastack.amount)) if(plasglassout.amount >= 1) glassstack.amount -= plasglassout.amount plasmastack.amount -= plasglassout.amount diff --git a/code/modules/research/circuitprinter.dm b/code/modules/research/circuitprinter.dm index 146f803edfb..6daea4b60fa 100644 --- a/code/modules/research/circuitprinter.dm +++ b/code/modules/research/circuitprinter.dm @@ -73,13 +73,13 @@ 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]/efficiency_coeff) >= 0) + return (g_amount - (being_built.materials[M]) >= 0) if(MAT_GOLD) - return (gold_amount - (being_built.materials[M]/efficiency_coeff) >= 0) + return (gold_amount - (being_built.materials[M]) >= 0) if(MAT_DIAMOND) - return (diamond_amount - (being_built.materials[M]/efficiency_coeff) >= 0) + return (diamond_amount - (being_built.materials[M]) >= 0) else - return (reagents.has_reagent(M, (being_built.materials[M]/efficiency_coeff)) != 0) + return (reagents.has_reagent(M, (being_built.materials[M])) != 0) /obj/machinery/r_n_d/circuit_imprinter/proc/TotalMaterials() diff --git a/code/modules/research/protolathe.dm b/code/modules/research/protolathe.dm index 16748fbb46b..3c8b89ea2a0 100644 --- a/code/modules/research/protolathe.dm +++ b/code/modules/research/protolathe.dm @@ -81,9 +81,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.reagents[M]/efficiency_coeff)) + A = A / max(1, (being_built.reagents[M])) else - A = A / max(1, (being_built.materials[M]/efficiency_coeff)) + A = A / max(1, (being_built.materials[M])) return A /obj/machinery/r_n_d/protolathe/attackby(var/obj/item/O as obj, var/mob/user as mob, params) diff --git a/code/modules/research/rdconsole.dm b/code/modules/research/rdconsole.dm index 58c1cf7fe6f..d806ec80a54 100644 --- a/code/modules/research/rdconsole.dm +++ b/code/modules/research/rdconsole.dm @@ -171,7 +171,7 @@ proc/CallMaterialName(ID) return D.loc = src to_chat(user, "You add the disk to the machine!") - else + else if(!(linked_destroy && linked_destroy.busy) && !(linked_lathe && linked_lathe.busy) && !(linked_imprinter && linked_imprinter.busy)) ..() src.updateUsrDialog() return @@ -411,7 +411,7 @@ proc/CallMaterialName(ID) var/list/efficient_mats = list() for(var/MAT in being_built.materials) - efficient_mats[MAT] = being_built.materials[MAT] / coeff + efficient_mats[MAT] = being_built.materials[MAT] if(!linked_lathe.materials.has_materials(efficient_mats, amount)) src.visible_message("The [src.name] beeps, \"Not enough materials to complete prototype.\"") @@ -419,7 +419,7 @@ proc/CallMaterialName(ID) g2g = 0 else for(var/R in being_built.reagents) - if(!linked_lathe.reagents.has_reagent(R, being_built.reagents[R]/coeff)) + if(!linked_lathe.reagents.has_reagent(R, being_built.reagents[R])) src.visible_message("The [src.name] beeps, \"Not enough reagents to complete prototype.\"") enough_materials = 0 g2g = 0 @@ -427,7 +427,7 @@ proc/CallMaterialName(ID) 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) + linked_lathe.reagents.remove_reagent(R, being_built.reagents[R]) var/P = being_built.build_path //lets save these values before the spawn() just in case. Nobody likes runtimes. var/O = being_built.locked @@ -439,8 +439,7 @@ proc/CallMaterialName(ID) new_item.investigate_log("built by [key]","singulo") new_item.reliability = 100 if(!istype(new_item, /obj/item/stack/sheet)) // To avoid materials dupe glitches - new_item.materials[MAT_METAL] /= coeff - new_item.materials[MAT_GLASS] /= coeff + new_item.materials = efficient_mats.Copy() if(O) var/obj/item/weapon/storage/lockbox/L = new/obj/item/weapon/storage/lockbox(linked_lathe.loc) new_item.loc = L @@ -458,7 +457,6 @@ 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 @@ -491,13 +489,13 @@ proc/CallMaterialName(ID) break switch(M) if(MAT_GLASS) - linked_imprinter.g_amount = max(0, (linked_imprinter.g_amount-being_built.materials[M]/coeff)) + linked_imprinter.g_amount = max(0, (linked_imprinter.g_amount-being_built.materials[M])) if(MAT_GOLD) - linked_imprinter.gold_amount = max(0, (linked_imprinter.gold_amount-being_built.materials[M]/coeff)) + linked_imprinter.gold_amount = max(0, (linked_imprinter.gold_amount-being_built.materials[M])) if(MAT_DIAMOND) - linked_imprinter.diamond_amount = max(0, (linked_imprinter.diamond_amount-being_built.materials[M]/coeff)) + linked_imprinter.diamond_amount = max(0, (linked_imprinter.diamond_amount-being_built.materials[M])) else - linked_imprinter.reagents.remove_reagent(M, being_built.materials[M]/coeff) + linked_imprinter.reagents.remove_reagent(M, being_built.materials[M]) var/P = being_built.build_path //lets save these values before the spawn() just in case. Nobody likes runtimes. spawn(16) @@ -873,7 +871,6 @@ proc/CallMaterialName(ID) dat += "Material Amount: [linked_lathe.materials.total_amount] / [linked_lathe.materials.max_amount]
" dat += "Chemical Volume: [linked_lathe.reagents.total_volume] / [linked_lathe.reagents.maximum_volume]
" - var/coeff = linked_lathe.efficiency_coeff for(var/datum/design/D in files.known_designs) if(!(selected_category in D.category)|| !(D.build_type & PROTOLATHE)) continue @@ -884,9 +881,9 @@ proc/CallMaterialName(ID) t = linked_lathe.check_mat(D, M) temp_material += " | " if (t < 1) - temp_material += "[D.materials[M]/coeff] [CallMaterialName(M)]" + temp_material += "[D.materials[M]] [CallMaterialName(M)]" else - temp_material += " [D.materials[M]/coeff] [CallMaterialName(M)]" + temp_material += " [D.materials[M]] [CallMaterialName(M)]" c = min(c,t) @@ -894,9 +891,9 @@ proc/CallMaterialName(ID) t = linked_lathe.check_mat(D, R) temp_material += " | " if (t < 1) - temp_material += "[D.reagents[R]/coeff] [CallMaterialName(R)]" + temp_material += "[D.reagents[R]] [CallMaterialName(R)]" else - temp_material += " [D.reagents[R]/coeff] [CallMaterialName(R)]" + temp_material += " [D.reagents[R]] [CallMaterialName(R)]" c = min(c,t) if (c >= 1) @@ -920,7 +917,6 @@ proc/CallMaterialName(ID) dat += "Material Amount: [linked_lathe.materials.total_amount] / [linked_lathe.materials.max_amount]
" dat += "Chemical Volume: [linked_lathe.reagents.total_volume] / [linked_lathe.reagents.maximum_volume]
" - var/coeff = linked_lathe.efficiency_coeff for(var/datum/design/D in matching_designs) var/temp_material var/c = 50 @@ -929,18 +925,18 @@ proc/CallMaterialName(ID) t = linked_lathe.check_mat(D, M) temp_material += " | " if (t < 1) - temp_material += "[D.materials[M]/coeff] [CallMaterialName(M)]" + temp_material += "[D.materials[M]] [CallMaterialName(M)]" else - temp_material += " [D.materials[M]/coeff] [CallMaterialName(M)]" + temp_material += " [D.materials[M]] [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 += "[D.reagents[R]/coeff] [CallMaterialName(R)]" + temp_material += "[D.reagents[R]] [CallMaterialName(R)]" else - temp_material += " [D.reagents[R]/coeff] [CallMaterialName(R)]" + temp_material += " [D.reagents[R]] [CallMaterialName(R)]" c = min(c,t) if (c >= 1) @@ -1080,7 +1076,6 @@ proc/CallMaterialName(ID) dat += "Material Amount: [linked_imprinter.TotalMaterials()]
" dat += "Chemical Volume: [linked_imprinter.reagents.total_volume]
" - 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 @@ -1090,9 +1085,9 @@ proc/CallMaterialName(ID) temp_materials += " | " if (!linked_imprinter.check_mat(D, M)) check_materials = 0 - temp_materials += " [D.materials[M]/coeff] [CallMaterialName(M)]" + temp_materials += " [D.materials[M]] [CallMaterialName(M)]" else - temp_materials += " [D.materials[M]/coeff] [CallMaterialName(M)]" + temp_materials += " [D.materials[M]] [CallMaterialName(M)]" if (check_materials) dat += "[D.name][temp_materials]
" else @@ -1108,7 +1103,6 @@ proc/CallMaterialName(ID) dat += "Material Amount: [linked_imprinter.TotalMaterials()]
" dat += "Chemical Volume: [linked_imprinter.reagents.total_volume]
" - var/coeff = linked_imprinter.efficiency_coeff for(var/datum/design/D in matching_designs) var/temp_materials var/check_materials = 1 @@ -1116,9 +1110,9 @@ proc/CallMaterialName(ID) temp_materials += " | " if (!linked_imprinter.check_mat(D, M)) check_materials = 0 - temp_materials += " [D.materials[M]/coeff] [CallMaterialName(M)]" + temp_materials += " [D.materials[M]] [CallMaterialName(M)]" else - temp_materials += " [D.materials[M]/coeff] [CallMaterialName(M)]" + temp_materials += " [D.materials[M]] [CallMaterialName(M)]" if (check_materials) dat += "[D.name][temp_materials]
" else From ddff923cd1f4dfdac87d88f91863da138e24dee9 Mon Sep 17 00:00:00 2001 From: Fox-McCloud Date: Mon, 25 Apr 2016 20:23:00 -0400 Subject: [PATCH 2/4] increase materials amount --- code/__DEFINES/machines.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/__DEFINES/machines.dm b/code/__DEFINES/machines.dm index eb894d7e071..3153c180817 100644 --- a/code/__DEFINES/machines.dm +++ b/code/__DEFINES/machines.dm @@ -15,7 +15,7 @@ #define FILE_DRM 16 // Some files want to not be copied/moved. This is them complaining that you tried. #define NETWORK_FAILURE 32 -#define MINERAL_MATERIAL_AMOUNT 1000 //The amount of materials you get from a sheet of mineral like iron/diamond/glass etc +#define MINERAL_MATERIAL_AMOUNT 2000 //The amount of materials you get from a sheet of mineral like iron/diamond/glass etc #define IMPRINTER 1 //For circuits. Uses glass/chemicals. #define PROTOLATHE 2 //New stuff. Uses glass/metal/chemicals From b4469854bff650bd6020f18e48a1016cab9a6ebb Mon Sep 17 00:00:00 2001 From: Fox-McCloud Date: Tue, 26 Apr 2016 03:16:00 -0400 Subject: [PATCH 3/4] re-add circuit imprinter efficiency --- code/modules/research/circuitprinter.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/research/circuitprinter.dm b/code/modules/research/circuitprinter.dm index 6daea4b60fa..4ded524e40c 100644 --- a/code/modules/research/circuitprinter.dm +++ b/code/modules/research/circuitprinter.dm @@ -79,7 +79,7 @@ using metal and glass, it uses glass and reagents (usually sulfuric acis). if(MAT_DIAMOND) return (diamond_amount - (being_built.materials[M]) >= 0) else - return (reagents.has_reagent(M, (being_built.materials[M])) != 0) + return (reagents.has_reagent(M, (being_built.materials[M]/efficiency_coeff)) != 0) /obj/machinery/r_n_d/circuit_imprinter/proc/TotalMaterials() From f543a60e3051973db717cc4fe5335e62c8d2a708 Mon Sep 17 00:00:00 2001 From: Fox-McCloud Date: Fri, 29 Apr 2016 08:47:23 -0400 Subject: [PATCH 4/4] circuit imprinter --- code/modules/research/circuitprinter.dm | 6 +++--- code/modules/research/rdconsole.dm | 19 +++++++++++-------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/code/modules/research/circuitprinter.dm b/code/modules/research/circuitprinter.dm index 4ded524e40c..146f803edfb 100644 --- a/code/modules/research/circuitprinter.dm +++ b/code/modules/research/circuitprinter.dm @@ -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) diff --git a/code/modules/research/rdconsole.dm b/code/modules/research/rdconsole.dm index d806ec80a54..9e8b29f94c1 100644 --- a/code/modules/research/rdconsole.dm +++ b/code/modules/research/rdconsole.dm @@ -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()]
" dat += "Chemical Volume: [linked_imprinter.reagents.total_volume]
" + 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 += " [D.materials[M]] [CallMaterialName(M)]" + temp_materials += " [D.materials[M]/coeff] [CallMaterialName(M)]" else - temp_materials += " [D.materials[M]] [CallMaterialName(M)]" + temp_materials += " [D.materials[M]/coeff] [CallMaterialName(M)]" if (check_materials) dat += "[D.name][temp_materials]
" else @@ -1103,6 +1105,7 @@ proc/CallMaterialName(ID) dat += "Material Amount: [linked_imprinter.TotalMaterials()]
" dat += "Chemical Volume: [linked_imprinter.reagents.total_volume]
" + 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 += " [D.materials[M]] [CallMaterialName(M)]" + temp_materials += " [D.materials[M]/coeff] [CallMaterialName(M)]" else - temp_materials += " [D.materials[M]] [CallMaterialName(M)]" + temp_materials += " [D.materials[M]/coeff] [CallMaterialName(M)]" if (check_materials) dat += "[D.name][temp_materials]
" else