Merge pull request #9061 from Anasari/TGRefundPort

Port over Fox's refactored syndicate item refund from TG.
This commit is contained in:
Crazy Lemon
2018-08-22 22:51:12 -07:00
committed by GitHub
6 changed files with 51 additions and 36 deletions
+11 -14
View File
@@ -1,16 +1,13 @@
var/list/uplink_items = list()
GLOBAL_LIST_INIT(uplink_items, subtypesof(/datum/uplink_item))
/proc/get_uplink_items(var/job = null)
// If not already initialized..
var/list/uplink_items = list()
if(!uplink_items.len)
// Fill in the list and order it like this:
// A keyed list, acting as categories, which are lists to the datum.
var/list/last = list()
for(var/item in typesof(/datum/uplink_item))
for(var/path in GLOB.uplink_items)
var/datum/uplink_item/I = new item()
var/datum/uplink_item/I = new path
if(!I.item)
continue
if(I.gamemodes.len && ticker && !(ticker.mode.type in I.gamemodes))
@@ -55,6 +52,9 @@ var/list/uplink_items = list()
var/list/job = null
var/surplus = 100 //Chance of being included in the surplus crate (when pick() selects it)
var/hijack_only = FALSE //can this item be purchased only during hijackings?
var/refundable = FALSE
var/refund_path = null // Alternative path for refunds, in case the item purchased isn't what is actually refunded (ie: holoparasites).
var/refund_amount // specified refund amount in case there needs to be a TC penalty for refunds.
/datum/uplink_item/proc/spawn_item(var/turf/loc, var/obj/item/uplink/U)
if(hijack_only)
@@ -540,9 +540,11 @@ var/list/uplink_items = list()
desc = "A cyborg designed and programmed for systematic extermination of non-Syndicate personnel."
reference = "SC"
item = /obj/item/antag_spawner/borg_tele
refund_path = /obj/item/antag_spawner/borg_tele
cost = 50
gamemodes = list(/datum/game_mode/nuclear)
surplus = 0
refundable = TRUE
/datum/uplink_item/dangerous/foamsmg
name = "Toy Submachine Gun"
@@ -571,19 +573,14 @@ var/list/uplink_items = list()
gamemodes = list(/datum/game_mode/nuclear)
surplus = 0
//for refunding the syndieborg teleporter
/datum/uplink_item/dangerous/syndieborg/spawn_item()
var/obj/item/antag_spawner/borg_tele/T = ..()
if(istype(T))
T.TC_cost = cost
/datum/uplink_item/dangerous/guardian
name = "Holoparasites"
desc = "Though capable of near sorcerous feats via use of hardlight holograms and nanomachines, they require an organic host as a home base and source of fuel."
item = /obj/item/storage/box/syndie_kit/guardian
excludefrom = list(/datum/game_mode/nuclear)
cost = 12
refund_path = /obj/item/guardiancreator/tech/choose
refundable = TRUE
// Ammunition