Files
Bubberstation/code/modules/research/techweb/__techweb_helpers.dm
SkyratBot 5fde8bd1ad [MIRROR] Makes point_types not be dumb (#26376)
* Makes point_types not be dumb (#81202)

## About The Pull Request

We currently have a list of point types that is meant to be
list(``DEFINE`` = name) but it's completely useless since the define is
just the name anyways. It's not used for anything, it has no purpose to
be this way. It seems more like a holdover from when there were multiple
types of research points (it was made for that purpose, even before
nanite points were a thing) but even for that, it serves no purpose.

I reworked it now to be the abbreviated name of the research point type,
de-hardcoding techwebs a little bit and removing the need for
downstreams to edit the techweb UI.

## Why It's Good For The Game

This at least looks better and makes more sense at people just looking
over it.

## Changelog

No player-facing changes.

* Makes point_types not be dumb

---------

Co-authored-by: John Willard <53777086+JohnFulpWillard@users.noreply.github.com>
2024-02-07 13:26:48 -05:00

40 lines
1.5 KiB
Plaintext

/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
///Returns an associative list of techweb node datums with values of the nodes it unlocks.
/proc/techweb_item_unlock_check(obj/item/I)
if(SSresearch.techweb_unlock_items[I.type])
return SSresearch.techweb_unlock_items[I.type] //It should already be formatted in node datum = list(point type = value)
/proc/techweb_item_point_check(obj/item/I)
if(SSresearch.techweb_point_items[I.type])
return SSresearch.techweb_point_items[I.type]
return FALSE
/proc/techweb_point_display_generic(pointlist)
var/list/ret = list()
for(var/i in pointlist)
if(i in SSresearch.point_types)
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)
var/research_line = "[(i in SSresearch.point_types) || "ERRORED POINT TYPE"]: [pointlist[i]]"
if(last_pointlist[i] > 0)
research_line += " (+[(last_pointlist[i]) * ((SSresearch.flags & SS_TICKER)? (600 / (world.tick_lag * SSresearch.wait)) : (600 / SSresearch.wait))]/ minute)"
ret += research_line
return ret.Join("<BR>")