Skip to content

Commit

Permalink
Volumetric Boxes (#3460)
Browse files Browse the repository at this point in the history
title

<!-- Write **BELOW** The Headers and **ABOVE** The comments else it may
not be viewable. -->
<!-- You can view Contributing.MD for a detailed description of the pull
request process. -->

## About The Pull Request
See title. Enabler for Thgvr's future ammo box plans.

Many "specialized" boxes have become normal ones and are now less
volumous as a result.
Slight rebalance to volu sizes to make smaller objects slightly smaller,
because I accidentally made boxes much worse with the original stats

Next is first aid and toolboxes, maybe. 
<!-- Describe The Pull Request. Please be sure every change is
documented or this can delay review and even discourage maintainers from
merging your PR! -->

## Why It's Good For The Game
Extends volumetric storage coverage from 1(1) storage object, to 2.
<!-- Please add a short description of why you think these changes would
benefit the game. If you can't justify it in words, it might not be
worth adding. -->

## Changelog

:cl:
add: Boxes are now volumetric. Some special boxes have been adjusted.
balance: small objects in volumetric storage are now slightly smaller
/:cl:

<!-- Both :cl:'s are required for the changelog to work! You can put
your name to the right of the first :cl: if you want to overwrite your
GitHub username as author ingame. -->
<!-- You can use multiple of the same prefix (they're only used for the
icon ingame) and delete the unneeded ones. Despite some of the tags,
changelogs should generally represent how a player might be affected by
the changes rather than a summary of the PR's contents. -->
  • Loading branch information
Sun-Soaked authored Oct 6, 2024
1 parent 608589a commit 8e0a1e7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 38 deletions.
12 changes: 6 additions & 6 deletions code/__DEFINES/storage.dm
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@
// PLEASE KEEP ALL VOLUME DEFINES IN THIS FILE, it's going to be hell to keep track of them later.
#define DEFAULT_VOLUME_TINY 1
#define DEFAULT_VOLUME_SMALL 2
#define DEFAULT_VOLUME_NORMAL 6
#define DEFAULT_VOLUME_BULKY 12
#define DEFAULT_VOLUME_HUGE 24
#define DEFAULT_VOLUME_NORMAL 8
#define DEFAULT_VOLUME_BULKY 14
#define DEFAULT_VOLUME_HUGE 28
#define DEFAULT_VOLUME_GIGANTIC 48

GLOBAL_LIST_INIT(default_weight_class_to_volume, list(
Expand Down Expand Up @@ -80,9 +80,9 @@ GLOBAL_LIST_INIT(default_weight_class_to_volume, list(
#define MAX_WEIGHT_CLASS_DUFFEL WEIGHT_CLASS_BULKY

// max_volume for storages
#define STORAGE_VOLUME_CONTAINER_S DEFAULT_VOLUME_NORMAL //3 small items
#define STORAGE_VOLUME_CONTAINER_M (DEFAULT_VOLUME_NORMAL * 2) //6 small items
#define STORAGE_VOLUME_CONTAINER_S DEFAULT_VOLUME_NORMAL //4 small items
#define STORAGE_VOLUME_CONTAINER_M (DEFAULT_VOLUME_NORMAL * 2) //8 small items
#define STORAGE_VOLUME_SATCHEL (DEFAULT_VOLUME_NORMAL * 4) //4 normal items
#define STORAGE_VOLUME_BACKPACK (DEFAULT_VOLUME_NORMAL * 6) //6 normal items, or 3 bulky items
#define STORAGE_VOLUME_BACKPACK (DEFAULT_VOLUME_NORMAL * 6) //1.5x satchel, 3 bulky items
#define STORAGE_VOLUME_DUFFLEBAG (DEFAULT_VOLUME_NORMAL * 8) // 2 huge items, or 4 bulky items
#define STORAGE_VOLUME_BAG_OF_HOLDING (DEFAULT_VOLUME_NORMAL * 9) //1.5X backpack
38 changes: 6 additions & 32 deletions code/game/objects/items/storage/boxes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@
/obj/item/storage/box/ComponentInitialize()
. = ..()
var/datum/component/storage/STR = GetComponent(/datum/component/storage)
STR.storage_flags = STORAGE_FLAGS_VOLUME_DEFAULT
STR.max_volume = STORAGE_VOLUME_CONTAINER_S
STR.max_w_class = WEIGHT_CLASS_SMALL
STR.use_sound = 'sound/items/storage/briefcase.ogg'

/obj/item/storage/box/update_overlays()
Expand Down Expand Up @@ -477,11 +480,6 @@
for(var/i in 1 to 6)
new donktype(src)

/obj/item/storage/box/donkpockets/ComponentInitialize()
. = ..()
var/datum/component/storage/STR = GetComponent(/datum/component/storage)
STR.set_holdable(list(/obj/item/reagent_containers/food/snacks/donkpocket))

/obj/item/storage/box/donkpockets/donkpocketspicy
name = "box of spicy-flavoured donk-pockets"
icon_state = "donkpocketboxspicy"
Expand Down Expand Up @@ -519,12 +517,6 @@
illustration = null
var/cube_type = /obj/item/reagent_containers/food/snacks/monkeycube

/obj/item/storage/box/monkeycubes/ComponentInitialize()
. = ..()
var/datum/component/storage/STR = GetComponent(/datum/component/storage)
STR.max_items = 7
STR.set_holdable(list(/obj/item/reagent_containers/food/snacks/monkeycube))

/obj/item/storage/box/monkeycubes/PopulateContents()
for(var/i in 1 to 5)
new cube_type(src)
Expand All @@ -539,12 +531,6 @@
icon_state = "monkeycubebox"
illustration = null

/obj/item/storage/box/gorillacubes/ComponentInitialize()
. = ..()
var/datum/component/storage/STR = GetComponent(/datum/component/storage)
STR.max_items = 3
STR.set_holdable(list(/obj/item/reagent_containers/food/snacks/monkeycube))

/obj/item/storage/box/gorillacubes/PopulateContents()
for(var/i in 1 to 3)
new /obj/item/reagent_containers/food/snacks/monkeycube/gorilla(src)
Expand Down Expand Up @@ -676,12 +662,6 @@
icon = 'icons/obj/toy.dmi'
icon_state = "spbox"

/obj/item/storage/box/snappops/ComponentInitialize()
. = ..()
var/datum/component/storage/STR = GetComponent(/datum/component/storage)
STR.set_holdable(list(/obj/item/toy/snappop))
STR.max_items = 8

/obj/item/storage/box/snappops/PopulateContents()
SEND_SIGNAL(src, COMSIG_TRY_STORAGE_FILL_TYPE, /obj/item/toy/snappop)

Expand All @@ -697,12 +677,6 @@
pickup_sound = 'sound/items/handling/matchbox_pickup.ogg'
custom_price = 20

/obj/item/storage/box/matches/ComponentInitialize()
. = ..()
var/datum/component/storage/STR = GetComponent(/datum/component/storage)
STR.max_items = 10
STR.set_holdable(list(/obj/item/match))

/obj/item/storage/box/matches/PopulateContents()
SEND_SIGNAL(src, COMSIG_TRY_STORAGE_FILL_TYPE, /obj/item/match)

Expand All @@ -720,9 +694,10 @@
righthand_file = 'icons/mob/inhands/equipment/medical_righthand.dmi'
foldable = /obj/item/stack/sheet/cardboard //BubbleWrap

/obj/item/storage/box/lights/ComponentInitialize()
/obj/item/storage/box/lights/ComponentInitialize()//holy oversized box. this one can stay the way it is, for now
. = ..()
var/datum/component/storage/STR = GetComponent(/datum/component/storage)
STR.storage_flags = STORAGE_FLAGS_LEGACY_DEFAULT
STR.max_items = 21
STR.set_holdable(list(/obj/item/light/tube, /obj/item/light/bulb))
STR.max_combined_w_class = 21
Expand Down Expand Up @@ -1479,8 +1454,7 @@
/obj/item/storage/box/gum/ComponentInitialize()
. = ..()
var/datum/component/storage/STR = GetComponent(/datum/component/storage)
STR.set_holdable(list(/obj/item/reagent_containers/food/snacks/chewable/bubblegum))
STR.max_items = 4
STR.max_volume = (STORAGE_VOLUME_CONTAINER_S / 2)

/obj/item/storage/box/gum/PopulateContents()
for(var/i in 1 to 4)
Expand Down

0 comments on commit 8e0a1e7

Please sign in to comment.