This commit is contained in:
kevinz000
2020-04-06 18:40:20 -07:00
parent b21b3fee3c
commit 154e145e25
7 changed files with 56 additions and 11 deletions
+9
View File
@@ -33,7 +33,12 @@ GLOBAL_VAR_INIT(rpg_loot_items, FALSE)
var/hitsound = null
var/usesound = null
var/throwhitsound = null
/// Weight class for how much storage capacity it uses and how big it physically is meaning storages can't hold it if their maximum weight class isn't as high as it.
var/w_class = WEIGHT_CLASS_NORMAL
/// Volume override for the item, otherwise automatically calculated from w_class.
var/volume
var/total_mass //Total mass in arbitrary pound-like values. If there's no balance reasons for an item to have otherwise, this var should be the item's weight in pounds.
var/slot_flags = 0 //This is used to determine on which slots an item can fit.
pass_flags = PASSTABLE
@@ -850,3 +855,7 @@ GLOBAL_VAR_INIT(rpg_loot_items, FALSE)
if (HAS_TRAIT(src, TRAIT_NODROP))
return
return ..()
/// Get an item's volume that it uses when being stored.
/obj/item/proc/get_volume()
return isnull(volume)? AUTOSCALE_VOLUME(w_class) : volume