mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2025-12-31 20:53:34 +00:00
* The lance now has a very clear confirmation message on it. * Update code/modules/supply/supply_console.dm Co-authored-by: Matt <116982774+Burzah@users.noreply.github.com> Signed-off-by: Qwertytoforty <52090703+Qwertytoforty@users.noreply.github.com> --------- Signed-off-by: Qwertytoforty <52090703+Qwertytoforty@users.noreply.github.com> Co-authored-by: S34N <12197162+S34NW@users.noreply.github.com> Co-authored-by: Matt <116982774+Burzah@users.noreply.github.com>
121 lines
3.9 KiB
Plaintext
121 lines
3.9 KiB
Plaintext
/datum/supply_packs
|
|
/// The name of this supply pack.
|
|
var/name
|
|
/// OBJ: What is inside the crate
|
|
var/list/contains = list()
|
|
/// STRING: What is inside the crate
|
|
var/list/contains_special = list()
|
|
/// The manifest contents for this order.
|
|
var/manifest = ""
|
|
/// The number of crates that get generated by this pack.
|
|
var/amount
|
|
/// The cost of this pack.
|
|
var/cost
|
|
/// Path of the type of order that should be generated from this order
|
|
var/datum/supply_order/order_type = /datum/supply_order
|
|
/// The type of container that the contents will arrive in.
|
|
var/containertype = /obj/structure/closet/crate
|
|
|
|
/// The name to give the container itself.
|
|
var/containername
|
|
/// If the container is lockable, the access to require for it.
|
|
var/access
|
|
/// If TRUE, this pack is only visible on an emagged supply console.
|
|
var/hidden = FALSE
|
|
/// If TRUE, this pack is only visible on a hacked supply console.
|
|
var/contraband = FALSE
|
|
/// If TRUE, this pack is only visible on a cmagged supply console.
|
|
var/cmag_hidden = FALSE
|
|
/// A special pack that should not appear unless certain circumstances are fulfilled (event, station goals, admin packs)
|
|
var/special = FALSE
|
|
/// If this pack is special, whether it should be visible or not.
|
|
var/special_enabled = FALSE
|
|
/// If true, this pack can only be ordered in units of 1.
|
|
var/singleton = FALSE
|
|
/// Identifier indicating the specific "set" of singletons that this belongs to.
|
|
/// Only one item in this set can be in the shopping cart at once.
|
|
var/singleton_group_id
|
|
/// The pack group this should appear in.
|
|
var/group = SUPPLY_MISC
|
|
///Determines which departments do not need QM approval to order this supply pack
|
|
var/list/department_restrictions = list()
|
|
/// Particular beacons that we'll notify the relevant department when we reach
|
|
var/list/announce_beacons = list()
|
|
/// List of names for being done in TGUI
|
|
var/list/ui_manifest = list()
|
|
/// If this variable is filled, this grants the user a special TGUI confirmation prompt about ordering this shuttle, before they can place the order. Similar to bag of holding.
|
|
var/are_you_sure_you_want_to_be_banned
|
|
|
|
/datum/supply_packs/New()
|
|
. = ..()
|
|
manifest += "<ul>"
|
|
for(var/path in contains)
|
|
if(!path)
|
|
continue
|
|
var/atom/movable/AM = path
|
|
manifest += "<li>[initial(AM.name)]</li>"
|
|
//Add the name to the UI manifest
|
|
ui_manifest += "[initial(AM.name)]"
|
|
for(var/item in contains_special)
|
|
manifest += "<li>[item]</li>"
|
|
ui_manifest += "[item]"
|
|
manifest += "</ul>"
|
|
|
|
/**
|
|
* Create a supply order for this pack.
|
|
*/
|
|
/datum/supply_packs/proc/create_order(orderedby, occupation, comment, order_num)
|
|
RETURN_TYPE(/datum/supply_order)
|
|
var/datum/supply_order/order = new order_type()
|
|
order.ordernum = order_num
|
|
order.object = src
|
|
order.orderedby = orderedby
|
|
order.orderedbyRank = occupation
|
|
order.comment = comment
|
|
|
|
return order
|
|
|
|
/// Define a special condition as to whether or not this crate can currently be ordered.
|
|
/datum/supply_packs/proc/can_order()
|
|
return TRUE
|
|
|
|
|
|
/datum/supply_packs/proc/create_package(turf/spawn_location)
|
|
var/obj/structure/closet/crate/crate = new containertype(spawn_location)
|
|
|
|
crate.name = containername
|
|
if(access)
|
|
crate.req_access = list(text2num(access))
|
|
|
|
//we now create the actual contents
|
|
for(var/typepath in generate_items())
|
|
if(!typepath)
|
|
continue
|
|
var/atom/A = new typepath(crate)
|
|
if(isstack(A) && amount)
|
|
var/obj/item/stack/mats = A
|
|
mats.amount = amount
|
|
|
|
return crate
|
|
|
|
/datum/supply_packs/proc/generate_items()
|
|
return contains
|
|
|
|
/// Called right when an order for this pack is confirmed.
|
|
/datum/supply_packs/proc/on_order_confirm(datum/supply_order/order)
|
|
return
|
|
|
|
/datum/supply_packs/misc/randomised/generate_items()
|
|
. = list()
|
|
if(length(contains))
|
|
for(var/j in 1 to num_contained)
|
|
. += pick(contains)
|
|
|
|
/datum/supply_packs/proc/get_cost()
|
|
return cost * SSeconomy.pack_price_modifier
|
|
|
|
/datum/supply_packs/proc/get_special_manifest(content_list)
|
|
for(var/item in contains_special)
|
|
content_list += item
|
|
return content_list
|