Merge branch 'master' into abductor-update

This commit is contained in:
Lin
2019-11-15 23:24:51 +00:00
committed by GitHub
497 changed files with 32240 additions and 135364 deletions
+6 -1
View File
@@ -27,6 +27,7 @@ other types of metals and chemistry for reagents).
*/
//DESIGNS ARE GLOBAL. DO NOT CREATE OR DESTROY THEM AT RUNTIME OUTSIDE OF INIT, JUST REFERENCE THEM TO WHATEVER YOU'RE DOING! //why are you yelling?
//DO NOT REFERENCE OUTSIDE OF SSRESEARCH. USE THE PROCS IN SSRESEARCH TO OBTAIN A REFERENCE.
/datum/design //Datum for object designs, used in construction
var/name = "Name" //Name of the created object.
@@ -48,8 +49,12 @@ other types of metals and chemistry for reagents).
var/research_icon_state
var/icon_cache
/datum/design/error_design
name = "ERROR"
desc = "This usually means something in the database has corrupted. If this doesn't go away automatically, inform Central Command so their techs can fix this ASAP(tm)"
/datum/design/Destroy()
CRASH("DESIGN DATUMS SHOULD NOT EVER BE DESTROYED AS THEY ARE ONLY MEANT TO BE IN A GLOBAL LIST AND REFERENCED FOR US.")
SSresearch.techweb_designs -= id
return ..()
/datum/design/proc/icon_html(client/user)
@@ -0,0 +1,335 @@
///////////////////////////////////
//////////AutoBottler Designs//////
///////////////////////////////////
/datum/design/board/autobottler
name = "Machine Design (AutoBottler)"
desc = "Allows for the construction of circuit boards used to build an Autobottler."
id = "autobottler"
materials = list(MAT_GLASS = 2000)
build_path = /obj/item/circuitboard/machine/autobottler
category = list ("Misc. Machinery")
departmental_flags = DEPARTMENTAL_FLAG_CARGO | DEPARTMENTAL_FLAG_SERVICE
/datum/design/bottle
materials = list(MAT_GLASS = 1200)
build_type = AUTOBOTTLER
category = list("Storge")
/datum/design/bottle/wine
name = "Bottle Design (Wine)"
desc = "Allows for the blowing of Wine bottles."
id = "wine"
build_path = /obj/item/reagent_containers/food/drinks/bottle/wine/empty
/datum/design/bottle/rum
name = "Bottle Design (Rum)"
desc = "Allows for the blowing of Rum bottles."
id = "rum"
build_path = /obj/item/reagent_containers/food/drinks/bottle/rum/empty
/datum/design/bottle/gin
name = "Bottle Design (Gin)"
desc = "Allows for the blowing of Gin bottles."
id = "gin"
build_path = /obj/item/reagent_containers/food/drinks/bottle/gin/empty
/datum/design/bottle/whiskey
name = "Bottle Design (Whiskey)"
desc = "Allows for the blowing of Whiskey bottles."
id = "whiskey"
build_path = /obj/item/reagent_containers/food/drinks/bottle/whiskey/empty
/datum/design/bottle/vodka
name = "Bottle Design (Vodka)"
desc = "Allows for the blowing of Vodka bottles."
id = "vodka"
build_path = /obj/item/reagent_containers/food/drinks/bottle/vodka/empty
/datum/design/bottle/tequila
name = "Bottle Design (Tequila)"
desc = "Allows for the blowing of Tequila bottles."
id = "tequila"
build_path = /obj/item/reagent_containers/food/drinks/bottle/tequila/empty
/datum/design/bottle/patron
name = "Bottle Design (Patron)"
desc = "Allows for the blowing of Patron bottles."
id = "patron"
build_path = /obj/item/reagent_containers/food/drinks/bottle/patron/empty
/datum/design/bottle/kahlua
name = "Bottle Design (Kahlua)"
desc = "Allows for the blowing of Kahlua bottles."
id = "kahlua"
build_path = /obj/item/reagent_containers/food/drinks/bottle/kahlua/empty
/datum/design/bottle/sake
name = "Bottle Design (Sake)"
desc = "Allows for the blowing of Sake bottles."
id = "sake"
build_path = /obj/item/reagent_containers/food/drinks/bottle/sake/empty
/datum/design/bottle/vermouth
name = "Bottle Design (Vermouth)"
desc = "Allows for the blowing of Vermouth bottles."
id = "vermouth"
build_path = /obj/item/reagent_containers/food/drinks/bottle/vermouth/empty
/datum/design/bottle/goldschlager
name = "Bottle Design (Goldschlager)"
desc = "Allows for the blowing of Goldschlager bottles."
id = "goldschlager"
build_path = /obj/item/reagent_containers/food/drinks/bottle/goldschlager/empty
/datum/design/bottle/hcider
name = "Bottle Design (Cider)"
desc = "Allows for the blowing of Cider bottles."
id = "hcider"
build_path = /obj/item/reagent_containers/food/drinks/bottle/hcider/empty
/datum/design/bottle/cognac
name = "Bottle Design (Cognac)"
desc = "Allows for the blowing of Cognac bottles."
id = "cognac"
build_path = /obj/item/reagent_containers/food/drinks/bottle/cognac/empty
/datum/design/bottle/absinthe
name = "Bottle Design (Absinthe)"
desc = "Allows for the blowing of Absinthe bottles."
id = "absinthe"
build_path = /obj/item/reagent_containers/food/drinks/bottle/absinthe/empty
/datum/design/bottle/grappa
name = "Bottle Design (Grappa)"
desc = "Allows for the blowing of Grappa bottles."
id = "grappa"
build_path = /obj/item/reagent_containers/food/drinks/bottle/grappa/empty
/datum/design/bottle/fernet
name = "Bottle Design (Fernet)"
desc = "Allows for the blowing of Fernet bottles."
id = "fernet"
build_path = /obj/item/reagent_containers/food/drinks/bottle/fernet/empty
/datum/design/bottle/applejack
name = "Bottle Design (Applejack)"
desc = "Allows for the blowing of Applejack bottles."
id = "applejack"
build_path = /obj/item/reagent_containers/food/drinks/bottle/applejack/empty
/datum/design/bottle/champagne
name = "Bottle Design (Champagne)"
desc = "Allows for the blowing of Champagne bottles."
id = "champagne"
build_path = /obj/item/reagent_containers/food/drinks/bottle/champagne/empty
/datum/design/bottle/blazaam
name = "Bottle Design (Blazaam)"
desc = "Allows for the blowing of Blazaam bottles."
id = "blazaam"
build_path = /obj/item/reagent_containers/food/drinks/bottle/blazaam/empty
/datum/design/bottle/trappist
name = "Bottle Design (Trappist)"
desc = "Allows for the blowing of Trappist bottles."
id = "trappist"
build_path = /obj/item/reagent_containers/food/drinks/bottle/trappist/empty
/datum/design/bottle/grenadine
name = "Bottle Design (Grenadine)"
desc = "Allows for the blowing of Grenadine bottles."
id = "grenadine"
build_path = /obj/item/reagent_containers/food/drinks/bottle/grenadine/empty
/datum/design/bottle/export
materials = list(MAT_GLASS = 1200)
build_type = AUTOBOTTLER
category = list("Brands")
/datum/design/bottle/export/wine
name = "Export Design (Wine)"
desc = "Allows for the blowing, and bottling of Wine bottles."
id = "wine_export"
reagents_list = list("wine" = 100)
build_path = /obj/item/export/bottle/wine
/datum/design/bottle/export/rum
name = "Export Design (Rum)"
desc = "Allows for the blowing, and bottling of Rum bottles."
id = "rum_export"
reagents_list = list("rum" = 100)
build_path = /obj/item/export/bottle/rum
/datum/design/bottle/export/gin
name = "Export Design (Gin)"
desc = "Allows for the blowing, and bottling of Gin bottles."
id = "gin_export"
reagents_list = list("gin" = 100)
build_path = /obj/item/export/bottle/gin
/datum/design/bottle/export/whiskey
name = "Export Design (Whiskey)"
desc = "Allows for the blowing, and bottling of Whiskey bottles."
id = "whiskey_export"
reagents_list = list("whiskey" = 100)
build_path = /obj/item/export/bottle/whiskey
/datum/design/bottle/export/vodka
name = "Export Design (Vodka)"
desc = "Allows for the blowing, and bottling of 99% Vodka bottles."
id = "vodka_export"
reagents_list = list("vodka" = 99, "water" = 1)
build_path = /obj/item/export/bottle/vodka
/datum/design/bottle/export/tequila
name = "Export Design (Tequila)"
desc = "Allows for the blowing, and bottling of Tequila bottles."
id = "tequila_export"
reagents_list = list("tequila" = 80, "lemon_juice" = 20)
build_path = /obj/item/export/bottle/tequila
/datum/design/bottle/export/patron
name = "Export Design (Patron)"
desc = "Allows for the blowing, and bottling of Patron bottles."
id = "patron_export"
reagents_list = list("patron" = 100)
build_path = /obj/item/export/bottle/patron
/datum/design/bottle/export/kahlua
name = "Export Design (Kahlua)"
desc = "Allows for the blowing, and bottling of Kahlua bottles."
id = "kahlua_export"
reagents_list = list("kahlua" = 100)
build_path = /obj/item/export/bottle/kahlua
/datum/design/bottle/export/sake
name = "Export Design (Sake)"
desc = "Allows for the blowing, and bottling of Sake bottles."
id = "sake_export"
reagents_list = list("sake" = 80, "rice" = 10, "sugar" = 10)
build_path = /obj/item/export/bottle/sake
/datum/design/bottle/export/vermouth
name = "Export Design (Vermouth)"
desc = "Allows for the blowing, and bottling of Vermouth bottles."
id = "vermouth_export"
reagents_list = list("vermouth" = 100)
build_path = /obj/item/export/bottle/vermouth
/datum/design/bottle/export/goldschlager
name = "Export Design (Goldschlager)"
desc = "Allows for the blowing, and bottling of Goldschlager bottles."
id = "goldschlager_export"
reagents_list = list("goldschlager" = 100)
build_path = /obj/item/export/bottle/goldschlager
/datum/design/bottle/export/hcider
name = "Export Design (Cider)"
desc = "Allows for the blowing, and bottling of Cider bottles."
id = "hcider_export"
reagents_list = list("hcider" = 30, "water" = 20)
build_path = /obj/item/export/bottle/hcider
/datum/design/bottle/export/cognac
name = "Export Design (Cognac)"
desc = "Allows for the blowing, and bottling of Cognac bottles."
id = "cognac_export"
reagents_list = list("cognac" = 100)
build_path = /obj/item/export/bottle/cognac
/datum/design/bottle/export/absinthe
name = "Export Design (Absinthe)"
desc = "Allows for the blowing, and bottling of Absinthe bottles."
reagents_list = list("absinthe" = 100)
id = "absinthe_export"
build_path = /obj/item/export/bottle/absinthe
/datum/design/bottle/export/grappa
name = "Export Design (Grappa)"
desc = "Allows for the blowing, and bottling of Grappa bottles."
id = "grappa_export"
reagents_list = list("grappa" = 100)
build_path = /obj/item/export/bottle/grappa
/datum/design/bottle/export/fernet
name = "Export Design (Fernet)"
desc = "Allows for the blowing, and bottling of Fernet bottles."
id = "fernet_export"
reagents_list = list("fernet" = 100)
build_path = /obj/item/export/bottle/fernet
/datum/design/bottle/export/applejack
name = "Export Design (Applejack)"
desc = "Allows for the blowing, and bottling of Applejack bottles."
id = "applejack_export"
reagents_list = list("applejack" = 50, "gin" = 10)
build_path = /obj/item/export/bottle/applejack
/datum/design/bottle/export/champagne
name = "Export Design (Champagne)"
desc = "Allows for the blowing, and bottling of Champagne bottles."
id = "champagne_export"
reagents_list = list("champagne" = 90, "co2" = 10)
build_path = /obj/item/export/bottle/champagne
/datum/design/bottle/export/blazaam
name = "Export Design (Blazaam)"
desc = "Allows for the blowing, and bottling of Blazaam bottles."
id = "blazaam_export"
reagents_list = list("blazaam" = 80, "holywater" = 20)
build_path = /obj/item/export/bottle/blazaam
/datum/design/bottle/export/trappist
name = "Export Design (Trappist)"
desc = "Allows for the blowing, and bottling of Trappist bottles."
id = "trappist_export"
reagents_list = list("trappist" = 100)
build_path = /obj/item/export/bottle/trappist
/datum/design/bottle/export/grenadine
name = "Export Design (Grenadine)"
desc = "Allows for the blowing, and bottling of Grenadine bottles."
id = "grenadine_export"
reagents_list = list("grenadine" = 100)
build_path = /obj/item/export/bottle/grenadine
/datum/design/bottle/export/minikeg
name = "Export Design (Minikeg)"
desc = "Allows for the fabication, and bottling of Minikeg of craft beer."
id = "minikeg"
category = list("Beers")
reagents_list = list("light_beer" = 100)
build_path = /obj/item/export/bottle/minikeg
/datum/design/bottle/export/blooddrop
name = "Export Design (Blooddrop)"
desc = "Allows for the blowing, and bottling of Blooddrop bottles."
id = "blooddrop"
category = list("Wines")
reagents_list = list("champagne" = 30, "co2" = 30, "wine" = 10, "grape_juice" = 30)
build_path = /obj/item/export/bottle/blooddrop
/datum/design/bottle/export/slim_gold
name = "Export Design (Slim Gold)"
desc = "Allows for the blowing, and bottling of Slim Gold bottles."
id = "slim_gold"
category = list("Beers")
reagents_list = list("gold" = 10, "co2" = 10, "rum" = 30, "beer" = 40)
build_path = /obj/item/export/bottle/slim_gold
/datum/design/bottle/export/white_bloodmoon
name = "Export Design (White Bloodmoon)"
desc = "Allows for the blowing, and bottling of White Bloodmoon bottles."
id = "white_bloodmoon"
category = list("Wines")
reagents_list = list("synthflesh" = 50, "blood" = 50, "gib" = 10)
build_path = /obj/item/export/bottle/white_bloodmoon
/datum/design/bottle/export/greenroad
name = "Export Design (Greenroad)"
desc = "Allows for the blowing, and bottling of Greenroad bottles."
id = "greenroad"
reagents_list = list("vitfro" = 50, "rum" = 50, "ash" = 10)
category = list("Beers")
build_path = /obj/item/export/bottle/greenroad
@@ -17,6 +17,36 @@
id = "sec_38lethal"
build_path = /obj/item/ammo_box/c38/lethal
/datum/design/c38_trac
name = "Speed Loader (.38 TRAC)"
desc = "Designed to quickly reload revolvers. TRAC bullets embed a tracking implant within the target's body."
id = "c38_trac"
build_type = PROTOLATHE
materials = list(MAT_METAL = 20000, MAT_SILVER = 5000, MAT_GOLD = 1000)
build_path = /obj/item/ammo_box/c38/trac
category = list("Ammo")
departmental_flags = DEPARTMENTAL_FLAG_SECURITY
/datum/design/c38_hotshot
name = "Speed Loader (.38 Hot Shot)"
desc = "Designed to quickly reload revolvers. Hot Shot bullets contain an incendiary payload."
id = "c38_hotshot"
build_type = PROTOLATHE
materials = list(MAT_METAL = 20000, MAT_PLASMA = 5000)
build_path = /obj/item/ammo_box/c38/hotshot
category = list("Ammo")
departmental_flags = DEPARTMENTAL_FLAG_SECURITY
/datum/design/c38_iceblox
name = "Speed Loader (.38 Iceblox)"
desc = "Designed to quickly reload revolvers. Iceblox bullets contain a cryogenic payload."
id = "c38_iceblox"
build_type = PROTOLATHE
materials = list(MAT_METAL = 20000, MAT_PLASMA = 5000)
build_path = /obj/item/ammo_box/c38/iceblox
category = list("Ammo")
departmental_flags = DEPARTMENTAL_FLAG_SECURITY
//////////////
//WT550 Mags//
//////////////
@@ -102,7 +102,7 @@ Note: Must be placed within 3 tiles of the R&D Console
return FALSE
if (id && id != RESEARCH_MATERIAL_RECLAMATION_ID)
var/datum/techweb_node/TN = get_techweb_node_by_id(id)
var/datum/techweb_node/TN = SSresearch.techweb_node_by_id(id)
if(!istype(TN))
return FALSE
var/dpath = loaded_item.type
@@ -123,7 +123,7 @@ Note: Must be placed within 3 tiles of the R&D Console
return FALSE
SSblackbox.record_feedback("nested tally", "item_deconstructed", 1, list("[TN.id]", "[loaded_item.type]"))
if(destroy_item(loaded_item))
linked_console.stored_research.boost_with_path(SSresearch.techweb_nodes[TN.id], dpath)
linked_console.stored_research.boost_with_path(SSresearch.techweb_node_by_id(TN.id), dpath)
else
var/list/point_value = techweb_item_point_check(loaded_item)
+6 -6
View File
@@ -128,13 +128,13 @@
var/list/res = list("<b><font color='blue'>Already researched:</font></b>")
var/list/boosted = list("<b><font color='red'>Already boosted:</font></b>")
for(var/node_id in listin)
var/datum/techweb_node/N = get_techweb_node_by_id(node_id)
var/datum/techweb_node/N = SSresearch.techweb_node_by_id(node_id)
var/str = "<b>[N.display_name]</b>: [listin[N]] points.</b>"
if(SSresearch.science_tech.researched_nodes[N])
if(SSresearch.science_tech.researched_nodes[N.id])
res += str
else if(SSresearch.science_tech.boosted_nodes[N])
else if(SSresearch.science_tech.boosted_nodes[N.id])
boosted += str
if(SSresearch.science_tech.visible_nodes[N]) //JOY OF DISCOVERY!
if(SSresearch.science_tech.visible_nodes[N.id]) //JOY OF DISCOVERY!
output += str
output += boosted + res
dat += output
@@ -182,10 +182,10 @@
experiment(dotype,process)
use_power(750)
if(dotype != FAIL)
var/list/datum/techweb_node/nodes = techweb_item_boost_check(process)
var/list/nodes = techweb_item_boost_check(process)
var/picked = pickweight(nodes) //This should work.
if(linked_console)
linked_console.stored_research.boost_with_path(picked, process.type)
linked_console.stored_research.boost_with_path(SSresearch.techweb_node_by_id(picked), process.type)
updateUsrDialog()
/obj/machinery/rnd/experimentor/proc/matchReaction(matching,reaction)
@@ -36,7 +36,7 @@
/obj/machinery/rnd/production/proc/update_designs()
cached_designs.Cut()
for(var/i in stored_research.researched_designs)
var/datum/design/d = stored_research.researched_designs[i]
var/datum/design/d = SSresearch.techweb_design_by_id(i)
if((isnull(allowed_department_flags) || (d.departmental_flags & allowed_department_flags)) && (d.build_type & allowed_buildtypes))
cached_designs |= d
@@ -113,7 +113,7 @@
amount = text2num(amount)
if(isnull(amount))
amount = 1
var/datum/design/D = (linked_console || requires_console)? linked_console.stored_research.researched_designs[id] : get_techweb_design_by_id(id)
var/datum/design/D = (linked_console || requires_console)? (linked_console.stored_research.researched_designs[id]? SSresearch.techweb_design_by_id(id) : null) : SSresearch.techweb_design_by_id(id)
if(!istype(D))
return FALSE
if(!(isnull(allowed_department_flags) || (D.departmental_flags & allowed_department_flags)))
@@ -160,7 +160,7 @@
/obj/machinery/rnd/production/proc/search(string)
matching_designs.Cut()
for(var/v in stored_research.researched_designs)
var/datum/design/D = stored_research.researched_designs[v]
var/datum/design/D = SSresearch.techweb_design_by_id(v)
if(!(D.build_type & allowed_buildtypes) || !(isnull(allowed_department_flags) || (D.departmental_flags & allowed_department_flags)))
continue
if(findtext(D.name,string))
@@ -336,7 +336,7 @@
l += "<div class='statusDisplay'><h3>Browsing [selected_category]:</h3>"
var/coeff = efficiency_coeff
for(var/v in stored_research.researched_designs)
var/datum/design/D = stored_research.researched_designs[v]
var/datum/design/D = SSresearch.techweb_design_by_id(v)
if(!(selected_category in D.category)|| !(D.build_type & allowed_buildtypes))
continue
if(!(isnull(allowed_department_flags) || (D.departmental_flags & allowed_department_flags)))
@@ -69,7 +69,7 @@
if(current_category != "Main")
var/list/program_list = list()
for(var/i in linked_techweb.researched_designs)
var/datum/design/nanites/D = linked_techweb.researched_designs[i]
var/datum/design/nanites/D = SSresearch.techweb_design_by_id(i)
if(!istype(D))
continue
if(current_category in D.category)
@@ -116,9 +116,9 @@
disk.program = null
disk.name = initial(disk.name)
. = TRUE
/obj/machinery/nanite_program_hub/admin/Initialize()
. = ..()
linked_techweb = SSresearch.admin_tech
+65 -63
View File
@@ -36,10 +36,10 @@ Nothing else in the console has ID requirements.
var/locked = FALSE
var/tdisk_uple = FALSE
var/ddisk_uple = FALSE
var/datum/techweb_node/selected_node
var/datum/design/selected_design
var/datum/selected_node_id
var/datum/selected_design_id
var/selected_category
var/list/datum/design/matching_designs
var/list/matching_design_ids
var/disk_slot_selected
var/searchstring = ""
var/searchtype = ""
@@ -88,7 +88,7 @@ Nothing else in the console has ID requirements.
. = ..()
stored_research = SSresearch.science_tech
stored_research.consoles_accessing[src] = TRUE
matching_designs = list()
matching_design_ids = list()
SyncRDevices()
/obj/machinery/computer/rdconsole/Destroy()
@@ -109,9 +109,7 @@ Nothing else in the console has ID requirements.
if(d_disk)
d_disk.forceMove(get_turf(src))
d_disk = null
matching_designs = null
selected_node = null
selected_design = null
matching_design_ids = null
return ..()
/obj/machinery/computer/rdconsole/attackby(obj/item/D, mob/user, params)
@@ -144,7 +142,7 @@ Nothing else in the console has ID requirements.
if(!stored_research.available_nodes[id] || stored_research.researched_nodes[id])
say("Node unlock failed: Either already researched or not available!")
return FALSE
var/datum/techweb_node/TN = SSresearch.techweb_nodes[id]
var/datum/techweb_node/TN = SSresearch.techweb_node_by_id(id)
if(!istype(TN))
say("Node unlock failed: Unknown error.")
return FALSE
@@ -153,7 +151,7 @@ Nothing else in the console has ID requirements.
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" = "[json_encode(price)]", "time" = SQLtime()))
if(stored_research.research_node(SSresearch.techweb_nodes[id]))
if(stored_research.research_node_id(id))
say("Successfully researched [TN.display_name].")
var/logname = "Unknown"
if(isAI(user))
@@ -282,7 +280,7 @@ Nothing else in the console has ID requirements.
l += ui_protolathe_header()
l += "<div class='statusDisplay'><h3>Browsing [selected_category]:</h3>"
for(var/v in stored_research.researched_designs)
var/datum/design/D = stored_research.researched_designs[v]
var/datum/design/D = SSresearch.techweb_design_by_id(v)
if(!(selected_category in D.category)|| !(D.build_type & PROTOLATHE))
continue
if(!(isnull(linked_lathe.allowed_department_flags) || (D.departmental_flags & linked_lathe.allowed_department_flags)))
@@ -337,7 +335,8 @@ Nothing else in the console has ID requirements.
RDSCREEN_UI_LATHE_CHECK
var/list/l = list()
l += ui_protolathe_header()
for(var/datum/design/D in matching_designs)
for(var/id in matching_design_ids)
var/datum/design/D = SSresearch.techweb_design_by_id(id)
if(!(isnull(linked_lathe.allowed_department_flags) || (D.departmental_flags & linked_lathe.allowed_department_flags)))
continue
var/temp_material
@@ -433,7 +432,7 @@ Nothing else in the console has ID requirements.
l += "<div class='statusDisplay'><h3>Browsing [selected_category]:</h3>"
for(var/v in stored_research.researched_designs)
var/datum/design/D = stored_research.researched_designs[v]
var/datum/design/D = SSresearch.techweb_design_by_id(v)
if(!(selected_category in D.category) || !(D.build_type & IMPRINTER))
continue
if(!(isnull(linked_imprinter.allowed_department_flags) || (D.departmental_flags & linked_imprinter.allowed_department_flags)))
@@ -466,7 +465,8 @@ Nothing else in the console has ID requirements.
l += ui_circuit_header()
l += "<div class='statusDisplay'><h3>Search results:</h3>"
for(var/datum/design/D in matching_designs)
for(var/id in matching_design_ids)
var/datum/design/D = SSresearch.techweb_design_by_id(id)
if(!(isnull(linked_imprinter.allowed_department_flags) || (D.departmental_flags & linked_imprinter.allowed_department_flags)))
continue
var/temp_materials
@@ -526,7 +526,7 @@ Nothing else in the console has ID requirements.
l += "<A href='?src=[REF(src)];copy_tech=1'>Load Technology to Disk</A></div>"
l += "<div class='statusDisplay'><h3>Stored Technology Nodes:</h3>"
for(var/i in t_disk.stored_research.researched_nodes)
var/datum/techweb_node/N = t_disk.stored_research.researched_nodes[i]
var/datum/techweb_node/N = SSresearch.techweb_node_by_id(i)
l += "<A href='?src=[REF(src)];view_node=[i];back_screen=[screen]'>[N.display_name]</A>"
l += "</div>"
return l
@@ -552,7 +552,7 @@ Nothing else in the console has ID requirements.
l += "<A href='?src=[REF(src)];switch_screen=[RDSCREEN_DESIGNDISK];back_screen=[screen]'>Return to Disk Operations</A><div class='statusDisplay'>"
l += "<h3>Load Design to Disk:</h3>"
for(var/v in stored_research.researched_designs)
var/datum/design/D = stored_research.researched_designs[v]
var/datum/design/D = SSresearch.techweb_design_by_id(v)
l += "[D.name] "
l += "<A href='?src=[REF(src)];copy_design=[disk_slot_selected];copy_design_ID=[D.id]'>Copy to Disk</A>"
l += "</div>"
@@ -573,7 +573,7 @@ Nothing else in the console has ID requirements.
for(var/id in boostable_nodes)
anything = TRUE
var/list/worth = boostable_nodes[id]
var/datum/techweb_node/N = get_techweb_node_by_id(id)
var/datum/techweb_node/N = SSresearch.techweb_node_by_id(id)
l += "<div class='statusDisplay'>[RDSCREEN_NOBREAK]"
if (stored_research.researched_nodes[N.id]) // already researched
@@ -637,32 +637,33 @@ Nothing else in the console has ID requirements.
var/list/columns = list()
var/max_tier = 0
for (var/node_ in stored_research.tiers)
var/datum/techweb_node/node = node_
var/tier = stored_research.tiers[node]
var/datum/techweb_node/node = SSresearch.techweb_node_by_id(node_)
var/tier = stored_research.tiers[node.id]
LAZYINITLIST(columns["[tier]"]) // String hackery to make the numbers associative
columns["[tier]"] += ui_techweb_single_node(node, minimal=(tier != 1))
max_tier = max(max_tier, tier)
l += "<table><tr><th align='left'>Researched</th><th align='left'>Available</th><th align='left'>Future</th></tr><tr>[RDSCREEN_NOBREAK]"
for(var/tier in 0 to max_tier)
l += "<td valign='top'>[RDSCREEN_NOBREAK]"
l += columns["[tier]"]
l += "</td>[RDSCREEN_NOBREAK]"
if(max_tier)
for(var/tier in 0 to max_tier)
l += "<td valign='top'>[RDSCREEN_NOBREAK]"
l += columns["[tier]"]
l += "</td>[RDSCREEN_NOBREAK]"
l += "</tr></table>[RDSCREEN_NOBREAK]"
else
var/list/avail = list() //This could probably be optimized a bit later.
var/list/unavail = list()
var/list/res = list()
for(var/v in stored_research.researched_nodes)
res += stored_research.researched_nodes[v]
res += SSresearch.techweb_node_by_id(v)
for(var/v in stored_research.available_nodes)
if(stored_research.researched_nodes[v])
continue
avail += stored_research.available_nodes[v]
avail += SSresearch.techweb_node_by_id(v)
for(var/v in stored_research.visible_nodes)
if(stored_research.available_nodes[v])
continue
unavail += stored_research.visible_nodes[v]
unavail += SSresearch.techweb_node_by_id(v)
l += "<h2>Technology Nodes:</h2>[RDSCREEN_NOBREAK]"
l += "<div><h3>Available for Research:</h3>"
for(var/datum/techweb_node/N in avail)
@@ -704,13 +705,14 @@ Nothing else in the console has ID requirements.
l += "<BR><span class='linkOff bad'>[node.price_display(stored_research)]</span>" // red - missing prereqs
if(ui_mode == RDCONSOLE_UI_MODE_NORMAL)
l += "[node.description]"
for(var/i in node.designs)
var/datum/design/D = node.designs[i]
for(var/i in node.design_ids)
var/datum/design/D = SSresearch.techweb_design_by_id(i)
l += "<span data-tooltip='[D.name]' onclick='location=\"?src=[REF(src)];view_design=[i];back_screen=[screen]\"'>[D.icon_html(usr)]</span>[RDSCREEN_NOBREAK]"
l += "</div>[RDSCREEN_NOBREAK]"
return l
/obj/machinery/computer/rdconsole/proc/ui_techweb_nodeview()
var/datum/techweb_node/selected_node = SSresearch.techweb_node_by_id(selected_node_id)
RDSCREEN_UI_SNODE_CHECK
var/list/l = list()
if(stored_research.hidden_nodes[selected_node.id])
@@ -718,65 +720,65 @@ Nothing else in the console has ID requirements.
return
l += "<table><tr>[RDSCREEN_NOBREAK]"
if (length(selected_node.prerequisites))
if (length(selected_node.prereq_ids))
l += "<th align='left'>Requires</th>[RDSCREEN_NOBREAK]"
l += "<th align='left'>Current Node</th>[RDSCREEN_NOBREAK]"
if (length(selected_node.unlocks))
if (length(selected_node.unlock_ids))
l += "<th align='left'>Unlocks</th>[RDSCREEN_NOBREAK]"
l += "</tr><tr>[RDSCREEN_NOBREAK]"
if (length(selected_node.prerequisites))
if (length(selected_node.prereq_ids))
l += "<td valign='top'>[RDSCREEN_NOBREAK]"
for (var/i in selected_node.prerequisites)
l += ui_techweb_single_node(selected_node.prerequisites[i])
for (var/i in selected_node.prereq_ids)
l += ui_techweb_single_node(SSresearch.techweb_node_by_id(i))
l += "</td>[RDSCREEN_NOBREAK]"
l += "<td valign='top'>[RDSCREEN_NOBREAK]"
l += ui_techweb_single_node(selected_node, selflink=FALSE)
l += "</td>[RDSCREEN_NOBREAK]"
if (length(selected_node.unlocks))
if (length(selected_node.unlock_ids))
l += "<td valign='top'>[RDSCREEN_NOBREAK]"
for (var/i in selected_node.unlocks)
l += ui_techweb_single_node(selected_node.unlocks[i])
for (var/i in selected_node.unlock_ids)
l += ui_techweb_single_node(SSresearch.techweb_node_by_id(i))
l += "</td>[RDSCREEN_NOBREAK]"
l += "</tr></table>[RDSCREEN_NOBREAK]"
return l
/obj/machinery/computer/rdconsole/proc/ui_techweb_designview() //Legacy code
var/datum/design/selected_design = SSresearch.techweb_design_by_id(selected_design_id)
RDSCREEN_UI_SDESIGN_CHECK
var/list/l = list()
var/datum/design/D = selected_design
l += "<div><table><tr><td>[D.icon_html(usr)]</td><td><b>[D.name]</b></td></tr></table>[RDSCREEN_NOBREAK]"
if(D.build_type)
l += "<div><table><tr><td>[selected_design.icon_html(usr)]</td><td><b>[selected_design.name]</b></td></tr></table>[RDSCREEN_NOBREAK]"
if(selected_design.build_type)
var/lathes = list()
if(D.build_type & IMPRINTER)
if(selected_design.build_type & IMPRINTER)
lathes += "<span data-tooltip='Circuit Imprinter'>[machine_icon(/obj/machinery/rnd/production/circuit_imprinter)]</span>[RDSCREEN_NOBREAK]"
if (linked_imprinter && D.id in stored_research.researched_designs)
l += "<A href='?src=[REF(src)];search=1;type=imprint;to_search=[D.name]'>Imprint</A>"
if(D.build_type & PROTOLATHE)
if (linked_imprinter && stored_research.researched_designs[selected_design.id])
l += "<A href='?src=[REF(src)];search=1;type=imprint;to_search=[selected_design.name]'>Imprint</A>"
if(selected_design.build_type & PROTOLATHE)
lathes += "<span data-tooltip='Protolathe'>[machine_icon(/obj/machinery/rnd/production/protolathe)]</span>[RDSCREEN_NOBREAK]"
if (linked_lathe && D.id in stored_research.researched_designs)
l += "<A href='?src=[REF(src)];search=1;type=proto;to_search=[D.name]'>Construct</A>"
if(D.build_type & AUTOLATHE)
if (linked_lathe && stored_research.researched_designs[selected_design.id])
l += "<A href='?src=[REF(src)];search=1;type=proto;to_search=[selected_design.name]'>Construct</A>"
if(selected_design.build_type & AUTOLATHE)
lathes += "<span data-tooltip='Autolathe'>[machine_icon(/obj/machinery/autolathe)]</span>[RDSCREEN_NOBREAK]"
if(D.build_type & MECHFAB)
if(selected_design.build_type & MECHFAB)
lathes += "<span data-tooltip='Exosuit Fabricator'>[machine_icon(/obj/machinery/mecha_part_fabricator)]</span>[RDSCREEN_NOBREAK]"
if(D.build_type & BIOGENERATOR)
if(selected_design.build_type & BIOGENERATOR)
lathes += "<span data-tooltip='Biogenerator'>[machine_icon(/obj/machinery/biogenerator)]</span>[RDSCREEN_NOBREAK]"
if(D.build_type & LIMBGROWER)
if(selected_design.build_type & LIMBGROWER)
lathes += "<span data-tooltip='Limbgrower'>[machine_icon(/obj/machinery/limbgrower)]</span>[RDSCREEN_NOBREAK]"
if(D.build_type & SMELTER)
if(selected_design.build_type & SMELTER)
lathes += "<span data-tooltip='Smelter'>[machine_icon(/obj/machinery/mineral/processing_unit)]</span>[RDSCREEN_NOBREAK]"
l += "Construction types:"
l += lathes
l += ""
l += "Required materials:"
var/all_mats = D.materials + D.reagents_list
var/all_mats = selected_design.materials + selected_design.reagents_list
for(var/M in all_mats)
l += "* [CallMaterialName(M)] x [all_mats[M]]"
l += "Unlocked by:"
for (var/node in D.unlocked_by)
l += ui_techweb_single_node(node)
for (var/i in selected_design.unlocked_by)
l += ui_techweb_single_node(SSresearch.techweb_node_by_id(i))
l += "[RDSCREEN_NOBREAK]</div>"
return l
@@ -967,7 +969,7 @@ Nothing else in the console has ID requirements.
qdel(t_disk.stored_research)
t_disk.stored_research = new
say("Wiping technology disk.")
if(ls["copy_tech"]) //Copy some technology la from the research holder to the disk.
if(ls["copy_tech"]) //Copy some technology from the research holder to the disk.
if(QDELETED(t_disk))
say("No Technology Disk Inserted!")
return
@@ -1001,12 +1003,12 @@ Nothing else in the console has ID requirements.
return
say("Uploading technology disk.")
t_disk.stored_research.copy_research_to(stored_research)
if(ls["copy_design"]) //Copy design la from the research holder to the design disk.
if(ls["copy_design"]) //Copy design from the research holder to the design disk.
if(QDELETED(d_disk))
say("No Design Disk Inserted!")
return
var/slot = text2num(ls["copy_design"])
var/datum/design/D = stored_research.researched_designs[ls["copy_design_ID"]]
var/datum/design/D = SSresearch.techweb_design_by_id(ls["copy_design_ID"])
if(D)
var/autolathe_friendly = TRUE
if(D.reagents_list.len)
@@ -1033,12 +1035,12 @@ Nothing else in the console has ID requirements.
linked_destroy.unload_item()
screen = RDSCREEN_MENU
if(ls["view_node"])
selected_node = SSresearch.techweb_nodes[ls["view_node"]]
selected_node_id = ls["view_node"]
screen = RDSCREEN_TECHWEB_NODEVIEW
if(ls["view_design"])
selected_design = SSresearch.techweb_designs[ls["view_design"]]
selected_design_id = ls["view_design"]
screen = RDSCREEN_TECHWEB_DESIGNVIEW
if(ls["updt_design"]) //Uples the research holder with design la from the design disk.
if(ls["updt_design"]) //Uploads a design from disk to the techweb.
if(QDELETED(d_disk))
say("No design disk found.")
return
@@ -1046,9 +1048,9 @@ Nothing else in the console has ID requirements.
if(!n)
for(var/D in d_disk.blueprints)
if(D)
stored_research.add_design(D)
stored_research.add_design(D, TRUE)
else
stored_research.add_design(d_disk.blueprints[n])
stored_research.add_design(d_disk.blueprints[n], TRUE)
updateUsrDialog()
@@ -1077,17 +1079,17 @@ Nothing else in the console has ID requirements.
/obj/machinery/computer/rdconsole/proc/rescan_views()
var/compare
matching_designs.Cut()
matching_design_ids.Cut()
if(searchtype == "proto")
compare = PROTOLATHE
else if(searchtype == "imprint")
compare = IMPRINTER
for(var/v in stored_research.researched_designs)
var/datum/design/D = stored_research.researched_designs[v]
var/datum/design/D = SSresearch.techweb_design_by_id(v)
if(!(D.build_type & compare))
continue
if(findtext(D.name,searchstring))
matching_designs.Add(D)
matching_design_ids.Add(D.id)
/obj/machinery/computer/rdconsole/proc/check_canprint(datum/design/D, buildtype)
var/amount = 50
@@ -1,48 +1,3 @@
/proc/initialize_all_techweb_nodes(clearall = FALSE)
if(islist(SSresearch.techweb_nodes) && clearall)
QDEL_LIST(SSresearch.techweb_nodes)
if(islist(SSresearch.techweb_nodes_starting && clearall))
QDEL_LIST(SSresearch.techweb_nodes_starting)
var/list/returned = list()
for(var/path in subtypesof(/datum/techweb_node))
var/datum/techweb_node/TN = path
if(isnull(initial(TN.id)))
continue
TN = new path
if(returned[initial(TN.id)])
stack_trace("WARNING: Techweb node ID clash with ID [initial(TN.id)] detected!")
SSresearch.errored_datums[TN] = initial(TN.id)
continue
returned[initial(TN.id)] = TN
if(TN.starting_node)
SSresearch.techweb_nodes_starting[TN.id] = TN
SSresearch.techweb_nodes = returned
verify_techweb_nodes() //Verify all nodes have ids and such.
calculate_techweb_nodes()
calculate_techweb_boost_list()
verify_techweb_nodes() //Verify nodes and designs have been crosslinked properly.
/proc/initialize_all_techweb_designs(clearall = FALSE)
if(islist(SSresearch.techweb_designs) && clearall)
QDEL_LIST(SSresearch.techweb_designs)
var/list/returned = list()
for(var/path in subtypesof(/datum/design))
var/datum/design/DN = path
if(isnull(initial(DN.id)))
stack_trace("WARNING: Design with null ID detected. Build path: [initial(DN.build_path)]")
continue
else if(initial(DN.id) == DESIGN_ID_IGNORE)
continue
DN = new path
if(returned[initial(DN.id)])
stack_trace("WARNING: Design ID clash with ID [initial(DN.id)] detected!")
SSresearch.errored_datums[DN] = initial(DN.id)
continue
returned[initial(DN.id)] = DN
SSresearch.techweb_designs = returned
verify_techweb_designs()
/proc/count_unique_techweb_nodes()
var/static/list/L = typesof(/datum/techweb_node)
return L.len
@@ -51,135 +6,10 @@
var/static/list/L = typesof(/datum/design)
return L.len
/proc/get_techweb_node_by_id(id)
if(SSresearch.techweb_nodes[id])
return SSresearch.techweb_nodes[id]
/proc/get_techweb_design_by_id(id)
if(SSresearch.techweb_designs[id])
return SSresearch.techweb_designs[id]
/proc/research_node_id_error(id)
if(SSresearch.invalid_node_ids[id])
SSresearch.invalid_node_ids[id]++
else
SSresearch.invalid_node_ids[id] = 1
/proc/design_id_error(id)
if(SSresearch.invalid_design_ids[id])
SSresearch.invalid_design_ids[id]++
else
SSresearch.invalid_design_ids[id] = 1
/proc/node_boost_error(id, message)
WARNING("Invalid boost information for node \[[id]\]: [message]")
SSresearch.invalid_node_boost[id] = message
/proc/verify_techweb_nodes()
for(var/n in SSresearch.techweb_nodes)
var/datum/techweb_node/N = SSresearch.techweb_nodes[n]
if(!istype(N))
WARNING("Invalid research node with ID [n] detected and removed.")
SSresearch.techweb_nodes -= n
research_node_id_error(n)
for(var/p in N.prereq_ids)
var/datum/techweb_node/P = SSresearch.techweb_nodes[p]
if(!istype(P))
WARNING("Invalid research prerequisite node with ID [p] detected in node [N.display_name]\[[N.id]\] removed.")
N.prereq_ids -= p
research_node_id_error(p)
for(var/d in N.design_ids)
var/datum/design/D = SSresearch.techweb_designs[d]
if(!istype(D))
WARNING("Invalid research design with ID [d] detected in node [N.display_name]\[[N.id]\] removed.")
N.designs -= d
design_id_error(d)
for(var/p in N.prerequisites)
var/datum/techweb_node/P = N.prerequisites[p]
if(!istype(P))
WARNING("Invalid research prerequisite node with ID [p] detected in node [N.display_name]\[[N.id]\] removed.")
N.prerequisites -= p
research_node_id_error(p)
for(var/u in N.unlocks)
var/datum/techweb_node/U = N.unlocks[u]
if(!istype(U))
WARNING("Invalid research unlock node with ID [u] detected in node [N.display_name]\[[N.id]\] removed.")
N.unlocks -= u
research_node_id_error(u)
for(var/d in N.designs)
var/datum/design/D = N.designs[d]
if(!istype(D))
WARNING("Invalid research design with ID [d] detected in node [N.display_name]\[[N.id]\] removed.")
N.designs -= d
design_id_error(d)
for(var/p in N.boost_item_paths)
if(!ispath(p))
N.boost_item_paths -= p
node_boost_error(N.id, "[p] is not a valid path.")
var/list/points = N.boost_item_paths[p]
if(islist(points))
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.")
else if(!isnull(points))
N.boost_item_paths -= p
node_boost_error(N.id, "No valid list.")
CHECK_TICK
/proc/verify_techweb_designs()
for(var/d in SSresearch.techweb_designs)
var/datum/design/D = SSresearch.techweb_designs[d]
if(!istype(D))
stack_trace("WARNING: Invalid research design with ID [d] detected and removed.")
SSresearch.techweb_designs -= d
CHECK_TICK
/proc/calculate_techweb_nodes()
for(var/design_id in SSresearch.techweb_designs)
var/datum/design/D = SSresearch.techweb_designs[design_id]
D.unlocked_by.Cut()
for(var/node_id in SSresearch.techweb_nodes)
var/datum/techweb_node/node = SSresearch.techweb_nodes[node_id]
node.prerequisites = list()
node.unlocks = list()
node.designs = list()
for(var/i in node.prereq_ids)
node.prerequisites[i] = SSresearch.techweb_nodes[i]
for(var/i in node.design_ids)
var/datum/design/D = SSresearch.techweb_designs[i]
node.designs[i] = D
D.unlocked_by += node
if(node.hidden)
SSresearch.techweb_nodes_hidden[node.id] = node
CHECK_TICK
generate_techweb_unlock_linking()
/proc/generate_techweb_unlock_linking()
for(var/node_id in SSresearch.techweb_nodes) //Clear all unlock links to avoid duplication.
var/datum/techweb_node/node = SSresearch.techweb_nodes[node_id]
node.unlocks = list()
for(var/node_id in SSresearch.techweb_nodes)
var/datum/techweb_node/node = SSresearch.techweb_nodes[node_id]
for(var/prereq_id in node.prerequisites)
var/datum/techweb_node/prereq_node = node.prerequisites[prereq_id]
prereq_node.unlocks[node.id] = node
/proc/calculate_techweb_boost_list(clearall = FALSE)
if(clearall)
SSresearch.techweb_boost_items = list()
for(var/node_id in SSresearch.techweb_nodes)
var/datum/techweb_node/node = SSresearch.techweb_nodes[node_id]
for(var/path in node.boost_item_paths)
if(!ispath(path))
continue
if(length(SSresearch.techweb_boost_items[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 = list(point type = value)
+72 -61
View File
@@ -5,12 +5,13 @@
//Techweb datums are meant to store unlocked research, being able to be stored on research consoles, servers, and disks. They are NOT global.
/datum/techweb
var/list/datum/techweb_node/researched_nodes = list() //Already unlocked and all designs are now available. Assoc list, id = datum
var/list/datum/techweb_node/visible_nodes = list() //Visible nodes, doesn't mean it can be researched. Assoc list, id = datum
var/list/datum/techweb_node/available_nodes = list() //Nodes that can immediately be researched, all reqs met. assoc list, id = datum
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/researched_nodes = list() //Already unlocked and all designs are now available. Assoc list, id = TRUE
var/list/visible_nodes = list() //Visible nodes, doesn't mean it can be researched. Assoc list, id = TRUE
var/list/available_nodes = list() //Nodes that can immediately be researched, all reqs met. assoc list, id = TRUE
var/list/researched_designs = list() //Designs that are available for use. Assoc list, id = TRUE
var/list/custom_designs = list() //Custom inserted designs like from disks that should survive recalculation.
var/list/boosted_nodes = list() //Already boosted nodes that can't be boosted again. node id = path of boost object.
var/list/hidden_nodes = list() //Hidden nodes. id = TRUE. 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. path = list(point_type = points)
var/list/research_points = list() //Available research points. type = number
var/list/obj/machinery/computer/rdconsole/consoles_accessing = list()
@@ -19,13 +20,13 @@
var/largest_bomb_value = 0
var/organization = "Third-Party" //Organization name, used for display.
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
var/list/tiers = list() //Assoc list, id = number, 1 is available, 2 is all reqs are 1, so on
/datum/techweb/New()
for(var/i in SSresearch.techweb_nodes_starting)
var/datum/techweb_node/DN = SSresearch.techweb_nodes_starting[i]
var/datum/techweb_node/DN = SSresearch.techweb_node_by_id(i)
research_node(DN, TRUE, FALSE)
hidden_nodes = SSresearch.techweb_nodes_hidden
hidden_nodes = SSresearch.techweb_nodes_hidden.Copy()
return ..()
/datum/techweb/admin
@@ -66,23 +67,24 @@
researched_designs = null
available_nodes = null
visible_nodes = null
custom_designs = null
SSresearch.techwebs -= src
return ..()
/datum/techweb/proc/recalculate_nodes(recalculate_designs = FALSE)
/datum/techweb/proc/recalculate_nodes(recalculate_designs = FALSE, wipe_custom_designs = FALSE)
var/list/datum/techweb_node/processing = list()
for(var/i in researched_nodes)
processing[i] = researched_nodes[i]
for(var/i in visible_nodes)
processing[i] = visible_nodes[i]
for(var/i in available_nodes)
processing[i] = available_nodes[i]
for(var/i in processing)
update_node_status(processing[i])
if(recalculate_designs) //Wipes custom added designs like from design disks or anything like that!
researched_designs = list()
for(var/i in processing)
var/datum/techweb_node/TN = processing[i]
update_node_status(TN, FALSE)
for(var/id in researched_nodes)
processing[id] = TRUE
for(var/id in visible_nodes)
processing[id] = TRUE
for(var/id in available_nodes)
processing[id] = TRUE
if(recalculate_designs)
researched_designs = custom_designs.Copy()
if(wipe_custom_designs)
custom_designs = list()
for(var/id in processing)
update_node_status(SSresearch.techweb_node_by_id(id), FALSE)
CHECK_TICK
for(var/v in consoles_accessing)
var/obj/machinery/computer/rdconsole/V = v
@@ -172,21 +174,27 @@
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))
/datum/techweb/proc/add_design_by_id(id, custom = FALSE)
return add_design(SSresearch.techweb_design_by_id(id), custom)
/datum/techweb/proc/add_design(datum/design/design)
/datum/techweb/proc/add_design(datum/design/design, custom = FALSE)
if(!istype(design))
return FALSE
researched_designs[design.id] = design
researched_designs[design.id] = TRUE
if(custom)
custom_designs[design.id] = TRUE
return TRUE
/datum/techweb/proc/remove_design_by_id(id)
return remove_design(get_techweb_design_by_id(id))
/datum/techweb/proc/remove_design_by_id(id, custom = FALSE)
return remove_design(SSresearch.techweb_design_by_id(id), custom)
/datum/techweb/proc/remove_design(datum/design/design)
/datum/techweb/proc/remove_design(datum/design/design, custom = FALSE)
if(!istype(design))
return FALSE
if(custom_designs[design.id] && !custom)
return FALSE
custom_designs -= design.id
researched_designs -= design.id
return TRUE
@@ -200,7 +208,7 @@
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)
return research_node(SSresearch.techweb_node_by_id(id), force, auto_update_points)
/datum/techweb/proc/research_node(datum/techweb_node/node, force = FALSE, auto_adjust_cost = TRUE)
if(!istype(node))
@@ -211,17 +219,17 @@
return FALSE
if(auto_adjust_cost)
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]
update_node_status(node.unlocks[i])
for(var/i in node.designs)
add_design(node.designs[i])
researched_nodes[node.id] = TRUE //Add to our researched list
for(var/id in node.unlock_ids)
visible_nodes[id] = TRUE
update_node_status(SSresearch.techweb_node_by_id(id))
for(var/id in node.design_ids)
add_design_by_id(id)
update_node_status(node)
return TRUE
/datum/techweb/proc/unresearch_node_id(id)
return unresearch_node(get_techweb_node_by_id(id))
return unresearch_node(SSresearch.techweb_node_by_id(id))
/datum/techweb/proc/unresearch_node(datum/techweb_node/node)
if(!istype(node))
@@ -232,9 +240,9 @@
/datum/techweb/proc/boost_with_path(datum/techweb_node/N, itempath)
if(!istype(N) || !ispath(itempath))
return FALSE
LAZYINITLIST(boosted_nodes[N])
LAZYINITLIST(boosted_nodes[N.id])
for(var/i in N.boost_item_paths[itempath])
boosted_nodes[N][i] = max(boosted_nodes[N][i], N.boost_item_paths[itempath][i])
boosted_nodes[N.id][i] = max(boosted_nodes[N.id][i], N.boost_item_paths[itempath][i])
if(N.autounlock_by_boost)
hidden_nodes -= N.id
update_node_status(N)
@@ -249,13 +257,13 @@
var/tier = 0
if (!researched_nodes[node.id]) // researched is tier 0
for (var/id in node.prereq_ids)
var/prereq_tier = tiers[node.prerequisites[id]]
var/prereq_tier = tiers[id]
tier = max(tier, prereq_tier + 1)
if (tier != tiers[node])
tiers[node] = tier
for (var/id in node.unlocks)
next += node.unlocks[id]
if (tier != tiers[node.id])
tiers[node.id] = tier
for (var/id in node.unlock_ids)
next += SSresearch.techweb_node_by_id(id)
current = next
/datum/techweb/proc/update_node_status(datum/techweb_node/node, autoupdate_consoles = TRUE)
@@ -265,8 +273,8 @@
if(researched_nodes[node.id])
researched = TRUE
var/needed = node.prereq_ids.len
for(var/i in node.prereq_ids)
if(researched_nodes[i])
for(var/id in node.prereq_ids)
if(researched_nodes[id])
visible = TRUE
needed--
if(!needed)
@@ -277,15 +285,15 @@
if(hidden_nodes[node.id]) //Hidden.
return
if(researched)
researched_nodes[node.id] = node
for(var/i in node.designs)
add_design(node.designs[i])
researched_nodes[node.id] = TRUE
for(var/id in node.design_ids)
add_design(SSresearch.techweb_design_by_id(id))
else
if(available)
available_nodes[node.id] = node
available_nodes[node.id] = TRUE
else
if(visible)
visible_nodes[node.id] = node
visible_nodes[node.id] = TRUE
update_tiers(node)
if(autoupdate_consoles)
for(var/v in consoles_accessing)
@@ -296,35 +304,34 @@
//Laggy procs to do specific checks, just in case. Don't use them if you can just use the vars that already store all this!
/datum/techweb/proc/designHasReqs(datum/design/D)
for(var/i in researched_nodes)
var/datum/techweb_node/N = researched_nodes[i]
for(var/I in N.designs)
if(D == N.designs[I])
return TRUE
var/datum/techweb_node/N = SSresearch.techweb_node_by_id(i)
if(N.design_ids[D.id])
return TRUE
return FALSE
/datum/techweb/proc/isDesignResearched(datum/design/D)
return isDesignResearchedID(D.id)
/datum/techweb/proc/isDesignResearchedID(id)
return researched_designs[id]
return researched_designs[id]? SSresearch.techweb_design_by_id(id) : FALSE
/datum/techweb/proc/isNodeResearched(datum/techweb_node/N)
return isNodeResearchedID(N.id)
/datum/techweb/proc/isNodeResearchedID(id)
return researched_nodes[id]
return researched_nodes[id]? SSresearch.techweb_node_by_id(id) : FALSE
/datum/techweb/proc/isNodeVisible(datum/techweb_node/N)
return isNodeResearchedID(N.id)
/datum/techweb/proc/isNodeVisibleID(id)
return visible_nodes[id]
return visible_nodes[id]? SSresearch.techweb_node_by_id(id) : FALSE
/datum/techweb/proc/isNodeAvailable(datum/techweb_node/N)
return isNodeAvailableID(N.id)
/datum/techweb/proc/isNodeAvailableID(id)
return available_nodes[id]
return available_nodes[id]? SSresearch.techweb_node_by_id(id) : FALSE
/datum/techweb/specialized
var/allowed_buildtypes = ALL
@@ -347,11 +354,11 @@
for(var/id in node_autounlock_ids)
research_node_id(id, TRUE, FALSE)
for(var/id in SSresearch.techweb_designs)
var/datum/design/D = SSresearch.techweb_designs[id]
var/datum/design/D = SSresearch.techweb_design_by_id(id)
if(D.build_type & design_autounlock_buildtypes)
for(var/i in D.category)
if(i in design_autounlock_categories)
add_design(D)
add_design_by_id(D.id)
break
/datum/techweb/specialized/autounlocking/autolathe
@@ -376,3 +383,7 @@
/datum/techweb/specialized/autounlocking/autoylathe
design_autounlock_buildtypes = AUTOYLATHE
allowed_buildtypes = AUTOYLATHE
/datum/techweb/specialized/autounlocking/autobottler
design_autounlock_buildtypes = AUTOBOTTLER
allowed_buildtypes = AUTOBOTTLER
+69 -6
View File
@@ -1,5 +1,6 @@
//Techweb nodes are GLOBAL, there should only be one instance of them in the game. Persistant changes should never be made to them in-game.
//USE SSRESEARCH PROCS TO OBTAIN REFERENCES. DO NOT REFERENCE OUTSIDE OF SSRESEARCH OR YOU WILL FUCK UP GC.
/datum/techweb_node
var/id
@@ -9,20 +10,82 @@
var/starting_node = FALSE //Whether it's available without any research.
var/list/prereq_ids = list()
var/list/design_ids = list()
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/unlock_ids = list() //CALCULATED FROM OTHER NODE'S PREREQUISITES. Assoc list id = TRUE.
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/list/research_costs = 0 //Point cost to research. type = amount
var/list/research_costs = list() //Point cost to research. type = amount
var/category = "Misc" //Category
/datum/techweb_node/error_node
id = "ERROR"
display_name = "ERROR"
description = "This usually means something in the database has corrupted. If it doesn't go away automatically, inform Central Command for their techs to fix it ASAP(tm)"
/datum/techweb_node/proc/Initialize()
//Make lists associative for lookup
for(var/id in prereq_ids)
prereq_ids[id] = TRUE
for(var/id in design_ids)
design_ids[id] = TRUE
for(var/id in unlock_ids)
unlock_ids[id] = TRUE
/datum/techweb_node/Destroy()
SSresearch.techweb_nodes -= id
return ..()
/datum/techweb_node/serialize_list(list/options)
. = list()
VARSET_TO_LIST(., id)
VARSET_TO_LIST(., display_name)
VARSET_TO_LIST(., hidden)
VARSET_TO_LIST(., starting_node)
VARSET_TO_LIST(., assoc_list_strip_value(prereq_ids))
VARSET_TO_LIST(., assoc_list_strip_value(design_ids))
VARSET_TO_LIST(., assoc_list_strip_value(unlock_ids))
VARSET_TO_LIST(., boost_item_paths)
VARSET_TO_LIST(., autounlock_by_boost)
VARSET_TO_LIST(., export_price)
VARSET_TO_LIST(., research_costs)
VARSET_TO_LIST(., category)
/datum/techweb_node/deserialize_list(list/input, list/options)
if(!input["id"])
return
VARSET_FROM_LIST(input, id)
VARSET_FROM_LIST(input, display_name)
VARSET_FROM_LIST(input, hidden)
VARSET_FROM_LIST(input, starting_node)
VARSET_FROM_LIST(input, prereq_ids)
VARSET_FROM_LIST(input, design_ids)
VARSET_FROM_LIST(input, unlock_ids)
VARSET_FROM_LIST(input, boost_item_paths)
VARSET_FROM_LIST(input, autounlock_by_boost)
VARSET_FROM_LIST(input, export_price)
VARSET_FROM_LIST(input, research_costs)
VARSET_FROM_LIST(input, category)
Initialize()
return src
/datum/techweb_node/proc/on_design_deletion(datum/design/D)
prune_design_id(D.id)
/datum/techweb_node/proc/on_node_deletion(datum/techweb_node/TN)
prune_node_id(TN.id)
/datum/techweb_node/proc/prune_design_id(design_id)
design_ids -= design_id
/datum/techweb_node/proc/prune_node_id(node_id)
prereq_ids -= node_id
unlock_ids -= node_id
/datum/techweb_node/proc/get_price(datum/techweb/host)
if(host)
var/list/actual_costs = research_costs
if(host.boosted_nodes[src])
var/list/L = host.boosted_nodes[src]
if(host.boosted_nodes[id])
var/list/L = host.boosted_nodes[id]
for(var/i in L)
if(actual_costs[i])
actual_costs[i] -= L[i]
+27 -8
View File
@@ -43,7 +43,6 @@
description = "Various tools fit for basic mech units"
design_ids = list("mech_drill", "mech_mscanner", "mech_extinguisher", "mech_cable_layer")
/datum/techweb_node/surplus_lims
id = "surplus_lims"
display_name = "Basic Prosthetics"
@@ -51,8 +50,20 @@
starting_node = TRUE
prereq_ids = list("biotech")
design_ids = list("basic_l_arm", "basic_r_arm", "basic_r_leg", "basic_l_leg")
export_price = 5000
/datum/techweb_node/blueprinted_bottles
id = "blueprinted_bottles"
display_name = "License Bottling"
description = "Some Branded bottles to print and export."
starting_node = TRUE
design_ids = list("gin", "wine", "whiskey", "vodka", "tequila", "patron", "rum", "kahlua", "vermouth", "goldschlager", "hcider", "cognac", "absinthe", "grappa", "sake", "fernet", "applejack", "champagne", "blazaam", "trappist", "grenadine", "autobottler")
/datum/techweb_node/blueprinted_exports
id = "blueprinted_exports"
display_name = "License Exports"
description = "Some Branded bottles to print and export."
starting_node = TRUE
design_ids = list("gin_export", "wine_export", "whiskey_export", "vodka_export", "tequila_export", "patron_export", "rum_export", "kahlua_export", "vermouth_export", "goldschlager_export", "hcider_export", "cognac_export", "absinthe_export", "grappa_export", "sake_export", "fernet_export", "applejack_export", "champagne_export", "blazaam_export", "trappist_export", "grenadine_export")
/////////////////////////Biotech/////////////////////////
/datum/techweb_node/biotech
@@ -82,6 +93,14 @@
research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500)
export_price = 5000
/datum/techweb_node/bottle_exports
id = "bottle_exports"
display_name = "Legal Bottling"
prereq_ids = list("blueprinted_bottles")
description = "New bottles for printing and selling."
design_ids = list("minikeg", "blooddrop", "slim_gold", "white_bloodmoon", "greenroad")
research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 250)
/datum/techweb_node/advance_lims
id = "advance_lims"
display_name = "Upgraded Prosthetics"
@@ -517,7 +536,7 @@
display_name = "Subdermal Implants"
description = "Electronic implants buried beneath the skin."
prereq_ids = list("biotech", "datatheory")
design_ids = list("implanter", "implantcase", "implant_chem", "implant_tracking", "locator")
design_ids = list("implanter", "implantcase", "implant_chem", "implant_tracking", "locator", "c38_trac")
research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500)
export_price = 5000
@@ -694,12 +713,12 @@
research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2750)
export_price = 5000
/datum/techweb_node/tech_shell
id = "tech_shell"
display_name = "Technological Shells"
description = "They're more technological than regular shot."
/datum/techweb_node/exotic_ammo
id = "exotic_ammo"
display_name = "Exotic Ammunition"
description = "They won't know what hit em."
prereq_ids = list("weaponry", "ballistic_weapons")
design_ids = list("techshotshell")
design_ids = list("techshotshell", "c38_hotshot", "c38_iceblox")
research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 3500)
export_price = 5000