From 603e2bc1fec14ae9d2ba8a0cce89275f46584b03 Mon Sep 17 00:00:00 2001 From: Iamgoofball Date: Thu, 25 Aug 2016 13:59:30 -0700 Subject: [PATCH] Since infinite traitor items is okay, I improved it --- code/modules/cargo/packs.dm | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/code/modules/cargo/packs.dm b/code/modules/cargo/packs.dm index b3fe2ffd114..7da6ba1489c 100644 --- a/code/modules/cargo/packs.dm +++ b/code/modules/cargo/packs.dm @@ -147,11 +147,27 @@ name = "NULL_ENTRY" hidden = TRUE cost = 14000 - contains = list(/obj/item/weapon/storage/box/syndicate) + contains = list() crate_name = "emergency crate" crate_type = /obj/structure/closet/crate/internals dangerous = TRUE +/datum/supply_pack/emergency/syndicate/fill(obj/structure/closet/crate/C) + var/list/uplink_items = get_uplink_items() + + var/crate_value = 50 + while(crate_value) + var/category = pick(uplink_items) + var/item = pick(uplink_items[category]) + var/datum/uplink_item/I = uplink_items[category][item] + + if(!I.surplus || prob(100 - I.surplus)) + continue + if(crate_value < I.cost) + continue + crate_value -= I.cost + new I.item(C) + ////////////////////////////////////////////////////////////////////////////// //////////////////////////// Security //////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////