Fixed an issue where contraband crates could not be ordered and would prevent other crates in the same shipment from arriving.

Generalised the crate contents randomisation code to allow for future random-contents crates and avoid unnecessary copypasted code.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@3588 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
musketstgstation@gmail.com
2012-05-14 00:48:27 +00:00
parent 43f93a06c5
commit f6b2777313
2 changed files with 11 additions and 23 deletions

View File

@@ -542,7 +542,8 @@
containertype = "/obj/structure/closet/crate/secure/gear"
containername = "Secruity Barriers crate"
/datum/supply_packs/hats/
/datum/supply_packs/randomised
var/num_contained = 3 //number of items picked to be contained in a randomised crate
contains = list("/obj/item/clothing/head/collectable/chef",
"/obj/item/clothing/head/collectable/paper",
"/obj/item/clothing/head/collectable/tophat",
@@ -569,28 +570,22 @@
"/obj/item/clothing/head/collectable/petehat")
name = "Collectable hat crate!"
cost = 200
containertype = "/obj/structure/closet/crate/hat"
containertype = "/obj/structure/closet/crate"
containername = "Collectable hats crate! Brought to you by Bass.inc!"
/datum/supply_packs/hats/New()
/datum/supply_packs/randomised/New()
var/list/tempContains = list()
for(var/i = 0,i<min(3,contains.len),i++)
for(var/i = 0,i<num_contained,i++)
tempContains += pick(contains)
contains = tempContains
..()
/datum/supply_packs/contraband
/datum/supply_packs/randomised/contraband
num_contained = 5
contains = list("/obj/item/weapon/contraband/poster","/obj/item/weapon/cigpacket/dromedaryco") //We randomly pick 5 items from this list through the constructor, look below
name = "Contraband crate"
cost = 30
containertype = "/obj/structure/closet/crate/contraband"
containertype = "/obj/structure/closet/crate"
containername = "Contraband crate"
contraband = 1
/datum/supply_packs/poster/New()
var/list/tempContains = list()
for(var/i = 0,i<5,i++)
tempContains += pick(contains)
src.contains = tempContains
..()

View File

@@ -29,6 +29,7 @@
icon_opened = "trashcartopen"
icon_closed = "trashcart"
/*these aren't needed anymore
/obj/structure/closet/crate/hat
desc = "A crate filled with Valuable Collector's Hats!."
name = "Hat Crate"
@@ -38,7 +39,7 @@
icon_opened = "crateopen"
icon_closed = "crate"
/obj/structure/closet/crate/poster
/obj/structure/closet/crate/contraband
name = "Poster crate"
desc = "A random assortment of posters manufactured by providers NOT listed under Nanotrasen's whitelist."
icon = 'storage.dmi'
@@ -46,15 +47,7 @@
density = 1
icon_opened = "crateopen"
icon_closed = "crate"
/obj/structure/closet/crate/cigarettes
name = "DromedaryCo cigarettes crate"
desc = "A crate of cigarettes manufactured by the notorious DromedaryCo company."
icon = 'storage.dmi'
icon_state = "crate"
density = 1
icon_opened = "crateopen"
icon_closed = "crate"
*/
/obj/structure/closet/crate/medical
desc = "A medical crate."