More expanded multi-web support (#71402)

## About The Pull Request

This is a continuation of my previous PR
https://github.com/tgstation/tgstation/pull/71070

That one tackled techwebs and syncing it to machines, this one primarily
focuses on Generic techwebs and Experiment handlers.

### What it does

* Experiment handlers now only broadcast completed experiments over the
node they're connected to
* RD consoles once again no longer bluescreen if not connected to a
techweb
* RD servers now delete their techweb on deconstruction if they're the
creator of it
* 'Generic' techwebs are now capitalized
* Experiment handlers now see all techwebs instead of all servers being
listed under the same web, allowing there to have more than 1 techweb on
the same Z level but not list it as the same. They don't show the
location of the server anymore, I don't know if that's something that's
wanted or not.

In-game screenshot:

![image](https://user-images.githubusercontent.com/53777086/202935208-21b1fa15-e41d-4f85-b954-619252ecd504.png)

## Why It's Good For The Game

Mostly the same reason as my previous PR, this opens up more ways to
modularize techwebs and give more possibilities for ghost roles and
downstreams.

## Changelog

🆑
fix: Experisci handlers no longer show all servers as being on the same
techweb if they aren't.
fix: RnD consoles no longer bluescreen if they aren't connected to a
techweb, instead it will give an error message.
balance: Experisci handlers no longer show the location of RnD servers.
/🆑
This commit is contained in:
John Willard
2022-11-21 18:49:07 -08:00
committed by GitHub
parent ce71f2dc69
commit 118299b70b
6 changed files with 90 additions and 89 deletions
+25 -19
View File
@@ -7,6 +7,11 @@
* on research consoles, servers, and disks. They are NOT global.
*/
/datum/techweb
///The id/name of the whole Techweb viewable to players.
var/id = "Generic"
/// Organization name, used for display
var/organization = "Third-Party"
/// 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
@@ -25,12 +30,8 @@
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"
/// IC logs
var/list/research_logs = list()
/// 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
@@ -42,6 +43,11 @@
/// Completed experiments
var/list/completed_experiments = list()
///All RD consoles connected to this individual techweb.
var/list/obj/machinery/computer/rdconsole/consoles_accessing = list()
///All research servers connected to this individual techweb.
var/list/obj/machinery/rnd/server/techweb_servers = list()
/**
* Assoc list of relationships with various partners
* scientific_cooperation[partner_typepath] = relationship
@@ -62,6 +68,7 @@
hidden_nodes = SSresearch.techweb_nodes_hidden.Copy()
initialize_published_papers()
return ..()
/datum/techweb/admin
id = "ADMIN"
organization = "CentCom"
@@ -75,14 +82,6 @@
research_points[i] = INFINITY
hidden_nodes = list()
/datum/techweb/science //Global science techweb for RND consoles.
id = "SCIENCE"
organization = "Nanotrasen"
/datum/techweb/bepis //Should contain only 1 BEPIS tech selected at random.
id = "EXPERIMENTAL"
organization = "Nanotrasen R&D"
/datum/techweb/bepis/New(remove_tech = TRUE)
. = ..()
var/bepis_id = pick(SSresearch.techweb_nodes_experimental) //To add a new tech to the BEPIS, add the ID to this pick list.
@@ -285,8 +284,7 @@
*/
/datum/techweb/proc/add_experiments(list/experiment_list)
. = TRUE
for (var/experiment_type in experiment_list)
var/datum/experiment/experiment = experiment_type
for (var/datum/experiment/experiment as anything in experiment_list)
. = . && add_experiment(experiment)
/**
@@ -332,11 +330,6 @@
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
. = ..()
if(.)
node.on_research()
/datum/techweb/proc/unresearch_node_id(id)
return unresearch_node(SSresearch.techweb_node_by_id(id))
@@ -523,3 +516,16 @@
handler.announce_message_to_all("The [experiment.name] has been completed!")
return TRUE
/datum/techweb/science //Global science techweb for RND consoles.
id = "SCIENCE"
organization = "Nanotrasen"
/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
. = ..()
if(.)
node.on_research()
/datum/techweb/bepis //Should contain only 1 BEPIS tech selected at random.
id = "EXPERIMENTAL"
organization = "Nanotrasen R&D"