Makes cargo canister listings get automatically generated at runtime (#57844)

This commit is contained in:
Emmett Gaines
2021-03-21 09:07:54 -04:00
committed by GitHub
parent e629ec95d1
commit d71ce02c98
5 changed files with 136 additions and 103 deletions

View File

@@ -44,10 +44,19 @@ SUBSYSTEM_DEF(shuttle)
var/centcom_message = "" //Remarks from CentCom on how well you checked the last order.
var/list/discoveredPlants = list() //Typepaths for unusual plants we've already sent CentCom, associated with their potencies
/// All of the possible supply packs that can be purchased by cargo
var/list/supply_packs = list()
/// Queued supplies to be purchased for the chef
var/list/chef_groceries = list()
/// Queued supply packs to be purchased
var/list/shoppinglist = list()
/// Wishlist items made by crew for cargo to purchase at their leisure
var/list/requestlist = list()
/// A listing of previously delivered supply packs
var/list/orderhistory = list()
var/list/hidden_shuttle_turfs = list() //all turfs hidden from navigation computers associated with a list containing the image hiding them and the type of the turf they are pretending to be
@@ -76,11 +85,22 @@ SUBSYSTEM_DEF(shuttle)
/datum/controller/subsystem/shuttle/Initialize(timeofday)
ordernum = rand(1, 9000)
for(var/pack in subtypesof(/datum/supply_pack))
var/datum/supply_pack/P = new pack()
if(!P.contains)
var/list/pack_processing = subtypesof(/datum/supply_pack)
while(length(pack_processing))
var/datum/supply_pack/pack = pack_processing[length(pack_processing)]
pack_processing.len--
if(ispath(pack, /datum/supply_pack))
pack = new pack
var/list/generated_packs = pack.generate_supply_packs()
if(generated_packs)
pack_processing += generated_packs
continue
supply_packs[P.type] = P
if(!pack.contains)
continue
supply_packs[pack.id] = pack
initial_load()