Skip to content

Commit

Permalink
Borg Bag Fixes and Refactors
Browse files Browse the repository at this point in the history
  • Loading branch information
alsoandanswer committed Mar 8, 2025
1 parent 821326b commit 7335936
Show file tree
Hide file tree
Showing 39 changed files with 183 additions and 137 deletions.
8 changes: 5 additions & 3 deletions code/__DEFINES/inventory.dm
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
//in exchange for being limited in the w_class of items that will fit
#define BASE_STORAGE_CAPACITY(w_class) (7*(w_class-1))

#define DEFAULT_BACKPACK_STORAGE BASE_STORAGE_CAPACITY(5)
#define DEFAULT_LARGEBOX_STORAGE BASE_STORAGE_CAPACITY(4)
#define DEFAULT_BOX_STORAGE BASE_STORAGE_CAPACITY(3)
#define DEFAULT_HOLDING_STORAGE BASE_STORAGE_CAPACITY(9)
#define DEFAULT_DUFFELBAG_STORAGE BASE_STORAGE_CAPACITY(6)
#define DEFAULT_BACKPACK_STORAGE BASE_STORAGE_CAPACITY(5)
#define DEFAULT_LARGEBOX_STORAGE BASE_STORAGE_CAPACITY(4)
#define DEFAULT_BOX_STORAGE BASE_STORAGE_CAPACITY(3)
8 changes: 4 additions & 4 deletions code/defines/obj/weapon.dm
Original file line number Diff line number Diff line change
Expand Up @@ -526,11 +526,11 @@
w_class = WEIGHT_CLASS_HUGE
can_hold = list(/obj/item/stock_parts,/obj/item/reagent_containers/glass/beaker)
storage_slots = 50
use_to_pickup = 1
allow_quick_gather = 1
allow_quick_empty = 1
use_to_pickup = TRUE
allow_quick_gather = TRUE
allow_quick_empty = TRUE
collection_mode = 1
display_contents_with_number = 1
display_contents_with_number = TRUE
max_w_class = WEIGHT_CLASS_NORMAL
max_storage_space = 100

Expand Down
3 changes: 2 additions & 1 deletion code/game/objects/items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@

var/storage_cost

var/storage_slot_sort_by_name = FALSE

///Dimensions of the icon file used when this item is worn, eg: hats.dmi (32x32 sprite, 64x64 sprite, etc.). Allows inhands/worn sprites to be of any size, but still centered on a mob properly
var/worn_x_dimension = 32

Expand Down Expand Up @@ -223,7 +225,6 @@
///Used to override hardcoded clothing dmis in human clothing pr
var/icon_override


var/charge_failure_message = " cannot be recharged."
var/held_maptext

Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/vaurca.dm
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,11 @@
use_sound = 'sound/items/storage/wrapper.ogg'
open_sound = /singleton/sound_category/rip_sound
open_message = "You tear open the bag, breaking the vacuum seal."
make_exact_fit = TRUE

/obj/item/storage/box/fancy/vkrexi_swollen_organ/fill()
new /obj/item/reagent_containers/food/drinks/bottle/skyemok(src)
. = ..()
make_exact_fit()

/obj/item/storage/box/fancy/vkrexi_swollen_organ/attack_self(mob/user)
open(user)
Expand Down
3 changes: 2 additions & 1 deletion code/game/objects/items/weapons/cards_ids.dm
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@

/obj/item/card/update_icon()
var/matrix/tf = matrix()
if(istype(loc, /obj/item/storage))
var/obj/item/storage/S = loc
if(istype(S, /obj/item/storage) && !S.storage_slots)
tf.Turn(-90) //Vertical for storing compactly
tf.Translate(-1, 0) //Could do this with pixel_x but let's just update the appearance once.
transform = tf
Expand Down
20 changes: 5 additions & 15 deletions code/game/objects/items/weapons/storage/backpack.dm
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
icon_state = "holdingpack"
item_state = "holdingpack"
max_w_class = WEIGHT_CLASS_BULKY
max_storage_space = 56
max_storage_space = DEFAULT_HOLDING_STORAGE
storage_cost = 29
empty_delay = 0.8 SECOND

