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
@@ -6,7 +6,7 @@
desc = "It's a tiny chip! This one doesn't seem to do much, however."
icon = 'icons/obj/electronic_assemblies.dmi'
icon_state = "template"
w_class = 1
w_class = ITEMSIZE_TINY
var/extended_desc = null
var/list/inputs = list()
var/list/outputs = list()
@@ -1,7 +1,7 @@
/obj/item/device/electronic_assembly
name = "electronic assembly"
desc = "It's a case, for building electronics with."
w_class = 2
w_class = ITEMSIZE_SMALL
icon = 'icons/obj/electronic_assemblies.dmi'
icon_state = "setup_small"
var/max_components = 10
@@ -11,21 +11,21 @@
/obj/item/device/electronic_assembly/medium
name = "electronic mechanism"
icon_state = "setup_medium"
w_class = 3
w_class = ITEMSIZE_NORMAL
max_components = 20
max_complexity = 80
/obj/item/device/electronic_assembly/large
name = "electronic machine"
icon_state = "setup_large"
w_class = 4
w_class = ITEMSIZE_LARGE
max_components = 30
max_complexity = 120
/obj/item/device/electronic_assembly/drone
name = "electronic drone"
icon_state = "setup_drone"
w_class = 3
w_class = ITEMSIZE_NORMAL
max_components = 25
max_complexity = 100
+5 -5
View File
@@ -12,7 +12,7 @@
icon = 'icons/obj/electronic_assemblies.dmi'
icon_state = "wirer-wire"
flags = CONDUCT
w_class = 2
w_class = ITEMSIZE_SMALL
var/datum/integrated_io/selected_io = null
var/mode = WIRE
@@ -111,7 +111,7 @@
icon = 'icons/obj/electronic_assemblies.dmi'
icon_state = "debugger"
flags = CONDUCT
w_class = 2
w_class = ITEMSIZE_SMALL
var/data_to_write = null
var/accepting_refs = 0
@@ -162,10 +162,10 @@
desc = "This kit's essential for any circuitry projects."
icon = 'icons/obj/electronic_assemblies.dmi'
icon_state = "circuit_kit"
w_class = 3
w_class = ITEMSIZE_NORMAL
storage_slots = 200
max_storage_space = 400
max_w_class = 3
max_storage_space = ITEMSIZE_COST_NORMAL * 100
max_w_class = ITEMSIZE_NORMAL
display_contents_with_number = 1
can_hold = list(/obj/item/integrated_circuit, /obj/item/device/integrated_electronics, /obj/item/device/electronic_assembly,
/obj/item/weapon/screwdriver, /obj/item/weapon/crowbar)