diff --git a/code/__DEFINES/research.dm b/code/__DEFINES/research.dm index 5facee079a..bafce49947 100644 --- a/code/__DEFINES/research.dm +++ b/code/__DEFINES/research.dm @@ -61,3 +61,13 @@ #define DESIGN_ID_IGNORE "IGNORE_THIS_DESIGN" #define RESEARCH_MATERIAL_RECLAMATION_ID "__materials" + +//When adding new types, update the list below! +#define TECHWEB_POINT_TYPE_GENERIC "General Research" + +#define TECHWEB_POINT_TYPE_DEFAULT TECHWEB_POINT_TYPE_GENERIC + +//defined here so people don't forget to change this! +#define TECHWEB_POINT_TYPE_LIST_ASSOCIATIVE_NAMES list(\ + TECHWEB_POINT_TYPE_GENERIC = "General Research"\ + ) diff --git a/code/controllers/subsystem/research.dm b/code/controllers/subsystem/research.dm index 3f6f42f833..4c0e913f59 100644 --- a/code/controllers/subsystem/research.dm +++ b/code/controllers/subsystem/research.dm @@ -14,12 +14,13 @@ SUBSYSTEM_DEF(research) var/list/techweb_categories = list() //category name = list(node.id = node) var/list/techweb_designs = list() //associative id = node datum var/list/techweb_nodes_starting = list() //associative id = node datum - var/list/techweb_boost_items = list() //associative double-layer path = list(id = point_discount) + var/list/techweb_boost_items = list() //associative double-layer path = list(id = list(point_type = point_discount)) var/list/techweb_nodes_hidden = list() //Nodes that should be hidden by default. - var/list/techweb_point_items = list() //path = value + var/list/techweb_point_items = list() //path = list(point type = value) var/list/errored_datums = list() + var/list/point_types = list() //typecache style type = TRUE list //---------------------------------------------- - var/single_server_income = 54.3 + var/list/single_server_income = list(TECHWEB_POINT_TYPE_GENERIC = 54.3) var/multiserver_calculation = FALSE var/last_income = 0 //^^^^^^^^ ALL OF THESE ARE PER SECOND! ^^^^^^^^ @@ -29,6 +30,7 @@ SUBSYSTEM_DEF(research) //Around 450000 points max??? /datum/controller/subsystem/research/Initialize() + point_types = TECHWEB_POINT_TYPE_LIST_ASSOCIATIVE_NAMES initialize_all_techweb_designs() initialize_all_techweb_nodes() science_tech = new /datum/techweb/science @@ -40,20 +42,25 @@ SUBSYSTEM_DEF(research) handle_research_income() /datum/controller/subsystem/research/proc/handle_research_income() - var/bitcoins = 0 + var/list/bitcoins if(multiserver_calculation) + bitcoins = list() var/eff = calculate_server_coefficient() for(var/obj/machinery/rnd/server/miner in servers) - bitcoins += (miner.mine() * eff) //SLAVE AWAY, SLAVE. + var/list/result = (miner.mine()) //SLAVE AWAY, SLAVE. + for(var/i in result) + result[i] *= eff + bitcoins[i] = bitcoins[i]? bitcoins[i] + result[i] : result[i] else for(var/obj/machinery/rnd/server/miner in servers) if(miner.working) - bitcoins = single_server_income + bitcoins = single_server_income.Copy() break //Just need one to work. var/income_time_difference = world.time - last_income science_tech.last_bitcoins = bitcoins // Doesn't take tick drift into account - bitcoins *= income_time_difference / 10 - science_tech.research_points += bitcoins + for(var/i in bitcoins) + bitcoins[i] *= income_time_difference / 10 + science_tech.add_point_list(bitcoins) last_income = world.time /datum/controller/subsystem/research/proc/calculate_server_coefficient() //Diminishing returns. diff --git a/code/game/machinery/doppler_array.dm b/code/game/machinery/doppler_array.dm index 3ba1b473c7..0abc3e8cea 100644 --- a/code/game/machinery/doppler_array.dm +++ b/code/game/machinery/doppler_array.dm @@ -119,7 +119,7 @@ GLOBAL_LIST_EMPTY(doppler_arrays) say("Explosion not large enough for research calculations.") return linked_techweb.max_bomb_value = adjusted - linked_techweb.research_points += point_gain + linked_techweb.add_point_type(TECHWEB_POINT_TYPE_DEFAULT, point_gain) say("Gained [point_gain] points from explosion dataset.") /obj/machinery/doppler_array/research/science/Initialize() diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 042ff6d8f0..9da8946429 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -204,11 +204,10 @@ GLOBAL_VAR_INIT(rpg_loot_items, FALSE) research_msg += sep research_msg += node.display_name sep = ", " - var/points = techweb_item_point_check(src) - if (points) - research_msg += sep - research_msg += "[points] points" + var/list/points = techweb_item_point_check(src) + if (length(points)) sep = ", " + research_msg += techweb_point_display_generic(points) if (!sep) // nothing was shown research_msg += "None" diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index ca6d71c00c..376f3f857b 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -393,10 +393,10 @@ GLOBAL_LIST_INIT(ballmer_windows_me_msg, list("Yo man, what if, we like, uh, put ballmer_percent = (-abs(drunkenness - 13.35) / 0.9) + 1 if(prob(5)) say(pick(GLOB.ballmer_good_msg)) - SSresearch.science_tech.research_points += (BALLMER_POINTS * ballmer_percent) + SSresearch.science_tech.add_points_all(TECHWEB_POINT_TYPE_DEFAULT, (BALLMER_POINTS * ballmer_percent)) if(drunkenness > 26) // by this point you're into windows ME territory if(prob(5)) - SSresearch.science_tech.research_points -= BALLMER_POINTS + SSresearch.science_tech.remove_points_all(TECHWEB_POINT_TYPE_DEFAULT, BALLMER_POINTS) say(pick(GLOB.ballmer_windows_me_msg)) if(drunkenness >= 41) if(prob(25)) diff --git a/code/modules/power/singularity/collector.dm b/code/modules/power/singularity/collector.dm index 15ae1748f0..7898cd6a2e 100644 --- a/code/modules/power/singularity/collector.dm +++ b/code/modules/power/singularity/collector.dm @@ -66,7 +66,7 @@ loaded_tank.air_contents.gases[/datum/gas/carbon_dioxide][MOLES] += gasdrained*2 loaded_tank.air_contents.garbage_collect() var/bitcoins_mined = min(last_power, (last_power*RAD_COLLECTOR_STORED_OUT)+1000) - SSresearch.science_tech.research_points += bitcoins_mined*RAD_COLLECTOR_MINING_CONVERSION_RATE + SSresearch.science_tech.add_point_type(TECHWEB_POINT_TYPE_DEFAULT, bitcoins_mined*RAD_COLLECTOR_MINING_CONVERSION_RATE) last_power-=bitcoins_mined /obj/machinery/power/rad_collector/attack_hand(mob/user) diff --git a/code/modules/power/tesla/coil.dm b/code/modules/power/tesla/coil.dm index 11b0c0c295..b2714ad7ca 100644 --- a/code/modules/power/tesla/coil.dm +++ b/code/modules/power/tesla/coil.dm @@ -84,7 +84,7 @@ playsound(src.loc, 'sound/magic/lightningshock.ogg', 100, 1, extrarange = 5) tesla_zap(src, 5, power_produced) if(istype(linked_techweb)) - linked_techweb.research_points += min(power_produced, 1) // x4 coils = ~240/m point bonus for R&D + linked_techweb.add_point_type(TECHWEB_POINT_TYPE_DEFAULT, min(power_produced, 1)) // x4 coils = ~240/m point bonus for R&D addtimer(CALLBACK(src, .proc/reset_shocked), 10) tesla_buckle_check(power) else @@ -119,7 +119,7 @@ playsound(src.loc, 'sound/magic/lightningshock.ogg', 100, 1, extrarange = 5) tesla_zap(src, 5, power_produced) if(istype(linked_techweb)) - linked_techweb.research_points += min(power_produced, 3) // x4 coils with a pulse per second or so = ~720/m point bonus for R&D + linked_techweb.add_point_type(TECHWEB_POINT_TYPE_DEFAULT, min(power_produced, 3)) // x4 coils with a pulse per second or so = ~720/m point bonus for R&D addtimer(CALLBACK(src, .proc/reset_shocked), 10) tesla_buckle_check(power) else diff --git a/code/modules/research/destructive_analyzer.dm b/code/modules/research/destructive_analyzer.dm index e7877c44cc..b4ab8872e0 100644 --- a/code/modules/research/destructive_analyzer.dm +++ b/code/modules/research/destructive_analyzer.dm @@ -108,13 +108,17 @@ Note: Must be placed within 3 tiles of the R&D Console if(isnull(can_boost[id])) return FALSE var/dpath = loaded_item.type - var/worth = TN.boost_item_paths[dpath] - if(isnull(worth)) + var/list/worths = TN.boost_item_paths[dpath] + var/list/differences = list() + var/list/already_boosted = linked_console.stored_research.boosted_nodes[TN.id] + for(var/i in worths) + var/used = already_boosted? already_boosted[i] : 0 + var/value = min(worths[i], TN.research_costs[i]) - used + if(value > 0) + differences[i] = value + if(!length(differences)) return FALSE - var/difference = min(worth, TN.research_cost) - linked_console.stored_research.boosted_nodes[TN.id] - if(worth && difference <= 0) - return FALSE - var/choice = input("Are you sure you want to destroy [loaded_item] to [!worth ? "reveal [TN.display_name]" : "boost [TN.display_name] by [difference] point\s"]?") in list("Proceed", "Cancel") + var/choice = input("Are you sure you want to destroy [loaded_item] to [!length(worths) ? "reveal [TN.display_name]" : "boost [TN.display_name] by [json_encode(differences)] point\s"]?") in list("Proceed", "Cancel") if(choice == "Cancel") return FALSE if(QDELETED(loaded_item) || QDELETED(linked_console) || !user.Adjacent(linked_console) || QDELETED(src)) @@ -124,19 +128,18 @@ Note: Must be placed within 3 tiles of the R&D Console linked_console.stored_research.boost_with_path(SSresearch.techweb_nodes[TN.id], dpath) else - var/point_value = techweb_item_point_check(loaded_item) + var/list/point_value = techweb_item_point_check(loaded_item) if(linked_console.stored_research.deconstructed_items[loaded_item.type]) - point_value = 0 - var/choice = input("Are you sure you want to destroy [loaded_item] for [point_value ? "[point_value] research points" : "material reclamation"]?") in list("Proceed", "Cancel") + point_value = list() + var/choice = input("Are you sure you want to destroy [loaded_item] for [length(point_value) ? "[json_encode(point_value)] points" : "material reclamation"]?") in list("Proceed", "Cancel") if(choice == "Cancel") return FALSE if(QDELETED(loaded_item) || QDELETED(linked_console) || !user.Adjacent(linked_console) || QDELETED(src)) return FALSE var/loaded_type = loaded_item.type if(destroy_item(loaded_item)) - linked_console.stored_research.research_points += point_value + linked_console.stored_research.add_point_list(point_value) linked_console.stored_research.deconstructed_items[loaded_type] = point_value - return TRUE /obj/machinery/rnd/destructive_analyzer/proc/unload_item() diff --git a/code/modules/research/rdconsole.dm b/code/modules/research/rdconsole.dm index 17bacc01d7..0cde37c1df 100644 --- a/code/modules/research/rdconsole.dm +++ b/code/modules/research/rdconsole.dm @@ -150,11 +150,11 @@ doesn't have toxins access. if(!istype(TN)) say("Node unlock failed: Unknown error.") return FALSE - var/price = TN.get_price(stored_research) - if(stored_research.research_points >= price) - investigate_log("[key_name(user)] researched [id]([price]) on techweb id [stored_research.id].", INVESTIGATE_RESEARCH) + var/list/price = TN.get_price(stored_research) + if(stored_research.can_afford(price)) + investigate_log("[key_name(user)] researched [id]([json_encode(price)]) on techweb id [stored_research.id].", INVESTIGATE_RESEARCH) if(stored_research == SSresearch.science_tech) - SSblackbox.record_feedback("associative", "science_techweb_unlock", 1, list("id" = "[id]", "name" = TN.display_name, "price" = "[price]", "time" = SQLtime())) + SSblackbox.record_feedback("associative", "science_techweb_unlock", 1, list("id" = "[id]", "name" = TN.display_name, "price" = "[json_encode(price)]", "time" = SQLtime())) if(stored_research.research_node(SSresearch.techweb_nodes[id])) say("Successfully researched [TN.display_name].") var/logname = "Unknown" @@ -171,7 +171,7 @@ doesn't have toxins access. var/obj/item/card/id/ID = I.GetID() if(istype(ID)) logname = "User: [ID.registered_name]" - stored_research.research_logs += "[logname] researched node id [id] for [price] points." + stored_research.research_logs += "[logname] researched node id [id] with cost [json_encode(price)]." return TRUE else say("Failed to research node: Internal database error!") @@ -222,7 +222,7 @@ doesn't have toxins access. var/datum/asset/spritesheet/sheet = get_asset_datum(/datum/asset/spritesheet/research_designs) l += "[sheet.css_tag()][RDSCREEN_NOBREAK]" l += "
[stored_research.organization] Research and Development Network" - l += "Available points: [round(stored_research.research_points)] (+[round(stored_research.last_bitcoins * 60)] / minute)" + l += "Available points:
[techweb_point_display_rdconsole(stored_research.research_points, stored_research.last_bitcoins)]" l += "Security protocols: [obj_flags & EMAGGED ? "Disabled" : "Enabled"]" l += "Main Menu | Back
[RDSCREEN_NOBREAK]" l += "[ui_mode == 1? "Normal View" : "Normal View"] | [ui_mode == 2? "Expert View" : "Expert View"] | [ui_mode == 3? "List View" : "List View"]" @@ -553,14 +553,14 @@ doesn't have toxins access. var/list/boostable_nodes = techweb_item_boost_check(linked_destroy.loaded_item) for(var/id in boostable_nodes) anything = TRUE - var/worth = boostable_nodes[id] + var/list/worth = boostable_nodes[id] var/datum/techweb_node/N = get_techweb_node_by_id(id) l += "
[RDSCREEN_NOBREAK]" if (stored_research.researched_nodes[N.id]) // already researched l += "[N.display_name]" l += "This node has already been researched." - else if (worth == 0) // reveal only + else if(!length(worth)) // reveal only if (stored_research.hidden_nodes[N.id]) l += "[N.display_name]" l += "This node will be revealed." @@ -568,26 +568,32 @@ doesn't have toxins access. l += "[N.display_name]" l += "This node has already been revealed." else // boost by the difference - var/difference = min(worth, N.research_cost) - stored_research.boosted_nodes[N.id] - if (difference > 0) + var/list/differences = list() + var/list/already_boosted = stored_research.boosted_nodes[N.id] + for(var/i in worth) + var/already_boosted_amount = already_boosted? stored_research.boosted_nodes[N.id][i] : 0 + var/amt = min(worth[i], N.research_costs[i]) - already_boosted_amount + if(amt > 0) + differences[i] = amt + if (length(differences)) l += "[N.display_name]" - l += "This node will be boosted by [difference] points." + l += "This node will be boosted with the following:
[techweb_point_display_generic(differences)]" else l += "[N.display_name]" l += "This node has already been boosted." l += "
[RDSCREEN_NOBREAK]" // point deconstruction and material reclamation use the same ID to prevent accidentally missing the points - var/point_value = techweb_item_point_check(linked_destroy.loaded_item) - if(point_value) + var/list/point_values = techweb_item_point_check(linked_destroy.loaded_item) + if(point_values) anything = TRUE l += "
[RDSCREEN_NOBREAK]" if (stored_research.deconstructed_items[linked_destroy.loaded_item.type]) l += "Point Deconstruction" - l += "This item's [point_value] point\s have already been claimed." + l += "This item's points have already been claimed." else l += "Point Deconstruction" - l += "This item is worth [point_value] point\s!" + l += "This item is worth:
[techweb_point_display_generic(point_values)]!" l += "
[RDSCREEN_NOBREAK]" var/list/materials = linked_destroy.loaded_item.materials @@ -640,7 +646,7 @@ doesn't have toxins access. l += "

