mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-22 03:27:46 +01:00
Updates storage costs
Storage cost of an item is now twice that of the next smallest item, instead of being equal to the w_class. Items with w_class 1 or 2 are unaffected. This produces much better behaviour for containers that are limited by storage space instead of slots, such as how toolboxes are planned to work in a future update.
This commit is contained in:
@@ -8,10 +8,10 @@
|
||||
desc = "You wear this on your back and put items into it."
|
||||
icon_state = "backpack"
|
||||
item_state = "backpack"
|
||||
w_class = 4.0
|
||||
slot_flags = SLOT_BACK //ERROOOOO
|
||||
w_class = 4
|
||||
slot_flags = SLOT_BACK
|
||||
max_w_class = 3
|
||||
max_combined_w_class = 21
|
||||
max_storage_space = 28
|
||||
|
||||
/obj/item/weapon/storage/backpack/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if (src.use_sound)
|
||||
@@ -40,7 +40,7 @@
|
||||
origin_tech = "bluespace=4"
|
||||
icon_state = "holdingpack"
|
||||
max_w_class = 4
|
||||
max_combined_w_class = 28
|
||||
max_storage_space = 56
|
||||
|
||||
New()
|
||||
..()
|
||||
@@ -88,7 +88,7 @@
|
||||
w_class = 4.0
|
||||
storage_slots = 20
|
||||
max_w_class = 3
|
||||
max_combined_w_class = 400 // can store a ton of shit!
|
||||
max_storage_space = 400 // can store a ton of shit!
|
||||
|
||||
/obj/item/weapon/storage/backpack/cultpack
|
||||
name = "trophy rack"
|
||||
|
||||
@@ -77,7 +77,7 @@
|
||||
slot_flags = SLOT_BELT | SLOT_POCKET
|
||||
w_class = 3
|
||||
storage_slots = 50
|
||||
max_combined_w_class = 200 //Doesn't matter what this is, so long as it's more or equal to storage_slots * ore.w_class
|
||||
max_storage_space = 200 //Doesn't matter what this is, so long as it's more or equal to storage_slots * ore.w_class
|
||||
max_w_class = 3
|
||||
can_hold = list(/obj/item/weapon/ore)
|
||||
|
||||
@@ -91,7 +91,7 @@
|
||||
icon = 'icons/obj/hydroponics_machines.dmi'
|
||||
icon_state = "plantbag"
|
||||
storage_slots = 50; //the number of plant pieces it can carry.
|
||||
max_combined_w_class = 200 //Doesn't matter what this is, so long as it's more or equal to storage_slots * plants.w_class
|
||||
max_storage_space = 200 //Doesn't matter what this is, so long as it's more or equal to storage_slots * plants.w_class
|
||||
max_w_class = 3
|
||||
w_class = 2
|
||||
can_hold = list(/obj/item/weapon/reagent_containers/food/snacks/grown,/obj/item/seeds,/obj/item/weapon/grown)
|
||||
@@ -249,7 +249,7 @@
|
||||
icon_state = "cashbag"
|
||||
desc = "A bag for carrying lots of cash. It's got a big dollar sign printed on the front."
|
||||
storage_slots = 50; //the number of cash pieces it can carry.
|
||||
max_combined_w_class = 200 //Doesn't matter what this is, so long as it's more or equal to storage_slots * cash.w_class
|
||||
max_storage_space = 200 //Doesn't matter what this is, so long as it's more or equal to storage_slots * cash.w_class
|
||||
max_w_class = 3
|
||||
w_class = 2
|
||||
can_hold = list(/obj/item/weapon/coin,/obj/item/weapon/spacecash)
|
||||
|
||||
@@ -94,7 +94,7 @@
|
||||
item_state = "security"
|
||||
storage_slots = 7
|
||||
max_w_class = 3
|
||||
max_combined_w_class = 21
|
||||
max_storage_space = 28
|
||||
can_hold = list(
|
||||
/obj/item/weapon/grenade,
|
||||
/obj/item/weapon/reagent_containers/spray/pepper,
|
||||
@@ -154,4 +154,4 @@
|
||||
item_state = "swatbelt"
|
||||
storage_slots = 9
|
||||
max_w_class = 3
|
||||
max_combined_w_class = 21
|
||||
max_storage_space = 28
|
||||
|
||||
@@ -564,7 +564,7 @@
|
||||
foldable = /obj/item/stack/sheet/cardboard //BubbleWrap
|
||||
storage_slots=21
|
||||
can_hold = list(/obj/item/weapon/light/tube, /obj/item/weapon/light/bulb)
|
||||
max_combined_w_class = 42 //holds 21 items of w_class 2
|
||||
max_storage_space = 42 //holds 21 items of w_class 2
|
||||
use_to_pickup = 1 // for picking up broken bulbs, not that most people will try
|
||||
|
||||
/obj/item/weapon/storage/box/lights/bulbs/New()
|
||||
|
||||
@@ -7,9 +7,9 @@
|
||||
force = 8.0
|
||||
throw_speed = 1
|
||||
throw_range = 4
|
||||
w_class = 4.0
|
||||
w_class = 4
|
||||
max_w_class = 3
|
||||
max_combined_w_class = 16
|
||||
max_storage_space = 16
|
||||
|
||||
/obj/item/weapon/storage/briefcase/New()
|
||||
..()
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
icon_type = "egg"
|
||||
name = "egg box"
|
||||
storage_slots = 12
|
||||
max_combined_w_class = 24
|
||||
max_storage_space = 24
|
||||
can_hold = list(/obj/item/weapon/reagent_containers/food/snacks/egg)
|
||||
|
||||
/obj/item/weapon/storage/fancy/egg_box/New()
|
||||
@@ -254,9 +254,9 @@
|
||||
icon = 'icons/obj/vialbox.dmi'
|
||||
icon_state = "vialbox0"
|
||||
item_state = "syringe_kit"
|
||||
max_w_class = 3
|
||||
max_w_class = 2
|
||||
can_hold = list(/obj/item/weapon/reagent_containers/glass/beaker/vial)
|
||||
max_combined_w_class = 14 //The sum of the w_classes of all the items in this storage item.
|
||||
max_storage_space = 12 //The sum of the w_classes of all the items in this storage item.
|
||||
storage_slots = 6
|
||||
req_access = list(access_virology)
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
item_state = "syringe_kit"
|
||||
w_class = 4
|
||||
max_w_class = 3
|
||||
max_combined_w_class = 14 //The sum of the w_classes of all the items in this storage item.
|
||||
max_storage_space = 14 //The sum of the w_classes of all the items in this storage item.
|
||||
storage_slots = 4
|
||||
req_access = list(access_armory)
|
||||
var/locked = 1
|
||||
|
||||
@@ -23,9 +23,9 @@
|
||||
var/l_hacking = 0
|
||||
var/emagged = 0
|
||||
var/open = 0
|
||||
w_class = 3.0
|
||||
w_class = 3
|
||||
max_w_class = 2
|
||||
max_combined_w_class = 14
|
||||
max_storage_space = 14
|
||||
|
||||
examine(mob/user)
|
||||
if(..(user, 1))
|
||||
|
||||
@@ -8,11 +8,11 @@
|
||||
/obj/item/weapon/storage
|
||||
name = "storage"
|
||||
icon = 'icons/obj/storage.dmi'
|
||||
w_class = 3.0
|
||||
w_class = 3
|
||||
var/list/can_hold = new/list() //List of objects which this item can store (if set, it can't store anything else)
|
||||
var/list/cant_hold = new/list() //List of objects which this item can't store (in effect only if can_hold isn't set)
|
||||
var/max_w_class = 2 //Max size of objects that this object can store (in effect only if can_hold isn't set)
|
||||
var/max_combined_w_class = 14 //The sum of the w_classes of all the items in this storage item.
|
||||
var/max_storage_space = 14 //The sum of the storage costs of all the items in this storage item.
|
||||
var/storage_slots = 7 //The number of storage slots in this container.
|
||||
var/obj/screen/storage/boxes = null
|
||||
var/obj/screen/close/closer = null
|
||||
@@ -226,16 +226,17 @@
|
||||
usr << "<span class='notice'>[W] is too big for this [src].</span>"
|
||||
return 0
|
||||
|
||||
var/sum_w_class = W.w_class
|
||||
var/total_storage_space = W.get_storage_cost()
|
||||
for(var/obj/item/I in contents)
|
||||
sum_w_class += I.w_class //Adds up the combined w_classes which will be in the storage item if the item is added to it.
|
||||
total_storage_space += I.get_storage_cost() //Adds up the combined w_classes which will be in the storage item if the item is added to it.
|
||||
|
||||
if(sum_w_class > max_combined_w_class)
|
||||
if(total_storage_space > max_storage_space)
|
||||
if(!stop_messages)
|
||||
usr << "<span class='notice'>[src] is full, make some space.</span>"
|
||||
return 0
|
||||
|
||||
if(W.w_class >= src.w_class && (istype(W, /obj/item/weapon/storage)))
|
||||
//TODO: remove hack
|
||||
if(!istype(src, /obj/item/weapon/storage/backpack/holding)) //bohs should be able to hold backpacks again. The override for putting a boh in a boh is in backpack.dm.
|
||||
if(!stop_messages)
|
||||
usr << "<span class='notice'>[src] cannot hold [W] as it's a storage item of the same size.</span>"
|
||||
@@ -265,7 +266,7 @@
|
||||
usr << "<span class='notice'>You put \the [W] into [src].</span>"
|
||||
else if (M in range(1)) //If someone is standing close enough, they can tell what it is...
|
||||
M.show_message("<span class='notice'>[usr] puts [W] into [src].</span>")
|
||||
else if (W && W.w_class >= 3.0) //Otherwise they can only see large or normal items from a distance...
|
||||
else if (W && W.w_class >= 3) //Otherwise they can only see large or normal items from a distance...
|
||||
M.show_message("<span class='notice'>[usr] puts [W] into [src].</span>")
|
||||
|
||||
src.orient2hud(usr)
|
||||
@@ -486,3 +487,6 @@
|
||||
return -1 //inside something with a null loc.
|
||||
|
||||
return depth
|
||||
|
||||
/obj/item/proc/get_storage_cost()
|
||||
return 2**(w_class-1) //1,2,4,8,16,...
|
||||
@@ -3,7 +3,7 @@
|
||||
desc = "A folded membrane which rapidly expands into a large cubical shape on activation."
|
||||
icon = 'icons/obj/inflatable.dmi'
|
||||
icon_state = "folded_wall"
|
||||
w_class = 3.0
|
||||
w_class = 3
|
||||
|
||||
attack_self(mob/user)
|
||||
playsound(loc, 'sound/items/zip.ogg', 75, 1)
|
||||
@@ -252,7 +252,7 @@
|
||||
desc = "Contains inflatable walls and doors."
|
||||
icon_state = "inf_box"
|
||||
item_state = "syringe_kit"
|
||||
max_combined_w_class = 21
|
||||
max_storage_space = 28
|
||||
can_hold = list(/obj/item/inflatable)
|
||||
|
||||
New()
|
||||
|
||||
Reference in New Issue
Block a user