From 4f8389ec0ea6f9fbfa4d77f79ef23637b0fdbc15 Mon Sep 17 00:00:00 2001 From: Razharas Date: Mon, 23 Dec 2013 21:39:27 +0400 Subject: [PATCH] Constructable machines will depend on R&D parts DNA scanner: Laser quality lessens the irradiation Manipulator quality drastically improves the precision(9 times with best part) Scanner quality allows to scan suiciders/ling husks, best part enables cloner's autoprocess button, making it scan people in the scanner automatically Clone pod: Manipulator quality improves the speed of cloning Scanning module quality affects with how much health people will be ejected, will they get negative mutation/no mutations/clean of all mutations/random good mutation, at best quality will enable clone console's autoprocess button and will try to clone all the dead people in records automatically, together with best DNA scanner parts cloning console will be able to work in full automatic regime autoscanning people and autocloning them Borg recharger: Capacitors' quality and powercell max charge affect the speed at which borgs recharge Manipulator quality allows borg to be slowly repaired while inside the recharges, best manipulator allows even fire damage to be slowly repaired Portable power generators: Capacitors' quality produce more power Better lasers consume less fuel and reduce heat production PACMAN with best parts can keep whole station powered with about sheet of plamsa per minute(approximately, wasnt potent enough to test) Protolathe: Manipulators quality affects the cost of things(they will also have less m_amt and g_amt to prevent production of infinity metal), best manipulators reduces the cost 5 times (!) Imprinter: Manipulator quality affects the cost, best manipulator reduce cost(acid insluded) 4 times, i.e. 20 boards per 100 units of acid Destructive analyzer: Better parts allow items with less reliability in Redone how reliability is handled, you now see item reliability in the deconstruction menu and deconstructing items that has same or one point less research type level will rise the reliability of all known designs that has one or more research type requarements as the deconstructed item Designs of the same type raise in reliability more Removed reliability_base and reliability_mod completely because they served no purpose Critically broken things rise reliability of the design drastically Whole reliability system is not used a lot but now at least on the R&D part it finally matters Didnt touch telecomms machinery, R&D code is messy but tcomms is just another level, im not high enough to touch it yet Most of things except for pacman are tested ingame, no bugs/runtimes detected --- code/game/dna.dm | 25 ++++- code/game/machinery/autolathe.dm | 47 ++++++--- code/game/machinery/cloning.dm | 36 +++++-- code/game/machinery/computer/cloning.dm | 37 +++++++- code/game/machinery/rechargestation.dm | 41 ++++++-- code/modules/power/port_gen.dm | 15 ++- code/modules/research/circuitprinter.dm | 6 +- code/modules/research/designs.dm | 58 ++++++----- code/modules/research/destructive_analyzer.dm | 5 +- code/modules/research/protolathe.dm | 5 + code/modules/research/rdconsole.dm | 95 ++++++++++--------- code/modules/research/research.dm | 25 ++--- code/modules/research/server.dm | 1 - 13 files changed, 258 insertions(+), 138 deletions(-) diff --git a/code/game/dna.dm b/code/game/dna.dm index 04c6a091e5a..7afa8eef26a 100644 --- a/code/game/dna.dm +++ b/code/game/dna.dm @@ -336,6 +336,9 @@ use_power = 1 idle_power_usage = 50 active_power_usage = 300 + var/damage_coeff + var/scan_level + var/precision_coeff /obj/machinery/dna_scannernew/New() ..() @@ -347,8 +350,20 @@ component_parts += new /obj/item/weapon/stock_parts/console_screen(null) component_parts += new /obj/item/weapon/cable_coil(null, 1) component_parts += new /obj/item/weapon/cable_coil(null, 1) + RefreshParts() +/obj/machinery/dna_scannernew/RefreshParts() + scan_level = 0 + damage_coeff = 0 + precision_coeff = 0 + for(var/obj/item/weapon/stock_parts/scanning_module/P in component_parts) + scan_level += P.rating + for(var/obj/item/weapon/stock_parts/manipulator/P in component_parts) + precision_coeff = P.rating + for(var/obj/item/weapon/stock_parts/micro_laser/P in component_parts) + damage_coeff = P.rating + /obj/machinery/dna_scannernew/proc/toggle_open(mob/user=usr) if(!user) return @@ -582,7 +597,7 @@ if(connected) if(connected.occupant) //set occupant_status message viable_occupant = connected.occupant - if(check_dna_integrity(viable_occupant) && !(NOCLONE in viable_occupant.mutations)) //occupent is viable for dna modification + if(check_dna_integrity(viable_occupant) && (!(NOCLONE in viable_occupant.mutations) || (connected.scan_level == 3))) //occupent is viable for dna modification occupant_status += "[viable_occupant.name] => " switch(viable_occupant.stat) if(CONSCIOUS) occupant_status += "Conscious" @@ -624,7 +639,7 @@ var/stddev = radstrength*RADIATION_STRENGTH_MULTIPLIER status += "
Output Level:
[radstrength]
" status += "
  \> Mutation:
