mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2025-12-20 15:21:29 +00:00
48 lines
1.5 KiB
Plaintext
48 lines
1.5 KiB
Plaintext
GLOBAL_LIST_EMPTY(loadout_categories)
|
|
GLOBAL_LIST_EMPTY(gear_datums)
|
|
|
|
/datum/loadout_category
|
|
var/category = ""
|
|
var/list/gear = list()
|
|
|
|
/datum/loadout_category/New(cat)
|
|
category = cat
|
|
..()
|
|
|
|
/datum/gear
|
|
var/display_name //Name/index. Must be unique.
|
|
var/description //Description of this gear. If left blank will default to the description of the pathed item.
|
|
var/path //Path to item.
|
|
var/cost = 1 //Number of points used. Items in general cost 1 point, storage/armor/gloves/special use costs 2 points.
|
|
var/slot //Slot to equip to.
|
|
var/list/allowed_roles //Roles that can spawn with this item.
|
|
var/whitelisted //Term to check the whitelist for..
|
|
var/sort_category = "General"
|
|
var/list/gear_tweaks = list() //List of datums which will alter the item after it has been spawned.
|
|
var/subtype_path = /datum/gear //for skipping organizational subtypes (optional)
|
|
var/subtype_cost_overlap = TRUE //if subtypes can take points at the same time
|
|
var/donator_tier = 0
|
|
|
|
/datum/gear/New()
|
|
..()
|
|
if(!description)
|
|
var/obj/O = path
|
|
description = initial(O.desc)
|
|
|
|
/datum/gear_data
|
|
var/path
|
|
var/location
|
|
|
|
/datum/gear_data/New(npath, nlocation)
|
|
path = npath
|
|
location = nlocation
|
|
|
|
/datum/gear/proc/spawn_item(location, metadata)
|
|
var/datum/gear_data/gd = new(path, location)
|
|
for(var/datum/gear_tweak/gt in gear_tweaks)
|
|
gt.tweak_gear_data(metadata["[gt]"], gd)
|
|
var/item = new gd.path(gd.location)
|
|
for(var/datum/gear_tweak/gt in gear_tweaks)
|
|
gt.tweak_item(item, metadata["[gt]"])
|
|
return item
|