Merge branch 'master' into RemoteMoodResearch
This commit is contained in:
@@ -1,34 +1,34 @@
|
||||
/proc/count_unique_techweb_nodes()
|
||||
var/static/list/L = typesof(/datum/techweb_node)
|
||||
return L.len
|
||||
|
||||
/proc/count_unique_techweb_designs()
|
||||
var/static/list/L = typesof(/datum/design)
|
||||
return L.len
|
||||
|
||||
/proc/node_boost_error(id, message)
|
||||
WARNING("Invalid boost information for node \[[id]\]: [message]")
|
||||
SSresearch.invalid_node_boost[id] = message
|
||||
|
||||
/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)
|
||||
|
||||
/proc/techweb_item_point_check(obj/item/I)
|
||||
if(SSresearch.techweb_point_items[I.type])
|
||||
return SSresearch.techweb_point_items[I.type]
|
||||
|
||||
/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("<BR>")
|
||||
|
||||
/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("<BR>")
|
||||
/proc/count_unique_techweb_nodes()
|
||||
var/static/list/L = typesof(/datum/techweb_node)
|
||||
return L.len
|
||||
|
||||
/proc/count_unique_techweb_designs()
|
||||
var/static/list/L = typesof(/datum/design)
|
||||
return L.len
|
||||
|
||||
/proc/node_boost_error(id, message)
|
||||
WARNING("Invalid boost information for node \[[id]\]: [message]")
|
||||
SSresearch.invalid_node_boost[id] = message
|
||||
|
||||
/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)
|
||||
|
||||
/proc/techweb_item_point_check(obj/item/I)
|
||||
if(SSresearch.techweb_point_items[I.type])
|
||||
return SSresearch.techweb_point_items[I.type]
|
||||
|
||||
/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("<BR>")
|
||||
|
||||
/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("<BR>")
|
||||
|
||||
@@ -1,389 +1,389 @@
|
||||
|
||||
//Used \n[\s]*origin_tech[\s]*=[\s]*"[\S]+" to delete all origin techs.
|
||||
//Or \n[\s]*origin_tech[\s]*=[\s]list\([A-Z_\s=0-9,]*\)
|
||||
//Used \n[\s]*req_tech[\s]*=[\s]*list\(["a-z\s=0-9,]*\) to delete all req_techs.
|
||||
|
||||
//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/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()
|
||||
var/id = "generic"
|
||||
var/list/research_logs = list() //IC logs.
|
||||
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, 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_node_by_id(i)
|
||||
research_node(DN, TRUE, FALSE)
|
||||
hidden_nodes = SSresearch.techweb_nodes_hidden.Copy()
|
||||
return ..()
|
||||
|
||||
/datum/techweb/admin
|
||||
id = "ADMIN"
|
||||
organization = "CentCom"
|
||||
|
||||
/datum/techweb/admin/New() //All unlocked.
|
||||
. = ..()
|
||||
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/syndicate
|
||||
id = "SYNDICATE"
|
||||
organization = "Syndicate"
|
||||
|
||||
/datum/techweb/syndicate/New()
|
||||
var/datum/techweb_node/syndicate_basic/Node = new()
|
||||
research_node(Node, TRUE)
|
||||
|
||||
/datum/techweb/abductor
|
||||
id = "ABDUCTOR"
|
||||
organization = "Aliens"
|
||||
|
||||
/datum/techweb/abductor/New()
|
||||
var/datum/techweb_node/alientech/Node = new()
|
||||
research_node(Node, TRUE)
|
||||
|
||||
/datum/techweb/science //Global science techweb for RND consoles.
|
||||
id = "SCIENCE"
|
||||
organization = "Nanotrasen"
|
||||
|
||||
/datum/techweb/Destroy()
|
||||
researched_nodes = null
|
||||
researched_designs = null
|
||||
available_nodes = null
|
||||
visible_nodes = null
|
||||
custom_designs = null
|
||||
SSresearch.techwebs -= src
|
||||
return ..()
|
||||
|
||||
/datum/techweb/proc/recalculate_nodes(recalculate_designs = FALSE, wipe_custom_designs = FALSE)
|
||||
var/list/datum/techweb_node/processing = list()
|
||||
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
|
||||
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/receiver, unlock_hidden = TRUE) //Adds any missing research to theirs.
|
||||
for(var/i in researched_nodes)
|
||||
CHECK_TICK
|
||||
receiver.research_node_id(i, TRUE, FALSE)
|
||||
for(var/i in researched_designs)
|
||||
CHECK_TICK
|
||||
receiver.add_design_by_id(i)
|
||||
if(unlock_hidden)
|
||||
for(var/i in receiver.hidden_nodes)
|
||||
CHECK_TICK
|
||||
if(!hidden_nodes[i])
|
||||
receiver.hidden_nodes -= i //We can see it so let them see it too.
|
||||
receiver.recalculate_nodes()
|
||||
|
||||
/datum/techweb/proc/copy()
|
||||
var/datum/techweb/returned = new()
|
||||
returned.researched_nodes = researched_nodes.Copy()
|
||||
returned.visible_nodes = visible_nodes.Copy()
|
||||
returned.available_nodes = available_nodes.Copy()
|
||||
returned.researched_designs = researched_designs.Copy()
|
||||
returned.hidden_nodes = hidden_nodes.Copy()
|
||||
return returned
|
||||
|
||||
/datum/techweb/proc/get_visible_nodes() //The way this is set up is shit but whatever.
|
||||
return visible_nodes - hidden_nodes
|
||||
|
||||
/datum/techweb/proc/get_available_nodes()
|
||||
return available_nodes - hidden_nodes
|
||||
|
||||
/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, custom = FALSE)
|
||||
return add_design(SSresearch.techweb_design_by_id(id), custom)
|
||||
|
||||
/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, custom = FALSE)
|
||||
return remove_design(SSresearch.techweb_design_by_id(id), custom)
|
||||
|
||||
/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
|
||||
|
||||
/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(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))
|
||||
return FALSE
|
||||
update_node_status(node)
|
||||
if(!force)
|
||||
if(!available_nodes[node.id] || (auto_adjust_cost && (!can_afford(node.get_price(src)))))
|
||||
return FALSE
|
||||
if(auto_adjust_cost)
|
||||
remove_point_list(node.get_price(src))
|
||||
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(SSresearch.techweb_node_by_id(id))
|
||||
|
||||
/datum/techweb/proc/unresearch_node(datum/techweb_node/node)
|
||||
if(!istype(node))
|
||||
return FALSE
|
||||
researched_nodes -= node.id
|
||||
recalculate_nodes(TRUE) //Fully rebuild the tree.
|
||||
|
||||
/datum/techweb/proc/boost_with_path(datum/techweb_node/N, itempath)
|
||||
if(!istype(N) || !ispath(itempath))
|
||||
return FALSE
|
||||
LAZYINITLIST(boosted_nodes[N.id])
|
||||
for(var/i in N.boost_item_paths[itempath])
|
||||
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)
|
||||
return TRUE
|
||||
|
||||
/datum/techweb/proc/update_tiers(datum/techweb_node/base)
|
||||
var/list/current = list(base)
|
||||
while (current.len)
|
||||
var/list/next = list()
|
||||
for (var/node_ in current)
|
||||
var/datum/techweb_node/node = node_
|
||||
var/tier = 0
|
||||
if (!researched_nodes[node.id]) // researched is tier 0
|
||||
for (var/id in node.prereq_ids)
|
||||
var/prereq_tier = tiers[id]
|
||||
tier = max(tier, prereq_tier + 1)
|
||||
|
||||
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)
|
||||
var/researched = FALSE
|
||||
var/available = FALSE
|
||||
var/visible = FALSE
|
||||
if(researched_nodes[node.id])
|
||||
researched = TRUE
|
||||
var/needed = node.prereq_ids.len
|
||||
for(var/id in node.prereq_ids)
|
||||
if(researched_nodes[id])
|
||||
visible = TRUE
|
||||
needed--
|
||||
if(!needed)
|
||||
available = TRUE
|
||||
researched_nodes -= node.id
|
||||
available_nodes -= node.id
|
||||
visible_nodes -= node.id
|
||||
if(hidden_nodes[node.id]) //Hidden.
|
||||
return
|
||||
if(researched)
|
||||
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] = TRUE
|
||||
else
|
||||
if(visible)
|
||||
visible_nodes[node.id] = TRUE
|
||||
update_tiers(node)
|
||||
if(autoupdate_consoles)
|
||||
for(var/v in consoles_accessing)
|
||||
var/obj/machinery/computer/rdconsole/V = v
|
||||
V.rescan_views()
|
||||
V.updateUsrDialog()
|
||||
|
||||
//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 = 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]? 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]? 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]? 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]? SSresearch.techweb_node_by_id(id) : FALSE
|
||||
|
||||
/datum/techweb/specialized
|
||||
var/allowed_buildtypes = ALL
|
||||
|
||||
/datum/techweb/specialized/add_design(datum/design/D)
|
||||
if(!(D.build_type & allowed_buildtypes))
|
||||
return FALSE
|
||||
return ..()
|
||||
|
||||
/datum/techweb/specialized/autounlocking
|
||||
var/design_autounlock_buildtypes = NONE
|
||||
var/design_autounlock_categories = list("initial") //if a design has a buildtype that matches the abovea and either has a category in this or this is null, unlock it.
|
||||
var/node_autounlock_ids = list() //autounlock nodes of this type.
|
||||
|
||||
/datum/techweb/specialized/autounlocking/New()
|
||||
..()
|
||||
autounlock()
|
||||
|
||||
/datum/techweb/specialized/autounlocking/proc/autounlock()
|
||||
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_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_by_id(D.id)
|
||||
break
|
||||
|
||||
/datum/techweb/specialized/autounlocking/autolathe
|
||||
design_autounlock_buildtypes = AUTOLATHE
|
||||
allowed_buildtypes = AUTOLATHE
|
||||
|
||||
/datum/techweb/specialized/autounlocking/limbgrower
|
||||
design_autounlock_buildtypes = LIMBGROWER
|
||||
allowed_buildtypes = LIMBGROWER
|
||||
|
||||
/datum/techweb/specialized/autounlocking/biogenerator
|
||||
design_autounlock_buildtypes = BIOGENERATOR
|
||||
allowed_buildtypes = BIOGENERATOR
|
||||
|
||||
/datum/techweb/specialized/autounlocking/smelter
|
||||
design_autounlock_buildtypes = SMELTER
|
||||
allowed_buildtypes = SMELTER
|
||||
|
||||
/datum/techweb/specialized/autounlocking/exofab
|
||||
allowed_buildtypes = MECHFAB
|
||||
|
||||
/datum/techweb/specialized/autounlocking/autoylathe
|
||||
design_autounlock_buildtypes = AUTOYLATHE
|
||||
allowed_buildtypes = AUTOYLATHE
|
||||
|
||||
/datum/techweb/specialized/autounlocking/autobottler
|
||||
design_autounlock_buildtypes = AUTOBOTTLER
|
||||
|
||||
//Used \n[\s]*origin_tech[\s]*=[\s]*"[\S]+" to delete all origin techs.
|
||||
//Or \n[\s]*origin_tech[\s]*=[\s]list\([A-Z_\s=0-9,]*\)
|
||||
//Used \n[\s]*req_tech[\s]*=[\s]*list\(["a-z\s=0-9,]*\) to delete all req_techs.
|
||||
|
||||
//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/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()
|
||||
var/id = "generic"
|
||||
var/list/research_logs = list() //IC logs.
|
||||
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, 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_node_by_id(i)
|
||||
research_node(DN, TRUE, FALSE)
|
||||
hidden_nodes = SSresearch.techweb_nodes_hidden.Copy()
|
||||
return ..()
|
||||
|
||||
/datum/techweb/admin
|
||||
id = "ADMIN"
|
||||
organization = "CentCom"
|
||||
|
||||
/datum/techweb/admin/New() //All unlocked.
|
||||
. = ..()
|
||||
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/syndicate
|
||||
id = "SYNDICATE"
|
||||
organization = "Syndicate"
|
||||
|
||||
/datum/techweb/syndicate/New()
|
||||
var/datum/techweb_node/syndicate_basic/Node = new()
|
||||
research_node(Node, TRUE)
|
||||
|
||||
/datum/techweb/abductor
|
||||
id = "ABDUCTOR"
|
||||
organization = "Aliens"
|
||||
|
||||
/datum/techweb/abductor/New()
|
||||
var/datum/techweb_node/alientech/Node = new()
|
||||
research_node(Node, TRUE)
|
||||
|
||||
/datum/techweb/science //Global science techweb for RND consoles.
|
||||
id = "SCIENCE"
|
||||
organization = "Nanotrasen"
|
||||
|
||||
/datum/techweb/Destroy()
|
||||
researched_nodes = null
|
||||
researched_designs = null
|
||||
available_nodes = null
|
||||
visible_nodes = null
|
||||
custom_designs = null
|
||||
SSresearch.techwebs -= src
|
||||
return ..()
|
||||
|
||||
/datum/techweb/proc/recalculate_nodes(recalculate_designs = FALSE, wipe_custom_designs = FALSE)
|
||||
var/list/datum/techweb_node/processing = list()
|
||||
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
|
||||
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/receiver, unlock_hidden = TRUE) //Adds any missing research to theirs.
|
||||
for(var/i in researched_nodes)
|
||||
CHECK_TICK
|
||||
receiver.research_node_id(i, TRUE, FALSE)
|
||||
for(var/i in researched_designs)
|
||||
CHECK_TICK
|
||||
receiver.add_design_by_id(i)
|
||||
if(unlock_hidden)
|
||||
for(var/i in receiver.hidden_nodes)
|
||||
CHECK_TICK
|
||||
if(!hidden_nodes[i])
|
||||
receiver.hidden_nodes -= i //We can see it so let them see it too.
|
||||
receiver.recalculate_nodes()
|
||||
|
||||
/datum/techweb/proc/copy()
|
||||
var/datum/techweb/returned = new()
|
||||
returned.researched_nodes = researched_nodes.Copy()
|
||||
returned.visible_nodes = visible_nodes.Copy()
|
||||
returned.available_nodes = available_nodes.Copy()
|
||||
returned.researched_designs = researched_designs.Copy()
|
||||
returned.hidden_nodes = hidden_nodes.Copy()
|
||||
return returned
|
||||
|
||||
/datum/techweb/proc/get_visible_nodes() //The way this is set up is shit but whatever.
|
||||
return visible_nodes - hidden_nodes
|
||||
|
||||
/datum/techweb/proc/get_available_nodes()
|
||||
return available_nodes - hidden_nodes
|
||||
|
||||
/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, custom = FALSE)
|
||||
return add_design(SSresearch.techweb_design_by_id(id), custom)
|
||||
|
||||
/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, custom = FALSE)
|
||||
return remove_design(SSresearch.techweb_design_by_id(id), custom)
|
||||
|
||||
/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
|
||||
|
||||
/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(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))
|
||||
return FALSE
|
||||
update_node_status(node)
|
||||
if(!force)
|
||||
if(!available_nodes[node.id] || (auto_adjust_cost && (!can_afford(node.get_price(src)))))
|
||||
return FALSE
|
||||
if(auto_adjust_cost)
|
||||
remove_point_list(node.get_price(src))
|
||||
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(SSresearch.techweb_node_by_id(id))
|
||||
|
||||
/datum/techweb/proc/unresearch_node(datum/techweb_node/node)
|
||||
if(!istype(node))
|
||||
return FALSE
|
||||
researched_nodes -= node.id
|
||||
recalculate_nodes(TRUE) //Fully rebuild the tree.
|
||||
|
||||
/datum/techweb/proc/boost_with_path(datum/techweb_node/N, itempath)
|
||||
if(!istype(N) || !ispath(itempath))
|
||||
return FALSE
|
||||
LAZYINITLIST(boosted_nodes[N.id])
|
||||
for(var/i in N.boost_item_paths[itempath])
|
||||
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)
|
||||
return TRUE
|
||||
|
||||
/datum/techweb/proc/update_tiers(datum/techweb_node/base)
|
||||
var/list/current = list(base)
|
||||
while (current.len)
|
||||
var/list/next = list()
|
||||
for (var/node_ in current)
|
||||
var/datum/techweb_node/node = node_
|
||||
var/tier = 0
|
||||
if (!researched_nodes[node.id]) // researched is tier 0
|
||||
for (var/id in node.prereq_ids)
|
||||
var/prereq_tier = tiers[id]
|
||||
tier = max(tier, prereq_tier + 1)
|
||||
|
||||
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)
|
||||
var/researched = FALSE
|
||||
var/available = FALSE
|
||||
var/visible = FALSE
|
||||
if(researched_nodes[node.id])
|
||||
researched = TRUE
|
||||
var/needed = node.prereq_ids.len
|
||||
for(var/id in node.prereq_ids)
|
||||
if(researched_nodes[id])
|
||||
visible = TRUE
|
||||
needed--
|
||||
if(!needed)
|
||||
available = TRUE
|
||||
researched_nodes -= node.id
|
||||
available_nodes -= node.id
|
||||
visible_nodes -= node.id
|
||||
if(hidden_nodes[node.id]) //Hidden.
|
||||
return
|
||||
if(researched)
|
||||
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] = TRUE
|
||||
else
|
||||
if(visible)
|
||||
visible_nodes[node.id] = TRUE
|
||||
update_tiers(node)
|
||||
if(autoupdate_consoles)
|
||||
for(var/v in consoles_accessing)
|
||||
var/obj/machinery/computer/rdconsole/V = v
|
||||
V.rescan_views()
|
||||
V.updateUsrDialog()
|
||||
|
||||
//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 = 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]? 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]? 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]? 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]? SSresearch.techweb_node_by_id(id) : FALSE
|
||||
|
||||
/datum/techweb/specialized
|
||||
var/allowed_buildtypes = ALL
|
||||
|
||||
/datum/techweb/specialized/add_design(datum/design/D)
|
||||
if(!(D.build_type & allowed_buildtypes))
|
||||
return FALSE
|
||||
return ..()
|
||||
|
||||
/datum/techweb/specialized/autounlocking
|
||||
var/design_autounlock_buildtypes = NONE
|
||||
var/design_autounlock_categories = list("initial") //if a design has a buildtype that matches the abovea and either has a category in this or this is null, unlock it.
|
||||
var/node_autounlock_ids = list() //autounlock nodes of this type.
|
||||
|
||||
/datum/techweb/specialized/autounlocking/New()
|
||||
..()
|
||||
autounlock()
|
||||
|
||||
/datum/techweb/specialized/autounlocking/proc/autounlock()
|
||||
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_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_by_id(D.id)
|
||||
break
|
||||
|
||||
/datum/techweb/specialized/autounlocking/autolathe
|
||||
design_autounlock_buildtypes = AUTOLATHE
|
||||
allowed_buildtypes = AUTOLATHE
|
||||
|
||||
/datum/techweb/specialized/autounlocking/limbgrower
|
||||
design_autounlock_buildtypes = LIMBGROWER
|
||||
allowed_buildtypes = LIMBGROWER
|
||||
|
||||
/datum/techweb/specialized/autounlocking/biogenerator
|
||||
design_autounlock_buildtypes = BIOGENERATOR
|
||||
allowed_buildtypes = BIOGENERATOR
|
||||
|
||||
/datum/techweb/specialized/autounlocking/smelter
|
||||
design_autounlock_buildtypes = SMELTER
|
||||
allowed_buildtypes = SMELTER
|
||||
|
||||
/datum/techweb/specialized/autounlocking/exofab
|
||||
allowed_buildtypes = MECHFAB
|
||||
|
||||
/datum/techweb/specialized/autounlocking/autoylathe
|
||||
design_autounlock_buildtypes = AUTOYLATHE
|
||||
allowed_buildtypes = AUTOYLATHE
|
||||
|
||||
/datum/techweb/specialized/autounlocking/autobottler
|
||||
design_autounlock_buildtypes = AUTOBOTTLER
|
||||
allowed_buildtypes = AUTOBOTTLER
|
||||
@@ -1,97 +1,97 @@
|
||||
|
||||
//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
|
||||
var/display_name = "Errored Node"
|
||||
var/description = "Why are you seeing this?"
|
||||
var/hidden = FALSE //Whether it starts off hidden.
|
||||
var/starting_node = FALSE //Whether it's available without any research.
|
||||
var/list/prereq_ids = list()
|
||||
var/list/design_ids = list()
|
||||
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 = 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[id])
|
||||
var/list/L = host.boosted_nodes[id]
|
||||
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))
|
||||
|
||||
//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
|
||||
var/display_name = "Errored Node"
|
||||
var/description = "Why are you seeing this?"
|
||||
var/hidden = FALSE //Whether it starts off hidden.
|
||||
var/starting_node = FALSE //Whether it's available without any research.
|
||||
var/list/prereq_ids = list()
|
||||
var/list/design_ids = list()
|
||||
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 = 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[id])
|
||||
var/list/L = host.boosted_nodes[id]
|
||||
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))
|
||||
|
||||
@@ -8,9 +8,9 @@
|
||||
display_name = "Basic Research Technology"
|
||||
description = "NT default research technologies."
|
||||
// Default research tech, prevents bricking
|
||||
design_ids = list("basic_matter_bin", "basic_cell", "basic_scanning", "basic_capacitor", "basic_micro_laser", "micro_mani",
|
||||
design_ids = list("basic_matter_bin", "basic_cell", "basic_scanning", "basic_capacitor", "basic_micro_laser", "micro_mani", "desttagger", "handlabel", "packagewrap",
|
||||
"destructive_analyzer", "circuit_imprinter", "experimentor", "rdconsole", "design_disk", "tech_disk", "rdserver", "rdservercontrol", "mechfab",
|
||||
"space_heater", "xlarge_beaker", "sec_beanbag", "sec_rshot", "sec_bshot", "sec_slug", "sec_Islug", "sec_dart", "sec_38", "sec_38lethal",
|
||||
"space_heater", "beaker", "large_beaker", "bucket", "xlarge_beaker", "sec_beanbag", "sec_rshot", "sec_bshot", "sec_slug", "sec_Islug", "sec_dart", "sec_38", "sec_38lethal",
|
||||
"rglass","plasteel","plastitanium","plasmaglass","plasmareinforcedglass","titaniumglass","plastitaniumglass")
|
||||
|
||||
/datum/techweb_node/mmi
|
||||
@@ -71,7 +71,7 @@
|
||||
display_name = "Biological Technology"
|
||||
description = "What makes us tick." //the MC, silly!
|
||||
prereq_ids = list("base")
|
||||
design_ids = list("medicalkit", "chem_heater", "chem_master", "chem_dispenser", "sleeper", "vr_sleeper", "pandemic", "defibmount", "operating", "soda_dispenser", "beer_dispenser", "healthanalyzer", "blood_bag", "bloodbankgen", "telescopiciv")
|
||||
design_ids = list("medicalkit", "chem_heater", "chem_master", "chem_dispenser", "sleeper", "vr_sleeper", "pandemic", "defibrillator", "defibmount", "operating", "soda_dispenser", "beer_dispenser", "healthanalyzer", "blood_bag", "bloodbankgen", "telescopiciv", "medspray")
|
||||
research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500)
|
||||
export_price = 5000
|
||||
|
||||
@@ -80,7 +80,7 @@
|
||||
display_name = "Advanced Biotechnology"
|
||||
description = "Advanced Biotechnology"
|
||||
prereq_ids = list("biotech")
|
||||
design_ids = list("piercesyringe", "crewpinpointer", "smoke_machine", "plasmarefiller", "limbgrower", "defibrillator", "meta_beaker", "healthanalyzer_advanced","harvester","holobarrier_med","smartdartgun","medicinalsmartdart", "pHmeter")
|
||||
design_ids = list("piercesyringe", "crewpinpointer", "smoke_machine", "plasmarefiller", "limbgrower", "meta_beaker", "healthanalyzer_advanced", "harvester", "holobarrier_med", "detective_scanner", "defibrillator_compact", "smartdartgun", "medicinalsmartdart", "pHmeter")
|
||||
research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500)
|
||||
export_price = 5000
|
||||
|
||||
@@ -200,7 +200,7 @@
|
||||
display_name = "Advanced Engineering"
|
||||
description = "Pushing the boundaries of physics, one chainsaw-fist at a time."
|
||||
prereq_ids = list("engineering", "emp_basic")
|
||||
design_ids = list("engine_goggles", "magboots", "forcefield_projector", "weldingmask", "tray_goggles_prescription", "engine_goggles_prescription", "mesons_prescription", "rcd_upgrade")
|
||||
design_ids = list("engine_goggles", "magboots", "forcefield_projector", "weldingmask" , "rcd_loaded", "rpd", "tray_goggles_prescription", "engine_goggles_prescription", "mesons_prescription", "rcd_upgrade_frames", "rcd_upgrade_simple_circuits")
|
||||
research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 4000)
|
||||
export_price = 5000
|
||||
|
||||
@@ -365,7 +365,7 @@
|
||||
display_name = "Advanced Robotics Research"
|
||||
description = "It can even do the dishes!"
|
||||
prereq_ids = list("robotics")
|
||||
design_ids = list("borg_upgrade_diamonddrill", "borg_upgrade_advancedmop")
|
||||
design_ids = list("borg_upgrade_diamonddrill", "borg_upgrade_advancedmop", "borg_upgrade_advcutter", "borg_upgrade_premiumka")
|
||||
research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 3000)
|
||||
export_price = 5000
|
||||
|
||||
@@ -391,7 +391,7 @@
|
||||
display_name = "Cyborg Upgrades: Utility"
|
||||
description = "Utility upgrades for cyborgs."
|
||||
prereq_ids = list("engineering", "robotics")
|
||||
design_ids = list("borg_upgrade_holding", "borg_upgrade_lavaproof", "borg_upgrade_thrusters", "borg_upgrade_selfrepair", "borg_upgrade_expand", "borg_upgrade_rped")
|
||||
design_ids = list("borg_upgrade_lavaproof", "borg_upgrade_thrusters", "borg_upgrade_selfrepair", "borg_upgrade_expand", "borg_upgrade_rped")
|
||||
research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2000)
|
||||
export_price = 5000
|
||||
|
||||
@@ -430,7 +430,7 @@
|
||||
display_name = "Electromagnetic Theory"
|
||||
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")
|
||||
design_ids = list("holosign", "holosignsec", "holosignengi", "holosignatmos", "holosignfirelock", "inducer", "tray_goggles", "holopad")
|
||||
research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500)
|
||||
export_price = 5000
|
||||
|
||||
@@ -595,6 +595,15 @@
|
||||
export_price = 5000
|
||||
|
||||
////////////////////////Tools////////////////////////
|
||||
/datum/techweb_node/basic_tools
|
||||
id = "basic_tools"
|
||||
display_name = "Basic Tools"
|
||||
description = "Basic mechanical, electronic, surgical and botanical tools."
|
||||
prereq_ids = list("base")
|
||||
design_ids = list("screwdriver", "wrench", "wirecutters", "crowbar", "multitool", "welding_tool", "tscanner", "analyzer", "cable_coil", "pipe_painter", "airlock_painter", "scalpel", "circular_saw", "surgicaldrill", "retractor", "cautery", "hemostat", "cultivator", "plant_analyzer", "shovel", "spade", "hatchet")
|
||||
research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 500)
|
||||
export_price = 5000
|
||||
|
||||
/datum/techweb_node/basic_mining
|
||||
id = "basic_mining"
|
||||
display_name = "Mining Technology"
|
||||
@@ -618,7 +627,7 @@
|
||||
display_name = "Advanced Sanitation Technology"
|
||||
description = "Clean things better, faster, stronger, and harder!"
|
||||
prereq_ids = list("adv_engi")
|
||||
design_ids = list("advmop", "buffer", "light_replacer")
|
||||
design_ids = list("advmop", "buffer", "light_replacer", "spraybottle", "beartrap")
|
||||
research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 1750) // No longer has its bag
|
||||
export_price = 5000
|
||||
|
||||
@@ -640,6 +649,15 @@
|
||||
research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2750)
|
||||
export_price = 5000
|
||||
|
||||
/datum/techweb_node/sec_basic
|
||||
id = "sec_basic"
|
||||
display_name = "Basic Security Equipment"
|
||||
description = "Standard equipment used by security."
|
||||
design_ids = list("seclite", "pepperspray", "bola_energy", "zipties", "evidencebag")
|
||||
prereq_ids = list("base")
|
||||
research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 750)
|
||||
export_price = 5000
|
||||
|
||||
/////////////////////////weaponry tech/////////////////////////
|
||||
/datum/techweb_node/weaponry
|
||||
id = "weaponry"
|
||||
@@ -1081,7 +1099,7 @@
|
||||
display_name = "Illegal Technology"
|
||||
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")
|
||||
design_ids = list("decloner", "borg_syndicate_module", "ai_cam_upgrade", "suppressor", "largecrossbow", "donksofttoyvendor", "donksoft_refill", "syndiesleeper")
|
||||
research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 10000)
|
||||
export_price = 5000
|
||||
hidden = TRUE
|
||||
|
||||
Reference in New Issue
Block a user