Expand All @@ -157,15 +157,6 @@
return 1
return ..()

/obj/item/storage/backpack/santabag
name = "\improper Santa's gift bag"
desc = "Space Santa uses this to deliver toys to all the nice children in space in Christmas! Wow, it's pretty big!"
icon_state = "giftbag0"
item_state = "giftbag"
w_class = WEIGHT_CLASS_BULKY
max_storage_space = 200 // can store a ton of shit!
empty_delay = 1 SECOND

/obj/item/storage/backpack/cultpack
name = "trophy rack"
desc = "It's useful for both carrying extra gear and proudly declaring your insanity."
Expand Down Expand Up @@ -395,7 +386,7 @@
icon = 'icons/obj/unathi_items.dmi'
icon_state = "hegemony_satchel"
item_state = "hegemony_satchel"
max_storage_space = 32
max_storage_space = DEFAULT_DUFFELBAG_STORAGE
allow_quick_empty = FALSE // Pouches 'n shit.

/obj/item/storage/backpack/satchel/eng
Expand Down Expand Up @@ -563,7 +554,7 @@
w_class = WEIGHT_CLASS_HUGE // to avoid recursive backpacks
slot_flags = SLOT_BACK
max_w_class = WEIGHT_CLASS_NORMAL
max_storage_space = 20
max_storage_space = DEFAULT_LARGEBOX_STORAGE
build_from_parts = TRUE
worn_overlay = "overlay"

Expand All @@ -580,7 +571,6 @@
desc = "A small, fashionable bag typically worn over the shoulder."
icon_state = "purse"
item_state = "purse"
max_storage_space = 16
straps = FALSE

// Duffel Bags
Expand All @@ -592,7 +582,7 @@
icon_state = "duffel"
item_state = "duffel"
slowdown = 1
max_storage_space = 38
max_storage_space = DEFAULT_DUFFELBAG_STORAGE
straps = TRUE

/obj/item/storage/backpack/duffel/cap
Expand Down Expand Up @@ -926,7 +916,7 @@
contained_sprite = FALSE
w_class = WEIGHT_CLASS_HUGE
slot_flags = SLOT_BACK
max_storage_space = 12
max_storage_space = DEFAULT_BOX_STORAGE
canremove = FALSE
species_restricted = list(BODYTYPE_VAURCA_BREEDER)
sprite_sheets = list(BODYTYPE_VAURCA_BREEDER = 'icons/mob/species/breeder/back.dmi')
Expand Down
20 changes: 13 additions & 7 deletions code/game/objects/items/weapons/storage/bags.dm
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@

// Generic non-item
/obj/item/storage/bag
allow_quick_gather = 1
allow_quick_empty = 1
display_contents_with_number = 0 // UNStABLE AS FuCK, turn on when it stops crashing clients
use_to_pickup = 1
allow_quick_gather = TRUE
allow_quick_empty = TRUE
display_contents_with_number = TRUE
use_to_pickup = TRUE
storage_slots = 7
slot_flags = SLOT_BELT
var/use_deferred = TRUE
icon = 'icons/obj/storage/bags.dmi'
Expand All @@ -40,7 +41,8 @@

w_class = WEIGHT_CLASS_BULKY
max_w_class = WEIGHT_CLASS_SMALL
max_storage_space = 56
storage_slots = 50
max_storage_space = DEFAULT_HOLDING_STORAGE
can_hold = null // any
cant_hold = list(/obj/item/disk/nuclear)
drop_sound = 'sound/items/drop/wrapper.ogg'
Expand Down Expand Up @@ -106,6 +108,7 @@
desc = "It's a very flimsy, very noisy alternative to a bag."
icon_state = "plasticbag"
item_state = "plasticbag"
storage_slots = null
w_class = WEIGHT_CLASS_BULKY
max_w_class = WEIGHT_CLASS_SMALL
can_hold = null // any
Expand All @@ -122,11 +125,15 @@
desc = "For storing your stems, seeds, buds, and any other illicit substances."
icon_state = "plantbag"
item_state = "plantbag"
storage_slots = 50
max_storage_space = 100
max_w_class = WEIGHT_CLASS_NORMAL
w_class = WEIGHT_CLASS_SMALL
can_hold = list(/obj/item/reagent_containers/food/snacks/grown,/obj/item/seeds,/obj/item/grown)

