Makes loadout datums more flexible.

Loadout item definitions can now also take a list of tweaks, which will adjust the item after spawn.
Currently includes color and icon state changes.
This commit is contained in:
PsiOmegaDelta
2016-03-30 16:46:14 +01:00
committed by Yoshax
parent 5e05d6b91a
commit 877e3d66df
4 changed files with 37 additions and 3 deletions
@@ -157,5 +157,10 @@ var/list/gear_datums = list()
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.
/datum/gear/proc/spawn_item(var/location)
var/item = new path(location)
for(var/datum/gear_tweak/gt in gear_tweaks)
gt.apply_tweak(item)
return item