Re-adds species uplink items (and some minor fixes) (#64460)

This commit is contained in:
John Willard
2022-01-30 23:01:36 -08:00
committed by GitHub
parent 874c5f23d8
commit 6a1ae92145
10 changed files with 68 additions and 11 deletions
@@ -51,8 +51,6 @@
SStraitor.register_uplink_handler(uplink_handler)
uplink_handler.has_objectives = TRUE
uplink_handler.owner = owner
uplink_handler.assigned_role = owner.assigned_role.title
uplink_handler.generate_objectives()
if(uplink_handler.progression_points < SStraitor.current_global_progression)
@@ -60,7 +58,10 @@
var/list/uplink_items = list()
for(var/datum/uplink_item/item as anything in SStraitor.uplink_items)
if(item.item && (!length(item.restricted_roles) || (uplink_handler.assigned_role in item.restricted_roles)) \
&& !item.cant_discount && (item.purchasable_from & uplink_handler.uplink_flag) && item.cost > 1)
&& !item.cant_discount && (item.purchasable_from & uplink_handler.uplink_flag) && item.cost > 1)
uplink_items += item
if(item.item && (!length(item.restricted_species) || (uplink_handler.assigned_species in item.restricted_species)) \
&& !item.cant_discount && (item.purchasable_from & uplink_handler.uplink_flag) && item.cost > 1)
uplink_items += item
uplink_handler.extra_purchasable += create_uplink_sales(uplink_sale_count, /datum/uplink_category/discounts, -1, uplink_items)
@@ -38,6 +38,8 @@
var/list/potential_duplicate_objectives = list()
/// The role that this uplink handler is associated to.
var/assigned_role
/// The species this uplink handler is associated to.
var/assigned_species
/// Whether this is in debug mode or not. If in debug mode, allows all purchases
var/debug_mode = FALSE
@@ -60,6 +62,8 @@
if(length(to_purchase.restricted_roles) && !(assigned_role in to_purchase.restricted_roles))
return FALSE
if(length(to_purchase.restricted_species) && !(assigned_species in to_purchase.restricted_species))
return FALSE
var/stock = item_stock[to_purchase] || INFINITY
if(telecrystals < to_purchase.cost || stock <= 0 || (has_progression && progression_points < to_purchase.progression_minimum))
@@ -578,6 +578,7 @@
"restricted" = item.restricted,
"limited_stock" = item.limited_stock,
"restricted_roles" = item.restricted_roles,
"restricted_species" = item.restricted_species,
"progression_minimum" = item.progression_minimum,
))
}
+2
View File
@@ -53,6 +53,8 @@
var/purchasable_from = ALL
/// If this uplink item is only available to certain roles. Roles are dependent on the frequency chip or stored ID.
var/list/restricted_roles = list()
/// The species able to purchase this uplink item.
var/restricted_species = list()
/// The minimum amount of progression needed for this item to be added to uplinks.
var/progression_minimum = 0
/// Whether this purchase is visible in the purchase log.
@@ -0,0 +1,15 @@
/datum/uplink_category/species
name = "Species Restricted"
weight = 1
/datum/uplink_item/species_restricted
category = /datum/uplink_category/species
purchasable_from = ~(UPLINK_NUKE_OPS | UPLINK_CLOWN_OPS)
/datum/uplink_item/species_restricted/moth_lantern
name = "Extra-Bright Lantern"
desc = "We heard that moths such as yourself really like lamps, so we decided to grant you early access to a prototype \
Syndicate brand \"Extra-Bright Lantern™\". Enjoy."
cost = 2
item = /obj/item/flashlight/lantern/syndicate
restricted_species = list(SPECIES_MOTH)