Centralizes weight class definitions

A lot of new defines are now in inventory_sizes.dm, which contains;
All the size identifiers (the thing that tells the game if something is bulky, or w/e).
Storage costs for all the sizes, which are exponents of two, as previously.
A few constants for inventory size.

Also changes all storage item's capacity definitions by basing it off of how many 'normal slots' exist for it.  This allows one to change the definition for all of the defines in the file, and everything will follow along without needing to change 500 files.  In testing, I made all ITEMSIZE_COST_* defines doubled, and nothing had broke.

The benefit of doing all of this is that it makes adding new weight classes in the future much simpler, and makes knowing how much space a container has easier, as seeing ITEMSIZE_COST_NORMAL * 7 means it can hold seven normal items.
This commit is contained in:
Neerti
2016-09-22 00:51:51 -04:00
parent 038fe05a47
commit 828dacf485
273 changed files with 708 additions and 677 deletions

View File

@@ -23,9 +23,9 @@
var/l_hacking = 0
var/emagged = 0
var/open = 0
w_class = 3
max_w_class = 2
max_storage_space = 14
w_class = ITEMSIZE_NORMAL
max_w_class = ITEMSIZE_SMALL
max_storage_space = ITEMSIZE_SMALL * 7
examine(mob/user)
if(..(user, 1))
@@ -149,7 +149,7 @@
force = 8.0
throw_speed = 1
throw_range = 4
w_class = 4.0
w_class = ITEMSIZE_LARGE
attack_hand(mob/user as mob)
if ((src.loc == user) && (src.locked == 1))
@@ -176,8 +176,8 @@
icon_locking = "safeb"
icon_sparking = "safespark"
force = 8.0
w_class = 8.0
max_w_class = 8
w_class = ITEMSIZE_NO_CONTAINER
max_w_class = ITEMSIZE_LARGE // This was 8 previously...
anchored = 1.0
density = 0
cant_hold = list(/obj/item/weapon/storage/secure/briefcase)