From 8e0a1e748c78e21340b690a69a240013166d6f66 Mon Sep 17 00:00:00 2001 From: Sun-Soaked <45698967+Sun-Soaked@users.noreply.github.com> Date: Sat, 5 Oct 2024 22:28:57 -0400 Subject: [PATCH] Volumetric Boxes (#3460) title ## 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. ## Why It's Good For The Game Extends volumetric storage coverage from 1(1) storage object, to 2. ## Changelog :cl: add: Boxes are now volumetric. Some special boxes have been adjusted. balance: small objects in volumetric storage are now slightly smaller /:cl: --- code/__DEFINES/storage.dm | 12 ++++---- code/game/objects/items/storage/boxes.dm | 38 ++++-------------------- 2 files changed, 12 insertions(+), 38 deletions(-) diff --git a/code/__DEFINES/storage.dm b/code/__DEFINES/storage.dm index cb657520e33f4..f8f7e1f10c5b1 100644 --- a/code/__DEFINES/storage.dm +++ b/code/__DEFINES/storage.dm @@ -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( @@ -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 diff --git a/code/game/objects/items/storage/boxes.dm b/code/game/objects/items/storage/boxes.dm index 57b574e39b7fa..29d2cd22dbbdc 100644 --- a/code/game/objects/items/storage/boxes.dm +++ b/code/game/objects/items/storage/boxes.dm @@ -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() @@ -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" @@ -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) @@ -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) @@ -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) @@ -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) @@ -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 @@ -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)