/obj/item/storage/bag/plants/full
starts_with = list(/obj/random_produce/box = 50)

// -----------------------------
// Sheet Snatcher
// -----------------------------
Expand All @@ -142,7 +149,7 @@
w_class = WEIGHT_CLASS_NORMAL
storage_slots = 7

allow_quick_empty = 1 // this function is superceded
allow_quick_empty = TRUE // this function is superceded
use_deferred = FALSE

/obj/item/storage/bag/sheetsnatcher/can_be_inserted(obj/item/W as obj, stop_messages = 0)
Expand Down Expand Up @@ -303,7 +310,6 @@
name = "book bag"
desc = "A bag for books."
icon_state = "bookbag"
storage_slots = 7
max_storage_space = 200
max_w_class = WEIGHT_CLASS_NORMAL
w_class = WEIGHT_CLASS_NORMAL
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/weapons/storage/belt.dm
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@
item_state = "militarybelt"
storage_slots = 9 //same as a combat belt now
max_w_class = WEIGHT_CLASS_NORMAL
max_storage_space = 28
max_storage_space = DEFAULT_BACKPACK_STORAGE
can_hold = list(
/obj/item/grenade,
/obj/item/handcuffs,
Expand Down
42 changes: 15 additions & 27 deletions code/game/objects/items/weapons/storage/boxes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -454,10 +454,7 @@
name = "box of tethering devices"
desc = "A box containing eight electro-tethers, used primarily to keep track of partners during expeditions."
starts_with = list(/obj/item/tethering_device = 8)

/obj/item/storage/box/tethers/fill()
..()
make_exact_fit()
make_exact_fit = TRUE

/obj/item/storage/box/teargas
name = "box of pepperspray grenades"
Expand Down Expand Up @@ -609,7 +606,7 @@
/obj/item/storage/box/janitorgloves
name = "janitorial gloves box"
desc = "A box full of janitorial gloves of all shapes and sizes."
max_storage_space = 4
make_exact_fit = TRUE
can_hold = list(
/obj/item/clothing/gloves/janitor
)
Expand All @@ -626,10 +623,10 @@
desc_extended = "The manufacture of a cubed animal produces subjects that are similar but have marked differences compared to their ordinary cousins. Higher brain functions are all but destroyed \
and the life expectancy of the cubed animal is greatly reduced, with most expiring only a few days after introduction with water."
icon_state = "monkeycubebox"
illustration = null
can_hold = list(/obj/item/reagent_containers/food/snacks/monkeycube)
starts_with = list(/obj/item/reagent_containers/food/snacks/monkeycube/wrapped = 5)


/obj/item/storage/box/monkeycubes/farwacubes
name = "farwa cube box"
desc = "Drymate brand farwa cubes, shipped from Adhomai. Just add water!"
Expand Down Expand Up @@ -716,11 +713,8 @@
name = "box of replacement bulbs"
illustration = "light"
desc = "This box is shaped on the inside so that only light tubes and bulbs fit."
use_to_pickup = 1 // for picking up broken bulbs, not that most people will try

/obj/item/storage/box/lights/Initialize() // TODO-STORAGE: Initialize()?
. = ..()
make_exact_fit()
use_to_pickup = TRUE // for picking up broken bulbs, not that most people will try
make_exact_fit = TRUE

/obj/item/storage/box/lights/bulbs
starts_with = list(/obj/item/light/bulb = 21)
Expand Down Expand Up @@ -918,17 +912,15 @@
icon_state = "largebox"
illustration = "fruit"
starts_with = list(/obj/random_produce/box = 15)

/obj/item/storage/box/produce/fill()
. = ..()
make_exact_fit()
make_exact_fit = TRUE


/obj/item/storage/box/candy
name = "candy box"
desc = "A large box of assorted small candy."
icon_state = "largebox"
illustration = "writing_large"
make_exact_fit = TRUE

/obj/item/storage/box/candy/fill()
var/list/assorted_list = list(
Expand All @@ -948,8 +940,6 @@
var/chosen_candy = pickweight(assorted_list)
new chosen_candy(src)

make_exact_fit()


/obj/item/storage/box/crabmeat
name = "box of crab legs"
Expand Down Expand Up @@ -1072,7 +1062,7 @@
illustration = null
icon_state = "sharpsbox"
use_sound = 'sound/items/storage/briefcase.ogg'
max_storage_space = 20
max_storage_space = DEFAULT_LARGEBOX_STORAGE
chewable = FALSE
foldable = null

Expand All @@ -1084,7 +1074,7 @@
/obj/item/storage/box/aggression
desc_antag = "This box contains various implants that will make their owners increasingly aggressive."
illustration = "implant"
max_storage_space = 12
max_storage_space = DEFAULT_BOX_STORAGE
starts_with = list(/obj/item/implantcase/aggression = 6, /obj/item/implanter = 1, /obj/item/implantpad = 1)

/obj/item/storage/box/encryption_key
Expand Down Expand Up @@ -1213,7 +1203,7 @@
icon_state = "largebox"
illustration = "flare"
foldable = FALSE
max_storage_space = 12
max_storage_space = DEFAULT_BOX_STORAGE
can_hold = list(
/obj/item/device/flashlight/flare
)
Expand All @@ -1228,7 +1218,7 @@
w_class = WEIGHT_CLASS_BULKY
max_w_class = WEIGHT_CLASS_NORMAL
foldable = FALSE
max_storage_space = 16
max_storage_space = DEFAULT_BOX_STORAGE
can_hold = list(
/obj/item/device/magnetic_lock
)
Expand All @@ -1241,7 +1231,7 @@
name = "power cell box"
desc = "A box full of power cells."
foldable = FALSE
max_storage_space = 6
make_exact_fit = TRUE
can_hold = list(
/obj/item/cell
)
Expand Down Expand Up @@ -1281,19 +1271,17 @@
desc = "A box of advanced formula chemical tablets designed by Idris Incorporated."
desc_extended = "A new generation of cleaning chemicals, according to Idris at least. The instructions on the box reads: \"Dissolve tablet fully in container of water\". A warning label mentions that you should not consume the tablets nor drink the mixture after dissolving them."
illustration = "soapbucket"
max_storage_space = 16
starts_with = list(
/obj/item/reagent_containers/pill/cleaner_tablet = 16
)
make_exact_fit = TRUE

/obj/item/storage/box/led_collars
name = "box of LED collars"
desc = "A box containing eight LED collars, usually worn around the neck of the voidsuit."
starts_with = list(/obj/item/clothing/accessory/led_collar = 8)
make_exact_fit = TRUE

/obj/item/storage/box/led_collars/fill()
..()
make_exact_fit()
/obj/item/storage/box/traps/punji
name = "box of punji traps"
desc = "A box containing 5 punji traps."
Expand Down Expand Up @@ -1328,7 +1316,7 @@
drop_sound = 'sound/items/drop/metal_pot.ogg'
pickup_sound = 'sound/items/drop/metal_pot.ogg'
contained_sprite = TRUE
max_storage_space = 1
make_exact_fit = TRUE
can_hold = list(
/obj/item/reagent_containers/food/snacks/grown/konyang_tea
)
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/weapons/storage/briefcase.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
throw_range = 4
w_class = WEIGHT_CLASS_BULKY
max_w_class = WEIGHT_CLASS_NORMAL
max_storage_space = 16
max_storage_space = DEFAULT_LARGEBOX_STORAGE
use_sound = 'sound/items/storage/briefcase.ogg'
drop_sound = 'sound/items/drop/backpack.ogg'
pickup_sound = 'sound/items/pickup/backpack.ogg'
Expand Down
Loading

0 comments on commit 7335936

Please sign in to comment.