Experi-Sci: Techweb nodes may now require you to perform "scientific" experiments (#54093)

Co-authored-by: Brett Williams <bobbahbrown@gmail.com>
Co-authored-by: Jordan Brown <Cyberboss@users.noreply.github.com>
Co-authored-by: ArcaneMusic <41715314+ArcaneMusic@users.noreply.github.com>
Co-authored-by: Aleksej Komarov <stylemistake@gmail.com>
Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
This commit is contained in:
Qustinnus
2021-02-23 22:30:24 +01:00
committed by GitHub
parent 381b09fbd6
commit 931a32ffb3
82 changed files with 3349 additions and 808 deletions
+112 -25
View File
@@ -1,27 +1,47 @@
//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.
/**
* # Techweb
*
* A datum representing a research techweb
*
* 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
/// Already unlocked and all designs are now available. Assoc list, id = TRUE
var/list/researched_nodes = list()
/// Visible nodes, doesn't mean it can be researched. Assoc list, id = TRUE
var/list/visible_nodes = list()
/// Nodes that can immediately be researched, all reqs met. assoc list, id = TRUE
var/list/available_nodes = list()
/// Designs that are available for use. Assoc list, id = TRUE
var/list/researched_designs = list()
/// Custom inserted designs like from disks that should survive recalculation.
var/list/custom_designs = list()
/// Already boosted nodes that can't be boosted again. node id = path of boost object.
var/list/boosted_nodes = list()
/// Hidden nodes. id = TRUE. Used for unhiding nodes when requirements are met by removing the entry of the node.
var/list/hidden_nodes = list()
/// Items already deconstructed for a generic point boost, path = list(point_type = points)
var/list/deconstructed_items = list()
/// Available research points, type = number
var/list/research_points = list()
var/list/obj/machinery/computer/rdconsole/consoles_accessing = list()
var/id = "generic"
var/list/research_logs = list() //IC logs.
/// IC logs
var/list/research_logs = list()
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/discovered_mutations = list() //Mutations discovered by genetics, this way they are shared and cant be destroyed by destroying a single console
var/list/tiers = list() //Assoc list, id = number, 1 is available, 2 is all reqs are 1, so on
/// Organization name, used for display
var/organization = "Third-Party"
/// Current per-second production, used for display only.
var/list/last_bitcoins = list()
/// Mutations discovered by genetics, this way they are shared and cant be destroyed by destroying a single console
var/list/discovered_mutations = list()
/// Assoc list, id = number, 1 is available, 2 is all reqs are 1, so on
var/list/tiers = list()
/// Available experiments
var/list/available_experiments = list()
/// Completed experiments
var/list/completed_experiments = list()
/datum/techweb/New()
SSresearch.techwebs += src
@@ -206,6 +226,69 @@
return FALSE
return TRUE
/**
* Checks if all experiments have been completed for a given node on this techweb
*
* Arguments:
* * node - the node to check
*/
/datum/techweb/proc/have_experiments_for_node(datum/techweb_node/node)
. = TRUE
for (var/experiment_type in node.required_experiments)
if (!completed_experiments[experiment_type])
return FALSE
/**
* Checks if a node can be unlocked on this techweb, having the required points and experiments
*
* Arguments:
* * node - the node to check
*/
/datum/techweb/proc/can_unlock_node(datum/techweb_node/node)
return can_afford(node.get_price(src)) && have_experiments_for_node(node)
/**
* Adds an experiment to this techweb by its type, ensures that no duplicates are added.
*
* Arguments:
* * experiment_type - the type of the experiment to add
*/
/datum/techweb/proc/add_experiment(experiment_type)
. = TRUE
// check active experiments for experiment of this type
for (var/available_experiment in available_experiments)
var/datum/experiment/experiment = available_experiment
if (experiment.type == experiment_type)
return FALSE
// check completed experiments for experiments of this type
for (var/completed_experiment in completed_experiments)
var/datum/experiment/experiment = completed_experiment
if (experiment == experiment_type)
return FALSE
available_experiments += new experiment_type()
/**
* Adds a list of experiments to this techweb by their types, ensures that no duplicates are added.
*
* Arguments:
* * experiment_list - the list of types of experiments to add
*/
/datum/techweb/proc/add_experiments(list/experiment_list)
. = TRUE
for (var/experiment_type in experiment_list)
var/datum/experiment/experiment = experiment_type
. = . && add_experiment(experiment)
/**
* Notifies the techweb that an experiment has been completed, updating internal state of the techweb to reflect this.
*
* Arguments:
* * completed_experiment - the experiment which was completed
*/
/datum/techweb/proc/complete_experiment(datum/experiment/completed_experiment)
available_experiments -= completed_experiment
completed_experiments[completed_experiment.type] = completed_experiment
/datum/techweb/proc/printout_points()
return techweb_point_display_generic(research_points)
@@ -217,21 +300,25 @@
return FALSE
update_node_status(node)
if(!force)
if(!available_nodes[node.id] || (auto_adjust_cost && (!can_afford(node.get_price(src)))))
if(!available_nodes[node.id] || (auto_adjust_cost && (!can_afford(node.get_price(src)))) || !have_experiments_for_node(node))
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))
var/datum/techweb_node/unlocked_node = SSresearch.techweb_node_by_id(id)
if (unlocked_node.required_experiments.len > 0)
add_experiments(unlocked_node.required_experiments)
if (unlocked_node.discount_experiments.len > 0)
add_experiments(unlocked_node.discount_experiments)
update_node_status(unlocked_node)
for(var/id in node.design_ids)
add_design_by_id(id)
update_node_status(node)
if(get_that_dosh)
var/datum/bank_account/D = SSeconomy.get_dep_account(ACCOUNT_SCI)
if(D)
D.adjust_money(SSeconomy.techweb_bounty)
var/datum/bank_account/science_department_bank_account = SSeconomy.get_dep_account(ACCOUNT_SCI)
science_department_bank_account?.adjust_money(SSeconomy.techweb_bounty)
return TRUE
/datum/techweb/science/research_node(datum/techweb_node/node, force = FALSE, auto_adjust_cost = TRUE, get_that_dosh = TRUE) //When something is researched, triggers the proc for this techweb only
+42 -16
View File
@@ -1,21 +1,41 @@
//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.
/**
* # Techweb Node
*
* A datum representing a researchable node in the techweb.
*
* 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
/// Internal ID of the node
var/id
/// The name of the node as it is shown on UIs
var/display_name = "Errored Node"
/// A description of the node to show on UIs
var/description = "Why are you seeing this?"
var/hidden = FALSE //Whether it starts off hidden.
var/experimental = FALSE //If the tech can be randomly granted by the BEPIS as a reward. Meant to be fully given in tech disks, not researched.
var/starting_node = FALSE //Whether it's available without any research.
/// Whether it starts off hidden
var/hidden = FALSE
/// If the tech can be randomly generated by the BEPIS as a reward. MEant to be fully given in tech disks, not researched
var/experimental = FALSE
/// Whether it's available without any research
var/starting_node = FALSE
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/list/research_costs = list() //Point cost to research. type = amount
var/category = "Misc" //Category
/// CALCULATED FROM OTHER NODE'S PREREQUISITIES. Associated list id = TRUE
var/list/unlock_ids = list()
/// Associative list, path = list(point type = point_value)
var/list/boost_item_paths = list()
/// Boosting this will autounlock this node
var/autounlock_by_boost = TRUE
/// The points cost to research the node, type = amount
var/list/research_costs = list()
/// The category of the node
var/category = "Misc"
/// The list of experiments required to research the node
var/list/required_experiments = list()
/// If completed, these experiments give a specific point amount discount to the node.area
var/list/discount_experiments = list()
/datum/techweb_node/error_node
id = "ERROR"
@@ -48,6 +68,7 @@
VARSET_TO_LIST(., autounlock_by_boost)
VARSET_TO_LIST(., research_costs)
VARSET_TO_LIST(., category)
VARSET_TO_LIST(., required_experiments)
/datum/techweb_node/deserialize_list(list/input, list/options)
if(!input["id"])
@@ -63,6 +84,7 @@
VARSET_FROM_LIST(input, autounlock_by_boost)
VARSET_FROM_LIST(input, research_costs)
VARSET_FROM_LIST(input, category)
VARSET_FROM_LIST(input, required_experiments)
Initialize()
return src
@@ -83,10 +105,14 @@
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]
var/list/boostlist = host.boosted_nodes[id]
for(var/booster in boostlist)
if(actual_costs[booster])
actual_costs[booster] -= boostlist[booster]
for(var/cost_type in actual_costs)
for(var/experiment_type in discount_experiments)
if(host.completed_experiments[experiment_type]) //do we have this discount_experiment unlocked?
actual_costs[cost_type] -= discount_experiments[experiment_type]
return actual_costs
else
return research_costs
+32 -12
View File
@@ -10,7 +10,7 @@
// Default research tech, prevents bricking
design_ids = list("basic_matter_bin", "basic_cell", "basic_scanning", "basic_capacitor", "basic_micro_laser", "micro_mani", "basic_electrolite", "c-reader", "desttagger", "salestagger", "handlabel", "packagewrap",
"destructive_analyzer", "circuit_imprinter", "experimentor", "rdconsole", "bepis", "design_disk", "tech_disk", "rdserver", "rdservercontrol", "mechfab",
"paystand", "space_heater", "bucket", "sec_rshot", "sec_beanbag_slug", "sec_Islug", "sec_dart", "sec_38", "rglass", "plasteel",
"paystand", "space_heater", "bucket", "sec_rshot", "sec_beanbag_slug", "sec_Islug", "sec_dart", "sec_38", "rglass", "plasteel", "experi_scanner", "destructive_scanner", "doppler_array",
"plastitanium", "plasmaglass", "plasmareinforcedglass", "titaniumglass", "plastitaniumglass", "plastic_knife", "plastic_fork", "plastic_spoon", "conveyor_belt", "conveyor_switch")
/datum/techweb_node/mmi
@@ -62,6 +62,7 @@
"dropper", "defibmountdefault", "surgical_tape", "portable_chem_mixer")
/////////////////////////Biotech/////////////////////////
/datum/techweb_node/biotech
id = "biotech"
display_name = "Biological Technology"
@@ -69,6 +70,7 @@
prereq_ids = list("base")
design_ids = list("chem_heater", "chem_master", "chem_dispenser", "pandemic", "defibrillator", "defibmount", "operating", "soda_dispenser", "beer_dispenser", "healthanalyzer", "medigel","genescanner", "med_spray_bottle", "chem_pack", "blood_pack", "medical_kiosk", "crewpinpointerprox", "medipen_refiller", "biopsy_tool", "plumbing_rcd_sci")
research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500)
required_experiments = list(/datum/experiment/scanning/points/slime/calibration)
/datum/techweb_node/adv_biotech
id = "adv_biotech"
@@ -76,7 +78,9 @@
description = "Advanced Biotechnology"
prereq_ids = list("biotech")
design_ids = list("piercesyringe", "crewpinpointer", "smoke_machine", "plasmarefiller", "limbgrower", "meta_beaker", "healthanalyzer_advanced", "harvester", "holobarrier_med", "detective_scanner", "defibrillator_compact", "ph_meter")
research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500)
research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 5000)
required_experiments = list(/datum/experiment/scanning/points/slime/easy)
discount_experiments = list(/datum/experiment/scanning/random/material/meat = 4000) //Big discount to reinforce doing it.
/datum/techweb_node/bio_process
id = "bio_process"
@@ -84,9 +88,11 @@
description = "From slimes to kitchens."
prereq_ids = list("biotech")
design_ids = list("smartfridge", "gibber", "deepfryer", "monkey_recycler", "processor", "gibber", "microwave", "reagentgrinder", "dish_drive", "fat_sucker", "griddle")
research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500)
research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 4000)
discount_experiments = list(/datum/experiment/scanning/random/cytology = 3000) //Big discount to reinforce doing it.
/////////////////////////Advanced Surgery/////////////////////////
/datum/techweb_node/imp_wt_surgery
id = "imp_wt_surgery"
display_name = "Improved Wound-Tending Surgery"
@@ -121,6 +127,7 @@
research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 10000)
/////////////////////////data theory tech/////////////////////////
/datum/techweb_node/datatheory //Computer science
id = "datatheory"
display_name = "Data Theory"
@@ -131,6 +138,7 @@
/////////////////////////engineering tech/////////////////////////
/datum/techweb_node/engineering
id = "engineering"
display_name = "Industrial Engineering"
@@ -140,7 +148,8 @@
"atmosalerts", "atmos_control", "recycler", "autolathe", "high_micro_laser", "nano_mani", "mesons", "welding_goggles", "thermomachine", "rad_collector", "tesla_coil", "grounding_rod",
"apc_control", "cell_charger", "power control", "airlock_board", "firelock_board", "airalarm_electronics", "firealarm_electronics", "cell_charger", "stack_console", "stack_machine",
"oxygen_tank", "plasma_tank", "emergency_oxygen", "emergency_oxygen_engi", "plasmaman_tank_belt", "electrolyzer", "adv_electrolite", "pneumatic_seal")
research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 7500)
research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 12500)
discount_experiments = list(/datum/experiment/scanning/random/material/easy = 7500)
/datum/techweb_node/adv_engi
id = "adv_engi"
@@ -149,7 +158,8 @@
prereq_ids = list("engineering", "emp_basic")
design_ids = list("engine_goggles", "magboots", "forcefield_projector", "weldingmask", "rcd_loaded", "rpd_loaded", "sheetifier", "HFR_core", "HFR_fuel_input",
"HFR_waste_output", "HFR_moderator_input", "HFR_corner", "HFR_interface")
research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500)
research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 5000)
discount_experiments = list(/datum/experiment/scanning/random/material/medium/one = 4000)
/datum/techweb_node/anomaly
id = "anomaly_research"
@@ -377,7 +387,8 @@
description = "For the slackers on the station."
prereq_ids = list("comptech")
design_ids = list("arcade_battle", "arcade_orion", "slotmachine")
research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 1000)
research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 3250)
discount_experiments = list(/datum/experiment/physical/arcade_winner = 3000)
/datum/techweb_node/comp_recordkeeping
id = "comp_recordkeeping"
@@ -493,7 +504,8 @@
description = "Efficiency Level 127" //dumb mc references
prereq_ids = list("basic_mining", "adv_engi", "adv_power", "adv_plasma")
design_ids = list("drill_diamond", "jackhammer", "hypermod", "plasmacutter_adv")
research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500)
research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 7500)
discount_experiments = list(/datum/experiment/scanning/random/material/hard/one = 5000)
/datum/techweb_node/janitor
id = "janitor"
@@ -501,7 +513,8 @@
description = "Clean things better, faster, stronger, and harder!"
prereq_ids = list("adv_engi")
design_ids = list("holobarrier_jani", "advmop", "buffer", "blutrash", "light_replacer", "spraybottle", "beartrap", "paint_remover")
research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500)
research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 4000)
discount_experiments = list(/datum/experiment/scanning/random/janitor_trash = 3000) //75% discount for scanning some trash, seems fair right?
/datum/techweb_node/botany
id = "botany"
@@ -517,7 +530,8 @@
description = "Highly advanced tools."
design_ids = list("exwelder", "jawsoflife", "handdrill", "laserscalpel", "mechanicalpinches", "searingtool", "gene_shears")
prereq_ids = list("adv_engi")
research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500)
research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 7500)
discount_experiments = list(/datum/experiment/scanning/random/material/hard/one = 5000)
/datum/techweb_node/sec_basic
id = "sec_basic"
@@ -541,7 +555,8 @@
description = "Unlocks new RCD designs."
design_ids = list("rcd_upgrade_silo_link")
prereq_ids = list("rcd_upgrade", "bluespace_travel")
research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 5000)
research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 10000)
discount_experiments = list(/datum/experiment/scanning/random/material/hard/two = 5000)
/////////////////////////weaponry tech/////////////////////////
/datum/techweb_node/weaponry
@@ -551,6 +566,7 @@
prereq_ids = list("engineering")
design_ids = list("pin_testing", "tele_shield")
research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 10000)
required_experiments = list(/datum/experiment/explosion/calibration)
/datum/techweb_node/adv_weaponry
id = "adv_weaponry"
@@ -559,6 +575,7 @@
prereq_ids = list("adv_engi", "weaponry")
design_ids = list("pin_loyalty")
research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 10000)
required_experiments = list(/datum/experiment/explosion/medium)
/datum/techweb_node/electric_weapons
id = "electronic_weapons"
@@ -599,6 +616,7 @@
prereq_ids = list("adv_weaponry")
design_ids = list("large_Grenade", "pyro_Grenade", "adv_Grenade")
research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500)
required_experiments = list(/datum/experiment/explosion/maxcap)
/datum/techweb_node/ballistic_weapons
id = "ballistic_weapons"
@@ -631,7 +649,8 @@
description = "For when you just aren't Gundam enough."
prereq_ids = list("adv_robotics")
design_ids = list("mech_repair_droid")
research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500)
research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 7500)
discount_experiments = list(/datum/experiment/scanning/random/material/medium/three = 5000)
/datum/techweb_node/odysseus
id = "mecha_odysseus"
@@ -821,7 +840,7 @@
prereq_ids = list("datatheory")
design_ids = list("nanite_disk","nanite_remote","nanite_comm_remote","nanite_scanner",\
"nanite_chamber","public_nanite_chamber","nanite_chamber_control","nanite_programmer","nanite_program_hub","nanite_cloud_control",\
"relay_nanites", "monitoring_nanites", "research_nanites" ,"researchplus_nanites", "access_nanites", "repairing_nanites","sensor_nanite_volume", "repeater_nanites", "relay_repeater_nanites","debugging_nanites")
"relay_nanites", "monitoring_nanites", "access_nanites", "repairing_nanites","sensor_nanite_volume", "repeater_nanites", "relay_repeater_nanites","debugging_nanites")
research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 1000)
/datum/techweb_node/nanite_smart
@@ -935,6 +954,7 @@
/obj/item/cautery/alien, /obj/item/surgicaldrill/alien, /obj/item/screwdriver/abductor, /obj/item/wrench/abductor, /obj/item/crowbar/abductor, /obj/item/multitool/abductor,
/obj/item/weldingtool/abductor, /obj/item/wirecutters/abductor, /obj/item/circuitboard/machine/abductor, /obj/item/melee/baton/abductor, /obj/item/abductor, /obj/item/gun/energy/shrink_ray)
research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500)
required_experiments = list(/datum/experiment/scanning/points/slime/hard)
hidden = TRUE
/datum/techweb_node/alien_engi