Available for Research:

" for(var/datum/techweb_node/N in avail) var/not_unlocked = (stored_research.available_nodes[N.id] && !stored_research.researched_nodes[N.id]) - var/has_points = (stored_research.research_points >= N.get_price(stored_research)) + var/has_points = (stored_research.can_afford(N.get_price(stored_research))) var/research_href = not_unlocked? (has_points? "Research" : "Not Enough Points") : null l += "[N.display_name][research_href]" l += "

Locked Nodes:

" @@ -659,7 +665,6 @@ doesn't have toxins access. var/list/l = list() if (stored_research.hidden_nodes[node.id]) return l - var/price = node.get_price(stored_research) var/display_name = node.display_name if (selflink) display_name = "[display_name]" @@ -670,12 +675,12 @@ doesn't have toxins access. if(stored_research.researched_nodes[node.id]) l += "Researched" else if(stored_research.available_nodes[node.id]) - if(stored_research.research_points >= price) - l += "[price]" + if(stored_research.can_afford(node.get_price(stored_research))) + l += "
[node.price_display(stored_research)]" else - l += "[price]" // gray - too expensive + l += "
[node.price_display(stored_research)]" // gray - too expensive else - l += "[price]" // red - missing prereqs + l += "
[node.price_display(stored_research)]" // red - missing prereqs if(ui_mode == RDCONSOLE_UI_MODE_NORMAL) l += "[node.description]" for(var/i in node.designs) diff --git a/code/modules/research/techweb/__techweb_helpers.dm b/code/modules/research/techweb/__techweb_helpers.dm index af4fe7480b..1b814ede1d 100644 --- a/code/modules/research/techweb/__techweb_helpers.dm +++ b/code/modules/research/techweb/__techweb_helpers.dm @@ -115,10 +115,16 @@ if(!ispath(p)) N.boost_item_paths -= p node_boost_error(N.id, "[p] is not a valid path.") - var/num = N.boost_item_paths[p] - if(!isnum(num)) + var/list/points = N.boost_item_paths[p] + if(!islist(points)) N.boost_item_paths -= p - node_boost_error(N.id, "[num] is not a valid number.") + node_boost_error(N.id, "No valid list.") + else + for(var/i in points) + if(!isnum(points[i])) + node_boost_error(N.id, "[points[i]] is not a valid number.") + else if(!SSresearch.point_types[i]) + node_boost_error(N.id, "[i] is not a valid point type.") CHECK_TICK /proc/verify_techweb_designs() @@ -168,16 +174,30 @@ if(!ispath(path)) continue if(length(SSresearch.techweb_boost_items[path])) - SSresearch.techweb_boost_items[path] += list(node.id = node.boost_item_paths[path]) + SSresearch.techweb_boost_items[path][node.id] = node.boost_item_paths[path] else SSresearch.techweb_boost_items[path] = list(node.id = node.boost_item_paths[path]) CHECK_TICK /proc/techweb_item_boost_check(obj/item/I) //Returns an associative list of techweb node datums with values of the boost it gives. var/list/returned = list() if(SSresearch.techweb_boost_items[I.type]) - return SSresearch.techweb_boost_items[I.type] //It should already be formatted in node datum = value. + return SSresearch.techweb_boost_items[I.type] //It should already be formatted in node datum = list(point type = value) /proc/techweb_item_point_check(obj/item/I) if(SSresearch.techweb_point_items[I.type]) return SSresearch.techweb_point_items[I.type] - return 0 + +/proc/techweb_point_display_generic(pointlist) + var/list/ret = list() + for(var/i in pointlist) + if(SSresearch.point_types[i]) + ret += "[SSresearch.point_types[i]]: [pointlist[i]]" + else + ret += "ERRORED POINT TYPE: [pointlist[i]]" + return ret.Join("
") + +/proc/techweb_point_display_rdconsole(pointlist, last_pointlist) + var/list/ret = list() + for(var/i in pointlist) + ret += "[SSresearch.point_types[i] || "ERRORED POINT TYPE"]: [pointlist[i]] (+[(last_pointlist[i]) * ((SSresearch.flags & SS_TICKER)? (600 / (world.tick_lag * SSresearch.wait)) : (600 / SSresearch.wait))]/ minute)" + return ret.Join("
") diff --git a/code/modules/research/techweb/_techweb.dm b/code/modules/research/techweb/_techweb.dm index 8a7c0eab6c..c8fb1c6d27 100644 --- a/code/modules/research/techweb/_techweb.dm +++ b/code/modules/research/techweb/_techweb.dm @@ -11,14 +11,14 @@ var/list/datum/design/researched_designs = list() //Designs that are available for use. Assoc list, id = datum var/list/datum/techweb_node/boosted_nodes = list() //Already boosted nodes that can't be boosted again. node datum = path of boost object. var/list/datum/techweb_node/hidden_nodes = list() //Hidden nodes. id = datum. Used for unhiding nodes when requirements are met by removing the entry of the node. - var/list/deconstructed_items = list() //items already deconstructed for a generic point boost - var/research_points = 0 //Available research points. + var/list/deconstructed_items = list() //items already deconstructed for a generic point boost. path = list(point_type = points) + var/list/research_points = list() //Available research points. type = number var/list/obj/machinery/computer/rdconsole/consoles_accessing = list() var/id = "generic" var/list/research_logs = list() //IC logs. var/max_bomb_value = 0 var/organization = "Third-Party" //Organization name, used for display. - var/last_bitcoins = 0 //Current per-second production, used for display only. + var/list/last_bitcoins = list() //Current per-second production, used for display only. var/list/tiers = list() //Assoc list, datum = number, 1 is available, 2 is all reqs are 1, so on /datum/techweb/New() @@ -29,7 +29,6 @@ return ..() /datum/techweb/admin - research_points = INFINITY //KEKKLES. id = "ADMIN" organization = "CentCom" @@ -38,6 +37,8 @@ for(var/i in SSresearch.techweb_nodes) var/datum/techweb_node/TN = SSresearch.techweb_nodes[i] research_node(TN, TRUE) + for(var/i in SSresearch.point_types) + research_points[i] = INFINITY hidden_nodes = list() /datum/techweb/science //Global science techweb for RND consoles. @@ -72,6 +73,39 @@ V.rescan_views() V.updateUsrDialog() +/datum/techweb/proc/add_point_list(list/pointlist) + for(var/i in pointlist) + if(SSresearch.point_types[i] && pointlist[i] > 0) + research_points[i] += pointlist[i] + +/datum/techweb/proc/add_points_all(amount) + var/list/l = SSresearch.point_types.Copy() + for(var/i in l) + l[i] = amount + add_point_list(l) + +/datum/techweb/proc/remove_point_list(list/pointlist) + for(var/i in pointlist) + if(SSresearch.point_types[i] && pointlist[i] > 0) + research_points[i] = max(0, research_points[i] - pointlist[i]) + +/datum/techweb/proc/remove_points_all(amount) + var/list/l = SSresearch.point_types.Copy() + for(var/i in l) + l[i] = amount + remove_point_list(l) + +/datum/techweb/proc/modify_point_list(list/pointlist) + for(var/i in pointlist) + if(SSresearch.point_types[i] && pointlist[i] != 0) + research_points[i] = max(0, research_points[i] + pointlist[i]) + +/datum/techweb/proc/modify_points_all(amount) + var/list/l = SSresearch.point_types.Copy() + for(var/i in l) + l[i] = amount + modify_point_list(l) + /datum/techweb/proc/copy_research_to(datum/techweb/reciever, unlock_hidden = TRUE) //Adds any missing research to theirs. for(var/i in researched_nodes) CHECK_TICK @@ -104,6 +138,24 @@ /datum/techweb/proc/get_researched_nodes() return researched_nodes - hidden_nodes +/datum/techweb/proc/add_point_type(type, amount) + if(!SSresearch.point_types[type] || (amount <= 0)) + return FALSE + research_points[type] = amount + return TRUE + +/datum/techweb/proc/modify_point_type(type, amount) + if(!SSresearch.point_types[type]) + return FALSE + research_points[type] = max(0, research_points[type] - amount) + return TRUE + +/datum/techweb/proc/remove_point_type(type, amount) + if(!SSresearch.point_types[type] || (amount <= 0)) + return FALSE + research_points[type] = max(0, research_points[type] - amount) + return TRUE + /datum/techweb/proc/add_design_by_id(id) return add_design(get_techweb_design_by_id(id)) @@ -122,6 +174,15 @@ researched_designs -= design.id return TRUE +/datum/techweb/proc/can_afford(list/pointlist) + for(var/i in pointlist) + if(research_points[i] < pointlist[i]) + return FALSE + return TRUE + +/datum/techweb/proc/printout_points() + return techweb_point_display_generic(research_points) + /datum/techweb/proc/research_node_id(id, force, auto_update_points) return research_node(get_techweb_node_by_id(id), force, auto_update_points) @@ -130,10 +191,10 @@ return FALSE update_node_status(node) if(!force) - if(!available_nodes[node.id] || (auto_adjust_cost && (research_points < node.get_price(src)))) + if(!available_nodes[node.id] || (auto_adjust_cost && (!can_afford(node.get_price(src))))) return FALSE if(auto_adjust_cost) - research_points -= node.get_price(src) + remove_point_list(node.get_price(src)) researched_nodes[node.id] = node //Add to our researched list for(var/i in node.unlocks) visible_nodes[i] = node.unlocks[i] @@ -155,7 +216,9 @@ /datum/techweb/proc/boost_with_path(datum/techweb_node/N, itempath) if(!istype(N) || !ispath(itempath)) return FALSE - boosted_nodes[N] = max(boosted_nodes[N], N.boost_item_paths[itempath]) + LAZYINITLIST(boosted_nodes[N]) + for(var/i in N.boost_item_paths[itempath]) + boosted_nodes[N][i] = max(boosted_nodes[N][i], N.boost_item_paths[itempath][i]) if(N.autounlock_by_boost) hidden_nodes -= N.id update_node_status(N) diff --git a/code/modules/research/techweb/_techweb_node.dm b/code/modules/research/techweb/_techweb_node.dm index 3ec6c4cf9d..875329a89c 100644 --- a/code/modules/research/techweb/_techweb_node.dm +++ b/code/modules/research/techweb/_techweb_node.dm @@ -12,17 +12,23 @@ var/list/datum/techweb_node/prerequisites = list() //Assoc list id = datum var/list/datum/techweb_node/unlocks = list() //CALCULATED FROM OTHER NODE'S PREREQUISITES. Assoc list id = datum. var/list/datum/design/designs = list() //Assoc list id = datum - var/list/boost_item_paths = list() //Associative list, path = point_value. + var/list/boost_item_paths = list() //Associative list, path = list(point type = point_value). var/autounlock_by_boost = TRUE //boosting this will autounlock this node. var/export_price = 0 //Cargo export price. - var/research_cost = 0 //Point cost to research. - var/actual_cost = 0 + var/list/research_costs = 0 //Point cost to research. type = amount var/category = "Misc" //Category -/datum/techweb_node/New() - actual_cost = research_cost - /datum/techweb_node/proc/get_price(datum/techweb/host) if(host) - actual_cost = research_cost - host.boosted_nodes[src] - return actual_cost + var/list/actual_costs = research_costs + if(host.boosted_nodes[src]) + var/list/L = host.boosted_nodes[src] + for(var/i in L) + if(actual_costs[i]) + actual_costs[i] -= L[i] + return actual_costs + else + return research_costs + +/datum/techweb_node/proc/price_display(datum/techweb/TN) + return techweb_point_display_generic(get_price(TN)) diff --git a/code/modules/research/techweb/all_nodes.dm b/code/modules/research/techweb/all_nodes.dm index c69d0ad728..8bce3808f6 100644 --- a/code/modules/research/techweb/all_nodes.dm +++ b/code/modules/research/techweb/all_nodes.dm @@ -18,8 +18,8 @@ display_name = "Biological Technology" description = "What makes us tick." //the MC, silly! prereq_ids = list("base") - design_ids = list("chem_heater", "chem_master", "chem_dispenser", "sleeper", "pandemic", "defibmount", "operating", "soda_dispenser", "beer_dispenser") - research_cost = 2500 + design_ids = list("chem_heater", "chem_master", "chem_dispenser", "sleeper", "vr_sleeper", "pandemic", "defibmount", "operating", "soda_dispenser", "beer_dispenser") + research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500) export_price = 5000 /datum/techweb_node/adv_biotech @@ -28,7 +28,7 @@ description = "Advanced Biotechnology" prereq_ids = list("biotech") design_ids = list("piercesyringe", "smoke_machine", "plasmarefiller", "limbgrower", "defibrillator", "meta_beaker") - research_cost = 2500 + research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500) export_price = 5000 /datum/techweb_node/bio_process @@ -37,7 +37,7 @@ description = "From slimes to kitchens." prereq_ids = list("biotech") design_ids = list("smartfridge", "gibber", "deepfryer", "monkey_recycler", "processor", "gibber", "microwave", "reagentgrinder", "dish_drive") - research_cost = 2500 + research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500) export_price = 5000 /////////////////////////Advanced Surgery///////////////////////// @@ -47,7 +47,7 @@ description = "When simple medicine doesn't cut it." prereq_ids = list("adv_biotech") design_ids = list("surgery_lobotomy", "surgery_reconstruction") - research_cost = 2500 + research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500) export_price = 5000 /datum/techweb_node/exp_surgery @@ -56,7 +56,7 @@ description = "When evolution isn't fast enough." prereq_ids = list("adv_surgery") design_ids = list("surgery_revival","surgery_pacify","surgery_vein_thread","surgery_nerve_splice","surgery_nerve_ground","surgery_viral_bond") - research_cost = 5000 + research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 5000) export_price = 5000 /datum/techweb_node/alien_surgery @@ -65,7 +65,7 @@ description = "Abductors did nothing wrong." prereq_ids = list("exp_surgery", "alientech") design_ids = list("surgery_brainwashing","surgery_zombie") - research_cost = 10000 + research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 10000) export_price = 5000 /////////////////////////data theory tech///////////////////////// @@ -74,7 +74,7 @@ display_name = "Data Theory" description = "Big Data, in space!" prereq_ids = list("base") - research_cost = 2500 + research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500) export_price = 5000 /datum/techweb_node/adv_datatheory @@ -83,7 +83,7 @@ description = "Better insight into programming and data." prereq_ids = list("datatheory") design_ids = list("icprinter", "icupgadv", "icupgclo") - research_cost = 2500 + research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500) export_price = 5000 /////////////////////////engineering tech///////////////////////// @@ -95,7 +95,7 @@ design_ids = list("solarcontrol", "recharger", "powermonitor", "rped", "pacman", "adv_capacitor", "adv_scanning", "emitter", "high_cell", "adv_matter_bin", "atmosalerts", "atmos_control", "recycler", "autolathe", "high_micro_laser", "nano_mani", "mesons", "thermomachine", "rad_collector", "tesla_coil", "grounding_rod", "apc_control", "cell_charger", "power control", "airlock_board", "firelock_board", "airalarm_electronics", "firealarm_electronics", "cell_charger", "stack_console", "stack_machine") - research_cost = 7500 + research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 7500) export_price = 5000 /datum/techweb_node/adv_engi @@ -104,7 +104,7 @@ description = "Pushing the boundaries of physics, one chainsaw-fist at a time." prereq_ids = list("engineering", "emp_basic") design_ids = list("engine_goggles", "magboots", "weldingmask") - research_cost = 2500 + research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500) export_price = 5000 /datum/techweb_node/anomaly @@ -113,7 +113,7 @@ description = "Unlock the potential of the mysterious anomalies that appear on station." prereq_ids = list("adv_engi", "practical_bluespace") design_ids = list("reactive_armour") - research_cost = 2500 + research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 5000) export_price = 5000 /datum/techweb_node/high_efficiency @@ -122,7 +122,7 @@ description = "Finely-tooled manufacturing techniques allowing for picometer-perfect precision levels." prereq_ids = list("engineering", "datatheory") design_ids = list("pico_mani", "super_matter_bin") - research_cost = 7500 + research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 7500) export_price = 5000 /datum/techweb_node/adv_power @@ -131,7 +131,7 @@ description = "How to get more zap." prereq_ids = list("engineering") design_ids = list("smes", "super_cell", "hyper_cell", "super_capacitor", "superpacman", "mrspacman", "power_turbine", "power_turbine_console", "power_compressor") - research_cost = 2500 + research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500) export_price = 5000 /////////////////////////Bluespace tech///////////////////////// @@ -140,8 +140,8 @@ display_name = "Basic Bluespace Theory" description = "Basic studies into the mysterious alternate dimension known as bluespace." prereq_ids = list("base") - design_ids = list("beacon","telesci_gps") //CIT CHANGE removed xenobioconsole from here. - research_cost = 2500 + design_ids = list("beacon", "xenobioconsole", "telesci_gps") + research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500) export_price = 5000 /datum/techweb_node/adv_bluespace @@ -151,7 +151,7 @@ prereq_ids = list("practical_bluespace", "high_efficiency") design_ids = list("bluespace_matter_bin", "femto_mani", "triphasic_scanning", "tele_station", "tele_hub", "quantumpad", "launchpad", "launchpad_console", "teleconsole", "bag_holding", "bluespace_crystal", "wormholeprojector", "bluespace_pod") - research_cost = 15000 + research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 15000) export_price = 5000 /datum/techweb_node/practical_bluespace @@ -159,8 +159,8 @@ display_name = "Applied Bluespace Research" description = "Using bluespace to make things faster and better." prereq_ids = list("bluespace_basic", "engineering") - design_ids = list("bs_rped","minerbag_holding", "telesci_gps", "bluespacebeaker", "bluespacesyringe", "bluespacebodybag", "phasic_scanning", "roastingstick", "xenobioconsole") //CIT CHANGE added xenobioconsole here - research_cost = 5000 + design_ids = list("bs_rped","minerbag_holding", "bluespacebeaker", "bluespacesyringe", "bluespacebodybag", "phasic_scanning", "roastingstick") + research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 5000) export_price = 5000 /datum/techweb_node/bluespace_power @@ -169,7 +169,7 @@ description = "Even more powerful.. power!" prereq_ids = list("adv_power", "adv_bluespace") design_ids = list("bluespace_cell", "quadratic_capacitor") - research_cost = 2500 + research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500) export_price = 5000 @@ -180,7 +180,7 @@ description = "Research into the mysterious and dangerous substance, plasma." prereq_ids = list("engineering") design_ids = list("mech_generator") - research_cost = 2500 + research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500) export_price = 5000 /datum/techweb_node/adv_plasma @@ -189,7 +189,7 @@ description = "Research on how to fully exploit the power of plasma." prereq_ids = list("basic_plasma") design_ids = list("mech_plasma_cutter") - research_cost = 2500 + research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500) export_price = 5000 /////////////////////////robotics tech///////////////////////// @@ -199,7 +199,7 @@ description = "Programmable machines that make our lives lazier." prereq_ids = list("base") design_ids = list("paicard", "drone_shell") - research_cost = 2500 + research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500) export_price = 5000 /datum/techweb_node/adv_robotics @@ -208,7 +208,7 @@ description = "It can even do the dishes!" prereq_ids = list("robotics") design_ids = list("borg_upgrade_diamonddrill") - research_cost = 2500 + research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500) export_price = 5000 /datum/techweb_node/neural_programming @@ -216,7 +216,7 @@ display_name = "Neural Programming" description = "Study into networks of processing units that mimic our brains." prereq_ids = list("biotech", "datatheory") - research_cost = 2500 + research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500) export_price = 5000 /datum/techweb_node/mmi @@ -225,7 +225,7 @@ description = "A slightly Frankensteinian device that allows human brains to interface natively with software APIs." prereq_ids = list("neural_programming") design_ids = list("mmi") - research_cost = 2500 + research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500) export_price = 5000 /datum/techweb_node/posibrain @@ -234,7 +234,7 @@ description = "Applied usage of neural technology allowing for autonomous AI units based on special metallic cubes with conductive and processing circuits." prereq_ids = list("neural_programming", "mmi") design_ids = list("mmi_posi") - research_cost = 2500 + research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500) export_price = 5000 /datum/techweb_node/cyborg @@ -242,7 +242,7 @@ display_name = "Cyborg Construction" description = "Sapient robots with preloaded tool modules and programmable laws." prereq_ids = list("mmi", "robotics") - research_cost = 1000 + research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 1000) export_price = 5000 design_ids = list("robocontrol", "sflash", "borg_suit", "borg_head", "borg_chest", "borg_r_arm", "borg_l_arm", "borg_r_leg", "borg_l_leg", "borgupload", "cyborgrecharger", "borg_upgrade_restart", "borg_upgrade_rename") @@ -253,7 +253,7 @@ description = "Utility upgrades for cybogs." prereq_ids = list("engineering", "cyborg") design_ids = list("borg_upgrade_holding", "borg_upgrade_lavaproof", "borg_upgrade_thrusters", "borg_upgrade_selfrepair", "borg_upgrade_expand", "borg_upgrade_rped") - research_cost = 2000 + research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2000) export_price = 5000 /datum/techweb_node/cyborg_upg_med @@ -262,7 +262,7 @@ description = "Medical upgrades for cyborgs." prereq_ids = list("adv_biotech", "cyborg") design_ids = list("borg_upgrade_defibrillator", "borg_upgrade_piercinghypospray", "borg_upgrade_highstrengthsynthesiser", "borg_upgrade_expandedsynthesiser", "borg_upgrade_pinpointer") - research_cost = 2000 + research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2000) export_price = 5000 /datum/techweb_node/cyborg_upg_combat @@ -271,7 +271,7 @@ description = "Military grade upgrades for cyborgs." prereq_ids = list("adv_robotics", "adv_engi" , "weaponry") design_ids = list("borg_upgrade_vtec", "borg_upgrade_disablercooler") - research_cost = 5000 + research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 5000) export_price = 5000 /datum/techweb_node/ai @@ -282,7 +282,7 @@ design_ids = list("aifixer", "aicore", "safeguard_module", "onehuman_module", "protectstation_module", "quarantine_module", "oxygen_module", "freeform_module", "reset_module", "purge_module", "remove_module", "freeformcore_module", "asimov_module", "paladin_module", "tyrant_module", "corporate_module", "default_module", "borg_ai_control", "mecha_tracking_ai_control", "aiupload", "intellicard") - research_cost = 2500 + research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500) export_price = 5000 /////////////////////////EMP tech///////////////////////// @@ -292,7 +292,7 @@ description = "Study into usage of frequencies in the electromagnetic spectrum." prereq_ids = list("base") design_ids = list("holosign", "holosignsec", "holosignengi", "holosignatmos", "inducer", "tray_goggles", "holopad") - research_cost = 2500 + research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500) export_price = 5000 /datum/techweb_node/emp_adv @@ -301,7 +301,7 @@ description = "Determining whether reversing the polarity will actually help in a given situation." prereq_ids = list("emp_basic") design_ids = list("ultra_micro_laser") - research_cost = 3000 + research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 3000) export_price = 5000 /datum/techweb_node/emp_super @@ -310,7 +310,7 @@ description = "Even better electromagnetic technology." prereq_ids = list("emp_adv") design_ids = list("quadultra_micro_laser") - research_cost = 3000 + research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 3000) export_price = 5000 /////////////////////////Clown tech///////////////////////// @@ -321,7 +321,7 @@ prereq_ids = list("base") design_ids = list("air_horn", "honker_main", "honker_peri", "honker_targ", "honk_chassis", "honk_head", "honk_torso", "honk_left_arm", "honk_right_arm", "honk_left_leg", "honk_right_leg", "mech_banana_mortar", "mech_mousetrap_mortar", "mech_honker", "mech_punching_face", "implant_trombone") - research_cost = 2500 + research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500) export_price = 5000 ////////////////////////Computer tech//////////////////////// @@ -331,7 +331,7 @@ description = "Computers and how they work." prereq_ids = list("datatheory") design_ids = list("cargo", "cargorequest", "libraryconsole", "mining", "crewconsole", "rdcamera", "comconsole", "idcardconsole", "seccamera") - research_cost = 2000 + research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2000) export_price = 5000 /datum/techweb_node/computer_hardware_basic //Modular computers are shitty and nearly useless so until someone makes them actually useful this can be easy to get. @@ -339,7 +339,7 @@ display_name = "Computer Hardware" description = "How computer hardware are made." prereq_ids = list("comptech") - research_cost = 1000 //they are really shitty + research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 1000) //they are really shitty export_price = 2000 design_ids = list("hdd_basic", "hdd_advanced", "hdd_super", "hdd_cluster", "ssd_small", "ssd_micro", "netcard_basic", "netcard_advanced", "netcard_wired", "portadrive_basic", "portadrive_advanced", "portadrive_super", "cardslot", "aislot", "miniprinter", "APClink", "bat_control", "bat_normal", "bat_advanced", @@ -351,7 +351,7 @@ description = "For the slackers on the station." prereq_ids = list("comptech") design_ids = list("arcade_battle", "arcade_orion", "slotmachine") - research_cost = 1000 + research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 1000) export_price = 2000 /datum/techweb_node/comp_recordkeeping @@ -360,7 +360,7 @@ description = "Organized record databases and how they're used." prereq_ids = list("comptech") design_ids = list("secdata", "med_data", "prisonmanage", "vendor", "automated_announcement") - research_cost = 1000 + research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 1000) export_price = 2000 /datum/techweb_node/telecomms @@ -368,7 +368,7 @@ display_name = "Telecommunications Technology" description = "Subspace transmission technology for near-instant communications devices." prereq_ids = list("comptech", "bluespace_basic") - research_cost = 2500 + research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500) export_price = 5000 design_ids = list("s-receiver", "s-bus", "s-broadcaster", "s-processor", "s-hub", "s-server", "s-relay", "comm_monitor", "comm_server", "s-ansible", "s-filter", "s-amplifier", "ntnet_relay", "s-treatment", "s-analyzer", "s-crystal", "s-transmitter") @@ -379,7 +379,7 @@ description = "The usefulness of computerized records, projected straight onto your eyepiece!" prereq_ids = list("comp_recordkeeping", "emp_basic") design_ids = list("health_hud", "security_hud", "diagnostic_hud", "scigoggles") - research_cost = 1500 + research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 1500) export_price = 5000 /datum/techweb_node/NVGtech @@ -388,7 +388,7 @@ description = "Allows seeing in the dark without actual light!" prereq_ids = list("integrated_HUDs", "adv_engi", "emp_adv") design_ids = list("health_hud_night", "security_hud_night", "diagnostic_hud_night", "night_visision_goggles", "nvgmesons") - research_cost = 5000 + research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 5000) export_price = 5000 ////////////////////////Medical//////////////////////// @@ -398,7 +398,7 @@ description = "We have the technology to make him." prereq_ids = list("biotech") design_ids = list("clonecontrol", "clonepod", "clonescanner", "scan_console", "cloning_disk") - research_cost = 2500 + research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500) export_price = 5000 /datum/techweb_node/cryotech @@ -407,7 +407,7 @@ description = "Smart freezing of objects to preserve them!" prereq_ids = list("adv_engi", "biotech") design_ids = list("splitbeaker", "noreactsyringe", "cryotube", "cryo_Grenade") - research_cost = 2000 + research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2000) export_price = 4000 /datum/techweb_node/subdermal_implants @@ -416,7 +416,7 @@ description = "Electronic implants buried beneath the skin." prereq_ids = list("biotech") design_ids = list("implanter", "implantcase", "implant_chem", "implant_tracking") - research_cost = 2500 + research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500) export_price = 5000 /datum/techweb_node/cyber_organs @@ -425,7 +425,7 @@ description = "We have the technology to rebuild him." prereq_ids = list("adv_biotech", "cyborg") design_ids = list("cybernetic_heart", "cybernetic_liver", "cybernetic_liver_u", "cybernetic_lungs") - research_cost = 2500 + research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500) export_price = 5000 /datum/techweb_node/cyber_implants @@ -434,7 +434,7 @@ description = "Electronic implants that improve humans." prereq_ids = list("adv_biotech", "cyborg", "adv_datatheory") design_ids = list("ci-nutriment", "ci-breather", "ci-gloweyes", "ci-welding", "ci-medhud", "ci-sechud") - research_cost = 2500 + research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500) export_price = 5000 /datum/techweb_node/adv_cyber_implants @@ -443,7 +443,7 @@ description = "Upgraded and more powerful cybernetic implants." prereq_ids = list("neural_programming", "cyber_implants","integrated_HUDs") design_ids = list("ci-toolset", "ci-surgery", "ci-reviver", "ci-nutrimentplus") - research_cost = 2500 + research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500) export_price = 5000 /datum/techweb_node/combat_cyber_implants @@ -452,7 +452,7 @@ description = "Military grade combat implants to improve performance." prereq_ids = list("adv_cyber_implants","weaponry","NVGtech","high_efficiency") design_ids = list("ci-xray", "ci-thermals", "ci-antidrop", "ci-antistun", "ci-thrusters") - research_cost = 2500 + research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500) export_price = 5000 ////////////////////////Tools//////////////////////// @@ -462,7 +462,7 @@ description = "Better than Efficiency V." prereq_ids = list("engineering", "basic_plasma") design_ids = list("drill", "superresonator", "triggermod", "damagemod", "cooldownmod", "rangemod", "ore_redemption", "mining_equipment_vendor", "cargoexpress", "plasmacutter")//e a r l y g a m e) - research_cost = 2500 + research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500) export_price = 5000 /datum/techweb_node/adv_mining @@ -471,7 +471,7 @@ description = "Efficiency Level 127" //dumb mc references prereq_ids = list("basic_mining", "adv_engi", "adv_power", "adv_plasma") design_ids = list("drill_diamond", "jackhammer", "hypermod", "plasmacutter_adv") - research_cost = 2500 + research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500) export_price = 5000 /datum/techweb_node/janitor @@ -480,7 +480,7 @@ description = "Clean things better, faster, stronger, and harder!" prereq_ids = list("adv_engi") design_ids = list("advmop", "buffer", "blutrash", "light_replacer") - research_cost = 2500 + research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500) export_price = 5000 /datum/techweb_node/botany @@ -489,7 +489,7 @@ description = "Botanical tools" prereq_ids = list("adv_engi", "biotech") design_ids = list("diskplantgene", "portaseeder", "plantgenes", "flora_gun", "hydro_tray", "biogenerator", "seed_extractor") - research_cost = 2500 + research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500) export_price = 5000 /datum/techweb_node/exp_tools @@ -498,7 +498,7 @@ description = "Highly advanced construction tools." design_ids = list("exwelder", "jawsoflife", "handdrill") prereq_ids = list("adv_engi") - research_cost = 2500 + research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500) export_price = 5000 /datum/techweb_node/exp_flight @@ -507,7 +507,7 @@ description = "Highly advanced construction tools." design_ids = list("flightshoes", "flightpack", "flightsuit") prereq_ids = list("adv_engi","integrated_HUDs", "adv_power" , "high_efficiency") - research_cost = 5000 + research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 5000) export_price = 5000 /////////////////////////weaponry tech///////////////////////// @@ -517,7 +517,7 @@ description = "Our researchers have found new to weaponize just about everything now." prereq_ids = list("engineering") design_ids = list("pin_testing", "tele_shield") - research_cost = 10000 + research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 10000) export_price = 5000 /datum/techweb_node/adv_weaponry @@ -526,7 +526,7 @@ description = "Our weapons are breaking the rules of reality by now." prereq_ids = list("adv_engi", "weaponry") design_ids = list("pin_loyalty") - research_cost = 10000 + research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 10000) export_price = 5000 /datum/techweb_node/electric_weapons @@ -535,7 +535,7 @@ description = "Weapons using electric technology" prereq_ids = list("weaponry", "adv_power" , "emp_basic") design_ids = list("stunrevolver", "stunshell", "ioncarbine") - research_cost = 2500 + research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500) export_price = 5000 /datum/techweb_node/radioactive_weapons @@ -544,7 +544,7 @@ description = "Weapons using radioactive technology." prereq_ids = list("adv_engi", "adv_weaponry") design_ids = list("nuclear_gun") - research_cost = 2500 + research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500) export_price = 5000 /datum/techweb_node/medical_weapons @@ -553,7 +553,7 @@ description = "Weapons using medical technology." prereq_ids = list("adv_biotech", "adv_weaponry") design_ids = list("rapidsyringe", "shotgundartcryostatis") - research_cost = 2500 + research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500) export_price = 5000 /datum/techweb_node/beam_weapons @@ -562,7 +562,7 @@ description = "Various basic beam weapons" prereq_ids = list("adv_weaponry") design_ids = list("temp_gun", "xray_laser") - research_cost = 2500 + research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500) export_price = 5000 /datum/techweb_node/adv_beam_weapons @@ -571,7 +571,7 @@ description = "Various advanced beam weapons" prereq_ids = list("beam_weapons") design_ids = list("beamrifle") - research_cost = 2500 + research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500) export_price = 5000 /datum/techweb_node/explosive_weapons @@ -580,7 +580,7 @@ description = "If the light stuff just won't do it." prereq_ids = list("adv_weaponry") design_ids = list("large_Grenade", "pyro_Grenade", "adv_Grenade") - research_cost = 2500 + research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500) export_price = 5000 /datum/techweb_node/ballistic_weapons @@ -589,7 +589,7 @@ description = "This isn't research.. This is reverse-engineering!" prereq_ids = list("weaponry") design_ids = list("mag_oldsmg", "mag_oldsmg_ap", "mag_oldsmg_ic") - research_cost = 2500 + research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500) export_price = 5000 /datum/techweb_node/tech_shell @@ -598,7 +598,7 @@ description = "They're more technological than regular shot." prereq_ids = list("adv_weaponry") design_ids = list("techshotshell") - research_cost = 2500 + research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500) export_price = 5000 /datum/techweb_node/gravity_gun @@ -607,7 +607,7 @@ description = "Fancy wording for gravity gun." prereq_ids = list("adv_weaponry", "adv_bluespace") design_ids = list("gravitygun", "mech_gravcatapult") - research_cost = 2500 + research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500) export_price = 5000 ////////////////////////mech technology//////////////////////// @@ -618,7 +618,7 @@ prereq_ids = list("robotics", "adv_engi") design_ids = list("mecha_tracking", "mechacontrol", "mechapower", "mech_recharger", "ripley_chassis", "firefighter_chassis", "ripley_torso", "ripley_left_arm", "ripley_right_arm", "ripley_left_leg", "ripley_right_leg", "ripley_main", "ripley_peri", "mech_hydraulic_clamp") - research_cost = 2500 + research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500) export_price = 5000 /datum/techweb_node/adv_mecha @@ -627,7 +627,7 @@ description = "For when you just aren't Gundam enough." prereq_ids = list("adv_robotics", "mecha") design_ids = list("mech_repair_droid") - research_cost = 2500 + research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500) export_price = 5000 /datum/techweb_node/odysseus @@ -637,7 +637,7 @@ prereq_ids = list("mecha") design_ids = list("odysseus_chassis", "odysseus_torso", "odysseus_head", "odysseus_left_arm", "odysseus_right_arm" ,"odysseus_left_leg", "odysseus_right_leg", "odysseus_main", "odysseus_peri") - research_cost = 2500 + research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500) export_price = 5000 /datum/techweb_node/gygax @@ -647,7 +647,7 @@ prereq_ids = list("adv_mecha", "weaponry") design_ids = list("gygax_chassis", "gygax_torso", "gygax_head", "gygax_left_arm", "gygax_right_arm", "gygax_left_leg", "gygax_right_leg", "gygax_main", "gygax_peri", "gygax_targ", "gygax_armor") - research_cost = 2500 + research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500) export_price = 5000 /datum/techweb_node/durand @@ -657,7 +657,7 @@ prereq_ids = list("adv_mecha", "adv_weaponry") design_ids = list("durand_chassis", "durand_torso", "durand_head", "durand_left_arm", "durand_right_arm", "durand_left_leg", "durand_right_leg", "durand_main", "durand_peri", "durand_targ", "durand_armor") - research_cost = 2500 + research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500) export_price = 5000 /datum/techweb_node/phazon @@ -667,7 +667,7 @@ prereq_ids = list("adv_mecha", "weaponry" , "adv_bluespace") design_ids = list("phazon_chassis", "phazon_torso", "phazon_head", "phazon_left_arm", "phazon_right_arm", "phazon_left_leg", "phazon_right_leg", "phazon_main", "phazon_peri", "phazon_targ", "phazon_armor") - research_cost = 2500 + research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500) export_price = 5000 /datum/techweb_node/mech_tools @@ -676,7 +676,7 @@ description = "Various tools fit for basic mech units" prereq_ids = list("mecha") design_ids = list("mech_drill", "mech_mscanner", "mech_extinguisher", "mech_cable_layer") - research_cost = 2500 + research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500) export_price = 5000 /datum/techweb_node/adv_mecha_tools @@ -685,7 +685,7 @@ description = "Tools for high level mech suits" prereq_ids = list("adv_mecha", "mech_tools") design_ids = list("mech_rcd") - research_cost = 2500 + research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500) export_price = 5000 /datum/techweb_node/med_mech_tools @@ -694,7 +694,7 @@ description = "Tools for high level mech suits" prereq_ids = list("mecha", "adv_biotech", "mech_tools") design_ids = list("mech_sleeper", "mech_syringe_gun", "mech_medi_beam") - research_cost = 2500 + research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500) export_price = 5000 /datum/techweb_node/mech_modules @@ -703,7 +703,7 @@ description = "An advanced piece of mech weaponry" prereq_ids = list("adv_mecha", "bluespace_power") design_ids = list("mech_energy_relay", "mech_ccw_armor", "mech_proj_armor", "mech_generator_nuclear") - research_cost = 2500 + research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500) export_price = 5000 /datum/techweb_node/mech_scattershot @@ -712,7 +712,7 @@ description = "An advanced piece of mech weaponry" prereq_ids = list("mecha", "ballistic_weapons") design_ids = list("mech_scattershot") - research_cost = 2500 + research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500) export_price = 5000 /datum/techweb_node/mech_carbine @@ -721,7 +721,7 @@ description = "An advanced piece of mech weaponry" prereq_ids = list("mecha", "ballistic_weapons") design_ids = list("mech_carbine") - research_cost = 2500 + research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500) export_price = 5000 /datum/techweb_node/mech_ion @@ -730,7 +730,7 @@ description = "An advanced piece of mech weaponry" prereq_ids = list("mecha", "electronic_weapons", "emp_adv") design_ids = list("mech_ion") - research_cost = 2500 + research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500) export_price = 5000 /datum/techweb_node/mech_tesla @@ -739,7 +739,7 @@ description = "An advanced piece of mech weaponry" prereq_ids = list("mecha", "electronic_weapons", "adv_power") design_ids = list("mech_tesla") - research_cost = 2500 + research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500) export_price = 5000 /datum/techweb_node/mech_laser @@ -748,7 +748,7 @@ description = "A basic piece of mech weaponry" prereq_ids = list("mecha", "beam_weapons") design_ids = list("mech_laser") - research_cost = 2500 + research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500) export_price = 5000 /datum/techweb_node/mech_laser_heavy @@ -757,7 +757,7 @@ description = "An advanced piece of mech weaponry" prereq_ids = list("mecha", "adv_beam_weapons") design_ids = list("mech_laser_heavy") - research_cost = 2500 + research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500) export_price = 5000 /datum/techweb_node/mech_grenade_launcher @@ -766,7 +766,7 @@ description = "An advanced piece of mech weaponry" prereq_ids = list("mecha", "explosive_weapons") design_ids = list("mech_grenade_launcher") - research_cost = 2500 + research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500) export_price = 5000 /datum/techweb_node/mech_missile_rack @@ -775,7 +775,7 @@ description = "An advanced piece of mech weaponry" prereq_ids = list("mecha", "explosive_weapons") design_ids = list("mech_missile_rack") - research_cost = 2500 + research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500) export_price = 5000 /datum/techweb_node/clusterbang_launcher @@ -784,7 +784,7 @@ description = "An advanced piece of mech weaponry" prereq_ids = list("mecha", "explosive_weapons") design_ids = list("clusterbang_launcher") - research_cost = 2500 + research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500) export_price = 5000 /datum/techweb_node/mech_teleporter @@ -793,7 +793,7 @@ description = "An advanced piece of mech Equipment" prereq_ids = list("mech_tools", "adv_bluespace") design_ids = list("mech_teleporter") - research_cost = 2500 + research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500) export_price = 5000 /datum/techweb_node/mech_wormhole_gen @@ -802,7 +802,7 @@ description = "An advanced piece of mech weaponry" prereq_ids = list("mecha", "mech_tools", "adv_bluespace") design_ids = list("mech_wormhole_gen") - research_cost = 2500 + research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500) export_price = 5000 /datum/techweb_node/mech_taser @@ -811,7 +811,7 @@ description = "A basic piece of mech weaponry" prereq_ids = list("mecha", "electronic_weapons") design_ids = list("mech_taser") - research_cost = 2500 + research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500) export_price = 5000 /datum/techweb_node/mech_lmg @@ -820,7 +820,7 @@ description = "An advanced piece of mech weaponry" prereq_ids = list("mecha", "ballistic_weapons") design_ids = list("mech_lmg") - research_cost = 2500 + research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500) export_price = 5000 /datum/techweb_node/mech_diamond_drill @@ -829,7 +829,7 @@ description = "A diamond drill fit for a large exosuit" prereq_ids = list("mecha", "adv_mining") design_ids = list("mech_diamond_drill") - research_cost = 2500 + research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500) export_price = 5000 ////////////////////////Alien technology//////////////////////// @@ -838,10 +838,10 @@ display_name = "Alien Technology" description = "Things used by the greys." prereq_ids = list("biotech","engineering") - boost_item_paths = list(/obj/item/gun/energy/alien = 0, /obj/item/scalpel/alien = 0, /obj/item/hemostat/alien = 0, /obj/item/retractor/alien = 0, /obj/item/circular_saw/alien = 0, - /obj/item/cautery/alien = 0, /obj/item/surgicaldrill/alien = 0, /obj/item/screwdriver/abductor = 0, /obj/item/wrench/abductor = 0, /obj/item/crowbar/abductor = 0, /obj/item/multitool/abductor = 0, - /obj/item/weldingtool/abductor = 0, /obj/item/wirecutters/abductor = 0, /obj/item/circuitboard/machine/abductor = 0, /obj/item/abductor_baton = 0, /obj/item/abductor = 0) - research_cost = 5000 + boost_item_paths = list(/obj/item/gun/energy/alien, /obj/item/scalpel/alien, /obj/item/hemostat/alien, /obj/item/retractor/alien, /obj/item/circular_saw/alien, + /obj/item/cautery/alien, /obj/item/surgicaldrill/alien, /obj/item/screwdriver/abductor, /obj/item/wrench/abductor, /obj/item/crowbar/abductor, /obj/item/multitool/abductor, + /obj/item/weldingtool/abductor, /obj/item/wirecutters/abductor, /obj/item/circuitboard/machine/abductor, /obj/item/abductor_baton, /obj/item/abductor) + research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 5000) export_price = 20000 hidden = TRUE design_ids = list("alienalloy") @@ -852,10 +852,10 @@ description = "Advanced biological tools." prereq_ids = list("alientech", "adv_biotech") design_ids = list("alien_scalpel", "alien_hemostat", "alien_retractor", "alien_saw", "alien_drill", "alien_cautery") - boost_item_paths = list(/obj/item/gun/energy/alien = 0, /obj/item/scalpel/alien = 0, /obj/item/hemostat/alien = 0, /obj/item/retractor/alien = 0, /obj/item/circular_saw/alien = 0, - /obj/item/cautery/alien = 0, /obj/item/surgicaldrill/alien = 0, /obj/item/screwdriver/abductor = 0, /obj/item/wrench/abductor = 0, /obj/item/crowbar/abductor = 0, /obj/item/multitool/abductor = 0, - /obj/item/weldingtool/abductor = 0, /obj/item/wirecutters/abductor = 0, /obj/item/circuitboard/machine/abductor = 0, /obj/item/abductor_baton = 0, /obj/item/abductor = 0) - research_cost = 2500 + boost_item_paths = list(/obj/item/gun/energy/alien, /obj/item/scalpel/alien, /obj/item/hemostat/alien, /obj/item/retractor/alien, /obj/item/circular_saw/alien, + /obj/item/cautery/alien, /obj/item/surgicaldrill/alien, /obj/item/screwdriver/abductor, /obj/item/wrench/abductor, /obj/item/crowbar/abductor, /obj/item/multitool/abductor, + /obj/item/weldingtool/abductor, /obj/item/wirecutters/abductor, /obj/item/circuitboard/machine/abductor, /obj/item/abductor_baton, /obj/item/abductor) + research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500) export_price = 20000 hidden = TRUE @@ -865,9 +865,9 @@ description = "Alien engineering tools" prereq_ids = list("alientech", "adv_engi") design_ids = list("alien_wrench", "alien_wirecutters", "alien_screwdriver", "alien_crowbar", "alien_welder", "alien_multitool") - boost_item_paths = list(/obj/item/screwdriver/abductor = 0, /obj/item/wrench/abductor = 0, /obj/item/crowbar/abductor = 0, /obj/item/multitool/abductor = 0, - /obj/item/weldingtool/abductor = 0, /obj/item/wirecutters/abductor = 0, /obj/item/circuitboard/machine/abductor = 0, /obj/item/abductor_baton = 0, /obj/item/abductor = 0) - research_cost = 2500 + boost_item_paths = list(/obj/item/screwdriver/abductor, /obj/item/wrench/abductor, /obj/item/crowbar/abductor, /obj/item/multitool/abductor, + /obj/item/weldingtool/abductor, /obj/item/wirecutters/abductor, /obj/item/circuitboard/machine/abductor, /obj/item/abductor_baton, /obj/item/abductor) + research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500) export_price = 20000 hidden = TRUE @@ -877,7 +877,7 @@ description = "Dangerous research used to create dangerous objects." prereq_ids = list("adv_engi", "adv_weaponry", "explosive_weapons") design_ids = list("decloner", "borg_syndicate_module", "suppressor", "largecrossbow", "donksofttoyvendor") - research_cost = 10000 + research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 10000) export_price = 5000 hidden = TRUE @@ -888,9 +888,9 @@ var/datum/uplink_item/UI = new path if(!UI.item) continue - boost_item_paths[UI.item] = 0 //allows deconning to unlock. + boost_item_paths |= UI.item //allows deconning to unlock. -//HELPERS +//Helpers for debugging/balancing the techweb in its entirety! /proc/total_techweb_exports() var/list/datum/techweb_node/processing = list() for(var/i in subtypesof(/datum/techweb_node)) @@ -904,7 +904,20 @@ var/list/datum/techweb_node/processing = list() for(var/i in subtypesof(/datum/techweb_node)) processing += new i - . = 0 + var/datum/techweb/TW = new + TW.research_points = list() for(var/i in processing) var/datum/techweb_node/TN = i - . += TN.research_cost + TW.add_point_list(TN.research_costs) + return TW.research_points + +/proc/total_techweb_points_printout() + var/list/datum/techweb_node/processing = list() + for(var/i in subtypesof(/datum/techweb_node)) + processing += new i + var/datum/techweb/TW = new + TW.research_points = list() + for(var/i in processing) + var/datum/techweb_node/TN = i + TW.add_point_list(TN.research_costs) + return TW.printout_points() diff --git a/modular_citadel/code/modules/projectiles/guns/ballistic/magweapon.dm b/modular_citadel/code/modules/projectiles/guns/ballistic/magweapon.dm index 1fbd32e992..5cca9138f3 100644 --- a/modular_citadel/code/modules/projectiles/guns/ballistic/magweapon.dm +++ b/modular_citadel/code/modules/projectiles/guns/ballistic/magweapon.dm @@ -337,7 +337,7 @@ description = "Weapons using magnetic technology" prereq_ids = list("weaponry", "adv_weaponry", "emp_adv") design_ids = list("magrifle", "magpisol", "mag_magrifle", "mag_magrifle_nl", "mag_magpistol", "mag_magpistol_nl") - research_cost = 2500 + research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500) export_price = 5000 @@ -463,4 +463,4 @@ /obj/item/stock_parts/cell/toymagburst name = "toy mag burst rifle power supply" - maxcharge = 4000 \ No newline at end of file + maxcharge = 4000 diff --git a/modular_citadel/code/modules/research/techweb/all_nodes.dm b/modular_citadel/code/modules/research/techweb/all_nodes.dm index 9f1cd650b5..113d4115ac 100644 --- a/modular_citadel/code/modules/research/techweb/all_nodes.dm +++ b/modular_citadel/code/modules/research/techweb/all_nodes.dm @@ -16,5 +16,5 @@ description = "For the slackers on the station." prereq_ids = list("comptech") design_ids = list("arcade_battle", "arcade_orion", "slotmachine", "autoylathe") - research_cost = 1000 + research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 1000) export_price = 5000