[MIRROR] [MDB IGNORE] BIDDLE TRAITORS - Adds progression traitors. Refactors uplink code in its entirety [MDB IGNORE] (#10620)

* [MDB IGNORE] BIDDLE TRAITORS - Adds progression traitors. Refactors uplink code in its entirety

* updates and fixes

* ffff

Co-authored-by: Watermelon914 <37270891+Watermelon914@users.noreply.github.com>
Co-authored-by: Gandalf <9026500+Gandalf2k15@users.noreply.github.com>
This commit is contained in:
SkyratBot
2022-01-12 03:25:38 +00:00
committed by GitHub
co-authored by Watermelon914 Gandalf
parent ed457e5eec
commit c33061765b
145 changed files with 17246 additions and 4143 deletions
@@ -538,3 +538,43 @@
blended_color = "#2eeb9a"
pre_asset.Blend(blended_color, ICON_MULTIPLY)
return pre_asset
/// Sends information needed for uplinks
/datum/asset/json/uplink
name = "uplink"
/datum/asset/json/uplink/generate()
var/list/data = list()
var/list/categories = list()
var/list/items = list()
for(var/datum/uplink_category/category as anything in subtypesof(/datum/uplink_category))
categories += category
categories = sortTim(categories, .proc/cmp_uplink_category_desc)
var/list/new_categories = list()
for(var/datum/uplink_category/category as anything in categories)
new_categories += initial(category.name)
categories = new_categories
for(var/datum/uplink_item/item_path as anything in subtypesof(/datum/uplink_item))
var/datum/uplink_item/item = new item_path()
if(item.item) {
items += list(list(
"id" = item_path,
"name" = item.name,
"cost" = item.cost,
"desc" = item.desc,
"category" = item.category? initial(item.category.name) : null,
"purchasable_from" = item.purchasable_from,
"restricted" = item.restricted,
"limited_stock" = item.limited_stock,
"restricted_roles" = item.restricted_roles,
"progression_minimum" = item.progression_minimum,
))
}
SStraitor.uplink_items += item
SStraitor.uplink_items_by_type[item_path] = item
data["items"] = items
data["categories"] = categories
return data