(-[stddev] to +[stddev] = 68%) (-[2*stddev] to +[2*stddev] = 95%)
" - stddev = RADIATION_ACCURACY_MULTIPLIER/radduration + stddev = RADIATION_ACCURACY_MULTIPLIER/(radduration + (connected.precision_coeff ** 2)) var/chance_to_hit switch(stddev) //hardcoded values from a z-table for a normal distribution if(0 to 0.25) chance_to_hit = ">95%" @@ -829,7 +844,7 @@ num = Clamp(num, 1, NUMBER_OF_BUFFERS) var/list/buffer_slot = buffer[num] if(istype(buffer_slot)) - viable_occupant.radiation += rand(15,40) + viable_occupant.radiation += rand(15/(connected.damage_coeff ** 2),40/(connected.damage_coeff ** 2)) switch(href_list["text"]) if("se") if(buffer_slot["SE"]) @@ -899,12 +914,12 @@ current_screen = "mainmenu" if(viable_occupant && connected && connected.occupant==viable_occupant) - viable_occupant.radiation += RADIATION_IRRADIATION_MULTIPLIER*radduration*radstrength + viable_occupant.radiation += (RADIATION_IRRADIATION_MULTIPLIER*radduration*radstrength)/(connected.damage_coeff ** 2) switch(href_list["task"]) if("pulseui") var/len = length(viable_occupant.dna.uni_identity) num = Wrap(num, 1, len+1) - num = randomize_radiation_accuracy(num, radduration, len) + num = randomize_radiation_accuracy(num, radduration + (connected.precision_coeff ** 2), len) var/block = round((num-1)/DNA_BLOCK_SIZE)+1 var/subblock = num - block*DNA_BLOCK_SIZE diff --git a/code/game/machinery/autolathe.dm b/code/game/machinery/autolathe.dm index 6a31eb60051..c2a68b9f567 100644 --- a/code/game/machinery/autolathe.dm +++ b/code/game/machinery/autolathe.dm @@ -89,6 +89,7 @@ var/global/list/autolathe_recipes_hidden = list( \ idle_power_usage = 10 active_power_usage = 100 var/busy = 0 + var/prod_coeff proc wires_win(mob/user as mob) @@ -104,6 +105,7 @@ var/global/list/autolathe_recipes_hidden = list( \ onclose(user, "autolathe_hack") regular_win(mob/user as mob) + var/coeff = 2 ** prod_coeff var/dat as text dat = text("Metal Amount: [src.m_amount] cm3 (MAX: [max_m_amount])
\nGlass Amount: [src.g_amount] cm3 (MAX: [max_g_amount])
") var/list/objs = list() @@ -111,12 +113,13 @@ var/global/list/autolathe_recipes_hidden = list( \ if (src.hacked) objs += src.LL for(var/obj/t in objs) - var/title = "[t.name] ([t.m_amt] m /[t.g_amt] g)" - if (m_amount" - continue - dat += "[title]" if (istype(t, /obj/item/stack)) + var/title = "[t.name] ([t.m_amt] m /[t.g_amt] g)" + if (m_amount" + continue + dat += "[title]" + var/obj/item/stack/S = t var/max_multiplier = min(S.max_amount, S.m_amt?round(m_amount/S.m_amt):INFINITY, S.g_amt?round(g_amount/S.g_amt):INFINITY) if (max_multiplier>1) @@ -127,6 +130,12 @@ var/global/list/autolathe_recipes_hidden = list( \ dat += " x[25]" if (max_multiplier>1) dat += " x[max_multiplier]" + else + var/title = "[t.name] ([t.m_amt/coeff] m /[t.g_amt/coeff] g)" + if (m_amount" + continue + dat += "[title]" dat += "
" user << browse("Autolathe Control Panel[dat]", "window=autolathe_regular") onclose(user, "autolathe_regular") @@ -250,6 +259,7 @@ var/global/list/autolathe_recipes_hidden = list( \ src.add_fingerprint(usr) if (!busy) if(href_list["make"]) + var/coeff = 2 ** prod_coeff var/turf/T = get_step(src.loc, get_dir(src,usr)) var/obj/template = locate(href_list["make"]) var/multiplier = text2num(href_list["multiplier"]) @@ -260,21 +270,27 @@ var/global/list/autolathe_recipes_hidden = list( \ use_power(power) icon_state = "autolathe" flick("autolathe_n",src) - spawn(16) + spawn(16/coeff) use_power(power) - spawn(16) + spawn(16/coeff) use_power(power) - spawn(16) - src.m_amount -= template.m_amt*multiplier - src.g_amount -= template.g_amt*multiplier + spawn(16/coeff) + if(template.type == /obj/item/stack) + src.m_amount -= template.m_amt*multiplier + src.g_amount -= template.g_amt*multiplier + var/obj/new_item = new template.type(T) + var/obj/item/stack/S = new_item + S.amount = multiplier + else + src.m_amount -= template.m_amt/coeff + src.g_amount -= template.g_amt/coeff + var/obj/new_item = new template.type(T) + new_item.m_amt /= coeff + new_item.g_amt /= coeff if(src.m_amount < 0) src.m_amount = 0 if(src.g_amount < 0) src.g_amount = 0 - var/obj/new_item = new template.type(T) - if (multiplier>1) - var/obj/item/stack/S = new_item - S.amount = multiplier busy = 0 src.updateUsrDialog() if(href_list["act"]) @@ -319,11 +335,14 @@ var/global/list/autolathe_recipes_hidden = list( \ RefreshParts() ..() var/tot_rating = 0 + prod_coeff = 0 for(var/obj/item/weapon/stock_parts/matter_bin/MB in component_parts) tot_rating += MB.rating tot_rating *= 25000 max_m_amount = tot_rating * 2 max_g_amount = tot_rating + for(var/obj/item/weapon/stock_parts/manipulator/M in component_parts) + prod_coeff += M.rating - 1 New() ..() diff --git a/code/game/machinery/cloning.dm b/code/game/machinery/cloning.dm index 2498538e4f2..21b4645e918 100644 --- a/code/game/machinery/cloning.dm +++ b/code/game/machinery/cloning.dm @@ -18,6 +18,8 @@ var/mess = 0 //Need to clean out it if it's full of exploded clone. var/attempting = 0 //One clone attempt at a time thanks var/eject_wait = 0 //Don't eject them as soon as they are created fuckkk + var/speed_coeff + var/efficiency /obj/machinery/clonepod/New() ..() @@ -30,7 +32,16 @@ component_parts += new /obj/item/weapon/stock_parts/console_screen(src) component_parts += new /obj/item/weapon/cable_coil(src, 1) component_parts += new /obj/item/weapon/cable_coil(src, 1) + RefreshParts() +/obj/machinery/clonepod/RefreshParts() + speed_coeff = 0 + efficiency = 0 + for(var/obj/item/weapon/stock_parts/scanning_module/S in component_parts) + efficiency += S.rating + for(var/obj/item/weapon/stock_parts/manipulator/P in component_parts) + speed_coeff += P.rating + heal_level = (efficiency * 15) + 10 //The return of data disks?? Just for transferring between genetics machine/cloning machine. //TO-DO: Make the genetics machine accept them. @@ -132,8 +143,6 @@ return 0 - src.heal_level = rand(50,90) //Randomizes what health the clone is when ejected - src.attempting = 1 //One at a time!! src.locked = 1 @@ -150,8 +159,8 @@ src.icon_state = "pod_1" //Get the clone body ready - H.adjustCloneLoss(src.heal_level + 100) //new damage var so you can't eject a clone early then stab them to abuse the current damage system --NeoFite - H.adjustBrainLoss(heal_level) + H.adjustCloneLoss(190) //new damage var so you can't eject a clone early then stab them to abuse the current damage system --NeoFite + H.adjustBrainLoss(190) H.Paralyse(4) //Here let's calculate their health so the pod doesn't immediately eject them!!! @@ -178,7 +187,13 @@ // -- End mode specific stuff hardset_dna(H, ui, se, null, mrace) - randmutb(H) //Sometimes the clones come out wrong. + if(efficiency > 2) + for(var/A in bad_se_blocks) + setblock(H.dna.struc_enzymes, A, construct_block(0,2)) + if(efficiency > 5 && prob(20)) + randmutg(H) + if(efficiency < 3 && prob(50)) + randmutb(H) if(H.gender == MALE) H.facial_hair_style = "Full Beard" @@ -206,14 +221,15 @@ src.connected_message("Clone Rejected: Deceased.") return - else if(src.occupant.cloneloss > src.heal_level) + else if(src.occupant.cloneloss > (100 - src.heal_level)) + world.log << "This works" src.occupant.Paralyse(4) //Slowly get that clone healed and finished. - src.occupant.adjustCloneLoss(-heal_level/50) + src.occupant.adjustCloneLoss(-((speed_coeff/2))) //Premature clones may have brain damage. - src.occupant.adjustBrainLoss(-heal_level/100) + src.occupant.adjustBrainLoss(-((speed_coeff/2))) //So clones don't die of oxyloss in a running pod. if (src.occupant.reagents.get_reagent_amount("inaprovaline") < 30) @@ -222,7 +238,7 @@ use_power(7500) //This might need tweaking. return - else if((src.occupant.cloneloss <= src.heal_level) && (!src.eject_wait)) + else if((src.occupant.cloneloss <= (100 - src.heal_level)) && (!src.eject_wait)) src.connected_message("Cloning Process Complete.") src.locked = 0 src.go_out() @@ -350,7 +366,7 @@ return /obj/machinery/clonepod/emp_act(severity) - if(prob(100/severity)) malfunction() + if(prob(100/(severity*efficiency))) malfunction() ..() /obj/machinery/clonepod/ex_act(severity) diff --git a/code/game/machinery/computer/cloning.dm b/code/game/machinery/computer/cloning.dm index 5400185bd75..c83680469cc 100644 --- a/code/game/machinery/computer/cloning.dm +++ b/code/game/machinery/computer/cloning.dm @@ -15,6 +15,7 @@ var/datum/data/record/active_record = null var/obj/item/weapon/disk/data/diskette = null //Mostly so the geneticist can steal everything. var/loading = 0 // Nice loading text + var/autoprocess = 0 /obj/machinery/computer/cloning/New() ..() @@ -23,6 +24,19 @@ return return +/obj/machinery/computer/cloning/process() + if(!(scanner && pod1 && autoprocess)) + return + + if(scanner.occupant && (scanner.scan_level > 2)) + scan_mob(scanner.occupant) + + if(!(pod1.occupant || pod1.mess) && (pod1.efficiency > 5)) + for(var/datum/data/record/R in records) + if(!(pod1.occupant || pod1.mess)) + if(pod1.growclone(R.fields["ckey"], R.fields["name"], R.fields["UI"], R.fields["SE"], R.fields["mind"], R.fields["mrace"])) + records -= R + /obj/machinery/computer/cloning/proc/updatemodules() src.scanner = findscanner() src.pod1 = findcloner() @@ -82,7 +96,13 @@ var/dat = "" dat += "Refresh" - + if(scanner && pod1 && ((scanner.scan_level > 2) || (pod1.efficiency > 5))) + if(!autoprocess) + dat += "Autoprocess" + else + dat += "Stop autoprocess" + else + dat += "Autoprocess" dat += "

Cloning Pod Status

" dat += "
[temp] 
" @@ -200,7 +220,14 @@ if(loading) return - if ((href_list["scan"]) && (!isnull(src.scanner))) + if(href_list["task"]) + switch(href_list["task"]) + if("autoprocess") + autoprocess = 1 + if("stopautoprocess") + autoprocess = 0 + + else if ((href_list["scan"]) && (!isnull(src.scanner))) scantemp = "" loading = 1 @@ -296,7 +323,7 @@ temp = "Clonepod malfunction." else if(!config.revival_cloning) temp = "Unable to initiate cloning cycle." - else if(pod1.growclone(C.fields["ckey"], C.fields["name"], C.fields["UI"], C.fields["SE"], C.fields["mind"], C.fields["mrace"])) + else if(pod1.growclone(null, C.fields["name"], C.fields["UI"], C.fields["SE"], C.fields["mind"], C.fields["mrace"])) temp = "[C.fields["name"]] => Cloning cycle in progress..." records.Remove(C) if(active_record == C) @@ -322,10 +349,10 @@ if (!subject.getorgan(/obj/item/organ/brain)) scantemp = "No signs of intelligence detected." return - if (subject.suiciding == 1) + if (subject.suiciding == 1 && src.scanner.scan_level < 2) scantemp = "Subject's brain is not responding to scanning stimuli." return - if (NOCLONE in subject.mutations) + if (NOCLONE in subject.mutations && src.scanner.scan_level < 2) scantemp = "Subject no longer contains the fundamental materials required to create a living clone." return if ((!subject.ckey) || (!subject.client)) diff --git a/code/game/machinery/rechargestation.dm b/code/game/machinery/rechargestation.dm index 2f30bef8818..76dfa89f9e8 100644 --- a/code/game/machinery/rechargestation.dm +++ b/code/game/machinery/rechargestation.dm @@ -13,12 +13,32 @@ var/circuitboard = "/obj/item/weapon/circuitboard/cyborgrecharger" var/locked = 1 req_access = list(access_robotics) + var/recharge_speed + var/repairs /obj/machinery/recharge_station/New() ..() + component_parts = list() + component_parts += new /obj/item/weapon/circuitboard/cyborgrecharger(src) + component_parts += new /obj/item/weapon/stock_parts/capacitor(src) + component_parts += new /obj/item/weapon/stock_parts/capacitor(src) + component_parts += new /obj/item/weapon/stock_parts/manipulator(src) + component_parts += new /obj/item/weapon/cell/high(src) + RefreshParts() build_icon() +/obj/machinery/recharge_station/RefreshParts() + recharge_speed = 0 + repairs = 0 + for(var/obj/item/weapon/stock_parts/capacitor/C in component_parts) + recharge_speed += C.rating * 100 + for(var/obj/item/weapon/stock_parts/manipulator/M in component_parts) + repairs += M.rating - 1 + for(var/obj/item/weapon/cell/C in component_parts) + recharge_speed *= C.maxcharge / 10000 + + /obj/machinery/recharge_station/process() if(!(NOPOWER|BROKEN)) return @@ -230,22 +250,25 @@ /obj/machinery/recharge_station/proc/process_occupant() if(occupant) restock_modules() + if(repairs) + occupant.heal_organ_damage(repairs, repairs - 1) if(occupant.cell) if(occupant.cell.charge >= occupant.cell.maxcharge) occupant.cell.charge = occupant.cell.maxcharge else - occupant.cell.charge = min(occupant.cell.charge + 200, occupant.cell.maxcharge) + occupant.cell.charge = min(occupant.cell.charge + recharge_speed, occupant.cell.maxcharge) /obj/machinery/recharge_station/proc/restock_modules() if(occupant) if(occupant.module && occupant.module.modules) var/list/um = occupant.contents|occupant.module.modules // ^ makes sinle list of active (occupant.contents) and inactive modules (occupant.module.modules) + var/coeff = recharge_speed / 200 for(var/obj/O in um) // Engineering if(istype(O,/obj/item/stack/sheet/metal) || istype(O,/obj/item/stack/sheet/rglass) || istype(O,/obj/item/stack/rods) || istype(O,/obj/item/weapon/cable_coil)|| istype(O,/obj/item/stack/tile/plasteel)) if(O:amount < 50) - O:amount += 1 + O:amount += coeff // Security if(istype(O,/obj/item/device/flash)) if(O:broken) @@ -254,7 +277,7 @@ O:icon_state = "flash" if(istype(O,/obj/item/weapon/gun/energy/taser/cyborg)) if(O:power_supply.charge < O:power_supply.maxcharge) - O:power_supply.give(O:charge_cost) + O:power_supply.give(O:charge_cost * coeff) O:update_icon() else O:charge_tick = 0 @@ -265,16 +288,18 @@ //Service if(istype(O,/obj/item/weapon/reagent_containers/food/condiment/enzyme)) if(O.reagents.get_reagent_amount("enzyme") < 50) - O.reagents.add_reagent("enzyme", 2) + O.reagents.add_reagent("enzyme", 2 * coeff) //Medical if(istype(O,/obj/item/weapon/reagent_containers/glass/bottle/robot)) var/obj/item/weapon/reagent_containers/glass/bottle/robot/B = O if(B.reagent && (B.reagents.get_reagent_amount(B.reagent) < B.volume)) - B.reagents.add_reagent(B.reagent, 2) + B.reagents.add_reagent(B.reagent, 2 * coeff) //Janitor if(istype(O, /obj/item/device/lightreplacer)) var/obj/item/device/lightreplacer/LR = O - LR.Charge(occupant) + var/i = 1 + for(1, i < coeff, i++) + LR.Charge(occupant) if(occupant) if(occupant.module) @@ -285,6 +310,6 @@ if(istype(occupant.module.emag, /obj/item/weapon/reagent_containers/spray)) var/obj/item/weapon/reagent_containers/spray/S = occupant.module.emag if(S.name == "polyacid spray") - S.reagents.add_reagent("pacid", 2) + S.reagents.add_reagent("pacid", 2 * coeff) else if(S.name == "lube spray") - S.reagents.add_reagent("lube", 2) + S.reagents.add_reagent("lube", 2 * coeff) diff --git a/code/modules/power/port_gen.dm b/code/modules/power/port_gen.dm index f8569d10924..edbbf4fd5f4 100644 --- a/code/modules/power/port_gen.dm +++ b/code/modules/power/port_gen.dm @@ -55,6 +55,7 @@ display round(lastgen) and plasmatank amount var/power_gen = 5000 var/recent_fault = 0 var/power_output = 1 + var/consumption = 0 /obj/machinery/power/port_gen/proc/HasFuel() //Placeholder for fuel check. return 1 @@ -129,15 +130,19 @@ display round(lastgen) and plasmatank amount /obj/machinery/power/port_gen/pacman/RefreshParts() var/temp_rating = 0 var/temp_reliability = 0 + var/consumption_coeff = 0 for(var/obj/item/weapon/stock_parts/SP in component_parts) if(istype(SP, /obj/item/weapon/stock_parts/matter_bin)) max_sheets = SP.rating * SP.rating * 50 - else if(istype(SP, /obj/item/weapon/stock_parts/micro_laser) || istype(SP, /obj/item/weapon/stock_parts/capacitor)) + else if(istype(SP, /obj/item/weapon/stock_parts/capacitor)) temp_rating += SP.rating + else + consumption_coeff += SP.rating for(var/obj/item/weapon/CP in component_parts) temp_reliability += CP.reliability reliability = min(round(temp_reliability / 4), 100) - power_gen = round(initial(power_gen) * (max(2, temp_rating) / 2)) + power_gen = round(initial(power_gen) * temp_rating * 2) + consumption = consumption_coeff /obj/machinery/power/port_gen/pacman/examine() ..() @@ -160,7 +165,7 @@ display round(lastgen) and plasmatank amount sheets -= amount /obj/machinery/power/port_gen/pacman/UseFuel() - var/needed_sheets = 1 / (time_per_sheet / power_output) + var/needed_sheets = 1 / (time_per_sheet * consumption / power_output) var/temp = min(needed_sheets, sheet_left) needed_sheets -= temp sheet_left -= temp @@ -175,9 +180,9 @@ display round(lastgen) and plasmatank amount var/bias = 0 if (power_output > 4) upper_limit = 400 - bias = power_output * 3 + bias = power_output - consumption * (4 - consumption) if (heat < lower_limit) - heat += 3 + heat += 4 - consumption else heat += rand(-7 + bias, 7 + bias) if (heat < lower_limit) diff --git a/code/modules/research/circuitprinter.dm b/code/modules/research/circuitprinter.dm index 5ac1762d266..90528dac641 100644 --- a/code/modules/research/circuitprinter.dm +++ b/code/modules/research/circuitprinter.dm @@ -13,6 +13,7 @@ using metal and glass, it uses glass and reagents (usually sulfuric acis). var/gold_amount = 0 var/diamond_amount = 0 var/max_material_amount = 75000.0 + var/efficiency_coeff New() ..() @@ -35,7 +36,10 @@ using metal and glass, it uses glass and reagents (usually sulfuric acis). for(var/obj/item/weapon/stock_parts/matter_bin/M in component_parts) T += M.rating max_material_amount = T * 75000.0 - + T = 0 + for(var/obj/item/weapon/stock_parts/manipulator/M in component_parts) + T += M.rating + efficiency_coeff = T-1 blob_act() if (prob(50)) diff --git a/code/modules/research/designs.dm b/code/modules/research/designs.dm index e2a80bdd9d8..ec427f65ac4 100644 --- a/code/modules/research/designs.dm +++ b/code/modules/research/designs.dm @@ -22,7 +22,7 @@ The currently supporting non-reagent materials: Don't add new keyword/IDs if they are made from an existing one (such as rods which are made from metal). Only add raw materials. Design Guidlines -- The reliability formula for all R&D built items is reliability_base (a fixed number) + total tech levels required to make it + +- The reliability formula for all R&D built items is reliability (a fixed number) + total tech levels required to make it + reliability_mod (starts at 0, gets improved through experimentation). Example: PACMAN generator. 79 base reliablity + 6 tech (3 plasmatech, 3 powerstorage) + 0 (since it's completely new) = 85% reliability. Reliability is the chance it works CORRECTLY. - When adding new designs, check rdreadme.dm to see what kind of things have already been made and where new stuff is needed. @@ -43,9 +43,7 @@ datum/design //Datum for object designs, used in construction var/name = "Name" //Name of the created object. var/desc = "Desc" //Description of the created object. var/id = "id" //ID of the created object for easy refernece. Alphanumeric, lower-case, no symbols - var/list/req_tech = list() //IDs of that techs the object originated from and the minimum level requirements. - var/reliability_mod = 0 //Reliability modifier of the device at it's starting point. - var/reliability_base = 100 //Base reliability of a device before modifiers. + var/list/req_tech = list() //IDs of that techs the object originated from and the minimum level requirements. //Reliability modifier of the device at it's starting point. var/reliability = 100 //Reliability of the device. var/build_type = null //Flag as to what kind machine the design is built in. See defines. var/list/materials = list() //List of materials. Format: "id" = amount. @@ -57,11 +55,11 @@ datum/design //Datum for object designs, used in construction //A proc to calculate the reliability of a design based on tech levels and innate modifiers. //Input: A list of /datum/tech; Output: The new reliabilty. datum/design/proc/CalcReliability(var/list/temp_techs) - var/new_reliability = reliability_mod + reliability_base + var/new_reliability for(var/datum/tech/T in temp_techs) if(T.id in req_tech) new_reliability += T.level - new_reliability = Clamp(new_reliability, reliability_base, 100) + new_reliability = Clamp(new_reliability, reliability, 100) reliability = new_reliability return @@ -996,7 +994,7 @@ datum/design/super_capacitor id = "super_capacitor" req_tech = list("powerstorage" = 5, "materials" = 4) build_type = PROTOLATHE - reliability_base = 71 + reliability = 71 materials = list("$metal" = 50, "$glass" = 50, "$gold" = 20) build_path = "/obj/item/weapon/stock_parts/capacitor/super" @@ -1007,7 +1005,7 @@ datum/design/phasic_scanning req_tech = list("magnets" = 5, "materials" = 3) build_type = PROTOLATHE materials = list("$metal" = 50, "$glass" = 20, "$silver" = 10) - reliability_base = 72 + reliability = 72 build_path = "/obj/item/weapon/stock_parts/scanning_module/phasic" datum/design/pico_mani @@ -1017,7 +1015,7 @@ datum/design/pico_mani req_tech = list("materials" = 5, "programming" = 2) build_type = PROTOLATHE materials = list("$metal" = 30) - reliability_base = 73 + reliability = 73 build_path = "/obj/item/weapon/stock_parts/manipulator/pico" datum/design/ultra_micro_laser @@ -1027,7 +1025,7 @@ datum/design/ultra_micro_laser req_tech = list("magnets" = 5, "materials" = 5) build_type = PROTOLATHE materials = list("$metal" = 10, "$glass" = 20, "$uranium" = 10) - reliability_base = 70 + reliability = 70 build_path = "/obj/item/weapon/stock_parts/micro_laser/ultra" datum/design/super_matter_bin @@ -1037,7 +1035,7 @@ datum/design/super_matter_bin req_tech = list("materials" = 5) build_type = PROTOLATHE materials = list("$metal" = 80) - reliability_base = 75 + reliability = 75 build_path = "/obj/item/weapon/stock_parts/matter_bin/super" @@ -1134,7 +1132,7 @@ datum/design/super_cell desc = "A power cell that holds 20000 units of energy" id = "super_cell" req_tech = list("powerstorage" = 3, "materials" = 2) - reliability_base = 75 + reliability = 75 build_type = PROTOLATHE | MECHFAB materials = list("$metal" = 700, "$glass" = 70) build_path = "/obj/item/weapon/cell/super" @@ -1145,7 +1143,7 @@ datum/design/hyper_cell desc = "A power cell that holds 30000 units of energy" id = "hyper_cell" req_tech = list("powerstorage" = 5, "materials" = 4) - reliability_base = 70 + reliability = 70 build_type = PROTOLATHE | MECHFAB materials = list("$metal" = 400, "$gold" = 150, "$silver" = 150, "$glass" = 70) build_path = "/obj/item/weapon/cell/hyper" @@ -1247,7 +1245,7 @@ datum/design/pacman id = "pacman" req_tech = list("programming" = 3, "plasmatech" = 3, "powerstorage" = 3, "engineering" = 3) build_type = IMPRINTER - reliability_base = 79 + reliability = 79 materials = list("$glass" = 2000, "sacid" = 20) build_path = "/obj/item/weapon/circuitboard/pacman" @@ -1257,7 +1255,7 @@ datum/design/superpacman id = "superpacman" req_tech = list("programming" = 3, "powerstorage" = 4, "engineering" = 4) build_type = IMPRINTER - reliability_base = 76 + reliability = 76 materials = list("$glass" = 2000, "sacid" = 20) build_path = "/obj/item/weapon/circuitboard/pacman/super" @@ -1267,7 +1265,7 @@ datum/design/mrspacman id = "mrspacman" req_tech = list("programming" = 3, "powerstorage" = 5, "engineering" = 5) build_type = IMPRINTER - reliability_base = 74 + reliability = 74 materials = list("$glass" = 2000, "sacid" = 20) build_path = "/obj/item/weapon/circuitboard/pacman/mrs" @@ -1283,7 +1281,7 @@ datum/design/mass_spectrometer req_tech = list("biotech" = 2, "magnets" = 2) build_type = PROTOLATHE materials = list("$metal" = 30, "$glass" = 20) - reliability_base = 76 + reliability = 76 build_path = "/obj/item/device/mass_spectrometer" datum/design/adv_mass_spectrometer @@ -1293,7 +1291,7 @@ datum/design/adv_mass_spectrometer req_tech = list("biotech" = 2, "magnets" = 4) build_type = PROTOLATHE materials = list("$metal" = 30, "$glass" = 20) - reliability_base = 74 + reliability = 74 build_path = "/obj/item/device/mass_spectrometer/adv" datum/design/mmi @@ -1303,7 +1301,7 @@ datum/design/mmi req_tech = list("programming" = 2, "biotech" = 3) build_type = PROTOLATHE | MECHFAB materials = list("$metal" = 1000, "$glass" = 500) - reliability_base = 76 + reliability = 76 build_path = "/obj/item/device/mmi" category = "Misc" @@ -1314,7 +1312,7 @@ datum/design/mmi_radio req_tech = list("programming" = 2, "biotech" = 4) build_type = PROTOLATHE | MECHFAB materials = list("$metal" = 1200, "$glass" = 500) - reliability_base = 74 + reliability = 74 build_path = "/obj/item/device/mmi/radio_enabled" category = "Misc" @@ -1325,7 +1323,7 @@ datum/design/synthetic_flash req_tech = list("magnets" = 3, "combat" = 2) build_type = MECHFAB materials = list("$metal" = 750, "$glass" = 750) - reliability_base = 76 + reliability = 76 build_path = "/obj/item/device/flash/synthetic" category = "Misc" @@ -1336,7 +1334,7 @@ datum/design/bluespacebeaker req_tech = list("bluespace" = 2, "materials" = 6) build_type = PROTOLATHE materials = list("$metal" = 3000, "$plasma" = 3000, "$diamond" = 500) - reliability_base = 76 + reliability = 76 build_path = "/obj/item/weapon/reagent_containers/glass/beaker/bluespace" category = "Misc" @@ -1347,7 +1345,7 @@ datum/design/noreactbeaker req_tech = list("materials" = 2) build_type = PROTOLATHE materials = list("$metal" = 3000) - reliability_base = 76 + reliability = 76 build_path = "/obj/item/weapon/reagent_containers/glass/beaker/noreact" category = "Misc" @@ -1362,7 +1360,7 @@ datum/design/nuclear_gun req_tech = list("combat" = 3, "materials" = 5, "powerstorage" = 3) build_type = PROTOLATHE materials = list("$metal" = 5000, "$glass" = 1000, "$uranium" = 500) - reliability_base = 76 + reliability = 76 build_path = "/obj/item/weapon/gun/energy/gun/nuclear" locked = 1 @@ -1403,7 +1401,7 @@ datum/design/chemsprayer req_tech = list("combat" = 3, "materials" = 3, "engineering" = 3, "biotech" = 2) build_type = PROTOLATHE materials = list("$metal" = 5000, "$glass" = 1000) - reliability_base = 100 + reliability = 100 build_path = "/obj/item/weapon/chemsprayer" */ datum/design/rapidsyringe @@ -1450,7 +1448,7 @@ datum/design/large_grenade req_tech = list("combat" = 3, "materials" = 2) build_type = PROTOLATHE materials = list("$metal" = 3000) - reliability_base = 79 + reliability = 79 build_path = "/obj/item/weapon/grenade/chem_grenade/large" datum/design/smg @@ -1529,7 +1527,7 @@ datum/design/plasmacutter req_tech = list("materials" = 4, "plasmatech" = 3, "engineering" = 3) build_type = PROTOLATHE materials = list("$metal" = 1500, "$glass" = 500, "$gold" = 500, "$plasma" = 500) - reliability_base = 79 + reliability = 79 build_path = "/obj/item/weapon/pickaxe/plasmacutter" datum/design/pick_diamond @@ -1548,7 +1546,7 @@ datum/design/drill_diamond req_tech = list("materials" = 6, "powerstorage" = 4, "engineering" = 4) build_type = PROTOLATHE materials = list("$metal" = 3000, "$glass" = 1000, "$diamond" = 3750) //Yes, a whole diamond is needed. - reliability_base = 79 + reliability = 79 build_path = "/obj/item/weapon/pickaxe/diamonddrill" datum/design/mesons @@ -1580,7 +1578,7 @@ datum/design/bag_holding req_tech = list("bluespace" = 4, "materials" = 6) build_type = PROTOLATHE materials = list("$gold" = 3000, "$diamond" = 1500, "$uranium" = 250) - reliability_base = 80 + reliability = 80 build_path = "/obj/item/weapon/storage/backpack/holding" datum/design/bluespace_crystal @@ -1590,7 +1588,7 @@ datum/design/bluespace_crystal req_tech = list("bluespace" = 4, "materials" = 6) build_type = PROTOLATHE materials = list("$diamond" = 1500, "$plasma" = 1500) - reliability_base = 100 + reliability = 100 build_path = "/obj/item/bluespace_crystal/artificial" ///////////////////////////////////////// diff --git a/code/modules/research/destructive_analyzer.dm b/code/modules/research/destructive_analyzer.dm index bee0c198916..c0d7d862032 100644 --- a/code/modules/research/destructive_analyzer.dm +++ b/code/modules/research/destructive_analyzer.dm @@ -25,8 +25,7 @@ Note: Must be placed within 3 tiles of the R&D Console /obj/machinery/r_n_d/destructive_analyzer/RefreshParts() var/T = 0 for(var/obj/item/weapon/stock_parts/S in src) - T += S.rating * 0.1 - T = Clamp(T, 0, 1) + T += S.rating decon_mod = T /obj/machinery/r_n_d/destructive_analyzer/meteorhit() @@ -72,7 +71,7 @@ Note: Must be placed within 3 tiles of the R&D Console if (temp_tech.len == 0) user << "\red You cannot deconstruct this item!" return - if(O.reliability < 90 && O.crit_fail == 0) + if(O.reliability < (99-(decon_mod*3)) && O.crit_fail == 0) usr << "\red Item is neither reliable enough or broken enough to learn from." return busy = 1 diff --git a/code/modules/research/protolathe.dm b/code/modules/research/protolathe.dm index ec908f22d73..1e09063ca1d 100644 --- a/code/modules/research/protolathe.dm +++ b/code/modules/research/protolathe.dm @@ -22,6 +22,7 @@ Note: Must be placed west/left of and R&D console to function. var/diamond_amount = 0.0 var/clown_amount = 0.0 var/adamantine_amount = 0.0 + var/efficiency_coeff /obj/machinery/r_n_d/protolathe/New() @@ -50,6 +51,10 @@ Note: Must be placed west/left of and R&D console to function. for(var/obj/item/weapon/stock_parts/matter_bin/M in component_parts) T += M.rating max_material_storage = T * 75000 + T = 0 + for(var/obj/item/weapon/stock_parts/manipulator/M in component_parts) + T += M.rating + efficiency_coeff = T-1 /obj/machinery/r_n_d/protolathe/attackby(var/obj/item/O as obj, var/mob/user as mob) if (shocked) diff --git a/code/modules/research/rdconsole.dm b/code/modules/research/rdconsole.dm index 21f40240320..ac9743cd52e 100644 --- a/code/modules/research/rdconsole.dm +++ b/code/modules/research/rdconsole.dm @@ -256,15 +256,15 @@ won't update every console in existence) but it's more of a hassle to do. Also, usr <<"\red The destructive analyzer appears to be empty." screen = 1.0 return - if(linked_destroy.loaded_item.reliability >= 90) + if(linked_destroy.loaded_item.reliability >= 99 - (linked_destroy.decon_mod * 3)) var/list/temp_tech = linked_destroy.ConvertReqString2List(linked_destroy.loaded_item.origin_tech) for(var/T in temp_tech) - files.UpdateTech(T, temp_tech[T]) - if(linked_destroy.loaded_item.reliability < 100 && linked_destroy.loaded_item.crit_fail) - files.UpdateDesign(linked_destroy.loaded_item.type) + if(prob(linked_destroy.loaded_item.reliability)) + files.UpdateTech(T, temp_tech[T]) + files.UpdateDesigns(linked_destroy.loaded_item, temp_tech, src) if(linked_lathe) //Also sends salvaged materials to a linked protolathe, if any. - linked_lathe.m_amount += min((linked_lathe.max_material_storage - linked_lathe.TotalMaterials()), (linked_destroy.loaded_item.m_amt*linked_destroy.decon_mod)) - linked_lathe.g_amount += min((linked_lathe.max_material_storage - linked_lathe.TotalMaterials()), (linked_destroy.loaded_item.g_amt*linked_destroy.decon_mod)) + linked_lathe.m_amount += min((linked_lathe.max_material_storage - linked_lathe.TotalMaterials()), (linked_destroy.loaded_item.m_amt*(linked_destroy.decon_mod/10))) + linked_lathe.g_amount += min((linked_lathe.max_material_storage - linked_lathe.TotalMaterials()), (linked_destroy.loaded_item.g_amt*(linked_destroy.decon_mod/10))) linked_destroy.loaded_item = null for(var/obj/I in linked_destroy.contents) for(var/mob/M in I.contents) @@ -326,6 +326,7 @@ won't update every console in existence) but it's more of a hassle to do. Also, sync = !sync else if(href_list["build"]) //Causes the Protolathe to build something. + var/coeff = linked_lathe.efficiency_coeff var/g2g = 1 if(linked_lathe) var/datum/design/being_built = null @@ -351,23 +352,23 @@ won't update every console in existence) but it's more of a hassle to do. Also, break switch(M) if("$metal") - linked_lathe.m_amount = max(0, (linked_lathe.m_amount-being_built.materials[M])) + linked_lathe.m_amount = max(0, (linked_lathe.m_amount-(being_built.materials[M]/coeff))) if("$glass") - linked_lathe.g_amount = max(0, (linked_lathe.g_amount-being_built.materials[M])) + linked_lathe.g_amount = max(0, (linked_lathe.g_amount-(being_built.materials[M]/coeff))) if("$gold") - linked_lathe.gold_amount = max(0, (linked_lathe.gold_amount-being_built.materials[M])) + linked_lathe.gold_amount = max(0, (linked_lathe.gold_amount-(being_built.materials[M]/coeff))) if("$silver") - linked_lathe.silver_amount = max(0, (linked_lathe.silver_amount-being_built.materials[M])) + linked_lathe.silver_amount = max(0, (linked_lathe.silver_amount-(being_built.materials[M]/coeff))) if("$plasma") - linked_lathe.plasma_amount = max(0, (linked_lathe.plasma_amount-being_built.materials[M])) + linked_lathe.plasma_amount = max(0, (linked_lathe.plasma_amount-(being_built.materials[M]/coeff))) if("$uranium") - linked_lathe.uranium_amount = max(0, (linked_lathe.uranium_amount-being_built.materials[M])) + linked_lathe.uranium_amount = max(0, (linked_lathe.uranium_amount-(being_built.materials[M]/coeff))) if("$diamond") - linked_lathe.diamond_amount = max(0, (linked_lathe.diamond_amount-being_built.materials[M])) + linked_lathe.diamond_amount = max(0, (linked_lathe.diamond_amount-(being_built.materials[M]/coeff))) if("$clown") - linked_lathe.clown_amount = max(0, (linked_lathe.clown_amount-being_built.materials[M])) + linked_lathe.clown_amount = max(0, (linked_lathe.clown_amount-(being_built.materials[M]/coeff))) else - linked_lathe.reagents.remove_reagent(M, being_built.materials[M]) + linked_lathe.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. var/R = being_built.reliability @@ -378,6 +379,8 @@ won't update every console in existence) but it's more of a hassle to do. Also, if( new_item.type == /obj/item/weapon/storage/backpack/holding ) new_item.investigate_log("built by [key]","singulo") new_item.reliability = R + new_item.m_amt /= coeff + new_item.g_amt /= coeff if(linked_lathe.hacked) R = max((reliability / 2), 0) if(O) var/obj/item/weapon/storage/lockbox/L = new/obj/item/weapon/storage/lockbox(linked_lathe.loc) @@ -390,6 +393,7 @@ won't update every console in existence) but it's more of a hassle to do. Also, updateUsrDialog() else if(href_list["imprint"]) //Causes the Circuit Imprinter to build something. + var/coeff = 2 ** linked_imprinter.efficiency_coeff if(linked_imprinter) var/datum/design/being_built = null for(var/datum/design/D in files.known_designs) @@ -409,20 +413,19 @@ won't update every console in existence) but it's more of a hassle to do. Also, for(var/M in being_built.materials) switch(M) if("$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("$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("$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. var/R = being_built.reliability spawn(16) var/obj/new_item = new P(src) new_item.reliability = R - if(linked_imprinter.hacked) R = max((reliability / 2), 0) new_item.loc = linked_imprinter.loc linked_imprinter.busy = 0 screen = 4.1 @@ -533,23 +536,23 @@ won't update every console in existence) but it's more of a hassle to do. Also, /obj/machinery/computer/rdconsole/proc/check_mat(datum/design/being_built, var/M) switch(M) if("$metal") - return (linked_lathe.m_amount - being_built.materials[M] >= 0) ? 1 : 0 + return (linked_lathe.m_amount - (being_built.materials[M]/linked_lathe.efficiency_coeff) >= 0) ? 1 : 0 if("$glass") - return (linked_lathe.g_amount - being_built.materials[M] >= 0) ? 1 : 0 + return (linked_lathe.g_amount - (being_built.materials[M]/linked_lathe.efficiency_coeff) >= 0) ? 1 : 0 if("$gold") - return (linked_lathe.gold_amount - being_built.materials[M] >= 0) ? 1 : 0 + return (linked_lathe.gold_amount - (being_built.materials[M]/linked_lathe.efficiency_coeff) >= 0) ? 1 : 0 if("$silver") - return (linked_lathe.silver_amount - being_built.materials[M] >= 0) ? 1 : 0 + return (linked_lathe.silver_amount - (being_built.materials[M]/linked_lathe.efficiency_coeff) >= 0) ? 1 : 0 if("$plasma") - return (linked_lathe.plasma_amount - being_built.materials[M] >= 0) ? 1 : 0 + return (linked_lathe.plasma_amount - (being_built.materials[M]/linked_lathe.efficiency_coeff) >= 0) ? 1 : 0 if("$uranium") - return (linked_lathe.uranium_amount - being_built.materials[M] >= 0) ? 1 : 0 + return (linked_lathe.uranium_amount - (being_built.materials[M]/linked_lathe.efficiency_coeff) >= 0) ? 1 : 0 if("$diamond") - return (linked_lathe.diamond_amount - being_built.materials[M] >= 0) ? 1 : 0 + return (linked_lathe.diamond_amount - (being_built.materials[M]/linked_lathe.efficiency_coeff) >= 0) ? 1 : 0 if("$clown") - return (linked_lathe.clown_amount - being_built.materials[M] >= 0) ? 1 : 0 + return (linked_lathe.clown_amount - (being_built.materials[M]/linked_lathe.efficiency_coeff) >= 0) ? 1 : 0 else - return linked_lathe.reagents.remove_reagent(M, being_built.materials[M]) + return linked_lathe.reagents.remove_reagent(M, (being_built.materials[M]/linked_lathe.efficiency_coeff)) /obj/machinery/computer/rdconsole/attack_hand(mob/user as mob) if(..()) @@ -708,6 +711,7 @@ won't update every console in existence) but it's more of a hassle to do. Also, dat += "Main Menu
" dat += "Deconstruction Menu
" dat += "Name: [linked_destroy.loaded_item.name]
" + dat += "Reliability: [linked_destroy.loaded_item.reliability]
" dat += "Origin Tech:
" var/list/temp_tech = linked_destroy.ConvertReqString2List(linked_destroy.loaded_item.origin_tech) for(var/T in temp_tech) @@ -727,32 +731,33 @@ won't update every console in existence) but it's more of a hassle to do. Also, dat += "Protolathe Menu:

" dat += "Material Amount: [linked_lathe.TotalMaterials()] cm3 (MAX: [linked_lathe.max_material_storage])
" dat += "Chemical Volume: [linked_lathe.reagents.total_volume] (MAX: [linked_lathe.reagents.maximum_volume])
" + var/coeff = linked_lathe.efficiency_coeff for(var/datum/design/D in files.known_designs) if(!(D.build_type & PROTOLATHE)) continue var/temp_dat = "[D.name]" var/check_materials = 1 for(var/M in D.materials) - temp_dat += " [D.materials[M]] [CallMaterialName(M)]" + temp_dat += " [D.materials[M]/coeff] [CallMaterialName(M)]" if(copytext(M, 1, 2) == "$") switch(M) if("$glass") - if(D.materials[M] > linked_lathe.g_amount) check_materials = 0 + if(D.materials[M]/coeff > linked_lathe.g_amount) check_materials = 0 if("$metal") - if(D.materials[M] > linked_lathe.m_amount) check_materials = 0 + if(D.materials[M]/coeff > linked_lathe.m_amount) check_materials = 0 if("$gold") - if(D.materials[M] > linked_lathe.gold_amount) check_materials = 0 + if(D.materials[M]/coeff > linked_lathe.gold_amount) check_materials = 0 if("$silver") - if(D.materials[M] > linked_lathe.silver_amount) check_materials = 0 + if(D.materials[M]/coeff > linked_lathe.silver_amount) check_materials = 0 if("$plasma") - if(D.materials[M] > linked_lathe.plasma_amount) check_materials = 0 + if(D.materials[M]/coeff > linked_lathe.plasma_amount) check_materials = 0 if("$uranium") - if(D.materials[M] > linked_lathe.uranium_amount) check_materials = 0 + if(D.materials[M]/coeff > linked_lathe.uranium_amount) check_materials = 0 if("$diamond") - if(D.materials[M] > linked_lathe.diamond_amount) check_materials = 0 + if(D.materials[M]/coeff > linked_lathe.diamond_amount) check_materials = 0 if("$clown") - if(D.materials[M] > linked_lathe.clown_amount) check_materials = 0 - else if (!linked_lathe.reagents.has_reagent(M, D.materials[M])) + if(D.materials[M]/coeff > linked_lathe.clown_amount) check_materials = 0 + else if (!linked_lathe.reagents.has_reagent(M, D.materials[M]/coeff)) check_materials = 0 if (check_materials) dat += "* [temp_dat]
" @@ -840,23 +845,23 @@ won't update every console in existence) but it's more of a hassle to do. Also, dat += "Circuit Imprinter Menu:

" dat += "Material Amount: [linked_imprinter.TotalMaterials()] cm3
" dat += "Chemical Volume: [linked_imprinter.reagents.total_volume]
" - + var/coeff = 2 ** linked_imprinter.efficiency_coeff for(var/datum/design/D in files.known_designs) if(!(D.build_type & IMPRINTER)) continue var/temp_dat = "[D.name]" var/check_materials = 1 for(var/M in D.materials) - temp_dat += " [D.materials[M]] [CallMaterialName(M)]" + temp_dat += " [D.materials[M]/coeff] [CallMaterialName(M)]" if(copytext(M, 1, 2) == "$") switch(M) if("$glass") - if(D.materials[M] > linked_imprinter.g_amount) check_materials = 0 + if(D.materials[M]/coeff > linked_imprinter.g_amount) check_materials = 0 if("$gold") - if(D.materials[M] > linked_imprinter.gold_amount) check_materials = 0 + if(D.materials[M]/coeff > linked_imprinter.gold_amount) check_materials = 0 if("$diamond") - if(D.materials[M] > linked_imprinter.diamond_amount) check_materials = 0 - else if (!linked_imprinter.reagents.has_reagent(M, D.materials[M])) + if(D.materials[M]/coeff > linked_imprinter.diamond_amount) check_materials = 0 + else if (!linked_imprinter.reagents.has_reagent(M, D.materials[M]/coeff)) check_materials = 0 if (check_materials) dat += "* [temp_dat]
" diff --git a/code/modules/research/research.dm b/code/modules/research/research.dm index 7938720c0c9..f65bbad5142 100644 --- a/code/modules/research/research.dm +++ b/code/modules/research/research.dm @@ -118,8 +118,8 @@ research holder datum. /datum/research/proc/AddDesign2Known(var/datum/design/D) for(var/datum/design/known in known_designs) if(D.id == known.id) - if(D.reliability_mod > known.reliability_mod) - known.reliability_mod = D.reliability_mod + if(D.reliability > known.reliability) + known.reliability = D.reliability return known_designs += D return @@ -144,17 +144,20 @@ research holder datum. /datum/research/proc/UpdateTech(var/ID, var/level) for(var/datum/tech/KT in known_tech) if(KT.id == ID) - if(KT.level <= level) KT.level = max((KT.level + 1), (level - 1)) + if(KT.level <= level) + KT.level = max((KT.level + 1), (level - 1)) return -/datum/research/proc/UpdateDesign(var/path) - for(var/datum/design/KD in known_designs) - if(KD.build_path == path) - KD.reliability_mod += rand(1,2) - break - return - - +/datum/research/proc/UpdateDesigns(var/obj/item/I, var/list/temp_tech) + for(var/T in temp_tech) + if(temp_tech[T] - 1 >= known_tech[T]) + for(var/datum/design/D in known_designs) + if(D.req_tech[T]) + D.reliability = min(100, D.reliability + prob(35)) + if(D.build_path == I.type) + D.reliability = min(100, D.reliability + rand(1,3)) + if(I.crit_fail) + D.reliability = min(100, D.reliability + rand(3, 5)) /*************************************************************** diff --git a/code/modules/research/server.dm b/code/modules/research/server.dm index b90917b53e1..4c4daca528d 100644 --- a/code/modules/research/server.dm +++ b/code/modules/research/server.dm @@ -250,7 +250,6 @@ if(choice == "Continue") for(var/datum/design/D in temp_server.files.known_designs) if(D.id == href_list["reset_design"]) - D.reliability_mod = 0 temp_server.files.known_designs -= D break temp_server.files.RefreshResearch()