diff --git a/citadel.dme b/citadel.dme index 5633b589a42..b131df8de8d 100644 --- a/citadel.dme +++ b/citadel.dme @@ -52,7 +52,6 @@ #include "code\__DEFINES\icon_smoothing.dm" #include "code\__DEFINES\ingredients.dm" #include "code\__DEFINES\instruments.dm" -#include "code\__DEFINES\inventory_storage.dm" #include "code\__DEFINES\is_helpers.dm" #include "code\__DEFINES\items_clothing.dm" #include "code\__DEFINES\loadout.dm" @@ -87,7 +86,6 @@ #include "code\__DEFINES\spells.dm" #include "code\__DEFINES\stat_tracking.dm" #include "code\__DEFINES\statpanel.dm" -#include "code\__DEFINES\storage.dm" #include "code\__DEFINES\targeting.dm" #include "code\__DEFINES\text.dm" #include "code\__DEFINES\tgs.config.dm" @@ -162,7 +160,6 @@ #include "code\__DEFINES\dcs\signals\signals_fish.dm" #include "code\__DEFINES\dcs\signals\signals_global.dm" #include "code\__DEFINES\dcs\signals\signals_object.dm" -#include "code\__DEFINES\dcs\signals\signals_storage.dm" #include "code\__DEFINES\dcs\signals\signals_turf.dm" #include "code\__DEFINES\dcs\signals\datums\signals_beam.dm" #include "code\__DEFINES\dcs\signals\datums\signals_perspective.dm" @@ -185,6 +182,8 @@ #include "code\__DEFINES\dcs\signals\signals_atom\tool_system.dm" #include "code\__DEFINES\dcs\signals\signals_item\signals_item_economy.dm" #include "code\__DEFINES\dcs\signals\signals_item\signals_item_inventory.dm" +#include "code\__DEFINES\dcs\signals\signals_item\signals_item_mouse.dm" +#include "code\__DEFINES\dcs\signals\signals_item\signals_item_storage.dm" #include "code\__DEFINES\dcs\signals\signals_mob\signals_mob_appearance.dm" #include "code\__DEFINES\dcs\signals\signals_mob\signals_mob_combat.dm" #include "code\__DEFINES\dcs\signals\signals_mob\signals_mob_defense.dm" @@ -209,6 +208,7 @@ #include "code\__DEFINES\inventory\procs.dm" #include "code\__DEFINES\inventory\rendering.dm" #include "code\__DEFINES\inventory\slots.dm" +#include "code\__DEFINES\inventory\storage.dm" #include "code\__DEFINES\items\hypospray.dm" #include "code\__DEFINES\items\inducer.dm" #include "code\__DEFINES\items\nifs.dm" @@ -367,6 +367,7 @@ #include "code\__HELPERS\files\hashing.dm" #include "code\__HELPERS\files\paths.dm" #include "code\__HELPERS\files\walk.dm" +#include "code\__HELPERS\game\depth.dm" #include "code\__HELPERS\graphs\astar.dm" #include "code\__HELPERS\icons\alpha.dm" #include "code\__HELPERS\icons\color.dm" @@ -1663,25 +1664,25 @@ #include "code\game\objects\items\stock_parts\part_replacer.dm" #include "code\game\objects\items\stock_parts\scanning_module.dm" #include "code\game\objects\items\stock_parts\subspace.dm" -#include "code\game\objects\items\storage\_storage.dm" #include "code\game\objects\items\storage\backpack.dm" #include "code\game\objects\items\storage\bags.dm" #include "code\game\objects\items\storage\belt.dm" -#include "code\game\objects\items\storage\bible.dm" #include "code\game\objects\items\storage\boxes.dm" #include "code\game\objects\items\storage\briefcase.dm" -#include "code\game\objects\items\storage\fancy.dm" -#include "code\game\objects\items\storage\internal.dm" -#include "code\game\objects\items\storage\laundry_basket.dm" #include "code\game\objects\items\storage\lockbox.dm" -#include "code\game\objects\items\storage\misc.dm" #include "code\game\objects\items\storage\quickdraw.dm" #include "code\game\objects\items\storage\secure.dm" +#include "code\game\objects\items\storage\storage.dm" #include "code\game\objects\items\storage\toolbox.dm" #include "code\game\objects\items\storage\uplink_kits.dm" #include "code\game\objects\items\storage\wallets.dm" #include "code\game\objects\items\storage\medical\firstaid.dm" #include "code\game\objects\items\storage\medical\hypokit.dm" +#include "code\game\objects\items\storage\misc_legacy\bible.dm" +#include "code\game\objects\items\storage\misc_legacy\fancy.dm" +#include "code\game\objects\items\storage\misc_legacy\laundry_basket.dm" +#include "code\game\objects\items\storage\misc_legacy\misc.dm" +#include "code\game\objects\items\storage\misc_legacy\trinket_box.dm" #include "code\game\objects\items\storage\single_use\_single_use.dm" #include "code\game\objects\items\storage\single_use\med_pouch.dm" #include "code\game\objects\items\storage\single_use\mre.dm" @@ -1921,6 +1922,7 @@ #include "code\game\objects\structures\tables\update_triggers.dm" #include "code\game\objects\systems\_system.dm" #include "code\game\objects\systems\cell_slot.dm" +#include "code\game\objects\systems\storage.dm" #include "code\game\rendering\client.dm" #include "code\game\rendering\mob.dm" #include "code\game\rendering\screen.dm" diff --git a/code/__DEFINES/_planes+layers.dm b/code/__DEFINES/_planes+layers.dm index 1a8b3be02d6..0ee4c052792 100644 --- a/code/__DEFINES/_planes+layers.dm +++ b/code/__DEFINES/_planes+layers.dm @@ -341,17 +341,17 @@ */ #define VERTICALITY_PLANE 40 +/** + *! -- Camera Mask Plane + */ +#define CAMERA_MASK_PLANE 70 +#define CAMERA_MASK_LAYER_MAIN 1 + /** *! -- Fullscreen Plane *? Fullscreen overlays. */ -#define FULLSCREEN_PLANE 90 - -/** - *! -- Sonar Plane - *? Used for renders for effects like sonar / sensory things - */ -#define SONAR_PLANE 91 // 91 because 90 is the Blind plane, and you should be able to use your ears when your eyes don't work +#define FULLSCREEN_PLANE 75 #define FULLSCREEN_LAYER_OBFUSCATION 19.9 #define FULLSCREEN_LAYER_MAIN 20.1 @@ -361,10 +361,11 @@ #define FULLSCREEN_LAYER_CURSE 20.5 /** - *! -- Camera Mask Plane + *! -- Sonar Plane + *? Used for renders for effects like sonar / sensory things + * todo: this needs to be under fullscreen plane but above blind. */ -#define CAMERA_MASK_PLANE 92 -#define CAMERA_MASK_LAYER_MAIN 1 +#define SONAR_PLANE 80 /** *! -- Player HUD Plane @@ -373,13 +374,21 @@ * * todo: some layers are unused? */ -#define HUD_PLANE 95 +#define HUD_PLANE 90 #define HUD_LAYER_UNDER 1 /// Under the HUD items. #define HUD_LAYER_BASE 2 /// The HUD items themselves. #define HUD_LAYER_ITEM 3 /// Things sitting on HUD items (largely irrelevant because INVENTORY_PLANE). #define HUD_LAYER_ABOVE 4 /// Things that reside above items (highlights). +/** + *! -- Storage Plane + */ +#define STORAGE_PLANE 95 +#define STORAGE_LAYER_CONTAINER 1 +#define STORAGE_LAYER_ITEM_INACTIVE 2 +#define STORAGE_LAYER_ITEM_ACTIVE 3 + /** *! -- Player HUD Items Plane *? Separate layer with which to apply colorblindness. diff --git a/code/__DEFINES/combat/atom_damage.dm b/code/__DEFINES/combat/atom_damage.dm index 9c23b91e86d..d7176cdbe37 100644 --- a/code/__DEFINES/combat/atom_damage.dm +++ b/code/__DEFINES/combat/atom_damage.dm @@ -1,7 +1,8 @@ //* This file is explicitly licensed under the MIT license. *// //* Copyright (c) 2023 Citadel Station developers. *// -//! Atom destruction types, used in /deconstruct() and its derived/child/called functions. +//* Atom destruction types, used in /deconstruct() and its derived/child/called functions. + /// Atom was neatly deconstructed #define ATOM_DECONSTRUCT_DISASSEMBLED 0 /// Atom received excess kinetic energy, usually through weaponry diff --git a/code/__DEFINES/dcs/signals/signals_atom/context_system.dm b/code/__DEFINES/dcs/signals/signals_atom/context_system.dm index e765fd72e57..f6efa7cee46 100644 --- a/code/__DEFINES/dcs/signals/signals_atom/context_system.dm +++ b/code/__DEFINES/dcs/signals/signals_atom/context_system.dm @@ -9,12 +9,30 @@ #define RAISE_ATOM_CONTEXT_ACT_HANDLED (1<<0) /// create context +/// todo: this is deprecated, i think. /// * name: name /// * image: context menu image /// * distance: distance where this is valid; much be reachable or actable; null = requires adjacency or adjacency-equivalence /// * mobility: mobility flags required #define ATOM_CONTEXT_TUPLE(name, image, distance, mobility) list(name, image, distance, mobility) +/// Creates context list +/// +/// @params +/// * name: name +/// * image: context menu image +/// * distance: distance where this is valid; much be reachable or actable; null = requires adjacency or adjacency-equivalence +/// * mobility: mobility flags required +/// * defaultable: allow defaulting if this is the only thing in the list +/atom/proc/atom_context_tuple(name, image/I, distance, mobility, defaultable) + return list( + name, + I, + distance, + mobility, + defaultable, + ) + /// when used as distance, telekinetics and other things do not count as adjacency // todo: currently not implemented #define ATOM_CONTEXT_FORCE_PHYSICAL_ADJACENCY null diff --git a/code/__DEFINES/dcs/signals/signals_atom/signals_atom_main.dm b/code/__DEFINES/dcs/signals/signals_atom/signals_atom_main.dm index c8275ee9125..094fcc59349 100644 --- a/code/__DEFINES/dcs/signals/signals_atom/signals_atom_main.dm +++ b/code/__DEFINES/dcs/signals/signals_atom/signals_atom_main.dm @@ -20,8 +20,6 @@ #define EXAMINE_POSITION_BEFORE (1<<1) //*End positions #define COMPONENT_EXNAME_CHANGED (1<<0) -/// From base of atom/handle_atom_del(): (atom/deleted) -////#define COMSIG_ATOM_CONTENTS_DEL "atom_contents_del" /// From base of atom/has_gravity(): (turf/location, list/forced_gravities) ////#define COMSIG_ATOM_HAS_GRAVITY "atom_has_gravity" /// For when an atom has been created through processing (atom/original_atom, list/chosen_processing_option) diff --git a/code/__DEFINES/dcs/signals/signals_atom/signals_atom_mouse.dm b/code/__DEFINES/dcs/signals/signals_atom/signals_atom_mouse.dm index 4fc3bb966e9..3144e0bf47e 100644 --- a/code/__DEFINES/dcs/signals/signals_atom/signals_atom_mouse.dm +++ b/code/__DEFINES/dcs/signals/signals_atom/signals_atom_mouse.dm @@ -17,9 +17,6 @@ /// From base of atom/AltClick(): (/mob) #define COMSIG_CLICK_ALT "alt_click" #define COMPONENT_CANCEL_CLICK_ALT (1<<0) -/// From base of atom/alt_click_secondary(): (/mob) -////#define COMSIG_CLICK_ALT_SECONDARY "alt_click_secondary" - ////#define COMPONENT_CANCEL_CLICK_ALT_SECONDARY (1<<0) /// From base of atom/CtrlShiftClick(/mob) ////#define COMSIG_CLICK_CTRL_SHIFT "ctrl_shift_click" /// From base of atom/OnMouseDrop(): (/atom/over, /mob/user, proximity, params) diff --git a/code/__DEFINES/dcs/signals/signals_item/signals_item_mouse.dm b/code/__DEFINES/dcs/signals/signals_item/signals_item_mouse.dm new file mode 100644 index 00000000000..8da932980c2 --- /dev/null +++ b/code/__DEFINES/dcs/signals/signals_item/signals_item_mouse.dm @@ -0,0 +1,8 @@ +//* This file is explicitly licensed under the MIT license. *// +//* Copyright (c) 2023 Citadel Station developers. *// + +/// from base of item/MouseEntered: (usr) +#define COMSIG_ITEM_MOUSE_ENTERED "item_mouse_enter" + +/// from base of item/MouseExited: (usr) +#define COMSIG_ITEM_MOUSE_EXITED "item_mouse_exit" diff --git a/code/__DEFINES/dcs/signals/signals_item/signals_item_storage.dm b/code/__DEFINES/dcs/signals/signals_item/signals_item_storage.dm new file mode 100644 index 00000000000..6d20c5c5a73 --- /dev/null +++ b/code/__DEFINES/dcs/signals/signals_item/signals_item_storage.dm @@ -0,0 +1,5 @@ + +/// From base of obj/item/on_enter_storage(): (datum/object_system/storage/storage) +#define COMSIG_STORAGE_ENTERED "storage_entered" +/// From base of obj/item/on_exit_storage(): (datum/object_system/storage/storage) +#define COMSIG_STORAGE_EXITED "storage_exited" diff --git a/code/__DEFINES/dcs/signals/signals_storage.dm b/code/__DEFINES/dcs/signals/signals_storage.dm deleted file mode 100644 index bf62464b86a..00000000000 --- a/code/__DEFINES/dcs/signals/signals_storage.dm +++ /dev/null @@ -1,38 +0,0 @@ -/** - *! ## Storage Signals. Format: - * * When the signal is called: (signal arguments) - * * All signals send the source datum of the signal as the first argument - */ - -//! /datum/component/storage Signals -/// () - returns bool. -////#define COMSIG_CONTAINS_STORAGE "is_storage" -/// (obj/item/inserting, mob/user, silent, force) - returns bool -////#define COMSIG_TRY_STORAGE_INSERT "storage_try_insert" -/// (mob/show_to, force) - returns bool. -////#define COMSIG_TRY_STORAGE_SHOW "storage_show_to" -/// (mob/hide_from) - returns bool -////#define COMSIG_TRY_STORAGE_HIDE_FROM "storage_hide_from" -/// Returns bool -////#define COMSIG_TRY_STORAGE_HIDE_ALL "storage_hide_all" -/// (newstate) -////#define COMSIG_TRY_STORAGE_SET_LOCKSTATE "storage_lock_set_state" -/// () - returns bool. MUST CHECK IF STORAGE IS THERE FIRST! -////#define COMSIG_IS_STORAGE_LOCKED "storage_get_lockstate" -/// (type, atom/destination, amount = INFINITY, check_adjacent, force, mob/user, list/inserted) - returns bool - type can be a list of types. -////#define COMSIG_TRY_STORAGE_TAKE_TYPE "storage_take_type" -/// (type, amount = INFINITY, force = FALSE). Force will ignore max_items, and amount is normally clamped to max_items. -////#define COMSIG_TRY_STORAGE_FILL_TYPE "storage_fill_type" -/// (obj, new_loc, force = FALSE) - returns bool -////#define COMSIG_TRY_STORAGE_TAKE "storage_take_obj" -/// (loc) - returns bool - if loc is null it will dump at parent location. -////#define COMSIG_TRY_STORAGE_QUICK_EMPTY "storage_quick_empty" -/// (list/list_to_inject_results_into, recursively_search_inside_storages = TRUE) -////#define COMSIG_TRY_STORAGE_RETURN_INVENTORY "storage_return_inventory" -/// (obj/item/insertion_candidate, mob/user, silent) - returns bool -////#define COMSIG_TRY_STORAGE_CAN_INSERT "storage_can_equip" - -/// From base of atom/movable/on_enter_storage(): (datum/component/storage/concrete/master_storage) -#define COMSIG_STORAGE_ENTERED "storage_entered" -/// From base of atom/movable/on_exit_storage(): (datum/component/storage/concrete/master_storage) -#define COMSIG_STORAGE_EXITED "storage_exited" diff --git a/code/__DEFINES/inventory/misc.dm b/code/__DEFINES/inventory/misc.dm index e15f079e3d2..8bbf978e80a 100644 --- a/code/__DEFINES/inventory/misc.dm +++ b/code/__DEFINES/inventory/misc.dm @@ -1,3 +1,4 @@ // proc: dropped() on /obj/item +// todo: this should be in procs.dm and the names need to be changed probably /// relocated; return false #define ITEM_RELOCATED_BY_DROPPED -1 diff --git a/code/__DEFINES/inventory/storage.dm b/code/__DEFINES/inventory/storage.dm new file mode 100644 index 00000000000..763ae099df2 --- /dev/null +++ b/code/__DEFINES/inventory/storage.dm @@ -0,0 +1,91 @@ +//* This file is explicitly licensed under the MIT license. *// +//* Copyright (c) 2023 Citadel Station developers. *// + +//* Storage UI defines *// + +/// Size of volumetric box icon +#define VOLUMETRIC_STORAGE_BOX_ICON_SIZE 32 +/// Size of EACH left/right border icon for volumetric boxes +#define VOLUMETRIC_STORAGE_BOX_BORDER_SIZE 2 +/// Minimum pixels an item must have in volumetric scaled storage UI +/// This must not be smaller than BOX_BORDER_SIZE * 2. +#define VOLUMETRIC_STORAGE_MINIMUM_PIXELS_PER_ITEM 6 +/// Maximum number of objects that will be allowed to be displayed using the volumetric display system. Arbitrary number to prevent server lockups. +#define VOLUMETRIC_STORAGE_MAX_ITEMS 128 +/// How much padding to give between items +#define VOLUMETRIC_STORAGE_ITEM_PADDING 1 +/// How much padding to give to edges +#define VOLUMETRIC_STORAGE_EDGE_PADDING 0 +/// Standard pixel width ratio for volumetric storage; 1 volume converts into this many pixels. +#define VOLUMETRIC_STORAGE_STANDARD_PIXEL_RATIO 8 + +//* Storage access *// + +#define STORAGE_REACH_DEPTH 3 + +//* Storage quick gather modes *// + +/// one at a time on click +#define STORAGE_QUICK_GATHER_COLLECT_ONE 1 +/// all on tile +#define STORAGE_QUICK_GATHER_COLLECT_ALL 2 +/// same typepath +#define STORAGE_QUICK_GATHER_COLLECT_SAME 3 + +//* Storage UI - we shouldn't hardcode this but I don't care. *// +// todo: we should care + +#define STORAGE_UI_START_TILE_X 3 +#define STORAGE_UI_START_TILE_Y 1 +#define STORAGE_UI_START_PIXEL_X 16 +#define STORAGE_UI_START_PIXEL_Y 16 +#define STORAGE_UI_TILES_FOR_SCREEN_VIEW_X(X) max(4, X - 8) +#define STORAGE_UI_MAX_ROWS 5 + +//* w_class *// + +// ITEM INVENTORY WEIGHT, FOR w_class +// todo: lmao this is so outdated, semantically +// keep this 1 to n, and make sure w_class_to_volume is updated. + +#define WEIGHT_CLASS_MIN 0 +#define WEIGHT_CLASS_MAX 6 + +/// Usually items smaller then a human hand, ex: Playing Cards, Lighter, Scalpel, Coins/Money +#define WEIGHT_CLASS_TINY 1 +/// Pockets can hold small and tiny items, ex: Flashlight, Multitool, Grenades, GPS Device +#define WEIGHT_CLASS_SMALL 2 +/// Standard backpacks can carry tiny, small & normal items, ex: Fire extinguisher, Stunbaton, Gas Mask, Metal Sheets +#define WEIGHT_CLASS_NORMAL 3 +/// Items that can be weilded or equipped but not stored in a normal bag, ex: Defibrillator, Backpack, Space Suits +#define WEIGHT_CLASS_BULKY 4 +/// Usually represents objects that require two hands to operate, ex: Shotgun, Two Handed Melee Weapons - Can not fit in Boh +#define WEIGHT_CLASS_HUGE 5 +/// Essentially means it cannot be picked up or placed in an inventory, ex: Mech Parts, Safe - Can not fit in Boh +#define WEIGHT_CLASS_GIGANTIC 6 + +//* Volumetrics - Default Item Volumes *// + +#define WEIGHT_VOLUME_TINY 1 +#define WEIGHT_VOLUME_SMALL 2 +#define WEIGHT_VOLUME_NORMAL 4 +#define WEIGHT_VOLUME_BULKY 8 +#define WEIGHT_VOLUME_HUGE 16 +#define WEIGHT_VOLUME_GIGANTIC 32 + +GLOBAL_REAL_LIST(w_class_to_volume) = list( + WEIGHT_VOLUME_TINY, + WEIGHT_VOLUME_SMALL, + WEIGHT_VOLUME_NORMAL, + WEIGHT_VOLUME_BULKY, + WEIGHT_VOLUME_HUGE, + WEIGHT_VOLUME_GIGANTIC, +) + +//* Volumetrics - Storage Volumes *// + +#define STORAGE_VOLUME_BOX (WEIGHT_VOLUME_SMALL * 7) +#define STORAGE_VOLUME_BACKPACK (WEIGHT_VOLUME_NORMAL * 7) +#define STORAGE_VOLUME_DUFFLEBAG (WEIGHT_VOLUME_NORMAL * 9) + +//* Volumetrics - Item Volumes *// diff --git a/code/__DEFINES/inventory_storage.dm b/code/__DEFINES/inventory_storage.dm deleted file mode 100644 index 3801afbeb10..00000000000 --- a/code/__DEFINES/inventory_storage.dm +++ /dev/null @@ -1,41 +0,0 @@ -// The below should be used to define an item's w_class variable. -// Example: w_class = ITENSIZE_LARGE -// This allows the addition of future w_classes without needing to change every file. -#define ITEMSIZE_TINY 1 -#define ITEMSIZE_SMALL 2 -#define ITEMSIZE_NORMAL 3 -#define ITEMSIZE_LARGE 4 -#define ITEMSIZE_HUGE 5 -//I am done with having to adjust these everytime I port something from bay or nebula -#define ITEM_SIZE_TINY 1 -#define ITEM_SIZE_SMALL 2 -#define ITEM_SIZE_NORMAL 3 -#define ITEM_SIZE_LARGE 4 -#define ITEM_SIZE_HUGE 5 -#define ITEM_SIZE_GARGANTUAN 6 -#define ITEM_SIZE_NO_CONTAINER 10 // Use this to forbid item from being placed in a container. -#define ITEM_SIZE_STRUCTURE 20 - -/// Use this to forbid item from being placed in a container. -#define ITEMSIZE_NO_CONTAINER 100 -// Tweak these to determine how much space an item takes in a container. -// Look in storage.dm for get_storage_cost(), which uses these. Containers also use these as a reference for size. -// ITEMSIZE_COST_NORMAL is equivalent to one slot using the old inventory system. As such, it is a nice reference to use for -// defining how much space there is in a container. -#define ITEMSIZE_COST_TINY 1 -#define ITEMSIZE_COST_SMALL 2 -#define ITEMSIZE_COST_NORMAL 4 -#define ITEMSIZE_COST_LARGE 8 -#define ITEMSIZE_COST_HUGE 16 -#define ITEMSIZE_COST_NO_CONTAINER 1000 - -// Container sizes. Note that different containers can hold a maximum ITEMSIZE. -/// 28 -#define INVENTORY_STANDARD_SPACE ITEMSIZE_COST_NORMAL * 7 -/// 36 -#define INVENTORY_DUFFLEBAG_SPACE ITEMSIZE_COST_NORMAL * 10 -#define INVENTORY_BOX_SPACE ITEMSIZE_COST_SMALL * 7 - -//this all needs a refactor to tg storage but for now.. -///maximum you can reach down to grab things from storage. -#define MAX_STORAGE_REACH 2 diff --git a/code/__DEFINES/math.dm b/code/__DEFINES/math.dm index 2e190ce6173..c2f52b031aa 100644 --- a/code/__DEFINES/math.dm +++ b/code/__DEFINES/math.dm @@ -27,11 +27,14 @@ #define SIGN(x) ( (x)!=0 ? (x) / abs(x) : 0 ) -#define CEILING(x, y) ( -round(-(x) / (y)) * (y) ) - +/// ceil() #define ROUND_UP(x) ( -round(-(x))) +/// floor() +#define ROUND_DOWN(x) (round(x)) -// round() acts like floor(x, 1) by default but can't handle other values +// x to the nearest higher multiple of y +#define CEILING(x, y) ( -round(-(x) / (y)) * (y) ) +// x to the nearest lower multiple of y #define FLOOR(x, y) ( round((x) / (y)) * (y) ) // Similar to clamp but the bottom rolls around to the top and vice versa. min is inclusive, max is exclusive diff --git a/code/__DEFINES/storage.dm b/code/__DEFINES/storage.dm deleted file mode 100644 index 8c8743a66d3..00000000000 --- a/code/__DEFINES/storage.dm +++ /dev/null @@ -1,15 +0,0 @@ -// Defines related to item storage goes here. - -//ITEM INVENTORY WEIGHT, FOR w_class -///Usually items smaller then a human hand, ex: Playing Cards, Lighter, Scalpel, Coins/Money -#define WEIGHT_CLASS_TINY 1 -///Pockets can hold small and tiny items, ex: Flashlight, Multitool, Grenades, GPS Device -#define WEIGHT_CLASS_SMALL 2 -///Standard backpacks can carry tiny, small & normal items, ex: Fire extinguisher, Stunbaton, Gas Mask, Metal Sheets -#define WEIGHT_CLASS_NORMAL 3 -///Items that can be weilded or equipped but not stored in a normal bag, ex: Defibrillator, Backpack, Space Suits -#define WEIGHT_CLASS_BULKY 4 -///Usually represents objects that require two hands to operate, ex: Shotgun, Two Handed Melee Weapons - Can not fit in Boh -#define WEIGHT_CLASS_HUGE 5 -///Essentially means it cannot be picked up or placed in an inventory, ex: Mech Parts, Safe - Can not fit in Boh -#define WEIGHT_CLASS_GIGANTIC 6 diff --git a/code/__HELPERS/game.dm b/code/__HELPERS/game.dm index 02e4d4795af..e5511d5a9f6 100644 --- a/code/__HELPERS/game.dm +++ b/code/__HELPERS/game.dm @@ -1,13 +1,4 @@ -/proc/dopage(src, target) - var/href_list - var/href - href_list = params2list("src=\ref[src]&[target]=1") - href = "src=\ref[src];[target]=1" - src:temphtml = null - src:Topic(href, href_list) - return null - /proc/is_on_same_plane_or_station(z1, z2) if (z1 == z2) return TRUE @@ -394,25 +385,8 @@ return get_step(start, EAST) /proc/get_mob_by_key(key) - return GLOB.directory[ckey(key)] - -/** - * Will return a list of active candidates. - * It increases the buffer 5 times until it finds a candidate which is active within the buffer. - */ -/proc/get_active_candidates(buffer = 1) - - /// List of candidate KEYS to assume control of the new larva ~Carn - var/list/candidates = list() - var/i = 0 - while(candidates.len <= 0 && i < 5) - for(var/mob/observer/dead/G in GLOB.player_list) - // The most active players are more likely to become an alien. - if(((G.client.inactivity/10)/60) <= buffer + i) - if(!(G.mind && G.mind.current && G.mind.current.stat != DEAD)) - candidates += G.key - i++ - return candidates + var/client/found = GLOB.directory[ckey(key)] + return found?.mob /** * Same as above but for alien candidates. @@ -432,24 +406,6 @@ i++ return candidates -/proc/ScreenText(obj/O, maptext="", screen_loc="CENTER-7,CENTER-7", maptext_height=480, maptext_width=480) - if(!isobj(O)) O = new /atom/movable/screen/text() - O.maptext = maptext - O.maptext_height = maptext_height - O.maptext_width = maptext_width - O.screen_loc = screen_loc - return O - -/proc/Show2Group4Delay(obj/O, list/group, delay=0) - if(!isobj(O)) return - if(!group) group = GLOB.clients - for(var/client/C in group) - C.screen += O - if(delay) - spawn(delay) - for(var/client/C in group) - C.screen -= O - /datum/projectile_data var/src_x var/src_y @@ -487,67 +443,6 @@ return new /datum/projectile_data(src_x, src_y, time, distance, power_x, power_y, dest_x, dest_y) -/proc/GetRedPart(const/hexa) - return hex2num(copytext(hexa,2,4)) - -/proc/GetGreenPart(const/hexa) - return hex2num(copytext(hexa,4,6)) - -/proc/GetBluePart(const/hexa) - return hex2num(copytext(hexa,6,8)) - -/proc/GetHexColors(const/hexa) - return list( - GetRedPart(hexa), - GetGreenPart(hexa), - GetBluePart(hexa) - ) - -/proc/MixColors(const/list/colors) - var/list/reds = list() - var/list/blues = list() - var/list/greens = list() - var/list/weights = list() - - for (var/i = 0, ++i <= colors.len) - reds.Add(GetRedPart(colors[i])) - blues.Add(GetBluePart(colors[i])) - greens.Add(GetGreenPart(colors[i])) - weights.Add(1) - - var/r = mixOneColor(weights, reds) - var/g = mixOneColor(weights, greens) - var/b = mixOneColor(weights, blues) - return rgb(r,g,b) - -/proc/mixOneColor(list/weight, list/color) - if (!weight || !color || length(weight)!=length(color)) - return 0 - - var/contents = length(weight) - var/i - - //normalize weights - var/listsum = 0 - for(i=1; i<=contents; i++) - listsum += weight[i] - for(i=1; i<=contents; i++) - weight[i] /= listsum - - //mix them - var/mixedcolor = 0 - for(i=1; i<=contents; i++) - mixedcolor += weight[i]*color[i] - mixedcolor = round(mixedcolor) - - // Until someone writes a formal proof for this algorithm, let's keep this in. - // if(mixedcolor<0x00 || mixedcolor>0xFF) - // return 0 - // That's not the kind of operation we are running here, NERD. - mixedcolor=min(max(mixedcolor,0),255) - - return mixedcolor - /** * Gets the highest and lowest pressures from the tiles in cardinal directions * around us, then checks the difference. diff --git a/code/__HELPERS/game/depth.dm b/code/__HELPERS/game/depth.dm new file mode 100644 index 00000000000..fc782bc158a --- /dev/null +++ b/code/__HELPERS/game/depth.dm @@ -0,0 +1,38 @@ +/** + * get something's depth to turf, or INFINITY if not in turf + * + * * turfs return 0 + * * areas crash on invoke + * * something directly in a turf's contents counts as 0 + * * something in nullspace or nested inside something in nullspace counts as INFINITY + */ +/atom/proc/depth_from_turf() + . = 0 + var/atom/scanning = loc + while(!isturf(scanning)) + if(isnull(scanning)) + return INFINITY + ++. + scanning = scanning.loc + +/turf/depth_from_turf() + return 0 + +/area/depth_from_turf() + CRASH("invalid call") + +/** + * get something's depth from another atom, where being in that atom's contents is 0 + * + * * this makes no sense if containing is null. + */ +/atom/movable/proc/depth_inside_atom(atom/containing) + . = 0 + var/atom/scanning = loc + while(scanning) + if(isnull(scanning)) + return INFINITY + if(scanning == containing) + return + .++ + scanning = scanning.loc diff --git a/code/datums/action.dm b/code/datums/action.dm index 7f508f61e50..05c76dd9f1c 100644 --- a/code/datums/action.dm +++ b/code/datums/action.dm @@ -71,6 +71,8 @@ var/button_managed = FALSE /// is the button visible var/button_visibility = TRUE + /// custom overlay to add to button; this is arbitrary, and can be a reference to an item + var/button_overlay /datum/action/New(datum/target) if(!target_compatible(target)) @@ -89,6 +91,8 @@ remove(owner) target = null QDEL_NULL(button) + // clear ref, because it might be directly an object + button_overlay = null return ..() /datum/action/proc/grant(mob/living/T) @@ -213,6 +217,9 @@ img.pixel_y = 0 button.add_overlay(img) + if(button_overlay) + button.add_overlay(button_overlay) + if(button_availability < 1) button.color = rgb(128,0,0,128) else @@ -246,6 +253,7 @@ //? Action Button /atom/movable/screen/movable/action_button + appearance_flags = APPEARANCE_UI | KEEP_TOGETHER var/datum/action/owner screen_loc = "LEFT,TOP" diff --git a/code/game/antagonist/outsider/raider.dm b/code/game/antagonist/outsider/raider.dm index 961690838e4..541afecb926 100644 --- a/code/game/antagonist/outsider/raider.dm +++ b/code/game/antagonist/outsider/raider.dm @@ -230,7 +230,7 @@ var/datum/antagonist/raider/raiders id.name = "[player.real_name]'s Passport" id.assignment = "Visitor" var/obj/item/storage/wallet/W = new(player) - W.handle_item_insertion(id) + W.obj_storage.insert(id) player.equip_to_slot_or_del(W, SLOT_ID_WORN_ID) spawn_money(rand(50,150)*10,W) create_radio(RAID_FREQ, player) diff --git a/code/game/antagonist/outsider/trader.dm b/code/game/antagonist/outsider/trader.dm index 0ce3653deeb..011c15aebca 100644 --- a/code/game/antagonist/outsider/trader.dm +++ b/code/game/antagonist/outsider/trader.dm @@ -56,7 +56,7 @@ var/datum/antagonist/trader/traders id.assignment = "Trader" id.access |= ACCESS_FACTION_TRADER var/obj/item/storage/wallet/W = new(player) - W.handle_item_insertion(id) + W.obj_storage.insert(id) player.equip_to_slot_or_del(W, SLOT_ID_WORN_ID) spawn_money(rand(50,150)*10,W) diff --git a/code/game/atoms/atom.dm b/code/game/atoms/atom.dm index b1d46dc7ade..e5e4e009ddc 100644 --- a/code/game/atoms/atom.dm +++ b/code/game/atoms/atom.dm @@ -34,11 +34,13 @@ var/bubble_icon = "normal" //? Armor - /// armor datm - this armor mitigates damage - /// damage is reduced to 1 / (armor / 100 + 1), so 100 armor = 2x effective hp, 200 = 3x - /// if negative, you receive that % more damage, -100 = 0.5x effective hp, -200 = 0.33x, so on and so forth. + /// armor datum - holds armor values + /// this is lazy initialized, only init'd when armor is fetched + /// [armor_type] specifies the typepath to fetch if this is null during a fetch var/datum/armor/armor /// armor datum type + /// this is the type to init if armor is unset when armor is fetched + /// * anonymous typepaths are not allowed here var/armor_type = /datum/armor/none //? Context @@ -941,6 +943,14 @@ /atom/proc/update_atom_colour() CRASH("base proc hit") +//* Deletions *// + +// /** +// * Called when something in our contents is being Destroy()'d, before they get moved. +// */ +// /atom/proc/handle_contents_del(atom/movable/deleting) +// return + //? Filters /atom/proc/add_filter(name, priority, list/params, update = TRUE) @@ -1006,6 +1016,23 @@ filter_data = null filters = null +//* Inventory *// + +/atom/proc/on_contents_weight_class_change(obj/item/item, old_weight_class, new_weight_class) + return + +/atom/proc/on_contents_weight_volume_change(obj/item/item, old_weight_volume, new_weight_volume) + return + +/atom/proc/on_contents_weight_change(obj/item/item, old_weight, new_weight) + return + +/** + * called when an /obj/item Initialize()s in us. + */ +/atom/proc/on_contents_item_new(obj/item/item) + return + //? Layers /// Sets our plane @@ -1045,6 +1072,8 @@ //? Pixel Offsets +// todo: at some point we need to optimize this entire chain of bullshit, proccalls are expensive yo + /atom/proc/set_pixel_x(val) pixel_x = val + get_managed_pixel_x() SEND_SIGNAL(src, COMSIG_MOVABLE_PIXEL_OFFSET_CHANGED) @@ -1053,6 +1082,11 @@ pixel_y = val + get_managed_pixel_y() SEND_SIGNAL(src, COMSIG_MOVABLE_PIXEL_OFFSET_CHANGED) +/atom/proc/set_pixel_offsets(x, y) + pixel_x = x + get_managed_pixel_x() + pixel_y = y + get_managed_pixel_y() + SEND_SIGNAL(src, COMSIG_MOVABLE_PIXEL_OFFSET_CHANGED) + /atom/proc/reset_pixel_offsets() pixel_x = get_managed_pixel_x() pixel_y = get_managed_pixel_y() diff --git a/code/game/atoms/movable/movable.dm b/code/game/atoms/movable/movable.dm index 0c3844410d5..a489d59d2e6 100644 --- a/code/game/atoms/movable/movable.dm +++ b/code/game/atoms/movable/movable.dm @@ -157,8 +157,11 @@ //atom color stuff if(!isnull(color) && atom_colouration_system) add_atom_colour(color, FIXED_COLOUR_PRIORITY) - if (!mapload && loc) - loc.Entered(src, null) + // WARNING WARNING SHITCODE THIS MEANS THAT ONLY TURFS RECEIVE MAPLOAD ENTERED + // DO NOT RELY ON ENTERED + // TODO: what would tg do (but maybe not that much component signal abuse?) + if(!mapload) + loc?.Entered(src, null) switch(blocks_emissive) if(EMISSIVE_BLOCK_GENERIC) var/mutable_appearance/gen_emissive_blocker = mutable_appearance(icon, icon_state, plane = EMISSIVE_PLANE, alpha = src.alpha) @@ -175,6 +178,10 @@ unbuckle_all_mobs(BUCKLE_OP_FORCE) for(var/atom/movable/AM in contents) qdel(AM) + /* + if(loc) + loc.handle_contents_del(src) + */ var/turf/un_opaque if(opacity && isturf(loc)) un_opaque = loc diff --git a/code/game/click/context.dm b/code/game/click/context.dm index 81c18774cdc..41001e80a43 100644 --- a/code/game/click/context.dm +++ b/code/game/click/context.dm @@ -43,6 +43,17 @@ var/list/menu_options = context_query(e_args) if(!length(menu_options)) return FALSE + // check for defaulting + if(length(menu_options) == 1) + var/key = menu_options[1] + var/list/first_option = menu_options[key] + // todo: this is shitcode but we don't want assoclists for performance, just yet. + // make sure it's defaultable + if(length(first_option) >= 5 && first_option[5]) + // it is, log and execute + log_click_context(e_args, src, "menu execute [key] (default)") + context_act(e_args, key) + return // open log_click_context(e_args, src, "menu open") . = TRUE @@ -73,6 +84,8 @@ GLOB.radial_menus[id] = menu LAZYSET(context_menus, receiving, menu) + receiving.context_menu = menu + menu.radius = 32 menu.host = src menu.anchor = src @@ -81,15 +94,18 @@ menu.show_to(receiving.mob) menu.wait(receiving.mob, src, TRUE) + receiving.context_menu = null + var/chosen_name = menu.selected_choice - qdel(menu) GLOB.radial_menus -= id + qdel(menu) if(isnull(chosen_name)) return var/key = inverse_lookup[chosen_name] + log_click_context(e_args, src, "menu execute [key]") context_act(e_args, key) /atom/proc/context_close() diff --git a/code/game/click/drag_drop.dm b/code/game/click/drag_drop.dm index 051719b0e19..df676da9a9b 100644 --- a/code/game/click/drag_drop.dm +++ b/code/game/click/drag_drop.dm @@ -16,7 +16,9 @@ return TRUE /atom/MouseDrop(atom/over_object, src_location, over_location, src_control, over_control, params) - SHOULD_NOT_OVERRIDE(TRUE) + // no clickdrag to self + if(over_object == src) + return // cache incase thsi somehow gets lost var/user = usr if(!user || !over_object) @@ -28,7 +30,7 @@ return // shit proximity check, refactor later - var/proximity = Adjacent(usr) && over_object.Adjacent(usr) + var/proximity = usr.Reachability(src) && ((over_object == usr) || usr.Reachability(over_object)) if(proximity) // this one only runs if the above pass. legacy behavior. if(over_object.MouseDroppedOnLegacy(src, user, params) & CLICKCHAIN_DO_NOT_PROPAGATE) @@ -52,6 +54,8 @@ * - user - the person dropping it * - proximity - can we reach the thing? * - params - click params + * + * @return clickchain flags */ /atom/proc/OnMouseDrop(atom/over, mob/user, proximity, params) return NONE @@ -73,6 +77,8 @@ * - user - the person dropping it * - proximity - can we reach the thing? * - params - click params + * + * @return clickchain flags */ /atom/proc/MouseDroppedOn(atom/dropping, mob/user, proximity, params) return NONE diff --git a/code/game/click/items.dm b/code/game/click/items.dm index e130a0a47ca..e6a3b047a73 100644 --- a/code/game/click/items.dm +++ b/code/game/click/items.dm @@ -22,18 +22,20 @@ . = clickchain_flags + // todo: inject something here for 'used as item' much like /tg/, to get rid of attackby pattern + if((. |= tool_attack_chain(target, user, ., params)) & CLICKCHAIN_DO_NOT_PROPAGATE) return - + if((. |= pre_attack(target, user, ., params)) & CLICKCHAIN_DO_NOT_PROPAGATE) return // todo: refactor - if(resolve_attackby(target, user, params, null, clickchain_flags)) + if(resolve_attackby(target, user, params, null, .)) return CLICKCHAIN_DO_NOT_PROPAGATE // todo: signal for afterattack here - return clickchain_flags | afterattack(target, user, clickchain_flags, params) + return . | afterattack(target, user, clickchain_flags, params) /** * Called when trying to click something that the user can't Reachability() to. diff --git a/code/game/click/other_mobs.dm b/code/game/click/other_mobs.dm index ae111a9234c..0b0ae6ee346 100644 --- a/code/game/click/other_mobs.dm +++ b/code/game/click/other_mobs.dm @@ -31,14 +31,15 @@ // todo: /datum/event_args/actor/clickchain /atom/proc/attack_hand(mob/user, list/params) var/datum/event_args/actor/clickchain/e_args = new(user, target = src, intent = user.a_intent, params = params) - if(user.a_intent == INTENT_HARM) - return user.melee_attack_chain(src, e_args) if(on_attack_hand(e_args)) return TRUE + if(user.a_intent == INTENT_HARM) + return user.melee_attack_chain(src, e_args) . = _try_interact(user) /** * Override this instead of attack_hand. + * This happens before melee attack chain checks. * * Return TRUE to cancel other attack hand effects that respect it. * diff --git a/code/game/click/telekinesis.dm b/code/game/click/telekinesis.dm index 8436d432f12..c73cbb1d65b 100644 --- a/code/game/click/telekinesis.dm +++ b/code/game/click/telekinesis.dm @@ -67,7 +67,7 @@ var/const/tk_maxrange = 15 icon_state = "2" item_flags = ITEM_DROPDEL | ITEM_NOBLUDGEON //item_state = null - w_class = ITEMSIZE_NO_CONTAINER + w_class = WEIGHT_CLASS_HUGE layer = HUD_LAYER_BASE var/last_throw = 0 diff --git a/code/game/gamemodes/changeling/powers/armblade.dm b/code/game/gamemodes/changeling/powers/armblade.dm index 5d0e9b526c9..db77320eed6 100644 --- a/code/game/gamemodes/changeling/powers/armblade.dm +++ b/code/game/gamemodes/changeling/powers/armblade.dm @@ -52,7 +52,7 @@ desc = "A grotesque weapon made out of bone and flesh that cleaves through people as a hot knife through butter." icon = 'icons/obj/weapons.dmi' icon_state = "arm_blade" - w_class = ITEMSIZE_HUGE + w_class = WEIGHT_CLASS_HUGE damage_force = 5 anchored = 1 throw_force = 0 //Just to be on the safe side diff --git a/code/game/gamemodes/changeling/powers/bioelectrogenesis.dm b/code/game/gamemodes/changeling/powers/bioelectrogenesis.dm index 1f1579b4020..7d5547a962c 100644 --- a/code/game/gamemodes/changeling/powers/bioelectrogenesis.dm +++ b/code/game/gamemodes/changeling/powers/bioelectrogenesis.dm @@ -133,7 +133,7 @@ return // Handle glove conductivity. - var/obj/item/clothing/gloves/gloves = user.item_by_slot(SLOT_ID_GLOVES) + var/obj/item/clothing/gloves/gloves = user.item_by_slot_id(SLOT_ID_GLOVES) var/siemens = 1 if(gloves) siemens = gloves.siemens_coefficient diff --git a/code/game/gamemodes/cult/cult_items.dm b/code/game/gamemodes/cult/cult_items.dm index 4520868c690..0b1fd4839a0 100644 --- a/code/game/gamemodes/cult/cult_items.dm +++ b/code/game/gamemodes/cult/cult_items.dm @@ -3,7 +3,7 @@ desc = "An arcane weapon wielded by the followers of Nar-Sie." icon_state = "cultblade" origin_tech = list(TECH_COMBAT = 1, TECH_ARCANE = 1) - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY damage_force = 30 throw_force = 10 attack_sound = 'sound/weapons/bladeslice.ogg' @@ -132,7 +132,7 @@ icon_state = "cult" origin_tech = list(TECH_MATERIAL = 3, TECH_ARCANE = 1) desc = "A bulky suit of armour, bristling with spikes. It looks space-worthy." - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL allowed = list(/obj/item/book/tome,/obj/item/melee/cultblade,/obj/item/tank/emergency/oxygen,/obj/item/suit_cooling_unit) weight = ITEM_WEIGHT_CULT_VOIDSUIT encumbrance = ITEM_ENCUMBRANCE_CULT_VOIDSUIT diff --git a/code/game/gamemodes/cult/ritual.dm b/code/game/gamemodes/cult/ritual.dm index d0fb469fd47..e2e982ddfe1 100644 --- a/code/game/gamemodes/cult/ritual.dm +++ b/code/game/gamemodes/cult/ritual.dm @@ -183,7 +183,7 @@ var/global/list/rnwords = list("ire","ego","nahlizet","certum","veri","jatkaa"," icon_state ="tome" throw_speed = 1 throw_range = 5 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL unique = 1 var/tomedat = "" var/list/words = list("ire" = "ire", "ego" = "ego", "nahlizet" = "nahlizet", "certum" = "certum", "veri" = "veri", "jatkaa" = "jatkaa", "balaq" = "balaq", "mgar" = "mgar", "karazet" = "karazet", "geeri" = "geeri") @@ -423,7 +423,7 @@ var/global/list/rnwords = list("ire","ego","nahlizet","certum","veri","jatkaa"," return /obj/item/book/tome/imbued //admin tome, spawns working runes without waiting - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL var/cultistsonly = 1 /obj/item/book/tome/imbued/attack_self(mob/user) diff --git a/code/game/gamemodes/cult/soulstone.dm b/code/game/gamemodes/cult/soulstone.dm index 8f920f2e5e8..351bc6f0020 100644 --- a/code/game/gamemodes/cult/soulstone.dm +++ b/code/game/gamemodes/cult/soulstone.dm @@ -8,7 +8,7 @@ icon_state = "soulstone" item_state = "electronic" desc = "A fragment of the legendary treasure known simply as the 'Soul Stone'. The shard still flickers with a fraction of the full artefacts power." - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL slot_flags = SLOT_BELT origin_tech = list(TECH_BLUESPACE = 4, TECH_MATERIAL = 4, TECH_ARCANE = 1) var/imprinted = "empty" diff --git a/code/game/gamemodes/events/holidays/Other.dm b/code/game/gamemodes/events/holidays/Other.dm deleted file mode 100644 index 5f1a5160f47..00000000000 --- a/code/game/gamemodes/events/holidays/Other.dm +++ /dev/null @@ -1,10 +0,0 @@ -/proc/GameOver() - if(!hadevent) - hadevent = 1 - message_admins("The apocalypse has begun! (this holiday event can be disabled by toggling events off within 60 seconds)") - spawn(600) - if(!config_legacy.allow_random_events) return - Show2Group4Delay(ScreenText(null,"
GAME OVER
"),null,150) - for(var/i=1,i<=4,i++) - spawn_dynamic_event() - sleep(50) diff --git a/code/game/gamemodes/nuclear/nuclear.dm b/code/game/gamemodes/nuclear/nuclear.dm index f39e8598c1a..39bc1a30f3b 100644 --- a/code/game/gamemodes/nuclear/nuclear.dm +++ b/code/game/gamemodes/nuclear/nuclear.dm @@ -28,8 +28,7 @@ var/list/nuke_disks = list() //checks if L has a nuke disk on their person /datum/game_mode/nuclear/proc/check_mob(mob/living/L) for(var/obj/item/disk/nuclear/N in nuke_disks) - if(N.storage_depth(L) >= 0) - return 1 + return N.depth_inside_atom(L) != INFINITY return 0 /datum/game_mode/nuclear/declare_completion() diff --git a/code/game/gamemodes/nuclear/pinpointer.dm b/code/game/gamemodes/nuclear/pinpointer.dm index c9542d67176..7140731a6ed 100644 --- a/code/game/gamemodes/nuclear/pinpointer.dm +++ b/code/game/gamemodes/nuclear/pinpointer.dm @@ -3,7 +3,7 @@ icon = 'icons/obj/device.dmi' icon_state = "pinoff" slot_flags = SLOT_BELT - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL item_state = "electronic" throw_speed = 4 throw_range = 20 diff --git a/code/game/gamemodes/technomancer/catalog.dm b/code/game/gamemodes/technomancer/catalog.dm index a82c86a2790..89323709dae 100644 --- a/code/game/gamemodes/technomancer/catalog.dm +++ b/code/game/gamemodes/technomancer/catalog.dm @@ -23,7 +23,7 @@ requisition various things from.. where ever they came from." icon = 'icons/obj/storage.dmi' icon_state ="scientology" //placeholder - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL slot_flags = SLOT_BELT var/budget = 1000 var/max_budget = 1000 diff --git a/code/game/gamemodes/technomancer/core_obj.dm b/code/game/gamemodes/technomancer/core_obj.dm index 313807074cb..879c6cb7099 100644 --- a/code/game/gamemodes/technomancer/core_obj.dm +++ b/code/game/gamemodes/technomancer/core_obj.dm @@ -5,7 +5,7 @@ icon = 'icons/obj/technomancer.dmi' icon_state = "technomancer_core" item_state = "technomancer_core" - w_class = ITEMSIZE_HUGE + w_class = WEIGHT_CLASS_HUGE slot_flags = SLOT_BACK integrity_flags = INTEGRITY_INDESTRUCTIBLE | INTEGRITY_ACIDPROOF | INTEGRITY_FIREPROOF | INTEGRITY_LAVAPROOF origin_tech = list( diff --git a/code/game/gamemodes/technomancer/devices/disposable_teleporter.dm b/code/game/gamemodes/technomancer/devices/disposable_teleporter.dm index 5e2f8d15173..9af0f71b860 100644 --- a/code/game/gamemodes/technomancer/devices/disposable_teleporter.dm +++ b/code/game/gamemodes/technomancer/devices/disposable_teleporter.dm @@ -11,7 +11,7 @@ icon = 'icons/obj/device.dmi' icon_state = "hand_tele" //temporary var/uses = 3.0 - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY item_state = "paper" origin_tech = list(TECH_BLUESPACE = 4, TECH_POWER = 3) diff --git a/code/game/gamemodes/technomancer/equipment.dm b/code/game/gamemodes/technomancer/equipment.dm index c319a98c5db..85ef60c4bc9 100644 --- a/code/game/gamemodes/technomancer/equipment.dm +++ b/code/game/gamemodes/technomancer/equipment.dm @@ -111,7 +111,7 @@ name = "hypo belt" desc = "A medical belt designed to carry autoinjectors and other medical equipment." -/obj/item/storage/belt/medical/technomancer/PopulateContents() +/obj/item/storage/belt/medical/technomancer/legacy_spawn_contents() new /obj/item/reagent_containers/hypospray/autoinjector/biginjector/brute(src) new /obj/item/reagent_containers/hypospray/autoinjector/biginjector/burn(src) new /obj/item/reagent_containers/hypospray/autoinjector/biginjector/toxin(src) @@ -133,9 +133,9 @@ name = "Belt of Holding" desc = "Can hold more than you'd expect." icon_state = "ems" - max_w_class = ITEMSIZE_NORMAL // Can hold normal sized items. - storage_slots = 14 // Twice the capacity of a typical belt. - max_storage_space = ITEMSIZE_COST_NORMAL * 14 + max_single_weight_class = WEIGHT_CLASS_NORMAL // Can hold normal sized items. + max_items = 14 // Twice the capacity of a typical belt. + max_combined_volume = WEIGHT_VOLUME_NORMAL * 14 /datum/technomancer/equipment/thermals name = "Thermoncle" diff --git a/code/game/machinery/_machinery.dm b/code/game/machinery/_machinery.dm index a79921b4373..bf90d6cc3e5 100644 --- a/code/game/machinery/_machinery.dm +++ b/code/game/machinery/_machinery.dm @@ -100,7 +100,7 @@ /obj/machinery name = "machinery" icon = 'icons/obj/stationobjs.dmi' - w_class = ITEMSIZE_NO_CONTAINER + w_class = WEIGHT_CLASS_HUGE layer = UNDER_JUNK_LAYER // todo: don't block rad contents and just have component parts be unable to be contaminated while inside // todo: wow rad contents is a weird system @@ -437,13 +437,14 @@ continue if(istype(B, P) && istype(A, P)) if(their_rating > our_rating) - R.remove_from_storage(B, src) - R.handle_item_insertion(A, null, TRUE) + R.obj_storage.remove(B, src) + R.obj_storage.insert(A, suppressed = TRUE, no_update = TRUE) component_parts -= A component_parts += B B.loc = null to_chat(user, "[A.name] replaced with [B.name].") break + R.obj_storage.ui_queue_refresh() update_appearance() RefreshParts() return 1 diff --git a/code/game/machinery/bioprinter.dm b/code/game/machinery/bioprinter.dm index ddf18136f02..5c27edd487b 100644 --- a/code/game/machinery/bioprinter.dm +++ b/code/game/machinery/bioprinter.dm @@ -253,7 +253,7 @@ if(O.species) // This is a very hacky way of doing of what organ/New() does if it has an owner - O.w_class = max(O.w_class + mob_size_difference(O.species.mob_size, MOB_MEDIUM), 1) + O.set_weight_class(max(O.w_class + mob_size_difference(O.species.mob_size, MOB_MEDIUM), 1)) return O // END GENERIC PRINTER diff --git a/code/game/machinery/camera/camera_assembly.dm b/code/game/machinery/camera/camera_assembly.dm index 9bff46e9832..a851040377c 100644 --- a/code/game/machinery/camera/camera_assembly.dm +++ b/code/game/machinery/camera/camera_assembly.dm @@ -3,7 +3,7 @@ desc = "A pre-fabricated security camera kit, ready to be assembled and mounted to a surface." icon = 'icons/machinery/security_camera.dmi' icon_state = "cameracase" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL anchored = 0 materials_base = list(MAT_STEEL = 700, MAT_GLASS = 300) diff --git a/code/game/machinery/cell_charger.dm b/code/game/machinery/cell_charger.dm index b5d46e6f897..813b3c83f07 100644 --- a/code/game/machinery/cell_charger.dm +++ b/code/game/machinery/cell_charger.dm @@ -142,7 +142,7 @@ SLOT_ID_RIGHT_HAND = 'icons/mob/items/righthand_storage.dmi', ) item_state = "syringe_kit" - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL materials_base = list(MAT_STEEL = 4000, MAT_GLASS = 1000) /obj/item/cell_charger_kit/attack_self(mob/user) diff --git a/code/game/machinery/cloning.dm b/code/game/machinery/cloning.dm index a8b2a8ee83a..87610114a57 100644 --- a/code/game/machinery/cloning.dm +++ b/code/game/machinery/cloning.dm @@ -483,7 +483,7 @@ icon = 'icons/obj/cloning.dmi' icon_state = "datadisk0" //Gosh I hope syndies don't mistake them for the nuke disk. item_state = "card-id" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL var/datum/dna2/record/buf = null var/read_only = 0 //Well,it's still a floppy disk @@ -544,7 +544,7 @@ name = "Diskette Box" icon_state = "disk_kit" -/obj/item/storage/box/disks/PopulateContents() +/obj/item/storage/box/disks/legacy_spawn_contents() new /obj/item/disk/data(src) new /obj/item/disk/data(src) new /obj/item/disk/data(src) diff --git a/code/game/machinery/computer/arcade/orion.dm b/code/game/machinery/computer/arcade/orion.dm index c2cb41cefac..395a339eeec 100644 --- a/code/game/machinery/computer/arcade/orion.dm +++ b/code/game/machinery/computer/arcade/orion.dm @@ -497,7 +497,7 @@ GLOBAL_LIST_INIT(orion_events, generate_orion_events()) desc = "A model spaceship, it looks like those used back in the day when travelling to Orion! It even has a miniature FX-293 reactor, which was renowned for its instability and tendency to explode..." icon = 'icons/obj/toy.dmi' icon_state = "ship" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL var/active = FALSE //if the ship is on /obj/item/orion_ship/examine(mob/user, dist) diff --git a/code/game/machinery/cryopod.dm b/code/game/machinery/cryopod.dm index 9e80eb1a2ba..52b0754c80f 100644 --- a/code/game/machinery/cryopod.dm +++ b/code/game/machinery/cryopod.dm @@ -418,8 +418,6 @@ W.forceMove(src) if(W.contents.len) for(var/obj/item/O in W.contents) - if(istype(O,/obj/item/storage/internal)) - continue O.forceMove(src) if(ishuman(to_despawn)) var/mob/living/carbon/human/H = to_despawn @@ -435,8 +433,6 @@ if(W.contents.len) //Make sure we catch anything not handled by qdel() on the items. for(var/obj/item/O in W.contents) - if(istype(O,/obj/item/storage/internal)) //Stop eating pockets, you fuck! - continue O.forceMove(src) //Delete all items not on the preservation list. diff --git a/code/game/machinery/doors/airlock/airlock_electronics.dm b/code/game/machinery/doors/airlock/airlock_electronics.dm index 987aecfb27d..228d76b9388 100644 --- a/code/game/machinery/doors/airlock/airlock_electronics.dm +++ b/code/game/machinery/doors/airlock/airlock_electronics.dm @@ -2,7 +2,7 @@ name = "airlock electronics" icon = 'icons/obj/doors/door_assembly.dmi' icon_state = "door_electronics" - w_class = ITEMSIZE_SMALL //It should be tiny! -Agouri + w_class = WEIGHT_CLASS_SMALL //It should be tiny! -Agouri materials_base = list(MAT_STEEL = 50, MAT_GLASS = 50) diff --git a/code/game/machinery/fire_alarm.dm b/code/game/machinery/fire_alarm.dm index 4208f449d75..101465e9cf4 100644 --- a/code/game/machinery/fire_alarm.dm +++ b/code/game/machinery/fire_alarm.dm @@ -283,7 +283,7 @@ Just a object used in constructing fire alarms icon = 'icons/obj/doors/door_assembly.dmi' icon_state = "door_electronics" desc = "A circuit. It has a label on it, it says \"Can handle heat levels up to 40 degrees celsius!\"" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL materials_base = list(MAT_STEEL = 50, MAT_GLASS = 50) */ /obj/machinery/partyalarm diff --git a/code/game/machinery/floor_inflatables.dm b/code/game/machinery/floor_inflatables.dm index d755ec044ba..7e87f68451a 100644 --- a/code/game/machinery/floor_inflatables.dm +++ b/code/game/machinery/floor_inflatables.dm @@ -39,7 +39,7 @@ add_fingerprint(user, 0, C) add_fingerprint(user, 0, src) if(istype(C)) - if(C.w_class <= ITEMSIZE_NORMAL) + if(C.w_class <= WEIGHT_CLASS_NORMAL) C.forceMove(src) stored = C to_chat(user, "You slide [C] into the compartment and close it.") diff --git a/code/game/machinery/newscaster.dm b/code/game/machinery/newscaster.dm index c30ab142519..867e179e812 100644 --- a/code/game/machinery/newscaster.dm +++ b/code/game/machinery/newscaster.dm @@ -799,7 +799,7 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co desc = "An issue of The Griffon, the newspaper circulating aboard most stations." icon = 'icons/obj/bureaucracy.dmi' icon_state = "newspaper" - w_class = ITEMSIZE_SMALL //Let's make it fit in trashbags! + w_class = WEIGHT_CLASS_SMALL //Let's make it fit in trashbags! attack_verb = list("bapped") var/screen = 0 var/pages = 0 diff --git a/code/game/machinery/pipe/construction.dm b/code/game/machinery/pipe/construction.dm index f37ec6471c0..1d33af8d1ad 100644 --- a/code/game/machinery/pipe/construction.dm +++ b/code/game/machinery/pipe/construction.dm @@ -258,7 +258,7 @@ Buildable meters icon = 'icons/obj/pipe-item.dmi' icon_state = "meter" item_state = "buildpipe" - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY var/piping_layer = PIPING_LAYER_DEFAULT /obj/item/pipe_meter/attackby(var/obj/item/W as obj, var/mob/user as mob) diff --git a/code/game/mecha/components/_component.dm b/code/game/mecha/components/_component.dm index 6421f0b779b..956fc9866f3 100644 --- a/code/game/mecha/components/_component.dm +++ b/code/game/mecha/components/_component.dm @@ -3,7 +3,7 @@ name = "mecha component" icon = 'icons/mecha/mech_component.dmi' icon_state = "component" - w_class = ITEMSIZE_HUGE + w_class = WEIGHT_CLASS_HUGE origin_tech = list(TECH_DATA = 2, TECH_ENGINEERING = 2) var/component_type = null diff --git a/code/game/mecha/components/actuators.dm b/code/game/mecha/components/actuators.dm index dadb8165b74..84f7580559d 100644 --- a/code/game/mecha/components/actuators.dm +++ b/code/game/mecha/components/actuators.dm @@ -3,7 +3,7 @@ name = "mecha actuator" icon = 'icons/mecha/mech_component.dmi' icon_state = "motor" - w_class = ITEMSIZE_HUGE + w_class = WEIGHT_CLASS_HUGE origin_tech = list(TECH_DATA = 2, TECH_ENGINEERING = 2) materials_base = list(MAT_STEEL = 2500, MAT_GLASS = 1200) diff --git a/code/game/mecha/components/armor.dm b/code/game/mecha/components/armor.dm index 3bddffb7c96..4d2a57e2ad2 100644 --- a/code/game/mecha/components/armor.dm +++ b/code/game/mecha/components/armor.dm @@ -3,7 +3,7 @@ name = "mecha plating" icon = 'icons/mecha/mech_component.dmi' icon_state = "armor" - w_class = ITEMSIZE_HUGE + w_class = WEIGHT_CLASS_HUGE origin_tech = list(TECH_DATA = 1, TECH_ENGINEERING = 2) materials_base = list(MAT_STEEL = 5000, MAT_GLASS = 1000) diff --git a/code/game/mecha/components/electrical.dm b/code/game/mecha/components/electrical.dm index 7cc27d2c1b3..5d4a213882c 100644 --- a/code/game/mecha/components/electrical.dm +++ b/code/game/mecha/components/electrical.dm @@ -3,7 +3,7 @@ name = "mecha electrical harness" icon = 'icons/mecha/mech_component.dmi' icon_state = "board" - w_class = ITEMSIZE_HUGE + w_class = WEIGHT_CLASS_HUGE origin_tech = list(TECH_DATA = 2, TECH_ENGINEERING = 2) materials_base = list(MAT_STEEL = 2500, MAT_GLASS = 1000) diff --git a/code/game/mecha/components/hull.dm b/code/game/mecha/components/hull.dm index 4cddba40688..cdea1f5bb43 100644 --- a/code/game/mecha/components/hull.dm +++ b/code/game/mecha/components/hull.dm @@ -3,7 +3,7 @@ name = "mecha hull" icon = 'icons/mecha/mech_component.dmi' icon_state = "hull" - w_class = ITEMSIZE_HUGE + w_class = WEIGHT_CLASS_HUGE origin_tech = list(TECH_DATA = 2, TECH_ENGINEERING = 2) materials_base = list(MAT_STEEL = 3500, MAT_GLASS = 200) diff --git a/code/game/mecha/components/lifesupport.dm b/code/game/mecha/components/lifesupport.dm index 9afb3e3f542..c0bf51e6f90 100644 --- a/code/game/mecha/components/lifesupport.dm +++ b/code/game/mecha/components/lifesupport.dm @@ -3,7 +3,7 @@ name = "mecha life-support" icon = 'icons/mecha/mech_component.dmi' icon_state = "lifesupport" - w_class = ITEMSIZE_HUGE + w_class = WEIGHT_CLASS_HUGE origin_tech = list(TECH_DATA = 2, TECH_ENGINEERING = 2) materials_base = list(MAT_STEEL = 1000, MAT_GLASS = 1500) diff --git a/code/game/mecha/mecha_control_console.dm b/code/game/mecha/mecha_control_console.dm index cd4f58454e7..b6120714961 100644 --- a/code/game/mecha/mecha_control_console.dm +++ b/code/game/mecha/mecha_control_console.dm @@ -130,7 +130,7 @@ /obj/item/storage/box/mechabeacons name = "Exosuit Tracking Beacons" -/obj/item/storage/box/mechabeacons/PopulateContents() +/obj/item/storage/box/mechabeacons/legacy_spawn_contents() new /obj/item/mecha_parts/mecha_tracking(src) new /obj/item/mecha_parts/mecha_tracking(src) new /obj/item/mecha_parts/mecha_tracking(src) diff --git a/code/game/mecha/mecha_parts.dm b/code/game/mecha/mecha_parts.dm index 2604d6a369a..652ff65aee8 100644 --- a/code/game/mecha/mecha_parts.dm +++ b/code/game/mecha/mecha_parts.dm @@ -8,7 +8,7 @@ name = "mecha part" icon = 'icons/mecha/mech_construct.dmi' icon_state = "blank" - w_class = ITEMSIZE_HUGE + w_class = WEIGHT_CLASS_HUGE origin_tech = list(TECH_DATA = 2, TECH_MATERIAL = 2) diff --git a/code/game/mecha/micro/mecha_parts_vr.dm b/code/game/mecha/micro/mecha_parts_vr.dm index 0966e84fa28..7c49970bead 100644 --- a/code/game/mecha/micro/mecha_parts_vr.dm +++ b/code/game/mecha/micro/mecha_parts_vr.dm @@ -4,7 +4,7 @@ name = "mecha part" icon = 'icons/mecha/mech_construct_vr.dmi' icon_state = "blank" - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL /obj/item/mecha_parts/micro/chassis diff --git a/code/game/mecha/micro/micro_equipment.dm b/code/game/mecha/micro/micro_equipment.dm index 242982a3998..1e0f76cea70 100644 --- a/code/game/mecha/micro/micro_equipment.dm +++ b/code/game/mecha/micro/micro_equipment.dm @@ -5,7 +5,7 @@ ///////////////////////////// /obj/item/mecha_parts/mecha_equipment/weapon/energy/microlaser - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY desc = "A mounted laser-carbine for light exosuits." equip_cooldown = 10 // same as the laser carbine name = "\improper WS-19 \"Torch\" laser carbine" @@ -18,7 +18,7 @@ required_type = list(/obj/mecha/micro/sec) /obj/item/mecha_parts/mecha_equipment/weapon/energy/laser/microheavy - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY desc = "A mounted laser cannon for light exosuits." equip_cooldown = 30 // same as portable name = "\improper PC-20 \"Lance\" light laser cannon" @@ -31,7 +31,7 @@ required_type = list(/obj/mecha/micro/sec) /obj/item/mecha_parts/mecha_equipment/weapon/energy/microtaser - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY desc = "A mounted taser for light exosuits." name = "\improper TS-12 \"Suppressor\" integrated taser" icon = 'icons/mecha/mecha_equipment_vr.dmi' @@ -44,7 +44,7 @@ required_type = list(/obj/mecha/micro/sec) /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/microshotgun - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY desc = "A mounted combat shotgun with integrated ammo-lathe." name = "\improper Remington C-12 \"Boomstick\"" icon = 'icons/mecha/mecha_equipment_vr.dmi' @@ -83,7 +83,7 @@ /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/grenade/microflashbang - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY desc = "A mounted grenade launcher for smaller mechs." name = "\improper FP-20 mounted grenade launcher" icon = 'icons/mecha/mecha_equipment_vr.dmi' @@ -102,7 +102,7 @@ ///////////////////////////// /obj/item/mecha_parts/mecha_equipment/tool/drill/micro - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY name = "drill" desc = "This is the drill that'll sorta poke holes in the heavens!" icon = 'icons/mecha/mecha_equipment_vr.dmi' @@ -152,7 +152,7 @@ /obj/item/mecha_parts/mecha_equipment/tool/micro/orescoop - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY name = "Mounted ore box" desc = "A mounted ore scoop and hopper, for gathering ores." icon = 'icons/mecha/mecha_equipment_vr.dmi' diff --git a/code/game/objects/defense.dm b/code/game/objects/defense.dm index c9f672fd271..a215e9f18be 100644 --- a/code/game/objects/defense.dm +++ b/code/game/objects/defense.dm @@ -37,6 +37,11 @@ . = ..() inflict_atom_damage(100, flag = ARMOR_MELEE, attack_type = ATTACK_TYPE_MELEE) +/obj/drop_products(method, atom/where) + . = ..() + if(obj_storage?.drop_on_deconstruction_methods & method) + obj_storage.drop_everything_at(where) + /obj/hitsound_melee(obj/item/I) if(!isnull(material_primary)) var/datum/material/primary = get_primary_material() diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index a83d190cef4..a3778eef198 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -1,7 +1,7 @@ /obj/item name = "item" icon = 'icons/obj/items.dmi' - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL // todo: better way, for now, block all rad contamination to interior rad_flags = RAD_BLOCK_CONTENTS obj_flags = OBJ_IGNORE_MOB_DEPTH | OBJ_RANGE_TARGETABLE @@ -42,6 +42,17 @@ /// economic category for items var/economic_category_item = ECONOMIC_CATEGORY_ITEM_DEFAULT + //* Environmentals *// + /// Set this variable to determine up to which temperature (IN KELVIN) the item protects against heat damage. Keep at null to disable protection. Only protects areas set by heat_protection flags. + var/max_heat_protection_temperature + /// Set this variable to determine down to which temperature (IN KELVIN) the item protects against cold damage. 0 is NOT an acceptable number due to if(varname) tests!! Keep at null to disable protection. Only protects areas set by cold_protection flags. + var/min_cold_protection_temperature + + /// Set this variable if the item protects its wearer against high pressures below an upper bound. Keep at null to disable protection. + var/max_pressure_protection + /// Set this variable if the item protects its wearer against low pressures above a lower bound. Keep at null to disable protection. 0 represents protection against hard vacuum. + var/min_pressure_protection + //? Carry Weight /// encumberance. /// calculated as max() of all encumbrance @@ -72,15 +83,14 @@ var/damage_mode = NONE // todo: port over damtype + //* Storage *// + /// storage cost for volumetric storage + /// null to default to weight class + var/weight_volume + //? unsorted / legacy /// This saves our blood splatter overlay, which will be processed not to go over the edges of the sprite var/image/blood_overlay = null - var/r_speed = 1.0 - var/burn_point = null - var/burning = null - var/storage_cost = null - /// If it's an item we don't want to log attack_logs with, set this to TRUE - var/no_attack_log = FALSE pass_flags = ATOM_PASS_TABLE pressure_resistance = 5 var/obj/item/master = null @@ -92,16 +102,6 @@ */ var/list/attack_verb = "attacked" - /// Set this variable to determine up to which temperature (IN KELVIN) the item protects against heat damage. Keep at null to disable protection. Only protects areas set by heat_protection flags. - var/max_heat_protection_temperature - /// Set this variable to determine down to which temperature (IN KELVIN) the item protects against cold damage. 0 is NOT an acceptable number due to if(varname) tests!! Keep at null to disable protection. Only protects areas set by cold_protection flags. - var/min_cold_protection_temperature - - /// Set this variable if the item protects its wearer against high pressures below an upper bound. Keep at null to disable protection. - var/max_pressure_protection - /// Set this variable if the item protects its wearer against low pressures above a lower bound. Keep at null to disable protection. 0 represents protection against hard vacuum. - var/min_pressure_protection - //? todo: more advanced handling, multi actions, etc var/datum/action/item_action/action = null /// It is also the text which gets displayed on the action button. If not set it defaults to 'Use [name]'. If it's not set, there'll be no button. @@ -118,12 +118,16 @@ /// For electrical admittance/conductance (electrocution checks and shit) var/siemens_coefficient = 1 /// Suit storage stuff. + // todo: kill with fire var/list/allowed = null + // todo: kill with fire /// All items can have an uplink hidden inside, just remember to add the triggers. var/obj/item/uplink/hidden/hidden_uplink = null /// Name used for message when binoculars/scope is used + // todo: kill with fire var/zoomdevicename = null /// TRUE if item is actively being used to zoom. For scoped guns and binoculars. + // todo: kill with fire var/zoom = FALSE /// 0 won't embed, and 100 will always embed var/embed_chance = EMBED_CHANCE_UNSET @@ -159,10 +163,9 @@ /obj/item/Initialize(mapload) . = ..() + loc?.on_contents_item_new(src) if(islist(origin_tech)) origin_tech = typelist(NAMEOF(src, origin_tech), origin_tech) - if(istype(loc, /obj/item/storage)) - item_flags |= ITEM_IN_STORAGE //Potential memory optimization: Making embed chance a getter if unset. if(embed_chance == EMBED_CHANCE_UNSET) if(sharp) @@ -305,25 +308,26 @@ /proc/weightclass2text(w_class) switch(w_class) - if(WEIGHT_CLASS_TINY, ITEMSIZE_TINY) + if(WEIGHT_CLASS_TINY, WEIGHT_CLASS_TINY) . = "tiny" - if(WEIGHT_CLASS_SMALL, ITEMSIZE_SMALL) + if(WEIGHT_CLASS_SMALL, WEIGHT_CLASS_SMALL) . = "small" - if(WEIGHT_CLASS_NORMAL, ITEMSIZE_NORMAL) + if(WEIGHT_CLASS_NORMAL, WEIGHT_CLASS_NORMAL) . = "normal-sized" - if(WEIGHT_CLASS_BULKY, ITEMSIZE_LARGE) + if(WEIGHT_CLASS_BULKY, WEIGHT_CLASS_BULKY) . = "bulky" - if(WEIGHT_CLASS_HUGE, ITEMSIZE_HUGE) + if(WEIGHT_CLASS_HUGE, WEIGHT_CLASS_HUGE) . = "huge" if(WEIGHT_CLASS_GIGANTIC) . = "gigantic" else . = "" -/obj/item/attack_hand(mob/user, list/params) - attempt_pickup(user) +/obj/item/proc/should_attempt_pickup(datum/event_args/actor/actor) + return TRUE /obj/item/proc/attempt_pickup(mob/user) + . = TRUE if (!user) return @@ -350,17 +354,32 @@ var/old_loc = src.loc throwing?.terminate() - if(user.put_in_active_hand(src)) - if(isturf(old_loc)) - var/obj/effect/temporary_effect/item_pickup_ghost/ghost = new(old_loc) - ghost.assumeform(src) - ghost.animate_towards(user) + + //! FUCK; this is off because we don't have storage indirection working properly. + + // if(item_flags & ITEM_IN_STORAGE) + // var/obj/object = loc + // var/datum/object_system/storage/in_storage = object.obj_storage + // // todo: support for indirection + // ASSERT(!isnull(in_storage)) + // if(!in_storage.auto_handle_interacted_removal(src, new /datum/event_args/actor(user), put_in_hands = TRUE)) + // return + // else if(!user.put_in_active_hand(src)) + if(!user.put_in_active_hand(src)) + return + if(isturf(old_loc)) + var/obj/effect/temporary_effect/item_pickup_ghost/ghost = new(old_loc) + ghost.assumeform(src) + ghost.animate_towards(user) /obj/item/OnMouseDrop(atom/over, mob/user, proximity, params) + . = ..() + if(. & CLICKCHAIN_DO_NOT_PROPAGATE) + return if(anchored) // Don't. - return ..() + return if(user.restrained()) - return ..() // don't. + return // don't. // todo: restraint levels, e.g. handcuffs vs straightjacket if(!user.is_in_inventory(src)) // not being held @@ -390,7 +409,6 @@ user.visible_message(SPAN_NOTICE("[user] slides [src] over."), SPAN_NOTICE("You slide [src] over."), range = MESSAGE_RANGE_COMBAT_SUBTLE) log_inventory("[user] slid [src] from [COORD(old)] to [COORD(over)]") return CLICKCHAIN_DO_NOT_PROPAGATE - return ..() else // being held, check for attempt unequip if(istype(over, /atom/movable/screen/inventory/hand)) @@ -404,7 +422,6 @@ else if(istype(over, /turf)) user.drop_item_to_ground(src) return CLICKCHAIN_DO_NOT_PROPAGATE - return ..() // funny! /mob/proc/CanSlideItem(obj/item/I, turf/over) @@ -425,30 +442,6 @@ R.activate_module(src) R.hud_used.update_robot_modules_display() -/obj/item/attackby(obj/item/I, mob/user, list/params, clickchain_flags, damage_multiplier) - if(istype(I, /obj/item/storage)) - var/obj/item/storage/S = I - if(S.use_to_pickup) - if(S.collection_mode) //Mode is set to collect all items - if(isturf(src.loc)) - S.gather_all(src.loc, user) - - else if(S.can_be_inserted(src)) - S.handle_item_insertion(src, user) - if(istype(I, /obj/item/cell) && !isnull(obj_cell_slot) && isnull(obj_cell_slot.cell) && obj_cell_slot.interaction_active(user)) - if(!user.transfer_item_to_loc(I, src)) - user.action_feedback(SPAN_WARNING("[I] is stuck to your hand!"), src) - return CLICKCHAIN_DO_NOT_PROPAGATE - user.visible_action_feedback( - target = src, - hard_range = obj_cell_slot.remove_is_discrete? 0 : MESSAGE_RANGE_CONSTRUCTION, - visible_hard = SPAN_NOTICE("[user] inserts [I] into [src]."), - audible_hard = SPAN_NOTICE("You hear something being slotted in."), - visible_self = SPAN_NOTICE("You insert [I] into [src]."), - ) - obj_cell_slot.insert_cell(I) - return CLICKCHAIN_DO_NOT_PROPAGATE | CLICKCHAIN_DID_SOMETHING - /obj/item/proc/talk_into(mob/M as mob, text) return @@ -494,20 +487,7 @@ var/matrix/M = matrix(transform) M.Turn(rand(-170, 170)) transform = M - pixel_x = rand(-8, 8) - pixel_y = rand(-8, 8) - -// called when this item is removed from a storage item, which is passed on as S. The loc variable is already set to the new destination before this is called. -/obj/item/proc/on_exit_storage(obj/item/storage/S as obj) - SEND_SIGNAL(src, COMSIG_STORAGE_EXITED, S) - -// called when this item is added into a storage item, which is passed on as S. The loc variable is already set to the storage item. -/obj/item/proc/on_enter_storage(obj/item/storage/S as obj) - SEND_SIGNAL(src, COMSIG_STORAGE_ENTERED, S) - -// called when "found" in pockets and storage items. Returns 1 if the search should end. -/obj/item/proc/on_found(mob/finder as mob) - return + set_pixel_offsets(rand(-8, 8), rand(-8, 8)) /obj/item/verb/verb_pickup() set src in oview(1) @@ -731,7 +711,7 @@ modules/mob/living/carbon/human/life.dm if you die, you will be zoomed out. else if(!zoom && user.get_active_held_item() != src && wornslot == FALSE) to_chat(user, "You are too distracted to look through the [devicename], perhaps if it was in your active hand this might work better") cannotzoom = 1 - else if(!zoom && user.item_by_slot(wornslot) != src && wornslot != FALSE) + else if(!zoom && user.item_by_slot_id(wornslot) != src && wornslot != FALSE) to_chat(user, "You need to wear the [devicename] to look through it properly") cannotzoom = 1 //We checked above if they are a human and returned already if they weren't. @@ -801,7 +781,7 @@ modules/mob/living/carbon/human/life.dm if you die, you will be zoomed out. // . = ..() // update_action_buttons() -//* Armor +//* Armor *// /** * called to be checked for mob armor @@ -822,7 +802,7 @@ modules/mob/living/carbon/human/life.dm if you die, you will be zoomed out. damage = fetch_armor().resultant_damage(damage, tier, flag) return args.Copy() -//* Attack +//* Attack *// /** * grabs an attack verb to use @@ -872,7 +852,26 @@ modules/mob/living/carbon/human/life.dm if you die, you will be zoomed out. /obj/item/proc/is_shred(strict) return (damage_mode & DAMAGE_MODE_SHRED) -//* Interaction +//* Interaction *// + +/obj/item/attackby(obj/item/I, mob/user, list/params, clickchain_flags, damage_multiplier) + if(isturf(loc) && I.obj_storage?.allow_mass_gather && I.obj_storage.allow_mass_gather_via_click) + I.obj_storage.auto_handle_interacted_mass_pickup(new /datum/event_args/actor(user), src) + return CLICKCHAIN_DO_NOT_PROPAGATE | CLICKCHAIN_DID_SOMETHING + if(istype(I, /obj/item/cell) && !isnull(obj_cell_slot) && isnull(obj_cell_slot.cell) && obj_cell_slot.interaction_active(user)) + if(!user.transfer_item_to_loc(I, src)) + user.action_feedback(SPAN_WARNING("[I] is stuck to your hand!"), src) + return CLICKCHAIN_DO_NOT_PROPAGATE + user.visible_action_feedback( + target = src, + hard_range = obj_cell_slot.remove_is_discrete? 0 : MESSAGE_RANGE_CONSTRUCTION, + visible_hard = SPAN_NOTICE("[user] inserts [I] into [src]."), + audible_hard = SPAN_NOTICE("You hear something being slotted in."), + visible_self = SPAN_NOTICE("You insert [I] into [src]."), + ) + obj_cell_slot.insert_cell(I) + return CLICKCHAIN_DO_NOT_PROPAGATE | CLICKCHAIN_DID_SOMETHING + return ..() /** * Called when the item is in the active hand, and clicked; alternately, there is an 'activate held object' verb or you can hit pagedown. @@ -914,6 +913,10 @@ modules/mob/living/carbon/human/life.dm if you die, you will be zoomed out. log_construction(e_args, src, "removed cell [obj_cell_slot.cell] ([obj_cell_slot.cell.type])") e_args.performer.put_in_hands_or_drop(obj_cell_slot.remove_cell(e_args.performer)) return TRUE + if(!isnull(obj_storage) && obj_storage.allow_quick_empty && obj_storage.allow_quick_empty_via_attack_self) + var/turf/turf = get_turf(e_args.performer) + obj_storage.auto_handle_interacted_mass_dumping(e_args, turf) + return CLICKCHAIN_DO_NOT_PROPAGATE return FALSE /** @@ -924,10 +927,10 @@ modules/mob/living/carbon/human/life.dm if you die, you will be zoomed out. /obj/item/proc/attacksound_override(atom/target, attack_type) return -//* Carry Weight +//* Carry Weight *// /obj/item/proc/get_weight() - return weight + return weight + obj_storage?.get_containing_weight() /obj/item/proc/get_encumbrance() return encumbrance @@ -990,14 +993,42 @@ modules/mob/living/carbon/human/life.dm if you die, you will be zoomed out. worn_mob()?.update_item_slowdown() /obj/item/proc/propagate_weight(old_weight, new_weight) - if(!(item_flags & ITEM_IN_STORAGE)) - return - var/obj/item/storage/S = loc - if(!istype(S)) - return - S.stored_weight_changed(src, old_weight, new_weight) + loc?.on_contents_weight_change(src, old_weight, new_weight) -//* Materials +//* Interactions *// + +/obj/item/on_attack_hand(datum/event_args/actor/clickchain/e_args) + . = ..() + if(.) + return + + if(e_args.performer.is_in_inventory(src)) + if(e_args.performer.is_holding(src)) + if(obj_storage?.allow_open_via_offhand_click && obj_storage.auto_handle_interacted_open(e_args)) + return TRUE + else + if(obj_storage?.allow_open_via_equipped_click && obj_storage.auto_handle_interacted_open(e_args)) + return TRUE + if(!e_args.performer.is_holding(src)) + if(should_attempt_pickup(e_args) && attempt_pickup(e_args.performer)) + return TRUE + +//* Inventory *// + +/** + * Called when someone clisk us on a storage, before the storage handler's + * 'put item in' runs. Return FALSE to deny. + */ +/obj/item/proc/allow_auto_storage_insert(datum/event_args/actor/actor, datum/object_system/storage/storage) + return TRUE + +/obj/item/proc/on_exit_storage(datum/object_system/storage/storage) + SEND_SIGNAL(src, COMSIG_STORAGE_EXITED, storage) + +/obj/item/proc/on_enter_storage(datum/object_system/storage/storage) + SEND_SIGNAL(src, COMSIG_STORAGE_ENTERED, storage) + +//* Materials *// /obj/item/material_trait_brittle_shatter() var/datum/material/material = get_primary_material() @@ -1012,7 +1043,43 @@ modules/mob/living/carbon/human/life.dm if you die, you will be zoomed out. playsound(src, "shatter", 70, 1) qdel(src) -//? VV +//* Mouse *// + +/obj/item/MouseEntered(location, control, params) + ..() + SEND_SIGNAL(src, COMSIG_ITEM_MOUSE_ENTERED, usr) + +/obj/item/MouseExited(location, control, params) + ..() + SEND_SIGNAL(src, COMSIG_ITEM_MOUSE_EXITED, usr) + +//* Storage *// + +/obj/item/proc/get_weight_class() + return w_class + +/obj/item/proc/get_weight_volume() + return isnull(weight_volume)? global.w_class_to_volume[w_class || WEIGHT_CLASS_GIGANTIC] : weight_volume + +/obj/item/proc/set_weight_class(weight_class) + var/old = w_class + w_class = weight_class + loc?.on_contents_weight_class_change(src, old, weight_class) + +/obj/item/proc/set_weight_volume(volume) + var/old = weight_volume + weight_volume = volume + loc?.on_contents_weight_volume_change(src, old, volume) + +/** + * called when someone is opening a storage with us in it + * + * @return TRUE to stop the storage from opening + */ +/obj/item/proc/on_containing_storage_opening(datum/event_args/actor/actor, datum/object_system/storage/storage) + return FALSE + +//* VV *// /obj/item/vv_edit_var(var_name, var_value, mass_edit, raw_edit) switch(var_name) @@ -1040,5 +1107,19 @@ modules/mob/living/carbon/human/life.dm if you die, you will be zoomed out. // check, as worn_mob() returns /mob, not /living if(istype(L)) L.update_item_slowdown() + if(NAMEOF(src, w_class)) + if(!isnum(var_value) && !raw_edit) + return FALSE + if((var_value < WEIGHT_CLASS_MIN) || (var_value > WEIGHT_CLASS_MAX)) + return FALSE + set_weight_class(var_value) + return TRUE + if(NAMEOF(src, weight_volume)) + if(!isnum(var_value) && !raw_edit) + return FALSE + if(var_value < 0) + return FALSE + set_weight_volume(var_value) + return TRUE else return ..() diff --git a/code/game/objects/items/antag_spawners.dm b/code/game/objects/items/antag_spawners.dm index 9cd10e387e7..d4f951dac29 100644 --- a/code/game/objects/items/antag_spawners.dm +++ b/code/game/objects/items/antag_spawners.dm @@ -1,5 +1,5 @@ /obj/item/antag_spawner - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY var/used = 0 var/ghost_query_type = null var/searching = FALSE diff --git a/code/game/objects/items/balls.dm b/code/game/objects/items/balls.dm index 5c2fa1ba591..5532d734bcd 100644 --- a/code/game/objects/items/balls.dm +++ b/code/game/objects/items/balls.dm @@ -13,7 +13,7 @@ item_state = "tennis_classic" slot_flags = SLOT_MASK throw_range = 14 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL /obj/item/toy/tennis/rainbow name = "pseudo-euclidean interdimensional tennis sphere" diff --git a/code/game/objects/items/bodybag.dm b/code/game/objects/items/bodybag.dm index a7568239cd3..6c8fefdcafc 100644 --- a/code/game/objects/items/bodybag.dm +++ b/code/game/objects/items/bodybag.dm @@ -5,7 +5,7 @@ desc = "A folded bag designed for the storage and transportation of cadavers." icon = 'icons/obj/medical/bodybag.dmi' icon_state = "bodybag_folded" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL var/bag_type = /obj/structure/closet/body_bag diff --git a/code/game/objects/items/circuitboards/circuitboard.dm b/code/game/objects/items/circuitboards/circuitboard.dm index 54055db8f69..ce82992e42f 100644 --- a/code/game/objects/items/circuitboards/circuitboard.dm +++ b/code/game/objects/items/circuitboards/circuitboard.dm @@ -16,7 +16,7 @@ origin_tech = list(TECH_DATA = 2) density = FALSE anchored = FALSE - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL damage_force = 5.0 throw_force = 5.0 throw_speed = 3 diff --git a/code/game/objects/items/contraband.dm b/code/game/objects/items/contraband.dm index 1285d753abb..5091e45fc63 100644 --- a/code/game/objects/items/contraband.dm +++ b/code/game/objects/items/contraband.dm @@ -47,7 +47,7 @@ icon = 'icons/obj/storage.dmi' icon_state = "deliverycrate5" item_state = "table_parts" - w_class = ITEMSIZE_HUGE + w_class = WEIGHT_CLASS_HUGE /obj/item/stolenpackage/attack_self(mob/user) . = ..() @@ -145,27 +145,27 @@ /obj/item/storage/fancy/cigar/havana name = "\improper Havana cigar case" desc = "Save these for the fancy-pantses at the next CentCom black tie reception. You can't blow the smoke from such majestic stogies in just anyone's face." - can_hold = list(/obj/item/clothing/mask/smokable/cigarette/cigar/havana) + insertion_whitelist = list(/obj/item/clothing/mask/smokable/cigarette/cigar/havana) starts_with = list(/obj/item/clothing/mask/smokable/cigarette/cigar/havana = 7) /obj/item/storage/fancy/cigar/cohiba name = "\improper Cohiba Robusto cigar case" desc = "If Havana cigars were meant for the black tie reception, then these are meant to be family heirlooms instead of being smoked. These are the pinnacle of smoking luxury, make no mistake." - can_hold = list(/obj/item/clothing/mask/smokable/cigarette/cigar/cohiba) + insertion_whitelist = list(/obj/item/clothing/mask/smokable/cigarette/cigar/cohiba) starts_with = list(/obj/item/clothing/mask/smokable/cigarette/cigar/cohiba = 7) /obj/item/storage/fancy/cigar/taj name = "\improper S'rendarr's Hand case" desc = "A luxury medicinal cigar exported from Adhomai. The trifecta flag on the case showing a symbol of unity amongst producers of S'rendarr's from all Tajaran nations." icon_state = "cigarcase-taj" - can_hold = list(/obj/item/clothing/mask/smokable/cigarette/cigar/taj) + insertion_whitelist = list(/obj/item/clothing/mask/smokable/cigarette/cigar/taj) starts_with = list(/obj/item/clothing/mask/smokable/cigarette/cigar/taj = 7) /obj/item/storage/fancy/cigar/taj/premium name = "\improper S'rendarr's Own case" desc = "Truly luxurious medicinal cigars bearing the proof marks of the Confederate Commonwealth, the \"united\" galactic lobbying body of all three Tajaran states, marking these cigars as the best Adhomai has to offer." icon_state = "cigarcase-tajalt" - can_hold = list(/obj/item/clothing/mask/smokable/cigarette/cigar/taj/premium) + insertion_whitelist = list(/obj/item/clothing/mask/smokable/cigarette/cigar/taj/premium) starts_with = list(/obj/item/clothing/mask/smokable/cigarette/cigar/taj/premium = 7) @@ -175,7 +175,7 @@ icon = 'icons/obj/storage.dmi' icon_state = "deliverycrate5" item_state = "table_parts" - w_class = ITEMSIZE_HUGE + w_class = WEIGHT_CLASS_HUGE /obj/item/stolenpackageplus/attack_self(mob/user) . = ..() @@ -240,7 +240,7 @@ icon = 'icons/obj/storage.dmi' icon_state = "deliverycrate5" item_state = "table_parts" - w_class = ITEMSIZE_HUGE + w_class = WEIGHT_CLASS_HUGE /obj/item/mechasalvage/attack_self(mob/user) . = ..() diff --git a/code/game/objects/items/devices/PDA/PDA.dm b/code/game/objects/items/devices/PDA/PDA.dm index fcf428d6f48..09414202d85 100644 --- a/code/game/objects/items/devices/PDA/PDA.dm +++ b/code/game/objects/items/devices/PDA/PDA.dm @@ -9,7 +9,7 @@ GLOBAL_LIST_EMPTY(PDAs) icon = 'icons/obj/pda.dmi' icon_state = "pda" item_state = "electronic" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL slot_flags = SLOT_ID | SLOT_BELT rad_flags = RAD_BLOCK_CONTENTS item_flags = ITEM_NOBLUDGEON diff --git a/code/game/objects/items/devices/PDA/cart.dm b/code/game/objects/items/devices/PDA/cart.dm index f13acc8010b..ca9ab6b250a 100644 --- a/code/game/objects/items/devices/PDA/cart.dm +++ b/code/game/objects/items/devices/PDA/cart.dm @@ -50,7 +50,7 @@ var/list/civilian_cartridges = list( icon = 'icons/obj/pda.dmi' icon_state = "cart" item_state = "electronic" - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY drop_sound = 'sound/items/drop/component.ogg' pickup_sound = 'sound/items/pickup/component.ogg' diff --git a/code/game/objects/items/devices/advnifrepair.dm b/code/game/objects/items/devices/advnifrepair.dm index 75ad645fa92..63e049d0743 100644 --- a/code/game/objects/items/devices/advnifrepair.dm +++ b/code/game/objects/items/devices/advnifrepair.dm @@ -7,7 +7,7 @@ item_state = "gun" slot_flags = SLOT_BELT throw_force = 3 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL throw_speed = 5 throw_range = 10 materials_base = list(MAT_STEEL = 4000, MAT_GLASS = 6000) diff --git a/code/game/objects/items/devices/aicard.dm b/code/game/objects/items/devices/aicard.dm index 3194dcbe82b..12eeab47952 100644 --- a/code/game/objects/items/devices/aicard.dm +++ b/code/game/objects/items/devices/aicard.dm @@ -4,7 +4,7 @@ icon = 'icons/obj/pda.dmi' icon_state = "aicard" // aicard-full item_state = "aicard" - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL slot_flags = SLOT_BELT show_messages = 0 preserve_item = 1 diff --git a/code/game/objects/items/devices/binoculars.dm b/code/game/objects/items/devices/binoculars.dm index 003361c9127..6303a72736b 100644 --- a/code/game/objects/items/devices/binoculars.dm +++ b/code/game/objects/items/devices/binoculars.dm @@ -4,7 +4,7 @@ icon = 'icons/obj/device.dmi' icon_state = "binoculars" damage_force = 5.0 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL throw_force = 5.0 throw_range = 15 throw_speed = 3 diff --git a/code/game/objects/items/devices/body_snatcher_vr.dm b/code/game/objects/items/devices/body_snatcher_vr.dm index 522dd565f64..cc2517090be 100644 --- a/code/game/objects/items/devices/body_snatcher_vr.dm +++ b/code/game/objects/items/devices/body_snatcher_vr.dm @@ -7,7 +7,7 @@ item_state = "healthanalyzer" item_flags = ITEM_NOBLUDGEON | ITEM_ENCUMBERS_WHILE_HELD slot_flags = SLOT_BELT - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL materials_base = list(MAT_STEEL = 200) origin_tech = list(TECH_MAGNET = 2, TECH_BIO = 2, TECH_ILLEGAL = 1) diff --git a/code/game/objects/items/devices/chameleonproj.dm b/code/game/objects/items/devices/chameleonproj.dm index cb25a423658..40a96b4cd4f 100644 --- a/code/game/objects/items/devices/chameleonproj.dm +++ b/code/game/objects/items/devices/chameleonproj.dm @@ -7,7 +7,7 @@ throw_force = 5.0 throw_speed = 1 throw_range = 5 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL origin_tech = list(TECH_ILLEGAL = 4, TECH_MAGNET = 4) var/can_use = 1 var/obj/effect/dummy/chameleon/active_dummy = null diff --git a/code/game/objects/items/devices/communicator/communicator.dm b/code/game/objects/items/devices/communicator/communicator.dm index 5b0c5944856..919ac17c708 100644 --- a/code/game/objects/items/devices/communicator/communicator.dm +++ b/code/game/objects/items/devices/communicator/communicator.dm @@ -21,7 +21,7 @@ var/global/list/obj/item/communicator/all_communicators = list() communications across different stations, planets, or even star systems." icon = 'icons/obj/device.dmi' icon_state = "communicator_home" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL slot_flags = SLOT_ID | SLOT_BELT show_messages = 1 diff --git a/code/game/objects/items/devices/debugger.dm b/code/game/objects/items/devices/debugger.dm index 731a774ba44..2fb48820002 100644 --- a/code/game/objects/items/devices/debugger.dm +++ b/code/game/objects/items/devices/debugger.dm @@ -10,7 +10,7 @@ icon = 'icons/obj/hacktool.dmi' icon_state = "hacktool-g" damage_force = 5.0 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL throw_force = 5.0 throw_range = 15 throw_speed = 3 diff --git a/code/game/objects/items/devices/defib.dm b/code/game/objects/items/devices/defib.dm index 209782d42fa..19afd5eef28 100644 --- a/code/game/objects/items/devices/defib.dm +++ b/code/game/objects/items/devices/defib.dm @@ -13,7 +13,7 @@ damage_force = 5 throw_force = 6 preserve_item = 1 - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY origin_tech = list(TECH_BIO = 4, TECH_POWER = 2) action_button_name = "Remove/Replace Paddles" @@ -133,9 +133,9 @@ if(!istype(M)) return 0 //not equipped - if((slot_flags & SLOT_BACK) && M.item_by_slot(SLOT_ID_BACK) == src) + if((slot_flags & SLOT_BACK) && M.item_by_slot_id(SLOT_ID_BACK) == src) return 1 - if((slot_flags & SLOT_BELT) && M.item_by_slot(SLOT_ID_BELT) == src) + if((slot_flags & SLOT_BELT) && M.item_by_slot_id(SLOT_ID_BELT) == src) return 1 return 0 @@ -162,7 +162,7 @@ desc = "A belt-equipped defibrillator that can be rapidly deployed." icon_state = "defibcompact" item_state = "defibcompact" - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL slot_flags = SLOT_BELT origin_tech = list(TECH_BIO = 5, TECH_POWER = 3) @@ -195,7 +195,7 @@ gender = PLURAL damage_force = 2 throw_force = 6 - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY var/safety = 1 //if you can zap people with the paddles on harm mode var/combat = 0 //If it can be used to revive people wearing thick clothing (e.g. spacesuits) diff --git a/code/game/objects/items/devices/flash.dm b/code/game/objects/items/devices/flash.dm index 605d91a181a..aab42892826 100644 --- a/code/game/objects/items/devices/flash.dm +++ b/code/game/objects/items/devices/flash.dm @@ -5,7 +5,7 @@ icon_state = "flash" item_state = "flashtool" throw_force = 5 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL throw_speed = 4 throw_range = 10 origin_tech = list(TECH_MAGNET = 2, TECH_COMBAT = 1) diff --git a/code/game/objects/items/devices/flashlight.dm b/code/game/objects/items/devices/flashlight.dm index ea8a17fc591..9088e9bf717 100644 --- a/code/game/objects/items/devices/flashlight.dm +++ b/code/game/objects/items/devices/flashlight.dm @@ -3,7 +3,7 @@ desc = "A hand-held emergency light." icon = 'icons/obj/lighting.dmi' icon_state = "flashlight" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL slot_flags = SLOT_BELT materials_base = list(MAT_STEEL = 50, MAT_GLASS = 20) action_button_name = "Toggle Flashlight" @@ -234,7 +234,7 @@ pickup_sound = 'sound/items/pickup/accessory.ogg' slot_flags = SLOT_EARS brightness_on = 2 - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY power_use = 0 flashlight_range = 2 light_wedge = LIGHT_OMNI @@ -265,7 +265,7 @@ icon_state = "maglight" damage_force = 10 slot_flags = SLOT_BELT - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL attack_verb = list ("smacked", "thwacked", "thunked") attack_sound = "swing_hit" materials_base = list(MAT_STEEL = 200, MAT_GLASS = 50) @@ -279,7 +279,7 @@ item_state = null brightness_on = 2 flashlight_range = 2 - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY power_use = 0 // the desk lamps are a bit special @@ -289,7 +289,7 @@ icon_state = "lamp" damage_force = 10 brightness_on = 5 - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY power_use = 0 on = 1 light_wedge = LIGHT_OMNI @@ -319,7 +319,7 @@ desc = "A red standard-issue flare. There are instructions on the side reading 'pull cord, make light'." icon_state = "flare" item_state = "flare" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL brightness_on = 8 // Pretty bright. flashlight_power = 0.8 @@ -387,7 +387,7 @@ /obj/item/flashlight/glowstick name = "green glowstick" desc = "A green military-grade glowstick." - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL brightness_on = 4 icon_state = "glowstick" item_state = "glowstick" diff --git a/code/game/objects/items/devices/geiger.dm b/code/game/objects/items/devices/geiger.dm index ca4139fbbd4..6206e37f361 100644 --- a/code/game/objects/items/devices/geiger.dm +++ b/code/game/objects/items/devices/geiger.dm @@ -14,7 +14,7 @@ icon = 'icons/obj/device.dmi' icon_state = "geiger_off" item_state = "multitool" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL rad_flags = RAD_NO_CONTAMINATE | RAD_BLOCK_CONTENTS materials_base = list(MAT_STEEL = 200, MAT_GLASS = 100) diff --git a/code/game/objects/items/devices/gps.dm b/code/game/objects/items/devices/gps.dm index d3e3cf61ede..d500cce74c5 100644 --- a/code/game/objects/items/devices/gps.dm +++ b/code/game/objects/items/devices/gps.dm @@ -22,7 +22,7 @@ desc = "Triangulates the approximate co-ordinates using a nearby satellite network." icon = 'icons/obj/gps.dmi' icon_state = "gps-gen" - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY slot_flags = SLOT_BELT origin_tech = list(TECH_MATERIAL = 2, TECH_BLUESPACE = 2, TECH_MAGNET = 1) materials_base = list(MAT_STEEL = 500) @@ -601,7 +601,7 @@ throw_force = 10 sharp = 1 edge = 1 - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL origin_tech = list(TECH_COMBAT = 4, TECH_ILLEGAL = 4) attack_verb = list("sliced", "chopped", "stabbed", "pierced") tool_speed = 2 // Use a real axe if you want to chop logs. diff --git a/code/game/objects/items/devices/holowarrant.dm b/code/game/objects/items/devices/holowarrant.dm index 3713cbfcc7f..6735bd3f250 100644 --- a/code/game/objects/items/devices/holowarrant.dm +++ b/code/game/objects/items/devices/holowarrant.dm @@ -6,7 +6,7 @@ item_state = "flashtool" item_flags = ITEM_NOBLUDGEON | ITEM_ENCUMBERS_WHILE_HELD throw_force = 5 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL throw_speed = 4 throw_range = 10 var/datum/data/record/warrant/active diff --git a/code/game/objects/items/devices/megaphone.dm b/code/game/objects/items/devices/megaphone.dm index f00117a7735..310f2d4973f 100644 --- a/code/game/objects/items/devices/megaphone.dm +++ b/code/game/objects/items/devices/megaphone.dm @@ -3,7 +3,7 @@ desc = "A device used to project your voice. Loudly." icon = 'icons/obj/device.dmi' icon_state = "megaphone" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL var/spamcheck = 0 var/emagged = 0 diff --git a/code/game/objects/items/devices/multitool.dm b/code/game/objects/items/devices/multitool.dm index bda036525d6..89e1ccbc382 100755 --- a/code/game/objects/items/devices/multitool.dm +++ b/code/game/objects/items/devices/multitool.dm @@ -11,7 +11,7 @@ icon = 'icons/obj/device.dmi' icon_state = "multitool" damage_force = 5.0 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL throw_force = 5.0 throw_range = 15 throw_speed = 3 diff --git a/code/game/objects/items/devices/paicard.dm b/code/game/objects/items/devices/paicard.dm index 48b1e2d8c3c..310b2988846 100644 --- a/code/game/objects/items/devices/paicard.dm +++ b/code/game/objects/items/devices/paicard.dm @@ -5,7 +5,7 @@ GLOBAL_LIST_BOILERPLATE(all_pai_cards, /obj/item/paicard) icon = 'icons/obj/pda.dmi' icon_state = "pai" item_state = "electronic" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL slot_flags = SLOT_BELT origin_tech = list(TECH_DATA = 2) show_messages = FALSE diff --git a/code/game/objects/items/devices/powersink.dm b/code/game/objects/items/devices/powersink.dm index 55f0ec69998..d4d8b82e28b 100644 --- a/code/game/objects/items/devices/powersink.dm +++ b/code/game/objects/items/devices/powersink.dm @@ -5,7 +5,7 @@ desc = "A nulling power sink which drains energy from electrical systems." icon = 'icons/obj/device.dmi' icon_state = "powersink0" - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY throw_force = 5 throw_speed = 1 throw_range = 2 diff --git a/code/game/objects/items/devices/radio/beacon.dm b/code/game/objects/items/devices/radio/beacon.dm index 251606c0bcc..1aa2c8dbea5 100644 --- a/code/game/objects/items/devices/radio/beacon.dm +++ b/code/game/objects/items/devices/radio/beacon.dm @@ -44,7 +44,7 @@ GLOBAL_LIST_BOILERPLATE(all_beacons, /obj/item/radio/beacon) /obj/item/radio/beacon/anchored desc = "A beacon used by a teleporter. This one appears to be bolted to the ground." anchored = TRUE - w_class = ITEMSIZE_HUGE + w_class = WEIGHT_CLASS_HUGE //randpixel = 0 var/repair_fail_chance = 35 diff --git a/code/game/objects/items/devices/radio/electropack.dm b/code/game/objects/items/devices/radio/electropack.dm index c71f89337e1..ce568341ff7 100644 --- a/code/game/objects/items/devices/radio/electropack.dm +++ b/code/game/objects/items/devices/radio/electropack.dm @@ -9,14 +9,14 @@ item_state = "electropack" frequency = 1449 slot_flags = SLOT_BACK - w_class = ITEMSIZE_HUGE + w_class = WEIGHT_CLASS_HUGE materials_base = list(MAT_STEEL = 10000, MAT_GLASS = 2500) var/code = 2 /obj/item/radio/electropack/attack_hand(mob/user, list/params) - if(src == user.item_by_slot(SLOT_ID_BACK)) + if(src == user.item_by_slot_id(SLOT_ID_BACK)) to_chat(user, "You need help taking this off!") return ..() diff --git a/code/game/objects/items/devices/radio/encryptionkey.dm b/code/game/objects/items/devices/radio/encryptionkey.dm index 0d7588d4a37..7594ac317e4 100755 --- a/code/game/objects/items/devices/radio/encryptionkey.dm +++ b/code/game/objects/items/devices/radio/encryptionkey.dm @@ -4,7 +4,7 @@ desc = "An encryption key for a radio headset. Contains cypherkeys." icon = 'icons/obj/radio.dmi' icon_state = "cypherkey" - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY slot_flags = SLOT_EARS var/translate_binary = 0 var/translate_hive = 0 diff --git a/code/game/objects/items/devices/radio/intercom.dm b/code/game/objects/items/devices/radio/intercom.dm index c9c6601d443..87af95ef2b8 100644 --- a/code/game/objects/items/devices/radio/intercom.dm +++ b/code/game/objects/items/devices/radio/intercom.dm @@ -7,7 +7,7 @@ CREATE_WALL_MOUNTING_TYPES_SHIFTED(/obj/item/radio/intercom, 28) plane = TURF_PLANE layer = ABOVE_TURF_LAYER anchored = 1 - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY canhear_range = 2 atom_flags = NOBLOODY var/circuit = /obj/item/circuitboard/intercom diff --git a/code/game/objects/items/devices/radio/radio.dm b/code/game/objects/items/devices/radio/radio.dm index 6c688e783aa..b113f18e479 100644 --- a/code/game/objects/items/devices/radio/radio.dm +++ b/code/game/objects/items/devices/radio/radio.dm @@ -55,7 +55,7 @@ GLOBAL_LIST_INIT(default_medbay_channels, list( slot_flags = SLOT_BELT throw_speed = 2 throw_range = 9 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL show_messages = 1 //Bluespace radios talk directly to telecomms equipment @@ -797,7 +797,7 @@ GLOBAL_DATUM_INIT(virtual_announcer_ai, /mob/living/silicon/ai/announcer, new(nu damage_force = 5 throw_force = 6 preserve_item = 1 - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY action_button_name = "Remove/Replace Handset" var/obj/item/radio/bluespace_handset/linked/handset = /obj/item/radio/bluespace_handset/linked @@ -859,9 +859,9 @@ GLOBAL_DATUM_INIT(virtual_announcer_ai, /mob/living/silicon/ai/announcer, new(nu if(!istype(M)) return 0 //not equipped - if((slot_flags & SLOT_BACK) && M.item_by_slot(SLOT_ID_BACK) == src) + if((slot_flags & SLOT_BACK) && M.item_by_slot_id(SLOT_ID_BACK) == src) return 1 - if((slot_flags & SLOT_BACK) && M.item_by_slot(SLOT_ID_SUIT_STORAGE) == src) + if((slot_flags & SLOT_BACK) && M.item_by_slot_id(SLOT_ID_SUIT_STORAGE) == src) return 1 return 0 @@ -885,7 +885,7 @@ GLOBAL_DATUM_INIT(virtual_announcer_ai, /mob/living/silicon/ai/announcer, new(nu bluespace_radio = TRUE icon_state = "signaller" slot_flags = null - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY /obj/item/radio/bluespace_handset/linked var/obj/item/bluespace_radio/base_unit diff --git a/code/game/objects/items/devices/scanners_vr.dm b/code/game/objects/items/devices/scanners_vr.dm index c224fd64149..8027f484352 100644 --- a/code/game/objects/items/devices/scanners_vr.dm +++ b/code/game/objects/items/devices/scanners_vr.dm @@ -9,7 +9,7 @@ var/global/mob/living/carbon/human/dummy/mannequin/sleevemate_mob item_state = "healthanalyzer" slot_flags = SLOT_BELT throw_force = 3 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL throw_speed = 5 throw_range = 10 materials_base = list(MAT_STEEL = 200) diff --git a/code/game/objects/items/devices/spy_bug.dm b/code/game/objects/items/devices/spy_bug.dm index dd8673d30f2..b8f2560a9a5 100644 --- a/code/game/objects/items/devices/spy_bug.dm +++ b/code/game/objects/items/devices/spy_bug.dm @@ -4,7 +4,7 @@ icon = 'icons/obj/grenade.dmi' icon_state = "camgrenade" item_state = "empgrenade" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL damage_force = 0 throw_force = 5.0 throw_range = 15 @@ -48,7 +48,7 @@ icon_state = "camgrenadebroken" item_state = "empgrenade" damage_force = 5.0 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL throw_force = 5.0 throw_range = 15 throw_speed = 3 @@ -61,7 +61,7 @@ icon_state = "eshield" item_state = "nothing" layer = TURF_LAYER+0.2 - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY slot_flags = SLOT_EARS origin_tech = list(TECH_ENGINEERING = 1, TECH_ILLEGAL = 3) //crush it and you lose the data damage_force = 0 @@ -76,7 +76,7 @@ icon_state = "eshield" item_state = "nothing" layer = TURF_LAYER+0.2 - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY slot_flags = SLOT_EARS origin_tech = list(TECH_DATA = 1, TECH_ENGINEERING = 1, TECH_ILLEGAL = 3) camtype = /obj/machinery/camera/bug/spy @@ -130,7 +130,7 @@ icon = 'icons/obj/device.dmi' icon_state = "forensic0" item_state = "electronic" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL origin_tech = list(TECH_DATA = 1, TECH_ENGINEERING = 1) var/operating = 0 diff --git a/code/game/objects/items/devices/suit_cooling.dm b/code/game/objects/items/devices/suit_cooling.dm index da6fe4fd407..3f95b498c04 100644 --- a/code/game/objects/items/devices/suit_cooling.dm +++ b/code/game/objects/items/devices/suit_cooling.dm @@ -1,7 +1,7 @@ /obj/item/suit_cooling_unit name = "portable suit cooling unit" desc = "A portable heat sink and liquid cooled radiator that can be hooked up to a space suit's existing temperature controls to provide industrial levels of cooling." - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY icon = 'icons/obj/device.dmi' icon_state = "suitcooler0" slot_flags = SLOT_BACK @@ -212,7 +212,7 @@ /obj/item/suit_cooling_unit/emergency icon_state = "esuitcooler" cell = /obj/item/cell - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL /obj/item/suit_cooling_unit/emergency/updateicon() return diff --git a/code/game/objects/items/devices/t_scanner.dm b/code/game/objects/items/devices/t_scanner.dm index 550e5c1b1ba..0ae210b3278 100644 --- a/code/game/objects/items/devices/t_scanner.dm +++ b/code/game/objects/items/devices/t_scanner.dm @@ -7,7 +7,7 @@ icon_state = "t-ray0" item_state = "t-ray" slot_flags = SLOT_BELT - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL materials_base = list(MAT_STEEL = 150) origin_tech = list(TECH_MAGNET = 1, TECH_ENGINEERING = 1) diff --git a/code/game/objects/items/devices/tape_recorder/cassette_tape.dm b/code/game/objects/items/devices/tape_recorder/cassette_tape.dm index 3c1749089d6..70ebd1ac3bf 100644 --- a/code/game/objects/items/devices/tape_recorder/cassette_tape.dm +++ b/code/game/objects/items/devices/tape_recorder/cassette_tape.dm @@ -18,7 +18,7 @@ icon = 'icons/obj/device.dmi' icon_state = "tape_white" item_state = "analyzer" - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY materials_base = list(MAT_STEEL=20, "glass"=5) damage_force = 1 throw_force = 0 diff --git a/code/game/objects/items/devices/tape_recorder/tape_recorder.dm b/code/game/objects/items/devices/tape_recorder/tape_recorder.dm index 918510e368a..90d2b459bd5 100644 --- a/code/game/objects/items/devices/tape_recorder/tape_recorder.dm +++ b/code/game/objects/items/devices/tape_recorder/tape_recorder.dm @@ -4,7 +4,7 @@ icon_state = "taperecorder_empty" item_state = "analyzer" icon = 'icons/obj/device.dmi' - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL slot_flags = SLOT_BELT throw_force = 2 throw_speed = 4 diff --git a/code/game/objects/items/devices/taperecorder.dm b/code/game/objects/items/devices/taperecorder.dm index ae827048e05..508d252ec86 100644 --- a/code/game/objects/items/devices/taperecorder.dm +++ b/code/game/objects/items/devices/taperecorder.dm @@ -4,7 +4,7 @@ icon_state = "taperecorder_empty" item_state = "analyzer" icon = 'icons/obj/device.dmi' - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL materials_base = list(MAT_STEEL = 60, MAT_GLASS = 30) @@ -369,7 +369,7 @@ icon = 'icons/obj/device.dmi' icon_state = "tape_white" item_state = "analyzer" - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY materials_base = list(MAT_STEEL=20, "glass"=5) damage_force = 1 throw_force = 0 diff --git a/code/game/objects/items/devices/text_to_speech.dm b/code/game/objects/items/devices/text_to_speech.dm index 25c5f20bfa6..71c444de8c5 100644 --- a/code/game/objects/items/devices/text_to_speech.dm +++ b/code/game/objects/items/devices/text_to_speech.dm @@ -3,7 +3,7 @@ desc = "A device that speaks an inputted message. Given to crew which can not speak properly or at all." icon = 'icons/obj/integrated_electronics/electronic_setups.dmi' icon_state = "setup_small_off" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL var/named var/activated = FALSE var/mob/linked_user diff --git a/code/game/objects/items/devices/traitordevices.dm b/code/game/objects/items/devices/traitordevices.dm index 66f9540758b..4bf461a56d7 100644 --- a/code/game/objects/items/devices/traitordevices.dm +++ b/code/game/objects/items/devices/traitordevices.dm @@ -19,7 +19,7 @@ effective or pretty fucking useless. desc = "A strange device with twin antennas." icon_state = "batterer" throw_force = 5 - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY throw_speed = 4 throw_range = 10 item_state = "electronic" diff --git a/code/game/objects/items/devices/translator.dm b/code/game/objects/items/devices/translator.dm index 5a2c051acb0..a80be8e302c 100644 --- a/code/game/objects/items/devices/translator.dm +++ b/code/game/objects/items/devices/translator.dm @@ -4,7 +4,7 @@ desc = "This handy device appears to translate the languages it hears into onscreen text for a user." icon = 'icons/obj/device.dmi' icon_state = "translator" - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL origin_tech = list(TECH_DATA = 3, TECH_ENGINEERING = 3) /// our translation context; set to path to start as path var/datum/translation_context/context = /datum/translation_context/simple/universal_translator @@ -158,7 +158,7 @@ name = "translator earpiece" desc = "This handy device appears to translate the languages it hears into another language for a user." icon_state = "earpiece" - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY slot_flags = SLOT_EARS visual = 0 audio = 1 diff --git a/code/game/objects/items/devices/tvcamera.dm b/code/game/objects/items/devices/tvcamera.dm index 1301e9265e2..4dc9e79536b 100644 --- a/code/game/objects/items/devices/tvcamera.dm +++ b/code/game/objects/items/devices/tvcamera.dm @@ -4,7 +4,7 @@ icon = 'icons/obj/device.dmi' icon_state = "camcorder" item_state = "camcorder" - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY slot_flags = SLOT_BELT var/channel = "Tether News Feed" var/obj/machinery/camera/network/thunder/camera diff --git a/code/game/objects/items/devices/whistle.dm b/code/game/objects/items/devices/whistle.dm index 662185d6905..401ab578fcb 100644 --- a/code/game/objects/items/devices/whistle.dm +++ b/code/game/objects/items/devices/whistle.dm @@ -4,7 +4,7 @@ icon = 'icons/obj/device.dmi' icon_state = "voice0" item_state = "flashbang" //looks exactly like a flash (and nothing like a flashbang) - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY slot_flags = SLOT_EARS var/use_message = "Halt! Security!" diff --git a/code/game/objects/items/glassjar.dm b/code/game/objects/items/glassjar.dm index ac04f62cefb..719cf51484a 100644 --- a/code/game/objects/items/glassjar.dm +++ b/code/game/objects/items/glassjar.dm @@ -3,7 +3,7 @@ desc = "A small empty jar." icon = 'icons/obj/items.dmi' icon_state = "jar" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL materials_base = list(MAT_GLASS = 200) item_flags = ITEM_NOBLUDGEON | ITEM_ENCUMBERS_WHILE_HELD var/list/accept_mobs = list(/mob/living/simple_mob/animal/passive/lizard, /mob/living/simple_mob/animal/passive/mouse, /mob/living/simple_mob/animal/sif/leech, /mob/living/simple_mob/animal/sif/frostfly, /mob/living/simple_mob/animal/sif/glitterfly) diff --git a/code/game/objects/items/godfigures.dm b/code/game/objects/items/godfigures.dm index 386105ac0f9..dc1f8fa2fba 100644 --- a/code/game/objects/items/godfigures.dm +++ b/code/game/objects/items/godfigures.dm @@ -8,7 +8,7 @@ throw_speed = 1 throw_range = 4 throw_force = 10 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL /obj/item/godfig/attack_self(mob/user) . = ..() diff --git a/code/game/objects/items/gunbox.dm b/code/game/objects/items/gunbox.dm index d78b46ad8df..2561a727adb 100644 --- a/code/game/objects/items/gunbox.dm +++ b/code/game/objects/items/gunbox.dm @@ -44,7 +44,7 @@ desc = "A secure box containing a Detective's sidearm." icon = 'icons/obj/storage.dmi' icon_state = "gunbox" - w_class = ITEMSIZE_HUGE + w_class = WEIGHT_CLASS_HUGE /obj/item/gunbox/attack_self(mob/user) var/list/options = list() @@ -65,7 +65,7 @@ desc = "A secure box containing a marksman rifle." icon = 'icons/obj/storage.dmi' icon_state = "gunbox" - w_class = ITEMSIZE_HUGE + w_class = WEIGHT_CLASS_HUGE /obj/item/gunbox/marksman/attack_self(mob/user) var/list/options = list() diff --git a/code/game/objects/items/id_cards/cards.dm b/code/game/objects/items/id_cards/cards.dm index 38a6a83c067..4ce9ce5d66d 100644 --- a/code/game/objects/items/id_cards/cards.dm +++ b/code/game/objects/items/id_cards/cards.dm @@ -14,7 +14,7 @@ desc = "Does card things." icon = 'icons/obj/card_cit.dmi' icon_state = "generic" - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY slot_flags = SLOT_ID | SLOT_EARS var/associated_account_number = 0 diff --git a/code/game/objects/items/inflatables.dm b/code/game/objects/items/inflatables.dm index 4243b3ee3a9..a3e6c8c5b5a 100644 --- a/code/game/objects/items/inflatables.dm +++ b/code/game/objects/items/inflatables.dm @@ -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 = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL var/deploy_path = /obj/structure/inflatable /obj/item/inflatable/attack_self(mob/user) @@ -66,11 +66,11 @@ name = "inflatable barrier box" desc = "Contains inflatable walls and doors." icon_state = "inf_box" - w_class = ITEMSIZE_NORMAL - max_storage_space = ITEMSIZE_COST_NORMAL * 7 - can_hold = list(/obj/item/inflatable) + w_class = WEIGHT_CLASS_NORMAL + max_combined_volume = WEIGHT_VOLUME_NORMAL * 7 + insertion_whitelist = list(/obj/item/inflatable) -/obj/item/storage/briefcase/inflatable/PopulateContents() +/obj/item/storage/briefcase/inflatable/legacy_spawn_contents() . = ..() new /obj/item/inflatable/door(src) new /obj/item/inflatable/door(src) diff --git a/code/game/objects/items/latexballoon.dm b/code/game/objects/items/latexballoon.dm index a6f242cc67a..8c5ecb1731b 100644 --- a/code/game/objects/items/latexballoon.dm +++ b/code/game/objects/items/latexballoon.dm @@ -9,7 +9,7 @@ item_state = "lgloves" damage_force = 0 throw_force = 0 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL throw_speed = 1 throw_range = 15 var/state diff --git a/code/game/objects/items/paintkit.dm b/code/game/objects/items/paintkit.dm index 981d42101f6..bab47200e27 100644 --- a/code/game/objects/items/paintkit.dm +++ b/code/game/objects/items/paintkit.dm @@ -1,7 +1,7 @@ /obj/item/kit icon_state = "modkit" icon = 'icons/obj/device.dmi' - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL var/new_name = "custom item" var/new_desc = "A custom item." var/new_fluff = "A custom item." diff --git a/code/game/objects/items/pizza_voucher.dm b/code/game/objects/items/pizza_voucher.dm index 060e9f4c5f1..fc71e9fa4f0 100644 --- a/code/game/objects/items/pizza_voucher.dm +++ b/code/game/objects/items/pizza_voucher.dm @@ -5,7 +5,7 @@ icon_state = "pizza_voucher" var/spent = FALSE var/special_delivery = FALSE - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL /obj/item/pizzavoucher/Initialize(mapload) . = ..() diff --git a/code/game/objects/items/scanners/atmos.dm b/code/game/objects/items/scanners/atmos.dm index 7adaaa7d025..fb10b13e407 100644 --- a/code/game/objects/items/scanners/atmos.dm +++ b/code/game/objects/items/scanners/atmos.dm @@ -4,7 +4,7 @@ icon = 'icons/obj/device.dmi' icon_state = "atmos" item_state = "analyzer" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL slot_flags = SLOT_BELT throw_force = 5 throw_speed = 4 @@ -23,7 +23,7 @@ icon = 'icons/obj/device.dmi' icon_state = "atmos" item_state = "analyzer" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL slot_flags = SLOT_BELT throw_force = 5 throw_speed = 4 diff --git a/code/game/objects/items/scanners/health.dm b/code/game/objects/items/scanners/health.dm index 3a8ec3c7186..01754f56c30 100644 --- a/code/game/objects/items/scanners/health.dm +++ b/code/game/objects/items/scanners/health.dm @@ -6,7 +6,7 @@ item_state = "healthanalyzer" slot_flags = SLOT_BELT throw_force = 3 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL throw_speed = 5 throw_range = 10 materials_base = list(MAT_STEEL = 200) diff --git a/code/game/objects/items/scanners/reagent.dm b/code/game/objects/items/scanners/reagent.dm index 6d46e8e6a19..b76223f485b 100644 --- a/code/game/objects/items/scanners/reagent.dm +++ b/code/game/objects/items/scanners/reagent.dm @@ -4,7 +4,7 @@ icon = 'icons/obj/device.dmi' icon_state = "spectrometer" item_state = "analyzer" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL slot_flags = SLOT_BELT throw_force = 5 throw_speed = 4 diff --git a/code/game/objects/items/scanners/slime.dm b/code/game/objects/items/scanners/slime.dm index 2be81db996f..2995258d825 100644 --- a/code/game/objects/items/scanners/slime.dm +++ b/code/game/objects/items/scanners/slime.dm @@ -4,7 +4,7 @@ item_state = "xenobio" icon = 'icons/obj/device.dmi' origin_tech = list(TECH_BIO = 1) - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL throw_force = 0 throw_speed = 3 throw_range = 7 diff --git a/code/game/objects/items/scanners/spectrometer.dm b/code/game/objects/items/scanners/spectrometer.dm index bc3cdd1c386..c104792376b 100644 --- a/code/game/objects/items/scanners/spectrometer.dm +++ b/code/game/objects/items/scanners/spectrometer.dm @@ -3,7 +3,7 @@ desc = "A hand-held mass spectrometer which identifies trace chemicals in a blood sample." icon = 'icons/obj/device.dmi' icon_state = "spectrometer" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL atom_flags = OPENCONTAINER slot_flags = SLOT_BELT throw_force = 5 diff --git a/code/game/objects/items/spritechanger.dm b/code/game/objects/items/spritechanger.dm index 62a031f1510..aabc8148777 100644 --- a/code/game/objects/items/spritechanger.dm +++ b/code/game/objects/items/spritechanger.dm @@ -9,7 +9,7 @@ after the sprite has been set you can use it again to remove overlays that may h icon = 'icons/obj/device.dmi' icon_state = "flash" item_state = "flashtool" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL var/path var/state diff --git a/code/game/objects/items/stacks/marker_beacons.dm b/code/game/objects/items/stacks/marker_beacons.dm index 5f37614594e..9be024a7645 100644 --- a/code/game/objects/items/stacks/marker_beacons.dm +++ b/code/game/objects/items/stacks/marker_beacons.dm @@ -26,7 +26,7 @@ var/list/marker_beacon_colors = list( icon_state = "marker" max_amount = 100 no_variants = TRUE - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL var/picked_color = "random" /obj/item/stack/marker_beacon/ten diff --git a/code/game/objects/items/stacks/medical.dm b/code/game/objects/items/stacks/medical.dm index 81d7dfc0985..6c93e5816e0 100644 --- a/code/game/objects/items/stacks/medical.dm +++ b/code/game/objects/items/stacks/medical.dm @@ -4,7 +4,7 @@ icon = 'icons/obj/stacks.dmi' amount = 10 max_amount = 10 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL throw_speed = 4 throw_range = 20 var/heal_brute = 0 @@ -397,7 +397,7 @@ user.visible_message("\The [user] fumbles [src].", "You fumble [src].", "You hear something being wrapped.") return if(ishuman(user)) - var/obj/item/stack/medical/splint/S = split(1) + var/obj/item/stack/medical/splint/S = split(1, user) if(S) if(affecting.apply_splint(S)) S.forceMove(affecting) diff --git a/code/game/objects/items/stacks/nanopaste.dm b/code/game/objects/items/stacks/nanopaste.dm index 054b2958d5c..4f5e15997fe 100644 --- a/code/game/objects/items/stacks/nanopaste.dm +++ b/code/game/objects/items/stacks/nanopaste.dm @@ -7,7 +7,7 @@ origin_tech = list(TECH_MATERIAL = 4, TECH_ENGINEERING = 3) amount = 10 tool_speed = 0.75 //Used in surgery, shouldn't be the same speed as a normal screwdriver on mechanical organ repair. - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL no_variants = FALSE var/restoration_external = 5 var/restoration_internal = 20 diff --git a/code/game/objects/items/stacks/rods.dm b/code/game/objects/items/stacks/rods.dm index 65ee3f10bac..13af5cc22f9 100644 --- a/code/game/objects/items/stacks/rods.dm +++ b/code/game/objects/items/stacks/rods.dm @@ -3,7 +3,7 @@ desc = "Some rods. Can be used for building, or something." singular_name = "metal rod" icon_state = "rods" - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL damage_force = 9.0 throw_force = 15.0 throw_speed = 5 diff --git a/code/game/objects/items/stacks/sandbag.dm b/code/game/objects/items/stacks/sandbag.dm index 3dc35bc7663..06915faf904 100644 --- a/code/game/objects/items/stacks/sandbag.dm +++ b/code/game/objects/items/stacks/sandbag.dm @@ -4,7 +4,7 @@ desc = "A bag designed to be filled with sand." singular_name = "empty sandbag" icon_state = "sandbag_empty" - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL damage_force = 1 throw_force = 1 throw_speed = 5 @@ -51,7 +51,7 @@ desc = "This is a synthetic bag tightly packed with sand. It is designed to provide structural support and serve as a portable barrier." singular_name = "sandbag" icon_state = "sandbags" - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL damage_force = 10 throw_force = 15 throw_speed = 3 diff --git a/code/game/objects/items/stacks/stack.dm b/code/game/objects/items/stacks/stack.dm index 6f42300ce14..a6dd4d5a23f 100644 --- a/code/game/objects/items/stacks/stack.dm +++ b/code/game/objects/items/stacks/stack.dm @@ -173,9 +173,9 @@ S.use_charge(charge_costs[i] * used) // Doesn't need to be deleted return TRUE -/obj/item/stack/proc/add(extra) +/obj/item/stack/proc/add(extra, force) if(!uses_charge) - if(amount + extra > get_max_amount()) + if((amount + extra > get_max_amount()) && !force) return FALSE else amount += extra @@ -218,18 +218,18 @@ /// Creates a new stack with the specified amount. // todo: refactor and combine /change_stack into here -/obj/item/stack/proc/split(tamount) +/obj/item/stack/proc/split(tamount, atom/where, force) if (!amount) return null if (uses_charge) return null - var/transfer = max(min(tamount, src.amount, initial(max_amount)), 0) + var/transfer = max(min(tamount, src.amount, force? INFINITY : initial(max_amount)), 0) var/orig_amount = src.amount if (transfer && src.use(transfer)) var/make_type = isnull(split_type)? type : split_type - var/obj/item/stack/newstack = new make_type(loc, transfer, FALSE) + var/obj/item/stack/newstack = new make_type(where, transfer, FALSE) newstack.color = color if (prob(transfer/orig_amount * 100)) transfer_fingerprints_to(newstack) diff --git a/code/game/objects/items/stacks/telecrystal.dm b/code/game/objects/items/stacks/telecrystal.dm index f53c31ff955..5d6c7ba89ad 100644 --- a/code/game/objects/items/stacks/telecrystal.dm +++ b/code/game/objects/items/stacks/telecrystal.dm @@ -5,7 +5,7 @@ singular_name = "telecrystal" icon = 'icons/obj/stock_parts.dmi' icon_state = "telecrystal" - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY max_amount = 240 origin_tech = list(TECH_MATERIAL = 6, TECH_BLUESPACE = 4) damage_force = 1 //Needs a token force to ensure you can attack because for some reason you can't attack with 0 force things diff --git a/code/game/objects/items/stacks/tickets.dm b/code/game/objects/items/stacks/tickets.dm index 652b6c28aa7..a88abfc9fbb 100644 --- a/code/game/objects/items/stacks/tickets.dm +++ b/code/game/objects/items/stacks/tickets.dm @@ -4,7 +4,7 @@ singular_name = "arcade ticket" icon_state = "arcade-ticket" item_state = "tickets" - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY max_amount = 30 /obj/item/stack/arcadeticket/Initialize(mapload) diff --git a/code/game/objects/items/stacks/tiles/tile_types.dm b/code/game/objects/items/stacks/tiles/tile_types.dm index f42d06a8a04..3f0955fd54b 100644 --- a/code/game/objects/items/stacks/tiles/tile_types.dm +++ b/code/game/objects/items/stacks/tiles/tile_types.dm @@ -14,7 +14,7 @@ name = "tile" singular_name = "tile" desc = "A non-descript floor tile" - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL max_amount = 60 drop_sound = 'sound/items/drop/axe.ogg' pickup_sound = 'sound/items/pickup/axe.ogg' diff --git a/code/game/objects/items/stock_parts/_stock_parts.dm b/code/game/objects/items/stock_parts/_stock_parts.dm index f0907592115..652e4a92825 100644 --- a/code/game/objects/items/stock_parts/_stock_parts.dm +++ b/code/game/objects/items/stock_parts/_stock_parts.dm @@ -3,7 +3,7 @@ desc = "What?" gender = PLURAL icon = 'icons/obj/stock_parts.dmi' - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL item_flags = ITEM_EASY_LATHE_DECONSTRUCT | ITEM_ENCUMBERS_WHILE_HELD var/rating = 1 diff --git a/code/game/objects/items/stock_parts/part_replacer.dm b/code/game/objects/items/stock_parts/part_replacer.dm index bed939b6446..2bb0863c084 100644 --- a/code/game/objects/items/stock_parts/part_replacer.dm +++ b/code/game/objects/items/stock_parts/part_replacer.dm @@ -2,16 +2,21 @@ name = "rapid part exchange device" desc = "A special mechanical module made to store, sort, and apply standard machine parts." icon_state = "RPED" - w_class = ITEMSIZE_HUGE - can_hold = list(/obj/item/stock_parts, /obj/item/cell/, /obj/item/reagent_containers/glass/beaker/) - storage_slots = 100 - use_to_pickup = 1 - allow_quick_gather = 1 - allow_quick_empty = 1 - collection_mode = 1 - display_contents_with_number = 1 - max_w_class = ITEMSIZE_NORMAL - max_storage_space = 200 + w_class = WEIGHT_CLASS_HUGE + storage_datum_path = /datum/object_system/storage/stock_parts + insertion_whitelist = list( + /obj/item/stock_parts, + /obj/item/cell, + /obj/item/reagent_containers/glass/beaker, + ) + allow_mass_gather = TRUE + allow_quick_empty = TRUE + allow_quick_empty_via_attack_self = TRUE + ui_numerical_mode = TRUE + max_single_weight_class = WEIGHT_CLASS_NORMAL + max_items = 100 + max_combined_volume = 100 + ui_expand_when_needed = TRUE materials_base = list( MAT_STEEL = 8000, MAT_GLASS = 2500, @@ -21,7 +26,6 @@ /obj/item/storage/part_replacer/basic name = "basic part exchanger" desc = "A basic part exchanger. It can't seem to store much." - storage_slots = 35 materials_base = list( MAT_STEEL = 4000, MAT_GLASS = 1500, @@ -31,8 +35,8 @@ name = "advanced rapid part exchange device" desc = "A special mechanical module made to store, sort, and apply standard machine parts. This one has a greatly upgraded storage capacity" icon_state = "RPED" - storage_slots = 200 - max_storage_space = 400 + max_items = 200 + max_combined_volume = 200 materials_base = list( MAT_STEEL = 12000, MAT_GLASS = 4000, @@ -42,23 +46,6 @@ name = "discount bluespace rapid part exchange device" desc = "A special mechanical module made to store, sort, and apply standard machine parts. This one has a further increased storage capacity, \ and the ability to work on machines with closed maintenance panels." - storage_slots = 400 - max_storage_space = 800 + max_items = 400 + max_combined_volume = 800 panel_req = FALSE - -/obj/item/storage/part_replacer/drop_contents() // hacky-feeling tier-based drop system - hide_from(usr) - var/turf/T = get_turf(src) - var/lowest_rating = INFINITY // We want the lowest-part tier rating in the RPED so we only drop the lowest-tier parts. - /* - * Why not just use the stock part's rating variable? - * Future-proofing for a potential future where stock parts aren't the only thing that can fit in an RPED. - * see: /tg/ and /vg/'s RPEDs fitting power cells, beakers, etc. - */ - for(var/obj/item/B in contents) - if(B.rped_rating() < lowest_rating) - lowest_rating = B.rped_rating() - for(var/obj/item/B in contents) - if(B.rped_rating() > lowest_rating) - continue - remove_from_storage(B, T) diff --git a/code/game/objects/items/storage/_storage.dm b/code/game/objects/items/storage/_storage.dm deleted file mode 100644 index 80c6c775bfc..00000000000 --- a/code/game/objects/items/storage/_storage.dm +++ /dev/null @@ -1,792 +0,0 @@ -// To clarify: -// For use_to_pickup and allow_quick_gather functionality, -// see item/attackby() (/game/objects/items.dm) -// Do not remove this functionality without good reason, cough reagent_containers cough. -// -Sayu -#define storage_ui_default "LEFT+7,BOTTOM+7 to LEFT+10,BOTTOM+8" -/obj/item/storage - name = "storage" - icon = 'icons/obj/storage.dmi' - inhand_default_type = INHAND_DEFAULT_ICON_STORAGE - w_class = ITEMSIZE_NORMAL - show_messages = 1 - - 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/list/is_seeing = new/list() //List of mobs which are currently seeing the contents of this item's storage - var/max_w_class = ITEMSIZE_SMALL //Max size of objects that this object can store (in effect only if can_hold isn't set) - var/max_storage_space = ITEMSIZE_COST_SMALL * 4 //The sum of the storage costs of all the items in this storage item. - var/storage_slots = null //The number of storage slots in this container. If null, it uses the volume-based storage instead. - var/atom/movable/screen/storage/boxes = null - var/atom/movable/screen/storage/storage_start = null //storage UI - var/atom/movable/screen/storage/storage_continue = null - var/atom/movable/screen/storage/storage_end = null - var/atom/movable/screen/storage/stored_start = null - var/atom/movable/screen/storage/stored_continue = null - var/atom/movable/screen/storage/stored_end = null - var/atom/movable/screen/close/closer = null - var/use_to_pickup //Set this to make it possible to use this item in an inverse way, so you can have the item in your hand and click items on the floor to pick them up. - var/display_contents_with_number //Set this to make the storage item group contents of the same type and display them as a number. - var/allow_quick_empty //Set this variable to allow the object to have the 'empty' verb, which dumps all the contents on the floor. - var/allow_quick_gather //Set this variable to allow the object to have the 'toggle mode' verb, which quickly collects all items from a tile. - var/collection_mode = 1; //0 = pick one at a time, 1 = pick all on tile - var/use_sound = "rustle" //sound played when used. null for no sound. - - var/list/starts_with //Things to spawn on the box on spawn //THIS IS A BANNED LIST. ALL NEW STORAGE MUST USE POPULATE_CONTENTS() TO MAKE THEIR ITEMS! - KEVINZ000 - - var/empty //Mapper override to spawn an empty version of a container that usually has stuff - - var/last_message = 0 - - /// carry weight in us - var/weight_cached = 0 - /// carry weight mitigation, static. applied after multiplicative - var/weight_mitigation = 0 - /// carry weight mitigation, multiplicative. - var/weight_multiply = 1 - -/obj/item/storage/Initialize(mapload) - . = ..() - - if(allow_quick_empty) - add_obj_verb(src, /obj/item/storage/verb/quick_empty) - else - remove_obj_verb(src, /obj/item/storage/verb/quick_empty) - - if(allow_quick_gather) - add_obj_verb(src, /obj/item/storage/verb/toggle_gathering_mode) - else - remove_obj_verb(src, /obj/item/storage/verb/toggle_gathering_mode) - - src.boxes = new /atom/movable/screen/storage( ) - src.boxes.name = "storage" - src.boxes.master = src - src.boxes.icon_state = "block" - src.boxes.screen_loc = storage_ui_default - - src.storage_start = new /atom/movable/screen/storage( ) - src.storage_start.name = "storage" - src.storage_start.master = src - src.storage_start.icon_state = "storage_start" - src.storage_start.screen_loc = storage_ui_default - - src.storage_continue = new /atom/movable/screen/storage( ) - src.storage_continue.name = "storage" - src.storage_continue.master = src - src.storage_continue.icon_state = "storage_continue" - src.storage_continue.screen_loc = storage_ui_default - - src.storage_end = new /atom/movable/screen/storage( ) - src.storage_end.name = "storage" - src.storage_end.master = src - src.storage_end.icon_state = "storage_end" - src.storage_end.screen_loc = storage_ui_default - - src.stored_start = new /atom/movable //we just need these to hold the icon - src.stored_start.icon_state = "stored_start" - - src.stored_continue = new /atom/movable - src.stored_continue.icon_state = "stored_continue" - - src.stored_end = new /atom/movable - src.stored_end.icon_state = "stored_end" - - src.closer = new /atom/movable/screen/close( ) - src.closer.master = src - src.closer.icon_state = "storage_close" - src.closer.hud_layerise() - orient2hud() - - populate_contents_legacy() - - PopulateContents() - - //calibrate_size() //Let's not! - - reset_weight() - -/obj/item/storage/Destroy() - close_all() - QDEL_NULL(boxes) - QDEL_NULL(src.storage_start) - QDEL_NULL(src.storage_continue) - QDEL_NULL(src.storage_end) - QDEL_NULL(src.stored_start) - QDEL_NULL(src.stored_continue) - QDEL_NULL(src.stored_end) - QDEL_NULL(closer) - return ..() - -/obj/item/storage/get_weight() - . = ..() - . += max(0, (weight_cached * weight_multiply) - weight_mitigation) - -/obj/item/storage/proc/reset_weight() - var/old_weight_cached = weight_cached - weight_cached = 0 - for(var/obj/item/I in contents) - weight_cached += I.get_weight() - propagate_weight(old_weight_cached, weight_cached) - update_weight() - -/obj/item/storage/proc/stored_weight_changed(obj/item/I, old_weight, new_weight) - var/diff = new_weight - old_weight - var/old = weight_cached - weight_cached += diff - propagate_weight(old, weight_cached) -/obj/item/storage/proc/reset_weight_recursive() - do_reset_weight_recursive(200) - -/obj/item/storage/proc/do_reset_weight_recursive(safety) - if(!(safety - 1)) - CRASH("out of safety") - for(var/obj/item/storage/S in contents) - S.do_reset_weight_recursive(safety - 1) - reset_weight() - -/obj/item/storage/AltClick(mob/user) - if(user in is_seeing) - src.close(user) - // I would think there should be some incap check here or something - // But MouseDrop doesn't use one (as of this writing), so... - else if(isliving(user) && user.Reachability(src)) - src.open(user) - else - return ..() - -/obj/item/storage/OnMouseDrop(atom/over, mob/user, proximity, params) - if(user != over) - return ..() - if(user in is_seeing) - close(user) - else if(isliving(user) && user.Reachability(src)) - open(user) - else - -/obj/item/storage/proc/return_inv() - - var/list/L = list( ) - - L += src.contents - - for(var/obj/item/storage/S in src) - L += S.return_inv() - for(var/obj/item/gift/G in src) - L += G.gift - if (istype(G.gift, /obj/item/storage)) - L += G.gift:return_inv() - return L - -/obj/item/storage/proc/show_to(mob/user as mob) - // todo: datum storage - if(!user.client) - return - if(user.s_active != src) - for(var/obj/item/I in src) - if(I.on_found(user)) - return - if(user.s_active) - user.s_active.hide_from(user) - user.client.screen -= src.boxes - user.client.screen -= src.storage_start - user.client.screen -= src.storage_continue - user.client.screen -= src.storage_end - user.client.screen -= src.closer - user.client.screen -= src.contents - user.client.screen += src.closer - user.client.screen += src.contents - if(storage_slots) - user.client.screen += src.boxes - else - user.client.screen += src.storage_start - user.client.screen += src.storage_continue - user.client.screen += src.storage_end - user.s_active = src - is_seeing |= user - return - -/obj/item/storage/proc/hide_from(mob/user as mob) - if(!user) - return - is_seeing -= user - if(user.s_active == src) - user.s_active = null - if(!user?.client) - return - user.client.screen -= src.boxes - user.client.screen -= src.storage_start - user.client.screen -= src.storage_continue - user.client.screen -= src.storage_end - user.client.screen -= src.closer - user.client.screen -= src.contents - -/obj/item/storage/proc/open(mob/user as mob, sound_played = FALSE) - if (src.use_sound && !isobserver(user) && !sound_played) - playsound(src.loc, src.use_sound, 50, 1, -5) - - orient2hud(user) - if (user.s_active) - user.s_active.close(user) - show_to(user) - -/obj/item/storage/proc/close(mob/user as mob) - src.hide_from(user) - user.s_active = null - return - -/obj/item/storage/proc/close_all() - for(var/mob/M in can_see_contents()) - close(M) - . = 1 - -/obj/item/storage/proc/can_see_contents() - var/list/cansee = list() - for(var/mob/M in is_seeing) - if(M.s_active == src && M.client) - cansee |= M - else - is_seeing -= M - return cansee - -/// Adds up the combined w_classes. -/obj/item/storage/proc/storage_space_used() - . = 0 - for(var/obj/item/I in contents) - . += I.get_storage_cost() - -//This proc draws out the inventory and places the items on it. tx and ty are the upper left tile and mx, my are the bottm right. -//The numbers are calculated from the bottom-left The bottom-left slot being 1,1. -/obj/item/storage/proc/orient_objs(tx, ty, mx, my) - var/cx = tx - var/cy = ty - src.boxes.screen_loc = "LEFT+[tx],BOTTOM+[ty] to LEFT+[mx],BOTTOM+[my]" - for(var/obj/O in src.contents) - O.screen_loc = "LEFT+[cx],BOTTOM+[cy]" - O.hud_layerise() - cx++ - if (cx > mx) - cx = tx - cy-- - src.closer.screen_loc = "LEFT+[mx+1],BOTTOM+[my]" - return - -//This proc draws out the inventory and places the items on it. It uses the standard position. -/obj/item/storage/proc/slot_orient_objs(var/rows, var/cols, var/list/obj/item/display_contents) - var/cx = 3 - var/cy = 1 + rows - src.boxes.screen_loc = "LEFT+3:16,BOTTOM+1:16 to LEFT+[3+cols]:16,BOTTOM+[1+rows]:16" - - if(display_contents_with_number) - for(var/datum/numbered_display/ND in display_contents) - ND.sample_object.screen_loc = "LEFT+[cx]:16,BOTTOM+[cy]:16" - ND.sample_object.maptext = "[(ND.number > 1)? "[ND.number]" : ""]" - ND.sample_object.hud_layerise() - cx++ - if (cx > (3+cols)) - cx = 3 - cy-- - else - for(var/obj/O in contents) - O.screen_loc = "LEFT+[cx]:16,BOTTOM+[cy]:16" - O.maptext = "" - O.hud_layerise() - cx++ - if (cx > (3+cols)) - cx = 3 - cy-- - src.closer.screen_loc = "LEFT+[3+cols+1]:16,BOTTOM+1:16" - return - -/obj/item/storage/proc/space_orient_objs(list/obj/item/display_contents) - - var/baseline_max_storage_space = INVENTORY_STANDARD_SPACE / 2 //should be equal to default backpack capacity // This is a lie. - // Above var is misleading, what it does upon changing is makes smaller inventory sizes have smaller space on the UI. - // It's cut in half because otherwise boxes of IDs and other tiny items are unbearably cluttered. - - var/storage_cap_width = 2 //length of sprite for start and end of the box representing total storage space - var/stored_cap_width = 4 //length of sprite for start and end of the box representing the stored item - var/storage_width = min( round( 224 * max_storage_space/baseline_max_storage_space ,1) ,274) //length of sprite for the box representing total storage space - - storage_start.cut_overlays() - - var/matrix/M = matrix() - M.Scale((storage_width-storage_cap_width*2+3)/32,1) - storage_continue.transform = M - - storage_start.screen_loc = "LEFT+3:16,BOTTOM+1:16" - storage_continue.screen_loc = "LEFT+3:[storage_cap_width+(storage_width-storage_cap_width*2)/2+2],BOTTOM+1:16" - storage_end.screen_loc = "LEFT+3:[19+storage_width-storage_cap_width],BOTTOM+1:16" - - var/startpoint = 0 - var/endpoint = 1 - - for(var/obj/item/O in contents) - startpoint = endpoint + 1 - endpoint += storage_width * O.get_storage_cost()/max_storage_space - - var/matrix/M_start = matrix() - var/matrix/M_continue = matrix() - var/matrix/M_end = matrix() - M_start.Translate(startpoint,0) - M_continue.Scale((endpoint-startpoint-stored_cap_width*2)/32,1) - M_continue.Translate(startpoint+stored_cap_width+(endpoint-startpoint-stored_cap_width*2)/2 - 16,0) - M_end.Translate(endpoint-stored_cap_width,0) - stored_start.transform = M_start - stored_continue.transform = M_continue - stored_end.transform = M_end - - var/list/overlays_to_add = list() - overlays_to_add += stored_start - overlays_to_add += stored_continue - overlays_to_add += stored_end - storage_start.add_overlay(overlays_to_add) - - O.screen_loc = "LEFT+3:[round((startpoint+endpoint)/2)+2],BOTTOM+1:16" - O.maptext = "" - O.hud_layerise() - - // If we're not overloaded, force overlays to build now to reduce visual lag. - if (!TICK_CHECK) - storage_start.compile_overlays() - - closer.screen_loc = "LEFT+3:[storage_width+19],BOTTOM+1:16" - return - - -/datum/numbered_display - var/obj/item/sample_object - var/number - -/datum/numbered_display/New(obj/item/sample) - if(!istype(sample)) - qdel(src) - sample_object = sample - number = 1 - -//This proc determins the size of the inventory to be displayed. Please touch it only if you know what you're doing. -/obj/item/storage/proc/orient2hud(mob/user as mob) - - var/adjusted_contents = contents.len - - //Numbered contents display - var/list/datum/numbered_display/numbered_contents - if(display_contents_with_number) - numbered_contents = list() - adjusted_contents = 0 - for(var/obj/item/I in contents) - var/found = 0 - for(var/datum/numbered_display/ND in numbered_contents) - if(ND.sample_object.type == I.type) - ND.number++ - found = 1 - break - if(!found) - adjusted_contents++ - numbered_contents.Add( new/datum/numbered_display(I) ) - - if(storage_slots == null) - src.space_orient_objs(numbered_contents) - else - var/row_num = 0 - var/col_count = min(7,storage_slots) -1 - if (adjusted_contents > 7) - row_num = round((adjusted_contents-1) / 7) // 7 is the maximum allowed width. - src.slot_orient_objs(row_num, col_count, numbered_contents) - return - -//This proc return 1 if the item can be picked up and 0 if it can't. -//Set the stop_messages to stop it from printing messages -/obj/item/storage/proc/can_be_inserted(obj/item/W as obj, stop_messages = 0) - if(!istype(W)) - return //Not an item - - if(usr && usr.is_in_inventory(W) && !usr.can_unequip(W, user = usr)) - return 0 - - if(src.loc == W) - return 0 //Means the item is already in the storage item - - if(storage_slots != null && contents.len >= storage_slots) - if(!stop_messages) - to_chat(usr, "[src] is full, make some space.") - return 0 //Storage item is full - - if(can_hold.len && !is_type_in_list(W, can_hold)) - if(!stop_messages) - if (istype(W, /obj/item/hand_labeler)) - return 0 - to_chat(usr, "[src] cannot hold [W].") - return 0 - - if(cant_hold.len && is_type_in_list(W, cant_hold)) - if(!stop_messages) - to_chat(usr, "[src] cannot hold [W].") - return 0 - - if (max_w_class != null && W.w_class > max_w_class) - if(!stop_messages) - to_chat(usr, "[W] is too long for \the [src].") - return 0 - - if((storage_space_used() + W.get_storage_cost()) > max_storage_space) //Adds up the combined w_classes which will be in the storage item if the item is added to it. - if(!stop_messages) - to_chat(usr, "[src] is too full, make some space.") - return 0 - - if(W.w_class >= src.w_class && (istype(W, /obj/item/storage))) - if(!stop_messages) - to_chat(usr, "[src] cannot hold [W] as it's a storage item of the same size.") - return 0 //To prevent the stacking of same sized storage items. - - return 1 - -//This proc handles items being inserted. It does not perform any checks of whether an item can or can't be inserted. That's done by can_be_inserted() -//The stop_warning parameter will stop the insertion message from being displayed. It is intended for cases where you are inserting multiple items at once, -//such as when picking up all the items on a tile with one click. -/obj/item/storage/proc/handle_item_insertion(obj/item/W as obj, mob/user, prevent_warning = 0) - if(!istype(W)) - return 0 - - W.forceMove(src) - W.on_enter_storage(src) - W.item_flags |= ITEM_IN_STORAGE - var/old_weight = weight_cached - weight_cached += W.get_weight() - propagate_weight(old_weight, weight_cached) - if(user) - if(!prevent_warning) - for(var/mob/M in viewers(user)) - if (M == usr) - to_chat(usr, "You put \the [W] into [src].") - else if (M in range(1)) //If someone is standing close enough, they can tell what it is... - M.show_message("\The [usr] puts [W] into [src].") - else if (W && W.w_class >= 3) //Otherwise they can only see large or normal items from a distance... - M.show_message("\The [usr] puts [W] into [src].") - if(user.s_active == src) - orient2hud(user) - show_to(user) - - update_icon() - return 1 - -/obj/item/storage/proc/try_insert(obj/item/I, mob/user, prevent_warning = FALSE, force) - if(!force && !can_be_inserted(I, prevent_warning)) - return FALSE - return handle_item_insertion(I, user, prevent_warning) - -//Call this proc to handle the removal of an item from the storage item. The item will be moved to the atom sent as new_target -/obj/item/storage/proc/remove_from_storage(obj/item/W as obj, atom/new_location, do_move = TRUE) - if(!istype(W)) - return 0 - - if(istype(src, /obj/item/storage/fancy)) - var/obj/item/storage/fancy/F = src - F.update_icon(1) - - for(var/mob/M in range(1, src.loc)) - if (M.s_active == src) - if (M.client) - M.client.screen -= W - - if(do_move) - if(new_location) - W.forceMove(new_location) - else - W.forceMove(get_turf(src)) - - if(usr?.s_active == src) - orient2hud(usr) - show_to(usr) - if(W.maptext) - W.maptext = "" - W.on_exit_storage(src) - W.item_flags &= ~ITEM_IN_STORAGE - var/old_weight = weight_cached - weight_cached -= W.get_weight() - propagate_weight(old_weight, weight_cached) - update_icon() - return 1 - -/obj/item/storage/Exited(atom/movable/AM, atom/newLoc) - if(isitem(AM)) - var/obj/item/I = AM - if(I.item_flags & ITEM_IN_STORAGE) - remove_from_storage(I, null, FALSE) - return ..() - -//This proc is called when you want to place an item into the storage item. -/obj/item/storage/attackby(obj/item/W as obj, mob/user as mob) - ..() - - if(isrobot(user)) - return //Robots can't interact with storage items. - - if(istype(W, /obj/item/lightreplacer)) - var/obj/item/lightreplacer/LP = W - var/amt_inserted = 0 - var/turf/T = get_turf(user) - for(var/obj/item/light/L in src.contents) - if(L.status == 0) - if(LP.uses < LP.max_uses) - LP.add_uses(1) - amt_inserted++ - remove_from_storage(L, T) - qdel(L) - if(amt_inserted) - to_chat(user, "You inserted [amt_inserted] light\s into \the [LP.name]. You have [LP.uses] light\s remaining.") - return - - if(!can_be_inserted(W)) - return - - if(!user.transfer_item_to_loc(W, src)) - return - - W.add_fingerprint(user) - return handle_item_insertion(W, user) - -/obj/item/storage/attack_hand(mob/user, list/params) - if(ishuman(user)) - var/mob/living/carbon/human/H = user - if(H.l_store == src && !H.get_active_held_item()) //Prevents opening if it's in a pocket. - H.put_in_hands(src) - H.l_store = null - return - if(H.r_store == src && !H.get_active_held_item()) - H.put_in_hands(src) - H.r_store = null - return - - if (loc == user) - open(user) - else - ..() - for(var/mob/M in range(1)) - if (M.s_active == src) - src.close(M) - src.add_fingerprint(user) - return - -/obj/item/storage/proc/gather_all(turf/T as turf, mob/user as mob) - var/list/rejections = list() - var/success = 0 - var/failure = 0 - - for(var/obj/item/I in T) - if(I.type in rejections) // To limit bag spamming: any given type only complains once - continue - if(!can_be_inserted(I, user)) // Note can_be_inserted still makes noise when the answer is no - rejections += I.type // therefore full bags are still a little spammy - failure = 1 - continue - success = 1 - handle_item_insertion(I, user, TRUE) //The 1 stops the "You put the [src] into [S]" insertion message from being displayed. - if(success && !failure) - to_chat(user, "You put everything in [src].") - else if(success) - to_chat(user, "You put some things in [src].") - else - if(world.time >= last_message == 0) - to_chat(user, "You fail to pick anything up with \the [src].") - last_message = world.time + 200 - -/obj/item/storage/verb/toggle_gathering_mode() - set name = "Switch Gathering Method" - set category = "Object" - - collection_mode = !collection_mode - switch (collection_mode) - if(1) - to_chat(usr, "[src] now picks up all items on a tile at once.") - if(0) - to_chat(usr, "[src] now picks up one item at a time.") - -/obj/item/storage/verb/quick_empty() - set name = "Empty Contents" - set category = "Object" - - if(((!(ishuman(usr) || isrobot(usr))) && (src.loc != usr)) || usr.stat || usr.restrained()) - return - drop_contents() - -/obj/item/storage/proc/drop_contents() - hide_from(usr) - var/turf/T = get_turf(src) - for(var/obj/item/I in contents) - remove_from_storage(I, T) - -/obj/item/storage/proc/populate_contents_legacy() - if(LAZYLEN(starts_with) && !empty) - for(var/newtype in starts_with) - var/count = starts_with[newtype] || 1 //Could have left it blank. - while(count) - count-- - new newtype(src) - starts_with = null //Reduce list count. - -/obj/item/storage/proc/PopulateContents() - return - -///Prevents spawned containers from being too small for their contents. -/obj/item/storage/proc/calibrate_size() - max_storage_space = max(storage_space_used(),max_storage_space) - -/obj/item/storage/emp_act(severity) - if(!istype(src.loc, /mob/living)) - for(var/obj/O in contents) - O.emp_act(severity) - ..() - -/obj/item/storage/attack_self(mob/user) - . = ..() - if(.) - return - if((user.get_active_held_item() == src) || (isrobot(user)) && allow_quick_empty) - if(src.verbs.Find(/obj/item/storage/verb/quick_empty)) - src.quick_empty() - return 1 - - if(user in is_seeing) - src.close(user) - else if(isliving(user) && user.Reachability(src)) - src.open(user) - else - return ..() - -//Returns the storage depth of an atom. This is the number of storage items the atom is contained in before reaching toplevel (the area). -//Returns -1 if the atom was not found on container. -/atom/proc/storage_depth(atom/container) - var/depth = 0 - var/atom/cur_atom = src - - while (cur_atom && !(cur_atom in container.contents)) - if (isarea(cur_atom)) - return INFINITY - if (istype(cur_atom.loc, /obj/item/storage)) - depth++ - cur_atom = cur_atom.loc - - if (!cur_atom) - return INFINITY //inside something with a null loc. - - return depth - -//Like storage depth, but returns the depth to the nearest turf -//Returns -1 if no top level turf (a loc was null somewhere, or a non-turf atom's loc was an area somehow). -/atom/proc/storage_depth_turf() - var/depth = 0 - var/atom/cur_atom = src - - while (cur_atom && !isturf(cur_atom)) - if (isarea(cur_atom)) - return INFINITY - if (istype(cur_atom.loc, /obj/item/storage)) - depth++ - cur_atom = cur_atom.loc - - if (!cur_atom) - return INFINITY //inside something with a null loc. - - return depth - -// See inventory_sizes.dm for the defines. -/obj/item/proc/get_storage_cost() - if (storage_cost) - return storage_cost - else - switch(w_class) - if(ITEMSIZE_TINY) - return ITEMSIZE_COST_TINY - if(ITEMSIZE_SMALL) - return ITEMSIZE_COST_SMALL - if(ITEMSIZE_NORMAL) - return ITEMSIZE_COST_NORMAL - if(ITEMSIZE_LARGE) - return ITEMSIZE_COST_LARGE - if(ITEMSIZE_HUGE) - return ITEMSIZE_COST_HUGE - else - return ITEMSIZE_COST_NO_CONTAINER - -/obj/item/storage/proc/make_exact_fit() - storage_slots = contents.len - - can_hold.Cut() - max_w_class = 0 - max_storage_space = 0 - for(var/obj/item/I in src) - can_hold[I.type]++ - max_w_class = max(I.w_class, max_w_class) - max_storage_space += I.get_storage_cost() - -/* - * Trinket Box - READDING SOON - */ -/obj/item/storage/trinketbox - name = "trinket box" - desc = "A box that can hold small trinkets, such as a ring." - icon = 'icons/obj/items.dmi' - icon_state = "trinketbox" - var/open = 0 - storage_slots = 1 - can_hold = list( - /obj/item/clothing/gloves/ring, - /obj/item/coin, - /obj/item/clothing/accessory/medal - ) - var/open_state - var/closed_state - -/obj/item/storage/trinketbox/update_icon() - cut_overlays() - if(open) - icon_state = open_state - - if(contents.len >= 1) - var/contained_image = null - if(istype(contents[1], /obj/item/clothing/gloves/ring)) - contained_image = "ring_trinket" - else if(istype(contents[1], /obj/item/coin)) - contained_image = "coin_trinket" - else if(istype(contents[1], /obj/item/clothing/accessory/medal)) - contained_image = "medal_trinket" - if(contained_image) - add_overlay(contained_image) - else - icon_state = closed_state - -/obj/item/storage/trinketbox/Initialize(mapload) - if(!open_state) - open_state = "[initial(icon_state)]_open" - if(!closed_state) - closed_state = "[initial(icon_state)]" - . = ..() - -/obj/item/storage/trinketbox/attack_self(mob/user) - . = ..() - if(.) - return - open = !open - update_icon() - ..() - -/obj/item/storage/trinketbox/examine(mob/user, dist) - . = ..() - if(open && contents.len) - var/display_item = contents[1] - . += "\The [src] contains \the [display_item]!" - -/obj/item/storage/AllowDrop() - return TRUE - -/obj/item/storage/clean_radiation(str, mul, cheap) - . = ..() - if(cheap) - return - for(var/atom/A as anything in contents) - A.clean_radiation(str, mul, cheap) - -/obj/item/storage/drop_products(method, atom/where) - . = ..() - for(var/atom/movable/AM as anything in contents) - AM.forceMove(where) diff --git a/code/game/objects/items/storage/backpack.dm b/code/game/objects/items/storage/backpack.dm index 1192e6db523..c8853d0b68c 100644 --- a/code/game/objects/items/storage/backpack.dm +++ b/code/game/objects/items/storage/backpack.dm @@ -7,34 +7,17 @@ desc = "You wear this on your back and put items into it." icon = 'icons/obj/clothing/backpack.dmi' icon_state = "backpack" - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY slot_flags = SLOT_BACK - max_w_class = ITEMSIZE_LARGE + max_single_weight_class = WEIGHT_CLASS_BULKY weight = ITEM_WEIGHT_STORAGE_BACKPACK encumbrance = ITEM_ENCUMBRANCE_STORAGE_BACKPACK - max_storage_space = INVENTORY_STANDARD_SPACE + max_combined_volume = STORAGE_VOLUME_BACKPACK var/flippable = 0 var/side = 0 //0 = right, 1 = left drop_sound = 'sound/items/drop/backpack.ogg' pickup_sound = 'sound/items/pickup/backpack.ogg' -/obj/item/storage/backpack/attackby(obj/item/W as obj, mob/user as mob) - if (src.use_sound) - playsound(src.loc, src.use_sound, 50, 1, -5) - ..() - -/obj/item/storage/backpack/equipped(var/mob/user, var/slot) - if (slot == SLOT_ID_BACK && src.use_sound) - playsound(src.loc, src.use_sound, 50, 1, -5) - ..(user, slot) - -/* -/obj/item/storage/backpack/dropped(mob/user, flags, atom/newLoc) - if (loc == user && src.use_sound) - playsound(src.loc, src.use_sound, 50, 1, -5) - ..(user) -*/ - /* * Backpack Types */ @@ -44,9 +27,8 @@ desc = "A backpack that opens into a localized pocket of Blue Space." origin_tech = list(TECH_BLUESPACE = 4) icon_state = "holdingpack" - max_w_class = ITEMSIZE_LARGE - max_storage_space = ITEMSIZE_COST_NORMAL * 14 // 56 - storage_cost = INVENTORY_STANDARD_SPACE + 1 + max_single_weight_class = WEIGHT_CLASS_BULKY + max_combined_volume = WEIGHT_VOLUME_NORMAL * 14 // 56 /obj/item/storage/backpack/holding/duffle name = "dufflebag of holding" @@ -80,9 +62,9 @@ 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_slots = list(SLOT_ID_RIGHT_HAND = "giftbag", SLOT_ID_LEFT_HAND = "giftbag") - w_class = ITEMSIZE_LARGE - max_w_class = ITEMSIZE_NORMAL - max_storage_space = ITEMSIZE_COST_NORMAL * 100 // can store a ton of shit! + w_class = WEIGHT_CLASS_BULKY + max_single_weight_class = WEIGHT_CLASS_NORMAL + max_combined_volume = WEIGHT_VOLUME_NORMAL * 100 // can store a ton of shit! item_state_slots = null /obj/item/storage/backpack/cultpack @@ -172,7 +154,7 @@ flat_encumbrance = ITEM_FLAT_ENCUMBRANCE_DUFFLEBAG // todo: remove when weight system is used slowdown = 0.25 - max_storage_space = INVENTORY_DUFFLEBAG_SPACE + max_combined_volume = STORAGE_VOLUME_DUFFLEBAG /obj/item/storage/backpack/dufflebag/syndie name = "black dufflebag" @@ -510,9 +492,9 @@ desc = "A small, fashionable bag typically worn over the shoulder." icon_state = "purse" item_state_slots = list(SLOT_ID_RIGHT_HAND = "lgpurse", SLOT_ID_LEFT_HAND = "lgpurse") - w_class = ITEMSIZE_LARGE - max_w_class = ITEMSIZE_NORMAL - max_storage_space = ITEMSIZE_COST_NORMAL * 5 + w_class = WEIGHT_CLASS_BULKY + max_single_weight_class = WEIGHT_CLASS_NORMAL + max_combined_volume = WEIGHT_VOLUME_NORMAL * 5 //Parachutes /obj/item/storage/backpack/parachute @@ -520,7 +502,7 @@ desc = "A specially made backpack, designed to help one survive jumping from incredible heights. It sacrifices some storage space for that added functionality." icon_state = "parachute" item_state_slots = list(SLOT_ID_RIGHT_HAND = "backpack", SLOT_ID_LEFT_HAND = "backpack") - max_storage_space = ITEMSIZE_COST_NORMAL * 5 + max_combined_volume = WEIGHT_VOLUME_NORMAL * 5 /obj/item/storage/backpack/parachute/examine(mob/user, dist) . = ..() @@ -600,7 +582,7 @@ icon_state = "saddlebag" var/icon_base = "saddlebag" encumbrance = ITEM_ENCUMBRANCE_STORAGE_DUFFLEBAG - max_storage_space = INVENTORY_DUFFLEBAG_SPACE //Saddlebags can hold more, like dufflebags + max_combined_volume = STORAGE_VOLUME_DUFFLEBAG //Saddlebags can hold more, like dufflebags var/no_message = "You aren't the appropriate taur type to wear this!" /obj/item/storage/backpack/saddlebag_common/can_equip(mob/M, slot, mob/user, flags) @@ -654,7 +636,7 @@ item_state = "taurvest" icon_state = "taurvest" icon_base = "taurvest" - max_storage_space = INVENTORY_STANDARD_SPACE + max_combined_volume = STORAGE_VOLUME_BACKPACK encumbrance = ITEM_ENCUMBRANCE_STORAGE_BACKPACK /obj/item/storage/backpack/dufflebag/fluff //Black dufflebag without syndie buffs. diff --git a/code/game/objects/items/storage/bags.dm b/code/game/objects/items/storage/bags.dm index c1f39b35ae0..473bed1fbe8 100644 --- a/code/game/objects/items/storage/bags.dm +++ b/code/game/objects/items/storage/bags.dm @@ -18,34 +18,47 @@ // 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 slot_flags = SLOT_BELT drop_sound = 'sound/items/drop/backpack.ogg' pickup_sound = 'sound/items/pickup/backpack.ogg' -/obj/item/storage/bag/handle_item_insertion(obj/item/W as obj, prevent_warning = 0) - . = ..() - if(.) update_w_class() + allow_mass_gather = TRUE + allow_quick_empty = TRUE + allow_quick_empty_via_attack_self = TRUE -/obj/item/storage/bag/remove_from_storage(obj/item/W as obj, atom/new_location) - . = ..() - if(.) update_w_class() + var/auto_fit_weight_class_to_largest_contained = TRUE -/obj/item/storage/bag/can_be_inserted(obj/item/W, stop_messages = 0) - var/mob/living/carbon/human/H = usr // if we're human, then we need to check if bag in a pocket - if(istype(src.loc, /obj/item/storage) || ishuman(H) && (H.l_store == src || H.r_store == src)) - if(!stop_messages) - to_chat(usr, SPAN_NOTICE("Take \the [src] out of [istype(src.loc, /obj) ? "\the [src.loc]" : "the pocket"] first.")) - return 0 //causes problems if the bag expands and becomes larger than src.loc can hold, so disallow it +/obj/item/storage/bag/Entered(atom/movable/AM, atom/oldLoc) . = ..() + if(!isitem(AM)) + return + refit_to(AM) -/obj/item/storage/bag/proc/update_w_class() - w_class = initial(w_class) - for(var/obj/item/I in contents) - w_class = max(w_class, I.w_class) +/obj/item/storage/bag/Exited(atom/movable/AM, atom/newLoc) + . = ..() + if(!isitem(AM)) + return + refit_to(AM, TRUE) + +/obj/item/storage/bag/on_contents_weight_class_change(obj/item/item, old_weight_class, new_weight_class) + refit_to(item, TRUE) + return ..() + +/obj/item/storage/bag/proc/refit_to(obj/item/thing, removing) + var/their_weight_class = thing.get_weight_class() + if(!removing) + if(their_weight_class <= w_class) + return + else + set_weight_class(their_weight_class) + else + if(their_weight_class < w_class) + return + else + var/staged = initial(w_class) + for(var/obj/item/contained in src) + staged = max(staged, contained.get_weight_class()) + set_weight_class(staged) // ----------------------------- // Trash bag @@ -59,25 +72,28 @@ drop_sound = 'sound/items/drop/wrapper.ogg' pickup_sound = 'sound/items/pickup/wrapper.ogg' - w_class = ITEMSIZE_SMALL - max_w_class = ITEMSIZE_NORMAL - max_storage_space = ITEMSIZE_SMALL * 21 - can_hold = list() // any - cant_hold = list(/obj/item/disk/nuclear) + w_class = WEIGHT_CLASS_SMALL + max_single_weight_class = WEIGHT_CLASS_NORMAL + max_combined_volume = WEIGHT_CLASS_SMALL * 21 + insertion_whitelist = list() // any + insertion_blacklist = list(/obj/item/disk/nuclear) -/obj/item/storage/bag/trash/update_w_class() - ..() - update_icon() +/obj/item/storage/bag/trash/update_icon_state() switch(w_class) - if(2) icon_state = "[initial(icon_state)]" - if(3) icon_state = "[initial(icon_state)]1" - if(4) icon_state = "[initial(icon_state)]2" - if(5 to INFINITY) icon_state = "[initial(icon_state)]3" + if(3) + icon_state = "[initial(icon_state)]1" + if(4) + icon_state = "[initial(icon_state)]2" + if(5 to INFINITY) + icon_state = "[initial(icon_state)]3" + else + icon_state = "[initial(icon_state)]" + return ..() /obj/item/storage/bag/trash/bluespace name = "trash bag of holding" - max_w_class = ITEMSIZE_HUGE - max_storage_space = ITEMSIZE_SMALL * 56 + max_single_weight_class = WEIGHT_CLASS_HUGE + max_combined_volume = WEIGHT_CLASS_SMALL * 56 desc = "The latest and greatest in custodial convenience, a trashbag that is capable of holding vast quantities of garbage." icon_state = "bluetrashbag" @@ -100,10 +116,10 @@ drop_sound = 'sound/items/drop/wrapper.ogg' pickup_sound = 'sound/items/pickup/wrapper.ogg' - w_class = ITEMSIZE_LARGE - max_w_class = ITEMSIZE_SMALL - can_hold = list() // any - cant_hold = list(/obj/item/disk/nuclear) + w_class = WEIGHT_CLASS_BULKY + max_single_weight_class = WEIGHT_CLASS_SMALL + insertion_whitelist = list() // any + insertion_blacklist = list(/obj/item/disk/nuclear) // ----------------------------- // Mining Satchel @@ -119,150 +135,53 @@ icon = 'icons/obj/mining.dmi' icon_state = "satchel" slot_flags = SLOT_BELT | SLOT_POCKET - w_class = ITEMSIZE_NORMAL - max_storage_space = ITEMSIZE_COST_NORMAL * 25 //kinda irrelevant now :^) - max_w_class = ITEMSIZE_NORMAL - can_hold = list(/obj/item/stack/ore) - var/stored_ore = list() - var/total_ore = 0 //current ore stored - var/max_ore = 300 //how much ore it can hold - var/last_update = 0 + w_class = WEIGHT_CLASS_NORMAL + max_combined_volume = null + max_combined_weight_class = null + max_items = 300 + storage_datum_path = /datum/object_system/storage/stack + ui_expand_when_needed = TRUE + insertion_whitelist = list(/obj/item/stack/ore) + auto_fit_weight_class_to_largest_contained = FALSE -/obj/item/storage/bag/ore/update_w_class() - return - -/obj/item/storage/bag/ore/gather_all(turf/T as turf, mob/user as mob, var/silent = 0) - var/success = 0 - var/failure = 0 - for(var/obj/item/stack/ore/I in T) //Only ever grabs ores. Doesn't do any extraneous checks, as all ore is the same size. Tons of checks means it causes hanging for up to three seconds. - if(istype(user.pulling, /obj/structure/ore_box)) - var/obj/structure/ore_box/O = user.pulling - I.forceMove(O) - if(world.time < last_message && !silent) - to_chat(user, "You put the contents you scooped up into [O].") - last_message = world.time + 10 - else if(total_ore >= max_ore || contents.len >= max_storage_space) - failure = 1 - break - else - I.forceMove(src) - success = 1 - if(success && !failure && !silent) - if(world.time < last_message == 0) - to_chat(user, "You put everything in [src].") - last_message = world.time + 10 - else if (success && (!silent || total_ore >= max_ore)) - to_chat(user, "You fill the [src].") - last_message = world.time + 10 - else if(!silent) - if(world.time >= last_message == 0) - to_chat(user, "You fail to pick anything up with \the [src].") - last_message = world.time + 90 +/obj/item/storage/bag/ore/proc/autodump() + var/mob/living/user = loc + if(!istype(user)) + return + if(!istype(user.pulling, /obj/structure/ore_box)) + return + var/obj/structure/ore_box/box = user.pulling + for(var/obj/item/stack/ore/ore in src) + ore.forceMove(box) /obj/item/storage/bag/ore/equipped(mob/user, slot, flags) . = ..() - RegisterSignal(user, COMSIG_MOVABLE_MOVED, PROC_REF(autoload), override = TRUE) + RegisterSignal(user, COMSIG_MOVABLE_MOVED, PROC_REF(signal_autoload), override = TRUE) /obj/item/storage/bag/ore/dropped(mob/user, flags, atom/newLoc) . = ..() UnregisterSignal(user, COMSIG_MOVABLE_MOVED) -/obj/item/storage/bag/ore/proc/autoload(datum/source, atom/oldLoc, dir, forced) - var/obj/item/stack/ore/O = locate() in get_turf(src) - if(O) - gather_all(get_turf(src), ismob(source)? source : null) - -/obj/item/storage/bag/ore/attack_self(mob/user) - . = ..() - - if(isOreEmpty()) - to_chat(user, SPAN_WARNING("[src] is empty.")) +/obj/item/storage/bag/ore/proc/signal_autoload(datum/source, atom/oldLoc, dir, forced) + // todo: this is weird with SSinput. + if(TICK_CHECK) + return // not if we're already overloaded + var/obj/item/stack/ore/O = locate() in get_turf(source) + if(isnull(O)) return - - to_chat(user, SPAN_NOTICE("You begin emptying [src].")) - - if(do_after(usr,10,src)) - while(!isOreEmpty()) - if(!do_after(user, 2, src)) - to_chat(user,SPAN_NOTICE("You stop emptying [src].")) - return - var/atom/A = drop_location() - if(!A || (length(A.contents) > 200)) - to_chat(user, SPAN_WARNING("The area under [src] is too full.")) - return - deposit(A,50) - to_chat(user,SPAN_NOTICE("You finish emptying [src].")) - -/obj/item/storage/bag/ore/Entered(atom/movable/AM, atom/oldLoc) - . = ..() - if(istype(AM, /obj/item/stack/ore)) - take(AM) - else //shouldn't be possible unless someone's adminbussing weirdly. - AM.forceMove(drop_location()) - -/obj/item/storage/bag/ore/drop_products(method, atom/where) - . = ..() - var/i = 0 - while(!isOreEmpty() && i < 200) //may be laggy as hell if they're carrying 2,000+ sand, so capping it at 200 items dropped. - deposit(where, 50) - i++ - -/obj/item/storage/bag/ore/proc/take(obj/item/stack/ore/O) - if(!istype(O)) - return FALSE - var/overflow = max((total_ore + O.amount) - max_ore, 0) - var/store_amount = O.amount - overflow - - if(!stored_ore[O.type]) - stored_ore[O.type] = store_amount - else - stored_ore[O.type] += store_amount - total_ore += O.amount - - if(overflow) - O.use(store_amount) - O.forceMove(drop_location()) - return FALSE - else - qdel(O) - return TRUE - -/obj/item/storage/bag/ore/proc/deposit(atom/newloc, amount = 50) - if(isOreEmpty()) - return FALSE - var/path = stored_ore[1] - if(amount > stored_ore[path]) - amount = stored_ore[path] - new path(newloc, amount) - stored_ore[path] -= amount - total_ore -= amount - if(stored_ore[path] <= 0) - stored_ore -= path - return TRUE - -/obj/item/storage/bag/ore/proc/isOreEmpty() - return !length(stored_ore) - -/obj/item/storage/bag/ore/examine(mob/user, dist) - . = ..() - if(!Adjacent(user)) //Can only check the contents of ore bags if you can physically reach them. - return - if(istype(user, /mob/living)) - add_fingerprint(user) - if(isOreEmpty()) - . += "It is empty." + var/mob/user = worn_mob() + if(isnull(user)) return + INVOKE_ASYNC(src, PROC_REF(autoload), user, O) - if(world.time > last_update + 10) - last_update = world.time - - . += "It holds:" - for(var/ore in stored_ore) - var/obj/item/stack/ore/O = ore - . += "- [stored_ore[ore]] [initial(O.name)]" - -/obj/item/storage/bag/ore/open(mob/user as mob) //No opening it since the ores are nonexistent - user.do_examinate(src) +/obj/item/storage/bag/ore/proc/autoload(mob/user, obj/item/stack/ore/piece_of_ore) + var/turf/target = piece_of_ore.loc + var/list/ores = list() + for(var/obj/item/stack/ore/ore in target) + ores += ore + obj_storage?.mass_storage_pickup_handler(ores, target) + autodump() + obj_storage?.ui_queue_refresh() //Ashlander variant! /obj/item/storage/bag/ore/ashlander @@ -276,7 +195,8 @@ name = "mining satchel of holding" desc = "This advanced spacious storage efficiently stores and transports ores using bluespace technology. It's like having an ore box latched onto your pocket!" icon_state = "satchel_bspace" - max_ore = SHORT_REAL_LIMIT //if someone manages to reach 16+ million ores in a single 5 hour round, they'd have to be something else. + // :omegawheelchair: + max_items = SHORT_REAL_LIMIT // ----------------------------- @@ -287,15 +207,15 @@ name = "plant bag" icon = 'icons/obj/hydroponics_machines.dmi' icon_state = "plantbag" - max_storage_space = ITEMSIZE_COST_NORMAL * 25 - max_w_class = ITEMSIZE_NORMAL - w_class = ITEMSIZE_SMALL - can_hold = list(/obj/item/reagent_containers/food/snacks/grown,/obj/item/seeds,/obj/item/grown) + max_combined_volume = WEIGHT_VOLUME_NORMAL * 25 + max_single_weight_class = WEIGHT_CLASS_NORMAL + w_class = WEIGHT_CLASS_SMALL + insertion_whitelist = list(/obj/item/reagent_containers/food/snacks/grown,/obj/item/seeds,/obj/item/grown) /obj/item/storage/bag/plants/large name = "large plant bag" - w_class = ITEMSIZE_SMALL - max_storage_space = ITEMSIZE_COST_NORMAL * 45 + w_class = WEIGHT_CLASS_SMALL + max_combined_volume = WEIGHT_VOLUME_NORMAL * 45 /obj/item/storage/bag/plants/ashlander name = "goliath hide plant bag" @@ -314,117 +234,17 @@ icon_state = "sheetsnatcher" desc = "A patented storage system designed for any kind of mineral sheet." - var/capacity = 300; //the number of sheets it can carry. - w_class = ITEMSIZE_NORMAL - storage_slots = 7 + w_class = WEIGHT_CLASS_NORMAL - allow_quick_empty = 1 // this function is superceded - -/obj/item/storage/bag/sheetsnatcher/can_be_inserted(obj/item/W as obj, stop_messages = 0) - if(!istype(W,/obj/item/stack/material)) - if(!stop_messages) - to_chat(usr, "The snatcher does not accept [W].") - return 0 - var/current = 0 - for(var/obj/item/stack/material/S in contents) - current += S.amount - if(capacity == current)//If it's full, you're done - if(!stop_messages) - to_chat(usr, "The snatcher is full.") - return 0 - return 1 - - -// Modified handle_item_insertion. Would prefer not to, but... -/obj/item/storage/bag/sheetsnatcher/handle_item_insertion(obj/item/W as obj, prevent_warning = 0) - var/obj/item/stack/material/S = W - if(!istype(S)) return 0 - - var/amount - var/inserted = 0 - var/current = 0 - for(var/obj/item/stack/material/S2 in contents) - current += S2.amount - if(capacity < current + S.amount)//If the stack will fill it up - amount = capacity - current - else - amount = S.amount - - for(var/obj/item/stack/material/sheet in contents) - if(S.type == sheet.type) // we are violating the amount limitation because these are not sane objects - sheet.amount += amount // they should only be removed through procs in this file, which split them up. - S.amount -= amount - inserted = 1 - break - - if(!inserted || !S.amount) - if(!S.amount) - qdel(S) - else - S.forceMove(src) - - orient2hud(usr) - if(usr.s_active) - usr.s_active.show_to(usr) - update_icon() - return 1 - -// Sets up numbered display to show the stack size of each stored mineral -// NOTE: numbered display is turned off currently because it's broken -/obj/item/storage/bag/sheetsnatcher/orient2hud(mob/user as mob) - var/adjusted_contents = contents.len - - //Numbered contents display - var/list/datum/numbered_display/numbered_contents - if(display_contents_with_number) - numbered_contents = list() - adjusted_contents = 0 - for(var/obj/item/stack/material/I in contents) - adjusted_contents++ - var/datum/numbered_display/D = new/datum/numbered_display(I) - D.number = I.amount - numbered_contents.Add( D ) - - var/row_num = 0 - var/col_count = min(7,storage_slots) -1 - if (adjusted_contents > 7) - row_num = round((adjusted_contents-1) / 7) // 7 is the maximum allowed width. - src.slot_orient_objs(row_num, col_count, numbered_contents) - return - -// Modified quick_empty verb drops appropriate sized stacks -/obj/item/storage/bag/sheetsnatcher/quick_empty() - var/location = get_turf(src) - for(var/obj/item/stack/material/S in contents) - while(S.amount) - var/obj/item/stack/material/N = new S.type(location) - var/stacksize = min(S.amount,N.max_amount) - N.amount = stacksize - S.amount -= stacksize - N.update_icon() - if(!S.amount) - qdel(S) // todo: there's probably something missing here - orient2hud(usr) - if(usr.s_active) - usr.s_active.show_to(usr) - update_icon() - -// Instead of removing -/obj/item/storage/bag/sheetsnatcher/remove_from_storage(obj/item/W as obj, atom/new_location) - var/obj/item/stack/material/S = W - if(!istype(S)) return 0 - - //I would prefer to drop a new stack, but the item/attack_hand code - // that calls this can't recieve a different object than you clicked on. - //Therefore, make a new stack internally that has the remainder. - // -Sayu - - if(S.amount > S.max_amount) - var/obj/item/stack/material/temp = new S.type(src) - temp.amount = S.amount - S.max_amount - S.amount = S.max_amount - - return ..(S,new_location) + storage_datum_path = /datum/object_system/storage/stack + max_combined_volume = null + max_combined_weight_class = null + max_items = 300 + allow_quick_empty = TRUE + allow_mass_gather = TRUE + allow_mass_gather_mode_switch = FALSE + auto_fit_weight_class_to_largest_contained = FALSE + ui_expand_when_needed = TRUE // ----------------------------- // Sheet Snatcher (Cyborg) @@ -433,7 +253,7 @@ /obj/item/storage/bag/sheetsnatcher/borg name = "sheet snatcher 9000" desc = "" - capacity = 500//Borgs get more because >specialization + max_items = 600 // ----------------------------- // Cash Bag @@ -444,10 +264,10 @@ icon = 'icons/obj/storage.dmi' icon_state = "cashbag" desc = "A bag for carrying lots of cash. It's got a big dollar sign printed on the front." - max_storage_space = ITEMSIZE_COST_NORMAL * 25 - max_w_class = ITEMSIZE_NORMAL - w_class = ITEMSIZE_SMALL - can_hold = list(/obj/item/coin,/obj/item/spacecash) + max_combined_volume = WEIGHT_VOLUME_NORMAL * 25 + max_single_weight_class = WEIGHT_CLASS_NORMAL + w_class = WEIGHT_CLASS_SMALL + insertion_whitelist = list(/obj/item/coin,/obj/item/spacecash) // ----------------------------- // Chemistry Bag @@ -457,9 +277,9 @@ icon = 'icons/obj/storage.dmi' icon_state = "chembag" desc = "A bag for storing pills, patches, bottles, and hypovials." - max_storage_space = 200 - w_class = ITEMSIZE_LARGE - can_hold = list( + max_combined_volume = 200 + w_class = WEIGHT_CLASS_BULKY + insertion_whitelist = list( /obj/item/reagent_containers/pill, /obj/item/reagent_containers/glass/beaker, /obj/item/reagent_containers/glass/bottle, @@ -474,9 +294,9 @@ icon = 'icons/obj/storage.dmi' icon_state = "biobag" desc = "A bag for storing slime extracts, slime potions, monkey cubes, and beakers." - max_storage_space = 200 - w_class = ITEMSIZE_LARGE - can_hold = list( + max_combined_volume = 200 + w_class = WEIGHT_CLASS_BULKY + insertion_whitelist = list( /obj/item/reagent_containers/glass/beaker, /obj/item/reagent_containers/food/snacks/monkeycube, /obj/item/slime_extract, @@ -491,10 +311,10 @@ icon = 'icons/obj/storage.dmi' icon_state = "foodbag" desc = "A bag for storing foods of all kinds." - max_storage_space = ITEMSIZE_COST_NORMAL * 25 - max_w_class = ITEMSIZE_NORMAL - w_class = ITEMSIZE_SMALL - can_hold = list(/obj/item/reagent_containers/food/snacks,/obj/item/reagent_containers/food/condiment) + max_combined_volume = WEIGHT_VOLUME_NORMAL * 25 + max_single_weight_class = WEIGHT_CLASS_NORMAL + w_class = WEIGHT_CLASS_SMALL + insertion_whitelist = list(/obj/item/reagent_containers/food/snacks,/obj/item/reagent_containers/food/condiment) // ----------------------------- // Evidence Bag @@ -504,19 +324,19 @@ icon = 'icons/obj/storage.dmi' icon_state = "detbag" desc = "A bag for storing investigation things. You know, securely." - max_storage_space = ITEMSIZE_COST_NORMAL * 15 - max_w_class = ITEMSIZE_NORMAL - w_class = ITEMSIZE_SMALL - can_hold = list(/obj/item/forensics/swab,/obj/item/sample/print,/obj/item/sample/fibers,/obj/item/evidencebag) + max_combined_volume = WEIGHT_VOLUME_NORMAL * 15 + max_single_weight_class = WEIGHT_CLASS_NORMAL + w_class = WEIGHT_CLASS_SMALL + insertion_whitelist = list(/obj/item/forensics/swab,/obj/item/sample/print,/obj/item/sample/fibers,/obj/item/evidencebag) /obj/item/storage/bag/dogborg name = "dog bag" icon = 'icons/obj/storage.dmi' icon_state = "foodbag" desc = "A bag for storing things of all kinds." - max_storage_space = ITEMSIZE_COST_NORMAL * 25 - max_w_class = ITEMSIZE_NORMAL - w_class = ITEMSIZE_SMALL - can_hold = list(/obj/item/reagent_containers/food/snacks,/obj/item/reagent_containers/food/condiment, + max_combined_volume = WEIGHT_VOLUME_NORMAL * 25 + max_single_weight_class = WEIGHT_CLASS_NORMAL + w_class = WEIGHT_CLASS_SMALL + insertion_whitelist = list(/obj/item/reagent_containers/food/snacks,/obj/item/reagent_containers/food/condiment, /obj/item/reagent_containers/glass/beaker,/obj/item/reagent_containers/glass/bottle,/obj/item/coin,/obj/item/spacecash, /obj/item/reagent_containers/food/snacks/grown,/obj/item/seeds,/obj/item/grown,/obj/item/reagent_containers/pill) diff --git a/code/game/objects/items/storage/belt.dm b/code/game/objects/items/storage/belt.dm index 797e5003d41..2fbbec5b7f5 100644 --- a/code/game/objects/items/storage/belt.dm +++ b/code/game/objects/items/storage/belt.dm @@ -3,9 +3,10 @@ desc = "Can hold various things." icon = 'icons/obj/clothing/belts.dmi' icon_state = "utility" - storage_slots = 7 - max_storage_space = ITEMSIZE_COST_NORMAL * 7 //This should ensure belts always have enough room to store whatever. - max_w_class = ITEMSIZE_NORMAL + max_items = 7 + max_combined_volume = WEIGHT_VOLUME_NORMAL * 7 //This should ensure belts always have enough room to store whatever. + max_single_weight_class = WEIGHT_CLASS_NORMAL + ui_force_slot_mode = TRUE slot_flags = SLOT_BELT attack_verb = list("whipped", "lashed", "disciplined") equip_sound = 'sound/items/toolbelt_equip.ogg' @@ -48,7 +49,7 @@ desc = "Can hold various tools." icon_state = "utility" item_state = "utility" - can_hold = list( + insertion_whitelist = list( ///obj/item/combitool, /obj/item/tool/crowbar, /obj/item/tool/screwdriver, @@ -118,7 +119,7 @@ name = "medical belt" desc = "Can hold various medical equipment." icon_state = "medical" - can_hold = list( + insertion_whitelist = list( /obj/item/healthanalyzer, /obj/item/dnainjector, /obj/item/reagent_containers/dropper, @@ -159,8 +160,8 @@ name = "security belt" desc = "Can hold security gear like handcuffs and flashes." icon_state = "security" - max_w_class = ITEMSIZE_NORMAL - can_hold = list( + max_single_weight_class = WEIGHT_CLASS_NORMAL + insertion_whitelist = list( /obj/item/grenade, /obj/item/reagent_containers/spray/pepper, /obj/item/handcuffs, @@ -197,9 +198,9 @@ name = "forensic utility belt" desc = "A belt for holding forensics equipment." icon_state = "security" - storage_slots = 7 - max_w_class = ITEMSIZE_NORMAL - can_hold = list( + max_items = 7 + max_single_weight_class = WEIGHT_CLASS_NORMAL + insertion_whitelist = list( /obj/item/tape_recorder, /obj/item/barrier_tape_roll, /obj/item/clothing/glasses, @@ -240,10 +241,10 @@ name = "pathfinder's bandolier" desc = "A versatile bandolier fitted with eight pouches that can hold a wide variety of items such as tools, small melee weapons, batteries, ammunition, and more; ideal for any pathfinder who has too much stuff and not enough pockets." icon_state = "bandolier" - storage_slots = 7 - max_storage_space = ITEMSIZE_COST_NORMAL * 7 + max_items = 7 + max_combined_volume = WEIGHT_VOLUME_NORMAL * 7 show_above_suit = 1 - can_hold = list( + insertion_whitelist = list( /obj/item/grenade, /obj/item/tool/crowbar, /obj/item/tool/screwdriver, @@ -296,8 +297,8 @@ name = "soul stone belt" desc = "Designed for ease of access to the shards during a fight, as to not let a single enemy spirit slip away" icon_state = "soulstone" - storage_slots = 6 - can_hold = list( + max_items = 6 + insertion_whitelist = list( /obj/item/soulstone ) @@ -328,8 +329,8 @@ icon = 'icons/obj/abductor.dmi' icon_state = "belt" item_state = "security" - storage_slots = 8 - can_hold = list( + max_items = 8 + insertion_whitelist = list( /obj/item/healthanalyzer, /obj/item/dnainjector, /obj/item/reagent_containers/dropper, @@ -374,8 +375,8 @@ name = "championship belt" desc = "Proves to the world that you are the strongest!" icon_state = "champion" - storage_slots = 1 - can_hold = list( + max_items = 1 + insertion_whitelist = list( "/obj/item/clothing/mask/luchador" ) @@ -383,9 +384,9 @@ name = "combat belt" desc = "Can hold security gear like handcuffs and flashes, with more pouches for more storage." icon_state = "swat" - storage_slots = 9 - max_w_class = ITEMSIZE_NORMAL - max_storage_space = ITEMSIZE_COST_NORMAL * 7 + max_items = 9 + max_single_weight_class = WEIGHT_CLASS_NORMAL + max_combined_volume = WEIGHT_VOLUME_NORMAL * 7 /obj/item/storage/belt/security/tactical/bandolier name = "combat belt" @@ -396,19 +397,19 @@ name = "spike bandolier" desc = "A bandolier used to hold spikes, and only spikes." icon_state = "bandolier" - storage_slots = 14 - max_w_class = ITEMSIZE_SMALL - max_storage_space = ITEMSIZE_COST_SMALL * 14 - can_hold = list(/obj/item/melee/spike) + max_items = 14 + max_single_weight_class = WEIGHT_CLASS_SMALL + max_combined_volume = WEIGHT_VOLUME_SMALL * 14 + insertion_whitelist = list(/obj/item/melee/spike) starts_with = list(/obj/item/melee/spike = 14) /obj/item/storage/belt/janitor name = "janitorial belt" desc = "A belt used to hold most janitorial supplies." icon_state = "janitor" - storage_slots = 7 - max_w_class = ITEMSIZE_NORMAL - can_hold = list( + max_items = 7 + max_single_weight_class = WEIGHT_CLASS_NORMAL + insertion_whitelist = list( /obj/item/clothing/glasses, /obj/item/flashlight, /obj/item/cell/device, @@ -431,7 +432,7 @@ name = "excavation gear-belt" desc = "Can hold various excavation gear." icon_state = "gear" - can_hold = list( + insertion_whitelist = list( /obj/item/storage/box/samplebags, /obj/item/core_sampler, /obj/item/beacon_locator, @@ -466,9 +467,9 @@ desc = "A dorky fannypack for keeping small items in." icon_state = "fannypack_leather" item_state = "fannypack_leather" - max_w_class = ITEMSIZE_SMALL - storage_slots = null - max_storage_space = ITEMSIZE_COST_NORMAL * 2 + max_single_weight_class = WEIGHT_CLASS_SMALL + max_items = null + max_combined_volume = WEIGHT_VOLUME_NORMAL * 2 /obj/item/storage/belt/fannypack/black name = "black fannypack" @@ -519,8 +520,8 @@ name = "sabre sheath" desc = "An ornate sheath designed to hold an officer's blade." icon_state = "sheath-sabre" - storage_slots = 1 - can_hold = list( + max_items = 1 + insertion_whitelist = list( /obj/item/melee/sabre, /obj/item/melee/baton/stunsword, ) @@ -548,9 +549,9 @@ name = "dual holster gunbelt" desc = "Belts like these were popular on old Earth, but were largely supplanted by modular holsters. This gunbelt is too bulky to be comfortably anchored to clothes without support." icon_state = "dual_holster" - storage_slots = 2 - max_w_class = ITEMSIZE_NORMAL - can_hold = list( + max_items = 2 + max_single_weight_class = WEIGHT_CLASS_NORMAL + insertion_whitelist = list( /obj/item/gun/energy/alien, /obj/item/gun/energy/captain, /obj/item/gun/energy/crossbow, @@ -591,9 +592,9 @@ name = "leather quiver" desc = "A quiver made from the hide of some animal. Used to hold arrows." icon_state = "quiver" - storage_slots = 15 - max_w_class = ITEMSIZE_NORMAL - can_hold = list( + max_items = 15 + max_single_weight_class = WEIGHT_CLASS_NORMAL + insertion_whitelist = list( /obj/item/ammo_casing/arrow ) @@ -601,9 +602,9 @@ name = "leather quiver" desc = "A quiver made from the hide of some animal. Used to hold arrows." icon_state = "quiver" - storage_slots = 15 - max_w_class = ITEMSIZE_NORMAL - can_hold = list( + max_items = 15 + max_single_weight_class = WEIGHT_CLASS_NORMAL + insertion_whitelist = list( /obj/item/ammo_casing/arrow ) starts_with = list( @@ -614,9 +615,9 @@ name = "leather quiver" desc = "A quiver made from the hide of some animal. Used to hold arrows." icon_state = "quiver" - storage_slots = 15 - max_w_class = ITEMSIZE_NORMAL - can_hold = list( + max_items = 15 + max_single_weight_class = WEIGHT_CLASS_NORMAL + insertion_whitelist = list( /obj/item/ammo_casing/arrow ) starts_with = list( diff --git a/code/game/objects/items/storage/boxes.dm b/code/game/objects/items/storage/boxes.dm index 26bc1cdbb55..9de90fb2eca 100644 --- a/code/game/objects/items/storage/boxes.dm +++ b/code/game/objects/items/storage/boxes.dm @@ -25,8 +25,8 @@ icon_state = "box" item_state = "syringe_kit" var/foldable = /obj/item/stack/material/cardboard // BubbleWrap - if set, can be folded (when empty) into a sheet of cardboard - max_w_class = ITEMSIZE_SMALL - max_storage_space = INVENTORY_BOX_SPACE + max_single_weight_class = WEIGHT_CLASS_SMALL + max_combined_volume = STORAGE_VOLUME_BOX drop_sound = 'sound/items/drop/cardboardbox.ogg' pickup_sound = 'sound/items/pickup/cardboardbox.ogg' @@ -54,15 +54,6 @@ if ( !ispath(foldable) ) return - var/found = 0 - // Close any open UI windows first - for(var/mob/M in range(1)) - if (M.s_active == src) - close(M) - if ( M == user ) - found = 1 - if ( !found ) // User is too far away - return // Now make the cardboard to_chat(user, "You fold [src] flat.") new foldable(get_turf(src)) @@ -150,11 +141,11 @@ drop_sound = 'sound/items/drop/ammobox.ogg' pickup_sound = 'sound/items/pickup/ammobox.ogg' -/obj/item/storage/box/beanbags/PopulateContents() +/obj/item/storage/box/beanbags/legacy_spawn_contents() for(var/i in 1 to 8) new /obj/item/ammo_casing/a12g/beanbag(src) -/obj/item/storage/box/beanbags/large/PopulateContents() +/obj/item/storage/box/beanbags/large/legacy_spawn_contents() for(var/i in 1 to 16) new /obj/item/ammo_casing/a12g/beanbag(src) @@ -384,7 +375,7 @@ desc = "Drymate brand monkey cubes. Just add water!" icon = 'icons/obj/food.dmi' icon_state = "monkeycubebox" - can_hold = list(/obj/item/reagent_containers/food/snacks/monkeycube) + insertion_whitelist = list(/obj/item/reagent_containers/food/snacks/monkeycube) starts_with = list(/obj/item/reagent_containers/food/snacks/monkeycube/wrapped = 4) /obj/item/storage/box/monkeycubes/farwacubes @@ -437,7 +428,7 @@ desc = "Eight wrappers of fun! Ages 8 and up. Not suitable for children." icon = 'icons/obj/toy.dmi' icon_state = "spbox" - can_hold = list(/obj/item/toy/snappop) + insertion_whitelist = list(/obj/item/toy/snappop) starts_with = list(/obj/item/toy/snappop = 8) /obj/item/storage/box/matches @@ -445,9 +436,9 @@ desc = "A small box of 'Space-Proof' premium matches." icon = 'icons/obj/cigarettes.dmi' icon_state = "matchbox" - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY slot_flags = SLOT_BELT - can_hold = list(/obj/item/flame/match) + insertion_whitelist = list(/obj/item/flame/match) starts_with = list(/obj/item/flame/match = 10) drop_sound = 'sound/items/drop/matchbox.ogg' pickup_sound = 'sound/items/pickup/matchbox.ogg' @@ -473,10 +464,10 @@ icon_state = "light" desc = "This box is shaped on the inside so that only light tubes and bulbs fit." item_state_slots = list(SLOT_ID_RIGHT_HAND = "syringe_kit", SLOT_ID_LEFT_HAND = "syringe_kit") - storage_slots = 24 - can_hold = list(/obj/item/light/tube, /obj/item/light/bulb) - max_storage_space = ITEMSIZE_COST_SMALL * 24 //holds 24 items of w_class 2 - use_to_pickup = 1 // for picking up broken bulbs, not that most people will try + max_items = 24 + insertion_whitelist = list(/obj/item/light/tube, /obj/item/light/bulb) + max_combined_volume = WEIGHT_VOLUME_SMALL * 24 //holds 24 items of w_class 2 + allow_mass_gather = TRUE // for picking up broken bulbs, not that most people will try /obj/item/storage/box/lights/bulbs starts_with = list(/obj/item/light/bulb = 24) @@ -497,7 +488,7 @@ /obj/item/storage/box/lights/fairy name = "box of replacement fairy bulbs" icon_state = "lightfairy" - can_hold = list(/obj/item/light/bulb/fairy) + insertion_whitelist = list(/obj/item/light/bulb/fairy) starts_with = list(/obj/item/light/bulb/fairy = 24) //Colored Lights @@ -516,7 +507,7 @@ /obj/item/storage/box/lights/bulbs_neon name = "box of neon bulbs" icon_state = "light_color" - storage_slots = 30 + max_items = 30 starts_with = list( /obj/item/light/bulb/neon_pink = 6, /obj/item/light/bulb/neon_blue = 6, @@ -540,7 +531,7 @@ /obj/item/storage/box/lights/tubes_neon name = "box of neon tubes" icon_state = "lighttube_color" - storage_slots = 30 + max_items = 30 starts_with = list( /obj/item/light/tube/neon_pink = 6, /obj/item/light/tube/neon_blue = 6, @@ -570,7 +561,7 @@ /obj/item/storage/box/lights/mixed_neon name = "box of neon lights" icon_state = "lightmixed_color" - storage_slots = 30 + max_items = 30 starts_with = list( /obj/item/light/tube/neon_pink = 3, /obj/item/light/tube/neon_blue = 3, @@ -591,10 +582,10 @@ icon_state = "portafreezer" item_state_slots = list(SLOT_ID_RIGHT_HAND = "medicalpack", SLOT_ID_LEFT_HAND = "medicalpack") foldable = null - max_w_class = ITEMSIZE_NORMAL - can_hold = list(/obj/item/organ) - max_storage_space = ITEMSIZE_COST_NORMAL * 5 // Formally 21. Odd numbers are bad. - use_to_pickup = 1 // for picking up broken bulbs, not that most people will try + max_single_weight_class = WEIGHT_CLASS_NORMAL + insertion_whitelist = list(/obj/item/organ) + max_combined_volume = WEIGHT_VOLUME_NORMAL * 5 // Formally 21. Odd numbers are bad. + allow_mass_gather = TRUE // for picking up broken bulbs, not that most people will try /obj/item/storage/box/freezer/Entered(var/atom/movable/AM) if(istype(AM, /obj/item/organ)) @@ -689,8 +680,8 @@ name = "foil raincoat pouch" icon_state = "rainponcho" foldable = null - storage_slots = 1 - can_hold = list(/obj/item/clothing/suit/storage/hooded/rainponcho) + max_items = 1 + insertion_whitelist = list(/obj/item/clothing/suit/storage/hooded/rainponcho) starts_with = list(/obj/item/clothing/suit/storage/hooded/rainponcho) //Foam Darts diff --git a/code/game/objects/items/storage/briefcase.dm b/code/game/objects/items/storage/briefcase.dm index ef15bad6dc4..f3383051069 100644 --- a/code/game/objects/items/storage/briefcase.dm +++ b/code/game/objects/items/storage/briefcase.dm @@ -5,10 +5,10 @@ damage_force = 8.0 throw_speed = 1 throw_range = 4 - w_class = ITEMSIZE_LARGE - max_w_class = ITEMSIZE_NORMAL - max_storage_space = ITEMSIZE_COST_NORMAL * 4 - use_sound = 'sound/items/storage/briefcase.ogg' + w_class = WEIGHT_CLASS_BULKY + max_single_weight_class = WEIGHT_CLASS_NORMAL + max_combined_volume = WEIGHT_VOLUME_NORMAL * 4 + sfx_open = 'sound/items/storage/briefcase.ogg' drop_sound = 'sound/items/drop/backpack.ogg' pickup_sound = 'sound/items/pickup/backpack.ogg' @@ -19,13 +19,13 @@ icon_state = "clutch" item_state_slots = list(SLOT_ID_RIGHT_HAND = "smpurse", SLOT_ID_LEFT_HAND = "smpurse") damage_force = 0 - w_class = ITEMSIZE_NORMAL - max_w_class = ITEMSIZE_SMALL - max_storage_space = ITEMSIZE_COST_SMALL * 4 + w_class = WEIGHT_CLASS_NORMAL + max_single_weight_class = WEIGHT_CLASS_SMALL + max_combined_volume = WEIGHT_VOLUME_SMALL * 4 /obj/item/storage/briefcase/crafted desc = "Hand crafted suitcase made of leather and cloth." damage_force = 6 -/obj/item/storage/briefcase/crafted/PopulateContents() +/obj/item/storage/briefcase/crafted/legacy_spawn_contents() return //So we dont spawn items diff --git a/code/game/objects/items/storage/internal.dm b/code/game/objects/items/storage/internal.dm deleted file mode 100644 index 6197817efcb..00000000000 --- a/code/game/objects/items/storage/internal.dm +++ /dev/null @@ -1,80 +0,0 @@ -//A storage item intended to be used by other items to provide storage functionality. -//Types that use this should consider overriding emp_act() and hear_talk(), unless they shield their contents somehow. -/obj/item/storage/internal - preserve_item = 1 - var/obj/item/master_item - -/obj/item/storage/internal/Initialize(mapload) - . = ..() - master_item = loc - remove_obj_verb(src, /obj/item/verb/verb_pickup) //make sure this is never picked up. - -/obj/item/storage/internal/Destroy() - master_item = null - . = ..() - -//Helper procs to cleanly implement internal storages - storage items that provide inventory slots for other items. -//These procs are completely optional, it is up to the master item to decide when it's storage get's opened by calling open() -//However they are helpful for allowing the master item to pretend it is a storage item itself. -//If you are using these you will probably want to override attackby() as well. -//See /obj/item/clothing/suit/storage for an example. - -//items that use internal storage have the option of calling this to emulate default storage MouseDrop behaviour. -//returns 1 if the master item's parent's MouseDrop() should be called, 0 otherwise. It's strange, but no other way of -//doing it without the ability to call another proc's parent, really. -/obj/item/storage/internal/proc/handle_mousedrop(mob/user as mob, obj/over_object as obj) - if (ishuman(user) || issmall(user)) //so monkeys can take off their backpacks -- Urist - - if (istype(user.loc,/obj/mecha)) // stops inventory actions in a mech - return 0 - - if(over_object == user && Adjacent(user)) // this must come before the screen objects only block - src.open(user) - return 0 - - if (!( istype(over_object, /atom/movable/screen) )) - return 1 - - //makes sure master_item is equipped before putting it in hand, so that we can't drag it into our hand from miles away. - //there's got to be a better way of doing this... - if (!(master_item.loc == user) || (master_item.loc && master_item.loc.loc == user)) - return 0 - - if (!( user.restrained() ) && !( user.stat )) - switch(over_object.name) - if("r_hand") - user.put_in_right_hand(master_item) - if("l_hand") - user.put_in_left_hand(master_item) - master_item.add_fingerprint(user) - return 0 - return 0 - -//items that use internal storage have the option of calling this to emulate default storage attack_hand behaviour. -//returns 1 if the master item's parent's attack_hand() should be called, 0 otherwise. -//It's strange, but no other way of doing it without the ability to call another proc's parent, really. -/obj/item/storage/internal/proc/handle_attack_hand(mob/user as mob) - - if(ishuman(user)) - var/mob/living/carbon/human/H = user - if(H.l_store == master_item && !H.get_active_held_item()) //Prevents opening if it's in a pocket. - H.put_in_hands(master_item) - H.l_store = null - return 0 - if(H.r_store == master_item && !H.get_active_held_item()) - H.put_in_hands(master_item) - H.r_store = null - return 0 - - src.add_fingerprint(user) - if (master_item.loc == user) - src.open(user) - return 0 - - for(var/mob/M in range(1, master_item.loc)) - if (M.s_active == src) - src.close(M) - return 1 - -/obj/item/storage/internal/Adjacent(var/atom/neighbor) - return master_item.Adjacent(neighbor) diff --git a/code/game/objects/items/storage/laundry_basket.dm b/code/game/objects/items/storage/laundry_basket.dm deleted file mode 100644 index 2d0c83027fc..00000000000 --- a/code/game/objects/items/storage/laundry_basket.dm +++ /dev/null @@ -1,91 +0,0 @@ -// ----------------------------- -// Laundry Basket -// ----------------------------- -// An item designed for hauling the belongings of a character. -// So this cannot be abused for other uses, we make it two-handed and inable to have its storage looked into. -/obj/item/storage/laundry_basket - name = "laundry basket" - icon = 'icons/obj/janitor.dmi' - icon_state = "laundry-empty" - item_state_slots = list(SLOT_ID_RIGHT_HAND = "laundry", SLOT_ID_LEFT_HAND = "laundry") - desc = "The peak of thousands of years of laundry evolution." - - w_class = ITEMSIZE_HUGE - max_w_class = ITEMSIZE_LARGE - max_storage_space = ITEMSIZE_COST_NORMAL * 8 - storage_slots = 20 - use_to_pickup = 1 - allow_quick_empty = 1 - allow_quick_gather = 1 - collection_mode = 1 - var/linked - -/obj/item/storage/laundry_basket/attack_hand(mob/user, list/params) - if(ishuman(user)) - var/mob/living/carbon/human/H = user - var/obj/item/organ/external/temp = H.get_organ("r_hand") - if (H.hand) - temp = H.get_organ("l_hand") - if(!temp) - to_chat(user, "You need two hands to pick this up!") - return - - if(user.get_inactive_held_item()) - to_chat(user, "You need your other hand to be empty") - return - return ..() - -/obj/item/storage/laundry_basket/attack_self(mob/user) - . = ..() - if(.) - return - var/turf/T = get_turf(user) - to_chat(user, "You dump the [src]'s contents onto \the [T].") - return ..() - -/obj/item/storage/laundry_basket/pickup(mob/user, flags, atom/oldLoc) - . = ..() - if(!use_to_pickup) - return // DON'T FUCKING INFINITELY RECURSE - var/obj/item/storage/laundry_basket/offhand/O = new(user) - O.name = "[name] - second hand" - O.desc = "Your second grip on the [name]." - O.linked = src - user.put_in_inactive_hand(O) - linked = O - -/obj/item/storage/laundry_basket/update_icon_state() - . = ..() - if(contents.len) - icon_state = "laundry-full" - else - icon_state = "laundry-empty" - -/obj/item/storage/laundry_basket/OnMouseDropLegacy(obj/over_object as obj) - if(over_object == usr) - return - else - return ..() - -/obj/item/storage/laundry_basket/dropped(mob/user, flags, atom/newLoc) - if(use_to_pickup) // sigh refactor this shit when - QDEL_NULL(linked) - return ..() - -/obj/item/storage/laundry_basket/show_to(mob/user as mob) - return - -/obj/item/storage/laundry_basket/open(mob/user as mob) - - -//Offhand -// TODO: REFACTOR THIS SHIT -/obj/item/storage/laundry_basket/offhand - icon = 'icons/obj/weapons.dmi' - icon_state = "offhand" - name = "second hand" - use_to_pickup = 0 - -/obj/item/storage/laundry_basket/offhand/dropped(mob/user, flags, atom/newLoc) - . = ..() - user.drop_item_to_ground(linked) diff --git a/code/game/objects/items/storage/lockbox.dm b/code/game/objects/items/storage/lockbox.dm index d5f54a40c03..03255d855d6 100644 --- a/code/game/objects/items/storage/lockbox.dm +++ b/code/game/objects/items/storage/lockbox.dm @@ -3,17 +3,21 @@ desc = "A locked box." icon_state = "lockbox+l" item_state_slots = list(SLOT_ID_RIGHT_HAND = "syringe_kit", SLOT_ID_LEFT_HAND = "syringe_kit") - w_class = ITEMSIZE_LARGE - max_w_class = ITEMSIZE_NORMAL - max_storage_space = ITEMSIZE_COST_NORMAL * 4 //The sum of the w_classes of all the items in this storage item. + w_class = WEIGHT_CLASS_BULKY + max_single_weight_class = WEIGHT_CLASS_NORMAL + max_combined_volume = WEIGHT_VOLUME_NORMAL * 4 //The sum of the w_classes of all the items in this storage item. req_access = list(ACCESS_SECURITY_ARMORY) preserve_item = 1 - var/locked = 1 var/broken = 0 + var/locked = TRUE var/icon_locked = "lockbox+l" var/icon_closed = "lockbox" var/icon_broken = "lockbox+b" +/obj/item/storage/lockbox/initialize_storage() + . = ..() + if(locked && !broken) + obj_storage.set_locked(TRUE) /obj/item/storage/lockbox/attackby(obj/item/W, mob/user) if (istype(W, /obj/item/card/id)) @@ -21,11 +25,10 @@ to_chat(user, "It appears to be broken.") return if(src.allowed(user)) - src.locked = !( src.locked ) - if(src.locked) + obj_storage.set_locked(!obj_storage.locked) + if(obj_storage.locked) src.icon_state = src.icon_locked to_chat(user, "You lock \the [src]!") - close_all() return else src.icon_state = src.icon_closed @@ -44,15 +47,6 @@ ..() else to_chat(user, "It's locked!") - return - - -/obj/item/storage/lockbox/show_to(mob/user) - if(locked) - to_chat(user, "It's locked!") - else - ..() - return /obj/item/storage/lockbox/emag_act(remaining_charges, mob/user, emag_source, visual_feedback = "", audible_feedback = "") if(!broken) @@ -66,7 +60,7 @@ audible_feedback = "You hear a faint electrical spark." broken = 1 - locked = 0 + obj_storage.set_locked(FALSE) desc = "It appears to be broken." icon_state = src.icon_broken visible_message(visual_feedback, audible_feedback) @@ -90,7 +84,7 @@ name = "lockbox of medals" desc = "A lockbox filled with commemorative medals, it has the NanoTrasen logo stamped on it." req_access = list(ACCESS_COMMAND_BRIDGE) - storage_slots = 7 + max_items = 7 starts_with = list( /obj/item/clothing/accessory/medal/conduct, /obj/item/clothing/accessory/medal/bronze_heart, @@ -105,7 +99,7 @@ /obj/item/storage/lockbox/colonial name = "Colonial Equipment Pack" req_access = list(ACCESS_GENERAL_PATHFINDER) - storage_slots = 34 + max_items = 34 starts_with = list( /obj/item/clothing/under/customs/khaki = 4, /obj/item/clothing/suit/colonial_redcoat = 4, @@ -121,7 +115,7 @@ /obj/item/storage/lockbox/gateway name = "Gateway Guardian Pack" req_access = list(ACCESS_GENERAL_PATHFINDER) - storage_slots = 24 + max_items = 24 starts_with = list( /obj/item/clothing/under/tactical = 4, /obj/item/clothing/accessory/storage/black_vest = 4, @@ -135,7 +129,7 @@ /obj/item/storage/lockbox/cowboy name = "Cyan Posse Pack" req_access = list(ACCESS_GENERAL_PATHFINDER) - storage_slots = 33 + max_items = 33 starts_with = list( /obj/item/clothing/suit/storage/toggle/brown_jacket = 4, /obj/item/clothing/shoes/boots/cowboy/classic = 4, @@ -154,7 +148,7 @@ /obj/item/storage/lockbox/russian name = "Conscript Pack" req_access = list(ACCESS_GENERAL_PATHFINDER) - storage_slots = 17 + max_items = 17 starts_with = list( /obj/item/clothing/under/soviet = 4, /obj/item/clothing/head/ushanka = 3, @@ -169,7 +163,7 @@ /obj/item/storage/lockbox/crusade name = "Holy Crusade Pack" req_access = list(ACCESS_GENERAL_PATHFINDER) - storage_slots = 34 + max_items = 34 starts_with = list( /obj/item/clothing/suit/armor/medieval/crusader/cross/templar = 4, /obj/item/clothing/head/helmet/medieval/crusader/templar = 4, @@ -182,7 +176,7 @@ /obj/item/storage/lockbox/maniple name = "Maniple Pack" req_access = list(ACCESS_GENERAL_PATHFINDER) - storage_slots = 16 + max_items = 16 starts_with = list( /obj/item/clothing/under/roman = 4, /obj/item/clothing/head/helmet/roman = 3, @@ -194,7 +188,7 @@ /obj/item/storage/lockbox/away name = "Away Team Pack" req_access = list(ACCESS_GENERAL_PATHFINDER) - storage_slots = 17 + max_items = 17 starts_with = list( /obj/item/clothing/under/rank/trek/command/ds9 = 1, /obj/item/clothing/under/rank/trek/engsec/ds9 = 2, @@ -209,7 +203,7 @@ name = "Lightweight Plating Kit" desc = "A lockbox filled with a plate harness and modular limb armor." req_access = list(ACCESS_SECURITY_EQUIPMENT) - storage_slots = 5 + max_items = 5 starts_with = list( /obj/item/clothing/suit/armor/plate_harness, /obj/item/clothing/accessory/armor/limb_plate/arm_r, diff --git a/code/game/objects/items/storage/medical/firstaid.dm b/code/game/objects/items/storage/medical/firstaid.dm index e7f2dbb161f..1d6f1bc4a34 100644 --- a/code/game/objects/items/storage/medical/firstaid.dm +++ b/code/game/objects/items/storage/medical/firstaid.dm @@ -15,7 +15,7 @@ throw_speed = 2 throw_range = 8 slot_flags = SLOT_BELT - max_storage_space = ITEMSIZE_COST_SMALL * 7 // 14 + max_combined_volume = WEIGHT_VOLUME_SMALL * 7 // 14 drop_sound = 'sound/items/drop/cardboardbox.ogg' pickup_sound = 'sound/items/pickup/cardboardbox.ogg' @@ -114,10 +114,10 @@ icon = 'icons/obj/storage.dmi' icon_state = "surgerykit" item_state = "firstaid-surgery" - max_w_class = ITEMSIZE_NORMAL - max_storage_space = 25 //update this when necessary! + max_single_weight_class = WEIGHT_CLASS_NORMAL + max_combined_volume = 25 //update this when necessary! - can_hold = list( + insertion_whitelist = list( /obj/item/surgical, /obj/item/stack/medical/advanced/bruise_pack, /obj/item/stack/nanopaste, @@ -143,13 +143,13 @@ name = "clotting kit" desc = "Contains chemicals to stop bleeding." icon_state = "clottingkit" - max_storage_space = ITEMSIZE_COST_SMALL * 7 + max_combined_volume = WEIGHT_VOLUME_SMALL * 7 starts_with = list(/obj/item/reagent_containers/hypospray/autoinjector/biginjector/clotting = 8) /obj/item/storage/firstaid/bonemed name = "bone repair kit" desc = "Contains chemicals to mend broken bones." - max_storage_space = ITEMSIZE_COST_SMALL * 7 + max_combined_volume = WEIGHT_VOLUME_SMALL * 7 starts_with = list(/obj/item/reagent_containers/hypospray/autoinjector/biginjector/bonemed = 8) /* @@ -163,14 +163,15 @@ drop_sound = 'sound/items/drop/pillbottle.ogg' pickup_sound = 'sound/items/pickup/pillbottle.ogg' item_state_slots = list(SLOT_ID_RIGHT_HAND = "contsolid", SLOT_ID_LEFT_HAND = "contsolid") - w_class = ITEMSIZE_SMALL - can_hold = list(/obj/item/reagent_containers/pill,/obj/item/dice,/obj/item/paper) - allow_quick_gather = 1 - allow_quick_empty = 1 - use_to_pickup = 1 - use_sound = null - max_storage_space = ITEMSIZE_COST_TINY * 14 - max_w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_SMALL + insertion_whitelist = list(/obj/item/reagent_containers/pill,/obj/item/dice,/obj/item/paper) + allow_quick_empty = TRUE + allow_mass_gather = TRUE + sfx_insert = null + sfx_remove = null + sfx_open = null + max_combined_volume = WEIGHT_VOLUME_TINY * 14 + max_single_weight_class = WEIGHT_CLASS_TINY var/label_text = "" var/labeled = 0 diff --git a/code/game/objects/items/storage/medical/hypokit.dm b/code/game/objects/items/storage/medical/hypokit.dm index 329660a2552..6409bb530a8 100644 --- a/code/game/objects/items/storage/medical/hypokit.dm +++ b/code/game/objects/items/storage/medical/hypokit.dm @@ -5,8 +5,8 @@ inhand_icon = 'icons/items/storage/firstaid.dmi' icon_state = "normal" slot_flags = SLOT_BELT - max_storage_space = INVENTORY_BOX_SPACE - can_hold = list( + max_combined_volume = STORAGE_VOLUME_BOX + insertion_whitelist = list( /obj/item/reagent_containers/glass/hypovial, /obj/item/hypospray, ) @@ -15,7 +15,7 @@ var/vial_path = /obj/item/reagent_containers/glass/hypovial var/vial_amount = 6 -/obj/item/storage/hypokit/PopulateContents() +/obj/item/storage/hypokit/legacy_spawn_contents() . = ..() new hypospray_path(src) spawn_hypovials() @@ -29,8 +29,8 @@ icon_state = "tactical" hypospray_path = /obj/item/hypospray/combat/loaded vial_path = /obj/item/reagent_containers/glass/hypovial/large - max_storage_space = INVENTORY_BOX_SPACE * 2 - storage_cost = ITEMSIZE_COST_NORMAL * 1.5 + max_combined_volume = STORAGE_VOLUME_BOX * 2 + weight_volume = WEIGHT_VOLUME_NORMAL * 1.5 /obj/item/storage/hypokit/combat/loaded/spawn_hypovials() for(var/i in 1 to 2) @@ -54,8 +54,8 @@ inhand_state = "normal" hypospray_path = /obj/item/hypospray/advanced/loaded vial_path = /obj/item/reagent_containers/glass/hypovial/large - max_storage_space = INVENTORY_BOX_SPACE * 2 - storage_cost = ITEMSIZE_COST_NORMAL * 1.5 + max_combined_volume = STORAGE_VOLUME_BOX * 2 + weight_volume = WEIGHT_VOLUME_NORMAL * 1.5 /obj/item/storage/hypokit/advanced/loaded/spawn_hypovials() for(var/i in 1 to 2) diff --git a/code/game/objects/items/storage/bible.dm b/code/game/objects/items/storage/misc_legacy/bible.dm similarity index 84% rename from code/game/objects/items/storage/bible.dm rename to code/game/objects/items/storage/misc_legacy/bible.dm index bd8f6956cdf..0508e8c0ea0 100644 --- a/code/game/objects/items/storage/bible.dm +++ b/code/game/objects/items/storage/misc_legacy/bible.dm @@ -4,8 +4,7 @@ icon_state ="bible" throw_speed = 1 throw_range = 5 - w_class = ITEMSIZE_NORMAL - var/mob/affecting = null + w_class = WEIGHT_CLASS_NORMAL var/deity_name = "Christ" /obj/item/storage/bible/booze @@ -28,8 +27,3 @@ var/water2holy = target.reagents.get_reagent_amount("water") target.reagents.del_reagent("water") target.reagents.add_reagent("holywater",water2holy) - -/obj/item/storage/bible/attackby(obj/item/W as obj, mob/user as mob) - if (src.use_sound) - playsound(src.loc, src.use_sound, 50, 1, -5) - ..() diff --git a/code/game/objects/items/storage/fancy.dm b/code/game/objects/items/storage/misc_legacy/fancy.dm similarity index 85% rename from code/game/objects/items/storage/fancy.dm rename to code/game/objects/items/storage/misc_legacy/fancy.dm index d2b05d0f901..f24d76e3e72 100644 --- a/code/game/objects/items/storage/fancy.dm +++ b/code/game/objects/items/storage/misc_legacy/fancy.dm @@ -22,6 +22,10 @@ drop_sound = 'sound/items/drop/cardboardbox.ogg' pickup_sound = 'sound/items/pickup/cardboardbox.ogg' +/obj/item/storage/fancy/initialize_storage() + . = ..() + obj_storage.update_icon_on_item_change = TRUE + /obj/item/storage/fancy/update_icon_state() . = ..() icon_state = "[icon_type]box[contents.len]" @@ -46,9 +50,9 @@ icon_state = "eggbox" icon_type = "egg" name = "egg box" - storage_slots = 12 - max_storage_space = 12 * ITEMSIZE_COST_SMALL - can_hold = list( + max_items = 12 + max_combined_volume = 12 * WEIGHT_VOLUME_SMALL + insertion_whitelist = list( /obj/item/reagent_containers/food/snacks/egg, /obj/item/reagent_containers/food/snacks/boiledegg ) @@ -67,7 +71,7 @@ item_state = "candlebox5" throw_force = 2 slot_flags = SLOT_BELT - max_storage_space = ITEMSIZE_COST_SMALL * 5 + max_combined_volume = WEIGHT_VOLUME_SMALL * 5 starts_with = list(/obj/item/flame/candle = 5) /obj/item/storage/fancy/whitecandle_box @@ -79,7 +83,7 @@ item_state = "whitecandlebox5" throw_force = 2 slot_flags = SLOT_BELT - max_storage_space = ITEMSIZE_COST_SMALL * 5 + max_combined_volume = WEIGHT_VOLUME_SMALL * 5 starts_with = list(/obj/item/flame/candle/white = 5) /obj/item/storage/fancy/blackcandle_box @@ -91,7 +95,7 @@ item_state = "blackcandlebox5" throw_force = 2 slot_flags = SLOT_BELT - max_storage_space = ITEMSIZE_COST_SMALL * 5 + max_combined_volume = WEIGHT_VOLUME_SMALL * 5 starts_with = list(/obj/item/flame/candle/black = 5) @@ -104,9 +108,9 @@ desc = "A box of crayons for all your rune drawing needs." icon = 'icons/obj/crayons.dmi' icon_state = "crayonbox" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL icon_type = "crayon" - can_hold = list( + insertion_whitelist = list( /obj/item/pen/crayon ) starts_with = list( @@ -143,9 +147,9 @@ desc = "A very professional looking box of permanent markers." icon = 'icons/obj/crayons.dmi' icon_state = "markerbox" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL icon_type = "marker" - can_hold = list( + insertion_whitelist = list( /obj/item/pen/crayon/marker ) starts_with = list( @@ -183,9 +187,9 @@ desc = "A box of chalk for all your ritual needs." icon = 'icons/obj/crayons.dmi' icon_state = "chalkbox" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL icon_type = "chalk" - can_hold = list( + insertion_whitelist = list( /obj/item/pen/crayon/chalk ) starts_with = list( @@ -213,10 +217,10 @@ icon = 'icons/obj/food.dmi' icon_state = "crackerbox" icon_type = "cracker" - max_storage_space = ITEMSIZE_COST_TINY * 6 - max_w_class = ITEMSIZE_TINY - w_class = ITEMSIZE_SMALL - can_hold = list(/obj/item/reagent_containers/food/snacks/cracker) + max_combined_volume = WEIGHT_VOLUME_TINY * 6 + max_single_weight_class = WEIGHT_CLASS_TINY + w_class = WEIGHT_CLASS_SMALL + insertion_whitelist = list(/obj/item/reagent_containers/food/snacks/cracker) starts_with = list(/obj/item/reagent_containers/food/snacks/cracker = 6) //////////// @@ -228,11 +232,11 @@ icon = 'icons/obj/cigarettes.dmi' icon_state = "cigpacket" item_state_slots = list(SLOT_ID_RIGHT_HAND = "cigpacket", SLOT_ID_LEFT_HAND = "cigpacket") - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY throw_force = 2 slot_flags = SLOT_BELT | SLOT_EARS - storage_slots = 6 - can_hold = list(/obj/item/clothing/mask/smokable/cigarette, /obj/item/flame/lighter, /obj/item/cigbutt) + max_items = 6 + insertion_whitelist = list(/obj/item/clothing/mask/smokable/cigarette, /obj/item/flame/lighter, /obj/item/cigbutt) icon_type = "cigarette" starts_with = list(/obj/item/clothing/mask/smokable/cigarette = 6) var/brand = "\improper Trans-Stellar Duty-free" @@ -240,7 +244,7 @@ /obj/item/storage/fancy/cigarettes/Initialize(mapload) . = ..() atom_flags |= NOREACT - create_reagents(15 * storage_slots)//so people can inject cigarettes without opening a packet, now with being able to inject the whole one + create_reagents(15 * max_items)//so people can inject cigarettes without opening a packet, now with being able to inject the whole one atom_flags |= OPENCONTAINER if(brand) for(var/obj/item/clothing/mask/smokable/cigarette/C in src) @@ -251,12 +255,12 @@ icon_state = "[initial(icon_state)][contents.len]" return -/obj/item/storage/fancy/cigarettes/remove_from_storage(obj/item/W as obj, atom/new_location) +/obj/item/storage/fancy/cigarettes/Exited(atom/movable/AM, atom/newLoc) + . = ..() // Don't try to transfer reagents to lighters - if(istype(W, /obj/item/clothing/mask/smokable/cigarette)) - var/obj/item/clothing/mask/smokable/cigarette/C = W + if(istype(AM, /obj/item/clothing/mask/smokable/cigarette)) + var/obj/item/clothing/mask/smokable/cigarette/C = AM reagents?.trans_to_obj(C, (reagents.total_volume/contents.len)) - return ..() /obj/item/storage/fancy/cigarettes/attack_mob(mob/target, mob/user, clickchain_flags, list/params, mult, target_zone, intent) if(target == user && user.zone_sel.selecting == O_MOUTH) @@ -274,7 +278,6 @@ // We call remove_from_storage first to manage the reagent transfer and // UI updates. - remove_from_storage(cig, null) if(!user.equip_to_slot_if_possible(cig, SLOT_ID_MASK, INV_OP_SUPPRESS_WARNING)) cig.forceMove(user.drop_location()) @@ -340,40 +343,39 @@ desc = "A case for holding your cigars when you are not smoking them." icon_state = "cigarcase" icon = 'icons/obj/cigarettes.dmi' - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY throw_force = 2 slot_flags = SLOT_BELT - storage_slots = 7 - can_hold = list(/obj/item/clothing/mask/smokable/cigarette/cigar, /obj/item/cigbutt/cigarbutt) + max_items = 7 + insertion_whitelist = list(/obj/item/clothing/mask/smokable/cigarette/cigar, /obj/item/cigbutt/cigarbutt) icon_type = "cigar" starts_with = list(/obj/item/clothing/mask/smokable/cigarette/cigar = 7) /obj/item/storage/fancy/cigar/Initialize(mapload) . = ..() atom_flags |= NOREACT - create_reagents(15 * storage_slots) + create_reagents(15 * max_items) /obj/item/storage/fancy/cigar/update_icon() icon_state = "[initial(icon_state)][contents.len]" return -/obj/item/storage/fancy/cigar/remove_from_storage(obj/item/W as obj, atom/new_location) - var/obj/item/clothing/mask/smokable/cigarette/cigar/C = W - if(!istype(C)) - return ..() - reagents?.trans_to_obj(C, (reagents.total_volume/contents.len)) - return ..() +/obj/item/storage/fancy/cigar/Exited(atom/movable/AM, atom/newLoc) + . = ..() + if(!istype(AM, /obj/item/clothing/mask/smokable/cigarette/cigar)) + return + reagents?.trans_to_obj(AM, (reagents.total_volume / length(contents))) /obj/item/storage/rollingpapers name = "rolling paper pack" desc = "A small cardboard pack containing several folded rolling papers." icon_state = "paperbox" icon = 'icons/obj/cigarettes.dmi' - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY throw_force = 2 slot_flags = SLOT_BELT - storage_slots = 14 - can_hold = list(/obj/item/rollingpaper) + max_items = 14 + insertion_whitelist = list(/obj/item/rollingpaper) starts_with = list(/obj/item/rollingpaper = 14) /obj/item/storage/rollingblunts @@ -381,11 +383,11 @@ desc = "A small cardboard pack containing a few tabacco-based blunt papers." icon_state = "bluntbox" icon = 'icons/obj/cigarettes.dmi' - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY throw_force = 2 slot_flags = SLOT_BELT - storage_slots = 7 - can_hold = list(/obj/item/rollingblunt) + max_items = 7 + insertion_whitelist = list(/obj/item/rollingblunt) starts_with = list(/obj/item/rollingblunt = 7) /* @@ -397,8 +399,8 @@ icon_state = "vialbox6" icon_type = "vial" name = "vial storage box" - storage_slots = 6 - can_hold = list(/obj/item/reagent_containers/glass/beaker/vial) + max_items = 6 + insertion_whitelist = list(/obj/item/reagent_containers/glass/beaker/vial) starts_with = list(/obj/item/reagent_containers/glass/beaker/vial = 6) /obj/item/storage/lockbox/vials @@ -407,10 +409,10 @@ icon = 'icons/obj/vialbox.dmi' icon_state = "vialbox0" item_state_slots = list(SLOT_ID_RIGHT_HAND = "syringe_kit", SLOT_ID_LEFT_HAND = "syringe_kit") - max_w_class = ITEMSIZE_SMALL - can_hold = list(/obj/item/reagent_containers/glass/beaker/vial) - max_storage_space = ITEMSIZE_COST_SMALL * 6 //The sum of the w_classes of all the items in this storage item. - storage_slots = 6 + max_single_weight_class = WEIGHT_CLASS_SMALL + insertion_whitelist = list(/obj/item/reagent_containers/glass/beaker/vial) + max_combined_volume = WEIGHT_VOLUME_SMALL * 6 //The sum of the w_classes of all the items in this storage item. + max_items = 6 req_access = list(ACCESS_MEDICAL_VIROLOGY) /obj/item/storage/lockbox/vials/Initialize(mapload) @@ -449,8 +451,8 @@ icon_type = "chocolate" var/startswith = 6 - max_storage_space = ITEMSIZE_COST_SMALL * 6 - can_hold = list( + max_combined_volume = WEIGHT_VOLUME_SMALL * 6 + insertion_whitelist = list( /obj/item/reagent_containers/food/snacks/chocolatepiece, /obj/item/reagent_containers/food/snacks/chocolatepiece/white, /obj/item/reagent_containers/food/snacks/chocolatepiece/truffle diff --git a/code/game/objects/items/storage/misc_legacy/laundry_basket.dm b/code/game/objects/items/storage/misc_legacy/laundry_basket.dm new file mode 100644 index 00000000000..b8803546991 --- /dev/null +++ b/code/game/objects/items/storage/misc_legacy/laundry_basket.dm @@ -0,0 +1,26 @@ +// ----------------------------- +// Laundry Basket +// ----------------------------- +// An item designed for hauling the belongings of a character. +// So this cannot be abused for other uses, we make it two-handed and inable to have its storage looked into. +/obj/item/storage/laundry_basket + name = "laundry basket" + icon = 'icons/obj/janitor.dmi' + icon_state = "laundry-empty" + item_state_slots = list(SLOT_ID_RIGHT_HAND = "laundry", SLOT_ID_LEFT_HAND = "laundry") + desc = "The peak of thousands of years of laundry evolution." + + w_class = WEIGHT_CLASS_HUGE + max_single_weight_class = WEIGHT_CLASS_BULKY + max_combined_volume = WEIGHT_VOLUME_NORMAL * 8 + max_items = 20 + allow_mass_gather = TRUE + allow_quick_empty = TRUE + var/linked + +/obj/item/storage/laundry_basket/update_icon_state() + . = ..() + if(contents.len) + icon_state = "laundry-full" + else + icon_state = "laundry-empty" diff --git a/code/game/objects/items/storage/misc.dm b/code/game/objects/items/storage/misc_legacy/misc.dm similarity index 92% rename from code/game/objects/items/storage/misc.dm rename to code/game/objects/items/storage/misc_legacy/misc.dm index f3249365046..726dbefb0e2 100644 --- a/code/game/objects/items/storage/misc.dm +++ b/code/game/objects/items/storage/misc_legacy/misc.dm @@ -6,8 +6,8 @@ icon = 'icons/obj/food.dmi' icon_state = "donutbox" name = "donut box" - max_storage_space = ITEMSIZE_COST_SMALL * 6 - can_hold = list(/obj/item/reagent_containers/food/snacks/donut) + max_combined_volume = WEIGHT_VOLUME_SMALL * 6 + insertion_whitelist = list(/obj/item/reagent_containers/food/snacks/donut) foldable = /obj/item/stack/material/cardboard starts_with = list(/obj/item/reagent_containers/food/snacks/donut/normal = 6) @@ -30,8 +30,8 @@ icon_state = "wormcan" name = "can of worms" desc = "You probably do want to open this can of worms." - max_storage_space = ITEMSIZE_COST_TINY * 6 - can_hold = list( + max_combined_volume = WEIGHT_VOLUME_TINY * 6 + insertion_whitelist = list( /obj/item/reagent_containers/food/snacks/wormsickly, /obj/item/reagent_containers/food/snacks/worm, /obj/item/reagent_containers/food/snacks/wormdeluxe @@ -50,7 +50,7 @@ icon_state = "wormcan_sickly" name = "can of sickly worms" desc = "You probably don't want to open this can of worms." - max_storage_space = ITEMSIZE_COST_TINY * 6 + max_combined_volume = WEIGHT_VOLUME_TINY * 6 starts_with = list(/obj/item/reagent_containers/food/snacks/wormsickly = 6) /obj/item/storage/box/wormcan/sickly/update_icon(var/itemremoved = 0) @@ -61,7 +61,7 @@ icon_state = "wormcan_deluxe" name = "can of deluxe worms" desc = "You absolutely want to open this can of worms." - max_storage_space = ITEMSIZE_COST_TINY * 6 + max_combined_volume = WEIGHT_VOLUME_TINY * 6 starts_with = list(/obj/item/reagent_containers/food/snacks/wormdeluxe = 6) /obj/item/storage/box/wormcan/deluxe/update_icon(var/itemremoved = 0) @@ -75,14 +75,14 @@ icon = 'icons/obj/kitchen.dmi' icon_state = "survivalknife" item_state = "knife" - max_storage_space = ITEMSIZE_COST_TINY * 3 + max_combined_volume = WEIGHT_VOLUME_TINY * 3 sharp = 1 edge = 1 damage_force = 15 throw_force = 15 attack_verb = list("stabbed", "chopped", "cut") attack_sound = 'sound/weapons/bladeslice.ogg' - can_hold = list( + insertion_whitelist = list( /obj/item/pen/crayon/chalk, /obj/item/reagent_containers/pill, /obj/item/gps/survival, @@ -183,9 +183,9 @@ name = "munition box (musket)" desc = "A tanned leather pouch large enough to hold a few loose musket balls." icon_state = "musket_box" - w_class = ITEMSIZE_SMALL - max_storage_space = ITEMSIZE_COST_TINY * 6 - can_hold = list( + w_class = WEIGHT_CLASS_SMALL + max_combined_volume = WEIGHT_VOLUME_TINY * 6 + insertion_whitelist = list( /obj/item/ammo_casing/musket ) starts_with = list(/obj/item/ammo_casing/musket = 6) diff --git a/code/game/objects/items/storage/misc_legacy/trinket_box.dm b/code/game/objects/items/storage/misc_legacy/trinket_box.dm new file mode 100644 index 00000000000..db81355671c --- /dev/null +++ b/code/game/objects/items/storage/misc_legacy/trinket_box.dm @@ -0,0 +1,56 @@ +/* + * Trinket Box - READDING SOON + */ +/obj/item/storage/trinketbox + name = "trinket box" + desc = "A box that can hold small trinkets, such as a ring." + icon = 'icons/obj/items.dmi' + icon_state = "trinketbox" + var/open = 0 + max_items = 1 + insertion_whitelist = list( + /obj/item/clothing/gloves/ring, + /obj/item/coin, + /obj/item/clothing/accessory/medal + ) + var/open_state + var/closed_state + +/obj/item/storage/trinketbox/update_icon() + cut_overlays() + if(open) + icon_state = open_state + + if(contents.len >= 1) + var/contained_image = null + if(istype(contents[1], /obj/item/clothing/gloves/ring)) + contained_image = "ring_trinket" + else if(istype(contents[1], /obj/item/coin)) + contained_image = "coin_trinket" + else if(istype(contents[1], /obj/item/clothing/accessory/medal)) + contained_image = "medal_trinket" + if(contained_image) + add_overlay(contained_image) + else + icon_state = closed_state + +/obj/item/storage/trinketbox/Initialize(mapload) + if(!open_state) + open_state = "[initial(icon_state)]_open" + if(!closed_state) + closed_state = "[initial(icon_state)]" + . = ..() + +/obj/item/storage/trinketbox/attack_self(mob/user) + . = ..() + if(.) + return + open = !open + update_icon() + ..() + +/obj/item/storage/trinketbox/examine(mob/user, dist) + . = ..() + if(open && contents.len) + var/display_item = contents[1] + . += "\The [src] contains \the [display_item]!" diff --git a/code/game/objects/items/storage/quickdraw.dm b/code/game/objects/items/storage/quickdraw.dm index eee338ea566..b60e8caff1a 100644 --- a/code/game/objects/items/storage/quickdraw.dm +++ b/code/game/objects/items/storage/quickdraw.dm @@ -9,45 +9,48 @@ desc = "This object should not appear" icon = 'icons/obj/storage.dmi' +// todo: i just fully disabled this for now. sorry. +// todo: add quickdrawing. + //Quickmode //When set to 0, this storage will operate as a regular storage, and clicking on it while equipped will open it as a storage //When set to 1, a click while it is equipped will instead move the first item inside it to your hand - var/quickmode = 0 +// var/quickmode = 0 -/obj/item/storage/quickdraw/attack_hand(mob/user, list/params) - if(src.loc == user) //If they aren't holding us, we do nothing special - if(ishuman(user)) - var/mob/living/carbon/human/H = user - if(quickmode) - var/first_item = contents[1] - if(first_item && !H.get_active_held_item()) //Do we have anything to give you? - H.put_in_hands(first_item) - return +// /obj/item/storage/quickdraw/attack_hand(mob/user, list/params) +// if(src.loc == user) //If they aren't holding us, we do nothing special +// if(ishuman(user)) +// var/mob/living/carbon/human/H = user +// if(quickmode) +// var/first_item = contents[1] +// if(first_item && !H.get_active_held_item()) //Do we have anything to give you? +// H.put_in_hands(first_item) +// return - if(H.l_store == src && !H.get_active_held_item()) //overrides - src.open(user) - return - if(H.r_store == src && !H.get_active_held_item()) - src.open(user) - return - ..() //Nothing special happened, go call the other proc +// if(H.l_store == src && !H.get_active_held_item()) //overrides +// src.open(user) +// return +// if(H.r_store == src && !H.get_active_held_item()) +// src.open(user) +// return +// ..() //Nothing special happened, go call the other proc -/obj/item/storage/quickdraw/verb/toggle_quickdraw() - set name = "Switch Quickdraw Mode" - set category = "Object" +// /obj/item/storage/quickdraw/verb/toggle_quickdraw() +// set name = "Switch Quickdraw Mode" +// set category = "Object" - quickmode = !quickmode - switch (quickmode) - if(1) - to_chat(usr, "[src] now draws the first object inside.") - if(0) - to_chat(usr, "[src] now opens as a container.") +// quickmode = !quickmode +// switch (quickmode) +// if(1) +// to_chat(usr, "[src] now draws the first object inside.") +// if(0) +// to_chat(usr, "[src] now opens as a container.") -/obj/item/storage/quickdraw/AltClick(mob/user) - ..() - if(src.loc == user) //Are they carrying us? - toggle_quickdraw() +// /obj/item/storage/quickdraw/AltClick(mob/user) +// ..() +// if(src.loc == user) //Are they carrying us? +// toggle_quickdraw() // If we start adding more of these, we'll need to make them their own folder. 'til then, this one should be fine. @@ -61,15 +64,15 @@ desc = "A small case for safely carrying sharps around." icon_state = "syringe_case" - w_class = ITEMSIZE_SMALL - max_w_class = ITEMSIZE_TINY - max_storage_space = ITEMSIZE_TINY * 6 //Capable of holding six syringes + w_class = WEIGHT_CLASS_SMALL + max_single_weight_class = WEIGHT_CLASS_TINY + max_combined_volume = WEIGHT_CLASS_TINY * 6 //Capable of holding six syringes //Can hold syringes and autoinjectors, but also pills if you really wanted. Syringe-shaped objects like pens and cigarettes also fit, but why would you do that? - can_hold = list(/obj/item/reagent_containers/syringe, /obj/item/reagent_containers/hypospray/autoinjector, + insertion_whitelist = list(/obj/item/reagent_containers/syringe, /obj/item/reagent_containers/hypospray/autoinjector, /obj/item/reagent_containers/pill, /obj/item/pen, /obj/item/flashlight/pen, /obj/item/clothing/mask/smokable/cigarette) - quickmode = 1 //Starts in quickdraw mode + // quickmode = 1 //Starts in quickdraw mode //Preloaded for your convenience! starts_with = list( /obj/item/reagent_containers/syringe, diff --git a/code/game/objects/items/storage/secure.dm b/code/game/objects/items/storage/secure.dm index cdf36d31445..5cb647407c5 100644 --- a/code/game/objects/items/storage/secure.dm +++ b/code/game/objects/items/storage/secure.dm @@ -23,9 +23,9 @@ var/l_hacking = 0 var/emagged = 0 var/open = 0 - w_class = ITEMSIZE_NORMAL - max_w_class = ITEMSIZE_SMALL - max_storage_space = ITEMSIZE_SMALL * 7 + w_class = WEIGHT_CLASS_NORMAL + max_single_weight_class = WEIGHT_CLASS_SMALL + max_combined_volume = WEIGHT_CLASS_SMALL * 7 /obj/item/storage/secure/examine(mob/user, dist) . = ..() @@ -70,13 +70,6 @@ ..() -/obj/item/storage/secure/OnMouseDropLegacy(over_object, src_location, over_location) - if (locked) - src.add_fingerprint(usr) - return - ..() - - /obj/item/storage/secure/attack_self(mob/user) . = ..() if(.) @@ -107,6 +100,7 @@ l_set = 1 else if ((code == l_code) && (emagged == 0) && (l_set == 1)) locked = 0 + obj_storage.set_locked(FALSE) set_overlays(icon_opened) code = null else @@ -115,8 +109,8 @@ if ((href_list["type"] == "R") && (emagged == 0) && (!l_setshort)) locked = 1 cut_overlays() + obj_storage.set_locked(TRUE) code = null - close(usr) else code += href_list["type"] if (length(src.code) > 5) @@ -136,6 +130,7 @@ sleep(6) set_overlays(icon_locking) locked = 0 + obj_storage.set_locked(FALSE) to_chat(user, (feedback ? feedback : "You short out the lock of \the [src].")) return 1 @@ -151,28 +146,15 @@ damage_force = 8.0 throw_speed = 1 throw_range = 4 - max_w_class = ITEMSIZE_NORMAL - w_class = ITEMSIZE_LARGE - max_storage_space = ITEMSIZE_COST_NORMAL * 4 - -/obj/item/storage/secure/briefcase/attack_hand(mob/user, list/params) - if ((src.loc == user) && (src.locked == 1)) - to_chat(user, "[src] is locked and cannot be opened!") - else if ((src.loc == user) && (!src.locked)) - src.open(usr) - else - ..() - for(var/mob/M in range(1)) - if (M.s_active == src) - src.close(M) - src.add_fingerprint(user) - return + max_single_weight_class = WEIGHT_CLASS_NORMAL + w_class = WEIGHT_CLASS_BULKY + max_combined_volume = WEIGHT_VOLUME_NORMAL * 4 //LOADOUT ITEM /obj/item/storage/secure/briefcase/portable name = "Portable Secure Briefcase" desc = "A not-so large briefcase with a digital locking system. Holds less, but fits into more." - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL starts_with = list( /obj/item/paper, @@ -182,9 +164,9 @@ /obj/item/storage/secure/briefcase/vicase name = "VI's Secure Briefpack" - w_class = ITEMSIZE_LARGE - max_w_class = ITEMSIZE_LARGE - max_storage_space = INVENTORY_STANDARD_SPACE + w_class = WEIGHT_CLASS_BULKY + max_single_weight_class = WEIGHT_CLASS_BULKY + max_combined_volume = STORAGE_VOLUME_BACKPACK slot_flags = SLOT_BACK icon = 'icons/obj/clothing/backpack.dmi' icon_state = "securev" @@ -206,11 +188,11 @@ icon_locking = "safeb" icon_sparking = "safespark" damage_force = 8.0 - w_class = ITEMSIZE_NO_CONTAINER - max_w_class = ITEMSIZE_LARGE // This was 8 previously... + w_class = WEIGHT_CLASS_HUGE + max_single_weight_class = WEIGHT_CLASS_BULKY // This was 8 previously... anchored = 1.0 density = 0 - cant_hold = list(/obj/item/storage/secure/briefcase) + insertion_blacklist = list(/obj/item/storage/secure/briefcase) starts_with = list( /obj/item/paper, /obj/item/pen diff --git a/code/game/objects/items/storage/single_use/_single_use.dm b/code/game/objects/items/storage/single_use/_single_use.dm index 7825fead571..60de906fb36 100644 --- a/code/game/objects/items/storage/single_use/_single_use.dm +++ b/code/game/objects/items/storage/single_use/_single_use.dm @@ -1,33 +1,24 @@ /obj/item/storage/single_use - var/opened = FALSE - var/tear_sound = "rip" + var/sfx_tear = "rip" + var/torn_open = FALSE -/obj/item/storage/single_use/open(mob/user) - if(!opened) - playsound(src.loc, src.tear_sound, 50, FALSE, -5) - user.visible_message( - SPAN_NOTICE("\The [user] tears open [src], breaking the vacuum seal!"), - SPAN_NOTICE("You tear open [src], breaking the vacuum seal!"), - SPAN_HEAR("You hear something being torn open."), - ) - opened = TRUE - update_icon() - if (src.use_sound) - playsound(src.loc, src.use_sound, 50, FALSE, -5) - if (isrobot(user) && user.hud_used) - var/mob/living/silicon/robot/robot = user - if(robot.shown_robot_modules) //The robot's inventory is open, need to close it first. - robot.hud_used.toggle_show_robot_modules() - return ..(user, TRUE) - -/obj/item/storage/single_use/attack_self(mob/user) - . = ..() - if(.) +/obj/item/storage/single_use/object_storage_opened(mob/user) + if(torn_open) return - open(user) + torn_open = TRUE -/obj/item/storage/single_use/update_icon() - if(opened) - icon_state = "[initial(icon_state)][opened]" - . = ..() + if(sfx_tear) + playsound(src, sfx_tear, 50, TRUE, -5) + + user.visible_message( + SPAN_NOTICE("[user] tears open [src]'s seal."), + SPAN_NOTICE("You tear open [src]'s seals."), + SPAN_HEAR("You hear something being torn open."), + ) + + update_icon() + +/obj/item/storage/single_use/update_icon_state() + icon_state = "[base_icon_state || initial(icon_state)][torn_open]" + return ..() diff --git a/code/game/objects/items/storage/single_use/med_pouch.dm b/code/game/objects/items/storage/single_use/med_pouch.dm index 5558fe6bbb7..719fb9f4b80 100644 --- a/code/game/objects/items/storage/single_use/med_pouch.dm +++ b/code/game/objects/items/storage/single_use/med_pouch.dm @@ -5,12 +5,12 @@ name = "emergency medical pouch" desc = "For use in emergency situations only." icon = 'icons/obj/single_use/med_pouch.dmi' - storage_slots = 7 - w_class = ITEM_SIZE_SMALL - max_w_class = ITEM_SIZE_SMALL + max_items = 7 + w_class = WEIGHT_CLASS_SMALL + max_single_weight_class = WEIGHT_CLASS_SMALL + base_icon_state = "pack" icon_state = "pack0" - opened = FALSE - tear_sound = 'sound/effects/rip1.ogg' + sfx_tear = 'sound/effects/rip1.ogg' //material = /decl/material/solid/plastic var/injury_type = "generic" var/static/image/cross_overlay @@ -30,38 +30,20 @@ name = "emergency [injury_type] pouch" update_desc() if(length(contents)) - make_exact_fit() + obj_storage.fit_to_contents(no_shrink = TRUE) update_icon() - /obj/item/storage/single_use/med_pouch/update_icon() + cut_overlays() . = ..() if(!cross_overlay) cross_overlay = overlay_image(icon, "cross", flags = RESET_COLOR) add_overlay(cross_overlay) - icon_state = "pack[opened]" - -/* /obj/item/storage/single_use/med_pouch/examine(mob/user, dist) - . = ..() - . += instructions -*/ /obj/item/storage/single_use/med_pouch/update_desc(updates) . = ..() desc += instructions -/obj/item/storage/single_use/med_pouch/attack_self(mob/user) - . = ..() - if(.) - return - open(user) - -/*handled by single_use -/obj/item/storage/single_use/med_pouch/open(mob/user) - if(!opened) - user.visible_message("", "") - . = ..()*/ - /obj/item/storage/single_use/med_pouch/trauma name = "Trauma Pouch" injury_type = "trauma" diff --git a/code/game/objects/items/storage/single_use/mre.dm b/code/game/objects/items/storage/single_use/mre.dm index 703a9c37692..67534ef1f12 100644 --- a/code/game/objects/items/storage/single_use/mre.dm +++ b/code/game/objects/items/storage/single_use/mre.dm @@ -7,8 +7,8 @@ MRE Stuff desc = "A vacuum-sealed bag containing a day's worth of nutrients for an adult in strenuous situations. There is no visible expiration date on the package. This one is menu 1, meat pizza." icon = 'icons/obj/food.dmi' icon_state = "mre" - max_storage_space = ITEMSIZE_COST_SMALL * 7 - max_w_class = ITEMSIZE_SMALL + max_combined_volume = WEIGHT_VOLUME_SMALL * 7 + max_single_weight_class = WEIGHT_CLASS_SMALL starts_with = list( /obj/item/storage/single_use/mrebag, /obj/item/storage/single_use/mrebag/side, @@ -210,9 +210,9 @@ MRE Stuff desc = "A vacuum-sealed bag containing the MRE's main course. Self-heats when opened." icon = 'icons/obj/food.dmi' icon_state = "pouch_medium" - storage_slots = 1 - w_class = ITEMSIZE_SMALL - max_w_class = ITEMSIZE_SMALL + max_items = 1 + w_class = WEIGHT_CLASS_SMALL + max_single_weight_class = WEIGHT_CLASS_SMALL starts_with = list(/obj/item/reagent_containers/food/snacks/slice/meatpizza/filled) diff --git a/code/game/objects/items/storage/storage.dm b/code/game/objects/items/storage/storage.dm new file mode 100644 index 00000000000..6f5b1085b26 --- /dev/null +++ b/code/game/objects/items/storage/storage.dm @@ -0,0 +1,105 @@ +/obj/item/storage + name = "storage" + icon = 'icons/obj/storage.dmi' + inhand_default_type = INHAND_DEFAULT_ICON_STORAGE + w_class = WEIGHT_CLASS_NORMAL + show_messages = 1 + + //* Directly passed to storage system. *// + + var/list/insertion_whitelist + var/list/insertion_blacklist + var/list/insertion_allow + + var/max_single_weight_class = WEIGHT_CLASS_SMALL + var/max_combined_weight_class + var/max_combined_volume = WEIGHT_VOLUME_SMALL * 4 + var/max_items + + var/weight_subtract = 0 + var/weight_multiply = 1 + + var/allow_mass_gather = FALSE + var/allow_mass_gather_mode_switch = TRUE + var/mass_gather_mode = STORAGE_QUICK_GATHER_COLLECT_ALL + + var/allow_quick_empty = TRUE + var/allow_quick_empty_via_clickdrag = TRUE + var/allow_quick_empty_via_attack_self = FALSE + + var/sfx_open = "rustle" + var/sfx_insert = "rustle" + var/sfx_remove = "rustle" + + var/ui_numerical_mode = FALSE + var/ui_expand_when_needed = FALSE + var/ui_force_slot_mode = FALSE + + //* Initialization *// + + /// storage datum path + var/storage_datum_path = /datum/object_system/storage + /// Cleared after Initialize(). + /// List of types associated to amounts. + var/list/starts_with + /// set to prevent us from spawning starts_with + var/empty = FALSE + +/obj/item/storage/Initialize(mapload) + . = ..() + initialize_storage() + spawn_contents() + legacy_spawn_contents() + +/** + * Make sure to set [worth_dynamic] to TRUE if this does more than spawning what's in starts_with. + */ +/obj/item/storage/proc/spawn_contents() + if(length(starts_with) && !empty) + // this is way too permissive already + var/safety = 256 + var/atom/where_real_contents = obj_storage.real_contents_loc() + for(var/path in starts_with) + var/amount = starts_with[path] || 1 + for(var/i in 1 to amount) + if(!--safety) + CRASH("tried to spawn too many objects") + new path(where_real_contents) + starts_with = null + +/** + * Please get rid of this in favor of spawn_contents() and starts_with + */ +/obj/item/storage/proc/legacy_spawn_contents() + return + +/obj/item/storage/proc/initialize_storage() + ASSERT(isnull(obj_storage)) + init_storage(storage_datum_path) + obj_storage.set_insertion_allow(insertion_allow) + obj_storage.set_insertion_whitelist(insertion_whitelist) + obj_storage.set_insertion_blacklist(insertion_blacklist) + + obj_storage.max_single_weight_class = max_single_weight_class + obj_storage.max_combined_weight_class = max_combined_weight_class + obj_storage.max_combined_volume = max_combined_volume + obj_storage.max_items = max_items + + obj_storage.weight_subtract = weight_subtract + obj_storage.weight_multiply = weight_multiply + + obj_storage.allow_mass_gather = allow_mass_gather + obj_storage.allow_mass_gather_mode_switch = allow_mass_gather_mode_switch + obj_storage.mass_gather_mode = mass_gather_mode + + obj_storage.allow_quick_empty = allow_quick_empty + obj_storage.allow_quick_empty_via_clickdrag = allow_quick_empty_via_clickdrag + obj_storage.allow_quick_empty_via_attack_self = allow_quick_empty_via_attack_self + + obj_storage.sfx_open = sfx_open + obj_storage.sfx_insert = sfx_insert + obj_storage.sfx_remove = sfx_remove + + obj_storage.ui_numerical_mode = ui_numerical_mode + obj_storage.ui_expand_when_needed = ui_expand_when_needed + obj_storage.ui_force_slot_mode = ui_force_slot_mode diff --git a/code/game/objects/items/storage/toolbox.dm b/code/game/objects/items/storage/toolbox.dm index 5376764f02d..7981c13662b 100644 --- a/code/game/objects/items/storage/toolbox.dm +++ b/code/game/objects/items/storage/toolbox.dm @@ -8,9 +8,9 @@ throw_force = 10 throw_speed = 1 throw_range = 7 - w_class = ITEMSIZE_LARGE - max_w_class = ITEMSIZE_NORMAL - max_storage_space = ITEMSIZE_COST_SMALL * 7 //enough to hold all starting contents + w_class = WEIGHT_CLASS_BULKY + max_single_weight_class = WEIGHT_CLASS_NORMAL + max_combined_volume = WEIGHT_VOLUME_SMALL * 7 //enough to hold all starting contents origin_tech = list(TECH_COMBAT = 1) attack_verb = list("robusted") drop_sound = 'sound/items/drop/toolbox.ogg' @@ -63,7 +63,7 @@ new /obj/item/clothing/gloves/yellow(src) else new /obj/item/stack/cable_coil/random(src,30) - calibrate_size() + obj_storage.fit_to_contents() /obj/item/storage/toolbox/syndicate name = "black and red toolbox" @@ -106,8 +106,8 @@ icon_state = "lunchbox_rainbow" item_state_slots = list(SLOT_ID_RIGHT_HAND = "toolbox_pink", SLOT_ID_LEFT_HAND = "toolbox_pink") desc = "A little lunchbox. This one is the colors of the rainbow!" - w_class = ITEMSIZE_NORMAL - max_w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_NORMAL + max_single_weight_class = WEIGHT_CLASS_SMALL var/filled = FALSE attack_verb = list("lunched") diff --git a/code/game/objects/items/storage/uplink_kits.dm b/code/game/objects/items/storage/uplink_kits.dm index 034c616f1f8..ea34163b60e 100644 --- a/code/game/objects/items/storage/uplink_kits.dm +++ b/code/game/objects/items/storage/uplink_kits.dm @@ -222,7 +222,7 @@ pack.desc += " 'MB' has been scribbled on it." pack = new /obj/item/storage/fancy/cigarettes(src) - pack.reagents.add_reagent("tricordrazine", 15 * pack.storage_slots) + pack.reagents.add_reagent("tricordrazine", 15 * pack.max_items) pack.desc += " 'T' has been scribbled on it." new /obj/item/flame/lighter/zippo(src) @@ -231,7 +231,7 @@ /proc/fill_cigarre_package(var/obj/item/storage/fancy/cigarettes/C, var/list/reagents) for(var/reagent in reagents) - C.reagents.add_reagent(reagent, reagents[reagent] * C.storage_slots) + C.reagents.add_reagent(reagent, reagents[reagent] * C.max_items) /obj/item/storage/box/syndie_kit/ewar_voice name = "Electrowarfare and Voice Synthesizer kit" @@ -289,8 +289,8 @@ description_fluff = "The container, upon opening, looks to have a few oddly shaped indentations in its packing." description_antag = "This case will likely contain a charged fuel rod gun, and a few fuel rods to go with it. It can only hold the fuel rod gun, fuel rods, batteries, a screwdriver, and stock machine parts." damage_force = 12 //Anti-rad lined i.e. Lead, probably gonna hurt a bit if you get bashed with it. - can_hold = list(/obj/item/gun/magnetic/fuelrod, /obj/item/fuel_assembly, /obj/item/cell, /obj/item/stock_parts, /obj/item/tool/screwdriver) - cant_hold = list(/obj/item/tool/screwdriver/power) + insertion_whitelist = list(/obj/item/gun/magnetic/fuelrod, /obj/item/fuel_assembly, /obj/item/cell, /obj/item/stock_parts, /obj/item/tool/screwdriver) + insertion_blacklist = list(/obj/item/tool/screwdriver/power) starts_with = list( /obj/item/gun/magnetic/fuelrod, /obj/item/fuel_assembly/deuterium, diff --git a/code/game/objects/items/storage/wallets.dm b/code/game/objects/items/storage/wallets.dm index fd80260b5bc..d447f80218c 100644 --- a/code/game/objects/items/storage/wallets.dm +++ b/code/game/objects/items/storage/wallets.dm @@ -1,11 +1,11 @@ /obj/item/storage/wallet name = "wallet" desc = "It can hold a few small and personal things." - storage_slots = 10 + max_items = 10 icon = 'icons/obj/wallet.dmi' icon_state = "wallet-orange" - w_class = ITEMSIZE_SMALL - can_hold = list( + w_class = WEIGHT_CLASS_SMALL + insertion_whitelist = list( /obj/item/spacecash, /obj/item/card, /obj/item/clothing/mask/smokable/cigarette/, @@ -38,7 +38,7 @@ /obj/item/clothing/accessory/badge, /obj/item/makeover ) - cant_hold = list(/obj/item/tool/screwdriver/power) + insertion_blacklist = list(/obj/item/tool/screwdriver/power) slot_flags = SLOT_ID var/obj/item/card/id/front_id = null @@ -46,21 +46,25 @@ drop_sound = 'sound/items/drop/cloth.ogg' pickup_sound = 'sound/items/pickup/cloth.ogg' -/obj/item/storage/wallet/remove_from_storage(obj/item/W as obj, atom/new_location, do_move = TRUE) +/obj/item/storage/wallet/Entered(atom/movable/AM, atom/oldLoc) . = ..() - if(.) - if(W == front_id) - front_id = null - name = initial(name) - update_icon() + update_front_id() -/obj/item/storage/wallet/handle_item_insertion(obj/item/W as obj, mob/user, prevent_warning = 0) +/obj/item/storage/wallet/Exited(atom/movable/AM, atom/newLoc) . = ..() - if(.) - if(!front_id && istype(W, /obj/item/card/id)) - front_id = W - name = "[name] ([front_id])" - update_icon() + update_front_id() + +/obj/item/storage/wallet/proc/update_front_id() + // todo: lol fuck this is bad ~ silicons + var/obj/item/card/id/found = locate(/obj/item/card/id) in contents + if(isnull(front_id) == isnull(found)) + return + front_id = found + if(isnull(front_id)) + name = initial(name) + else + name = "[initial(name)] ([front_id])" + update_icon() /obj/item/storage/wallet/update_icon() cut_overlays() diff --git a/code/game/objects/items/tools/crowbar.dm b/code/game/objects/items/tools/crowbar.dm index 879bd4f14a1..9c6aa40a293 100644 --- a/code/game/objects/items/tools/crowbar.dm +++ b/code/game/objects/items/tools/crowbar.dm @@ -14,7 +14,7 @@ throw_force = 7 pry = 1 item_state = "crowbar" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL origin_tech = list(TECH_ENGINEERING = 1) materials_base = list(MAT_STEEL = 50) attack_verb = list("attacked", "bashed", "battered", "bludgeoned", "whacked") @@ -149,7 +149,7 @@ throw_force = 5 pry = 1 item_state = "crowbar" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL origin_tech = list(TECH_ENGINEERING = 1) materials_base = list(MAT_STEEL = 30) attack_verb = list("whapped", "smacked", "swatted", "thwacked", "hit") diff --git a/code/game/objects/items/tools/screwdriver.dm b/code/game/objects/items/tools/screwdriver.dm index 3789c3e5dd8..d74fd0bd23a 100644 --- a/code/game/objects/items/tools/screwdriver.dm +++ b/code/game/objects/items/tools/screwdriver.dm @@ -10,7 +10,7 @@ slot_flags = SLOT_BELT | SLOT_EARS tool_behaviour = TOOL_SCREWDRIVER damage_force = 6 - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY throw_force = 5 throw_speed = 3 throw_range = 5 @@ -31,7 +31,6 @@ return(BRUTELOSS) /obj/item/tool/screwdriver/Initialize(mapload) - . = ..() if(random_color) switch(pick("red","blue","purple","brown","green","cyan","yellow")) if ("red") @@ -59,6 +58,8 @@ if (prob(75)) src.pixel_y = rand(0, 16) + return ..() + /obj/item/tool/screwdriver/attack_mob(mob/target, mob/user, clickchain_flags, list/params, mult, target_zone, intent) if(user.a_intent != INTENT_HARM) return ..() @@ -127,7 +128,7 @@ item_state = "screwdriver_black" origin_tech = list(TECH_MATERIAL = 3, TECH_ENGINEERING = 3) weight = ITEM_WEIGHT_HYBRID_TOOLS - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL tool_sound = 'sound/effects/uncloak.ogg' tool_speed = 0.4 random_color = FALSE @@ -154,7 +155,7 @@ origin_tech = list(TECH_MATERIAL = 2, TECH_ENGINEERING = 2) slot_flags = SLOT_BELT damage_force = 8 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL throw_force = 8 throw_speed = 2 throw_range = 3//it's heavier than a screw driver/wrench, so it does more damage, but can't be thrown as far diff --git a/code/game/objects/items/tools/switchtool.dm b/code/game/objects/items/tools/switchtool.dm index d0f5e85ecc3..c6d9b2bd754 100644 --- a/code/game/objects/items/tools/switchtool.dm +++ b/code/game/objects/items/tools/switchtool.dm @@ -12,7 +12,7 @@ desc = "A multi-deployable, multi-instrument, finely crafted multi-purpose tool. The envy of engineers everywhere." siemens_coefficient = 1 damage_force = 3 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL item_icons = list( SLOT_ID_LEFT_HAND = 'icons/mob/items/lefthand_switchtool.dmi', SLOT_ID_RIGHT_HAND = 'icons/mob/items/righthand_switchtool.dmi') @@ -134,7 +134,7 @@ W.setWelding(FALSE) deployed = null cut_overlays() - w_class = initial(w_class) + set_weight_class(initial(w_class)) update_icon() tool_locked = FALSE diff --git a/code/game/objects/items/tools/weldingtool.dm b/code/game/objects/items/tools/weldingtool.dm index 367b4c79bcb..0f77d493cef 100644 --- a/code/game/objects/items/tools/weldingtool.dm +++ b/code/game/objects/items/tools/weldingtool.dm @@ -15,7 +15,7 @@ throw_force = 5.0 throw_speed = 1 throw_range = 5 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL //Cost to make in the autolathe materials_base = list(MAT_STEEL = 70, MAT_GLASS = 30) @@ -252,7 +252,7 @@ playsound(loc, acti_sound, 50, 1) src.damage_force = 15 src.damtype = "fire" - src.w_class = ITEMSIZE_LARGE + src.set_weight_class(WEIGHT_CLASS_BULKY) src.attack_sound = 'sound/items/welder.ogg' welding = 1 update_icon() @@ -274,7 +274,7 @@ playsound(loc, deac_sound, 50, 1) src.damage_force = 3 src.damtype = "brute" - src.w_class = initial(src.w_class) + src.set_weight_class(initial(src.w_class)) src.welding = 0 src.attack_sound = initial(src.attack_sound) update_icon() @@ -346,7 +346,7 @@ desc = "A much larger welder with a huge tank." icon_state = "indwelder" max_fuel = 80 - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL origin_tech = list(TECH_ENGINEERING = 3) materials_base = list(MAT_STEEL = 70, MAT_GLASS = 120) @@ -355,7 +355,7 @@ desc = "A miniature welder used during emergencies." icon_state = "miniwelder" max_fuel = 10 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL materials_base = list(MAT_METAL = 30, MAT_GLASS = 10) change_icons = 0 tool_speed = 2 @@ -432,7 +432,7 @@ desc = "An experimental welder capable of synthesizing its own fuel from waste compounds. It can output a flame hotter than regular welders." icon_state = "exwelder" max_fuel = 40 - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL origin_tech = list(TECH_ENGINEERING = 4, TECH_PHORON = 3) materials_base = list(MAT_STEEL = 70, MAT_GLASS = 120) tool_speed = 0.5 @@ -481,7 +481,7 @@ eye_safety_modifier = -2 // Brighter than the sun. Literally, you can look at the sun with a welding mask of proper grade, this will burn through that. weight = ITEM_WEIGHT_HYBRID_TOOLS tool_speed = 0.25 - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY flame_intensity = 5 origin_tech = list(TECH_ENGINEERING = 5, TECH_PHORON = 4, TECH_PRECURSOR = 1) reach = 2 @@ -495,7 +495,7 @@ desc = "A bulky, cooler-burning welding tool that draws from a worn welding tank." icon_state = "tubewelder" max_fuel = 10 - w_class = ITEMSIZE_NO_CONTAINER + w_class = WEIGHT_CLASS_HUGE materials_base = null tool_speed = 1.25 change_icons = 0 @@ -555,7 +555,7 @@ desc = "A miniature welder attached to a spear, providing more reach. Typically used by Tyrmalin workers." icon_state = "welderspear" max_fuel = 10 - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL materials_base = list(MAT_METAL = 50, MAT_GLASS = 10) tool_speed = 1.5 eye_safety_modifier = 1 // Safer on eyes. diff --git a/code/game/objects/items/tools/wirecutters.dm b/code/game/objects/items/tools/wirecutters.dm index 6bfe55c192c..227d6982cea 100644 --- a/code/game/objects/items/tools/wirecutters.dm +++ b/code/game/objects/items/tools/wirecutters.dm @@ -12,7 +12,7 @@ damage_force = 6 throw_speed = 2 throw_range = 9 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL origin_tech = list(TECH_MATERIAL = 1, TECH_ENGINEERING = 1) materials_base = list(MAT_STEEL = 80) attack_verb = list("pinched", "nipped") @@ -118,7 +118,7 @@ desc = "This cuts wires. With Science!" catalogue_data = list(/datum/category_item/catalogue/anomalous/precursor_a/alien_wirecutters) icon_state = "hybcutters" - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL weight = ITEM_WEIGHT_HYBRID_TOOLS origin_tech = list(TECH_MATERIAL = 3, TECH_ENGINEERING = 3, TECH_PHORON = 2) attack_verb = list("pinched", "nipped", "warped", "blasted") diff --git a/code/game/objects/items/tools/wrench.dm b/code/game/objects/items/tools/wrench.dm index dae7a1dcbee..b2beb981e20 100644 --- a/code/game/objects/items/tools/wrench.dm +++ b/code/game/objects/items/tools/wrench.dm @@ -11,7 +11,7 @@ tool_behaviour = TOOL_WRENCH damage_force = 6 throw_force = 7 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL origin_tech = list(TECH_MATERIAL = 1, TECH_ENGINEERING = 1) materials_base = list(MAT_STEEL = 150) attack_verb = list("bashed", "battered", "bludgeoned", "whacked") @@ -93,7 +93,7 @@ slot_flags = SLOT_BELT damage_force = 8 throw_force = 10 - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL weight = ITEM_WEIGHT_HYBRID_TOOLS origin_tech = list(TECH_MATERIAL = 3, TECH_ENGINEERING = 3, TECH_PHORON = 2) attack_verb = list("bashed", "battered", "bludgeoned", "whacked", "warped", "blasted") @@ -137,7 +137,7 @@ materials_base = list(MAT_STEEL = 150, MAT_SILVER = 50) origin_tech = list(TECH_MATERIAL = 2, TECH_ENGINEERING = 2) damage_force = 8 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL throw_force = 8 attack_verb = list("drilled", "screwed", "jabbed") tool_speed = 0.25 diff --git a/code/game/objects/items/toys.dm b/code/game/objects/items/toys.dm index 4e8ba3b547e..774c200fab9 100644 --- a/code/game/objects/items/toys.dm +++ b/code/game/objects/items/toys.dm @@ -95,7 +95,7 @@ damage_force = 0 icon = 'icons/obj/weapons.dmi' icon_state = "syndballoon" - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY /obj/item/toy/nanotrasenballoon name = "criminal balloon" @@ -106,7 +106,7 @@ damage_force = 0 icon = 'icons/obj/weapons.dmi' icon_state = "ntballoon" - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY /* * Fake telebeacon @@ -145,7 +145,7 @@ icon_r_hand = 'icons/mob/items/righthand_guns.dmi', ) slot_flags = SLOT_HOLSTER - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL attack_verb = list("attacked", "struck", "hit") var/bullets = 5 @@ -238,7 +238,7 @@ desc = "It's nerf or nothing! Ages 8 and up." icon = 'icons/obj/toy.dmi' icon_state = "foamdart" - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY slot_flags = SLOT_EARS /obj/effect/foam_dart_dummy @@ -262,7 +262,7 @@ SLOT_ID_RIGHT_HAND = 'icons/mob/items/righthand_melee.dmi', ) var/active = 0 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL attack_verb = list("attacked", "struck", "hit") color = "#0099FF" var/colorable = TRUE @@ -293,7 +293,7 @@ item_state = "[icon_state]_blade_rainbow" else item_state = "[icon_state]_blade" - w_class = ITEMSIZE_LARGE + set_weight_class(WEIGHT_CLASS_BULKY) playsound(user, 'sound/weapons/saberon.ogg', 50, 1) update_icon() to_chat(user, SPAN_NOTICE("You extend the plastic blade with a quick flick of your wrist.")) @@ -305,7 +305,7 @@ to_chat(user, SPAN_NOTICE("You push the plastic blade back down into the handle.")) item_state = "[icon_state]" active = 0 - w_class = initial(w_class) + set_weight_class(initial(w_class)) update_icon() /obj/item/toy/sword/attackby(obj/item/W, mob/user) @@ -364,7 +364,7 @@ slot_flags = SLOT_BELT | SLOT_BACK damage_force = 5 throw_force = 5 - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL attack_verb = list("attacked", "slashed", "stabbed", "sliced") /* @@ -375,7 +375,7 @@ desc = "Wow!" icon = 'icons/obj/toy.dmi' icon_state = "snappop" - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY /obj/item/toy/snappop/throw_impact(atom/hit_atom) ..() @@ -484,7 +484,7 @@ icon = 'icons/obj/toy.dmi' icon_state = "bosunwhistle" var/cooldown = 0 - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY slot_flags = SLOT_EARS | SLOT_HOLSTER /obj/item/toy/bosunwhistle/attack_self(mob/user) @@ -965,7 +965,7 @@ desc = "A small toy plushie. It's very cute." icon = 'icons/obj/toy.dmi' icon_state = "nymphplushie" - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY var/last_message = 0 var/pokephrase = "Uww!" @@ -1399,7 +1399,7 @@ SLOT_ID_LEFT_HAND = 'icons/mob/items/lefthand_melee.dmi', SLOT_ID_RIGHT_HAND = 'icons/mob/items/righthand_melee.dmi', ) - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY attack_verb = list("attacked", "slashed", "stabbed", "poked") //Flowers fake & real @@ -1409,7 +1409,7 @@ desc = "A lovely bouquet of flowers. Smells nice!" icon = 'icons/obj/items.dmi' icon_state = "bouquet" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL /obj/item/toy/bouquet/fake name = "plastic bouquet" @@ -1420,7 +1420,7 @@ desc = "A pretend horse on a stick for any aspiring little cowboy to ride." icon = 'icons/obj/toy.dmi' icon_state = "stickhorse" - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY ////////////////////////////////////////////////////// // Magic 8-Ball / Conch // @@ -1457,7 +1457,7 @@ // DND Character minis. Use the naming convention (type)character for the icon states. /obj/item/toy/character icon = 'icons/obj/toy.dmi' - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL pixel_z = 5 /obj/item/toy/character/alien @@ -1507,7 +1507,7 @@ desc = "A little toy model AI core!"// with real law announcing action!" //Alas, requires a rewrite of how ion laws work. icon = 'icons/obj/toy.dmi' icon_state = "AI" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL var/cooldown = 0 /* /obj/item/toy/AI/attack_self(mob/user) @@ -1529,7 +1529,7 @@ desc = "An action figure modeled after 'The Owl', defender of justice." icon = 'icons/obj/toy.dmi' icon_state = "owlprize" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL var/cooldown = 0 /obj/item/toy/owl/attack_self(mob/user) @@ -1550,7 +1550,7 @@ desc = "An action figure modeled after 'The Griffin', criminal mastermind." icon = 'icons/obj/toy.dmi' icon_state = "griffinprize" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL var/cooldown = 0 /obj/item/toy/griffin/attack_self(mob/user) @@ -1571,7 +1571,7 @@ desc = "A detailed miniature figure based on the 'Cyan Cowgirl', fastest gun on the Frontier." icon = 'icons/obj/toy.dmi' icon_state = "cowgirlprize" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL var/cooldown = 0 /obj/item/toy/cowgirlprize/attack_self(mob/user) @@ -1592,7 +1592,7 @@ desc = "A detailed miniature figure based on the 'Snake Oil Salesman', villain and cheat, scourge of the Frontier." icon = 'icons/obj/toy.dmi' icon_state = "snakeoilprize" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL var/cooldown = 0 /obj/item/toy/snakeoilprize/attack_self(mob/user) @@ -1622,7 +1622,7 @@ desc = "Tiny cute Christmas tree." icon = 'icons/obj/toy.dmi' icon_state = "tinyxmastree" - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY damage_force = 1 throw_force = 1 @@ -1636,10 +1636,11 @@ slot_flags = SLOT_BACK var/cooldowntime = 20 var/static/list/dakimakura_options = list("Callie","Casca","Chaika","Elisabeth","Foxy Grandpa","Haruko","Holo","Ian","Jolyne","Kurisu","Marie","Mugi","Nar'Sie","Patchouli","Plutia","Rei","Reisen","Naga","Squid","Squigly","Tomoko","Toriel","Umaru","Yaranaika","Yoko") //Kurisu is the ideal girl." - Me, Logos. - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL slot_flags = SLOT_BACK - max_w_class = ITEMSIZE_SMALL - max_storage_space = INVENTORY_BOX_SPACE + max_single_weight_class = WEIGHT_CLASS_SMALL + max_combined_volume = STORAGE_VOLUME_BOX + var/last_message = 0 /obj/item/storage/daki/attack_self(mob/user) . = ..() diff --git a/code/game/objects/items/trash.dm b/code/game/objects/items/trash.dm index 5eb96a681ec..dea0c35c2db 100644 --- a/code/game/objects/items/trash.dm +++ b/code/game/objects/items/trash.dm @@ -4,7 +4,7 @@ //Added by Jack Rost /obj/item/trash icon = 'icons/obj/trash.dmi' - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL damage_force = 0 desc = "This is rubbish." drop_sound = 'sound/items/drop/wrapper.ogg' diff --git a/code/game/objects/items/uav.dm b/code/game/objects/items/uav.dm index 62bc58abdbf..852a1a8dac9 100644 --- a/code/game/objects/items/uav.dm +++ b/code/game/objects/items/uav.dm @@ -208,14 +208,14 @@ switch(state) if(UAV_OFF) //Packing state = UAV_PACKED - w_class = ITEMSIZE_LARGE + set_weight_class(WEIGHT_CLASS_BULKY) slowdown = 1 density = FALSE update_icon() return TRUE if(UAV_PACKED) //Unpacking state = UAV_OFF - w_class = ITEMSIZE_HUGE + set_weight_class(WEIGHT_CLASS_HUGE) slowdown = 3 density = TRUE update_icon() diff --git a/code/game/objects/items/weapons/AI_modules.dm b/code/game/objects/items/weapons/AI_modules.dm index 10a062f1352..c5ba03858bd 100644 --- a/code/game/objects/items/weapons/AI_modules.dm +++ b/code/game/objects/items/weapons/AI_modules.dm @@ -12,7 +12,7 @@ AI MODULES icon_state = "std_mod" desc = "An AI Module for transmitting encrypted instructions to the AI." damage_force = 5.0 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL throw_force = 5.0 throw_speed = 3 throw_range = 15 diff --git a/code/game/objects/items/weapons/RCD.dm b/code/game/objects/items/weapons/RCD.dm index c8989e7a9e2..541c78e76f4 100644 --- a/code/game/objects/items/weapons/RCD.dm +++ b/code/game/objects/items/weapons/RCD.dm @@ -16,7 +16,7 @@ throw_force = 10 throw_speed = 1 throw_range = 5 - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL origin_tech = list(TECH_ENGINEERING = 4, TECH_MATERIAL = 2) materials_base = list(MAT_STEEL = 24000) preserve_item = TRUE // RCDs are pretty important. @@ -421,7 +421,7 @@ ) - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL origin_tech = list(TECH_MATERIAL = 2) materials_base = list(MAT_STEEL = 20000, MAT_GLASS = 4000) var/remaining = RCD_MAX_CAPACITY / 3 diff --git a/code/game/objects/items/weapons/RPD.dm b/code/game/objects/items/weapons/RPD.dm index e1ddadbd764..1ac9261686b 100644 --- a/code/game/objects/items/weapons/RPD.dm +++ b/code/game/objects/items/weapons/RPD.dm @@ -22,7 +22,7 @@ throw_force = 10 throw_speed = 1 throw_range = 5 - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL slot_flags = SLOT_BELT materials_base = list(MAT_STEEL = 20000, MAT_GLASS = 10000) ///Sparks system used when changing device in the UI diff --git a/code/game/objects/items/weapons/RSF.dm b/code/game/objects/items/weapons/RSF.dm index 9f5624c674a..9676a0bfeac 100644 --- a/code/game/objects/items/weapons/RSF.dm +++ b/code/game/objects/items/weapons/RSF.dm @@ -30,7 +30,7 @@ RSF "condiment bottle" = /obj/item/reagent_containers/food/condiment ) - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL /obj/item/rsf/examine(mob/user, dist) . = ..() diff --git a/code/game/objects/items/weapons/autopsy.dm b/code/game/objects/items/weapons/autopsy.dm index 2454fdaab5e..85e382fb8f2 100644 --- a/code/game/objects/items/weapons/autopsy.dm +++ b/code/game/objects/items/weapons/autopsy.dm @@ -8,7 +8,7 @@ icon = 'icons/obj/autopsy_scanner.dmi' icon_state = "" item_state = "autopsy_scanner" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL origin_tech = list(TECH_MATERIAL = 1, TECH_BIO = 1) var/list/datum/autopsy_data_scanner/wdata = list() var/list/datum/autopsy_data_scanner/chemtraces = list() diff --git a/code/game/objects/items/weapons/barrier_tape.dm b/code/game/objects/items/weapons/barrier_tape.dm index b39f14072d3..8eb40321c06 100644 --- a/code/game/objects/items/weapons/barrier_tape.dm +++ b/code/game/objects/items/weapons/barrier_tape.dm @@ -3,7 +3,7 @@ name = "tape roll" icon = 'icons/policetape.dmi' icon_state = "tape" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL tool_speed = 3 //You can use it in surgery. It's stupid, but you can. diff --git a/code/game/objects/items/weapons/bones.dm b/code/game/objects/items/weapons/bones.dm index dc2ab3521a0..93ba27baad7 100644 --- a/code/game/objects/items/weapons/bones.dm +++ b/code/game/objects/items/weapons/bones.dm @@ -7,7 +7,7 @@ damage_force = 5 throw_force = 6 item_state = "bone" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL attack_verb = list("attacked", "bashed", "battered", "bludgeoned", "whacked", "bonked", "boned") /obj/item/bone/skull diff --git a/code/game/objects/items/weapons/candle.dm b/code/game/objects/items/weapons/candle.dm index 036b90ef18f..5bda9d83026 100644 --- a/code/game/objects/items/weapons/candle.dm +++ b/code/game/objects/items/weapons/candle.dm @@ -5,7 +5,7 @@ icon_state = "candle1" drop_sound = 'sound/items/drop/gloves.ogg' pickup_sound = 'sound/items/pickup/gloves.ogg' - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY light_color = "#E09D37" var/wax = 2000 var/icon_type = "candle" @@ -76,7 +76,7 @@ icon = 'icons/obj/candle.dmi' icon_state = "smallcandle" icon_type = "smallcandle" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL /obj/item/flame/candle/white name = "white candle" @@ -84,7 +84,7 @@ icon = 'icons/obj/candle.dmi' icon_state = "whitecandle" icon_type = "whitecandle" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL /obj/item/flame/candle/black name = "black candle" @@ -92,14 +92,14 @@ icon = 'icons/obj/candle.dmi' icon_state = "blackcandle" icon_type = "blackcandle" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL /obj/item/flame/candle/candelabra name = "candelabra" desc = "a small gold candelabra. The cups that hold the candles save some of the wax from dripping off, allowing the candles to burn longer." icon = 'icons/obj/candle.dmi' icon_state = "candelabra" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL wax = 20000 /obj/item/flame/candle/candelabra/update_icon() diff --git a/code/game/objects/items/weapons/cigs_lighters.dm b/code/game/objects/items/weapons/cigs_lighters.dm index c8bda1c43ad..74171bd6d81 100644 --- a/code/game/objects/items/weapons/cigs_lighters.dm +++ b/code/game/objects/items/weapons/cigs_lighters.dm @@ -30,7 +30,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM icon_state = "match_unlit" var/burnt = 0 var/smoketime = 5 - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY origin_tech = list(TECH_MATERIAL = 1) slot_flags = SLOT_EARS attack_verb = list("burnt", "singed") @@ -266,7 +266,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM icon_state = "cig" item_state = "cig" throw_speed = 0.5 - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY slot_flags = SLOT_EARS | SLOT_MASK worn_render_flags = WORN_RENDER_INHAND_NO_RENDER | WORN_RENDER_SLOT_ALLOW_DEFAULT attack_verb = list("burnt", "singed") @@ -326,7 +326,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM icon_state = "cigimp" item_state = "cigimp" throw_speed = 0.5 - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY slot_flags = SLOT_EARS | SLOT_MASK attack_verb = list("burnt", "singed") type_butt = /obj/item/cigbutt/imp @@ -396,7 +396,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM desc = "A manky old cigarette butt." icon = 'icons/obj/clothing/masks.dmi' icon_state = "cigbutt" - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY slot_flags = SLOT_EARS throw_force = 1 @@ -530,7 +530,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM name = "rolling paper" desc = "A small, thin piece of easily flammable paper, commonly used for rolling and smoking various dried plants." icon = 'icons/obj/cigarettes.dmi' - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY icon_state = "cig paper" /obj/item/rollingpaper/attackby(obj/item/W as obj, mob/user as mob) @@ -553,7 +553,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM name = "blunt paper" desc = "A small, thin piece of tobacco-based paper, commonly used for rolling and smoking various dried plants." icon = 'icons/obj/cigarettes.dmi' - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY icon_state = "blunt paper" /obj/item/rollingblunt/attackby(obj/item/W as obj, mob/user as mob) @@ -582,7 +582,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM icon = 'icons/obj/items.dmi' icon_state = "lighter-g" item_state = "lighter-g" - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY throw_force = 4 slot_flags = SLOT_BELT attack_verb = list("burnt", "singed") diff --git a/code/game/objects/items/weapons/cosmetics.dm b/code/game/objects/items/weapons/cosmetics.dm index 2ea8e4204ba..d00f061acbe 100644 --- a/code/game/objects/items/weapons/cosmetics.dm +++ b/code/game/objects/items/weapons/cosmetics.dm @@ -4,7 +4,7 @@ desc = "A generic brand of lipstick." icon = 'icons/obj/items.dmi' icon_state = "lipstick" - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY slot_flags = SLOT_EARS var/colour = "red" var/open = 0 @@ -97,7 +97,7 @@ /obj/item/haircomb //sparklysheep's comb name = "purple comb" desc = "A pristine purple comb made from flexible plastic." - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY slot_flags = SLOT_EARS icon = 'icons/obj/items.dmi' icon_state = "purplecomb" @@ -125,7 +125,7 @@ /obj/item/makeover name = "makeover kit" desc = "A tiny case containing a mirror and some contact lenses." - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY icon = 'icons/obj/items.dmi' icon_state = "trinketbox" var/list/ui_users = list() diff --git a/code/game/objects/items/weapons/dna_injector.dm b/code/game/objects/items/weapons/dna_injector.dm index bdd9f34ae48..95c12557d51 100644 --- a/code/game/objects/items/weapons/dna_injector.dm +++ b/code/game/objects/items/weapons/dna_injector.dm @@ -8,7 +8,7 @@ var/s_time = 10.0 throw_speed = 1 throw_range = 5 - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY slot_flags = SLOT_EARS var/uses = 1 var/nofail diff --git a/code/game/objects/items/weapons/duct_tape.dm b/code/game/objects/items/weapons/duct_tape.dm index b39b7533f66..5fbb2b0d319 100644 --- a/code/game/objects/items/weapons/duct_tape.dm +++ b/code/game/objects/items/weapons/duct_tape.dm @@ -4,7 +4,7 @@ icon = 'icons/obj/bureaucracy.dmi' icon_state = "taperoll" damage_force = 0 - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY drop_sound = 'sound/items/drop/cardboardbox.ogg' pickup_sound = 'sound/items/pickup/cardboardbox.ogg' var/amount = 20 @@ -160,7 +160,7 @@ desc = "A piece of sticky tape." icon = 'icons/obj/bureaucracy.dmi' icon_state = "tape" - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY plane = MOB_PLANE item_flags = ITEM_NOBLUDGEON | ITEM_ENCUMBERS_WHILE_HELD anchored = FALSE diff --git a/code/game/objects/items/weapons/explosives.dm b/code/game/objects/items/weapons/explosives.dm index 7ece8ebc95e..1c5de510635 100644 --- a/code/game/objects/items/weapons/explosives.dm +++ b/code/game/objects/items/weapons/explosives.dm @@ -6,7 +6,7 @@ icon_state = "plastic-explosive0" item_state = "plasticx" item_flags = ITEM_NOBLUDGEON | ITEM_ENCUMBERS_WHILE_HELD - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL origin_tech = list(TECH_ILLEGAL = 2) var/datum/wires/explosive/c4/wires = null var/timer = 10 diff --git a/code/game/objects/items/weapons/extinguisher.dm b/code/game/objects/items/weapons/extinguisher.dm index e7555326f78..2b1c3b4f4e1 100644 --- a/code/game/objects/items/weapons/extinguisher.dm +++ b/code/game/objects/items/weapons/extinguisher.dm @@ -6,7 +6,7 @@ item_state = "fire_extinguisher" attack_sound = 'sound/weapons/smash.ogg' throw_force = 10 - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL throw_speed = 2 throw_range = 10 materials_base = list(MAT_STEEL = 90) @@ -29,7 +29,7 @@ item_state = "miniFE" attack_sound = null //it is much lighter, after all. throw_force = 2 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL damage_force = 3.0 max_water = 150 spray_particles = 3 diff --git a/code/game/objects/items/weapons/flamethrower.dm b/code/game/objects/items/weapons/flamethrower.dm index fefdd809b1a..61e44006d79 100644 --- a/code/game/objects/items/weapons/flamethrower.dm +++ b/code/game/objects/items/weapons/flamethrower.dm @@ -12,7 +12,7 @@ throw_force = 10.0 throw_speed = 1 throw_range = 5 - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL origin_tech = list(TECH_COMBAT = 1, TECH_PHORON = 1) materials_base = list(MAT_STEEL = 500) var/status = 0 diff --git a/code/game/objects/items/weapons/gift_wrappaper.dm b/code/game/objects/items/weapons/gift_wrappaper.dm index aafca56a73e..89b33c21914 100644 --- a/code/game/objects/items/weapons/gift_wrappaper.dm +++ b/code/game/objects/items/weapons/gift_wrappaper.dm @@ -20,11 +20,26 @@ . = ..() pixel_x = rand(-10,10) pixel_y = rand(-10,10) - if(w_class > 0 && w_class < ITEMSIZE_LARGE) + if(w_class > 0 && w_class < WEIGHT_CLASS_BULKY) icon_state = "gift[w_class]" else icon_state = "gift[pick(1, 2, 3)]" +/obj/item/gift + name = "gift" + desc = "A wrapped item." + icon = 'icons/obj/items.dmi' + icon_state = "gift3" + var/size = 3.0 + var/obj/item/gift = null + item_state = "gift" + w_class = WEIGHT_CLASS_BULKY + +/obj/item/gift/return_inventory() + . = list() + if(!isnull(gift)) + . += gift + /obj/item/gift/attack_self(mob/user) . = ..() if(.) @@ -220,7 +235,7 @@ ..() if (!( locate(/obj/structure/table, loc) )) to_chat(user, "You must put the paper on a table first!") - if (W.w_class < ITEMSIZE_LARGE) + if (W.w_class < WEIGHT_CLASS_BULKY) var/obj/item/I = user.get_inactive_held_item() if(I.is_wirecutter()) var/a_used = 2 ** (src.w_class - 1) @@ -236,7 +251,7 @@ amount -= a_used var/obj/item/gift/G = new /obj/item/gift( src.loc ) G.size = W.w_class - G.w_class = G.size + 1 + G.set_weight_class(G.size + 1) G.icon_state = "gift[G.size]" G.gift = W W.forceMove(G) diff --git a/code/game/objects/items/weapons/grenades/chem_grenade.dm b/code/game/objects/items/weapons/grenades/chem_grenade.dm index 0cbf8e2cf03..c73105a24b3 100644 --- a/code/game/objects/items/weapons/grenades/chem_grenade.dm +++ b/code/game/objects/items/weapons/grenades/chem_grenade.dm @@ -3,7 +3,7 @@ icon_state = "chemg" item_state = "grenade" desc = "A hand made chemical grenade." - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL damage_force = 2.0 det_time = 50 diff --git a/code/game/objects/items/weapons/grenades/grenade.dm b/code/game/objects/items/weapons/grenades/grenade.dm index 7db75869969..795f743c060 100644 --- a/code/game/objects/items/weapons/grenades/grenade.dm +++ b/code/game/objects/items/weapons/grenades/grenade.dm @@ -1,7 +1,7 @@ /obj/item/grenade name = "grenade" desc = "A hand held grenade, with an adjustable timer." - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL icon = 'icons/obj/grenade.dmi' icon_state = "grenade" item_state = "grenade" diff --git a/code/game/objects/items/weapons/grenades/spawnergrenade.dm b/code/game/objects/items/weapons/grenades/spawnergrenade.dm index 484200235e1..5a7bcbf2734 100644 --- a/code/game/objects/items/weapons/grenades/spawnergrenade.dm +++ b/code/game/objects/items/weapons/grenades/spawnergrenade.dm @@ -81,5 +81,5 @@ damage_force = 8.0 throw_speed = 1 throw_range = 4 - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY deliveryamt = 6 diff --git a/code/game/objects/items/weapons/handcuffs.dm b/code/game/objects/items/weapons/handcuffs.dm index 9fa66090e32..96578cddd24 100644 --- a/code/game/objects/items/weapons/handcuffs.dm +++ b/code/game/objects/items/weapons/handcuffs.dm @@ -6,7 +6,7 @@ icon_state = "handcuff" slot_flags = SLOT_BELT throw_force = 5 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL throw_speed = 2 throw_range = 5 origin_tech = list(TECH_MATERIAL = 1) @@ -222,7 +222,7 @@ var/last_chew = 0 icon = 'icons/obj/items.dmi' icon_state = "legcuff" throw_force = 0 - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL origin_tech = list(TECH_MATERIAL = 1) breakouttime = 300 //Deciseconds = 30s = 0.5 minute cuff_type = "legcuffs" diff --git a/code/game/objects/items/weapons/implants/implant.dm b/code/game/objects/items/weapons/implants/implant.dm index ad2647dc7fb..0bfe624f50f 100644 --- a/code/game/objects/items/weapons/implants/implant.dm +++ b/code/game/objects/items/weapons/implants/implant.dm @@ -6,7 +6,7 @@ name = "implant" icon = 'icons/obj/device.dmi' icon_state = "implant" - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY var/implanted = null var/mob/imp_in = null var/obj/item/organ/external/part diff --git a/code/game/objects/items/weapons/implants/implantcase.dm b/code/game/objects/items/weapons/implants/implantcase.dm index dddc5d6c324..d4501f65615 100644 --- a/code/game/objects/items/weapons/implants/implantcase.dm +++ b/code/game/objects/items/weapons/implants/implantcase.dm @@ -8,7 +8,7 @@ item_state = "implantcase" throw_speed = 1 throw_range = 5 - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY var/obj/item/implant/imp = null /obj/item/implantcase/proc/update() diff --git a/code/game/objects/items/weapons/implants/implanter.dm b/code/game/objects/items/weapons/implants/implanter.dm index dca6fa80d71..ad4ae9d4a72 100644 --- a/code/game/objects/items/weapons/implants/implanter.dm +++ b/code/game/objects/items/weapons/implants/implanter.dm @@ -5,7 +5,7 @@ item_state = "syringe_0" throw_speed = 1 throw_range = 5 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL materials_base = list(MAT_STEEL = 1000, MAT_GLASS = 1000) var/obj/item/implant/imp = null var/active = 1 diff --git a/code/game/objects/items/weapons/implants/implantpad.dm b/code/game/objects/items/weapons/implants/implantpad.dm index ef48e75c3aa..cec946b0487 100644 --- a/code/game/objects/items/weapons/implants/implantpad.dm +++ b/code/game/objects/items/weapons/implants/implantpad.dm @@ -6,7 +6,7 @@ item_state = "electronic" throw_speed = 1 throw_range = 5 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL var/obj/item/implantcase/case = null var/broadcasting = null var/listening = 1.0 diff --git a/code/game/objects/items/weapons/improvised_components.dm b/code/game/objects/items/weapons/improvised_components.dm index 7ce979d31e5..f28a72b7dd5 100644 --- a/code/game/objects/items/weapons/improvised_components.dm +++ b/code/game/objects/items/weapons/improvised_components.dm @@ -51,7 +51,7 @@ item_state = "rods" damage_force = 8 throw_force = 10 - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL attack_verb = list("hit", "bludgeoned", "whacked", "bonked") material_significance = MATERIAL_SIGNIFICANCE_SHARD diff --git a/code/game/objects/items/weapons/material/chainsaw.dm b/code/game/objects/items/weapons/material/chainsaw.dm index 626c242a181..477c05edf2e 100644 --- a/code/game/objects/items/weapons/material/chainsaw.dm +++ b/code/game/objects/items/weapons/material/chainsaw.dm @@ -6,9 +6,9 @@ item_state = "chainsaw0" var/on = 0 var/max_fuel = 100 - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY slot_flags = SLOT_BACK - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY slot_flags = SLOT_BACK var/active_force = 55 var/inactive_force = 10 @@ -124,7 +124,7 @@ slot_flags = SLOT_BELT damage_force = 30 throw_force = 10 - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL sharp = 1 edge = 1 attack_verb = list("sawed", "torn", "cut", "chopped", "diced") diff --git a/code/game/objects/items/weapons/material/gravemarker.dm b/code/game/objects/items/weapons/material/gravemarker.dm index 8776b404cac..c2b4192d132 100644 --- a/code/game/objects/items/weapons/material/gravemarker.dm +++ b/code/game/objects/items/weapons/material/gravemarker.dm @@ -2,7 +2,7 @@ name = "grave marker" desc = "An object used in marking graves." icon_state = "gravemarker" - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY material_significance = MATERIAL_SIGNIFICANCE_WEAPON_MEDIUM var/icon_changes = 1 //Does the sprite change when you put words on it? diff --git a/code/game/objects/items/weapons/material/kitchen.dm b/code/game/objects/items/weapons/material/kitchen.dm index 2c0a66bc190..f989d0851dc 100644 --- a/code/game/objects/items/weapons/material/kitchen.dm +++ b/code/game/objects/items/weapons/material/kitchen.dm @@ -7,7 +7,7 @@ /obj/item/material/kitchen/utensil drop_sound = 'sound/items/drop/knife.ogg' pickup_sound = 'sound/items/pickup/knife.ogg' - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY origin_tech = list(TECH_MATERIAL = 1) attack_verb = list("attacked", "stabbed", "poked") damage_mode = DAMAGE_MODE_SHARP | DAMAGE_MODE_EDGE diff --git a/code/game/objects/items/weapons/material/knives.dm b/code/game/objects/items/weapons/material/knives.dm index cb42c9594d4..22c1f49b913 100644 --- a/code/game/objects/items/weapons/material/knives.dm +++ b/code/game/objects/items/weapons/material/knives.dm @@ -4,7 +4,7 @@ icon_state = "butterflyknife" item_state = null attack_sound = null - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL attack_verb = list("patted", "tapped") force_multiplier = 0.1 throw_force_multiplier = 1.5 @@ -19,12 +19,12 @@ attack_sound = 'sound/weapons/bladeslice.ogg' force_multiplier = 1 icon_state += "_open" - w_class = ITEMSIZE_NORMAL + set_weight_class(WEIGHT_CLASS_NORMAL) else damage_mode = initial(damage_mode) attack_sound = initial(attack_sound) icon_state = initial(icon_state) - w_class = initial(w_class) + set_weight_class(initial(w_class)) attack_verb = initial(attack_verb) force_multiplier = initial(force_multiplier) update_material_parts() diff --git a/code/game/objects/items/weapons/material/material.dm b/code/game/objects/items/weapons/material/material.dm index 05f5ed4d4c5..f1ebf5f3b95 100644 --- a/code/game/objects/items/weapons/material/material.dm +++ b/code/game/objects/items/weapons/material/material.dm @@ -8,7 +8,7 @@ damage_tier = MELEE_TIER_LIGHT throw_speed = 3 throw_range = 7 - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL item_icons = list( SLOT_ID_LEFT_HAND = 'icons/mob/items/lefthand_material.dmi', SLOT_ID_RIGHT_HAND = 'icons/mob/items/righthand_material.dmi', diff --git a/code/game/objects/items/weapons/material/misc.dm b/code/game/objects/items/weapons/material/misc.dm index 8ef44892d13..0a5cccd8c43 100644 --- a/code/game/objects/items/weapons/material/misc.dm +++ b/code/game/objects/items/weapons/material/misc.dm @@ -22,7 +22,7 @@ icon_state = "hatchet" material_significance = MATERIAL_SIGNIFICANCE_WEAPON_HEAVY damage_mode = DAMAGE_MODE_SHARP | DAMAGE_MODE_EDGE - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL origin_tech = list(TECH_MATERIAL = 2, TECH_COMBAT = 1) attack_verb = list("chopped", "torn", "cut") material_color = 0 @@ -69,7 +69,7 @@ icon = 'icons/obj/weapons.dmi' icon_state = "hoe" material_significance = MATERIAL_SIGNIFICANCE_WEAPON_LIGHT - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL attack_verb = list("slashed", "sliced", "cut", "clawed") /obj/item/material/minihoe/plasteel @@ -92,7 +92,7 @@ material_parts = /datum/material/snow material_significance = MATERIAL_SIGNIFICANCE_SHARD force_multiplier = 0 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL attack_verb = list("mushed", "splatted", "splooshed", "splushed") // Words that totally exist. /obj/item/material/snow/snowball/attack_self(mob/user) @@ -132,7 +132,7 @@ active = 0 attack_verb = list("attacked", "slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut") attack_sound = 'sound/weapons/bladeslice.ogg' - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY material_significance = MATERIAL_SIGNIFICANCE_WEAPON_HEAVY damage_mode = DAMAGE_MODE_EDGE | DAMAGE_MODE_SHARP diff --git a/code/game/objects/items/weapons/material/shards.dm b/code/game/objects/items/weapons/material/shards.dm index 00f632ce0f1..10d09ba0951 100644 --- a/code/game/objects/items/weapons/material/shards.dm +++ b/code/game/objects/items/weapons/material/shards.dm @@ -3,7 +3,7 @@ icon = 'icons/obj/shards.dmi' desc = "Made of nothing. How does this even exist?" // set based on material, if this desc is visible it's a bug (shards default to being made of glass) icon_state = "large" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL material_significance = MATERIAL_SIGNIFICANCE_SHARD damage_mode = DAMAGE_MODE_SHARP | DAMAGE_MODE_EDGE item_state = "shard-glass" @@ -11,9 +11,9 @@ material_parts = /datum/material/glass /obj/item/material/shard/Initialize(mapload, material) - . = ..() pixel_x = rand(-8, 8) pixel_y = rand(-8, 8) + . = ..() /obj/item/material/shard/update_material_single(datum/material/material) . = ..() @@ -78,7 +78,7 @@ if(prob(75)) will_break = TRUE - var/obj/item/gloves = user.item_by_slot(SLOT_ID_GLOVES) + var/obj/item/gloves = user.item_by_slot_id(SLOT_ID_GLOVES) if(gloves && (gloves.body_cover_flags & HANDS) && istype(gloves, /obj/item/clothing/gloves)) // Not-gloves aren't gloves, and therefore don't protect us protected_hands = TRUE // If we're wearing gloves we can probably handle it just fine diff --git a/code/game/objects/items/weapons/material/twohanded.dm b/code/game/objects/items/weapons/material/twohanded.dm index f5e60bdb5b5..11690090677 100644 --- a/code/game/objects/items/weapons/material/twohanded.dm +++ b/code/game/objects/items/weapons/material/twohanded.dm @@ -17,7 +17,7 @@ * Twohanded */ /obj/item/material/twohanded - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY var/unwielded_force_multiplier = 0.25 var/wielded = 0 var/wieldsound = null @@ -79,7 +79,7 @@ description_info = "A hefty two-handed cutting implement. Used for chopping through wood, glass, metal grating, wild animals, and even trees, shockingly enough. Good thing NanoTrasen stocks these for free." material_significance = MATERIAL_SIGNIFICANCE_WEAPON_HEAVY damage_mode = DAMAGE_MODE_SHARP | DAMAGE_MODE_EDGE - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY slot_flags = SLOT_BACK attack_verb = list("attacked", "chopped", "cleaved", "torn", "cut") material_color = FALSE @@ -154,7 +154,7 @@ desc = "A haphazardly-constructed yet still deadly weapon of ancient design." description_info = "This weapon can strike from two tiles away, and over certain objects such as tables, or other people." damage_force = 10 - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY slot_flags = SLOT_BACK material_significance = MATERIAL_SIGNIFICANCE_WEAPON_HEAVY throw_force_multiplier = 1.5 @@ -247,7 +247,7 @@ description_info = "This weapon can cleave, striking nearby lesser, hostile enemies close to the primary target. It must be held in both hands to do this." material_significance = MATERIAL_SIGNIFICANCE_WEAPON_SUPERHEAVY attack_sound = 'sound/weapons/heavysmash.ogg' - w_class = ITEMSIZE_HUGE + w_class = WEIGHT_CLASS_HUGE encumbrance = ITEM_ENCUMBRANCE_MELEE_SLEDGEHAMMER attack_verb = list("attacked", "smashed", "crushed", "wacked", "pounded") armor_penetration = 50 diff --git a/code/game/objects/items/weapons/material/whetstone.dm b/code/game/objects/items/weapons/material/whetstone.dm index 87a9ddff5a4..3c704640a9c 100644 --- a/code/game/objects/items/weapons/material/whetstone.dm +++ b/code/game/objects/items/weapons/material/whetstone.dm @@ -7,7 +7,7 @@ icon = 'icons/obj/weapons.dmi' icon_state = "whetstone" damage_force = 3 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL var/repair_amount = 5 var/repair_time = 40 diff --git a/code/game/objects/items/weapons/melee/energy.dm b/code/game/objects/items/weapons/melee/energy.dm index 1bbadc77ccc..09cbb001ae6 100644 --- a/code/game/objects/items/weapons/melee/energy.dm +++ b/code/game/objects/items/weapons/melee/energy.dm @@ -37,7 +37,7 @@ throw_force = active_throwforce sharp = 1 edge = 1 - w_class = active_w_class + set_weight_class(active_w_class) playsound(user, 'sound/weapons/saberon.ogg', 50, 1) update_icon() set_light(lrange, lpower, lcolor) @@ -54,7 +54,7 @@ throw_force = initial(throw_force) sharp = initial(sharp) edge = initial(edge) - w_class = initial(w_class) + set_weight_class(initial(w_class)) update_icon() set_light(0,0) @@ -195,14 +195,14 @@ //active_force = 150 //holy... active_force = 60 active_throwforce = 35 - active_w_class = ITEMSIZE_HUGE + active_w_class = WEIGHT_CLASS_HUGE //damage_force = 40 //throw_force = 25 damage_force = 20 throw_force = 10 throw_speed = 1 throw_range = 5 - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL origin_tech = list(TECH_MAGNET = 3, TECH_COMBAT = 4) attack_verb = list("attacked", "chopped", "cleaved", "torn", "cut") sharp = 1 @@ -248,12 +248,12 @@ item_state = "esword" active_force = 30 active_throwforce = 20 - active_w_class = ITEMSIZE_LARGE + active_w_class = WEIGHT_CLASS_BULKY damage_force = 3 throw_force = 5 throw_speed = 1 throw_range = 5 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL atom_flags = NOBLOODY origin_tech = list(TECH_MAGNET = 3, TECH_ILLEGAL = 4) sharp = 1 @@ -495,7 +495,7 @@ throw_force = 1 //Throwing or dropping the item deletes it. throw_speed = 1 throw_range = 1 - w_class = ITEMSIZE_LARGE//So you can't hide it in your pocket or some such. + w_class = WEIGHT_CLASS_BULKY//So you can't hide it in your pocket or some such. atom_flags = NOBLOODY attack_verb = list("attacked", "slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut") var/mob/living/creator @@ -586,10 +586,10 @@ throw_speed = 7 throw_range = 11 reach = 2 - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY active_force = 25 active_throwforce = 30 - active_w_class = ITEMSIZE_HUGE + active_w_class = WEIGHT_CLASS_HUGE colorable = TRUE lcolor = "#800080" @@ -662,7 +662,7 @@ armor_penetration = 100 to_chat(user, " [src] starts vibrating.") playsound(user, 'sound/weapons/hf_machete/hfmachete1.ogg', 40, 0) - w_class = WEIGHT_CLASS_BULKY + set_weight_class(WEIGHT_CLASS_BULKY) // user.lazy_register_event(/lazy_event/on_moved, src, PROC_REF(mob_moved)) else damage_force = initial(damage_force) @@ -673,7 +673,7 @@ armor_penetration = initial(armor_penetration) to_chat(user, " [src] stops vibrating.") playsound(user, 'sound/weapons/hf_machete/hfmachete0.ogg', 40, 0) - w_class = WEIGHT_CLASS_NORMAL + set_weight_class(WEIGHT_CLASS_NORMAL) // user.lazy_unregister_event(/lazy_event/on_moved, src, PROC_REF(mob_moved)) update_icon() diff --git a/code/game/objects/items/weapons/melee/misc.dm b/code/game/objects/items/weapons/melee/misc.dm index 226cce82a30..63871150687 100644 --- a/code/game/objects/items/weapons/melee/misc.dm +++ b/code/game/objects/items/weapons/melee/misc.dm @@ -6,7 +6,7 @@ slot_flags = SLOT_BELT damage_force = 10 throw_force = 7 - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL origin_tech = list(TECH_COMBAT = 4) attack_verb = list("flogged", "whipped", "lashed", "disciplined") @@ -23,7 +23,7 @@ attack_sound = 'sound/weapons/rapierhit.ogg' damage_force = 35 throw_force = 15 - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL origin_tech = list(TECH_COMBAT = 4) attack_verb = list("attacked", "slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut") @@ -41,7 +41,7 @@ slot_flags = SLOT_BELT damage_force = 5 throw_force = 5 - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL var/open = FALSE /obj/item/melee/umbrella/Initialize(mapload) @@ -77,7 +77,7 @@ slot_flags = SLOT_BELT | SLOT_BACK damage_force = 30 throw_force = 10 - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL sharp = 1 edge = 1 attack_verb = list("attacked", "slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut") @@ -112,7 +112,7 @@ desc = "You shouldn't be seeing this. Contact an Admin." icon_state = "skateboard" icon = 'icons/obj/weapons.dmi' - w_class = ITEMSIZE_HUGE + w_class = WEIGHT_CLASS_HUGE slot_flags = SLOT_BELT damage_force = 10 throw_force = 7 @@ -174,7 +174,7 @@ slot_flags = SLOT_BELT | SLOT_BACK damage_force = 30 throw_force = 10 - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL sharp = 1 edge = 1 reach = 2 @@ -201,7 +201,7 @@ slot_flags = SLOT_BELT damage_force = 30 throw_force = 10 - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL sharp = 1 edge = 1 attack_verb = list("grasped", "torn", "cut", "pierced", "lashed") @@ -244,7 +244,7 @@ attack_sound = 'sound/weapons/bladeslice.ogg' damage_force = 20 throw_force = 10 - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL slot_flags = SLOT_BELT attack_verb = list("attacked", "slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut", "chopped") sharp = 1 @@ -302,7 +302,7 @@ playsound(loc, 'sound/weapons/gun_flamethrower3.ogg', 50, 1) src.damage_force = 20 src.damtype = "fire" - src.w_class = ITEMSIZE_LARGE + src.set_weight_class(WEIGHT_CLASS_BULKY) src.attack_sound = 'sound/weapons/gun_flamethrower2.ogg' active = 1 update_icon() @@ -312,7 +312,7 @@ playsound(loc, 'sound/weapons/gun_flamethrower1.ogg', 50, 1) src.damage_force = 20 src.damtype = "brute" - src.w_class = initial(src.w_class) + src.set_weight_class(initial(src.w_class)) src.attack_sound = initial(src.attack_sound) src.active = 0 update_icon() @@ -332,14 +332,14 @@ attack_verb = list("attacked", "stabbed", "sliced", "diced", "cut") damage_force = 8 throw_force = 5 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL sharp = 1 //I would like two-handed weapons that don't use our annoying material system, resulting in a "Steel Mjollnir". Drives me crazy. /obj/item/melee/twohanded name = "Two Handed Weapon" desc = "You shouldn't be seeing this. Report to a Maintainer." - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY var/wielded = 0 var/force_wielded = 0 var/force_unwielded @@ -383,7 +383,7 @@ throw_force = 30 force_wielded = 75 force_unwielded = 50 - w_class = ITEMSIZE_HUGE + w_class = WEIGHT_CLASS_HUGE edge = 1 attack_verb = list("attacked", "smashed", "crushed", "wacked", "pounded") armor_penetration = 50 @@ -552,7 +552,7 @@ playsound(loc, acti_sound, 50, 1) src.damage_force = 15 src.damtype = "fire" - src.w_class = ITEMSIZE_LARGE + src.set_weight_class(WEIGHT_CLASS_BULKY) src.attack_sound = 'sound/items/welder.ogg' src.sharp = 1 src.edge = 1 @@ -571,7 +571,7 @@ playsound(loc, deac_sound, 50, 1) src.damage_force = 3 src.damtype = "brute" - src.w_class = initial(src.w_class) + src.set_weight_class(initial(src.w_class)) src.active = 0 src.sharp = 0 src.edge = 0 diff --git a/code/game/objects/items/weapons/mop.dm b/code/game/objects/items/weapons/mop.dm index f72440bc5a2..1cd0d1aa589 100644 --- a/code/game/objects/items/weapons/mop.dm +++ b/code/game/objects/items/weapons/mop.dm @@ -11,7 +11,7 @@ GLOBAL_LIST_BOILERPLATE(all_mops, /obj/item/mop) throw_force = 10.0 throw_speed = 5 throw_range = 10 - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL attack_verb = list("mopped", "bashed", "bludgeoned", "whacked") materials_base = list(MAT_PLASTIC = 3) var/mopping = 0 diff --git a/code/game/objects/items/weapons/mop_deploy.dm b/code/game/objects/items/weapons/mop_deploy.dm index d9a6218bc87..cb92e2c30b1 100644 --- a/code/game/objects/items/weapons/mop_deploy.dm +++ b/code/game/objects/items/weapons/mop_deploy.dm @@ -7,7 +7,7 @@ throw_force = 1 //Throwing or dropping the item deletes it. throw_speed = 1 throw_range = 1 - w_class = ITEMSIZE_LARGE//So you can't hide it in your pocket or some such. + w_class = WEIGHT_CLASS_BULKY//So you can't hide it in your pocket or some such. attack_verb = list("mopped", "bashed", "bludgeoned", "whacked") var/mob/living/creator var/mopping = 0 diff --git a/code/game/objects/items/weapons/nullrod.dm b/code/game/objects/items/weapons/nullrod.dm index 022893442cb..4186a7a7d88 100644 --- a/code/game/objects/items/weapons/nullrod.dm +++ b/code/game/objects/items/weapons/nullrod.dm @@ -9,7 +9,7 @@ throw_speed = 1 throw_range = 4 throw_force = 10 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL drop_sound = 'sound/items/drop/sword.ogg' pickup_sound = 'sound/items/pickup/sword.ogg' diff --git a/code/game/objects/items/weapons/other.dm b/code/game/objects/items/weapons/other.dm index 035e0daad69..dd57580a83a 100644 --- a/code/game/objects/items/weapons/other.dm +++ b/code/game/objects/items/weapons/other.dm @@ -9,7 +9,7 @@ throw_force = 2.0 throw_speed = 1 throw_range = 4 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL attack_verb = list("called", "rang") attack_sound = 'sound/weapons/ring.ogg' @@ -23,7 +23,7 @@ anchored = 0.0 var/stored_matter = 0 var/mode = 1 - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL /obj/item/soap name = "soap" @@ -32,7 +32,7 @@ icon = 'icons/obj/items.dmi' icon_state = "soap" atom_flags = NOCONDUCT - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL slot_flags = SLOT_HOLSTER throw_force = 0 throw_speed = 4 @@ -64,7 +64,7 @@ icon_state = "bike_horn" item_state = "bike_horn" throw_force = 3 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL slot_flags = SLOT_HOLSTER throw_speed = 3 throw_range = 15 @@ -109,7 +109,7 @@ icon = 'icons/obj/items.dmi' icon_state = "c_tube" throw_force = 1 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL slot_flags = SLOT_HOLSTER throw_speed = 4 throw_range = 5 @@ -125,7 +125,7 @@ ) damage_force = 5.0 throw_force = 7.0 - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL materials_base = list(MAT_STEEL = 50) attack_verb = list("bludgeoned", "whacked", "disciplined", "thrashed") @@ -135,8 +135,8 @@ /obj/item/cane/concealed/Initialize(mapload) . = ..() var/obj/item/material/butterfly/switchblade/temp_blade = new(src) + temp_blade.set_active(TRUE) concealed_blade = temp_blade - temp_blade.attack_self() /obj/item/cane/concealed/attack_self(mob/user) . = ..() @@ -160,6 +160,7 @@ if(!src.concealed_blade && istype(W)) if(!user.attempt_insert_item_for_installation(W, src)) return + concealed_blade = W var/datum/gender/T = GLOB.gender_datums[user.get_visible_gender()] user.visible_message( SPAN_WARNING("[user] has sheathed \a [W] into [T.his] [src]!"), @@ -203,7 +204,7 @@ SLOT_ID_RIGHT_HAND = 'icons/mob/items/righthand_melee.dmi', ) slot_flags = SLOT_BELT - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL damage_force = 3 var/on = 0 @@ -221,7 +222,7 @@ ) icon_state = "whitecane1out" item_state_slots = list(SLOT_ID_RIGHT_HAND = "whitecane", SLOT_ID_LEFT_HAND = "whitecane") - w_class = ITEMSIZE_NORMAL + set_weight_class(WEIGHT_CLASS_NORMAL) damage_force = 5 attack_verb = list("smacked", "struck", "cracked", "beaten") else @@ -232,7 +233,7 @@ ) icon_state = "whitecane1in" item_state_slots = list(SLOT_ID_RIGHT_HAND = null, SLOT_ID_LEFT_HAND = null) - w_class = ITEMSIZE_SMALL + set_weight_class(WEIGHT_CLASS_SMALL) damage_force = 3 attack_verb = list("hit", "poked", "prodded") @@ -262,30 +263,7 @@ desc = "Better keep this safe." icon_state = "nucleardisk" item_state = "card-id" - w_class = ITEMSIZE_SMALL - -/* -/obj/item/game_kit - name = "Gaming Kit" - icon = 'icons/obj/items.dmi' - icon_state = "game_kit" - var/selected = null - var/board_stat = null - var/data = "" - var/base_url = "http://svn.slurm.us/public/spacestation13/misc/game_kit" - item_state = "sheet-metal" - w_class = ITEMSIZE_HUGE -*/ - -/obj/item/gift - name = "gift" - desc = "A wrapped item." - icon = 'icons/obj/items.dmi' - icon_state = "gift3" - var/size = 3.0 - var/obj/item/gift = null - item_state = "gift" - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_SMALL /obj/item/caution desc = "Caution! Wet Floor!" @@ -296,7 +274,7 @@ throw_force = 3.0 throw_speed = 1 throw_range = 5 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL attack_verb = list("warned", "cautioned", "smashed") /obj/item/caution/attackby(obj/item/D, mob/user) @@ -317,25 +295,6 @@ name = "candy cone" icon_state = "candycone" -/*/obj/item/syndicate_uplink - name = "station bounced radio" - desc = "Remain silent about this..." - icon = 'icons/obj/radio.dmi' - icon_state = "radio" - var/temp = null - var/uses = 10.0 - var/selfdestruct = 0.0 - var/traitor_frequency = 0.0 - var/mob/currentUser = null - var/obj/item/radio/origradio = null - flags = ONBELT - w_class = ITEMSIZE_SMALL - item_state = "radio" - throw_speed = 4 - throw_range = 20 - materials_base = list("metal" = 100 - origin_tech = list(TECH_MAGNET = 2, TECH_ILLEGAL = 3)*/ - /obj/item/SWF_uplink name = "station-bounced radio" desc = "Used to communicate, it appears." @@ -349,7 +308,7 @@ slot_flags = SLOT_BELT item_state = "radio" throw_force = 5 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL throw_speed = 4 throw_range = 20 materials_base = list(MAT_STEEL = 100) @@ -368,7 +327,7 @@ throw_force = 5.0 throw_speed = 1 throw_range = 5 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL attack_verb = list("bludgeoned", "whacked", "disciplined") /obj/item/staff/broom @@ -393,13 +352,13 @@ throw_force = 5.0 throw_speed = 1 throw_range = 5 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL /obj/item/module icon = 'icons/obj/module.dmi' icon_state = "std_module" item_state = "std_mod" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL var/mtype = 1 // 1=electronic 2=hardware /obj/item/module/card_reader @@ -446,7 +405,7 @@ icon = 'icons/obj/cigarettes.dmi' icon_state = "cigarpacket" item_state = "cigarpacket" - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY throw_force = 2 var/cigarcount = 6 flags = ONBELT @@ -486,7 +445,7 @@ desc = "A portable seat designed to be mounted on trained animals. You shouldn't be seeing this version!" icon = 'icons/obj/items.dmi' icon_state = "saddle" - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY /obj/item/saddle/horse desc = "A portable seat designed to be mounted on trained animals. This leather design originates from Old Earth, where it was primarily used on horses." @@ -518,7 +477,7 @@ desc = "This strange gem is considered sacred by the inhabitants of Surt. Jealously protected by the tribes, these stones exhibit anomalous properties - primarily a faintly audible chiming ring." icon = 'icons/obj/lavaland.dmi' icon_state = "elderstone" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL catalogue_data = list(/datum/category_item/catalogue/anomalous/scorian_religion/elder_stone) /obj/item/condensedphlogiston @@ -526,14 +485,14 @@ desc = "Phlogiston stabilized into a putty-like solid. It is less volatile than raw phlogiston, requiring special circumstances to detonate." icon = 'icons/obj/lavaland.dmi' icon_state = "condensedphlogiston" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL /obj/item/bitterash name = "poultice (bitter ash)" desc = "A pungent poultice used primarily in Scorian religious rites. It is believed to provide protection from rampaging beasts." icon = 'icons/obj/lavaland.dmi' icon_state = "poulticeash" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL var/use_sound = list('sound/effects/ointment.ogg') //Code isn't working. Figure it out tomorrow. diff --git a/code/game/objects/items/weapons/paint.dm b/code/game/objects/items/weapons/paint.dm index a768e39ca1b..84911e5cf69 100644 --- a/code/game/objects/items/weapons/paint.dm +++ b/code/game/objects/items/weapons/paint.dm @@ -10,7 +10,7 @@ var/global/list/cached_icons = list() icon_state = "paint_neutral" item_state = "paintcan" materials_base = list(MAT_STEEL = 200) - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL amount_per_transfer_from_this = 10 possible_transfer_amounts = list(10,20,30,60) volume = 60 diff --git a/code/game/objects/items/weapons/scrolls.dm b/code/game/objects/items/weapons/scrolls.dm index 3e4238780e3..449861d4136 100644 --- a/code/game/objects/items/weapons/scrolls.dm +++ b/code/game/objects/items/weapons/scrolls.dm @@ -4,7 +4,7 @@ icon = 'icons/obj/wizard.dmi' icon_state = "scroll" var/uses = 4.0 - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY item_state = "paper" throw_speed = 4 throw_range = 20 diff --git a/code/game/objects/items/weapons/shields.dm b/code/game/objects/items/weapons/shields.dm index eea328313b4..a1a4539d5ea 100644 --- a/code/game/objects/items/weapons/shields.dm +++ b/code/game/objects/items/weapons/shields.dm @@ -66,7 +66,7 @@ throw_force = 5.0 throw_speed = 1 throw_range = 4 - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY origin_tech = list(TECH_MATERIAL = 2) materials_base = list(MAT_GLASS = 7500, MAT_STEEL = 1000) attack_verb = list("shoved", "bashed") @@ -193,7 +193,7 @@ damage_force = 16 encumbrance = ITEM_ENCUMBRANCE_SHIELD_TOWER throw_force = 15 //Massive piece of metal - w_class = ITEMSIZE_HUGE + w_class = WEIGHT_CLASS_HUGE /obj/item/shield/riot/tower/swat name = "swat shield" @@ -294,7 +294,7 @@ throw_force = 5.0 throw_speed = 1 throw_range = 4 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL var/lrange = 1.5 var/lpower = 1.5 var/lcolor = "#006AFF" @@ -336,7 +336,7 @@ if (active) damage_force = 10 update_icon() - w_class = ITEMSIZE_LARGE + set_weight_class(WEIGHT_CLASS_BULKY) slot_flags = null playsound(user, 'sound/weapons/saberon.ogg', 50, 1) to_chat(user, "\The [src] is now active.") @@ -344,7 +344,7 @@ else damage_force = 3 update_icon() - w_class = ITEMSIZE_TINY + set_weight_class(WEIGHT_CLASS_TINY) slot_flags = SLOT_EARS playsound(user, 'sound/weapons/saberoff.ogg', 50, 1) to_chat(user, "\The [src] can now be concealed.") @@ -396,7 +396,7 @@ throw_force = 3 throw_speed = 3 throw_range = 4 - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL var/active = 0 /* /obj/item/shield/energy/IsShield() @@ -417,14 +417,14 @@ damage_force = 8 throw_force = 5 throw_speed = 2 - w_class = ITEMSIZE_LARGE + set_weight_class(WEIGHT_CLASS_BULKY) slot_flags = SLOT_BACK to_chat(user, "You extend \the [src].") else damage_force = 3 throw_force = 3 throw_speed = 3 - w_class = ITEMSIZE_NORMAL + set_weight_class(WEIGHT_CLASS_NORMAL) slot_flags = null to_chat(user, "[src] can now be concealed.") diff --git a/code/game/objects/items/weapons/stunbaton.dm b/code/game/objects/items/weapons/stunbaton.dm index b60c1aa3a1c..78846155985 100644 --- a/code/game/objects/items/weapons/stunbaton.dm +++ b/code/game/objects/items/weapons/stunbaton.dm @@ -12,7 +12,7 @@ edge = 0 throw_force = 7 atom_flags = NOCONDUCT - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL drop_sound = 'sound/items/drop/metalweapon.ogg' pickup_sound = 'sound/items/pickup/metalweapon.ogg' origin_tech = list(TECH_COMBAT = 2) @@ -295,7 +295,7 @@ name = "stun lance" desc = "Designed by NanoTrasen for mounted expeditions, the stun lance is useful for running down and incapacitating wildlife for study. Its efficacy on fugitives is tacitly implied." icon_state = "stunlance" - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL reach = 2 /obj/item/melee/baton/stunlance/Initialize(mapload) @@ -307,7 +307,7 @@ desc = "A smaller, more potent version of a hand-held tazer, one zap and the target is sure to be on the ground, and the integrated cell empty. Standard issue to Command staff, indentured sex workers and anyone else who might get mobbed by dissatisfied clientele. Do not lick." icon_state = "mini_baton" item_state = "mini_baton" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL damage_force = 5 stunforce = 5 throw_force = 2 diff --git a/code/game/objects/items/weapons/surgery_tools.dm b/code/game/objects/items/weapons/surgery_tools.dm index 238c33a2065..dd4da3bc35e 100644 --- a/code/game/objects/items/weapons/surgery_tools.dm +++ b/code/game/objects/items/weapons/surgery_tools.dm @@ -12,7 +12,7 @@ name = "Surgical tool" desc = "This shouldn't be here, ahelp it." icon = 'icons/obj/surgery.dmi' - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL item_flags = ITEM_CAREFUL_BLUDGEON | ITEM_ENCUMBERS_WHILE_HELD var/helpforce = 0 //For help intent things drop_sound = 'sound/items/drop/weldingtool.ogg' @@ -61,7 +61,7 @@ attack_sound = 'sound/weapons/circsawhit.ogg' materials_base = list(MAT_STEEL = 15000, MAT_GLASS = 10000) damage_force = 15 - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL origin_tech = list(TECH_MATERIAL = 1, TECH_BIO = 1) attack_verb = list("drilled") @@ -83,7 +83,7 @@ damage_force = 10.0 sharp = 1 edge = 1 - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY slot_flags = SLOT_EARS throw_force = 5.0 throw_speed = 3 @@ -146,7 +146,7 @@ icon_state = "saw3" attack_sound = 'sound/weapons/circsawhit.ogg' damage_force = 15.0 - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL throw_force = 9.0 throw_speed = 3 throw_range = 5 @@ -163,7 +163,7 @@ item_state = "saw3" attack_sound = 'sound/weapons/emitter2.ogg' damtype = SEARING - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY origin_tech = list(TECH_BIO = 4, TECH_MATERIAL = 6, TECH_MAGNET = 6) materials_base = list(MAT_STEEL = 12500) attack_verb = list("attacked", "slashed", "seared", "cut") @@ -311,7 +311,7 @@ damage_force = 10.0 sharp = 1 edge = 1 - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY slot_flags = SLOT_EARS throw_force = 5.0 throw_speed = 3 @@ -332,7 +332,7 @@ desc = "An admittedly complex, yet still inferior tool, this bone saw uses knapped volcanic glass as cutting teeth." icon_state = "saw_bone" damage_force = 15.0 - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL throw_force = 9.0 throw_speed = 3 throw_range = 5 diff --git a/code/game/objects/items/weapons/swords_axes_etc.dm b/code/game/objects/items/weapons/swords_axes_etc.dm index fbae63a4aa8..dd467649551 100644 --- a/code/game/objects/items/weapons/swords_axes_etc.dm +++ b/code/game/objects/items/weapons/swords_axes_etc.dm @@ -48,7 +48,7 @@ icon_state = "telebaton" item_state = "telebaton" slot_flags = SLOT_BELT - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL damage_force = 3 var/on = 0 var/off_force = 3 @@ -68,7 +68,7 @@ "You hear an ominous click.") src.icon_state = "[icon_state]_1" src.item_state = "[item_state]_1" - w_class = ITEMSIZE_NORMAL + set_weight_class(WEIGHT_CLASS_NORMAL) damage_force = on_force //quite robust attack_verb = list("struck", "beat") else @@ -78,7 +78,7 @@ "You hear a click.") src.icon_state = initial(icon_state) src.item_state = initial(item_state) - w_class = ITEMSIZE_SMALL + set_weight_class(WEIGHT_CLASS_SMALL) damage_force = off_force //not so robust now attack_verb = list("poked", "jabbed") if(istype(user,/mob/living/carbon/human)) @@ -187,7 +187,7 @@ icon_state = "cn_stool_c" damage_force = 10 throw_force = 10 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL var/on = 0 slot_flags = null damage_force = 0 @@ -201,12 +201,12 @@ if(on == 0) user.visible_message("In a quick motion, [user] extends their collapsible stool.") icon_state = "cn_stool" - w_class = ITEMSIZE_HUGE + set_weight_class(WEIGHT_CLASS_HUGE) on = 1 else user.visible_message("\ [user] collapses their stool.") icon_state = "cn_stool_c" - w_class = ITEMSIZE_SMALL + set_weight_class(WEIGHT_CLASS_SMALL) on = 0 playsound(src.loc, 'sound/weapons/empty.ogg', 50, 1) diff --git a/code/game/objects/items/weapons/syndie.dm b/code/game/objects/items/weapons/syndie.dm index c7eadc9c5c7..93168cbb59a 100644 --- a/code/game/objects/items/weapons/syndie.dm +++ b/code/game/objects/items/weapons/syndie.dm @@ -11,7 +11,7 @@ item_state = "radio" name = "normal-sized package" desc = "A small wrapped package." - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL var/devastate = 1 var/heavy_impact = 2 diff --git a/code/game/objects/items/weapons/tanks/jetpack.dm b/code/game/objects/items/weapons/tanks/jetpack.dm index 30b0f1485c5..351c4e94be4 100644 --- a/code/game/objects/items/weapons/tanks/jetpack.dm +++ b/code/game/objects/items/weapons/tanks/jetpack.dm @@ -5,7 +5,7 @@ desc = "A tank of compressed gas for use as propulsion in zero-gravity areas. Use with caution." icon_state = "jetpack" gauge_icon = null - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY item_icons = list( SLOT_ID_LEFT_HAND = 'icons/mob/items/lefthand_storage.dmi', SLOT_ID_RIGHT_HAND = 'icons/mob/items/righthand_storage.dmi', diff --git a/code/game/objects/items/weapons/tanks/tank_types.dm b/code/game/objects/items/weapons/tanks/tank_types.dm index f99bcf9611a..cbb62e971cb 100644 --- a/code/game/objects/items/weapons/tanks/tank_types.dm +++ b/code/game/objects/items/weapons/tanks/tank_types.dm @@ -106,7 +106,7 @@ /obj/item/tank/phoron/pressurized name = "fuel can" icon_state = "phoron_vox" - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL /obj/item/tank/phoron/pressurized/Initialize(mapload) . = ..() @@ -138,7 +138,7 @@ gauge_icon = "indicator_emergency" gauge_cap = 3 slot_flags = SLOT_BELT - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL damage_force = 4 distribute_pressure = ONE_ATMOSPHERE*O2STANDARD volume = 2 //Tiny. Real life equivalents only have 21 breaths of oxygen in them. They're EMERGENCY tanks anyway -errorage (dangercon 2011) diff --git a/code/game/objects/items/weapons/tanks/tanks.dm b/code/game/objects/items/weapons/tanks/tanks.dm index a3477920d89..68f8049127c 100644 --- a/code/game/objects/items/weapons/tanks/tanks.dm +++ b/code/game/objects/items/weapons/tanks/tanks.dm @@ -18,7 +18,7 @@ var/list/global/tank_gauge_cache = list() var/gauge_cap = 6 slot_flags = SLOT_BACK - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL damage_force = 5.0 throw_force = 10.0 diff --git a/code/game/objects/items/weapons/teleportation.dm b/code/game/objects/items/weapons/teleportation.dm index 0924a1d336b..52b06f60bba 100644 --- a/code/game/objects/items/weapons/teleportation.dm +++ b/code/game/objects/items/weapons/teleportation.dm @@ -16,7 +16,7 @@ var/frequency = 1451 var/broadcasting = null var/listening = 1.0 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL item_state = "electronic" throw_speed = 4 throw_range = 20 @@ -126,7 +126,7 @@ Frequency: icon_state = "hand_tele" item_state = "electronic" throw_force = 5 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL throw_speed = 3 throw_range = 5 origin_tech = list(TECH_MAGNET = 1, TECH_BLUESPACE = 3) diff --git a/code/game/objects/items/weapons/towels.dm b/code/game/objects/items/weapons/towels.dm index 3192158b069..c6cf2dffe3c 100644 --- a/code/game/objects/items/weapons/towels.dm +++ b/code/game/objects/items/weapons/towels.dm @@ -5,7 +5,7 @@ slot_flags = SLOT_HEAD | SLOT_BELT | SLOT_OCLOTHING damage_force = 3.0 clothing_flags = CLOTHING_IGNORE_BELTLINK - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL attack_verb = list("whipped") attack_sound = 'sound/weapons/towelwhip.ogg' desc = "A soft cotton towel." diff --git a/code/game/objects/items/weapons/traps.dm b/code/game/objects/items/weapons/traps.dm index 4abfa28898d..d447853fecb 100644 --- a/code/game/objects/items/weapons/traps.dm +++ b/code/game/objects/items/weapons/traps.dm @@ -8,7 +8,7 @@ icon_state = "beartrap0" desc = "A mechanically activated leg trap. Low-tech, but reliable. Looks like it could really hurt if you set it off." throw_force = 0 - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL origin_tech = list(TECH_MATERIAL = 1) materials_base = list(MAT_STEEL = 18750) buckle_restrained_resist_time = 15 SECONDS diff --git a/code/game/objects/items/weapons/trays.dm b/code/game/objects/items/weapons/trays.dm index 8f148088dce..f7e39b5f67b 100644 --- a/code/game/objects/items/weapons/trays.dm +++ b/code/game/objects/items/weapons/trays.dm @@ -10,7 +10,7 @@ throw_force = 10.0 throw_speed = 1 throw_range = 5 - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL materials_base = list(MAT_STEEL = 3000) var/list/carrying = list() // List of things on the tray. - Doohl var/max_carry = 10 @@ -77,7 +77,7 @@ var/protected = 0 for(var/slot in list(SLOT_ID_HEAD, SLOT_ID_MASK, SLOT_ID_GLASSES)) - var/obj/item/protection = victim.item_by_slot(slot) + var/obj/item/protection = victim.item_by_slot_id(slot) if(istype(protection) && (protection.body_cover_flags & FACE)) protected = 1 break @@ -162,9 +162,9 @@ var/val = 0 // value to return for(var/obj/item/I in carrying) - if(I.w_class == ITEMSIZE_TINY) + if(I.w_class == WEIGHT_CLASS_TINY) val ++ - else if(I.w_class == ITEMSIZE_SMALL) + else if(I.w_class == WEIGHT_CLASS_SMALL) val += 3 else val += 5 @@ -180,9 +180,9 @@ for(var/obj/item/I in loc) if( I != src && !I.anchored && !istype(I, /obj/item/clothing/under) && !istype(I, /obj/item/clothing/suit) && !istype(I, /obj/projectile) ) var/add = 0 - if(I.w_class == ITEMSIZE_TINY) + if(I.w_class == WEIGHT_CLASS_TINY) add = 1 - else if(I.w_class == ITEMSIZE_SMALL) + else if(I.w_class == WEIGHT_CLASS_SMALL) add = 3 else add = 5 diff --git a/code/game/objects/items/weapons/weldbackpack.dm b/code/game/objects/items/weapons/weldbackpack.dm index 280aa7f5b2a..8c1a5be5dc9 100644 --- a/code/game/objects/items/weapons/weldbackpack.dm +++ b/code/game/objects/items/weapons/weldbackpack.dm @@ -4,7 +4,7 @@ slot_flags = SLOT_BACK icon = 'icons/obj/storage.dmi' icon_state = "welderpack" - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY var/max_fuel = 350 var/obj/item/nozzle = null //Attached welder, or other spray device. var/nozzle_type = /obj/item/weldingtool/tubefed @@ -119,6 +119,6 @@ icon = 'icons/obj/storage.dmi' icon_state = "welderpack-e" item_state = "welderpack" - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY max_fuel = 100 nozzle_type = /obj/item/weldingtool/tubefed/survival diff --git a/code/game/objects/misc.dm b/code/game/objects/misc.dm index 91c4a25659d..6db6b6b7db6 100644 --- a/code/game/objects/misc.dm +++ b/code/game/objects/misc.dm @@ -47,7 +47,7 @@ name = "beach ball" density = 0 anchored = 0 - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY damage_force = 0.0 throw_force = 0.0 throw_speed = 1 diff --git a/code/game/objects/objs.dm b/code/game/objects/objs.dm index 5157e7229f6..37d598e8cd5 100644 --- a/code/game/objects/objs.dm +++ b/code/game/objects/objs.dm @@ -95,9 +95,11 @@ /// volume when breaking out using resist process var/breakout_volume = 100 - //? Systems - naming convention is 'object_[system]' + //? Systems - naming convention is 'obj_[system]' /// cell slot system var/datum/object_system/cell_slot/obj_cell_slot + /// storage system + var/datum/object_system/storage/obj_storage //? misc / legacy /// Set when a player renames a renamable object. @@ -175,10 +177,12 @@ SStgui.close_uis(src) SSnanoui.close_uis(src) QDEL_NULL(obj_cell_slot) + QDEL_NULL(obj_storage) return ..() /obj/Moved(atom/old_loc, movement_dir, forced, list/old_locs, momentum_change) . = ..() + obj_storage?.on_parent_moved(old_loc, forced) if(register_as_dangerous_object) var/turf/old_turf = get_turf(old_loc) var/turf/new_turf = get_turf(src) @@ -303,6 +307,9 @@ ) obj_cell_slot.insert_cell(I) return CLICKCHAIN_DO_NOT_PROPAGATE | CLICKCHAIN_DID_SOMETHING + var/datum/event_args/actor/actor = new(user) + if(!isnull(obj_storage) && I.allow_auto_storage_insert(actor, obj_storage) && obj_storage?.auto_handle_interacted_insertion(I, actor)) + return CLICKCHAIN_DO_NOT_PROPAGATE | CLICKCHAIN_DID_SOMETHING return ..() /obj/on_attack_hand(datum/event_args/actor/clickchain/e_args) @@ -345,6 +352,25 @@ return CLICKCHAIN_DO_NOT_PROPAGATE return ..() +/obj/OnMouseDrop(atom/over, mob/user, proximity, params) + if(!isnull(obj_storage) && proximity) + // clickdrag to self storage open + if(obj_storage.allow_open_via_clickdrag_to_self && ismob(over) && over == user) + if(obj_storage.auto_handle_interacted_open(new /datum/event_args/actor(user))) + return CLICKCHAIN_DO_NOT_PROPAGATE + // clickdrag to other obj transfer + if(obj_storage.allow_outbound_mass_transfer && obj_storage.allow_clickdrag_mass_transfer && isobj(over)) + var/obj/object = over + if(object.obj_storage.allow_inbound_mass_transfer) + obj_storage.interacted_mass_transfer(new /datum/event_args/actor(user), object.obj_storage) + return CLICKCHAIN_DO_NOT_PROPAGATE + // clickdrag to ground mass dumping + if(obj_storage.allow_quick_empty_via_clickdrag && obj_storage.allow_quick_empty && isturf(over)) + var/turf/turf = over + obj_storage.interacted_mass_dumping(new /datum/event_args/actor(user), turf) + return CLICKCHAIN_DO_NOT_PROPAGATE + return ..() + /obj/proc/drag_drop_climb_interaction(mob/user, atom/dropping) if(!climb_allowed) return FALSE @@ -476,35 +502,45 @@ . = ..() if(!isnull(obj_cell_slot?.cell) && obj_cell_slot.remove_yank_context && obj_cell_slot.interaction_active(e_args.performer)) var/image/rendered = image(obj_cell_slot.cell) - .["obj_cell_slot"] = ATOM_CONTEXT_TUPLE("remove cell", rendered, null, MOBILITY_CAN_USE) + .["obj_cell_slot"] = atom_context_tuple("remove cell", rendered, mobility = MOBILITY_CAN_USE, defaultable = TRUE) + if(obj_storage?.allow_open_via_context_click) + var/image/rendered = image(src) + .["obj_storage"] = atom_context_tuple("open storage", rendered, mobility = MOBILITY_CAN_STORAGE, defaultable = TRUE) /obj/context_act(datum/event_args/actor/e_args, key) - if(key == "obj_cell_slot") - var/reachability = e_args.performer.Reachability(src) - if(!reachability) + switch(key) + if("obj_cell_slot") + var/reachability = e_args.performer.Reachability(src) + if(!reachability) + return TRUE + if(!CHECK_MOBILITY(e_args.performer, MOBILITY_CAN_USE)) + e_args.initiator.action_feedback(SPAN_WARNING("You can't do that right now!"), src) + return TRUE + if(isnull(obj_cell_slot.cell)) + e_args.initiator.action_feedback(SPAN_WARNING("[src] doesn't have a cell installed.")) + return TRUE + if(!obj_cell_slot.interaction_active(e_args.performer)) + return TRUE + e_args.visible_feedback( + target = src, + range = obj_cell_slot.remove_is_discrete? 0 : MESSAGE_RANGE_CONSTRUCTION, + visible = SPAN_NOTICE("[e_args.performer] removes the cell from [src]."), + audible = SPAN_NOTICE("You hear fasteners falling out and something being removed."), + otherwise_self = SPAN_NOTICE("You remove the cell from [src]."), + ) + log_construction(e_args, src, "removed cell [obj_cell_slot.cell] ([obj_cell_slot.cell.type])") + var/obj/item/cell/removed = obj_cell_slot.remove_cell(src) + if(reachability == REACH_PHYSICAL) + e_args.performer.put_in_hands_or_drop(removed) + else + removed.forceMove(drop_location()) return TRUE - if(!CHECK_MOBILITY(e_args.performer, MOBILITY_CAN_USE)) - e_args.initiator.action_feedback(SPAN_WARNING("You can't do that right now!"), src) + if("obj_storage") + var/reachability = e_args.performer.Reachability(src) + if(!reachability) + return TRUE + obj_storage?.auto_handle_interacted_open(e_args) return TRUE - if(isnull(obj_cell_slot.cell)) - e_args.initiator.action_feedback(SPAN_WARNING("[src] doesn't have a cell installed.")) - return TRUE - if(!obj_cell_slot.interaction_active(e_args.performer)) - return TRUE - e_args.visible_feedback( - target = src, - range = obj_cell_slot.remove_is_discrete? 0 : MESSAGE_RANGE_CONSTRUCTION, - visible = SPAN_NOTICE("[e_args.performer] removes the cell from [src]."), - audible = SPAN_NOTICE("You hear fasteners falling out and something being removed."), - otherwise_self = SPAN_NOTICE("You remove the cell from [src]."), - ) - log_construction(e_args, src, "removed cell [obj_cell_slot.cell] ([obj_cell_slot.cell.type])") - var/obj/item/cell/removed = obj_cell_slot.remove_cell(src) - if(reachability == REACH_PHYSICAL) - e_args.performer.put_in_hands_or_drop(removed) - else - removed.forceMove(drop_location()) - return TRUE return ..() //* EMP *// @@ -513,6 +549,15 @@ . = ..() if(obj_cell_slot?.receive_emp) obj_cell_slot?.cell?.emp_act(severity) + if(obj_storage?.pass_emp_inside) + // ugh + if(obj_storage.pass_emp_weaken && severity < 4) + var/pass_severity = severity - 1 + for(var/atom/movable/inside in obj_storage.contents()) + inside.emp_act(pass_severity) + else + for(var/atom/movable/inside in obj_storage.contents()) + inside.emp_act(severity) //* Hiding / Underfloor *// @@ -522,6 +567,45 @@ /obj/proc/should_hide_underfloor() return FALSE +//* Inventory *// + +/obj/AllowDrop() + if(!isnull(obj_storage)) + return TRUE + return ..() + +/obj/clean_radiation(str, mul, cheap) + if(obj_storage?.pass_clean_radiation_inside) + for(var/atom/movable/AM as anything in contents) + AM.clean_radiation(str, mul, cheap) + return ..() + +/obj/on_contents_item_new(obj/item/item) + . = ..() + obj_storage?.on_contents_item_new(item) + +/** + * Returns stuff considered to be inside this object's inventory. + * + * Do not return ourselves or there will be an infinite loop in many callers! + * + * @return list() + */ +/obj/proc/return_inventory() + return isnull(obj_storage)? list() : obj_storage.contents() + +/obj/on_contents_weight_class_change(obj/item/item, old_weight_class, new_weight_class) + . = ..() + obj_storage?.on_contents_weight_class_change(item, old_weight_class, new_weight_class) + +/obj/on_contents_weight_volume_change(obj/item/item, old_weight_volume, new_weight_volume) + . = ..() + obj_storage?.on_contents_weight_volume_change(item, old_weight_volume, new_weight_volume) + +/obj/on_contents_weight_change(obj/item/item, old_weight, new_weight) + . = ..() + obj_storage?.on_contents_weight_change(item, old_weight, new_weight) + //* Examine *// /obj/examine(mob/user, dist) @@ -552,6 +636,20 @@ else . += SPAN_BOLDWARNING("It's falling apart!") +//* Movement *// + +/obj/Exited(atom/movable/AM, atom/newLoc) + . = ..() + // todo: this is fucking awful, proper redirection support when + if(isitem(AM) && obj_storage && (!obj_storage.dangerously_redirect_contents_calls || obj_storage.dangerously_redirect_contents_calls == src)) + obj_storage.on_item_exited(AM) + +/obj/Entered(atom/movable/AM, atom/oldLoc) + . = ..() + // todo: this is fucking awful, proper redirection support when + if(isitem(AM) && obj_storage && (!obj_storage.dangerously_redirect_contents_calls || obj_storage.dangerously_redirect_contents_calls == src)) + obj_storage.on_item_entered(AM) + //* Orientation *// /** @@ -565,7 +663,7 @@ /** * Standard wallmount orientation: face away - * + * * Directly sets dir without setDir() */ /obj/proc/auto_orient_wallmount_single_preinit() diff --git a/code/game/objects/structures.dm b/code/game/objects/structures.dm index 21c982dc7cc..87a0afecc2d 100644 --- a/code/game/objects/structures.dm +++ b/code/game/objects/structures.dm @@ -1,6 +1,6 @@ /obj/structure icon = 'icons/obj/structures.dmi' - w_class = ITEMSIZE_NO_CONTAINER + w_class = WEIGHT_CLASS_HUGE pass_flags = ATOM_PASS_BUCKLED // todo: rename to default_unanchor, allow generic structure unanchoring. diff --git a/code/game/objects/structures/ashlander.dm b/code/game/objects/structures/ashlander.dm index d11a1d037c3..54349c216de 100644 --- a/code/game/objects/structures/ashlander.dm +++ b/code/game/objects/structures/ashlander.dm @@ -164,7 +164,7 @@ if(!G.reagents || !G.reagents.total_volume) continue failed = 0 - bag.remove_from_storage(G, src) + bag.obj_storage.remove(G, src) holdingitems += G if(holdingitems && holdingitems.len >= limit) break diff --git a/code/game/objects/structures/bedsheet_bin.dm b/code/game/objects/structures/bedsheet_bin.dm index ec2ae31c51d..23bb25c1375 100644 --- a/code/game/objects/structures/bedsheet_bin.dm +++ b/code/game/objects/structures/bedsheet_bin.dm @@ -15,7 +15,7 @@ LINEN BINS throw_force = 1 throw_speed = 1 throw_range = 2 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL drop_sound = 'sound/items/drop/backpack.ogg' pickup_sound = 'sound/items/pickup/backpack.ogg' @@ -210,7 +210,7 @@ LINEN BINS sheets.Add(I) amount++ to_chat(user, "You put [I] in [src].") - else if(amount && !hidden && I.w_class < ITEMSIZE_LARGE) //make sure there's sheets to hide it among, make sure nothing else is hidden in there. + else if(amount && !hidden && I.w_class < WEIGHT_CLASS_BULKY) //make sure there's sheets to hide it among, make sure nothing else is hidden in there. if(!user.attempt_insert_item_for_installation(I, src)) return hidden = I diff --git a/code/game/objects/structures/bonfire.dm b/code/game/objects/structures/bonfire.dm index 57c26df5a4d..a4d652be467 100644 --- a/code/game/objects/structures/bonfire.dm +++ b/code/game/objects/structures/bonfire.dm @@ -130,7 +130,7 @@ return FALSE if(istype(new_fuel, /obj/item/stack/material/wood) || istype(new_fuel, /obj/item/stack/material/log) ) var/obj/item/stack/F = new_fuel - var/obj/item/stack/S = F.split(1) + var/obj/item/stack/S = F.split(1, user) if(S) S.forceMove(src) to_chat(user, SPAN_WARNING("You add \the [new_fuel] to \the [src].")) @@ -314,7 +314,7 @@ return FALSE if(istype(new_fuel, /obj/item/stack/material/wood) || istype(new_fuel, /obj/item/stack/material/log) ) var/obj/item/stack/F = new_fuel - var/obj/item/stack/S = F.split(1) + var/obj/item/stack/S = F.split(1, user) if(S) S.forceMove(src) to_chat(user, "You add \the [new_fuel] to \the [src].") diff --git a/code/game/objects/structures/crates_lockers/__closet.dm b/code/game/objects/structures/crates_lockers/__closet.dm index ec683887e80..55c9e446bd5 100644 --- a/code/game/objects/structures/crates_lockers/__closet.dm +++ b/code/game/objects/structures/crates_lockers/__closet.dm @@ -4,7 +4,7 @@ icon = 'icons/obj/closets/bases/closet.dmi' icon_state = "base" density = 1 - w_class = ITEMSIZE_HUGE + w_class = WEIGHT_CLASS_HUGE layer = UNDER_JUNK_LAYER armor_type = /datum/armor/object/medium @@ -55,7 +55,7 @@ . = ..() if(mapload && !opened) addtimer(CALLBACK(src, PROC_REF(take_contents)), 0) - PopulateContents() + legacy_spawn_contents() /* if(secure) lockerelectronics = new(src) @@ -101,7 +101,7 @@ /** * The proc that fills the closet with its initial contents. */ -/obj/structure/closet/proc/PopulateContents() +/obj/structure/closet/proc/legacy_spawn_contents() return /obj/structure/closet/examine(mob/user, dist) @@ -302,15 +302,6 @@ M.show_message("\The [src] has been cut apart by [user] with \the [WT].", 3, "You hear welding.", 2) qdel(src) return - if(istype(I, /obj/item/storage/laundry_basket) && I.contents.len) - var/obj/item/storage/laundry_basket/LB = I - var/turf/T = get_turf(src) - for(var/obj/item/I2 in LB.contents) - LB.remove_from_storage(I2, T) - user.visible_message("[user] empties \the [LB] into \the [src].", \ - "You empty \the [LB] into \the [src].", \ - "You hear rustling of clothes.") - return if(isrobot(user)) return if(I.loc != user) // This should stop mounted modules ending up outside the module. diff --git a/code/game/objects/structures/crates_lockers/closets/coffin.dm b/code/game/objects/structures/crates_lockers/closets/coffin.dm index 7f2fff03df9..4c1e44438b8 100644 --- a/code/game/objects/structures/crates_lockers/closets/coffin.dm +++ b/code/game/objects/structures/crates_lockers/closets/coffin.dm @@ -98,15 +98,6 @@ return 0 if(istype(W,/obj/item/tk_grab)) return 0 - if(istype(W, /obj/item/storage/laundry_basket) && W.contents.len) - var/obj/item/storage/laundry_basket/LB = W - var/turf/T = get_turf(src) - for(var/obj/item/I in LB.contents) - LB.remove_from_storage(I, T) - user.visible_message("[user] empties \the [LB] into \the [src].", \ - "You empty \the [LB] into \the [src].", \ - "You hear rustling of clothes.") - return if(isrobot(user)) return if(W.loc != user) // This should stop mounted modules ending up outside the module. diff --git a/code/game/objects/structures/crates_lockers/closets/fireaxe.dm b/code/game/objects/structures/crates_lockers/closets/fireaxe.dm index ea81d91eda7..b622c843d61 100644 --- a/code/game/objects/structures/crates_lockers/closets/fireaxe.dm +++ b/code/game/objects/structures/crates_lockers/closets/fireaxe.dm @@ -13,7 +13,7 @@ var/hitstaken = 0 var/smashed = 0 -/obj/structure/closet/fireaxecabinet/PopulateContents() +/obj/structure/closet/fireaxecabinet/legacy_spawn_contents() . = ..() fireaxe = new /obj/item/material/twohanded/fireaxe(src) diff --git a/code/game/objects/structures/crates_lockers/closets/secure/guncabinet.dm b/code/game/objects/structures/crates_lockers/closets/secure/guncabinet.dm index f830f2ac187..6907b9d21a7 100644 --- a/code/game/objects/structures/crates_lockers/closets/secure/guncabinet.dm +++ b/code/game/objects/structures/crates_lockers/closets/secure/guncabinet.dm @@ -95,7 +95,7 @@ name = "expedition weaponry cabinet" req_one_access = list(ACCESS_GENERAL_EXPLORER,ACCESS_SECURITY_ARMORY) -/obj/structure/closet/secure_closet/guncabinet/excursion/PopulateContents() +/obj/structure/closet/secure_closet/guncabinet/excursion/legacy_spawn_contents() for(var/i in 1 to 4) new /obj/item/gun/energy/frontier/locked(src) for(var/i in 1 to 4) diff --git a/code/game/objects/structures/crates_lockers/closets/secure/personal.dm b/code/game/objects/structures/crates_lockers/closets/secure/personal.dm index ea8bff0dd72..98a2f6ceb3b 100644 --- a/code/game/objects/structures/crates_lockers/closets/secure/personal.dm +++ b/code/game/objects/structures/crates_lockers/closets/secure/personal.dm @@ -5,7 +5,7 @@ req_access = list(ACCESS_COMMAND_LOCKERS) var/registered_name = null -/obj/structure/closet/secure_closet/personal/PopulateContents() +/obj/structure/closet/secure_closet/personal/legacy_spawn_contents() new /obj/item/radio/headset(src) if(prob(50)) new /obj/item/storage/backpack(src) @@ -13,7 +13,7 @@ new /obj/item/storage/backpack/satchel/norm(src) new /obj/item/instrument/piano_synth(src) -/obj/structure/closet/secure_closet/personal/patient/PopulateContents() +/obj/structure/closet/secure_closet/personal/patient/legacy_spawn_contents() new /obj/item/clothing/under/medigown(src) new /obj/item/clothing/under/color/white(src) new /obj/item/clothing/shoes/white(src) diff --git a/code/game/objects/structures/crates_lockers/largecrate.dm b/code/game/objects/structures/crates_lockers/largecrate.dm index 42c17ca0b3b..01f8d9f395c 100644 --- a/code/game/objects/structures/crates_lockers/largecrate.dm +++ b/code/game/objects/structures/crates_lockers/largecrate.dm @@ -14,7 +14,7 @@ . = ..() if(mapload) addtimer(CALLBACK(src, PROC_REF(take_contents)), 0) - PopulateContents() + legacy_spawn_contents() // Closets need to come later because of spawners potentially creating objects during init. return INITIALIZE_HINT_LATELOAD @@ -44,7 +44,7 @@ /** * The proc that fills the closet with its initial contents. */ -/obj/structure/largecrate/proc/PopulateContents() +/obj/structure/largecrate/proc/legacy_spawn_contents() return /* /// Doesnt work but im gonna leave this here commented out in case I broke something with the shameless copy pasta from above -Bloop diff --git a/code/game/objects/structures/door_assembly.dm b/code/game/objects/structures/door_assembly.dm index 7a6ab9c679f..147f5d25ff7 100644 --- a/code/game/objects/structures/door_assembly.dm +++ b/code/game/objects/structures/door_assembly.dm @@ -4,7 +4,7 @@ icon_state = "door_as_0" anchored = 0 density = 1 - w_class = ITEMSIZE_HUGE + w_class = WEIGHT_CLASS_HUGE var/state = 0 base_icon_state = "" var/base_name = "airlock" diff --git a/code/game/objects/structures/girders.dm b/code/game/objects/structures/girders.dm index abf55da59e7..7c9f05c87ac 100644 --- a/code/game/objects/structures/girders.dm +++ b/code/game/objects/structures/girders.dm @@ -5,7 +5,7 @@ anchored = TRUE density = TRUE plane = TURF_PLANE - w_class = ITEMSIZE_HUGE + w_class = WEIGHT_CLASS_HUGE integrity = 200 integrity_max = 200 depth_level = 24 diff --git a/code/game/objects/structures/janicart.dm b/code/game/objects/structures/janicart.dm index 04d956c9b72..a231a24ab6d 100644 --- a/code/game/objects/structures/janicart.dm +++ b/code/game/objects/structures/janicart.dm @@ -292,4 +292,4 @@ GLOBAL_LIST_BOILERPLATE(all_janitorial_carts, /obj/structure/janitorialcart) desc = "A keyring with a small steel key, and a pink fob reading \"Pussy Wagon\"." icon = 'icons/obj/vehicles.dmi' icon_state = "keys" - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY diff --git a/code/game/objects/structures/lattice.dm b/code/game/objects/structures/lattice.dm index 940e7e26c86..497a48fc69f 100644 --- a/code/game/objects/structures/lattice.dm +++ b/code/game/objects/structures/lattice.dm @@ -12,7 +12,7 @@ density = FALSE anchored = TRUE rad_flags = RAD_NO_CONTAMINATE - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL plane = TURF_PLANE diff --git a/code/game/objects/structures/mop_bucket.dm b/code/game/objects/structures/mop_bucket.dm index 51e97f054af..fcee69e2aa4 100644 --- a/code/game/objects/structures/mop_bucket.dm +++ b/code/game/objects/structures/mop_bucket.dm @@ -6,7 +6,7 @@ density = 1 climb_allowed = TRUE depth_level = 8 - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL pressure_resistance = 5 atom_flags = OPENCONTAINER var/amount_per_transfer_from_this = 5 //shit I dunno, adding this so syringes stop runtime erroring. --NeoFite diff --git a/code/game/objects/structures/props/alien_props.dm b/code/game/objects/structures/props/alien_props.dm index 4a1809e68d9..15ec33c15b2 100644 --- a/code/game/objects/structures/props/alien_props.dm +++ b/code/game/objects/structures/props/alien_props.dm @@ -102,7 +102,7 @@ name = "alien object" desc = "You have no idea what this thing does." icon_state = "health" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL var/static/list/possible_states = list("health", "spider", "slime", "emp", "species", "egg", "vent", "mindshock", "viral", "gland") var/static/list/possible_tech = list(TECH_MATERIAL, TECH_ENGINEERING, TECH_PHORON, TECH_POWER, TECH_BIO, TECH_COMBAT, TECH_MAGNET, TECH_DATA) diff --git a/code/game/objects/structures/signs.dm b/code/game/objects/structures/signs.dm index 770a9570646..9af98f5bd4a 100644 --- a/code/game/objects/structures/signs.dm +++ b/code/game/objects/structures/signs.dm @@ -5,7 +5,7 @@ density = 0 plane = OBJ_PLANE layer = ABOVE_JUNK_LAYER - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL /obj/structure/sign/legacy_ex_act(severity) switch(severity) @@ -39,7 +39,7 @@ name = "sign" desc = "" icon = 'icons/obj/decals.dmi' - w_class = ITEMSIZE_NORMAL //big + w_class = WEIGHT_CLASS_NORMAL //big var/sign_state = "" /obj/item/sign/attackby(obj/item/tool as obj, mob/user as mob) //construction diff --git a/code/game/objects/structures/stool_bed_chair_nest/bed.dm b/code/game/objects/structures/stool_bed_chair_nest/bed.dm index 47aba7c48de..f1b0043751f 100644 --- a/code/game/objects/structures/stool_bed_chair_nest/bed.dm +++ b/code/game/objects/structures/stool_bed_chair_nest/bed.dm @@ -256,7 +256,7 @@ icon = 'icons/obj/medical/rollerbed.dmi' icon_state = "folded_rollerbed" slot_flags = SLOT_BACK - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY var/rollertype = /obj/item/roller var/bedtype = /obj/structure/bed/roller drop_sound = 'sound/items/drop/axe.ogg' @@ -286,7 +286,7 @@ name = "advanced roller bed" desc = "A high-tech, compact version of the regular roller bed." icon_state = "folded_rollerbedadv" - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL rollertype = /obj/item/roller/adv bedtype = /obj/structure/bed/roller/adv diff --git a/code/game/objects/structures/stool_bed_chair_nest/chairs.dm b/code/game/objects/structures/stool_bed_chair_nest/chairs.dm index cfd58ac07b2..ba7df78018d 100644 --- a/code/game/objects/structures/stool_bed_chair_nest/chairs.dm +++ b/code/game/objects/structures/stool_bed_chair_nest/chairs.dm @@ -603,7 +603,7 @@ attack_verb = list("bashed", "battered", "chaired") damage_force = 1 throw_force = 3 - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY material_significance = MATERIAL_SIGNIFICANCE_WEAPON_LIGHT attack_sound = 'sound/effects/metal_chair_slam.ogg' pickup_sound = 'sound/items/pickup/axe.ogg' diff --git a/code/game/objects/structures/stool_bed_chair_nest/stools.dm b/code/game/objects/structures/stool_bed_chair_nest/stools.dm index e3a3c525401..326b39e6799 100644 --- a/code/game/objects/structures/stool_bed_chair_nest/stools.dm +++ b/code/game/objects/structures/stool_bed_chair_nest/stools.dm @@ -8,7 +8,7 @@ var/global/list/stool_cache = list() //haha stool icon_state = "stool_preview" //set for the map damage_force = 10 throw_force = 10 - w_class = ITEMSIZE_HUGE + w_class = WEIGHT_CLASS_HUGE material_parts = MATERIAL_DEFAULT_ABSTRACTED material_primary = "base" var/base_icon = "stool_base" diff --git a/code/game/objects/structures/stool_bed_chair_nest/wheelchair.dm b/code/game/objects/structures/stool_bed_chair_nest/wheelchair.dm index f7dd34397fd..bade56588a1 100644 --- a/code/game/objects/structures/stool_bed_chair_nest/wheelchair.dm +++ b/code/game/objects/structures/stool_bed_chair_nest/wheelchair.dm @@ -191,7 +191,7 @@ icon = 'icons/obj/furniture.dmi' icon_state = "wheelchair_folded" item_state = "wheelchair" - w_class = ITEMSIZE_HUGE // Can't be put in backpacks. Oh well. + w_class = WEIGHT_CLASS_HUGE // Can't be put in backpacks. Oh well. /// What we unfold to var/unfolded_type = /obj/structure/bed/chair/wheelchair diff --git a/code/game/objects/structures/tank_dispenser.dm b/code/game/objects/structures/tank_dispenser.dm index 9e8778ce764..dc0ee1691ed 100644 --- a/code/game/objects/structures/tank_dispenser.dm +++ b/code/game/objects/structures/tank_dispenser.dm @@ -5,7 +5,7 @@ icon_state = "dispenser" density = 1 anchored = 1.0 - w_class = ITEMSIZE_HUGE + w_class = WEIGHT_CLASS_HUGE var/oxygentanks = 10 var/phorontanks = 10 var/list/oxytanks = list() //sorry for the similar var names diff --git a/code/game/objects/structures/target_stake.dm b/code/game/objects/structures/target_stake.dm index a0038c1d1c9..ab9122056f7 100644 --- a/code/game/objects/structures/target_stake.dm +++ b/code/game/objects/structures/target_stake.dm @@ -5,7 +5,7 @@ icon = 'icons/obj/objects.dmi' icon_state = "target_stake" density = 1 - w_class = ITEMSIZE_HUGE + w_class = WEIGHT_CLASS_HUGE var/obj/item/target/pinned_target // the current pinned target /obj/structure/target_stake/Moved() diff --git a/code/game/objects/structures/windoor_assembly.dm b/code/game/objects/structures/windoor_assembly.dm index 25e244f5aed..077ea0bde9d 100644 --- a/code/game/objects/structures/windoor_assembly.dm +++ b/code/game/objects/structures/windoor_assembly.dm @@ -17,7 +17,7 @@ density = FALSE pass_flags_self = ATOM_PASS_GLASS dir = NORTH - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL var/obj/item/airlock_electronics/electronics = null var/created_name = null diff --git a/code/game/objects/structures/window.dm b/code/game/objects/structures/window.dm index e793d4fe94b..3df02a0aa8d 100644 --- a/code/game/objects/structures/window.dm +++ b/code/game/objects/structures/window.dm @@ -14,7 +14,7 @@ can_be_unanchored = TRUE pass_flags_self = ATOM_PASS_GLASS CanAtmosPass = ATMOS_PASS_PROC - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL rad_flags = RAD_BLOCK_CONTENTS | RAD_NO_CONTAMINATE plane = OBJ_PLANE diff --git a/code/game/objects/systems/_system.dm b/code/game/objects/systems/_system.dm index c47ad87d80c..bdedfe22a3b 100644 --- a/code/game/objects/systems/_system.dm +++ b/code/game/objects/systems/_system.dm @@ -1,3 +1,6 @@ +//* This file is explicitly licensed under the MIT license. *// +//* Copyright (c) 2023 Citadel Station developers. *// + /** * just the base type of object systems * diff --git a/code/game/objects/systems/cell_slot.dm b/code/game/objects/systems/cell_slot.dm index bf4e4e13880..8fb63ab1bb0 100644 --- a/code/game/objects/systems/cell_slot.dm +++ b/code/game/objects/systems/cell_slot.dm @@ -1,3 +1,6 @@ +//* This file is explicitly licensed under the MIT license. *// +//* Copyright (c) 2023 Citadel Station developers. *// + /** * cell slot */ diff --git a/code/game/objects/systems/storage.dm b/code/game/objects/systems/storage.dm new file mode 100644 index 00000000000..d64294f7f83 --- /dev/null +++ b/code/game/objects/systems/storage.dm @@ -0,0 +1,1740 @@ +//* This file is explicitly licensed under the MIT license. *// +//* Copyright (c) 2023 Citadel Station developers. *// + +/** + * storage systems + * + * stores /item's + */ +/datum/object_system/storage + + //* Access + + /// if set, limit allowable random access to first n items + var/limited_random_access_stack_amount + /// if set, limit allowable random access goes from bottom up, not top down + /// * top down is from end of contents list, bottom up is from start of contents list + var/limited_random_access_stack_bottom_first = FALSE + + //* Actions + + /// the action we have for mode switching gathering + var/datum/action/storage_gather_mode/action_mode_switch + + //* Carry Weight *// + + /// do we propagate weight? + /// use the setter, do not change this manually. + var/weight_propagation = TRUE + /// carry weight in us prior to mitigation + var/weight_cached = 0 + /// carry weight mitigation, static. applied after multiplicative + var/weight_subtract = 0 + /// carry weight mitigation, multiplicative. + var/weight_multiply = 1 + + //* Deconstruction & Integrity + + /// on deconstruct(method), drop on these method flags + var/drop_on_deconstruction_methods = ALL + /// locks don't work if atom is broken + var/lock_nullified_by_atom_break = FALSE + + //* Defense + + /// pass EMPs in + var/pass_emp_inside = TRUE + /// pass EMPs in but weaken them + var/pass_emp_weaken = TRUE + + //* Filters + + /// protected var because we want to cache. + /// set to a list of typepaths to initialize it at New(). + /// * things in this list are the only things that can fit in us + /// * overruled by blacklist + /// * Never, ever edit this list directly. + VAR_PROTECTED/list/insertion_whitelist_typecache + /// protected var because we want to cache. + /// set to a list of typepaths to initialize it at New(). + /// * things in this list can never fit in us, even if in whitelist + /// * Never, ever edit this list directly. + VAR_PROTECTED/list/insertion_blacklist_typecache + /// protected var because we want to cache. + /// set to a list of typepaths to initialize it at New(). + /// * in whitelist mode, things in this list can also be put in + /// * in blacklist mode, things in this list can always be put in regardless + /// * overrules both whitelist and blacklist + /// * Never, ever edit this list directly. + /// this is so overriding things can be easier. + VAR_PROTECTED/list/insertion_allow_typecache + + //* Interaction + + /// insert proposition: 'on', 'in', etc + var/insert_preposition = "in" + + /// allow quick empty at all + var/allow_quick_empty = FALSE + /// allow quick empty via clickdrag + var/allow_quick_empty_via_clickdrag = TRUE + /// allow quick empty via attack self + var/allow_quick_empty_via_attack_self = TRUE + + /// allow inbound mass transfers + var/allow_inbound_mass_transfer = TRUE + /// allow outbound mass transfer + var/allow_outbound_mass_transfer = TRUE + /// allow clickdrag to initiate mass transfer + var/allow_clickdrag_mass_transfer = TRUE + + /// allow mass gather at all + var/allow_mass_gather = FALSE + /// allow mass gather via click + var/allow_mass_gather_via_click = TRUE + /// allow switching mass gathering mode + var/allow_mass_gather_mode_switch = TRUE + /// mass gather mode + var/mass_gather_mode = STORAGE_QUICK_GATHER_COLLECT_ALL + + /// allow opening when clicking from other hand + var/allow_open_via_offhand_click = TRUE + /// allow opening via alt click + var/allow_open_via_context_click = TRUE + /// allow opening when clicking from hand if this is equipped + var/allow_open_via_equipped_click = TRUE + /// allow opening via clickdrag to self + var/allow_open_via_clickdrag_to_self = TRUE + + /// ghosts can always see inside + var/always_allow_observer_view = TRUE + + //* Limits + + /// if set, limit to a certain volume + var/max_combined_volume + /// if set, allow only a certain amount of items + var/max_items + /// if set, max weight class we can hold + var/max_single_weight_class + /// if set, max combined weight class of all containing items we can hold + var/max_combined_weight_class + /// disallow nesting storage items of same or bigger weight class + var/disallow_equal_weight_class_storage_nesting = TRUE + + //* Locking + + /// locked storage can't be accessed, unless show() is called with force + /// however, you can continue viewing even if it's locked. + /// use set_locked() to modify. + var/locked = FALSE + + //* Redirection + + /// When set, we treat this as the real parent object. + /// **Warning**: This is an advanced feature. + /// All this does is make us scan a different atom's contents. + /// It is your responsibility to understand what that means in context of storage, not ours. + /// + /// The storage backend this was inspired from used to have a real / virtual system, + /// where not all storage components were 'real' and could link to a 'concrete' + /// storage component where items are actually stored, so remote storages work. + /// + /// That, however, is too complex and awful, so, we just have a single redirection var now + /// if you mess it up, it is not my fault. ~silicons + /// + /// todo: this needs a setter so we can properly use comsigs to hook the redirected-to object's Exited() + /// todo: we should also hook the thing's Destroy, etc etc. + /// todo: this literally doesn't work due to no Reachability hooks. please implement this properly later via reachability signal hooks. + /// otherwise, using this is going to be GC failure hell from vis contents and rendering. + //! todo: a potential plan is /atom/movable/storage_indirection_holder, + //! which then has back-pointers to storage. + var/atom/dangerously_redirect_contents_calls + + //* Radiation + /// pass clean radiation calls inside? + var/pass_clean_radiation_inside = FALSE + + //* Rendering + + /// update icon on item change + var/update_icon_on_item_change = FALSE + + //* State Caches + + /// cached combined w class + var/tmp/cached_combined_weight_class + /// cached combined volume + var/tmp/cached_combined_volume + + //* Sound Effects + + /// open / access sound passed into playsound + var/sfx_open = "rustle" + /// removal sound passed into playsoud + var/sfx_remove = "rustle" + /// insert sound passed into playsound + var/sfx_insert = "rustle" + + //* UIs *// + + /// lazy list of UIs open; mob ref = list(ui objects) + var/list/ui_by_mob + /// stack stuff by number; defaults to types, please override the requisite proc to implement yours. + var/ui_numerical_mode = FALSE + /// ui force slot mode. + var/ui_force_slot_mode = FALSE + /// show minimum number of slots necessary, expand as needed + /// currently only works for slot mode + var/ui_expand_when_needed = FALSE + /// ui update queued? + // todo: this is only needed because redirection is halfassed. + var/ui_refresh_queued = FALSE + +/datum/object_system/storage/New(obj/parent) + src.parent = parent + // we use typelists to detect if it's been init'd + if(!is_typelist(insertion_whitelist_typecache)) + insertion_whitelist_typecache = cached_typecacheof(insertion_whitelist_typecache) + if(!is_typelist(insertion_blacklist_typecache)) + insertion_blacklist_typecache = cached_typecacheof(insertion_blacklist_typecache) + if(!is_typelist(insertion_allow_typecache)) + insertion_allow_typecache = cached_typecacheof(insertion_allow_typecache) + +/datum/object_system/storage/Destroy() + hide() + QDEL_NULL(action_mode_switch) + //! SHITCODE ALERT + if(istype(dangerously_redirect_contents_calls, /obj/storage_indirection_holder)) + var/obj/storage_indirection_holder/casted = dangerously_redirect_contents_calls + casted.obj_storage = null + qdel(casted) + dangerously_redirect_contents_calls = null + //! AAAA + return ..() + +//* Access *// + +/** + * do not mutate returned list + */ +/datum/object_system/storage/proc/dangerously_accessible_items_immutable(random_access = TRUE) + var/atom/redirection = real_contents_loc() + if(random_access) + if(limited_random_access_stack_amount) + var/contents_length = length(redirection.contents) + if(limited_random_access_stack_bottom_first) + return redirection.contents.Copy(1, min(contents_length + 1, limited_random_access_stack_bottom_first + 1)) + else + return redirection.contents.Copy(max(1, contents_length - limited_random_access_stack_amount + 1), contents_length + 1) + return redirection.contents + +/** + * you may mutate returned list + */ +/datum/object_system/storage/proc/accessible_items(random_access = TRUE) + var/atom/redirection = real_contents_loc() + if(random_access) + if(limited_random_access_stack_amount) + var/contents_length = length(redirection.contents) + if(limited_random_access_stack_bottom_first) + return redirection.contents.Copy(1, min(contents_length + 1, limited_random_access_stack_bottom_first + 1)) + else + return redirection.contents.Copy(max(1, contents_length - limited_random_access_stack_amount + 1), contents_length + 1) + return redirection.contents.Copy() + +/** + * Recursively return all inventory in this or nested storage (without indirection) + */ +/datum/object_system/storage/proc/recursively_return_contents(list/returning = list()) + var/atom/redirection = real_contents_loc() + for(var/obj/item/iterating in redirection) + returning += iterating + iterating.obj_storage?.recursively_return_contents(returning) + return returning + +/** + * iterate through what's considered inside + * + * this is a mutable / copy of a list, so you're free to mess with it. + */ +/datum/object_system/storage/proc/contents() + . = list() + for(var/obj/item/inside in real_contents_loc()) + . += inside + +/datum/object_system/storage/proc/accessible_by_mob(mob/user) + if(IsAdminGhost(user) || (isobserver(user) && always_allow_observer_view)) + return TRUE + return user.CheapReachability(parent) + +/datum/object_system/storage/proc/top_entity_in_contents() + RETURN_TYPE(/atom/movable) + var/atom/indirection = real_contents_loc() + var/amt = length(indirection.contents) + return amt? indirection.contents[amt] : null + +//* Buttons *// + +/datum/object_system/storage/proc/ensure_buttons() + if(!allow_mass_gather || !allow_mass_gather_mode_switch) + return + if(!isnull(action_mode_switch)) + return + action_mode_switch = new(src) + action_mode_switch.button_overlay = parent + action_mode_switch.update_button() + +/datum/object_system/storage/proc/grant_buttons(mob/wearer) + ensure_buttons() + if(allow_mass_gather && allow_mass_gather_mode_switch) + action_mode_switch.grant(wearer) + +/datum/object_system/storage/proc/revoke_buttons(mob/wearer) + action_mode_switch?.remove(wearer) + +/datum/object_system/storage/ui_action_click(datum/action/action, mob/user) + switch_gathering_modes(user) + +//* Caches *// + +/datum/object_system/storage/proc/rebuild_caches() + cached_combined_volume = 0 + cached_combined_weight_class = 0 + weight_cached = 0 + for(var/obj/item/item in real_contents_loc()) + cached_combined_volume += item.get_weight_volume() + cached_combined_weight_class += item.get_weight_class() + weight_cached += item.get_weight() + update_containing_weight() + +/** + * rebuild full state, used when shit explodes, vv use only. this is not totally + * idempotent due to on_enter_storage() not being 100% idempotent, so, this is a debug proc. + */ +/datum/object_system/storage/proc/dangerously_kind_of_rebuild_state() + // incase it wasn't clear enough: **DO NOT USE THIS UNLESS YOU ARE AN ADMIN TRYING TO FIX SOMETHING WITH SDQL.** + PRIVATE_PROC(TRUE) + for(var/obj/item/item in real_contents_loc()) + // assert variables + physically_insert_item(item, no_move = TRUE) + // rebuild the caches we just fucked up + rebuild_caches() + +//* Checks *// + +/datum/object_system/storage/proc/remaining_volume() + return isnull(max_combined_volume)? INFINITY : (max_combined_volume - cached_combined_volume) + +/datum/object_system/storage/proc/remaining_weight_class() + return isnull(max_combined_weight_class)? INFINITY : (max_combined_weight_class - cached_combined_weight_class) + +/datum/object_system/storage/proc/remaining_items() + var/atom/indirection = real_contents_loc() + return isnull(max_items)? INFINITY : (max_items - length(indirection.contents)) + +//* Carry Weight *// + +/datum/object_system/storage/proc/get_containing_weight() + return max(0, weight_cached * weight_multiply - weight_subtract) + +/datum/object_system/storage/proc/update_containing_weight() + if(!isitem(parent)) + return + var/obj/item/item = parent + item.update_weight() + +/datum/object_system/storage/proc/set_weight_propagation(value) + if(value == weight_propagation) + return + weight_propagation = value + if(!weight_propagation) + weight_cached = 0 + else + rebuild_caches() + update_containing_weight() + +//* Hooks *// + +/datum/object_system/storage/proc/on_pickup(mob/user) + grant_buttons(user) + +/datum/object_system/storage/proc/on_dropped(mob/user) + revoke_buttons(user) + +/** + * Called by our object when an item exits us + */ +/datum/object_system/storage/proc/on_item_exited(obj/item/exiting) + if(!(exiting.item_flags & ITEM_IN_STORAGE)) + return + physically_remove_item(exiting, no_move = TRUE, from_hook = TRUE) + ui_queue_refresh() + +/** + * Called by our object when an item enters us + */ +/datum/object_system/storage/proc/on_item_entered(obj/item/entering) + if(entering.item_flags & ITEM_IN_STORAGE) + return + physically_insert_item(entering, no_move = TRUE, from_hook = TRUE) + ui_queue_refresh() + +/datum/object_system/storage/proc/on_contents_weight_class_change(obj/item/item, old_weight_class, new_weight_class) + if(dangerously_redirect_contents_calls && item.loc != dangerously_redirect_contents_calls) + return + cached_combined_weight_class += (new_weight_class - old_weight_class) + if(isnull(item.weight_volume)) + on_contents_weight_volume_change(item, global.w_class_to_volume[old_weight_class], global.w_class_to_volume[new_weight_class]) + +/datum/object_system/storage/proc/on_contents_weight_volume_change(obj/item/item, old_weight_volume, new_weight_volume) + if(dangerously_redirect_contents_calls && item.loc != dangerously_redirect_contents_calls) + return + cached_combined_volume += (new_weight_volume - old_weight_volume) + +/datum/object_system/storage/proc/on_contents_weight_change(obj/item/item, old_weight, new_weight) + if(dangerously_redirect_contents_calls && item.loc != dangerously_redirect_contents_calls) + return + weight_cached += (new_weight - old_weight) + update_containing_weight() + +/datum/object_system/storage/proc/on_contents_item_new(obj/item/item) + if(dangerously_redirect_contents_calls && item.loc != dangerously_redirect_contents_calls) + return + if(item.item_flags & ITEM_IN_STORAGE) // somehow + return + physically_insert_item(item, no_move = TRUE) + ui_queue_refresh() + +//* Filters *// + +/datum/object_system/storage/proc/check_insertion_filters(obj/item/candidate) + if(insertion_allow_typecache?[candidate.type]) + return TRUE + if(!isnull(insertion_whitelist_typecache) && !insertion_whitelist_typecache?[candidate.type]) + return FALSE + if(insertion_blacklist_typecache?[candidate.type]) + return FALSE + return TRUE + +/datum/object_system/storage/proc/set_insertion_whitelist(list/types) + if(!length(types)) + src.insertion_whitelist_typecache = null + return + src.insertion_whitelist_typecache = cached_typecacheof(types) + +/datum/object_system/storage/proc/set_insertion_blacklist(list/types) + if(!length(types)) + src.insertion_blacklist_typecache = null + return + src.insertion_blacklist_typecache = cached_typecacheof(types) + +/datum/object_system/storage/proc/set_insertion_allow(list/types) + if(!length(types)) + src.insertion_allow_typecache = null + return + src.insertion_allow_typecache = cached_typecacheof(types) + +//* Interaction *// + +/** + * returns TRUE if we should interrupt an open + */ +/datum/object_system/storage/proc/check_on_found_hooks(datum/event_args/actor/actor) + for(var/obj/item/thing in real_contents_loc()) + if(thing.on_containing_storage_opening(actor, src)) + return TRUE + return FALSE + +//* Insertion & Removal *// + +/** + * @return TRUE / FALSE; if true, caller should stop clickchain. + */ +/datum/object_system/storage/proc/auto_handle_interacted_insertion(obj/item/inserting, datum/event_args/actor/actor, silent, suppressed) + if(is_locked(actor.performer)) + actor.chat_feedback( + msg = SPAN_WARNING("[parent] is locked."), + target = parent, + ) + return TRUE + if(!actor.performer.Reachability(parent)) + return TRUE + if(!try_insert(inserting, actor, silent, suppressed)) + return TRUE + // sound + // todo: put this in interacted_insert()..? + if(!suppressed && !isnull(actor)) + if(sfx_insert) + // todo: variable sound + playsound(actor.performer, sfx_insert, 50, 1, -5) + actor.visible_feedback( + target = parent, + range = MESSAGE_RANGE_INVENTORY_SOFT, + visible = "[actor.performer] puts [inserting] into [parent].", + visible_self = "You put [inserting] into [parent]", + ) + return TRUE + +/datum/object_system/storage/proc/try_insert(obj/item/inserting, datum/event_args/actor/actor, silent, suppressed, no_update) + if(!can_be_inserted(inserting, actor, silent)) + return FALSE + // point of no return + if(actor && (inserting.worn_mob() == actor.performer && !actor.performer.temporarily_remove_from_inventory(inserting, user = actor.performer))) + if(!silent) + actor?.chat_feedback( + msg = SPAN_WARNING("[inserting] is stuck to your hand / body!"), + target = parent, + ) + return FALSE + // point of no return (real) + return insert(inserting, actor, suppressed, no_update) + +/datum/object_system/storage/proc/can_be_inserted(obj/item/inserting, datum/event_args/actor/actor, silent) + if(!check_insertion_filters(inserting)) + if(!silent) + actor?.chat_feedback( + msg = SPAN_WARNING("[parent] can't hold [inserting]!"), + target = parent, + ) + return FALSE + var/why_insufficient_space = why_failed_insertion_limits(inserting) + if(why_insufficient_space) + if(!silent) + actor?.chat_feedback( + msg = SPAN_WARNING("[parent] can't fit [inserting]! ([why_insufficient_space])"), + target = parent, + ) + return FALSE + return TRUE + +/datum/object_system/storage/proc/insert(obj/item/inserting, datum/event_args/actor/actor, suppressed, no_update, no_move) + physically_insert_item(inserting, no_move) + + if(!no_update) + if(update_icon_on_item_change) + update_icon() + refresh() + + return TRUE + +/** + * handle moving an item in + * + * we can assume this proc will do potentially literally anything with the item, so.. + */ +/datum/object_system/storage/proc/physically_insert_item(obj/item/inserting, no_move, from_hook) + inserting.item_flags |= ITEM_IN_STORAGE + if(!no_move) + inserting.forceMove(real_contents_loc()) + inserting.vis_flags |= VIS_INHERIT_LAYER | VIS_INHERIT_PLANE + inserting.reset_pixel_offsets() + inserting.on_enter_storage(src) + if(weight_propagation) + var/inserting_weight = inserting.get_weight() + if(inserting_weight) + weight_cached += inserting_weight + update_containing_weight() + cached_combined_volume += inserting.get_weight_volume() + cached_combined_weight_class += inserting.get_weight_class() + +/** + * @return TRUE / FALSE + */ +/datum/object_system/storage/proc/auto_handle_interacted_removal(obj/item/removing, datum/event_args/actor/actor, silent, suppressed, put_in_hands) + if(is_locked(actor.performer)) + actor.chat_feedback( + msg = SPAN_WARNING("[parent] is locked."), + target = parent, + ) + return TRUE + if(!actor.performer.Reachability(parent)) + return TRUE + if(!try_remove(removing, actor.performer, actor, silent, suppressed)) + return TRUE + if(put_in_hands) + actor.performer.put_in_hands_or_drop(removing) + else + removing.forceMove(actor.performer.drop_location()) + // todo: put this in interacted_insert()..? + if(!suppressed && !isnull(actor)) + if(sfx_remove) + // todo: variable sound + playsound(actor.performer, sfx_remove, 50, 1, -5) + actor.visible_feedback( + target = parent, + range = MESSAGE_RANGE_INVENTORY_SOFT, + visible = "[actor.performer] takes [removing] out of [parent].", + visible_self = "You take [removing] out of [parent]", + ) + return TRUE + +/datum/object_system/storage/proc/try_remove(obj/item/removing, atom/to_where, datum/event_args/actor/actor, silent, suppressed, no_update) + return remove(removing, to_where, actor, suppressed, no_update) + +/datum/object_system/storage/proc/can_be_removed(obj/item/removing, atom/to_where, datum/event_args/actor/actor, silent) + return TRUE + +/** + * remove item from self + */ +/datum/object_system/storage/proc/remove(obj/item/removing, atom/to_where, datum/event_args/actor/actor, suppressed, no_update, no_move) + physically_remove_item(removing, to_where, no_move) + + if(!no_update) + if(update_icon_on_item_change) + update_icon() + refresh() + + return TRUE + +/** + * handle moving an item out + * + * we can assume this proc will do potentially literally anything with the item, so.. + */ +/datum/object_system/storage/proc/physically_remove_item(obj/item/removing, atom/to_where, no_move, from_hook) + removing.item_flags &= ~ITEM_IN_STORAGE + if(!no_move) + if(to_where == null) + removing.moveToNullspace() + else + removing.forceMove(to_where) + removing.vis_flags = (removing.vis_flags & ~(VIS_INHERIT_LAYER | VIS_INHERIT_LAYER)) | (initial(removing.vis_flags) & (VIS_INHERIT_LAYER | VIS_INHERIT_PLANE)) + removing.on_exit_storage(src) + // we might have set maptext in render_numerical_display + removing.maptext = null + if(weight_propagation) + var/removing_weight = removing.get_weight() + if(removing_weight) + weight_cached += removing_weight + update_containing_weight() + cached_combined_volume -= removing.get_weight_volume() + cached_combined_weight_class -= removing.get_weight_class() + +//* Limits *// + +/datum/object_system/storage/proc/check_insertion_limits(obj/item/candidate) + var/atom/movable/indirection = real_contents_loc() + if(!isnull(max_items) && length(indirection.contents) > max_items) + return FALSE + if(!isnull(max_combined_volume) && (cached_combined_volume + candidate.get_weight_volume() > max_combined_volume)) + return FALSE + var/their_weight_class = candidate.get_weight_class() + if(!isnull(max_single_weight_class) && (their_weight_class > max_single_weight_class)) + return FALSE + if(!isnull(max_combined_weight_class) && (cached_combined_weight_class + their_weight_class > max_combined_weight_class)) + return FALSE + if(candidate.obj_storage && (candidate.w_class >= parent.w_class) && disallow_equal_weight_class_storage_nesting) + return FALSE + return TRUE + +/datum/object_system/storage/proc/why_failed_insertion_limits(obj/item/candidate) + var/atom/movable/indirection = real_contents_loc() + if(!isnull(max_items) && length(indirection.contents) > max_items) + return "too many items" + if(!isnull(max_combined_volume) && (cached_combined_volume + candidate.get_weight_volume() > max_combined_volume)) + return "insufficient volume" + var/their_weight_class = candidate.get_weight_class() + if(!isnull(max_single_weight_class) && (their_weight_class > max_single_weight_class)) + return "too large" + if(!isnull(max_combined_weight_class) && (cached_combined_weight_class + their_weight_class > max_combined_weight_class)) + return "insufficient space" + if(candidate.obj_storage && (candidate.w_class >= parent.w_class) && disallow_equal_weight_class_storage_nesting) + return "can't nest storage" + return null + +/** + * generally a bad idea to call, tbh. + * + * uses max single weight class + * uses combined volume + * + * can use type whitelist + * if type_whitelist is FALSE, this just wipes all type whitelists. + */ +/datum/object_system/storage/proc/fit_to_contents(type_whitelist = FALSE, no_shrink = FALSE) + var/scanned_max_single_weight_class = WEIGHT_CLASS_TINY + var/scanned_max_combined_volume = 0 + + if(!no_shrink) + max_single_weight_class = scanned_max_single_weight_class + max_combined_volume = scanned_max_combined_volume + + var/list/types = list() + for(var/obj/item/item in real_contents_loc()) + if(type_whitelist) + types |= item.type + scanned_max_single_weight_class = max(max_single_weight_class, item.w_class) + scanned_max_combined_volume += item.get_weight_volume() + + max_single_weight_class = max(max_single_weight_class, scanned_max_single_weight_class) + max_combined_volume = max(max_combined_volume, scanned_max_combined_volume) + + set_insertion_whitelist(type_whitelist? types : null) + set_insertion_blacklist(null) + set_insertion_allow(null) + +//* Locking *// + +/** + * @params + * * accessing - the mob physically trying to reach in + */ +/datum/object_system/storage/proc/is_locked(mob/accessing) + return locked && (!lock_nullified_by_atom_break || !(parent.atom_flags & ATOM_BROKEN)) + +/datum/object_system/storage/proc/set_locked(value) + if(locked == value) + return + locked = value + if(locked) + hide() + +//* Quickdraw *// + +// todo: quickdraw +/* +/datum/component/storage/proc/on_alt_click(datum/source, mob/user) + if(!isliving(user) || !user.CanReach(parent)) + return + if(check_locked(source, user, TRUE)) + return TRUE + + var/atom/A = parent + if(!quickdraw) + A.add_fingerprint(user) + user_show_to_mob(user, trigger_on_found = TRUE) + if(rustle_sound) + playsound(A, "rustle", 50, 1, -5) + return TRUE + + if(user.can_hold_items() && !user.incapacitated()) + var/obj/item/I = locate() in real_location() + if(!I) + return + A.add_fingerprint(user) + remove_from_storage(I, get_turf(user)) + if(!user.put_in_hands(I)) + user.visible_message("[user] fumbles with the [parent], letting [I] fall on the floor.", \ + "You fumble with [parent], letting [I] fall on the floor.") + return TRUE + user.visible_message("[user] draws [I] from [parent]!", "You draw [I] from [parent].") + return TRUE +*/ + +//* Redirection *// + +/datum/object_system/storage/proc/real_contents_loc() + return dangerously_redirect_contents_calls || parent + +//* Rendering - Object *// + +/datum/object_system/storage/proc/update_icon() + parent.update_icon() + action_mode_switch?.button_overlay = parent + dangerously_redirect_contents_calls?.update_icon() + +//* Transfer *// + +/datum/object_system/storage/proc/switch_gathering_modes(mob/user) + switch(mass_gather_mode) + if(STORAGE_QUICK_GATHER_COLLECT_ONE) + mass_gather_mode = STORAGE_QUICK_GATHER_COLLECT_ALL + to_chat(user, SPAN_NOTICE("[parent] is now collecting all items from a tile.")) + if(STORAGE_QUICK_GATHER_COLLECT_ALL) + mass_gather_mode = STORAGE_QUICK_GATHER_COLLECT_SAME + to_chat(user, SPAN_NOTICE("[parent] is now collecting all items of a given type from a tile.")) + if(STORAGE_QUICK_GATHER_COLLECT_SAME) + mass_gather_mode = STORAGE_QUICK_GATHER_COLLECT_ONE + to_chat(user, SPAN_NOTICE("[parent] is now collecting one item at a time.")) + +/** + * Actor is mandatory. + */ +/datum/object_system/storage/proc/auto_handle_interacted_mass_transfer(datum/event_args/actor/actor, datum/object_system/storage/to_storage) + if(to_storage == src) + return FALSE + if(is_locked(actor.performer)) + actor?.chat_feedback( + msg = SPAN_WARNING("[parent] is locked."), + target = parent, + ) + return TRUE + parent.add_fingerprint(actor.performer) + interacted_mass_transfer(actor, to_storage) + return TRUE + +/** + * Actor is mandatory. + */ +/datum/object_system/storage/proc/auto_handle_interacted_mass_pickup(datum/event_args/actor/actor, atom/from_where) + if(is_locked(actor.performer)) + actor?.chat_feedback( + msg = SPAN_WARNING("[parent] is locked."), + target = parent, + ) + return TRUE + parent.add_fingerprint(actor.performer) + interacted_mass_pickup(actor, from_where) + return TRUE + +/** + * Actor is mandatory. + */ +/datum/object_system/storage/proc/auto_handle_interacted_mass_dumping(datum/event_args/actor/actor, atom/to_where) + if(is_locked(actor.performer)) + actor?.chat_feedback( + msg = SPAN_WARNING("[parent] is locked."), + target = parent, + ) + return TRUE + parent.add_fingerprint(actor.performer) + interacted_mass_dumping(actor, to_where) + return TRUE + +/** + * Actor is mandatory. + */ +/datum/object_system/storage/proc/interacted_mass_transfer(datum/event_args/actor/actor, datum/object_system/storage/to_storage, silent, suppressed) + var/list/obj/item/transferring = list() + for(var/obj/item/item in real_contents_loc()) + transferring += item + + if(!length(transferring)) + if(!silent) + actor.chat_feedback( + msg = "There's nothing to transfer out of [parent].", + target = src, + ) + return + if(!silent) + actor.chat_feedback( + msg = "You start transferring the contents of [parent] to [to_storage.parent]", + target = src, + ) + if(!suppressed && sfx_insert) + playsound(parent, sfx_insert, 50, TRUE, -4) + + var/list/rejections = list() + while(do_after(actor.performer, 0.5 SECONDS, parent, NONE, MOBILITY_CAN_STORAGE | MOBILITY_CAN_PICKUP)) + if(!mass_storage_transfer_handler(transferring, to_storage, actor, rejections)) + break + stoplag(1) + + if(!silent) + if(!length(rejections)) + actor.chat_feedback( + msg = "You finish transferring everything out from [parent].", + target = src, + ) + else + actor.chat_feedback( + msg = "You fail to transfer some things out of [parent].", + target = src, + ) + + refresh() + +/** + * Actor is mandatory. + */ +/datum/object_system/storage/proc/interacted_mass_pickup(datum/event_args/actor/actor, atom/from_loc, silent, suppressed) + var/list/transferring + switch(mass_gather_mode) + if(STORAGE_QUICK_GATHER_COLLECT_ONE) + if(!isitem(from_loc)) + return + try_insert(from_loc, actor) + return + if(STORAGE_QUICK_GATHER_COLLECT_ALL) + transferring = list() + from_loc = get_turf(from_loc) + for(var/obj/item/item in from_loc) + transferring += item + if(STORAGE_QUICK_GATHER_COLLECT_SAME) + transferring = list() + from_loc = get_turf(from_loc) + for(var/obj/item/item in from_loc) + if(item.type != from_loc.type) + continue + transferring += item + + if(!length(transferring)) + return + if(!silent) + actor.chat_feedback( + msg = "You start gathering things from [from_loc] with [parent].", + target = src, + ) + if(!suppressed && sfx_insert) + playsound(parent, sfx_insert, 50, TRUE, -4) + + var/list/rejections = list() + while(do_after(actor.performer, 0.5 SECONDS, parent, NONE, MOBILITY_CAN_STORAGE | MOBILITY_CAN_PICKUP)) + if(!mass_storage_pickup_handler(transferring, from_loc, actor, rejections)) + break + stoplag(1) + + ui_queue_refresh() + +/** + * Actor is mandatory. + */ +/datum/object_system/storage/proc/interacted_mass_dumping(datum/event_args/actor/actor, atom/to_loc, silent, suppressed) + var/list/obj/item/transferring = mass_dumping_query() + + if(!length(transferring)) + if(!silent) + actor.chat_feedback( + msg = "There's nothing to dump out of [parent].", + target = src, + ) + return + if(!silent) + actor.chat_feedback( + msg = "You start dumping out the contents of [parent].", + target = src, + ) + if(!suppressed && sfx_insert) + playsound(parent, sfx_remove, 50, TRUE, -4) + + var/list/rejections = list() + while(do_after(actor.performer, 0.5 SECONDS, parent, NONE, MOBILITY_CAN_STORAGE | MOBILITY_CAN_PICKUP)) + var/keep_going = mass_storage_dumping_handler(transferring, to_loc, actor, rejections) + if(!keep_going) + break + + if(!silent) + if(length(rejections)) + actor.chat_feedback( + msg = "You fail to dump some things out of [parent].", + target = src, + ) + else if(!length(transferring)) + actor.chat_feedback( + msg = "You finish dumping everything out of [parent].", + target = src, + ) + + ui_queue_refresh() + +/** + * handles mass storage transfers + * + * this will CHECK_TICK. + * + * progressbar should be initialized with goal value being the total item count. + * + * @params + * * things - things to transfer + * * to_storage - destination storage + * * progress - (optional) progressbar to update + * * actor - (optional) person doing it + * * rejections_out - (optional) rejected items + * * trigger_on_found - trigger on found? + * + * This proc does not update / refresh UIs, please do that manually when using this proc. + * + * @return TRUE if not done, FALSE if done. + */ +/datum/object_system/storage/proc/mass_storage_transfer_handler(list/obj/item/things, datum/object_system/storage/to_storage, datum/event_args/actor/actor, list/obj/item/rejections_out = list(), trigger_on_found = TRUE) + if(to_storage == src) + return FALSE + var/atom/indirection_from = real_contents_loc() + var/atom/indirection_to = to_storage.real_contents_loc() + var/i + . = TRUE + for(i in length(things) to 1 step -1) + var/obj/item/transferring = things[i] + // make sure they're still there + if(transferring.loc != indirection_from) + continue + // handle on open hooks if needed + if(trigger_on_found && actor?.performer.active_storage != src && transferring.on_containing_storage_opening(actor, src)) + . = FALSE + break + // see if receiver can accept it + if(!to_storage.can_be_inserted(transferring, actor, TRUE)) + rejections_out += transferring + continue + // see if we can remove it + if(!can_be_removed(transferring, indirection_to, actor, TRUE)) + rejections_out += transferring + continue + // transfer; the on enter/exit hooks will handle the rest (awful but whatever!) + remove(transferring, indirection_to, actor, TRUE, TRUE) + // stop if overtaxed + if(TICK_CHECK) + break + things.Cut(i, length(things) + 1) + return . && length(things) + +/** + * handles mass item pickups + * + * this will CHECK_TICK + * + * progressbar should be initialized with goal value being the total item count. + * + * @params + * * things - things to transfer + * * from_loc - source loc + * * progress - (optional) progressbar to update + * * actor - (optional) person doing it + * * rejections_out - (optional) list to add rejected items to + * + * This proc does not update / refresh UIs, please do that manually when using this proc. + * + * @return TRUE if not done, FALSE if done + */ +/datum/object_system/storage/proc/mass_storage_pickup_handler(list/obj/item/things, atom/from_loc, datum/event_args/actor/actor, list/rejections_out = list()) + var/i + . = TRUE + for(i in length(things) to 1 step -1) + var/obj/item/transferring = things[i] + // make sure they're still there + if(transferring.loc != from_loc) + continue + // see if we can accept it + if(!try_insert(transferring, actor, TRUE, TRUE, TRUE)) + rejections_out += transferring + continue + // stop if overtaxed + if(TICK_CHECK) + break + things.Cut(i, length(things) + 1) + return . && length(things) + +/** + * handles mass item dumps + * + * this will CHECK_TICK + * + * progressbar should be initialized with goal value being the total item count. + * + * @params + * * things - things to transfer + * * to_loc - where to transfer + * * progress - (optional) progressbar to update + * * actor - (optional) person doing it + * * rejections_out - (optional) list to add rejected items to + * * trigger_on_found - trigger on found? + * + * This proc does not update / refresh UIs, please do that manually when using this proc. + * + * @return TRUE if not done, FALSE if done + */ +/datum/object_system/storage/proc/mass_storage_dumping_handler(list/obj/item/things, atom/to_loc, datum/event_args/actor/actor, list/rejections_out = list(), trigger_on_found = TRUE) + var/atom/indirection = real_contents_loc() + var/i + . = TRUE + for(i in length(things) to 1 step -1) + var/obj/item/transferring = things[i] + // make sure they're still there + if(transferring.loc != indirection) + continue + // handle on open hooks if needed + if(trigger_on_found && actor?.performer.active_storage != src && transferring.on_containing_storage_opening(actor, src)) + . = FALSE + break + // see if we can remove it + if(!try_remove(transferring, to_loc, actor, TRUE, TRUE, TRUE)) + rejections_out += transferring + continue + // stop if overtaxed + if(TICK_CHECK) + break + things.Cut(i, length(things) + 1) + return . && length(things) + +/** + * what to drop + */ +/datum/object_system/storage/proc/mass_dumping_query() + var/atom/indirection = real_contents_loc() + // holy shit do a copy please + return indirection.contents.Copy() + +/** + * drop everything at + */ +/datum/object_system/storage/proc/drop_everything_at(atom/where) + for(var/obj/item/I in real_contents_loc()) + I.forceMove(where) + +//* UI *// + +/** + * @return TRUE if we did something (to interrupt clickchain) + */ +/datum/object_system/storage/proc/auto_handle_interacted_open(datum/event_args/actor/actor, force, suppressed) + if(!force && is_locked(actor.performer)) + actor.chat_feedback( + msg = SPAN_WARNING("[parent] is locked."), + target = parent, + ) + return TRUE + if(check_on_found_hooks(actor)) + return TRUE + if(!suppressed && !isnull(actor) && sfx_open) + // todo: variable sound + playsound(actor.performer, sfx_open, 50, 1, -5) + // todo: jiggle animation + show(actor.initiator) + return TRUE + +/datum/object_system/storage/proc/show(mob/viewer) + if(viewer.active_storage == src) + refresh_ui(viewer) + return TRUE + + viewer.active_storage?.hide(viewer) + viewer.active_storage = src + + create_ui(viewer) + + parent.object_storage_opened(viewer) + +/** + * if user not specified, it is 'all'. + */ +/datum/object_system/storage/proc/hide(mob/viewer) + if(isnull(viewer)) + for(var/mob/iterating as anything in ui_by_mob) + hide(iterating) + return + + if(viewer.active_storage != src) + stack_trace("viewer didn't have active storage set right, wtf?") + else + viewer.active_storage = null + + cleanup_ui(viewer) + + parent.object_storage_closed(viewer) + +/** + * Hooked into obj/Moved(). + */ +/datum/object_system/storage/proc/on_parent_moved(atom/old_loc, forced) + reconsider_mob_viewable() + +/datum/object_system/storage/proc/refresh(mob/viewer) + ui_refresh_queued = FALSE + if(isnull(viewer)) + for(var/mob/iterating as anything in ui_by_mob) + refresh_ui(iterating) + return + refresh_ui(viewer) + +/** + * Do not modify the returned appearances; they might be real instances! + * + * @return list(/datum/storage_numerical_display instance, ...) + */ +/datum/object_system/storage/proc/render_numerical_display(list/obj/item/for_items) + RETURN_TYPE(/list) + . = list() + var/list/types = list() + for(var/obj/item/iterating in (for_items || real_contents_loc())) + var/datum/storage_numerical_display/collation + if(isnull(types[iterating.type])) + collation = new + collation.rendered_object = iterating + collation.amount = 0 + . += collation + types[iterating.type] = collation + collation = types[iterating.type] + ++collation.amount + tim_sort(., /proc/cmp_storage_numerical_displays_name_asc) + +/datum/object_system/storage/proc/reconsider_mob_viewable(mob/user) + if(isnull(user)) + for(var/mob/viewer as anything in ui_by_mob) + reconsider_mob_viewable(viewer) + return + if(accessible_by_mob(user)) + return + hide(user) + +/datum/object_system/storage/proc/ui_queue_refresh() + if(ui_refresh_queued) + return + ui_refresh_queued = TRUE + addtimer(CALLBACK(src, PROC_REF(refresh)), 0) + +/datum/object_system/storage/proc/cleanup_ui(mob/user) + var/list/objects = ui_by_mob[user] + user.client?.screen -= objects + QDEL_LIST(objects) + ui_by_mob -= user + +/** + * we assume that the display style didn't change. + */ +/datum/object_system/storage/proc/refresh_ui(mob/user) + // for now, we just do a full redraw. + cleanup_ui(user) + create_ui(user) + +/datum/object_system/storage/proc/create_ui(mob/user) + var/uses_volumetric_ui = uses_volumetric_ui() + var/list/atom/movable/screen/storage/objects + if(uses_volumetric_ui) + objects += create_ui_volumetric_mode(user) + else + objects += create_ui_slot_mode(user) + LAZYINITLIST(ui_by_mob) + ui_by_mob[user] = objects + user.client?.screen += objects + +/** + * this should not rely on uses_numerical_ui() + */ +/datum/object_system/storage/proc/uses_volumetric_ui() + return max_combined_volume && !ui_numerical_mode && !ui_force_slot_mode + +/** + * this should not rely on uses_volumetric_ui() + */ +/datum/object_system/storage/proc/uses_numerical_ui() + return ui_numerical_mode + +/datum/object_system/storage/proc/create_ui_slot_mode(mob/user) + . = list() + var/atom/movable/screen/storage/closer/closer = new + . += closer + var/atom/movable/screen/storage/panel/slot/boxes/boxes = new + . += boxes + // todo: clientless support is awful here + var/list/decoded_view = decode_view_size(user.client?.view || world.view) + var/view_x = decoded_view[1] + // clamp to max items if needed + var/rendering_width = STORAGE_UI_TILES_FOR_SCREEN_VIEW_X(view_x) + if(max_items) + rendering_width = min(max_items, rendering_width) + // see if we need to process numerical display + var/list/datum/storage_numerical_display/numerical_rendered = uses_numerical_ui()? render_numerical_display() : null + // process indirection + var/atom/indirection = real_contents_loc() + // if we have expand when needed, only show 1 more than the actual amount. + if(ui_expand_when_needed) + rendering_width = min(rendering_width, (isnull(numerical_rendered)? length(indirection.contents) : length(numerical_rendered)) + 1) + // compute count and rows + var/item_count = isnull(numerical_rendered)? length(indirection.contents) : length(numerical_rendered) + var/rows_needed = ROUND_UP(item_count / rendering_width) || 1 + // prepare iteration + var/current_row = 1 + var/current_column = 1 + // render boxes + boxes.screen_loc = "LEFT+[STORAGE_UI_START_TILE_X]:[STORAGE_UI_START_PIXEL_X],BOTTOM+[STORAGE_UI_START_TILE_Y]:[STORAGE_UI_START_PIXEL_Y] to \ + LEFT+[STORAGE_UI_START_TILE_X + rendering_width - 1]:[STORAGE_UI_START_PIXEL_X],BOTTOM+[STORAGE_UI_START_TILE_Y + rows_needed - 1]:[STORAGE_UI_START_PIXEL_Y]" + // render closer + closer.screen_loc = "LEFT+[STORAGE_UI_START_TILE_X + rendering_width]:[STORAGE_UI_START_PIXEL_X],BOTTOM+[STORAGE_UI_START_TILE_Y]:[STORAGE_UI_START_PIXEL_Y]" + // render items + if(islist(numerical_rendered)) + for(var/datum/storage_numerical_display/display as anything in numerical_rendered) + var/atom/movable/screen/storage/item/slot/renderer = new(null, display.rendered_object) + . += renderer + // render amount + display.rendered_object.maptext = MAPTEXT("[display.amount]") + // position + renderer.screen_loc = "LEFT+[STORAGE_UI_START_TILE_X + current_column - 1]:[STORAGE_UI_START_PIXEL_X],\ + BOTTOM+[STORAGE_UI_START_TILE_Y + current_row - 1]:[STORAGE_UI_START_PIXEL_Y]" + // advance + ++current_column + if(current_column > rendering_width) + current_column = 1 + ++current_row + if(current_row > STORAGE_UI_MAX_ROWS) + break + else + for(var/obj/item/item in indirection) + var/atom/movable/screen/storage/item/slot/renderer = new(null, item) + . += renderer + // position + renderer.screen_loc = "LEFT+[STORAGE_UI_START_TILE_X + current_column - 1]:[STORAGE_UI_START_PIXEL_X],\ + BOTTOM+[STORAGE_UI_START_TILE_Y + current_row - 1]:[STORAGE_UI_START_PIXEL_Y]" + // advance + ++current_column + if(current_column > rendering_width) + current_column = 1 + ++current_row + if(current_row > STORAGE_UI_MAX_ROWS) + break + +/datum/object_system/storage/proc/create_ui_volumetric_mode(mob/user) + // guard against divide-by-0's + if(!max_combined_volume) + return create_ui_slot_mode(user) + . = list() + + //? resolve view and rendering + // todo: clientless support is awful here + + // resolve view + var/list/decoded_view = decode_view_size(user.client?.view || world.view) + var/view_x = decoded_view[1] + // setup initial width + var/rendering_width = STORAGE_UI_TILES_FOR_SCREEN_VIEW_X(view_x) + var/rendering_width_in_pixels = rendering_width * 32 + // effective max scales up if we're overrunning + var/effective_max_volume = max(max_combined_volume, cached_combined_volume) + // scale down width to volume + rendering_width_in_pixels = min(rendering_width_in_pixels, effective_max_volume * VOLUMETRIC_STORAGE_STANDARD_PIXEL_RATIO) + + //? resolve items + + // resolve indirection + var/atom/indirection = real_contents_loc() + + //? prepare iteration + + // max x used in all rows, including padding. + var/maximum_used_width = 0 + // current consumed x of row + var/iteration_used_width = 0 + // current consumed item padding of row + var/iteration_used_padding = 0 + // current row + var/current_row = 1 + // safety + var/safety = VOLUMETRIC_STORAGE_MAX_ITEMS + // iterate and render + for(var/obj/item/item in indirection) + // check safety + safety-- + if(safety <= 0) + to_chat(user, SPAN_WARNING("Some items in this storage have been truncated for performance reasons.")) + break + + // check row + if(iteration_used_width >= rendering_width_in_pixels) + // check if we're out of rows + if(current_row >= STORAGE_UI_MAX_ROWS) + to_chat(user, SPAN_WARNING("Some items in this storage have been truncated for performance reasons.")) + break + // make another row + current_row++ + // register to maximum used width + // we add the edge padding for both edges, but remove the last item's padding. + maximum_used_width = max(maximum_used_width, iteration_used_width + iteration_used_padding + VOLUMETRIC_STORAGE_EDGE_PADDING * 2 - VOLUMETRIC_STORAGE_ITEM_PADDING) + // reset vars + iteration_used_padding = 0 + iteration_used_width = 0 + + // render the item + var/atom/movable/screen/storage/item/volumetric/renderer = new(null, item) + // scale it as necessary, to nearest multiple of 2 + var/used_pixels = max(VOLUMETRIC_STORAGE_MINIMUM_PIXELS_PER_ITEM, CEILING(rendering_width_in_pixels * (item.get_weight_volume() / effective_max_volume), 2)) + // emit to renderer + renderer.set_pixel_width(used_pixels) + // set screen loc + renderer.screen_loc = "LEFT+[STORAGE_UI_START_TILE_X]:[STORAGE_UI_START_PIXEL_X + (iteration_used_width + iteration_used_padding + VOLUMETRIC_STORAGE_EDGE_PADDING) + (used_pixels - VOLUMETRIC_STORAGE_BOX_ICON_SIZE) * 0.5],\ + BOTTOM+[STORAGE_UI_START_TILE_Y + current_row - 1]:[STORAGE_UI_START_PIXEL_Y]" + // add to emitted screen list + . += renderer + // add to iteration tracking + iteration_used_width += used_pixels + iteration_used_padding += VOLUMETRIC_STORAGE_ITEM_PADDING + // register to maximum used width + // we add the edge padding for both edges, but remove the last item's padding. + maximum_used_width = max(maximum_used_width, iteration_used_width + iteration_used_padding + VOLUMETRIC_STORAGE_EDGE_PADDING * 2 - VOLUMETRIC_STORAGE_ITEM_PADDING) + + // now that everything's set up, we can render everything based on the solved sizes. + // middle size; we also keep in account padding so there's a smooth expansion instead of a sudden expansion at the end. + var/middle_width = max(maximum_used_width, rendering_width_in_pixels + iteration_used_padding) + // i hate byond i hate byond i hate byond i hate byond; this is because things break if we don't extend by 2 pixels + // at a time for left/right as we use a dumb transform matrix and screen loc to shift, instead of a scale and shift matrix + middle_width = CEILING(middle_width, 2) + // todo: instead of this crap we should instead have the translation matrix do the shift + var/middle_shift = round(middle_width * 0.5 - VOLUMETRIC_STORAGE_BOX_ICON_SIZE * 0.5) + // render left + var/atom/movable/screen/storage/panel/volumetric/left/p_left = new + . += p_left + p_left.screen_loc = "LEFT+[STORAGE_UI_START_TILE_X]:[STORAGE_UI_START_PIXEL_X - VOLUMETRIC_STORAGE_BOX_BORDER_SIZE],\ + BOTTOM+[STORAGE_UI_START_TILE_Y]:[STORAGE_UI_START_PIXEL_Y] to \ + LEFT+[STORAGE_UI_START_TILE_X]:[STORAGE_UI_START_PIXEL_X - VOLUMETRIC_STORAGE_BOX_BORDER_SIZE],\ + BOTTOM+[STORAGE_UI_START_TILE_Y + current_row - 1]:[STORAGE_UI_START_PIXEL_Y]" + // render middle + var/atom/movable/screen/storage/panel/volumetric/middle/p_box = new + . += p_box + p_box.set_pixel_width(middle_width) + p_box.screen_loc = "LEFT+[STORAGE_UI_START_TILE_X]:[STORAGE_UI_START_PIXEL_X + middle_shift],\ + BOTTOM+[STORAGE_UI_START_TILE_Y]:[STORAGE_UI_START_PIXEL_Y] to \ + LEFT+[STORAGE_UI_START_TILE_X]:[STORAGE_UI_START_PIXEL_X + middle_shift],\ + BOTTOM+[STORAGE_UI_START_TILE_Y + current_row - 1]:[STORAGE_UI_START_PIXEL_Y]" + // render closer on bottom + var/atom/movable/screen/storage/closer/closer = new + . += closer + closer.screen_loc = "LEFT+[STORAGE_UI_START_TILE_X]:[STORAGE_UI_START_PIXEL_X + middle_width],\ + BOTTOM+[STORAGE_UI_START_TILE_Y]:[STORAGE_UI_START_PIXEL_Y]" + // render right sides above closer + if(current_row > 1) + var/atom/movable/screen/storage/panel/volumetric/right/p_right = new + . += p_right + p_right.screen_loc = "LEFT+[STORAGE_UI_START_TILE_X]:[STORAGE_UI_START_PIXEL_X + middle_width - WORLD_ICON_SIZE + VOLUMETRIC_STORAGE_BOX_BORDER_SIZE],\ + BOTTOM+[STORAGE_UI_START_TILE_Y + 1]:[STORAGE_UI_START_PIXEL_Y] to \ + LEFT+[STORAGE_UI_START_TILE_X]:[STORAGE_UI_START_PIXEL_X + middle_width - WORLD_ICON_SIZE + VOLUMETRIC_STORAGE_BOX_BORDER_SIZE],\ + BOTTOM+[STORAGE_UI_START_TILE_Y + current_row - 1]:[STORAGE_UI_START_PIXEL_Y]" + +/** + * Stack storage + * + * Can handle both material and normal stacks. + * + * Uses max_items and only max_items for 'total combined'. + */ +/datum/object_system/storage/stack + ui_numerical_mode = TRUE + + var/cached_combined_stack_amount = 0 + +/datum/object_system/storage/stack/uses_volumetric_ui() + return FALSE + +/datum/object_system/storage/stack/uses_numerical_ui() + return TRUE + +/datum/object_system/storage/stack/rebuild_caches() + . = ..() + cached_combined_stack_amount = 0 + for(var/obj/item/stack/stack in real_contents_loc()) + cached_combined_stack_amount += stack.amount + +/datum/object_system/storage/stack/why_failed_insertion_limits(obj/item/candidate) + if(!istype(candidate, /obj/item/stack)) + return "not a stack" + if(cached_combined_stack_amount >= max_items) + return "too many sheets" + return null + +/datum/object_system/storage/stack/check_insertion_limits(obj/item/candidate) + return cached_combined_stack_amount < max_items + +// insertion hooked to support partial inserts + +/datum/object_system/storage/stack/try_insert(obj/item/inserting, datum/event_args/actor/actor, silent, suppressed, no_update) + if(!istype(inserting, /obj/item/stack)) + return FALSE + var/obj/item/stack/stack = inserting + // insert a copy + var/allowed_amount = min(stack.amount, max_items - cached_combined_stack_amount) + if(allowed_amount <= 0) + return + if(allowed_amount == stack.amount) + return ..() + var/obj/item/stack/actually_inserting = stack.split(allowed_amount, null, TRUE) + inserting = actually_inserting + return ..() + +/datum/object_system/storage/stack/insert(obj/item/inserting, datum/event_args/actor/actor, suppressed, no_update, no_move) + if(!istype(inserting, /obj/item/stack)) + return FALSE + return ..() + +/datum/object_system/storage/stack/physically_insert_item(obj/item/inserting, no_move, from_hook) + // todo: support non-stacks + if(!istype(inserting, /obj/item/stack)) + // how the fuck + CRASH("attempted to physically insert a non stack") + var/obj/item/stack/stack = inserting + cached_combined_stack_amount += stack.amount + if(no_move) + return ..() + var/atom/indirection = real_contents_loc() + for(var/obj/item/stack/other in indirection) + if(!stack.can_merge(other)) + continue + other.add(stack.amount, TRUE) + // this should delete the stack (?!) + stack.use(stack.amount) + return TRUE + inserting = stack + return ..() + +// removal is directly hooked to never allow producing stacks with amounts higher than max amounts +// in the future, we might want to change this to allow it if someone really needs/wants to. + +/datum/object_system/storage/stack/remove(obj/item/removing, atom/to_where, datum/event_args/actor/actor, suppressed, no_update, no_move) + if(!istype(removing, /obj/item/stack)) + return FALSE + return ..() + +/datum/object_system/storage/stack/physically_remove_item(obj/item/removing, atom/to_where, no_move, from_hook) + // todo: support non-stacks + if(!istype(removing, /obj/item/stack)) + // how the fuck + CRASH("attempted to physically insert a non stack") + var/obj/item/stack/stack = removing + cached_combined_stack_amount -= stack.amount + if(no_move && (!from_hook)) + return ..() + if(stack.amount <= stack.max_amount) + return ..() + var/obj/item/stack/staying_inside = stack.split(stack.amount - stack.max_amount, null, TRUE) + stack.amount = stack.max_amount + // do the normal removal + . = ..() + // insert into, without triggering normal hooks + staying_inside.abstract_move(real_contents_loc()) + // perform aftereffects and register it + physically_insert_item(staying_inside, TRUE) + +/datum/object_system/storage/stack/mass_storage_dumping_handler(list/obj/item/things, atom/to_loc, datum/event_args/actor/actor, list/rejections_out, trigger_on_found) + // todo: this is just a copypaste and god, that fucking sucks. + var/atom/indirection = real_contents_loc() + var/i = length(things) + . = TRUE + while(i > 0) + var/obj/item/stack/transferring = things[i] + //! UH OH, STACK STORAGE SPECIFIC CODE HERE + // make sure they're the right type + if(!istype(transferring)) + continue + var/transferring_type = transferring.type + //! END + // make sure they're still there + if(transferring.loc != indirection) + continue + // handle on open hooks if needed + if(trigger_on_found && actor?.performer.active_storage != src && transferring.on_containing_storage_opening(actor, src)) + . = FALSE + break + // see if we can remove it + if(!try_remove(transferring, to_loc, actor, TRUE, TRUE, TRUE)) + rejections_out += transferring + continue + //! UH OH, STACK STORAGE SPECIFIC CODE HERE + // if it wasn't fully removed, + var/obj/item/stack/remaining = locate(transferring_type) in indirection + if(!isnull(remaining)) + // swap it back + // and don't cut it out just yet + things[i] = remaining + else + // cut it out + i-- + //! END + // stop if overtaxed + if(TICK_CHECK) + break + if(i < length(things)) + things.Cut(i + 1, length(things) + 1) + return . && length(things) + +/datum/object_system/storage/stack/render_numerical_display(list/obj/item/for_items) + var/list/not_stack = list() + . = list() + var/list/types = list() + for(var/obj/item/item in real_contents_loc()) + if(!istype(item, /obj/item/stack)) + not_stack += item + continue + var/obj/item/stack/stack = item + var/datum/storage_numerical_display/display + if(isnull(types[stack.type])) + display = new /datum/storage_numerical_display(stack) + types[stack.type] = display + . += display + else + display = types[stack.type] + display.amount += stack.amount + return . + ..(not_stack) + +/datum/object_system/storage/stock_parts + ui_numerical_mode = TRUE + +/datum/object_system/storage/stock_parts/uses_volumetric_ui() + return FALSE + +/datum/object_system/storage/stock_parts/uses_numerical_ui() + return TRUE + +/datum/object_system/storage/stock_parts/mass_dumping_query() + var/lowest_rating = INFINITY + var/list/current_lowest = list() + for(var/obj/item/item in real_contents_loc()) + var/rating = item.rped_rating() + if(rating > lowest_rating) + continue + else if(rating == lowest_rating) + current_lowest += item + else + current_lowest.len = 0 + current_lowest += item + lowest_rating = rating + if(lowest_rating != INFINITY) + return current_lowest + return ..() + +//? Numerical Display Helper + +/datum/storage_numerical_display + var/obj/item/rendered_object + var/amount + +/datum/storage_numerical_display/New(obj/item/sample, amount = 0) + src.rendered_object = sample + src.amount = amount + +/proc/cmp_storage_numerical_displays_name_asc(datum/storage_numerical_display/A, datum/storage_numerical_display/B) + return sorttext(B.rendered_object.name, A.rendered_object.name) || sorttext(B.rendered_object.type, A.rendered_object.type) + +//? Action + +/datum/action/storage_gather_mode + name = "Switch Gather Mode" + +//? Storage Screens + +/atom/movable/screen/storage + name = "storage" + appearance_flags = APPEARANCE_UI | KEEP_TOGETHER | TILE_BOUND + plane = STORAGE_PLANE + icon = 'icons/screen/hud/common/storage.dmi' + +/atom/movable/screen/storage/closer + name = "close" + icon_state = "close" + layer = STORAGE_LAYER_CONTAINER + +/atom/movable/screen/storage/closer/Click() + usr.active_storage?.hide(usr) + +/atom/movable/screen/storage/item + layer = STORAGE_LAYER_ITEM_INACTIVE + var/obj/item/item + +/atom/movable/screen/storage/item/New(newloc, obj/item/from_item) + item = from_item + bind(from_item) + return ..() + +/atom/movable/screen/storage/item/Destroy() + item = null + return ..() + +/atom/movable/screen/storage/item/MouseEntered(location, control, params) + . = ..() + layer = STORAGE_LAYER_ITEM_ACTIVE + +/atom/movable/screen/storage/item/MouseExited(location, control, params) + . = ..() + layer = STORAGE_LAYER_ITEM_INACTIVE + +/atom/movable/screen/storage/item/proc/item_mouse_enter(mob/user) + layer = STORAGE_LAYER_ITEM_ACTIVE + +/atom/movable/screen/storage/item/proc/item_mouse_exit(mob/user) + layer = STORAGE_LAYER_ITEM_INACTIVE + +/atom/movable/screen/storage/item/MouseDrop(atom/over_object, src_location, over_location, src_control, over_control, params) + return item.MouseDrop(arglist(args)) + +/atom/movable/screen/storage/item/Click(location, control, params) + return item.Click(arglist(args)) + +/atom/movable/screen/storage/item/DblClick(location, control, params) + return item.DblClick(arglist(args)) + +/atom/movable/screen/storage/item/proc/bind(obj/item/item) + vis_contents += item + name = item.name + desc = item.desc + RegisterSignal(item, COMSIG_ITEM_MOUSE_ENTERED, PROC_REF(item_mouse_enter)) + RegisterSignal(item, COMSIG_ITEM_MOUSE_EXITED, PROC_REF(item_mouse_exit)) + +/atom/movable/screen/storage/panel + layer = STORAGE_LAYER_CONTAINER + +/atom/movable/screen/storage/panel/Click() + var/obj/item/held = usr.get_active_held_item() + if(isnull(held)) + return + usr.active_storage?.auto_handle_interacted_insertion(held, new /datum/event_args/actor(usr)) + +/atom/movable/screen/storage/item/slot + icon_state = "nothing" + mouse_opacity = MOUSE_OPACITY_OPAQUE + +/atom/movable/screen/storage/panel/slot + +/atom/movable/screen/storage/panel/slot/boxes + icon_state = "block" + +/atom/movable/screen/storage/item/volumetric + icon_state = "nothing" + +/** + * we are centered. + */ +/atom/movable/screen/storage/item/volumetric/proc/set_pixel_width(width) + overlays.len = 0 + var/center_thickness = (width - (VOLUMETRIC_STORAGE_BOX_BORDER_SIZE * 2)) + var/shift_from_center = -((WORLD_ICON_SIZE * 0.5) - VOLUMETRIC_STORAGE_BOX_BORDER_SIZE) + (center_thickness * 0.5) + var/image/left = image(icon, icon_state = "stored_left", pixel_x = -shift_from_center) + var/image/right = image(icon, icon_state = "stored_right", pixel_x = shift_from_center) + var/image/middle = image(icon, icon_state = "stored_middle") + middle.transform = matrix(center_thickness / VOLUMETRIC_STORAGE_BOX_ICON_SIZE, 0, 0, 0, 1, 0) + overlays = list(left, middle, right) + +/atom/movable/screen/storage/panel/volumetric + +/atom/movable/screen/storage/panel/volumetric/left + icon_state = "storage_left" + +/atom/movable/screen/storage/panel/volumetric/middle + icon_state = "storage_middle" + +/** + * we are centered. + */ +/atom/movable/screen/storage/panel/volumetric/middle/proc/set_pixel_width(width) + transform = matrix(width / VOLUMETRIC_STORAGE_BOX_ICON_SIZE, 0, 0, 0, 1, 0) + +/atom/movable/screen/storage/panel/volumetric/right + icon_state = "storage_right" + +//? Hooks + +/obj/proc/object_storage_opened(mob/user) + return + +/obj/proc/object_storage_closed(mob/user) + return + +//? Lazy indirection helper + +/obj/storage_indirection_holder + name = "storage indirection holder" + desc = "Why do you see this?" + atom_flags = ATOM_ABSTRACT + +/atom/movable/storage_indirection_holder/CanReachIn(atom/movable/mover, atom/target, obj/item/tool, list/cache) + return TRUE + +/atom/movable/storage_indirection_holder/CanReachOut(atom/movable/mover, atom/target, obj/item/tool, list/cache) + return TRUE + +//? Wrapper for init + +/** + * Use this to init, not new()! + */ +/obj/proc/init_storage(path = /datum/object_system/storage, indirected = FALSE) + RETURN_TYPE(/datum/object_system/storage) + ASSERT(isnull(obj_storage)) + obj_storage = new path(src) + if(!indirected) + // get all items inside / registered + for(var/obj/item/item in contents) + obj_storage.on_item_entered(item) + else + var/obj/indirection = new /obj/storage_indirection_holder(src) + obj_storage.dangerously_redirect_contents_calls = indirection + // this is shitcode oh my god + // AAAAAAAAAAAAAAAAAAA + indirection.obj_storage = obj_storage + return obj_storage diff --git a/code/game/rendering/legacy/radial.dm b/code/game/rendering/legacy/radial.dm index e470eeaba27..31b2425da03 100644 --- a/code/game/rendering/legacy/radial.dm +++ b/code/game/rendering/legacy/radial.dm @@ -4,6 +4,8 @@ GLOBAL_LIST_EMPTY(radial_menus) // Ported from TG +// todo: rewrite all of this, the code's too messy +// todo: screen/context/radial, screen/context/list /atom/movable/screen/radial icon = 'icons/mob/radial.dmi' @@ -12,6 +14,10 @@ GLOBAL_LIST_EMPTY(radial_menus) appearance_flags = PIXEL_SCALE | NO_CLIENT_COLOR | KEEP_APART | RESET_TRANSFORM | RESET_ALPHA | RESET_COLOR var/datum/radial_menu/parent +/atom/movable/screen/radial/Destroy() + parent = null + return ..() + /atom/movable/screen/radial/slice icon_state = "radial_slice" var/choice @@ -85,6 +91,13 @@ GLOBAL_LIST_EMPTY(radial_menus) var/py_shift = 0 var/entry_animation = TRUE +/datum/radial_menu/Destroy() + Reset() + hide() + QDEL_NULL(close_button) + QDEL_LIST(elements) + return ..() + //If we swap to vis_contens inventory these will need a redo /datum/radial_menu/proc/check_screen_border(mob/user) var/atom/movable/AM = anchor @@ -284,11 +297,6 @@ GLOBAL_LIST_EMPTY(radial_menus) next_check = world.time + check_delay stoplag(1) -/datum/radial_menu/Destroy() - Reset() - hide() - . = ..() - /* Presents radial menu to user anchored to anchor (or user if the anchor is currently in users screen) Choices should be a list where list keys are movables or text used for element names and return value diff --git a/code/game/rendering/screen.dm b/code/game/rendering/screen.dm index c3360069f9c..bfd26030a12 100644 --- a/code/game/rendering/screen.dm +++ b/code/game/rendering/screen.dm @@ -28,17 +28,6 @@ maptext_height = 480 maptext_width = 480 -/atom/movable/screen/close - name = "close" - -/atom/movable/screen/close/Click() - if(master) - if(istype(master, /obj/item/storage)) - var/obj/item/storage/S = master - S.close(usr) - return 1 - - /atom/movable/screen/item_action var/obj/item/owner @@ -75,23 +64,6 @@ /atom/movable/screen/grab/attackby() return - -/atom/movable/screen/storage - name = "storage" - -/atom/movable/screen/storage/Click() - if(!usr.canClick()) - return 1 - if(!CHECK_MOBILITY(usr, MOBILITY_CAN_STORAGE)) - return 1 - if (istype(usr.loc,/obj/mecha)) // stops inventory actions in a mech - return 1 - if(master) - var/obj/item/I = usr.get_active_held_item() - if(I) - usr.ClickOn(master) - return 1 - /atom/movable/screen/zone_sel name = "damage zone" icon_state = "zone_sel" diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm index 13cc3503588..775297495f2 100644 --- a/code/game/turfs/turf.dm +++ b/code/game/turfs/turf.dm @@ -157,6 +157,11 @@ if(color) add_atom_colour(color, FIXED_COLOUR_PRIORITY) + // todo: uh oh. + // TODO: what would tg do (but maybe not that much component signal abuse?) + // this is to trigger entered effects + // bad news is this is not necessarily currently idempotent + // we probably have to deal with this at.. some point. for(var/atom/movable/AM in src) Entered(AM) @@ -280,10 +285,9 @@ return 1 /turf/attackby(obj/item/I, mob/user, list/params, clickchain_flags, damage_multiplier) - if(istype(I, /obj/item/storage)) - var/obj/item/storage/S = I - if(S.use_to_pickup && S.collection_mode) - S.gather_all(src, user) + if(I.obj_storage?.allow_mass_gather && I.obj_storage.allow_mass_gather_via_click) + I.obj_storage.auto_handle_interacted_mass_pickup(new /datum/event_args/actor(user), src) + return CLICKCHAIN_DO_NOT_PROPAGATE | CLICKCHAIN_DID_SOMETHING return ..() // Hits a mob on the tile. diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index be7e52115dd..4d599cb6551 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -38,7 +38,6 @@ var/list/admin_verbs_admin = list( /client/proc/cmd_admin_subtle_message, //send an message to somebody as a 'voice in their head', /client/proc/cmd_admin_icsubtle_message, //send a message to someone as a voice from centcom /client/proc/cmd_admin_delete, //delete an instance/object/mob/etc, - /client/proc/cmd_admin_check_contents, //displays the contents of an instance, /client/proc/cmd_admin_check_player_logs, //checks a player's attack logs, /client/proc/cmd_admin_check_dialogue_logs, //checks a player's dialogue logs, /datum/admins/proc/access_news_network, //allows access of newscasters, @@ -274,7 +273,6 @@ var/list/admin_verbs_hideable = list( /client/proc/toggle_view_range, /client/proc/cmd_admin_subtle_message, /client/proc/cmd_admin_icsubtle_message, - /client/proc/cmd_admin_check_contents, /client/proc/cmd_admin_check_player_logs, /client/proc/cmd_admin_check_dialogue_logs, /datum/admins/proc/access_news_network, diff --git a/code/modules/admin/verbs/randomverbs.dm b/code/modules/admin/verbs/randomverbs.dm index 4f4c8f04a8e..b769154d776 100644 --- a/code/modules/admin/verbs/randomverbs.dm +++ b/code/modules/admin/verbs/randomverbs.dm @@ -787,16 +787,6 @@ Traitors and the like can also be revived with the previous role mostly intact. // I will both remove their SVN access and permanently ban them from my servers. return -/client/proc/cmd_admin_check_contents(mob/living/M as mob in GLOB.mob_list) - set category = "Special Verbs" - set name = "Check Contents" - set popup_menu = FALSE - - var/list/L = M.get_contents() - for(var/t in L) - to_chat(usr, "[t]") - feedback_add_details("admin_verb","CC") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - /* This proc is DEFERRED. Does not do anything. /client/proc/cmd_admin_remove_phoron() set category = "Debug" diff --git a/code/modules/artifice/deadringer.dm b/code/modules/artifice/deadringer.dm index a6baaf731c9..2d83b696463 100644 --- a/code/modules/artifice/deadringer.dm +++ b/code/modules/artifice/deadringer.dm @@ -3,7 +3,7 @@ desc = "A fancy silver-plated digital pocket watch. Looks expensive." icon = 'icons/obj/deadringer.dmi' icon_state = "deadringer" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL slot_flags = SLOT_ID | SLOT_BELT | SLOT_TIE origin_tech = list(TECH_ILLEGAL = 3) var/activated = 0 @@ -101,63 +101,63 @@ corpse.setDNA(H.dna.Clone()) corpse.death(1) //Kills the new mob var/obj/item/clothing/temp = null - if(H.item_by_slot(SLOT_ID_UNIFORM)) + if(H.item_by_slot_id(SLOT_ID_UNIFORM)) corpse.equip_to_slot_or_del(new /obj/item/clothing/under/chameleon/changeling(corpse), SLOT_ID_UNIFORM) - temp = corpse.item_by_slot(SLOT_ID_UNIFORM) - var/obj/item/clothing/c_type = H.item_by_slot(SLOT_ID_UNIFORM) + temp = corpse.item_by_slot_id(SLOT_ID_UNIFORM) + var/obj/item/clothing/c_type = H.item_by_slot_id(SLOT_ID_UNIFORM) temp.disguise(c_type.type) ADD_TRAIT(temp, TRAIT_ITEM_NODROP, HOLOGRAM_TRAIT) - if(H.item_by_slot(SLOT_ID_SUIT)) + if(H.item_by_slot_id(SLOT_ID_SUIT)) corpse.equip_to_slot_or_del(new /obj/item/clothing/suit/chameleon/changeling(corpse), SLOT_ID_SUIT) - temp = corpse.item_by_slot(SLOT_ID_SUIT) - var/obj/item/clothing/c_type = H.item_by_slot(SLOT_ID_SUIT) + temp = corpse.item_by_slot_id(SLOT_ID_SUIT) + var/obj/item/clothing/c_type = H.item_by_slot_id(SLOT_ID_SUIT) temp.disguise(c_type.type) ADD_TRAIT(temp, TRAIT_ITEM_NODROP, HOLOGRAM_TRAIT) - if(H.item_by_slot(SLOT_ID_SHOES)) + if(H.item_by_slot_id(SLOT_ID_SHOES)) corpse.equip_to_slot_or_del(new /obj/item/clothing/shoes/chameleon/changeling(corpse), SLOT_ID_SHOES) - temp = corpse.item_by_slot(SLOT_ID_SHOES) - var/obj/item/clothing/c_type = H.item_by_slot(SLOT_ID_SHOES) + temp = corpse.item_by_slot_id(SLOT_ID_SHOES) + var/obj/item/clothing/c_type = H.item_by_slot_id(SLOT_ID_SHOES) temp.disguise(c_type.type) ADD_TRAIT(temp, TRAIT_ITEM_NODROP, HOLOGRAM_TRAIT) - if(H.item_by_slot(SLOT_ID_GLOVES)) + if(H.item_by_slot_id(SLOT_ID_GLOVES)) corpse.equip_to_slot_or_del(new /obj/item/clothing/gloves/chameleon/changeling(corpse), SLOT_ID_GLOVES) - temp = corpse.item_by_slot(SLOT_ID_GLOVES) - var/obj/item/clothing/c_type = H.item_by_slot(SLOT_ID_GLOVES) + temp = corpse.item_by_slot_id(SLOT_ID_GLOVES) + var/obj/item/clothing/c_type = H.item_by_slot_id(SLOT_ID_GLOVES) temp.disguise(c_type.type) ADD_TRAIT(temp, TRAIT_ITEM_NODROP, HOLOGRAM_TRAIT) - if(H.item_by_slot(SLOT_ID_LEFT_EAR)) - temp = H.item_by_slot(SLOT_ID_LEFT_EAR) + if(H.item_by_slot_id(SLOT_ID_LEFT_EAR)) + temp = H.item_by_slot_id(SLOT_ID_LEFT_EAR) corpse.equip_to_slot_or_del(new temp.type(corpse), SLOT_ID_LEFT_EAR) - temp = corpse.item_by_slot(SLOT_ID_LEFT_EAR) + temp = corpse.item_by_slot_id(SLOT_ID_LEFT_EAR) ADD_TRAIT(temp, TRAIT_ITEM_NODROP, HOLOGRAM_TRAIT) - if(H.item_by_slot(SLOT_ID_GLASSES)) + if(H.item_by_slot_id(SLOT_ID_GLASSES)) corpse.equip_to_slot_or_del(new /obj/item/clothing/glasses/chameleon/changeling(corpse), SLOT_ID_GLASSES) - temp = corpse.item_by_slot(SLOT_ID_GLASSES) - var/obj/item/clothing/c_type = H.item_by_slot(SLOT_ID_GLASSES) + temp = corpse.item_by_slot_id(SLOT_ID_GLASSES) + var/obj/item/clothing/c_type = H.item_by_slot_id(SLOT_ID_GLASSES) temp.disguise(c_type.type) ADD_TRAIT(temp, TRAIT_ITEM_NODROP, HOLOGRAM_TRAIT) - if(H.item_by_slot(SLOT_ID_MASK)) + if(H.item_by_slot_id(SLOT_ID_MASK)) corpse.equip_to_slot_or_del(new /obj/item/clothing/mask/chameleon/changeling(corpse), SLOT_ID_MASK) - temp = corpse.item_by_slot(SLOT_ID_MASK) - var/obj/item/clothing/c_type = H.item_by_slot(SLOT_ID_MASK) + temp = corpse.item_by_slot_id(SLOT_ID_MASK) + var/obj/item/clothing/c_type = H.item_by_slot_id(SLOT_ID_MASK) temp.disguise(c_type.type) ADD_TRAIT(temp, TRAIT_ITEM_NODROP, HOLOGRAM_TRAIT) - if(H.item_by_slot(SLOT_ID_HEAD)) + if(H.item_by_slot_id(SLOT_ID_HEAD)) corpse.equip_to_slot_or_del(new /obj/item/clothing/head/chameleon/changeling(corpse), SLOT_ID_HEAD) - temp = corpse.item_by_slot(SLOT_ID_HEAD) - var/obj/item/clothing/c_type = H.item_by_slot(SLOT_ID_HEAD) + temp = corpse.item_by_slot_id(SLOT_ID_HEAD) + var/obj/item/clothing/c_type = H.item_by_slot_id(SLOT_ID_HEAD) temp.disguise(c_type.type) ADD_TRAIT(temp, TRAIT_ITEM_NODROP, HOLOGRAM_TRAIT) - if(H.item_by_slot(SLOT_ID_BELT)) + if(H.item_by_slot_id(SLOT_ID_BELT)) corpse.equip_to_slot_or_del(new /obj/item/storage/belt/chameleon/changeling(corpse), SLOT_ID_BELT) - temp = corpse.item_by_slot(SLOT_ID_BELT) - var/obj/item/clothing/c_type = H.item_by_slot(SLOT_ID_BELT) + temp = corpse.item_by_slot_id(SLOT_ID_BELT) + var/obj/item/clothing/c_type = H.item_by_slot_id(SLOT_ID_BELT) temp.disguise(c_type.type) ADD_TRAIT(temp, TRAIT_ITEM_NODROP, HOLOGRAM_TRAIT) - if(H.item_by_slot(SLOT_ID_BACK)) + if(H.item_by_slot_id(SLOT_ID_BACK)) corpse.equip_to_slot_or_del(new /obj/item/storage/backpack/chameleon/changeling(corpse), SLOT_ID_BACK) - temp = corpse.item_by_slot(SLOT_ID_BACK) - var/obj/item/clothing/c_type = H.item_by_slot(SLOT_ID_BACK) + temp = corpse.item_by_slot_id(SLOT_ID_BACK) + var/obj/item/clothing/c_type = H.item_by_slot_id(SLOT_ID_BACK) temp.disguise(c_type.type) ADD_TRAIT(temp, TRAIT_ITEM_NODROP, HOLOGRAM_TRAIT) corpse.identifying_gender = H.identifying_gender diff --git a/code/modules/artifice/telecube.dm b/code/modules/artifice/telecube.dm index 795dff6b733..f993d2bf76f 100644 --- a/code/modules/artifice/telecube.dm +++ b/code/modules/artifice/telecube.dm @@ -23,7 +23,7 @@ description_info = "Ctrl-Clicking on this object will attempt to activate its unique ability." icon = 'icons/obj/props/telecube.dmi' icon_state = "cube" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL origin_tech = list(TECH_MATERIAL = 7, TECH_POWER = 6, TECH_BLUESPACE = 7, TECH_ANOMALY = 2, TECH_PRECURSOR = 2) catalogue_data = list(/datum/category_item/catalogue/anomalous/precursor_a/telecube) diff --git a/code/modules/assembly/assembly.dm b/code/modules/assembly/assembly.dm index 84b8bba7b24..e0d3b72d868 100644 --- a/code/modules/assembly/assembly.dm +++ b/code/modules/assembly/assembly.dm @@ -10,7 +10,7 @@ desc = "A small electronic device that should never exist." icon = 'icons/obj/assemblies/new_assemblies.dmi' icon_state = "" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL materials_base = list(MAT_STEEL = 100) throw_force = 2 throw_speed = 3 diff --git a/code/modules/assembly/holder.dm b/code/modules/assembly/holder.dm index 347f5df0b96..4ce675966b9 100644 --- a/code/modules/assembly/holder.dm +++ b/code/modules/assembly/holder.dm @@ -4,7 +4,7 @@ icon_state = "holder" item_state = "assembly" throw_force = 5 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL throw_speed = 3 throw_range = 10 @@ -73,11 +73,10 @@ if(a_right) a_right.Crossed(AM) -/obj/item/assembly_holder/on_found(mob/finder as mob) - if(a_left) - a_left.on_found(finder) - if(a_right) - a_right.on_found(finder) +/obj/item/assembly_holder/on_containing_storage_opening(datum/event_args/actor/actor, datum/object_system/storage/storage) + . = ..() + . |= a_left?.on_containing_storage_opening(arglist(args)) + . |= a_right?.on_containing_storage_opening(arglist(args)) /obj/item/assembly_holder/Move() ..() diff --git a/code/modules/assembly/mousetrap.dm b/code/modules/assembly/mousetrap.dm index 42e174d9c54..65d59150ed0 100644 --- a/code/modules/assembly/mousetrap.dm +++ b/code/modules/assembly/mousetrap.dm @@ -99,7 +99,12 @@ ..() -/obj/item/assembly/mousetrap/on_found(var/mob/living/finder) +/obj/item/assembly/mousetrap/on_containing_storage_opening(datum/event_args/actor/actor, datum/object_system/storage/storage) + . = ..() + + var/mob/living/finder = actor.performer + if(!istype(finder)) + return if(armed) finder.visible_message("[finder] accidentally sets off [src], breaking their fingers.", \ "You accidentally trigger [src]!") diff --git a/code/modules/assembly/shock_kit.dm b/code/modules/assembly/shock_kit.dm index faa1c5842ee..3bde2f5966e 100644 --- a/code/modules/assembly/shock_kit.dm +++ b/code/modules/assembly/shock_kit.dm @@ -5,7 +5,7 @@ var/obj/item/clothing/head/helmet/part1 = null var/obj/item/radio/electropack/part2 = null var/status = 0 - w_class = ITEMSIZE_HUGE + w_class = WEIGHT_CLASS_HUGE /obj/item/assembly/shock_kit/Destroy() qdel(part1) diff --git a/code/modules/atmospherics/environmental/zas/airflow.dm b/code/modules/atmospherics/environmental/zas/airflow.dm index b9eadaffffd..f8e05581aa9 100644 --- a/code/modules/atmospherics/environmental/zas/airflow.dm +++ b/code/modules/atmospherics/environmental/zas/airflow.dm @@ -66,11 +66,11 @@ Contains helper procs for airflow, handled in /connection_group. if(isnull(w_class)) if(n < dense_pressure) return 0 //most non-item objs don't have a w_class yet switch(w_class) - if(ITEMSIZE_TINY,ITEMSIZE_SMALL) + if(WEIGHT_CLASS_TINY,WEIGHT_CLASS_SMALL) if(n < lightest_pressure) return 0 - if(ITEMSIZE_NORMAL) + if(WEIGHT_CLASS_NORMAL) if(n < light_pressure) return 0 - if(ITEMSIZE_LARGE,ITEMSIZE_HUGE) + if(WEIGHT_CLASS_BULKY,WEIGHT_CLASS_HUGE) if(n < medium_pressure) return 0 else if(n < dense_pressure) return 0 @@ -89,7 +89,7 @@ Contains helper procs for airflow, handled in /connection_group. return 0 if(buckled) return 0 - var/obj/item/shoes = item_by_slot(SLOT_ID_SHOES) + var/obj/item/shoes = item_by_slot_id(SLOT_ID_SHOES) if(istype(shoes) && (shoes.clothing_flags & NOSLIP)) return 0 return 1 diff --git a/code/modules/atmospherics/machinery/portable/canister.dm b/code/modules/atmospherics/machinery/portable/canister.dm index 2aa49452e0e..bd65d68502b 100644 --- a/code/modules/atmospherics/machinery/portable/canister.dm +++ b/code/modules/atmospherics/machinery/portable/canister.dm @@ -9,7 +9,7 @@ integrity = 300 integrity_max = 300 integrity_failure = 100 - w_class = ITEMSIZE_HUGE + w_class = WEIGHT_CLASS_HUGE layer = TABLE_LAYER // Above catwalks, hopefully below other things diff --git a/code/modules/atmospherics/machinery/portable/pump.dm b/code/modules/atmospherics/machinery/portable/pump.dm index e3fea77858f..fc9ebb05f1f 100644 --- a/code/modules/atmospherics/machinery/portable/pump.dm +++ b/code/modules/atmospherics/machinery/portable/pump.dm @@ -3,7 +3,7 @@ icon = 'icons/obj/atmos.dmi' icon_state = "psiphon:0" density = 1 - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL var/direction_out = 0 //0 = siphoning, 1 = releasing var/target_pressure = ONE_ATMOSPHERE diff --git a/code/modules/atmospherics/machinery/portable/scrubber.dm b/code/modules/atmospherics/machinery/portable/scrubber.dm index 9db12e6bd6b..145bc59c245 100644 --- a/code/modules/atmospherics/machinery/portable/scrubber.dm +++ b/code/modules/atmospherics/machinery/portable/scrubber.dm @@ -3,7 +3,7 @@ icon = 'icons/obj/atmos.dmi' icon_state = "pscrubber:0" density = TRUE - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL atmos_portable_ui_flags = ATMOS_PORTABLE_UI_TOGGLE_POWER | ATMOS_PORTABLE_UI_SEE_POWER | ATMOS_PORTABLE_UI_SEE_FLOW power_maximum = 7500 diff --git a/code/modules/cargo/supplypacks/contraband.dm b/code/modules/cargo/supplypacks/contraband.dm index 90ff6daf0d6..ca97a98b13b 100644 --- a/code/modules/cargo/supplypacks/contraband.dm +++ b/code/modules/cargo/supplypacks/contraband.dm @@ -66,7 +66,7 @@ /obj/item/storage/box/cargo_null_entry_kit/ops name = "operator's kit" -/obj/item/storage/box/cargo_null_entry_kit/ops/PopulateContents() +/obj/item/storage/box/cargo_null_entry_kit/ops/legacy_spawn_contents() new /obj/item/gun/ballistic/shotgun/pump/combat(src) new /obj/item/clothing/suit/storage/vest/heavy/merc(src) new /obj/item/clothing/glasses/night(src) @@ -77,7 +77,7 @@ /obj/item/storage/box/cargo_null_entry_kit/doctor name = "doctor's kit" -/obj/item/storage/box/cargo_null_entry_kit/doctor/PopulateContents() +/obj/item/storage/box/cargo_null_entry_kit/doctor/legacy_spawn_contents() new /obj/item/storage/firstaid/combat(src) new /obj/item/gun/ballistic/dartgun(src) new /obj/item/reagent_containers/hypospray(src) @@ -88,7 +88,7 @@ /obj/item/storage/box/cargo_null_entry_kit/sapper name = "sapper's kit" -/obj/item/storage/box/cargo_null_entry_kit/sapper/PopulateContents() +/obj/item/storage/box/cargo_null_entry_kit/sapper/legacy_spawn_contents() new /obj/item/melee/energy/sword/ionic_rapier(src) new /obj/item/storage/box/syndie_kit/space(src) new /obj/item/storage/box/syndie_kit/demolitions(src) @@ -99,7 +99,7 @@ /obj/item/storage/box/cargo_null_entry_kit/spy name = "spy's kit" -/obj/item/storage/box/cargo_null_entry_kit/spy/PopulateContents() +/obj/item/storage/box/cargo_null_entry_kit/spy/legacy_spawn_contents() new /obj/item/gun/ballistic/silenced(src) new /obj/item/storage/box/syndie_kit/chameleon(src) new /obj/item/encryptionkey/syndicate(src) @@ -110,7 +110,7 @@ /obj/item/storage/box/cargo_null_entry_kit/pro name = "professional's kit" -/obj/item/storage/box/cargo_null_entry_kit/pro/PopulateContents() +/obj/item/storage/box/cargo_null_entry_kit/pro/legacy_spawn_contents() new /obj/item/gun/ballistic/silenced(src) new /obj/item/gun/energy/ionrifle/pistol(src) new /obj/item/clothing/glasses/thermal/syndi(src) diff --git a/code/modules/catalogue/cataloguer.dm b/code/modules/catalogue/cataloguer.dm index f69997cb875..fa12bc6f348 100644 --- a/code/modules/catalogue/cataloguer.dm +++ b/code/modules/catalogue/cataloguer.dm @@ -22,7 +22,7 @@ GLOBAL_LIST_EMPTY(all_cataloguers) scanned again." icon = 'icons/obj/device.dmi' icon_state = "cataloguer" - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL origin_tech = list(TECH_MATERIAL = 2, TECH_DATA = 3, TECH_MAGNET = 3) damage_force = 0 var/points_stored = 0 // Amount of 'exploration points' this device holds. diff --git a/code/modules/catalogue/cataloguer_vr.dm b/code/modules/catalogue/cataloguer_vr.dm index 6df9bedd98c..6b3ae9d83ca 100644 --- a/code/modules/catalogue/cataloguer_vr.dm +++ b/code/modules/catalogue/cataloguer_vr.dm @@ -26,11 +26,11 @@ return deployed = !(deployed) if(deployed) - w_class = ITEMSIZE_NORMAL + set_weight_class(WEIGHT_CLASS_NORMAL) icon_state = "[initial(icon_state)]" to_chat(usr, SPAN_NOTICE("You flip open \the [src].")) else - w_class = ITEMSIZE_SMALL + set_weight_class(WEIGHT_CLASS_SMALL) icon_state = "[initial(icon_state)]_closed" to_chat(usr, SPAN_NOTICE("You close \the [src].")) diff --git a/code/modules/clothing/chameleon.dm b/code/modules/clothing/chameleon.dm index fffa6ccdb81..f1c6e2033a1 100644 --- a/code/modules/clothing/chameleon.dm +++ b/code/modules/clothing/chameleon.dm @@ -358,7 +358,7 @@ desc = "A hologram projector in the shape of a gun. There is a dial on the side to change the gun's disguise." icon = 'icons/obj/gun/holographic.dmi' icon_state = "deagle" - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL origin_tech = list(TECH_COMBAT = 5, TECH_MATERIAL = 2, TECH_ILLEGAL = 4) materials_base = list() diff --git a/code/modules/clothing/clothing.dm b/code/modules/clothing/clothing.dm index cb601964595..dfa3be81f74 100644 --- a/code/modules/clothing/clothing.dm +++ b/code/modules/clothing/clothing.dm @@ -59,9 +59,13 @@ var/mutable_appearance/accessory_inv_cached //? accessory system - attached to by accessories - /// full list of accessories, everything inside must be an /obj/item. *not* /obj/item/clothing. + /// full list of accessories, everything inside must be an /obj/item/clothing. var/list/accessories + //* Clothing *// + /// Don't automatically have someone yank us off on attack hand if this is FALSE + var/attack_hand_auto_unequip = TRUE + //* Carry Weight /// encumbrance compensation for accessories - flat. var/accessory_encumbrance_mitigation = 0 @@ -91,6 +95,24 @@ if(acc.len) . += " with traces of [english_list(acc)]" +/obj/item/clothing/should_attempt_pickup(datum/event_args/actor/actor) + // if we're currently attached as an accessory + if(accessory_host) + return FALSE + // either attack_hand_auto_unequip off, not being worn + var/equipped_by_performer = actor.performer == worn_mob() + . = ..() && (attack_hand_auto_unequip || !equipped_by_performer) + if(!.) + return + if(equipped_by_performer) + for(var/obj/item/clothing/accessory as anything in accessories) + // check if accessory has storage allowing equipped click + if(accessory.obj_storage?.allow_open_via_equipped_click) + return FALSE + // check if they allow pickup + if(!accessory.should_attempt_pickup(actor)) + return FALSE + /obj/item/clothing/equipped(mob/user, slot, flags) . = ..() if(enables_planes) diff --git a/code/modules/clothing/clothing_accessories.dm b/code/modules/clothing/clothing_accessories.dm index ceca5912638..6fa3138d3af 100644 --- a/code/modules/clothing/clothing_accessories.dm +++ b/code/modules/clothing/clothing_accessories.dm @@ -7,6 +7,37 @@ /obj/item/clothing/proc/is_accessory() return is_accessory +/obj/item/clothing/context_query(datum/event_args/actor/e_args) + . = ..() + for(var/obj/item/clothing/accessory as anything in accessories) + var/list/queried = accessory.context_query(e_args) + for(var/key in queried) + .["A-[ref(accessory)]-[key]"] = queried[key] + +/obj/item/clothing/context_act(datum/event_args/actor/e_args, key) + . = ..() + if(.) + return + if(key[1] != "A" || key[2] != "-") + return FALSE + var/list/split = splittext(key, "-") + if(length(split) < 3) + return FALSE + var/accessory_ref = split[2] + var/obj/item/clothing/accessory = locate(accessory_ref) in accessories + if(!(accessory in accessories)) + return FALSE + return accessory.context_act(e_args, split[3]) + +/obj/item/clothing/on_attack_hand(datum/event_args/actor/clickchain/e_args) + . = ..() + if(.) + return + for(var/obj/item/clothing/accessory as anything in accessories) + if(accessory.on_attack_hand(e_args)) + return TRUE + return FALSE + /obj/item/clothing/worn_mob() return isnull(accessory_host)? ..() : accessory_host.worn_mob() @@ -179,18 +210,6 @@ ..() -/obj/item/clothing/attack_hand(mob/user, list/params) - //only forward to the attached accessory if the clothing is equipped (not in a storage) - if(LAZYLEN(accessories) && src.loc == user) - for(var/obj/item/clothing/accessory/A in accessories) - A.attack_hand(user) - return - if (ishuman(user) && src.loc == user) - var/mob/living/carbon/human/H = user - if(src == H.w_uniform) // Un-equip on single click, but not on uniform. - return - return ..() - /obj/item/clothing/examine(var/mob/user) . = ..() if(LAZYLEN(accessories)) diff --git a/code/modules/clothing/ears/_ears.dm b/code/modules/clothing/ears/_ears.dm index 5213a221f6b..ead57f3c6f3 100644 --- a/code/modules/clothing/ears/_ears.dm +++ b/code/modules/clothing/ears/_ears.dm @@ -1,6 +1,6 @@ // Ears: headsets, earmuffs and tiny objects /obj/item/clothing/ears name = "ears" - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY throw_force = 2 slot_flags = SLOT_EARS diff --git a/code/modules/clothing/ears/ears.dm b/code/modules/clothing/ears/ears.dm index a04fb97ddb3..d4fbd5008fa 100644 --- a/code/modules/clothing/ears/ears.dm +++ b/code/modules/clothing/ears/ears.dm @@ -52,7 +52,7 @@ name = "skrell tentacle wear" desc = "Some stuff worn by skrell to adorn their head tentacles." icon = 'icons/obj/clothing/ears.dmi' - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY slot_flags = SLOT_EARS /obj/item/clothing/ears/skrell/chain @@ -198,7 +198,7 @@ desc = "A dark green laurel wreath that's worn tight around the head." icon = 'icons/obj/clothing/ears.dmi' icon_state = "laurel" - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY slot_flags = SLOT_EARS drop_sound = 'sound/items/drop/wrapper.ogg' pickup_sound = 'sound/items/drop/wrapper.ogg' diff --git a/code/modules/clothing/glasses/_glasses.dm b/code/modules/clothing/glasses/_glasses.dm index 84b2932aba6..23914c7e43a 100644 --- a/code/modules/clothing/glasses/_glasses.dm +++ b/code/modules/clothing/glasses/_glasses.dm @@ -14,7 +14,7 @@ BLIND // can't see anything /obj/item/clothing/glasses name = "glasses" icon = 'icons/obj/clothing/glasses.dmi' - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL slot_flags = SLOT_EYES active_slots = list(SLOT_ID_GLASSES) var/prescription = 0 @@ -479,7 +479,7 @@ BLIND // can't see anything icon = 'icons/obj/bureaucracy.dmi' icon_state = "tape_cross" item_state_slots = list(SLOT_ID_RIGHT_HAND = null, SLOT_ID_LEFT_HAND = null) - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY /obj/item/clothing/glasses/sunglasses/fakeblindfold name = "blindfold" @@ -496,7 +496,7 @@ BLIND // can't see anything icon = 'icons/obj/bureaucracy.dmi' icon_state = "tape_cross" item_state_slots = list(SLOT_ID_RIGHT_HAND = null, SLOT_ID_LEFT_HAND = null) - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY /obj/item/clothing/glasses/sunglasses/prescription name = "prescription sunglasses" diff --git a/code/modules/clothing/gloves/_gloves.dm b/code/modules/clothing/gloves/_gloves.dm index 7804d8f33c9..255da6cf730 100644 --- a/code/modules/clothing/gloves/_gloves.dm +++ b/code/modules/clothing/gloves/_gloves.dm @@ -6,7 +6,7 @@ SLOT_ID_RIGHT_HAND = 'icons/mob/items/righthand_gloves.dmi', ) gender = PLURAL //Carn: for grammarically correct text-parsing - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL icon = 'icons/obj/clothing/gloves.dmi' siemens_coefficient = 0.9 blood_sprite_state = "bloodyhands" diff --git a/code/modules/clothing/gloves/arm_guards.dm b/code/modules/clothing/gloves/arm_guards.dm index 837c252dc98..55642593b12 100644 --- a/code/modules/clothing/gloves/arm_guards.dm +++ b/code/modules/clothing/gloves/arm_guards.dm @@ -4,7 +4,7 @@ body_cover_flags = HANDS|ARMS overgloves = 1 punch_force = 3 - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL drop_sound = 'sound/items/drop/metalshield.ogg' pickup_sound = 'sound/items/pickup/axe.ogg' diff --git a/code/modules/clothing/gloves/rings/_rings.dm b/code/modules/clothing/gloves/rings/_rings.dm index 75ffe0908b4..c0998da867c 100644 --- a/code/modules/clothing/gloves/rings/_rings.dm +++ b/code/modules/clothing/gloves/rings/_rings.dm @@ -2,7 +2,7 @@ /obj/item/clothing/gloves/ring name = "ring" - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY icon = 'icons/obj/clothing/rings.dmi' gender = NEUTER species_restricted = list("exclude", SPECIES_DIONA) diff --git a/code/modules/clothing/head/_head.dm b/code/modules/clothing/head/_head.dm index 89265c01d2e..97b96e4ba9f 100644 --- a/code/modules/clothing/head/_head.dm +++ b/code/modules/clothing/head/_head.dm @@ -8,7 +8,7 @@ ) body_cover_flags = HEAD slot_flags = SLOT_HEAD - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL blood_sprite_state = "helmetblood" var/light_overlay = "helmet_light" diff --git a/code/modules/clothing/head/flowercrowns.dm b/code/modules/clothing/head/flowercrowns.dm index 620e98a4b4e..f65b7513d05 100644 --- a/code/modules/clothing/head/flowercrowns.dm +++ b/code/modules/clothing/head/flowercrowns.dm @@ -2,7 +2,7 @@ name = "wood circlet" desc = "A small wood circlet for making a flower crown." icon_state = "woodcirclet" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL body_cover_flags = 0 /obj/item/clothing/head/woodcirclet/attackby(obj/item/W as obj, mob/user as mob) diff --git a/code/modules/clothing/head/hardhat.dm b/code/modules/clothing/head/hardhat.dm index 021d4f2d122..1cc23a0a178 100644 --- a/code/modules/clothing/head/hardhat.dm +++ b/code/modules/clothing/head/hardhat.dm @@ -8,7 +8,7 @@ inv_hide_flags = 0 siemens_coefficient = 0.9 action_button_name = "Toggle Head-light" - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL ear_protection = 1 drop_sound = 'sound/items/drop/helm.ogg' pickup_sound = 'sound/items/pickup/helm.ogg' diff --git a/code/modules/clothing/head/helmet.dm b/code/modules/clothing/head/helmet.dm index f7f73b1fbf1..9f0cb40f9d1 100644 --- a/code/modules/clothing/head/helmet.dm +++ b/code/modules/clothing/head/helmet.dm @@ -12,7 +12,7 @@ heat_protection_cover = HEAD max_heat_protection_temperature = HELMET_MAX_HEAT_PROTECTION_TEMPERATURE siemens_coefficient = 0.7 - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL ear_protection = 1 drop_sound = 'sound/items/drop/helm.ogg' pickup_sound = 'sound/items/pickup/helm.ogg' diff --git a/code/modules/clothing/head/misc_special.dm b/code/modules/clothing/head/misc_special.dm index 5fca82543f8..4e936cf290d 100644 --- a/code/modules/clothing/head/misc_special.dm +++ b/code/modules/clothing/head/misc_special.dm @@ -24,7 +24,7 @@ body_cover_flags = HEAD|FACE|EYES action_button_name = "Flip Welding Mask" siemens_coefficient = 0.9 - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL var/base_state flash_protection = FLASH_PROTECTION_MAJOR tint = TINT_HEAVY @@ -188,7 +188,7 @@ body_cover_flags = HEAD|FACE|EYES brightness_on = 2 light_overlay = "helmet_light" - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL drop_sound = 'sound/items/drop/herb.ogg' pickup_sound = 'sound/items/pickup/herb.ogg' @@ -232,7 +232,7 @@ icon = 'icons/clothing/head/cage_32x48.dmi' icon_state = "cage" body_cover_flags = HEAD - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL worn_render_flags = WORN_RENDER_SLOT_ONE_FOR_ALL /* diff --git a/code/modules/clothing/head/pilot_helmet.dm b/code/modules/clothing/head/pilot_helmet.dm index 70bdf2fee93..d28d319b5ce 100644 --- a/code/modules/clothing/head/pilot_helmet.dm +++ b/code/modules/clothing/head/pilot_helmet.dm @@ -12,7 +12,7 @@ min_cold_protection_temperature = HELMET_MIN_COLD_PROTECTION_TEMPERATURE heat_protection_cover = HEAD max_heat_protection_temperature = HELMET_MAX_HEAT_PROTECTION_TEMPERATURE - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL var/obj/machinery/computer/shuttle_control/shuttle_comp var/atom/movable/screen/pilot_hud diff --git a/code/modules/clothing/masks/boxing.dm b/code/modules/clothing/masks/boxing.dm index bdb46f1ccbd..69391c2a963 100644 --- a/code/modules/clothing/masks/boxing.dm +++ b/code/modules/clothing/masks/boxing.dm @@ -5,7 +5,7 @@ item_state_slots = list(SLOT_ID_RIGHT_HAND = "bandblack", SLOT_ID_LEFT_HAND = "bandblack") inv_hide_flags = HIDEFACE|BLOCKHAIR body_cover_flags = FACE|HEAD - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL /obj/item/clothing/mask/balaclava/tactical name = "green balaclava" @@ -13,7 +13,7 @@ icon_state = "swatclava" item_state_slots = list(SLOT_ID_RIGHT_HAND = "bandgreen", SLOT_ID_LEFT_HAND = "bandgreen") inv_hide_flags = HIDEFACE|BLOCKHAIR - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL /obj/item/clothing/mask/luchador name = "Luchador Mask" @@ -21,7 +21,7 @@ icon_state = "luchag" inv_hide_flags = HIDEFACE|BLOCKHAIR body_cover_flags = HEAD|FACE - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL siemens_coefficient = 3.0 /obj/item/clothing/mask/luchador/tecnicos diff --git a/code/modules/clothing/masks/breath.dm b/code/modules/clothing/masks/breath.dm index 52b25ed41fd..9635659d100 100644 --- a/code/modules/clothing/masks/breath.dm +++ b/code/modules/clothing/masks/breath.dm @@ -5,7 +5,7 @@ item_state_slots = list(SLOT_ID_RIGHT_HAND = "breath", SLOT_ID_LEFT_HAND = "breath") clothing_flags = ALLOWINTERNALS|FLEXIBLEMATERIAL body_cover_flags = FACE - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL gas_transfer_coefficient = 0.10 permeability_coefficient = 0.50 var/hanging = 0 diff --git a/code/modules/clothing/masks/gasmask.dm b/code/modules/clothing/masks/gasmask.dm index f53a0780d89..0186aca14ed 100644 --- a/code/modules/clothing/masks/gasmask.dm +++ b/code/modules/clothing/masks/gasmask.dm @@ -5,7 +5,7 @@ clothing_flags = BLOCK_GAS_SMOKE_EFFECT | ALLOWINTERNALS | ALLOW_SURVIVALFOOD inv_hide_flags = HIDEEARS|HIDEEYES|HIDEFACE body_cover_flags = FACE|EYES - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL item_state_slots = list(SLOT_ID_RIGHT_HAND = "gas_alt", SLOT_ID_LEFT_HAND = "gas_alt") gas_transfer_coefficient = 0.01 permeability_coefficient = 0.01 @@ -45,7 +45,7 @@ icon_state = "halfgas" siemens_coefficient = 0.7 body_cover_flags = FACE - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL var/hanging = FALSE inv_hide_flags = HIDEFACE action_button_name = "Adjust Face Mask" diff --git a/code/modules/clothing/masks/miscellaneous.dm b/code/modules/clothing/masks/miscellaneous.dm index 7397943fa29..38e7357fac5 100644 --- a/code/modules/clothing/masks/miscellaneous.dm +++ b/code/modules/clothing/masks/miscellaneous.dm @@ -3,7 +3,7 @@ desc = "To stop that awful noise." icon_state = "muzzle" body_cover_flags = FACE - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL gas_transfer_coefficient = 0.90 voicechange = 1 @@ -13,7 +13,7 @@ icon = 'icons/obj/bureaucracy.dmi' icon_state = "tape_cross" item_state_slots = list(SLOT_ID_RIGHT_HAND = null, SLOT_ID_LEFT_HAND = null) - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY /obj/item/clothing/mask/muzzle/Initialize(mapload) . = ..() @@ -22,7 +22,7 @@ // Clumsy folks can't take the mask off themselves. /obj/item/clothing/mask/muzzle/attack_hand(mob/user, list/params) - if(user.item_by_slot(SLOT_ID_MASK) == src && !user.IsAdvancedToolUser()) + if(user.item_by_slot_id(SLOT_ID_MASK) == src && !user.IsAdvancedToolUser()) return 0 ..() /obj/item/clothing/mask/surgical @@ -30,7 +30,7 @@ desc = "A sterile mask designed to help prevent the spread of diseases." icon_state = "sterile" item_state_slots = list(SLOT_ID_RIGHT_HAND = "sterile", SLOT_ID_LEFT_HAND = "sterile") - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL body_cover_flags = FACE clothing_flags = FLEXIBLEMATERIAL gas_transfer_coefficient = 0.90 @@ -67,7 +67,7 @@ desc = "Warning: moustache is fake." icon_state = "fake-moustache" inv_hide_flags = HIDEFACE - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL body_cover_flags = 0 /obj/item/clothing/mask/snorkel @@ -85,7 +85,7 @@ icon_state = "blueneckscarf" body_cover_flags = FACE clothing_flags = FLEXIBLEMATERIAL - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL gas_transfer_coefficient = 0.90 /obj/item/clothing/mask/redscarf @@ -94,7 +94,7 @@ icon_state = "redwhite_scarf" body_cover_flags = FACE clothing_flags = FLEXIBLEMATERIAL - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL gas_transfer_coefficient = 0.90 /obj/item/clothing/mask/greenscarf @@ -103,7 +103,7 @@ icon_state = "green_scarf" body_cover_flags = FACE clothing_flags = FLEXIBLEMATERIAL - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL gas_transfer_coefficient = 0.90 /obj/item/clothing/mask/ninjascarf @@ -112,7 +112,7 @@ icon_state = "ninja_scarf" body_cover_flags = FACE clothing_flags = FLEXIBLEMATERIAL - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL gas_transfer_coefficient = 0.90 siemens_coefficient = 0 @@ -121,28 +121,28 @@ name = "nock mask (blue, scarab)" desc = "To Nock followers, masks symbolize rebirth and a new persona. Damaging the wearer's mask is generally considered an attack on their person itself." icon_state = "nock_scarab" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL body_cover_flags = HEAD|FACE /obj/item/clothing/mask/nock_demon name = "nock mask (purple, demon)" desc = "To Nock followers, masks symbolize rebirth and a new persona. Damaging the wearer's mask is generally considered an attack on their person itself." icon_state = "nock_demon" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL body_cover_flags = HEAD|FACE /obj/item/clothing/mask/nock_life name = "nock mask (green, life)" desc = "To Nock followers, masks symbolize rebirth and a new persona. Damaging the wearer's mask is generally considered an attack on their person itself." icon_state = "nock_life" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL body_cover_flags = HEAD|FACE /obj/item/clothing/mask/nock_ornate name = "nock mask (red, ornate)" desc = "To Nock followers, masks symbolize rebirth and a new persona. Damaging the wearer's mask is generally considered an attack on their person itself." icon_state = "nock_ornate" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL body_cover_flags = HEAD|FACE /obj/item/clothing/mask/horsehead/Initialize(mapload) @@ -191,7 +191,7 @@ item_state_slots = list(SLOT_ID_RIGHT_HAND = "bandblack", SLOT_ID_LEFT_HAND = "bandblack") clothing_flags = ALLOWINTERNALS|FLEXIBLEMATERIAL body_cover_flags = FACE - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL gas_transfer_coefficient = 0.10 permeability_coefficient = 0.50 @@ -203,7 +203,7 @@ /obj/item/clothing/mask/bandana name = "black bandana" desc = "A fine black bandana with nanotech lining. Can be worn on the head or face." - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY inv_hide_flags = HIDEFACE slot_flags = SLOT_MASK|SLOT_HEAD body_cover_flags = FACE diff --git a/code/modules/clothing/shoes/leg_guards.dm b/code/modules/clothing/shoes/leg_guards.dm index 473ac89393f..b88fed8ce0a 100644 --- a/code/modules/clothing/shoes/leg_guards.dm +++ b/code/modules/clothing/shoes/leg_guards.dm @@ -5,7 +5,7 @@ weight = ITEM_WEIGHT_ARMOR_MEDIUM_BOOTS encumbrance = ITEM_ENCUMBRANCE_ARMOR_MEDIUM_BOOTS species_restricted = null //Unathi and Taj can wear leg armor now - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL step_volume_mod = 1.3 can_hold_knife = TRUE drop_sound = 'sound/items/drop/boots.ogg' diff --git a/code/modules/clothing/shoes/miscellaneous.dm b/code/modules/clothing/shoes/miscellaneous.dm index 58de9f113d1..13165d57188 100644 --- a/code/modules/clothing/shoes/miscellaneous.dm +++ b/code/modules/clothing/shoes/miscellaneous.dm @@ -118,7 +118,7 @@ icon_state = "slippers_worn" item_state_slots = list(SLOT_ID_RIGHT_HAND = "slippers", SLOT_ID_LEFT_HAND = "slippers") damage_force = 0 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL /obj/item/clothing/shoes/laceup name = "black oxford shoes" @@ -175,7 +175,7 @@ icon_state = "clothwrap" item_state = "clothwrap" damage_force = 0 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL species_restricted = null drop_sound = 'sound/items/drop/clothing.ogg' pickup_sound = 'sound/items/pickup/cloth.ogg' diff --git a/code/modules/clothing/spacesuits/alien.dm b/code/modules/clothing/spacesuits/alien.dm index 65c08e20b10..bf61251514e 100644 --- a/code/modules/clothing/spacesuits/alien.dm +++ b/code/modules/clothing/spacesuits/alien.dm @@ -30,7 +30,7 @@ // Vox space gear (vaccuum suit, low pressure armour) // Can't be equipped by any other species due to bone structure and vox cybernetics. /obj/item/clothing/suit/space/vox - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL atom_flags = PHORONGUARD clothing_flags = CLOTHING_THICK_MATERIAL | CLOTHING_INJECTION_PORT allowed = list(/obj/item/gun,/obj/item/ammo_magazine,/obj/item/ammo_casing,/obj/item/melee/baton,/obj/item/melee/energy/sword,/obj/item/handcuffs,/obj/item/tank) diff --git a/code/modules/clothing/spacesuits/miscellaneous.dm b/code/modules/clothing/spacesuits/miscellaneous.dm index 5a93bc2fcbb..4b8014e48c8 100644 --- a/code/modules/clothing/spacesuits/miscellaneous.dm +++ b/code/modules/clothing/spacesuits/miscellaneous.dm @@ -19,7 +19,7 @@ name = "Facility Director's armor" desc = "A bulky, heavy-duty piece of exclusive corporate armor. YOU are in charge!" icon_state = "caparmor" - w_class = ITEMSIZE_HUGE + w_class = WEIGHT_CLASS_HUGE gas_transfer_coefficient = 0.01 permeability_coefficient = 0.02 clothing_flags = 0 @@ -91,7 +91,7 @@ name = "pirate coat" desc = "Yarr." icon_state = "pirate" - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL allowed = list(/obj/item/gun,/obj/item/ammo_magazine,/obj/item/ammo_casing,/obj/item/melee/baton,/obj/item/handcuffs,/obj/item/tank/emergency/oxygen) weight = ITEM_WEIGHT_BASELINE encumbrance = ITEM_ENCUMBRANCE_BASELINE diff --git a/code/modules/clothing/spacesuits/spacesuits.dm b/code/modules/clothing/spacesuits/spacesuits.dm index bdea4038fa9..a845a6f8cf7 100644 --- a/code/modules/clothing/spacesuits/spacesuits.dm +++ b/code/modules/clothing/spacesuits/spacesuits.dm @@ -68,7 +68,7 @@ desc = "A suit that protects against low pressure environments." icon = 'icons/obj/clothing/spacesuits.dmi' icon_state = "space" - w_class = ITEMSIZE_HUGE // So you can't fit this in your bag and be prepared at all times. + w_class = WEIGHT_CLASS_HUGE // So you can't fit this in your bag and be prepared at all times. gas_transfer_coefficient = 0.01 permeability_coefficient = 0.02 atom_flags = PHORONGUARD diff --git a/code/modules/clothing/spacesuits/syndi.dm b/code/modules/clothing/spacesuits/syndi.dm index aa7a625237f..51f0fdf7415 100644 --- a/code/modules/clothing/spacesuits/syndi.dm +++ b/code/modules/clothing/spacesuits/syndi.dm @@ -10,7 +10,7 @@ name = "red space suit" icon_state = "syndicate" desc = "A crimson spacesuit sporting clean lines and durable plating. Robust, reliable, and slightly suspicious." - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL allowed = list(/obj/item/gun,/obj/item/ammo_magazine,/obj/item/ammo_casing,/obj/item/melee/baton,/obj/item/melee/energy/sword,/obj/item/handcuffs,/obj/item/tank/emergency/oxygen) armor_type = /datum/armor/agent/space siemens_coefficient = 0.6 diff --git a/code/modules/clothing/spacesuits/void/merc.dm b/code/modules/clothing/spacesuits/void/merc.dm index c9fb92ef5ed..c3c486d93f3 100644 --- a/code/modules/clothing/spacesuits/void/merc.dm +++ b/code/modules/clothing/spacesuits/void/merc.dm @@ -18,7 +18,7 @@ item_state_slots = list(SLOT_ID_RIGHT_HAND = "syndie_voidsuit", SLOT_ID_LEFT_HAND = "syndie_voidsuit") encumbrance = ITEM_ENCUMBRANCE_VOIDSUIT weight = ITEM_WEIGHT_VOIDSUIT - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL armor_type = /datum/armor/merc/space allowed = list(/obj/item/flashlight,/obj/item/tank,/obj/item/suit_cooling_unit,/obj/item/gun,/obj/item/ammo_magazine,/obj/item/ammo_casing,/obj/item/melee/baton,/obj/item/melee/energy/sword,/obj/item/handcuffs) siemens_coefficient = 0.6 @@ -89,7 +89,7 @@ name = "clown commando voidsuit" desc = "An advanced suit that protects against injuries during special operations. An intricate bananium wafer in the shape of a banana bears the crest of Columbina." item_state_slots = list(SLOT_ID_RIGHT_HAND = "syndie_voidsuit", SLOT_ID_LEFT_HAND = "syndie_voidsuit") - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL armor_type = /datum/armor/merc/space/clown allowed = list(/obj/item/flashlight,/obj/item/tank,/obj/item/suit_cooling_unit,/obj/item/gun,/obj/item/ammo_magazine,/obj/item/ammo_casing,/obj/item/melee/baton,/obj/item/melee/energy/sword,/obj/item/handcuffs) siemens_coefficient = 0.6 @@ -109,7 +109,7 @@ icon_state = "odst" name = "hephaestus icarus suit" desc = "One of the few combat-grade suits avalible in the frontier, and the poster-child of Hephaestus Industries. Comes equipped with a wrist-bound oxygen timer." - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL armor_type = /datum/armor/station/secsuit allowed = list(/obj/item/flashlight,/obj/item/tank,/obj/item/suit_cooling_unit,/obj/item/gun,/obj/item/ammo_magazine,/obj/item/ammo_casing,/obj/item/melee/baton,/obj/item/melee/energy/sword,/obj/item/handcuffs) siemens_coefficient = 0.6 @@ -128,7 +128,7 @@ icon_state = "odst_corps" name = "hephaestus icarus medic suit" desc = "A standard Icarus line suit that has been repourposed to protect from heavier biohazards." - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL armor_type = /datum/armor/exploration/space allowed = list(/obj/item/flashlight,/obj/item/tank,/obj/item/suit_cooling_unit,/obj/item/gun,/obj/item/ammo_magazine,/obj/item/ammo_casing,/obj/item/melee/baton,/obj/item/melee/energy/sword,/obj/item/handcuffs) siemens_coefficient = 0.6 @@ -147,7 +147,7 @@ icon_state = "odst_orange" name = "hephaestus icarus engineer suit" desc = "Favoured suit of deep-space engineers, comfortable and comparable to suits avalible to NanoTrasen Engineers. Comes equipped with a wrist-bound oxygen timer." - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL armor_type = /datum/armor/engineering/space allowed = list(/obj/item/flashlight,/obj/item/tank,/obj/item/suit_cooling_unit,/obj/item/gun,/obj/item/ammo_magazine,/obj/item/ammo_casing,/obj/item/melee/baton,/obj/item/melee/energy/sword,/obj/item/handcuffs) siemens_coefficient = 0.6 @@ -166,7 +166,7 @@ icon_state = "odst_purple" name = "hephaestus icarus frontier suit" desc = "Cheaper version of the main Icarus line, often marketed to Frontier settlements. Perfect for Expeditions." - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL armor_type = /datum/armor/exploration/space allowed = list(/obj/item/flashlight,/obj/item/tank,/obj/item/suit_cooling_unit,/obj/item/gun,/obj/item/ammo_magazine,/obj/item/ammo_casing,/obj/item/melee/baton,/obj/item/melee/energy/sword,/obj/item/handcuffs) siemens_coefficient = 0.6 @@ -189,7 +189,7 @@ name = "necropolis operations suit" desc = "The main suit used by Necropolis Industries security division, a heavily modified Hephaestus Icarus suit emblazoned with the Necropolis logo on the left shoulder. Equipped with direct connections to the user's implants and prosthetics, making it function as a second skin." item_state_slots = list(SLOT_ID_RIGHT_HAND = "syndie_voidsuit", SLOT_ID_LEFT_HAND = "syndie_voidsuit") - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL armor_type = /datum/armor/merc/space allowed = list(/obj/item/flashlight,/obj/item/tank,/obj/item/suit_cooling_unit,/obj/item/gun,/obj/item/ammo_magazine,/obj/item/ammo_casing,/obj/item/melee/baton,/obj/item/melee/energy/sword,/obj/item/handcuffs) siemens_coefficient = 0.6 @@ -200,7 +200,7 @@ name = "necropolis field medic suit" desc = "The main suit used by Necropolis Industries security division, a heavily modified Hephaestheus Icarus suit emblazoned with the Necropolis logo on the left shoulder and a blue cross on the right arm. Equipped with direct connections to the user's implants and prosthetics, making it function as a second skin." item_state_slots = list(SLOT_ID_RIGHT_HAND = "syndie_voidsuit", SLOT_ID_LEFT_HAND = "syndie_voidsuit") - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL armor_type = /datum/armor/merc/space allowed = list(/obj/item/flashlight,/obj/item/tank,/obj/item/suit_cooling_unit,/obj/item/gun,/obj/item/ammo_magazine,/obj/item/ammo_casing,/obj/item/melee/baton,/obj/item/melee/energy/sword,/obj/item/handcuffs) siemens_coefficient = 0.6 diff --git a/code/modules/clothing/spacesuits/void/void_vr.dm b/code/modules/clothing/spacesuits/void/void_vr.dm index 756207f9efc..4b1cc4dfd5d 100644 --- a/code/modules/clothing/spacesuits/void/void_vr.dm +++ b/code/modules/clothing/spacesuits/void/void_vr.dm @@ -120,7 +120,7 @@ siemens_coefficient = 1 species_restricted = list("exclude",SPECIES_DIONA,SPECIES_VOX) //this thing can autoadapt breach_threshold = 6 //this thing is basically tissue paper - w_class = ITEMSIZE_NORMAL //if it's snug, high-tech, and made of relatively soft materials, it should be much easier to store! + w_class = WEIGHT_CLASS_NORMAL //if it's snug, high-tech, and made of relatively soft materials, it should be much easier to store! /obj/item/clothing/suit/space/void/autolok/Initialize(mapload) . = ..() diff --git a/code/modules/clothing/spacesuits/void/wizard.dm b/code/modules/clothing/spacesuits/void/wizard.dm index fc0fed8711f..65ec8be3262 100644 --- a/code/modules/clothing/spacesuits/void/wizard.dm +++ b/code/modules/clothing/spacesuits/void/wizard.dm @@ -18,7 +18,7 @@ item_state_slots = list(SLOT_ID_RIGHT_HAND = "wiz_voidsuit", SLOT_ID_LEFT_HAND = "wiz_voidsuit") encumbrance = ITEM_ENCUMBRANCE_VOIDSUIT_LIGHT weight = ITEM_WEIGHT_VOIDSUIT_LIGHT - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL integrity_flags = INTEGRITY_ACIDPROOF armor_type = /datum/armor/wizard siemens_coefficient = 0.7 diff --git a/code/modules/clothing/suits/_suit.dm b/code/modules/clothing/suits/_suit.dm index 625d47f5035..621a3809bb3 100644 --- a/code/modules/clothing/suits/_suit.dm +++ b/code/modules/clothing/suits/_suit.dm @@ -10,7 +10,7 @@ slot_flags = SLOT_OCLOTHING var/blood_overlay_type = "suit" siemens_coefficient = 0.9 - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL preserve_item = 1 var/taurized = FALSE //Easier than trying to 'compare icons' to see if it's a taur suit diff --git a/code/modules/clothing/suits/armor.dm b/code/modules/clothing/suits/armor.dm index 7011facee5d..6c9a9b5bc44 100644 --- a/code/modules/clothing/suits/armor.dm +++ b/code/modules/clothing/suits/armor.dm @@ -145,7 +145,7 @@ allowed = list(/obj/item/gun,/obj/item/ammo_magazine,/obj/item/ammo_casing,/obj/item/melee/baton,/obj/item/handcuffs,/obj/item/tank/emergency/oxygen,/obj/item/clothing/head/helmet) encumbrance = ITEM_ENCUMBRANCE_ARMOR_HEAVY + ITEM_ENCUMBRANCE_ARMOR_HEAVY_BOOTS + ITEM_ENCUMBRANCE_ARMOR_HEAVY_GLOVES weight = ITEM_WEIGHT_ARMOR_HEAVY + ITEM_WEIGHT_ARMOR_HEAVY_BOOTS + ITEM_WEIGHT_ARMOR_HEAVY_GLOVES - w_class = ITEMSIZE_HUGE + w_class = WEIGHT_CLASS_HUGE armor_type = /datum/armor/centcom/deathsquad inv_hide_flags = HIDEGLOVES|HIDESHOES|HIDEJUMPSUIT|HIDETIE|HIDEHOLSTER cold_protection_cover = UPPER_TORSO | LOWER_TORSO | LEGS | FEET | ARMS | HANDS @@ -461,6 +461,7 @@ armor_type = /datum/armor/station/heavy encumbrance = ITEM_ENCUMBRANCE_ARMOR_HEAVY weight = ITEM_WEIGHT_ARMOR_HEAVY + max_combined_volume = WEIGHT_VOLUME_SMALL * 4 /obj/item/clothing/suit/storage/vest/heavy/officer name = "officer heavy armor vest" @@ -557,7 +558,7 @@ desc = "A suit that protects against some damage." icon_state = "centcom" item_state_slots = list(SLOT_ID_RIGHT_HAND = "armor", SLOT_ID_LEFT_HAND = "armor") - w_class = ITEMSIZE_LARGE//bulky item + w_class = WEIGHT_CLASS_BULKY//bulky item body_cover_flags = UPPER_TORSO|LOWER_TORSO|LEGS|FEET|ARMS|HANDS allowed = list(/obj/item/gun/ballistic/sec/flash, /obj/item/gun/energy,/obj/item/melee/baton,/obj/item/handcuffs,/obj/item/tank/emergency/oxygen,/obj/item/clothing/head/helmet) inv_hide_flags = HIDEGLOVES|HIDESHOES|HIDEJUMPSUIT|HIDETIE|HIDEHOLSTER @@ -571,7 +572,7 @@ icon_state = "heavy" item_state_slots = list(SLOT_ID_RIGHT_HAND = "swat", SLOT_ID_LEFT_HAND = "swat") armor_type = /datum/armor/security/bulky_kinetic - w_class = ITEMSIZE_HUGE // Very bulky, very heavy. + w_class = WEIGHT_CLASS_HUGE // Very bulky, very heavy. gas_transfer_coefficient = 0.90 body_cover_flags = UPPER_TORSO|LOWER_TORSO|LEGS|FEET|ARMS|HANDS inv_hide_flags = HIDEGLOVES|HIDESHOES|HIDEJUMPSUIT|HIDETIE|HIDEHOLSTER @@ -602,7 +603,7 @@ icon_state = "samurai" item_state_slots = list(SLOT_ID_RIGHT_HAND = "leather_coat", SLOT_ID_LEFT_HAND = "leather_coat") armor_type = /datum/armor/general/samurai - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY body_cover_flags = UPPER_TORSO|LOWER_TORSO|LEGS|FEET|ARMS|HANDS inv_hide_flags = HIDETIE|HIDEHOLSTER siemens_coefficient = 0.6 diff --git a/code/modules/clothing/suits/bio.dm b/code/modules/clothing/suits/bio.dm index 83551e03715..fbf0309fa00 100644 --- a/code/modules/clothing/suits/bio.dm +++ b/code/modules/clothing/suits/bio.dm @@ -16,7 +16,7 @@ name = "bio suit" desc = "A suit that protects against biological contamination." icon_state = "bio" - w_class = ITEMSIZE_LARGE//bulky item + w_class = WEIGHT_CLASS_BULKY//bulky item gas_transfer_coefficient = 0.01 permeability_coefficient = 0.01 body_cover_flags = UPPER_TORSO|LOWER_TORSO|LEGS|ARMS|HANDS|FEET @@ -110,7 +110,7 @@ name = "beekeeping suit" desc = "A thick suit that protects against stinging insects." icon_state = "beekeeper" - w_class = ITEMSIZE_LARGE//bulky item + w_class = WEIGHT_CLASS_BULKY//bulky item gas_transfer_coefficient = 0.01 permeability_coefficient = 0.01 body_cover_flags = UPPER_TORSO|LOWER_TORSO|LEGS|ARMS|HANDS|FEET diff --git a/code/modules/clothing/suits/miscellaneous.dm b/code/modules/clothing/suits/miscellaneous.dm index 06d06333299..a8947c30401 100644 --- a/code/modules/clothing/suits/miscellaneous.dm +++ b/code/modules/clothing/suits/miscellaneous.dm @@ -96,7 +96,7 @@ icon = 'icons/obj/clothing/spacesuits.dmi' icon_state = "syndicate" desc = "A plastic replica of the syndicate space suit, you'll look just like a real murderous syndicate agent in this! This is a toy, it is not made for use in space!" - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL allowed = list(/obj/item/flashlight,/obj/item/tank/emergency/oxygen,/obj/item/toy) inv_hide_flags = HIDEGLOVES|HIDESHOES|HIDEJUMPSUIT|HIDETAIL|HIDETIE|HIDEHOLSTER body_cover_flags = UPPER_TORSO|LOWER_TORSO|ARMS|HANDS|LEGS|FEET @@ -306,7 +306,7 @@ . = ..() if(slot == SLOT_ID_SUIT) user.drop_all_held_items() - user.drop_item_to_ground(user.item_by_slot(SLOT_ID_HANDCUFFED), INV_OP_FORCE) + user.drop_item_to_ground(user.item_by_slot_id(SLOT_ID_HANDCUFFED), INV_OP_FORCE) /obj/item/clothing/suit/ianshirt name = "worn shirt" @@ -1387,7 +1387,7 @@ desc = "An utterly ancient suit of Earth armor, reverently maintained and restored over the years. This appears less sturdy than the authentic article." icon_state = "samurai_colorable" item_state_slots = list(SLOT_ID_RIGHT_HAND = "leather_coat", SLOT_ID_LEFT_HAND = "leather_coat") - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY body_cover_flags = UPPER_TORSO|LOWER_TORSO|LEGS|FEET|ARMS|HANDS inv_hide_flags = HIDETIE|HIDEHOLSTER diff --git a/code/modules/clothing/suits/storage.dm b/code/modules/clothing/suits/storage.dm index f1ecfd37958..c507cc3616f 100644 --- a/code/modules/clothing/suits/storage.dm +++ b/code/modules/clothing/suits/storage.dm @@ -1,38 +1,96 @@ /obj/item/clothing/suit/storage - var/obj/item/storage/internal/pockets - var/slots = 2 + //* Directly passed to storage system. *// + + var/list/insertion_whitelist + var/list/insertion_blacklist + var/list/insertion_allow + + var/max_single_weight_class = WEIGHT_CLASS_SMALL + var/max_combined_weight_class + var/max_combined_volume = WEIGHT_VOLUME_SMALL * 4 + var/max_items + + var/weight_subtract = 0 + var/weight_multiply = 1 + + var/allow_mass_gather = FALSE + var/allow_mass_gather_mode_switch = TRUE + var/mass_gather_mode = STORAGE_QUICK_GATHER_COLLECT_ALL + + var/allow_quick_empty = FALSE + var/allow_quick_empty_via_clickdrag = TRUE + var/allow_quick_empty_via_attack_self = TRUE + + var/sfx_open = "rustle" + var/sfx_insert = "rustle" + var/sfx_remove = "rustle" + + var/ui_numerical_mode = FALSE + + //* Initialization *// + + /// storage datum path + var/storage_datum_path = /datum/object_system/storage + /// Cleared after Initialize(). + /// List of types associated to amounts. + var/list/starts_with + /// set to prevent us from spawning starts_with + var/empty = FALSE /obj/item/clothing/suit/storage/Initialize(mapload) . = ..() - pockets = new/obj/item/storage/internal(src, slots, ITEMSIZE_SMALL) // Fit only pocket sized items - pockets.max_w_class = ITEMSIZE_SMALL // Fit only pocket sized items - pockets.max_storage_space = ITEMSIZE_COST_SMALL * 2 + initialize_storage() + spawn_contents() -/obj/item/clothing/suit/storage/Destroy() - QDEL_NULL(pockets) - . = ..() +/** + * Make sure to set [worth_dynamic] to TRUE if this does more than spawning what's in starts_with. + */ +/obj/item/clothing/suit/storage/proc/spawn_contents() + if(length(starts_with) && !empty) + // this is way too permissive already + var/safety = 256 + var/atom/where_real_contents = obj_storage.real_contents_loc() + for(var/path in starts_with) + var/amount = starts_with[path] || 1 + for(var/i in 1 to amount) + if(!--safety) + CRASH("tried to spawn too many objects") + new path(where_real_contents) + starts_with = null + +/obj/item/clothing/suit/storage/proc/initialize_storage() + ASSERT(isnull(obj_storage)) + init_storage(storage_datum_path, TRUE) + obj_storage.set_insertion_allow(insertion_allow) + obj_storage.set_insertion_whitelist(insertion_whitelist) + obj_storage.set_insertion_blacklist(insertion_blacklist) + + obj_storage.max_single_weight_class = max_single_weight_class + obj_storage.max_combined_weight_class = max_combined_weight_class + obj_storage.max_combined_volume = max_combined_volume + obj_storage.max_items = max_items + + obj_storage.weight_subtract = weight_subtract + obj_storage.weight_multiply = weight_multiply + + obj_storage.allow_mass_gather = allow_mass_gather + obj_storage.allow_mass_gather_mode_switch = allow_mass_gather_mode_switch + obj_storage.mass_gather_mode = mass_gather_mode + + obj_storage.allow_quick_empty = allow_quick_empty + obj_storage.allow_quick_empty_via_clickdrag = allow_quick_empty_via_clickdrag + obj_storage.allow_quick_empty_via_attack_self = allow_quick_empty_via_attack_self + + obj_storage.sfx_open = sfx_open + obj_storage.sfx_insert = sfx_insert + obj_storage.sfx_remove = sfx_remove + + obj_storage.ui_numerical_mode = ui_numerical_mode /obj/item/clothing/suit/storage/toggle/AltClick() // This only works for things that can be toggled, of course. ..() ToggleButtons() -/obj/item/clothing/suit/storage/attack_hand(mob/user, list/params) - if (pockets.handle_attack_hand(user)) - ..(user) - -/obj/item/clothing/suit/storage/OnMouseDropLegacy(obj/over_object as obj) - if (pockets.handle_mousedrop(usr, over_object)) - ..(over_object) - -/obj/item/clothing/suit/storage/attackby(obj/item/W as obj, mob/user as mob) - ..() - if(!(W in accessories)) // Make sure that an accessory wasn't successfully attached to suit. - pockets.attackby(W, user) - -/obj/item/clothing/suit/storage/emp_act(severity) - pockets.emp_act(severity) - ..() - //Jackets with buttons, used for labcoats, IA jackets, First Responder jackets, and brown jackets. /obj/item/clothing/suit/storage/toggle inv_hide_flags = HIDEHOLSTER @@ -85,14 +143,6 @@ return update_worn_icon() //so our overlays update - -//New Vest 4 pocket storage and badge toggles, until suit accessories are a thing. -/obj/item/clothing/suit/storage/vest/heavy/Initialize(mapload) - . = ..() - pockets = new/obj/item/storage/internal(src) - pockets.max_w_class = ITEMSIZE_SMALL - pockets.max_storage_space = ITEMSIZE_COST_SMALL * 4 - /obj/item/clothing/suit/storage/vest var/icon_badge var/icon_nobadge diff --git a/code/modules/clothing/suits/utility.dm b/code/modules/clothing/suits/utility.dm index a82fa3bb3e7..d151cf25474 100644 --- a/code/modules/clothing/suits/utility.dm +++ b/code/modules/clothing/suits/utility.dm @@ -13,7 +13,7 @@ name = "firesuit" desc = "A suit that protects against fire and heat." icon_state = "fire" - w_class = ITEMSIZE_LARGE//bulky item + w_class = WEIGHT_CLASS_BULKY//bulky item gas_transfer_coefficient = 0.90 permeability_coefficient = 0.50 body_cover_flags = UPPER_TORSO|LOWER_TORSO|LEGS|FEET|ARMS|HANDS @@ -50,7 +50,7 @@ name = "bomb suit" desc = "A suit designed for safety when handling explosives." icon_state = "bombsuit" - w_class = ITEMSIZE_LARGE//bulky item + w_class = WEIGHT_CLASS_BULKY//bulky item gas_transfer_coefficient = 0.01 permeability_coefficient = 0.01 encumbrance = ITEM_ENCUMBRANCE_ARMOR_BOMB_SUIT @@ -88,7 +88,7 @@ name = "Radiation suit" desc = "A suit that protects against radiation. Label: Made with lead, do not eat insulation." icon_state = "rad" - w_class = ITEMSIZE_LARGE//bulky item + w_class = WEIGHT_CLASS_BULKY//bulky item gas_transfer_coefficient = 0.90 permeability_coefficient = 0.50 body_cover_flags = UPPER_TORSO|LOWER_TORSO|LEGS|ARMS|HANDS|FEET diff --git a/code/modules/clothing/under/_under.dm b/code/modules/clothing/under/_under.dm index 98d72bd99c7..f5fef8dad1f 100644 --- a/code/modules/clothing/under/_under.dm +++ b/code/modules/clothing/under/_under.dm @@ -8,9 +8,10 @@ slot_flags = SLOT_ICLOTHING armor_type = /datum/armor/none equip_sound = 'sound/items/jumpsuit_equip.ogg' - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL show_messages = 1 blood_sprite_state = "uniformblood" + attack_hand_auto_unequip = FALSE //! Suit Sensors /// do we have suit sensors? @@ -66,14 +67,6 @@ var/icon/rolled_down_icon = 'icons/mob/clothing/uniform_rolled_down.dmi' var/icon/rolled_down_sleeves_icon = 'icons/mob/clothing/uniform_sleeves_rolled.dmi' -// todo kick to item flag for auto-unequip-without-clickdrag -/obj/item/clothing/under/attack_hand(mob/user, list/params) - if(LAZYLEN(accessories)) - ..() - if ((ishuman(usr) || issmall(usr)) && src.loc == user) - return - ..() - /obj/item/clothing/under/Initialize(mapload) . = ..() CONSTRUCT_BODYTYPES(worn_rolldown_bodytypes) @@ -84,8 +77,6 @@ snowflake_worn_state = item_state_slots?[SLOT_ID_UNIFORM] || item_state || icon_state addtimer(CALLBACK(src, PROC_REF(init_sensors)), 0) - - /obj/item/clothing/under/proc/init_sensors() var/mob/living/carbon/human/H = loc if(!istype(H)) diff --git a/code/modules/clothing/under/accessories/accessory.dm b/code/modules/clothing/under/accessories/accessory.dm index 93526fdeb13..fb60cde9031 100644 --- a/code/modules/clothing/under/accessories/accessory.dm +++ b/code/modules/clothing/under/accessories/accessory.dm @@ -6,7 +6,7 @@ item_state_slots = list(slot_r_hand_str = "", slot_l_hand_str = "") appearance_flags = RESET_COLOR // Stops accessory_host's color from being multiplied onto the accessory slot_flags = SLOT_TIE - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL accessory_render_legacy = TRUE accessory_render_specific = FALSE var/slot = ACCESSORY_SLOT_DECOR diff --git a/code/modules/clothing/under/accessories/armor.dm b/code/modules/clothing/under/accessories/armor.dm index 14e6d99e736..a641b26a22c 100644 --- a/code/modules/clothing/under/accessories/armor.dm +++ b/code/modules/clothing/under/accessories/armor.dm @@ -8,7 +8,7 @@ icon_override = 'icons/mob/clothing/modular_armor.dmi' icon = 'icons/obj/clothing/modular_armor.dmi' icon_state = "pouches" - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL /obj/item/clothing/accessory/armor/on_attached(var/obj/item/clothing/S, var/mob/user) if(ishuman(user)) @@ -37,10 +37,10 @@ icon_override = 'icons/mob/clothing/modular_armor.dmi' icon = 'icons/obj/clothing/modular_armor.dmi' icon_state = "pouches" - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL gender = PLURAL slot = ACCESSORY_SLOT_ARMOR_S - slots = 2 + max_combined_volume = WEIGHT_VOLUME_SMALL * 2 /obj/item/clothing/accessory/storage/pouches/blue desc = "A collection of blue pouches that can be attached to a plate carrier. Carries up to two items." @@ -62,7 +62,7 @@ name = "large storage pouches" desc = "A collection of black pouches that can be attached to a plate carrier. Carries up to four items." icon_state = "lpouches" - slots = 4 + max_combined_volume = WEIGHT_VOLUME_SMALL * 4 weight = ITEM_WEIGHT_STORAGE_POUCH_LARGE encumbrance = ITEM_ENCUMBRANCE_STORAGE_POUCH_LARGE @@ -93,21 +93,14 @@ icon = 'icons/obj/clothing/modular_armor.dmi' icon_state = "shotholder" slot = ACCESSORY_SLOT_ARMOR_S - slots = 4 + max_combined_volume = WEIGHT_VOLUME_SMALL * 4 + insertion_whitelist = list( + /obj/item/ammo_casing/a12g, + ) -/obj/item/clothing/accessory/storage/shotgun_shell_holder/update_icon(updates) - . = ..() - var/amt = length(hold.contents) - icon_state = "shotholder-[amt]" - -/obj/item/clothing/accessory/storage/shotgun_shell_holder/attackby(obj/item/W as obj, mob/user as mob) - if(istype(W, /obj/item/ammo_casing/a12g)) - . = hold.attackby(W, user) - update_icon() - accessory_host?.update_icon() - return - else - to_chat(user, SPAN_WARNING("The [src] can only hold 12-gauge shells!")) +/obj/item/clothing/accessory/storage/shotgun_shell_holder/update_icon_state() + icon_state = "shotholder-[length(contents)]" + return ..() //////////////// //Armor plates @@ -335,7 +328,7 @@ // accessory_icons = list(slot_tie_str = 'icons/mob/clothing/modular_armor.dmi', SLOT_ID_SUIt = 'icons/mob/clothing/modular_armor.dmi') icon_state = "solflag" slot = ACCESSORY_SLOT_ARMOR_M - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL //Nanotrasen /obj/item/clothing/accessory/armor/tag/nts diff --git a/code/modules/clothing/under/accessories/bracelets/_bracelets.dm b/code/modules/clothing/under/accessories/bracelets/_bracelets.dm index a0e52be649b..b0d5fec0031 100644 --- a/code/modules/clothing/under/accessories/bracelets/_bracelets.dm +++ b/code/modules/clothing/under/accessories/bracelets/_bracelets.dm @@ -3,7 +3,7 @@ desc = "A simple silver bracelet with a clasp." icon = 'icons/obj/clothing/ties.dmi' icon_state = "bracelet" - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY slot_flags = SLOT_TIE slot = ACCESSORY_SLOT_DECOR diff --git a/code/modules/clothing/under/accessories/clothing.dm b/code/modules/clothing/under/accessories/clothing.dm index d27b3569624..b74994e70d8 100644 --- a/code/modules/clothing/under/accessories/clothing.dm +++ b/code/modules/clothing/under/accessories/clothing.dm @@ -55,7 +55,7 @@ slot_flags = SLOT_OCLOTHING | SLOT_TIE body_cover_flags = UPPER_TORSO|LOWER_TORSO|ARMS|LEGS siemens_coefficient = 0.9 - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL slot = ACCESSORY_SLOT_OVER /obj/item/clothing/accessory/poncho/equipped(mob/user, slot, flags) //Solution for race-specific sprites for an accessory which is also a suit. Suit icons break if you don't use icon override which then also overrides race-specific sprites. @@ -176,7 +176,7 @@ slot_flags = SLOT_OCLOTHING | SLOT_TIE body_cover_flags = UPPER_TORSO|ARMS siemens_coefficient = 0.9 - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL slot = ACCESSORY_SLOT_OVER /obj/item/clothing/accessory/replika/klbr @@ -337,7 +337,7 @@ slot_flags = SLOT_OCLOTHING | SLOT_TIE body_cover_flags = UPPER_TORSO|LOWER_TORSO siemens_coefficient = 0.9 - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL slot = ACCESSORY_SLOT_OVER /obj/item/clothing/accessory/hawaii/red @@ -364,7 +364,7 @@ slot_flags = SLOT_OCLOTHING | SLOT_TIE body_cover_flags = UPPER_TORSO|LOWER_TORSO siemens_coefficient = 0.9 - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL slot = ACCESSORY_SLOT_OVER /obj/item/clothing/accessory/wcoat/red @@ -416,7 +416,7 @@ slot_flags = SLOT_OCLOTHING | SLOT_TIE body_cover_flags = UPPER_TORSO|LOWER_TORSO siemens_coefficient = 0.9 - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL slot = ACCESSORY_SLOT_DECOR /obj/item/clothing/accessory/buttonup/untucked @@ -434,7 +434,7 @@ slot_flags = SLOT_OCLOTHING | SLOT_TIE body_cover_flags = UPPER_TORSO|LOWER_TORSO|ARMS siemens_coefficient = 0.9 - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL slot = ACCESSORY_SLOT_OVER sprite_sheets = list( diff --git a/code/modules/clothing/under/accessories/holster.dm b/code/modules/clothing/under/accessories/holster.dm index 5e9c472cca6..5e5b9173ad0 100644 --- a/code/modules/clothing/under/accessories/holster.dm +++ b/code/modules/clothing/under/accessories/holster.dm @@ -32,7 +32,7 @@ holstered = I holstered.add_fingerprint(user) - w_class = max(w_class, holstered.w_class) + set_weight_class(max(w_class, holstered.w_class)) user.visible_message("[user] [holster_verb]s \the [holstered].", "You [holster_verb] \the [holstered].") name = "occupied [initial(name)]" playsound(user, "[sound_in]", 75, 0) @@ -63,7 +63,7 @@ user.put_in_hands(holstered) playsound(user, "[sound_out]", 75, 0) holstered.add_fingerprint(user) - w_class = initial(w_class) + set_weight_class(initial(w_class)) clear_holster() /obj/item/clothing/accessory/holster/attack_hand(mob/user, list/params) diff --git a/code/modules/clothing/under/accessories/lockets.dm b/code/modules/clothing/under/accessories/lockets.dm index d2c97417ee2..8b53a4f70ce 100644 --- a/code/modules/clothing/under/accessories/lockets.dm +++ b/code/modules/clothing/under/accessories/lockets.dm @@ -4,7 +4,7 @@ icon_state = "locket" drop_sound = 'sound/items/drop/ring.ogg' pickup_sound = 'sound/items/pickup/ring.ogg' - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL slot_flags = SLOT_MASK | SLOT_TIE slot = ACCESSORY_SLOT_DECOR var/base_icon diff --git a/code/modules/clothing/under/accessories/permits.dm b/code/modules/clothing/under/accessories/permits.dm index 428cf460fbb..7dac529899a 100755 --- a/code/modules/clothing/under/accessories/permits.dm +++ b/code/modules/clothing/under/accessories/permits.dm @@ -5,7 +5,7 @@ desc = "A permit for something." icon = 'icons/obj/card_cit.dmi' icon_state = "permit-generic" - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY slot = ACCESSORY_SLOT_MEDAL var/owner = 0 //To prevent people from just renaming the thing if they steal it diff --git a/code/modules/clothing/under/accessories/shiny_vr.dm b/code/modules/clothing/under/accessories/shiny_vr.dm index 2c41443d5d7..5e1e495bf6c 100644 --- a/code/modules/clothing/under/accessories/shiny_vr.dm +++ b/code/modules/clothing/under/accessories/shiny_vr.dm @@ -1,7 +1,7 @@ /obj/item/clothing/accessory/shiny icon_override = 'icons/mob/clothing/modular_latex.dmi' icon = 'icons/obj/clothing/modular_shiny.dmi' - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL desc = "Shiny! They look like they need to be attached to something, else they'll just fall off." /obj/item/clothing/accessory/shiny/gloves diff --git a/code/modules/clothing/under/accessories/storage.dm b/code/modules/clothing/under/accessories/storage.dm index 34a26899d12..ae102ce213d 100644 --- a/code/modules/clothing/under/accessories/storage.dm +++ b/code/modules/clothing/under/accessories/storage.dm @@ -5,97 +5,161 @@ slot = ACCESSORY_SLOT_UTILITY show_messages = 1 - var/slots = 5 - var/obj/item/storage/internal/hold - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL on_rolled = list("down" = "none") var/hide_on_roll = FALSE + //* Directly passed to storage system. *// + + var/list/insertion_whitelist + var/list/insertion_blacklist + var/list/insertion_allow + + var/max_single_weight_class = WEIGHT_CLASS_SMALL + var/max_combined_weight_class + var/max_combined_volume = WEIGHT_VOLUME_SMALL * 4 + var/max_items + + var/weight_subtract = 0 + var/weight_multiply = 1 + + var/allow_mass_gather = FALSE + var/allow_mass_gather_mode_switch = TRUE + var/mass_gather_mode = STORAGE_QUICK_GATHER_COLLECT_ALL + + var/allow_quick_empty = FALSE + var/allow_quick_empty_via_clickdrag = TRUE + var/allow_quick_empty_via_attack_self = TRUE + + var/sfx_open = "rustle" + var/sfx_insert = "rustle" + var/sfx_remove = "rustle" + + var/ui_numerical_mode = FALSE + + //* Initialization *// + + /// storage datum path + var/storage_datum_path = /datum/object_system/storage + /// Cleared after Initialize(). + /// List of types associated to amounts. + var/list/starts_with + /// set to prevent us from spawning starts_with + var/empty = FALSE + /obj/item/clothing/accessory/storage/Initialize(mapload) . = ..() - hold = new/obj/item/storage/internal(src) - hold.max_storage_space = slots * 2 - hold.max_w_class = ITEMSIZE_SMALL + initialize_storage() + spawn_contents() + if (!hide_on_roll) on_rolled["down"] = icon_state -/obj/item/clothing/accessory/storage/attack_hand(mob/user, list/params) - if (accessory_host) //if we are part of a suit - hold.open(user) - return +/** + * Make sure to set [worth_dynamic] to TRUE if this does more than spawning what's in starts_with. + */ +/obj/item/clothing/accessory/storage/proc/spawn_contents() + if(length(starts_with) && !empty) + // this is way too permissive already + var/safety = 256 + var/atom/where_real_contents = obj_storage.real_contents_loc() + for(var/path in starts_with) + var/amount = starts_with[path] || 1 + for(var/i in 1 to amount) + if(!--safety) + CRASH("tried to spawn too many objects") + new path(where_real_contents) + starts_with = null - if (hold.handle_attack_hand(user)) //otherwise interact as a regular storage item - ..(user) +/obj/item/clothing/accessory/storage/proc/initialize_storage() + ASSERT(isnull(obj_storage)) + init_storage(storage_datum_path, TRUE) + obj_storage.set_insertion_allow(insertion_allow) + obj_storage.set_insertion_whitelist(insertion_whitelist) + obj_storage.set_insertion_blacklist(insertion_blacklist) -/obj/item/clothing/accessory/storage/OnMouseDropLegacy(obj/over_object as obj) - if (accessory_host) - return + obj_storage.max_single_weight_class = max_single_weight_class + obj_storage.max_combined_weight_class = max_combined_weight_class + obj_storage.max_combined_volume = max_combined_volume + obj_storage.max_items = max_items - if (hold.handle_mousedrop(usr, over_object)) - ..(over_object) + obj_storage.weight_subtract = weight_subtract + obj_storage.weight_multiply = weight_multiply -/obj/item/clothing/accessory/storage/attackby(obj/item/W as obj, mob/user as mob) - return hold.attackby(W, user) + obj_storage.allow_mass_gather = allow_mass_gather + obj_storage.allow_mass_gather_mode_switch = allow_mass_gather_mode_switch + obj_storage.mass_gather_mode = mass_gather_mode -/obj/item/clothing/accessory/storage/emp_act(severity) - hold.emp_act(severity) - ..() + obj_storage.allow_quick_empty = allow_quick_empty + obj_storage.allow_quick_empty_via_clickdrag = allow_quick_empty_via_clickdrag + obj_storage.allow_quick_empty_via_attack_self = allow_quick_empty_via_attack_self -/obj/item/clothing/accessory/storage/attack_self(mob/user) - . = ..() - if(.) - return - to_chat(user, "You empty [src].") - var/turf/T = get_turf(src) - hold.hide_from(usr) - for(var/obj/item/I in hold.contents) - hold.remove_from_storage(I, T) - add_fingerprint(user) + obj_storage.sfx_open = sfx_open + obj_storage.sfx_insert = sfx_insert + obj_storage.sfx_remove = sfx_remove + + obj_storage.ui_numerical_mode = ui_numerical_mode /obj/item/clothing/accessory/storage/webbing name = "webbing" desc = "Sturdy mess of synthcotton belts and buckles, ready to share your burden." icon_state = "webbing" - slots = 3 + // nah fuck off we don't like aesthetics making dumb storage powercreep different per type. + max_combined_volume = WEIGHT_VOLUME_SMALL * 5 /obj/item/clothing/accessory/storage/black_vest name = "black webbing vest" desc = "Robust black synthcotton vest with lots of pockets to hold whatever you need, but cannot hold in hands." icon_state = "vest_black" + max_combined_volume = WEIGHT_VOLUME_SMALL * 5 /obj/item/clothing/accessory/storage/brown_vest name = "brown webbing vest" desc = "Worn brownish synthcotton vest with lots of pockets to unload your hands." icon_state = "vest_brown" + max_combined_volume = WEIGHT_VOLUME_SMALL * 5 /obj/item/clothing/accessory/storage/white_vest name = "white webbing vest" desc = "Durable white synthcotton vest with lots of pockets to carry essentials." icon_state = "vest_white" + max_combined_volume = WEIGHT_VOLUME_SMALL * 5 /obj/item/clothing/accessory/storage/black_drop_pouches name = "black drop pouches" gender = PLURAL desc = "Robust black synthcotton bags to hold whatever you need, but cannot hold in hands." icon_state = "thigh_black" + max_combined_volume = WEIGHT_VOLUME_SMALL * 5 /obj/item/clothing/accessory/storage/brown_drop_pouches name = "brown drop pouches" gender = PLURAL desc = "Worn brownish synthcotton bags to hold whatever you need, but cannot hold in hands." icon_state = "thigh_brown" + max_combined_volume = WEIGHT_VOLUME_SMALL * 5 /obj/item/clothing/accessory/storage/white_drop_pouches name = "white drop pouches" gender = PLURAL desc = "Durable white synthcotton bags to hold whatever you need, but cannot hold in hands." icon_state = "thigh_white" + max_combined_volume = WEIGHT_VOLUME_SMALL * 5 /obj/item/clothing/accessory/storage/knifeharness name = "decorated harness" desc = "A heavily decorated harness of sinew and leather with two knife-loops." icon_state = "unathiharness2" - slots = 2 + max_combined_volume = null + max_single_weight_class = WEIGHT_CLASS_NORMAL + max_items = 2 + max_combined_weight_class = null + insertion_whitelist = list( + /obj/item/material/knife, + ) + starts_with = list( + /obj/item/material/knife/machete/hatchet/unathiknife = 2, + ) /obj/item/clothing/accessory/storage/voyager name = "voyager harness" @@ -116,36 +180,24 @@ BODYTYPE_STRING_TESHARI = 'icons/mob/clothing/species/teshari/ties.dmi' ) -/obj/item/clothing/accessory/storage/knifeharness/Initialize(mapload) - . = ..() - hold.max_storage_space = ITEMSIZE_COST_SMALL * 2 - hold.can_hold = list(/obj/item/material/knife/machete/hatchet/unathiknife,\ - /obj/item/material/knife,\ - /obj/item/material/knife/plastic) - - new /obj/item/material/knife/machete/hatchet/unathiknife(hold) - new /obj/item/material/knife/machete/hatchet/unathiknife(hold) - /obj/item/clothing/accessory/storage/laconic name = "laconic field pouch system" desc = "This lightweight webbing system supports a hardened leather case designed to sit comfortably on the wearer's hip." icon_state = "laconic" slot = ACCESSORY_SLOT_UTILITY - slots = 5 + max_combined_volume = WEIGHT_VOLUME_SMALL * 5 //Ashlander Potion Bandolier /obj/item/clothing/accessory/storage/ashlander_alchemy name = "hide bandolier" desc = "A sturdy bandolier meant to keep the tools or products of alchemy held securely to the wearer's body." icon_state = "bandolier_ash" - slots = 5 - -/obj/item/clothing/accessory/storage/ashlander_alchemy/Initialize(mapload) - . = ..() - hold.can_hold = list( - /obj/item/reagent_containers/glass/stone,\ - /obj/item/stack/medical/poultice_brute,\ - /obj/item/stack/medical/poultice_burn,\ - /obj/item/grenade/explosive/ashlander,\ - /obj/item/bitterash,\ - /obj/item/flame/lighter) + max_combined_volume = WEIGHT_VOLUME_SMALL * 5 + insertion_whitelist = list( + /obj/item/reagent_containers/glass/stone, + /obj/item/stack/medical/poultice_brute, + /obj/item/stack/medical/poultice_burn, + /obj/item/grenade/explosive/ashlander, + /obj/item/bitterash, + /obj/item/flame/lighter, + ) diff --git a/code/modules/clothing/under/accessories/xeno/tajara.dm b/code/modules/clothing/under/accessories/xeno/tajara.dm index 11dd7664e1c..ee8ed1da2c4 100644 --- a/code/modules/clothing/under/accessories/xeno/tajara.dm +++ b/code/modules/clothing/under/accessories/xeno/tajara.dm @@ -96,7 +96,7 @@ slot_flags = SLOT_OCLOTHING | SLOT_TIE body_cover_flags = UPPER_TORSO|LOWER_TORSO|ARMS|LEGS siemens_coefficient = 0.9 - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL slot = ACCESSORY_SLOT_OVER /obj/item/clothing/accessory/tponcho/tajarancloak/fancy diff --git a/code/modules/clothing/under/miscellaneous.dm b/code/modules/clothing/under/miscellaneous.dm index b281b8092eb..b6e570d096c 100644 --- a/code/modules/clothing/under/miscellaneous.dm +++ b/code/modules/clothing/under/miscellaneous.dm @@ -83,7 +83,7 @@ name = "\improper NASA jumpsuit" desc = "It has a NASA logo on it and is made of space-proofed materials." icon_state = "black" - w_class = ITEMSIZE_LARGE//bulky item + w_class = WEIGHT_CLASS_BULKY//bulky item gas_transfer_coefficient = 0.01 permeability_coefficient = 0.02 body_cover_flags = UPPER_TORSO|LOWER_TORSO|LEGS|FEET|ARMS|HANDS diff --git a/code/modules/clothing/under/xenos/vox.dm b/code/modules/clothing/under/xenos/vox.dm index 7ea5eb67dff..571432ffbd3 100644 --- a/code/modules/clothing/under/xenos/vox.dm +++ b/code/modules/clothing/under/xenos/vox.dm @@ -31,12 +31,9 @@ atom_flags = PHORONGUARD - slots = 3 - -/obj/item/clothing/accessory/storage/vox/Initialize(mapload) - . = ..() - hold.max_storage_space = slots * ITEMSIZE_COST_NORMAL - hold.max_w_class = ITEMSIZE_NORMAL + max_items = 3 + max_combined_volume = 3 * WEIGHT_VOLUME_NORMAL + max_single_weight_class = WEIGHT_CLASS_NORMAL //Vox Pressure Suits /obj/item/clothing/under/pressuresuit diff --git a/code/modules/detectivework/forensics.dm b/code/modules/detectivework/forensics.dm index 37991fff821..5945787ff6d 100644 --- a/code/modules/detectivework/forensics.dm +++ b/code/modules/detectivework/forensics.dm @@ -1,6 +1,6 @@ /obj/item/forensics icon = 'icons/obj/forensics.dmi' - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY //This is the output of the stringpercent(print) proc, and means about 80% of //the print must be there for it to be complete. (Prints are 32 digits) diff --git a/code/modules/detectivework/tools/crimekit.dm b/code/modules/detectivework/tools/crimekit.dm index 613c8d8688d..a17f2506fba 100644 --- a/code/modules/detectivework/tools/crimekit.dm +++ b/code/modules/detectivework/tools/crimekit.dm @@ -4,7 +4,7 @@ desc = "A stainless steel-plated carrycase for all your forensic needs. Feels heavy." icon = 'icons/obj/forensics.dmi' icon_state = "det-case" - storage_slots = 14 + max_items = 14 drop_sound = 'sound/items/drop/toolbox.ogg' pickup_sound = 'sound/items/pickup/toolbox.ogg' item_icons = list( @@ -12,7 +12,7 @@ SLOT_ID_RIGHT_HAND = 'icons/mob/items/righthand_storage.dmi', ) -/obj/item/storage/briefcase/crimekit/PopulateContents() +/obj/item/storage/briefcase/crimekit/legacy_spawn_contents() new /obj/item/storage/box/swabs(src) new /obj/item/storage/box/fingerprints(src) new /obj/item/reagent_containers/spray/luminol(src) diff --git a/code/modules/detectivework/tools/evidencebag.dm b/code/modules/detectivework/tools/evidencebag.dm index 453c4ae06a6..8a52f1045d5 100644 --- a/code/modules/detectivework/tools/evidencebag.dm +++ b/code/modules/detectivework/tools/evidencebag.dm @@ -6,7 +6,7 @@ icon = 'icons/obj/storage.dmi' icon_state = "evidenceobj" item_state = null - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL var/obj/item/stored_item = null /obj/item/evidencebag/OnMouseDropLegacy(var/obj/item/I as obj) @@ -26,8 +26,8 @@ else //If it isn't on the floor. Do some checks to see if it's in our hands or a box. Otherwise give up. if(istype(I.loc,/obj/item/storage)) //in a container. - var/sdepth = I.storage_depth(user) - if (sdepth > MAX_STORAGE_REACH) + var/sdepth = I.depth_inside_atom(user) + if (sdepth > STORAGE_REACH_DEPTH) return //too deeply nested to access var/obj/item/storage/U = I.loc @@ -70,9 +70,7 @@ desc = "An evidence bag containing [I]." I.loc = src stored_item = I - w_class = I.w_class - return - + set_weight_class(I.w_class) /obj/item/evidencebag/attack_self(mob/user) . = ..() @@ -87,7 +85,7 @@ user.put_in_hands(I) stored_item = null - w_class = initial(w_class) + set_weight_class(initial(w_class)) icon_state = "evidenceobj" desc = "An empty evidence bag." else diff --git a/code/modules/detectivework/tools/rag.dm b/code/modules/detectivework/tools/rag.dm index c8edba9b247..95562c440ab 100644 --- a/code/modules/detectivework/tools/rag.dm +++ b/code/modules/detectivework/tools/rag.dm @@ -16,7 +16,7 @@ /obj/item/reagent_containers/glass/rag name = "rag" desc = "For cleaning up messes, you suppose." - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY icon = 'icons/obj/toy.dmi' icon_state = "rag" amount_per_transfer_from_this = 3 diff --git a/code/modules/detectivework/tools/sample_kits.dm b/code/modules/detectivework/tools/sample_kits.dm index 5eed168bd43..993e2e36d94 100644 --- a/code/modules/detectivework/tools/sample_kits.dm +++ b/code/modules/detectivework/tools/sample_kits.dm @@ -2,7 +2,7 @@ name = "forensic sample" icon = 'icons/obj/forensics.dmi' atom_flags = NOPRINT - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY var/list/evidence = list() /obj/item/sample/Initialize(mapload, atom/supplied) @@ -129,7 +129,7 @@ name = "fiber collection kit" desc = "A magnifying glass and tweezers. Used to lift suit fibers." icon_state = "m_glass" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL var/evidence_type = "fiber" var/evidence_path = /obj/item/sample/fibers diff --git a/code/modules/detectivework/tools/scanner.dm b/code/modules/detectivework/tools/scanner.dm index f24d7491dc3..87d6a6f59dd 100644 --- a/code/modules/detectivework/tools/scanner.dm +++ b/code/modules/detectivework/tools/scanner.dm @@ -4,7 +4,7 @@ icon = 'icons/obj/device.dmi' icon_state = "forensic" var/list/stored = list() - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL item_state = "electronic" item_flags = ITEM_NOBLUDGEON | ITEM_ENCUMBERS_WHILE_HELD slot_flags = SLOT_BELT @@ -23,7 +23,7 @@ return if(reveal_fingerprints) - if((!( istype(target.dna, /datum/dna) ) || target.item_by_slot(SLOT_ID_GLOVES))) + if((!( istype(target.dna, /datum/dna) ) || target.item_by_slot_id(SLOT_ID_GLOVES))) to_chat(user, "No fingerprints found on [target]") flick("[icon_state]0",src) return diff --git a/code/modules/detectivework/tools/storage.dm b/code/modules/detectivework/tools/storage.dm index d162e4963ac..34ba088a99f 100644 --- a/code/modules/detectivework/tools/storage.dm +++ b/code/modules/detectivework/tools/storage.dm @@ -3,31 +3,28 @@ desc = "Sterilized equipment within. Do not contaminate." icon = 'icons/obj/forensics.dmi' icon_state = "dnakit" - can_hold = list(/obj/item/forensics/swab) - storage_slots = 14 - -/obj/item/storage/box/swabs/PopulateContents() - for(var/i = 1 to storage_slots) // Fill 'er up. - new /obj/item/forensics/swab(src) + insertion_whitelist = list(/obj/item/forensics/swab) + max_items = 14 + starts_with = list( + /obj/item/forensics/swab = 14, + ) /obj/item/storage/box/evidence name = "evidence bag box" desc = "A box claiming to contain evidence bags." - storage_slots = 7 - can_hold = list(/obj/item/evidencebag) - -/obj/item/storage/box/evidence/PopulateContents() - for(var/i = 1 to storage_slots) - new /obj/item/evidencebag(src) + max_items = 7 + insertion_whitelist = list(/obj/item/evidencebag) + starts_with = list( + /obj/item/evidencebag = 7, + ) /obj/item/storage/box/fingerprints name = "box of fingerprint cards" desc = "Sterilized equipment within. Do not contaminate." icon = 'icons/obj/forensics.dmi' icon_state = "dnakit" - can_hold = list(/obj/item/sample/print) - storage_slots = 14 - -/obj/item/storage/box/fingerprints/PopulateContents() - for(var/i = 1 to storage_slots) - new /obj/item/sample/print(src) + insertion_whitelist = list(/obj/item/sample/print) + max_items = 14 + starts_with = list( + /obj/item/sample/print = 14, + ) diff --git a/code/modules/detectivework/tools/uvlight.dm b/code/modules/detectivework/tools/uvlight.dm index 699eeed17b8..0db93357911 100644 --- a/code/modules/detectivework/tools/uvlight.dm +++ b/code/modules/detectivework/tools/uvlight.dm @@ -4,7 +4,7 @@ icon = 'icons/obj/device.dmi' icon_state = "uv_off" slot_flags = SLOT_BELT - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL item_state = "electronic" action_button_name = "Toggle UV light" materials_base = list(MAT_STEEL = 150) diff --git a/code/modules/economy/items/cash.dm b/code/modules/economy/items/cash.dm index 2d5428267df..3ab8940b50b 100644 --- a/code/modules/economy/items/cash.dm +++ b/code/modules/economy/items/cash.dm @@ -11,7 +11,7 @@ throw_force = 1.0 throw_speed = 1 throw_range = 2 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL var/access = list() access = ACCESS_MISC_CASHCRATE var/worth = 0 diff --git a/code/modules/economy/items/coins.dm b/code/modules/economy/items/coins.dm index a31ae4f52ed..6a85dd5c359 100644 --- a/code/modules/economy/items/coins.dm +++ b/code/modules/economy/items/coins.dm @@ -6,7 +6,7 @@ icon_state = "coin" damage_force = 0.0 throw_force = 0.0 - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY slot_flags = SLOT_EARS var/string_attached var/sides = 2 diff --git a/code/modules/economy/items/retail_scanner.dm b/code/modules/economy/items/retail_scanner.dm index 511b95c6d55..3b8de0de61c 100644 --- a/code/modules/economy/items/retail_scanner.dm +++ b/code/modules/economy/items/retail_scanner.dm @@ -6,7 +6,7 @@ item_flags = ITEM_NOBLUDGEON | ITEM_ENCUMBERS_WHILE_HELD slot_flags = SLOT_BELT req_access = list(ACCESS_COMMAND_BRIDGE) - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL origin_tech = list(TECH_MATERIAL = 1) var/locked = 1 diff --git a/code/modules/economy/machines/mint.dm b/code/modules/economy/machines/mint.dm index 8ed2d05193d..858b40fa4ed 100644 --- a/code/modules/economy/machines/mint.dm +++ b/code/modules/economy/machines/mint.dm @@ -431,7 +431,7 @@ var/plants_loaded = 0 for(var/obj/G in P.contents) if(accept_check(G)) - P.remove_from_storage(G) //fixes ui bug - Pull Request 5515 + P.obj_storage.remove(G, src) stock(G) plants_loaded = 1 if(plants_loaded) diff --git a/code/modules/economy/money_bag.dm b/code/modules/economy/money_bag.dm index 87a5f736d1f..04a467c8cff 100644 --- a/code/modules/economy/money_bag.dm +++ b/code/modules/economy/money_bag.dm @@ -6,7 +6,7 @@ icon_state = "moneybag" damage_force = 10.0 throw_force = 2.0 - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY /obj/item/moneybag/attack_hand(mob/user, list/params) var/amt_supermatter = 0 diff --git a/code/modules/fishing/equipment/case.dm b/code/modules/fishing/equipment/case.dm index fa41b029e5d..f48567b5fd9 100644 --- a/code/modules/fishing/equipment/case.dm +++ b/code/modules/fishing/equipment/case.dm @@ -5,14 +5,15 @@ icon = 'icons/modules/fishing/storage.dmi' icon_state = "case" - storage_slots = 1 - max_w_class = WEIGHT_CLASS_HUGE - can_hold = list( + max_items = 1 + max_single_weight_class = WEIGHT_CLASS_HUGE + insertion_whitelist = list( /obj/item/fish, ) + worth_dynamic = TRUE ///Fish case with single random fish inside. -/obj/item/storage/fish_case/random/PopulateContents() +/obj/item/storage/fish_case/random/spawn_contents() . = ..() var/fish_type = select_fish_type() new fish_type(src) @@ -29,7 +30,7 @@ /obj/item/storage/fish_case/syndicate name = "ominous fish case" -/obj/item/storage/fish_case/syndicate/PopulateContents() +/obj/item/storage/fish_case/syndicate/legacy_spawn_contents() . = ..() var/fish_type = pick(/obj/item/fish/donkfish, /obj/item/fish/emulsijack) new fish_type(src) @@ -37,7 +38,7 @@ /obj/item/storage/fish_case/tiziran name = "imported fish case" -/obj/item/storage/fish_case/tiziran/PopulateContents() +/obj/item/storage/fish_case/tiziran/legacy_spawn_contents() . = ..() var/fish_type = pick(/obj/item/fish/dwarf_moonfish, /obj/item/fish/gunner_jellyfish, /obj/item/fish/needlefish, /obj/item/fish/armorfish) new fish_type(src) diff --git a/code/modules/fishing/equipment/kit.dm b/code/modules/fishing/equipment/kit.dm index bb4f0a0bb52..822fa3676f5 100644 --- a/code/modules/fishing/equipment/kit.dm +++ b/code/modules/fishing/equipment/kit.dm @@ -6,7 +6,7 @@ // todo: properly port tg sprite // todo: allow it to hold fishing rods properly -/obj/item/storage/toolbox/fishing/PopulateContents() +/obj/item/storage/toolbox/fishing/legacy_spawn_contents() new /obj/item/bait_can/worm(src) new /obj/item/fishing_rod(src) new /obj/item/fishing_hook(src) @@ -16,7 +16,7 @@ name = "fishing hook set" // todo: dynamic state with fish -/obj/item/storage/box/fishing_hooks/PopulateContents() +/obj/item/storage/box/fishing_hooks/legacy_spawn_contents() . = ..() new /obj/item/fishing_hook/magnet(src) new /obj/item/fishing_hook/shiny(src) @@ -26,7 +26,7 @@ name = "fishing line set" // todo: dynamic state with fish -/obj/item/storage/box/fishing_lines/PopulateContents() +/obj/item/storage/box/fishing_lines/legacy_spawn_contents() . = ..() new /obj/item/fishing_line/bouncy(src) new /obj/item/fishing_line/reinforced(src) @@ -36,6 +36,6 @@ name = "aquarium props box" // todo: dynamic state with fish -/obj/item/storage/box/aquarium_props/PopulateContents() +/obj/item/storage/box/aquarium_props/legacy_spawn_contents() for(var/prop_type in subtypesof(/obj/item/aquarium_prop)) new prop_type(src) diff --git a/code/modules/fishing/fish/fish_types.dm b/code/modules/fishing/fish/fish_types.dm index f59b84fe21f..66b02eed8c7 100644 --- a/code/modules/fishing/fish/fish_types.dm +++ b/code/modules/fishing/fish/fish_types.dm @@ -340,7 +340,7 @@ /obj/item/storage/box/fish_debug name = "box full of fish" -/obj/item/storage/box/fish_debug/PopulateContents() +/obj/item/storage/box/fish_debug/legacy_spawn_contents() for(var/fish_type in subtypesof(/obj/item/fish)) new fish_type(src) diff --git a/code/modules/food/drinkingglass/extras.dm b/code/modules/food/drinkingglass/extras.dm index 1d4c64f0020..d51297c7058 100644 --- a/code/modules/food/drinkingglass/extras.dm +++ b/code/modules/food/drinkingglass/extras.dm @@ -52,7 +52,7 @@ var/glass_addition var/glass_desc var/glass_color - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY icon = 'icons/pdrink.dmi' /obj/item/glass_extra/stick diff --git a/code/modules/food/drinkingglass/glass_boxes.dm b/code/modules/food/drinkingglass/glass_boxes.dm index fb3d17807f8..edddcc8c24a 100644 --- a/code/modules/food/drinkingglass/glass_boxes.dm +++ b/code/modules/food/drinkingglass/glass_boxes.dm @@ -1,7 +1,7 @@ /obj/item/storage/box/mixedglasses name = "glassware box" desc = "A box of assorted glassware" - can_hold = list(/obj/item/reagent_containers/food/drinks/glass2) + insertion_whitelist = list(/obj/item/reagent_containers/food/drinks/glass2) /obj/item/storage/box/mixedglasses/New() ..() @@ -18,7 +18,7 @@ /obj/item/storage/box/glasses name = "box of glasses" var/glass_type = /obj/item/reagent_containers/food/drinks/glass2 - can_hold = list(/obj/item/reagent_containers/food/drinks/glass2) + insertion_whitelist = list(/obj/item/reagent_containers/food/drinks/glass2) /obj/item/storage/box/glasses/New() ..() @@ -61,12 +61,13 @@ /obj/item/storage/box/glasses/meta name = "box of half-pint metamorphic glasses" glass_type = /obj/item/reagent_containers/food/drinks/metaglass + insertion_whitelist = list(/obj/item/reagent_containers/food/drinks/metaglass) /obj/item/storage/box/glass_extras name = "box of cocktail garnishings" var/extra_type = /obj/item/glass_extra - can_hold = list(/obj/item/glass_extra) - storage_slots = 14 + insertion_whitelist = list(/obj/item/glass_extra) + max_items = 14 /obj/item/storage/box/glass_extras/New() ..() diff --git a/code/modules/food/food/condiment.dm b/code/modules/food/food/condiment.dm index 9b43d560d41..db7d44dca4a 100644 --- a/code/modules/food/food/condiment.dm +++ b/code/modules/food/food/condiment.dm @@ -203,7 +203,7 @@ /obj/item/reagent_containers/food/condiment/small/packet icon_state = "packet_small" - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY possible_transfer_amounts = "1;5;10" amount_per_transfer_from_this = 1 volume = 5 diff --git a/code/modules/food/food/drinks.dm b/code/modules/food/food/drinks.dm index 8ffc912b1a3..745c9defb59 100644 --- a/code/modules/food/food/drinks.dm +++ b/code/modules/food/food/drinks.dm @@ -108,7 +108,7 @@ name = "golden cup" icon_state = "golden_cup" item_state = "" //nope :( - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY damage_force = 14 throw_force = 10 amount_per_transfer_from_this = 20 diff --git a/code/modules/food/food/sandwich.dm b/code/modules/food/food/sandwich.dm index 39a5947861c..bff06a007be 100644 --- a/code/modules/food/food/sandwich.dm +++ b/code/modules/food/food/sandwich.dm @@ -73,7 +73,7 @@ name = lowertext("[fullname] sandwich") if(length(name) > 80) name = "[pick(list("absurd","colossal","enormous","ridiculous"))] sandwich" - w_class = CEILING(clamp((ingredients.len/2),2,4), 1) + set_weight_class(CEILING(clamp((ingredients.len/2),2,4), 1)) add_overlay(overlays_to_add) diff --git a/code/modules/food/food/snacks.dm b/code/modules/food/food/snacks.dm index 71fd087a4c7..ba2293294e4 100644 --- a/code/modules/food/food/snacks.dm +++ b/code/modules/food/food/snacks.dm @@ -27,7 +27,7 @@ //Generally applied during modification cooking with oven/fryer //Used to stop deepfried meat from looking like slightly tanned raw meat, and make it actually look cooked center_of_mass = list("x"=16, "y"=16) - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL damage_force = 1 /obj/item/reagent_containers/food/snacks/Initialize(mapload) @@ -379,7 +379,7 @@ name = "Pocky Stick" desc = "A chocolate covered biscuit stick." icon_state = "pockystick" - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY nutriment_amt = 2 nutriment_desc = list("chocolate" = 2) @@ -403,9 +403,9 @@ /obj/item/reagent_containers/food/snacks/pockystick, /obj/item/reagent_containers/food/snacks/pockystick ) - w_class = ITEMSIZE_TINY - max_storage_space = ITEMSIZE_COST_TINY * 8 - can_hold = list(/obj/item/reagent_containers/food/snacks/pockystick) + w_class = WEIGHT_CLASS_TINY + max_combined_volume = WEIGHT_VOLUME_TINY * 8 + insertion_whitelist = list(/obj/item/reagent_containers/food/snacks/pockystick) foldable = null @@ -425,7 +425,7 @@ name = "Gondola Cookies" desc = "A small cookie filled with chocolate." icon_state = "gondas" - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY nutriment_amt = 2 nutriment_desc = list("chocolate" = 1, "sugar" = 1) @@ -448,9 +448,9 @@ /obj/item/reagent_containers/food/snacks/gondolas, /obj/item/reagent_containers/food/snacks/gondolas ) - w_class = ITEMSIZE_TINY - max_storage_space = ITEMSIZE_COST_TINY * 8 - can_hold = list(/obj/item/reagent_containers/food/snacks/gondolas) + w_class = WEIGHT_CLASS_TINY + max_combined_volume = WEIGHT_VOLUME_TINY * 8 + insertion_whitelist = list(/obj/item/reagent_containers/food/snacks/gondolas) foldable = null // End Nippon-Tan vending snacks @@ -2550,7 +2550,7 @@ // sliceable is just an organization type path, it doesn't have any additional code or variables tied to it. /obj/item/reagent_containers/food/snacks/sliceable - w_class = ITEMSIZE_NORMAL //Whole pizzas and cakes shouldn't fit in a pocket, you can slice them if you want to do that. + w_class = WEIGHT_CLASS_NORMAL //Whole pizzas and cakes shouldn't fit in a pocket, you can slice them if you want to do that. /** * A food item slice @@ -5524,7 +5524,7 @@ END CITADEL CHANGE */ icon_state = "worm_sickly" nutriment_amt = 1 nutriment_desc = list("bugflesh" = 1) - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY /obj/item/reagent_containers/food/snacks/wormsickly/Initialize(mapload) . = ..() @@ -5537,7 +5537,7 @@ END CITADEL CHANGE */ icon_state = "worm" nutriment_amt = 1 nutriment_desc = list("bugflesh" = 1) - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY /obj/item/reagent_containers/food/snacks/worm/Initialize(mapload) . = ..() @@ -5550,7 +5550,7 @@ END CITADEL CHANGE */ icon_state = "worm_deluxe" nutriment_amt = 5 nutriment_desc = list("bugflesh" = 1) - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY /obj/item/reagent_containers/food/snacks/wormdeluxe/Initialize(mapload) . = ..() @@ -5564,7 +5564,7 @@ END CITADEL CHANGE */ icon_state = "siffruit" nutriment_amt = 2 nutriment_desc = list("tart" = 1) - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY /obj/item/reagent_containers/food/snacks/siffruit/Initialize(mapload) . = ..() @@ -5846,8 +5846,8 @@ END CITADEL CHANGE */ icon = 'icons/obj/food.dmi' icon_state = "wings5" var/startswith = 5 - max_storage_space = ITEMSIZE_COST_SMALL * 5 - can_hold = list(/obj/item/reagent_containers/food/snacks/chickenwing) + max_combined_volume = WEIGHT_VOLUME_SMALL * 5 + insertion_whitelist = list(/obj/item/reagent_containers/food/snacks/chickenwing) foldable = null /obj/item/storage/box/wings/Initialize(mapload) @@ -6047,7 +6047,7 @@ END CITADEL CHANGE */ icon = 'icons/obj/food48x48_vr.dmi' icon_state = "monkfish_raw" nutriment_amt = 30 - w_class = ITEMSIZE_HUGE //Is that a monkfish in your pocket, or are you just happy to see me? + w_class = WEIGHT_CLASS_HUGE //Is that a monkfish in your pocket, or are you just happy to see me? slice_path = /obj/item/reagent_containers/food/snacks/monkfishfillet slices_num = 6 trash = /obj/item/reagent_containers/food/snacks/sliceable/monkfishremains @@ -6084,7 +6084,7 @@ END CITADEL CHANGE */ name = "monkfish remains" icon_state = "monkfish_remains" desc = "the work of a madman." - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY nutriment_amt = 10 slice_path = /obj/item/clothing/head/fish slices_num = 1 diff --git a/code/modules/food/machinery/appliance/_appliance.dm b/code/modules/food/machinery/appliance/_appliance.dm index 635cf143f2d..33790c87431 100644 --- a/code/modules/food/machinery/appliance/_appliance.dm +++ b/code/modules/food/machinery/appliance/_appliance.dm @@ -642,7 +642,7 @@ victim.calculate_composition() var/obj/item/reagent_containers/food/snacks/variable/mob/result = new /obj/item/reagent_containers/food/snacks/variable/mob(CI.container) - result.w_class = victim.mob_size + result.set_weight_class(victim.mob_size) result.reagents.add_reagent(victim.composition_reagent, victim.composition_reagent_quantity) if (victim.reagents) diff --git a/code/modules/food/machinery/appliance/_cooker_output.dm b/code/modules/food/machinery/appliance/_cooker_output.dm index 00463fc6ab8..c4fe58e1129 100644 --- a/code/modules/food/machinery/appliance/_cooker_output.dm +++ b/code/modules/food/machinery/appliance/_cooker_output.dm @@ -34,7 +34,7 @@ M.Scale(scale) src.transform = M - w_class *= scale + set_weight_class(initial(w_class) * (round(scale) || 1)) if (!prefix) if (scale == min_scale) prefix = "tiny" diff --git a/code/modules/food/machinery/smartfridge.dm b/code/modules/food/machinery/smartfridge.dm index ababec01a46..bfa4a59d7a4 100644 --- a/code/modules/food/machinery/smartfridge.dm +++ b/code/modules/food/machinery/smartfridge.dm @@ -152,7 +152,7 @@ var/plants_loaded = 0 for(var/obj/G in P.contents) if(accept_check(G)) - P.remove_from_storage(G) //fixes ui bug - Pull Request 5515 + P.obj_storage.remove(G) //fixes ui bug - Pull Request 5515 stock(G) plants_loaded = 1 if(plants_loaded) diff --git a/code/modules/games/cards.dm b/code/modules/games/cards.dm index a917b15734a..910cf957b37 100644 --- a/code/modules/games/cards.dm +++ b/code/modules/games/cards.dm @@ -4,7 +4,7 @@ var/back_icon = "card_back" /obj/item/deck - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL icon = 'icons/obj/playing_cards.dmi' var/list/cards = list() var/cooldown = 0 // to prevent spam shuffle @@ -280,7 +280,7 @@ icon_state = "card_pack" icon = 'icons/obj/playing_cards.dmi' - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY var/list/cards = list() var/parentdeck = null // This variable is added here so that card pack dependent card can be mixed together by defining a "parentdeck" for them drop_sound = 'sound/items/drop/paper.ogg' @@ -308,7 +308,7 @@ icon_state = "empty" drop_sound = 'sound/items/drop/paper.ogg' pickup_sound = 'sound/items/pickup/paper.ogg' - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY var/concealed = 0 var/list/cards = list() diff --git a/code/modules/games/dice.dm b/code/modules/games/dice.dm index 1f2bce18295..a62a6699c87 100644 --- a/code/modules/games/dice.dm +++ b/code/modules/games/dice.dm @@ -3,7 +3,7 @@ desc = "A dice with six sides." icon = 'icons/obj/dice.dmi' icon_state = "d66" - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY var/sides = 6 var/result = 6 var/currently_throwing = FALSE @@ -111,7 +111,7 @@ drop_sound = 'sound/items/drop/hat.ogg' pickup_sound = 'sound/items/pickup/hat.ogg' -/obj/item/storage/pill_bottle/dice/PopulateContents() +/obj/item/storage/pill_bottle/dice/legacy_spawn_contents() for(var/i = 1 to 7) new /obj/item/dice( src ) @@ -124,7 +124,7 @@ drop_sound = 'sound/items/drop/hat.ogg' pickup_sound = 'sound/items/pickup/hat.ogg' -/obj/item/storage/pill_bottle/dice_nerd/PopulateContents() +/obj/item/storage/pill_bottle/dice_nerd/legacy_spawn_contents() new /obj/item/dice/d4( src ) new /obj/item/dice( src ) new /obj/item/dice/d8( src ) @@ -142,9 +142,9 @@ desc = "A cup used to conceal and hold dice." icon = 'icons/obj/dice.dmi' icon_state = "dicecup" - w_class = ITEMSIZE_SMALL - storage_slots = 6 - can_hold = list( + w_class = WEIGHT_CLASS_SMALL + max_items = 6 + insertion_whitelist = list( /obj/item/dice, ) @@ -185,6 +185,6 @@ revealDice(player) -/obj/item/storage/dicecup/loaded/PopulateContents() +/obj/item/storage/dicecup/loaded/legacy_spawn_contents() for(var/i = 1 to 6) new /obj/item/dice( src ) diff --git a/code/modules/ghostroles/roles/ghost_cafe.dm b/code/modules/ghostroles/roles/ghost_cafe.dm index 251cc87ad0d..2e685c1fdef 100644 --- a/code/modules/ghostroles/roles/ghost_cafe.dm +++ b/code/modules/ghostroles/roles/ghost_cafe.dm @@ -155,7 +155,7 @@ name = "ghost cafe costuming kit" desc = "Look just the way you did in life - or better!" -/obj/item/storage/box/syndie_kit/chameleon/ghostcafe/PopulateContents() // Doesn't contain a PDA, for isolation reasons. +/obj/item/storage/box/syndie_kit/chameleon/ghostcafe/legacy_spawn_contents() // Doesn't contain a PDA, for isolation reasons. new /obj/item/clothing/under/chameleon(src) new /obj/item/clothing/suit/chameleon(src) new /obj/item/clothing/gloves/chameleon(src) diff --git a/code/modules/hardsuits/_rig.dm b/code/modules/hardsuits/_rig.dm index eabe8aee39f..f2101ac3f0d 100644 --- a/code/modules/hardsuits/_rig.dm +++ b/code/modules/hardsuits/_rig.dm @@ -20,7 +20,7 @@ icon = 'icons/obj/rig_modules.dmi' desc = "A back-mounted hardsuit deployment and control mechanism." slot_flags = SLOT_BACK - w_class = ITEMSIZE_HUGE + w_class = WEIGHT_CLASS_HUGE action_button_name = "Toggle Heatsink" // These values are passed on to all component pieces. @@ -121,6 +121,37 @@ var/sprint_slowdown_modifier = 0 // Sprinter module modifier. + //* Storage *// + var/list/storage_insertion_whitelist + var/list/storage_insertion_blacklist + var/list/storage_insertion_allow + + var/storage_max_single_weight_class = WEIGHT_CLASS_NORMAL + var/storage_max_combined_weight_class + var/storage_max_combined_volume = WEIGHT_VOLUME_NORMAL * 7 + var/storage_max_items + + var/storage_weight_subtract = 0 + var/storage_weight_multiply = 1 + + var/storage_allow_quick_empty = TRUE + var/storage_allow_quick_empty_via_clickdrag = TRUE + var/storage_allow_quick_empty_via_attack_self = FALSE + + var/storage_sfx_open = "rustle" + var/storage_sfx_insert = "rustle" + var/storage_sfx_remove = "rustle" + + var/storage_ui_numerical_mode = FALSE + + /// storage datum path + var/storage_datum_path = /datum/object_system/storage + /// Cleared after Initialize(). + /// List of types associated to amounts. + var/list/storage_starts_with + /// set to prevent us from spawning starts_with + var/storage_empty = FALSE + /obj/item/hardsuit/get_cell(inducer) return cell @@ -143,6 +174,8 @@ /obj/item/hardsuit/Initialize(mapload) . = ..() + initialize_storage() + spawn_storage_contents() suit_state = icon_state item_state = icon_state @@ -200,6 +233,45 @@ update_icon(1) +/obj/item/hardsuit/proc/spawn_storage_contents() + if(length(storage_starts_with) && !storage_empty) + // this is way too permissive already + var/safety = 256 + var/atom/where_real_contents = obj_storage.real_contents_loc() + for(var/path in storage_starts_with) + var/amount = storage_starts_with[path] || 1 + for(var/i in 1 to amount) + if(!--safety) + CRASH("tried to spawn too many objects") + new path(where_real_contents) + storage_starts_with = null + +/obj/item/hardsuit/proc/initialize_storage() + ASSERT(isnull(obj_storage)) + init_storage(indirected = TRUE) + + obj_storage.set_insertion_allow(storage_insertion_allow) + obj_storage.set_insertion_whitelist(storage_insertion_whitelist) + obj_storage.set_insertion_blacklist(storage_insertion_blacklist) + + obj_storage.max_single_weight_class = storage_max_single_weight_class + obj_storage.max_combined_weight_class = storage_max_combined_weight_class + obj_storage.max_combined_volume = storage_max_combined_volume + obj_storage.max_items = storage_max_items + + obj_storage.weight_subtract = storage_weight_subtract + obj_storage.weight_multiply = storage_weight_multiply + + obj_storage.allow_quick_empty = storage_allow_quick_empty + obj_storage.allow_quick_empty_via_clickdrag = storage_allow_quick_empty_via_clickdrag + obj_storage.allow_quick_empty_via_attack_self = storage_allow_quick_empty_via_attack_self + + obj_storage.sfx_open = storage_sfx_open + obj_storage.sfx_insert = storage_sfx_insert + obj_storage.sfx_remove = storage_sfx_remove + + obj_storage.ui_numerical_mode = storage_ui_numerical_mode + /obj/item/hardsuit/Destroy() for(var/obj/item/piece in list(gloves,boots,helmet,chest)) qdel(piece) diff --git a/code/modules/hardsuits/suits/combat.dm b/code/modules/hardsuits/suits/combat.dm index ae94a2f3f15..38e78d5b6cc 100644 --- a/code/modules/hardsuits/suits/combat.dm +++ b/code/modules/hardsuits/suits/combat.dm @@ -27,7 +27,6 @@ /obj/item/tank, /obj/item/suit_cooling_unit, /obj/item/melee/baton, - /obj/item/storage/backpack, /obj/item/bluespace_radio, ) @@ -88,7 +87,6 @@ /obj/item/reagent_containers/hypospray, /obj/item/roller, /obj/item/suit_cooling_unit, - /obj/item/storage/backpack, /obj/item/bluespace_radio, ) diff --git a/code/modules/hardsuits/suits/ert.dm b/code/modules/hardsuits/suits/ert.dm index 5673f15fd00..78ba574d6ae 100644 --- a/code/modules/hardsuits/suits/ert.dm +++ b/code/modules/hardsuits/suits/ert.dm @@ -42,7 +42,6 @@ /obj/item/storage/firstaid, /obj/item/reagent_containers/hypospray, /obj/item/roller, - /obj/item/storage/backpack, /obj/item/bluespace_radio, ) diff --git a/code/modules/hardsuits/suits/light.dm b/code/modules/hardsuits/suits/light.dm index d6ec9bdae75..951d6ec1d5f 100644 --- a/code/modules/hardsuits/suits/light.dm +++ b/code/modules/hardsuits/suits/light.dm @@ -104,7 +104,6 @@ /obj/item/tank, /obj/item/suit_cooling_unit, /obj/item/cell, - /obj/item/storage/backpack, /obj/item/bluespace_radio, ) diff --git a/code/modules/hardsuits/suits/merc.dm b/code/modules/hardsuits/suits/merc.dm index 72e78c098c7..ce1877f6d35 100644 --- a/code/modules/hardsuits/suits/merc.dm +++ b/code/modules/hardsuits/suits/merc.dm @@ -33,7 +33,6 @@ /obj/item/melee/baton, /obj/item/melee/energy/sword, /obj/item/handcuffs, - /obj/item/storage/backpack, /obj/item/bluespace_radio, ) diff --git a/code/modules/hardsuits/suits/pmc.dm b/code/modules/hardsuits/suits/pmc.dm index df6f2242f75..e4aaa76e8a4 100644 --- a/code/modules/hardsuits/suits/pmc.dm +++ b/code/modules/hardsuits/suits/pmc.dm @@ -40,7 +40,6 @@ /obj/item/storage/firstaid, /obj/item/reagent_containers/hypospray, /obj/item/roller, - /obj/item/storage/backpack, /obj/item/bluespace_radio, ) diff --git a/code/modules/hardsuits/suits/species/protean.dm b/code/modules/hardsuits/suits/species/protean.dm index 15e5eb356bf..6bfc401bfe9 100644 --- a/code/modules/hardsuits/suits/species/protean.dm +++ b/code/modules/hardsuits/suits/species/protean.dm @@ -61,4 +61,4 @@ desc = "A body-hugging mass of nanomachines." can_breach = 0 species_restricted = null - allowed = list(/obj/item/gun,/obj/item/flashlight,/obj/item/tank,/obj/item/suit_cooling_unit,/obj/item/melee/baton,/obj/item/storage/backpack,/obj/item/bluespace_radio) + allowed = list(/obj/item/gun,/obj/item/flashlight,/obj/item/tank,/obj/item/suit_cooling_unit,/obj/item/melee/baton,/obj/item/bluespace_radio) diff --git a/code/modules/hardsuits/suits/species/vox.dm b/code/modules/hardsuits/suits/species/vox.dm index 8cbf80bf023..73cb9df7693 100644 --- a/code/modules/hardsuits/suits/species/vox.dm +++ b/code/modules/hardsuits/suits/species/vox.dm @@ -12,7 +12,6 @@ /obj/item/flashlight, /obj/item/tank, /obj/item/suit_cooling_unit, - /obj/item/storage/backpack, /obj/item/bluespace_radio, ) air_type = /obj/item/tank/vox diff --git a/code/modules/hardsuits/suits/station/cargo.dm b/code/modules/hardsuits/suits/station/cargo.dm index 0ec49ab5753..c403f543608 100644 --- a/code/modules/hardsuits/suits/station/cargo.dm +++ b/code/modules/hardsuits/suits/station/cargo.dm @@ -19,7 +19,6 @@ /obj/item/t_scanner, /obj/item/pickaxe, /obj/item/rcd, - /obj/item/storage/backpack, /obj/item/bluespace_radio, ) diff --git a/code/modules/hardsuits/suits/station/engineering.dm b/code/modules/hardsuits/suits/station/engineering.dm index b44eba43a2d..ee862c5fbe1 100644 --- a/code/modules/hardsuits/suits/station/engineering.dm +++ b/code/modules/hardsuits/suits/station/engineering.dm @@ -18,7 +18,6 @@ /obj/item/flashlight, /obj/item/tank, /obj/item/suit_cooling_unit, - /obj/item/storage/backpack, /obj/item/storage/briefcase/inflatable, /obj/item/t_scanner, /obj/item/rcd @@ -77,7 +76,6 @@ /obj/item/t_scanner, /obj/item/pickaxe, /obj/item/rcd, - /obj/item/storage/backpack, /obj/item/bluespace_radio, ) diff --git a/code/modules/hardsuits/suits/station/medical.dm b/code/modules/hardsuits/suits/station/medical.dm index 95e83f2eeb4..0f80f844c0f 100644 --- a/code/modules/hardsuits/suits/station/medical.dm +++ b/code/modules/hardsuits/suits/station/medical.dm @@ -18,7 +18,6 @@ /obj/item/healthanalyzer, /obj/item/stack/medical, /obj/item/roller, - /obj/item/storage/backpack, /obj/item/bluespace_radio, ) diff --git a/code/modules/hardsuits/suits/station/misc.dm b/code/modules/hardsuits/suits/station/misc.dm index 904a6bb2250..62757643e71 100644 --- a/code/modules/hardsuits/suits/station/misc.dm +++ b/code/modules/hardsuits/suits/station/misc.dm @@ -13,7 +13,6 @@ /obj/item/flashlight, /obj/item/tank, /obj/item/suit_cooling_unit, - /obj/item/storage/backpack, /obj/item/storage/briefcase, /obj/item/storage/secure/briefcase ) diff --git a/code/modules/hardsuits/suits/station/science.dm b/code/modules/hardsuits/suits/station/science.dm index f4320fc9592..c625373b89d 100644 --- a/code/modules/hardsuits/suits/station/science.dm +++ b/code/modules/hardsuits/suits/station/science.dm @@ -27,7 +27,6 @@ /obj/item/radio/beacon, /obj/item/pickaxe/hand, /obj/item/storage/bag/fossils, - /obj/item/storage/backpack, /obj/item/bluespace_radio, ) diff --git a/code/modules/hardsuits/suits/station/security.dm b/code/modules/hardsuits/suits/station/security.dm index 019155c5fd2..f72c93ab952 100644 --- a/code/modules/hardsuits/suits/station/security.dm +++ b/code/modules/hardsuits/suits/station/security.dm @@ -15,7 +15,6 @@ /obj/item/tank, /obj/item/suit_cooling_unit, /obj/item/melee/baton, - /obj/item/storage/backpack, /obj/item/bluespace_radio, ) /datum/armor/hardsuit/hazard diff --git a/code/modules/holodeck/HolodeckObjects.dm b/code/modules/holodeck/HolodeckObjects.dm index 875b020c6f1..0854a36c59c 100644 --- a/code/modules/holodeck/HolodeckObjects.dm +++ b/code/modules/holodeck/HolodeckObjects.dm @@ -214,7 +214,6 @@ /obj/item/holo damtype = HALLOSS - no_attack_log = 1 /obj/item/holo/esword desc = "May the force be within you. Sorta." @@ -230,7 +229,7 @@ throw_speed = 1 throw_range = 5 throw_force = 0 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL atom_flags = NOBLOODY var/active = 0 @@ -259,13 +258,13 @@ if (active) damage_force = 30 item_state = "[icon_state]_blade" - w_class = ITEMSIZE_LARGE + set_weight_class(WEIGHT_CLASS_BULKY) playsound(src, 'sound/weapons/saberon.ogg', 50, 1) to_chat(user, "[src] is now active.") else damage_force = 3 item_state = "[icon_state]" - w_class = ITEMSIZE_SMALL + set_weight_class(WEIGHT_CLASS_SMALL) playsound(src, 'sound/weapons/saberoff.ogg', 50, 1) to_chat(user, "[src] can now be concealed.") @@ -302,7 +301,7 @@ icon_state = "basketball" name = "basketball" desc = "Here's your chance, do your dance at the Space Jam." - w_class = ITEMSIZE_LARGE //Stops people from hiding it in their bags/pockets + w_class = WEIGHT_CLASS_BULKY //Stops people from hiding it in their bags/pockets drop_sound = 'sound/items/drop/basketball.ogg' pickup_sound = 'sound/items/pickup/basketball.ogg' diff --git a/code/modules/hydroponics/beekeeping/beehive.dm b/code/modules/hydroponics/beekeeping/beehive.dm index 2ad9e7ca486..5b6cd371475 100644 --- a/code/modules/hydroponics/beekeeping/beehive.dm +++ b/code/modules/hydroponics/beekeeping/beehive.dm @@ -202,14 +202,14 @@ desc = "A device used to calm down bees before harvesting honey." icon = 'icons/obj/device.dmi' icon_state = "battererburnt" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL /obj/item/honey_frame name = "beehive frame" desc = "A frame for the beehive that the bees will fill with honeycombs." icon = 'icons/obj/beekeeping.dmi' icon_state = "honeyframe" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL var/honey = 0 diff --git a/code/modules/hydroponics/grown_inedible.dm b/code/modules/hydroponics/grown_inedible.dm index b0d97a47e41..b9408c95c6b 100644 --- a/code/modules/hydroponics/grown_inedible.dm +++ b/code/modules/hydroponics/grown_inedible.dm @@ -36,7 +36,7 @@ icon = 'icons/obj/trash.dmi' icon_state = "corncob" atom_flags = NOCONDUCT - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL throw_force = 0 throw_speed = 4 throw_range = 20 @@ -55,7 +55,7 @@ icon = 'icons/obj/items.dmi' icon_state = "banana_peel" atom_flags = NOCONDUCT - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL throw_force = 0 throw_speed = 4 throw_range = 20 diff --git a/code/modules/hydroponics/seed_machines.dm b/code/modules/hydroponics/seed_machines.dm index 95807224778..b649fc10f1f 100644 --- a/code/modules/hydroponics/seed_machines.dm +++ b/code/modules/hydroponics/seed_machines.dm @@ -3,7 +3,7 @@ desc = "A small disk used for carrying data on plant genetics." icon = 'icons/obj/hydroponics_machines.dmi' icon_state = "disk" - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY var/list/genes = list() var/genesource = "unknown" @@ -30,7 +30,7 @@ name = "flora disk box" desc = "A box of flora data disks, apparently." -/obj/item/storage/box/botanydisk/PopulateContents() +/obj/item/storage/box/botanydisk/legacy_spawn_contents() for(var/i = 0;i<7;i++) new /obj/item/disk/botany(src) diff --git a/code/modules/hydroponics/seed_packets.dm b/code/modules/hydroponics/seed_packets.dm index 08a8efecc23..0b3b4c77d47 100644 --- a/code/modules/hydroponics/seed_packets.dm +++ b/code/modules/hydroponics/seed_packets.dm @@ -8,7 +8,7 @@ GLOBAL_LIST_BOILERPLATE(all_seed_packs, /obj/item/seeds) icon = 'icons/obj/seeds.dmi' icon_state = "blank" worn_render_flags = WORN_RENDER_INHAND_NO_RENDER | WORN_RENDER_SLOT_NO_RENDER - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL var/seed_type var/datum/seed/seed diff --git a/code/modules/hydroponics/trays/tray.dm b/code/modules/hydroponics/trays/tray.dm index 7685ddfa72b..75aa5e52051 100644 --- a/code/modules/hydroponics/trays/tray.dm +++ b/code/modules/hydroponics/trays/tray.dm @@ -528,9 +528,8 @@ var/obj/item/storage/bag/plants/S = O for (var/obj/item/reagent_containers/food/snacks/grown/G in locate(user.x,user.y,user.z)) - if(!S.can_be_inserted(G)) - return - S.handle_item_insertion(G, user, 1) + S.obj_storage.try_insert(G, new /datum/event_args/actor(user), TRUE, TRUE, TRUE) + S.obj_storage.ui_queue_refresh() else if ( istype(O, /obj/item/plantspray) ) var/obj/item/plantspray/spray = O diff --git a/code/modules/hydroponics/trays/tray_reagents.dm b/code/modules/hydroponics/trays/tray_reagents.dm index 751d40acbfd..a140eaf7774 100644 --- a/code/modules/hydroponics/trays/tray_reagents.dm +++ b/code/modules/hydroponics/trays/tray_reagents.dm @@ -4,7 +4,7 @@ item_flags = ITEM_NOBLUDGEON | ITEM_ENCUMBERS_WHILE_HELD slot_flags = SLOT_BELT throw_force = 4 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL throw_speed = 2 throw_range = 10 var/toxicity = 4 diff --git a/code/modules/instruments/instruments/item.dm b/code/modules/instruments/instruments/item.dm index 4b5cf182a1e..a4fb544ec22 100644 --- a/code/modules/instruments/instruments/item.dm +++ b/code/modules/instruments/instruments/item.dm @@ -27,7 +27,7 @@ return ..() /obj/item/instrument/proc/should_stop_playing(mob/user) - return !Adjacent(user) && !(storage_depth(user) < 3) + return (loc != user) && (depth_inside_atom(user) < 3) /* /obj/item/instrument/process(wait) diff --git a/code/modules/integrated_electronics/core/assemblies.dm b/code/modules/integrated_electronics/core/assemblies.dm index 2a9dc47f333..d07fab6cb60 100644 --- a/code/modules/integrated_electronics/core/assemblies.dm +++ b/code/modules/integrated_electronics/core/assemblies.dm @@ -4,7 +4,7 @@ name = "electronic assembly" obj_flags = OBJ_RANGE_TARGETABLE | OBJ_MELEE_TARGETABLE desc = "It's a case, for building small electronics with." - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL icon = 'icons/obj/integrated_electronics/electronic_setups.dmi' icon_state = "setup_small" item_flags = ITEM_NOBLUDGEON | ITEM_ENCUMBERS_WHILE_HELD diff --git a/code/modules/integrated_electronics/core/assemblies/clothing.dm b/code/modules/integrated_electronics/core/assemblies/clothing.dm index 8e16c7c3842..c89d3a303ac 100644 --- a/code/modules/integrated_electronics/core/assemblies/clothing.dm +++ b/code/modules/integrated_electronics/core/assemblies/clothing.dm @@ -7,7 +7,7 @@ name = "electronic clothing parts" icon_state = "setup_small_simple" desc = "It's a collection of wires and parts, designed to fit inside of specialized electronic clothing." - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL max_components = IC_COMPONENTS_BASE max_complexity = IC_COMPLEXITY_BASE var/obj/item/clothing/clothing = null @@ -25,7 +25,7 @@ icon_state = "setup_device" max_components = IC_COMPONENTS_BASE / 2 max_complexity = IC_COMPLEXITY_BASE / 2 - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY // Ditto. /obj/item/electronic_assembly/clothing/large @@ -34,7 +34,7 @@ icon_state = "setup_medium_clam" max_components = IC_COMPONENTS_BASE * 2 max_complexity = IC_COMPLEXITY_BASE * 2 - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL // This is defined higher up, in /clothing to avoid lots of copypasta. diff --git a/code/modules/integrated_electronics/core/assemblies/device.dm b/code/modules/integrated_electronics/core/assemblies/device.dm index 688bff4a0b4..656754f09cb 100644 --- a/code/modules/integrated_electronics/core/assemblies/device.dm +++ b/code/modules/integrated_electronics/core/assemblies/device.dm @@ -72,7 +72,7 @@ icon_state = "setup_device" desc = "It's a tiny electronic device with specific use for attaching to other devices." var/obj/item/assembly/electronic_assembly/holder - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY max_components = IC_COMPONENTS_BASE * 3/4 max_complexity = IC_COMPLEXITY_BASE * 3/4 diff --git a/code/modules/integrated_electronics/core/assemblies/generic.dm b/code/modules/integrated_electronics/core/assemblies/generic.dm index 84a42dde047..b74eaeda3aa 100644 --- a/code/modules/integrated_electronics/core/assemblies/generic.dm +++ b/code/modules/integrated_electronics/core/assemblies/generic.dm @@ -6,7 +6,7 @@ name = "electronic device" icon_state = "setup_device" desc = "It's a case, for building tiny-sized electronics with." - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY max_components = IC_COMPONENTS_BASE / 2 max_complexity = IC_COMPLEXITY_BASE / 2 @@ -79,7 +79,7 @@ name = "electronic mechanism" icon_state = "setup_medium" desc = "It's a case, for building medium-sized electronics with." - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL max_components = IC_COMPONENTS_BASE * 2 max_complexity = IC_COMPLEXITY_BASE * 2 @@ -129,7 +129,7 @@ name = "electronic machine" icon_state = "setup_large" desc = "It's a case, for building large electronics with." - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY max_components = IC_COMPONENTS_BASE * 4 max_complexity = IC_COMPLEXITY_BASE * 4 can_anchor = TRUE @@ -173,7 +173,7 @@ name = "electronic drone" icon_state = "setup_drone" desc = "It's a case, for building mobile electronics with." - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY max_components = IC_COMPONENTS_BASE * 3 max_complexity = IC_COMPLEXITY_BASE * 3 allowed_circuit_action_flags = IC_ACTION_MOVEMENT | IC_ACTION_COMBAT | IC_ACTION_LONG_RANGE @@ -209,7 +209,7 @@ name = "type-f electronic drone" icon_state = "setup_drone_android" desc = "It's a case, for building mobile electronics with. This one has a hominoid design." - w_class = ITEMSIZE_COST_HUGE + w_class = WEIGHT_CLASS_HUGE max_components = IC_COMPONENTS_BASE * 5 max_complexity = IC_COMPLEXITY_BASE * 5 @@ -220,7 +220,7 @@ icon_state = "setup_wallmount_medium" desc = "It's a case, for building medium-sized electronics with. It has a magnetized \ backing to allow it to stick to walls." - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL max_components = IC_COMPONENTS_BASE * 2 max_complexity = IC_COMPLEXITY_BASE * 2 can_anchor = TRUE @@ -266,7 +266,7 @@ icon_state = "setup_wallmount_large" desc = "It's a case, for building large electronics with. It has a magnetized backing \ to allow it to stick to walls." - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY max_components = IC_COMPONENTS_BASE * 4 max_complexity = IC_COMPLEXITY_BASE * 4 @@ -275,7 +275,7 @@ icon_state = "setup_wallmount_small" desc = "It's a case, for building small electronics with. It has a magnetized backing \ to allow it to stick to walls." - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL max_components = IC_COMPONENTS_BASE max_complexity = IC_COMPLEXITY_BASE @@ -284,6 +284,6 @@ icon_state = "setup_wallmount_tiny" desc = "It's a case, for building tiny electronics with. It has a magnetized backing \ to allow it to stick to walls." - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY max_components = IC_COMPONENTS_BASE / 2 max_complexity = IC_COMPLEXITY_BASE / 2 diff --git a/code/modules/integrated_electronics/core/assemblies/implant.dm b/code/modules/integrated_electronics/core/assemblies/implant.dm index 54c6110c730..870ab774e0b 100644 --- a/code/modules/integrated_electronics/core/assemblies/implant.dm +++ b/code/modules/integrated_electronics/core/assemblies/implant.dm @@ -5,7 +5,7 @@ name = "electronic implant" icon_state = "setup_implant" desc = "It's a case, for building very tiny electronics with." - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY max_components = IC_COMPONENTS_BASE / 2 max_complexity = IC_COMPLEXITY_BASE / 2 var/obj/item/implant/integrated_circuit/implant = null diff --git a/code/modules/integrated_electronics/core/detailer.dm b/code/modules/integrated_electronics/core/detailer.dm index c3a9c4b43c5..3875e34f63f 100644 --- a/code/modules/integrated_electronics/core/detailer.dm +++ b/code/modules/integrated_electronics/core/detailer.dm @@ -4,7 +4,7 @@ icon = 'icons/obj/integrated_electronics/electronic_tools.dmi' icon_state = "detailer" item_flags = ITEM_NOBLUDGEON | ITEM_ENCUMBERS_WHILE_HELD - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL var/detail_color = COLOR_ASSEMBLY_WHITE var/list/color_list = list( "dark gray" = COLOR_ASSEMBLY_BLACK, diff --git a/code/modules/integrated_electronics/core/integrated_circuit.dm b/code/modules/integrated_electronics/core/integrated_circuit.dm index 8786d1a7011..b26c514d50f 100644 --- a/code/modules/integrated_electronics/core/integrated_circuit.dm +++ b/code/modules/integrated_electronics/core/integrated_circuit.dm @@ -8,7 +8,7 @@ a creative player the means to solve many problems. Circuits are held inside an desc = "It's a tiny chip! This one doesn't seem to do much, however." icon = 'icons/obj/integrated_electronics/electronic_components.dmi' icon_state = "template" - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY /// Reference to the assembly holding this circuit, if any. var/obj/item/electronic_assembly/assembly = null var/extended_desc = null diff --git a/code/modules/integrated_electronics/core/printer.dm b/code/modules/integrated_electronics/core/printer.dm index 44a7e43c014..a424b67d7bb 100644 --- a/code/modules/integrated_electronics/core/printer.dm +++ b/code/modules/integrated_electronics/core/printer.dm @@ -3,7 +3,7 @@ desc = "A portable(ish) machine made to print tiny modular circuitry out of metal." icon = 'icons/obj/integrated_electronics/electronic_tools.dmi' icon_state = "circuit_printer" - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY var/cur_metal = 0 var/max_metal = 250 /// One sheet equals this much metal. @@ -360,7 +360,7 @@ icon = 'icons/obj/integrated_electronics/electronic_tools.dmi' icon_state = "upgrade_disk" item_state = "card-id" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL origin_tech = list(TECH_ENGINEERING = 3, TECH_DATA = 4) /obj/item/disk/integrated_circuit/upgrade/advanced diff --git a/code/modules/integrated_electronics/core/tools.dm b/code/modules/integrated_electronics/core/tools.dm index 5cfb14ccd77..250916f54cc 100644 --- a/code/modules/integrated_electronics/core/tools.dm +++ b/code/modules/integrated_electronics/core/tools.dm @@ -12,7 +12,7 @@ icon = 'icons/obj/integrated_electronics/electronic_tools.dmi' icon_state = "wirer-wire" item_state = "wirer" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL var/datum/integrated_io/selected_io = null var/mode = WIRE @@ -110,7 +110,7 @@ settings to specific circuits, or for debugging purposes. It can also pulse activation pins." icon = 'icons/obj/integrated_electronics/electronic_tools.dmi' icon_state = "debugger" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL var/data_to_write = null var/accepting_refs = FALSE var/copy_values = FALSE @@ -286,9 +286,9 @@ desc = "This kit's essential for any circuitry projects." icon = 'icons/obj/integrated_electronics/electronic_misc.dmi' icon_state = "circuit_kit" - w_class = 3 - display_contents_with_number = 0 - can_hold = list( + w_class = WEIGHT_CLASS_NORMAL + ui_numerical_mode = FALSE + insertion_whitelist = list( /obj/item/integrated_circuit, /obj/item/storage/bag/circuits/mini, /obj/item/electronic_assembly, @@ -298,9 +298,9 @@ /obj/item/tool/wrench, /obj/item/multitool ) - cant_hold = list(/obj/item/tool/screwdriver/power) + insertion_blacklist = list(/obj/item/tool/screwdriver/power) -/obj/item/storage/bag/circuits/basic/PopulateContents() +/obj/item/storage/bag/circuits/basic/legacy_spawn_contents() new /obj/item/storage/bag/circuits/mini/arithmetic(src) new /obj/item/storage/bag/circuits/mini/trig(src) new /obj/item/storage/bag/circuits/mini/input(src) @@ -320,9 +320,9 @@ new /obj/item/tool/screwdriver(src) new /obj/item/tool/crowbar(src) new /obj/item/tool/wrench(src) - make_exact_fit() + obj_storage.fit_to_contents() -/obj/item/storage/bag/circuits/all/PopulateContents() +/obj/item/storage/bag/circuits/all/legacy_spawn_contents() new /obj/item/storage/bag/circuits/mini/arithmetic/all(src) new /obj/item/storage/bag/circuits/mini/trig/all(src) new /obj/item/storage/bag/circuits/mini/input/all(src) @@ -344,14 +344,14 @@ new /obj/item/integrated_electronics/wirer(src) new /obj/item/integrated_electronics/debugger(src) new /obj/item/tool/crowbar(src) - make_exact_fit() + obj_storage.fit_to_contents() /obj/item/storage/bag/circuits/mini name = "circuit box" desc = "Used to partition categories of circuits, for a neater workspace." - w_class = 2 - display_contents_with_number = 1 - can_hold = list(/obj/item/integrated_circuit) + w_class = WEIGHT_CLASS_SMALL + ui_numerical_mode = TRUE + insertion_whitelist = list(/obj/item/integrated_circuit) var/spawn_flags_to_use = IC_SPAWN_DEFAULT /obj/item/storage/bag/circuits/mini/arithmetic @@ -362,12 +362,12 @@ /obj/item/storage/bag/circuits/mini/arithmetic/all // Don't believe this will ever be needed. spawn_flags_to_use = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH -/obj/item/storage/bag/circuits/mini/arithmetic/PopulateContents() +/obj/item/storage/bag/circuits/mini/arithmetic/legacy_spawn_contents() for(var/obj/item/integrated_circuit/arithmetic/IC in all_integrated_circuits) if(IC.spawn_flags & spawn_flags_to_use) for(var/i = 1 to 4) new IC.type(src) - make_exact_fit() + obj_storage.fit_to_contents() /obj/item/storage/bag/circuits/mini/trig name = "trig circuit box" @@ -377,12 +377,12 @@ /obj/item/storage/bag/circuits/mini/trig/all // Ditto spawn_flags_to_use = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH -/obj/item/storage/bag/circuits/mini/trig/PopulateContents() +/obj/item/storage/bag/circuits/mini/trig/legacy_spawn_contents() for(var/obj/item/integrated_circuit/trig/IC in all_integrated_circuits) if(IC.spawn_flags & spawn_flags_to_use) for(var/i = 1 to 4) new IC.type(src) - make_exact_fit() + obj_storage.fit_to_contents() /obj/item/storage/bag/circuits/mini/input name = "input circuit box" @@ -392,12 +392,12 @@ /obj/item/storage/bag/circuits/mini/input/all spawn_flags_to_use = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH -/obj/item/storage/bag/circuits/mini/input/PopulateContents() +/obj/item/storage/bag/circuits/mini/input/legacy_spawn_contents() for(var/obj/item/integrated_circuit/input/IC in all_integrated_circuits) if(IC.spawn_flags & spawn_flags_to_use) for(var/i = 1 to 4) new IC.type(src) - make_exact_fit() + obj_storage.fit_to_contents() /obj/item/storage/bag/circuits/mini/output name = "output circuit box" @@ -407,12 +407,12 @@ /obj/item/storage/bag/circuits/mini/output/all spawn_flags_to_use = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH -/obj/item/storage/bag/circuits/mini/output/PopulateContents() +/obj/item/storage/bag/circuits/mini/output/legacy_spawn_contents() for(var/obj/item/integrated_circuit/output/IC in all_integrated_circuits) if(IC.spawn_flags & spawn_flags_to_use) for(var/i = 1 to 4) new IC.type(src) - make_exact_fit() + obj_storage.fit_to_contents() /obj/item/storage/bag/circuits/mini/memory name = "memory circuit box" @@ -422,12 +422,12 @@ /obj/item/storage/bag/circuits/mini/memory/all spawn_flags_to_use = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH -/obj/item/storage/bag/circuits/mini/memory/PopulateContents() +/obj/item/storage/bag/circuits/mini/memory/legacy_spawn_contents() for(var/obj/item/integrated_circuit/memory/IC in all_integrated_circuits) if(IC.spawn_flags & spawn_flags_to_use) for(var/i = 1 to 4) new IC.type(src) - make_exact_fit() + obj_storage.fit_to_contents() /obj/item/storage/bag/circuits/mini/logic name = "logic circuit box" @@ -437,12 +437,12 @@ /obj/item/storage/bag/circuits/mini/logic/all spawn_flags_to_use = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH -/obj/item/storage/bag/circuits/mini/logic/PopulateContents() +/obj/item/storage/bag/circuits/mini/logic/legacy_spawn_contents() for(var/obj/item/integrated_circuit/logic/IC in all_integrated_circuits) if(IC.spawn_flags & spawn_flags_to_use) for(var/i = 1 to 4) new IC.type(src) - make_exact_fit() + obj_storage.fit_to_contents() /obj/item/storage/bag/circuits/mini/time name = "time circuit box" @@ -452,12 +452,12 @@ /obj/item/storage/bag/circuits/mini/time/all spawn_flags_to_use = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH -/obj/item/storage/bag/circuits/mini/time/PopulateContents() +/obj/item/storage/bag/circuits/mini/time/legacy_spawn_contents() for(var/obj/item/integrated_circuit/time/IC in all_integrated_circuits) if(IC.spawn_flags & spawn_flags_to_use) for(var/i = 1 to 4) new IC.type(src) - make_exact_fit() + obj_storage.fit_to_contents() /obj/item/storage/bag/circuits/mini/reagents name = "reagent circuit box" @@ -467,13 +467,13 @@ /obj/item/storage/bag/circuits/mini/reagents/all spawn_flags_to_use = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH -/obj/item/storage/bag/circuits/mini/reagents/PopulateContents() +/obj/item/storage/bag/circuits/mini/reagents/legacy_spawn_contents() . = ..() for(var/obj/item/integrated_circuit/reagent/IC in all_integrated_circuits) if(IC.spawn_flags & spawn_flags_to_use) for(var/i = 1 to 4) new IC.type(src) - make_exact_fit() + obj_storage.fit_to_contents() /obj/item/storage/bag/circuits/mini/transfer name = "transfer circuit box" @@ -483,12 +483,12 @@ /obj/item/storage/bag/circuits/mini/transfer/all spawn_flags_to_use = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH -/obj/item/storage/bag/circuits/mini/transfer/PopulateContents() +/obj/item/storage/bag/circuits/mini/transfer/legacy_spawn_contents() for(var/obj/item/integrated_circuit/transfer/IC in all_integrated_circuits) if(IC.spawn_flags & spawn_flags_to_use) for(var/i = 1 to 4) new IC.type(src) - make_exact_fit() + obj_storage.fit_to_contents() /obj/item/storage/bag/circuits/mini/converter name = "converter circuit box" @@ -498,12 +498,12 @@ /obj/item/storage/bag/circuits/mini/converter/all spawn_flags_to_use = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH -/obj/item/storage/bag/circuits/mini/converter/PopulateContents() +/obj/item/storage/bag/circuits/mini/converter/legacy_spawn_contents() for(var/obj/item/integrated_circuit/converter/IC in all_integrated_circuits) if(IC.spawn_flags & spawn_flags_to_use) for(var/i = 1 to 4) new IC.type(src) - make_exact_fit() + obj_storage.fit_to_contents() /obj/item/storage/bag/circuits/mini/smart name = "smart box" @@ -513,13 +513,13 @@ /obj/item/storage/bag/circuits/mini/smart/all spawn_flags_to_use = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH -/obj/item/storage/bag/circuits/mini/smart/PopulateContents() +/obj/item/storage/bag/circuits/mini/smart/legacy_spawn_contents() . = ..() for(var/obj/item/integrated_circuit/smart/IC in all_integrated_circuits) if(IC.spawn_flags & spawn_flags_to_use) for(var/i = 1 to 4) new IC.type(src) - make_exact_fit() + obj_storage.fit_to_contents() /obj/item/storage/bag/circuits/mini/manipulation name = "manipulation box" @@ -529,13 +529,13 @@ /obj/item/storage/bag/circuits/mini/manipulation/all spawn_flags_to_use = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH -/obj/item/storage/bag/circuits/mini/manipulation/PopulateContents() +/obj/item/storage/bag/circuits/mini/manipulation/legacy_spawn_contents() . = ..() for(var/obj/item/integrated_circuit/manipulation/IC in all_integrated_circuits) if(IC.spawn_flags & spawn_flags_to_use) for(var/i = 1 to 4) new IC.type(src) - make_exact_fit() + obj_storage.fit_to_contents() /obj/item/storage/bag/circuits/mini/power name = "power circuit box" @@ -545,7 +545,7 @@ /obj/item/storage/bag/circuits/mini/power/all spawn_flags_to_use = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH -/obj/item/storage/bag/circuits/mini/power/PopulateContents() +/obj/item/storage/bag/circuits/mini/power/legacy_spawn_contents() for(var/obj/item/integrated_circuit/passive/power/IC in all_integrated_circuits) if(IC.spawn_flags & spawn_flags_to_use) for(var/i = 1 to 4) @@ -554,4 +554,4 @@ if(IC.spawn_flags & spawn_flags_to_use) for(var/i = 1 to 4) new IC.type(src) - make_exact_fit() + obj_storage.fit_to_contents() diff --git a/code/modules/integrated_electronics/passive/power.dm b/code/modules/integrated_electronics/passive/power.dm index 5258ffa3a9e..945e153c90f 100644 --- a/code/modules/integrated_electronics/passive/power.dm +++ b/code/modules/integrated_electronics/passive/power.dm @@ -94,7 +94,7 @@ /obj/item/integrated_circuit/passive/power/relay name = "tesla power relay" desc = "A seemingly enigmatic device which connects to nearby APCs wirelessly and draws power from them." - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL extended_desc = "The siphon generates 250W of energy, so long as an APC is in the same room, with a cell that has energy. It will always drain \ from the 'equipment' power channel." icon_state = "power_relay" @@ -152,7 +152,7 @@ /obj/item/integrated_circuit/passive/power/relay/large name = "large tesla power relay" desc = "A seemingly enigmatic device which connects to nearby APCs wirelessly and draws power from them, now in industiral size!" - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY extended_desc = "The siphon generates 2 kW of energy, so long as an APC is in the same room, with a cell that has energy. It will always drain \ from the 'equipment' power channel." icon_state = "power_relay" diff --git a/code/modules/integrated_electronics/subtypes/built_in.dm b/code/modules/integrated_electronics/subtypes/built_in.dm index 53a1c2c030f..568c49244a7 100644 --- a/code/modules/integrated_electronics/subtypes/built_in.dm +++ b/code/modules/integrated_electronics/subtypes/built_in.dm @@ -4,7 +4,7 @@ icon = 'icons/obj/integrated_electronics/electronic_setups.dmi' icon_state = "template" size = -1 - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY removable = FALSE /obj/item/integrated_circuit/built_in/device_input diff --git a/code/modules/integrated_electronics/subtypes/data_transfer.dm b/code/modules/integrated_electronics/subtypes/data_transfer.dm index d3ca3e7c816..9cb65c4f506 100644 --- a/code/modules/integrated_electronics/subtypes/data_transfer.dm +++ b/code/modules/integrated_electronics/subtypes/data_transfer.dm @@ -41,13 +41,13 @@ /obj/item/integrated_circuit/transfer/multiplexer/large name = "eight multiplexer" number_of_inputs = 8 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL icon_state = "mux8" /obj/item/integrated_circuit/transfer/multiplexer/huge name = "sixteen multiplexer" icon_state = "mux16" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL number_of_inputs = 16 /obj/item/integrated_circuit/transfer/demultiplexer @@ -90,13 +90,13 @@ /obj/item/integrated_circuit/transfer/demultiplexer/large name = "eight demultiplexer" icon_state = "dmux8" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL number_of_outputs = 8 /obj/item/integrated_circuit/transfer/demultiplexer/huge name = "sixteen demultiplexer" icon_state = "dmux16" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL number_of_outputs = 16 /obj/item/integrated_circuit/transfer/pulsedemultiplexer @@ -136,13 +136,13 @@ /obj/item/integrated_circuit/transfer/pulsedemultiplexer/large name = "eight pulse demultiplexer" icon_state = "dmux8" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL number_of_outputs = 8 /obj/item/integrated_circuit/transfer/pulsedemultiplexer/huge name = "sixteen pulse demultiplexer" icon_state = "dmux16" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL number_of_outputs = 16 /obj/item/integrated_circuit/transfer/pulsemultiplexer diff --git a/code/modules/integrated_electronics/subtypes/input.dm b/code/modules/integrated_electronics/subtypes/input.dm index fc0ff781277..4f2b32bc5eb 100644 --- a/code/modules/integrated_electronics/subtypes/input.dm +++ b/code/modules/integrated_electronics/subtypes/input.dm @@ -1171,7 +1171,7 @@ GLOBAL_DATUM_INIT(circuit_translation_context, /datum/translation_context/simple desc = "This monitors the charge level of an internal battery." icon_state = "internalbm" extended_desc = "This circuit will give you the values of charge, max charge and the current percentage of the internal battery on demand." - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY complexity = 1 inputs = list() outputs = list( @@ -1208,7 +1208,7 @@ GLOBAL_DATUM_INIT(circuit_translation_context, /datum/translation_context/simple desc = "This can read the battery state of any device in view." icon_state = "externalbm" extended_desc = "This circuit will give you the charge, max charge and the current percentage values of any device or battery in view." - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY complexity = 2 inputs = list("target" = IC_PINTYPE_REF) outputs = list( @@ -1295,7 +1295,7 @@ GLOBAL_DATUM_INIT(circuit_translation_context, /datum/translation_context/simple extended_desc = "This chip contains an esoteric mix of sensors with spurious claims. Proponents claim it facilitates communication \ with beings from other dimensions. A larger majority believe it to be a sophisticated hacking device. The designers simply state\ that \"more testing is required\"." - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY complexity = 4 inputs = list("toggle on" = IC_PINTYPE_BOOLEAN) // outputs = list("" = ) diff --git a/code/modules/integrated_electronics/subtypes/manipulation.dm b/code/modules/integrated_electronics/subtypes/manipulation.dm index 04747baa1ac..8d6a6081ce6 100644 --- a/code/modules/integrated_electronics/subtypes/manipulation.dm +++ b/code/modules/integrated_electronics/subtypes/manipulation.dm @@ -8,7 +8,7 @@ extended_desc = "The circuit accepts a 'dir' number as a direction to move towards.
\ Pulsing the 'step towards dir' activator pin will cause the machine to move one step in that direction, assuming it is not \ being held, or anchored in some way. It should be noted that the ability to move is dependant on the type of assembly that this circuit inhabits; only drone assemblies can move." - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL complexity = 10 cooldown_per_use = 1 ext_cooldown = 4 @@ -598,6 +598,7 @@ var/max_items = 10 /obj/item/integrated_circuit/manipulation/inserter/do_work(ord) + // todo: this doesn't even fucking work if(ord == 1) //There shouldn't be any target required to eject all contents var/obj/item/target_obj = get_pin_data_as_type(IC_INPUT, 1, /obj/item) @@ -625,7 +626,7 @@ if(0) if(A && isstorage(A) && Adjacent(A)) var/obj/item/storage/S = A - S.remove_from_storage(target_obj,drop_location()) + S.obj_storage.try_remove(target_obj, drop_location()) activate_pin(2) return TRUE return @@ -814,7 +815,7 @@ The 'fire' activator will cause the mechanism to attempt to fire the weapon at the coordinates, if possible. Note that the \ normal limitations to firearms, such as ammunition requirements and firing delays, still hold true if fired by the mechanism." complexity = 20 - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL size = 3 can_be_asked_input = TRUE inputs = list( diff --git a/code/modules/integrated_electronics/subtypes/memory.dm b/code/modules/integrated_electronics/subtypes/memory.dm index fa68e0bea39..28d3a0b831a 100644 --- a/code/modules/integrated_electronics/subtypes/memory.dm +++ b/code/modules/integrated_electronics/subtypes/memory.dm @@ -66,7 +66,7 @@ name = "large memory stick" desc = "This stick of memory can hold up up to sixteen pieces of data." icon_state = "memory16" - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL spawn_flags = IC_SPAWN_RESEARCH origin_tech = list(TECH_ENGINEERING = 4, TECH_DATA = 4) power_draw_per_use = 8 diff --git a/code/modules/integrated_electronics/subtypes/output.dm b/code/modules/integrated_electronics/subtypes/output.dm index 2e5830700cd..5b41b5cf0de 100644 --- a/code/modules/integrated_electronics/subtypes/output.dm +++ b/code/modules/integrated_electronics/subtypes/output.dm @@ -261,7 +261,7 @@ desc = "This small camera allows a remote viewer to see what it sees." extended_desc = "The camera is linked to the Research camera network." icon_state = "video_camera" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL complexity = 10 inputs = list( "camera name" = IC_PINTYPE_STRING, diff --git a/code/modules/integrated_electronics/subtypes/power.dm b/code/modules/integrated_electronics/subtypes/power.dm index af121c729f2..603d75b76f5 100644 --- a/code/modules/integrated_electronics/subtypes/power.dm +++ b/code/modules/integrated_electronics/subtypes/power.dm @@ -9,7 +9,7 @@ a reference to a machine to send electricity to. This can be a battery, or anything containing a battery. The machine can exist \ inside the assembly, or adjacent to it. The power is sourced from the assembly's power cell. If the target is outside of the assembly, \ some power is lost due to ineffiency." - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL complexity = 16 inputs = list("target" = IC_PINTYPE_REF) outputs = list( @@ -31,7 +31,7 @@ inside the assembly, or adjacent to it. The power is sourced from the assembly's power cell. If the target is outside of the assembly, \ some power is lost due to ineffiency. Warning! Don't stack more than 1 power transmitter, as it becomes less efficient for every other \ transmission circuit in its own assembly and other nearby ones." - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY complexity = 32 origin_tech = list(TECH_ENGINEERING = 4, TECH_DATA = 4, TECH_POWER = 6, TECH_MAGNET = 5) power_draw_per_use = 2000 diff --git a/code/modules/keybindings/keybind/human.dm b/code/modules/keybindings/keybind/human.dm index 43f5653472c..546b33cb471 100644 --- a/code/modules/keybindings/keybind/human.dm +++ b/code/modules/keybindings/keybind/human.dm @@ -24,7 +24,7 @@ /datum/keybinding/human/quick_equipbelt/down(client/user) var/mob/living/carbon/human/H = user.mob - H.smart_equipbelt() + H.auto_held_insert_or_draw_via_slot(/datum/inventory_slot_meta/inventory/belt) return TRUE /datum/keybinding/human/bag_equip @@ -35,5 +35,5 @@ /datum/keybinding/human/bag_equip/down(client/user) var/mob/living/carbon/human/H = user.mob - H.smart_equipbag() + H.auto_held_insert_or_draw_via_slot(/datum/inventory_slot_meta/inventory/back) return TRUE diff --git a/code/modules/library/book.dm b/code/modules/library/book.dm index 3b95b546b4f..1bef2444681 100644 --- a/code/modules/library/book.dm +++ b/code/modules/library/book.dm @@ -6,7 +6,7 @@ throw_range = 5 atom_flags = NOCONDUCT worn_render_flags = WORN_RENDER_INHAND_NO_RENDER | WORN_RENDER_SLOT_NO_RENDER - w_class = ITEMSIZE_NORMAL //upped to three because books are, y'know, pretty big. (and you could hide them inside eachother recursively forever) + w_class = WEIGHT_CLASS_NORMAL //upped to three because books are, y'know, pretty big. (and you could hide them inside eachother recursively forever) attack_verb = list("bashed", "whacked", "educated") var/dat // Actual page content var/due_date = 0 // Game time in 1/10th seconds @@ -45,7 +45,7 @@ /obj/item/book/attackby(obj/item/W, mob/user) if(carved) if(!store) - if(W.w_class < ITEMSIZE_LARGE) + if(W.w_class < WEIGHT_CLASS_BULKY) if(!user.attempt_insert_item_for_installation(W, src)) return store = W diff --git a/code/modules/library/lib_items.dm b/code/modules/library/lib_items.dm index e47dcedf6f1..2928ad4b4c3 100644 --- a/code/modules/library/lib_items.dm +++ b/code/modules/library/lib_items.dm @@ -203,7 +203,7 @@ worn_render_flags = WORN_RENDER_INHAND_NO_RENDER | WORN_RENDER_SLOT_NO_RENDER throw_speed = 1 throw_range = 5 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL var/obj/machinery/librarycomp/computer // Associated computer - Modes 1 to 3 use this var/obj/item/book/book // Currently scanned book var/mode = 0 // 0 - Scan only, 1 - Scan and Set Buffer, 2 - Scan and Attempt to Check In, 3 - Scan and Attempt to Add to Inventory diff --git a/code/modules/lore_codex/codex.dm b/code/modules/lore_codex/codex.dm index 813841217fd..0d33b266665 100644 --- a/code/modules/lore_codex/codex.dm +++ b/code/modules/lore_codex/codex.dm @@ -40,6 +40,6 @@ name = "Daedalus Pocket Newscaster" desc = "A occasionally-updated compendium of articles on current events. Useful for keeping on the news in the vastness of the the Sigmar Concord." icon_state = "newscodex" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL root_type = /datum/lore/codex/category/main_news libcategory = "Reference" diff --git a/code/modules/materials/material_sheets.dm b/code/modules/materials/material_sheets.dm index 5d28743162c..f8b74c95380 100644 --- a/code/modules/materials/material_sheets.dm +++ b/code/modules/materials/material_sheets.dm @@ -4,7 +4,7 @@ abstract_type = /obj/item/stack/material damage_force = 5 throw_force = 5 - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL throw_speed = 3 throw_range = 3 max_amount = 50 @@ -291,7 +291,7 @@ apply_colour = TRUE /obj/item/stack/material/supermatter/proc/update_mass() // Due to how dangerous they can be, the item will get heavier and larger the more are in the stack. - w_class = min(5, round(amount / 10) + 1) + set_weight_class(min(5, round(amount / 10) + 1)) throw_range = round(amount / 7) + 1 /obj/item/stack/material/supermatter/use(var/used) @@ -364,7 +364,7 @@ no_variants = FALSE color = "#824B28" max_amount = 25 - w_class = ITEMSIZE_HUGE + w_class = WEIGHT_CLASS_HUGE description_info = "Use inhand to craft things, or use a sharp and edged object on this to convert it into two wooden planks." var/plank_type = /obj/item/stack/material/wood drop_sound = 'sound/items/drop/wooden.ogg' diff --git a/code/modules/media/walkpod.dm b/code/modules/media/walkpod.dm index 72b18113818..2a0d61520df 100644 --- a/code/modules/media/walkpod.dm +++ b/code/modules/media/walkpod.dm @@ -24,7 +24,7 @@ var/obj/item/device/headpods/deployed_headpods - w_class = ITEMSIZE_COST_SMALL + w_class = WEIGHT_VOLUME_SMALL slot_flags = SLOT_BELT /obj/item/device/walkpod/Destroy() @@ -267,5 +267,5 @@ icon = 'icons/obj/device_vr.dmi' icon_state = "headpods" item_state = "headphones_on" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL slot_flags = SLOT_HEAD diff --git a/code/modules/mining/drilling/drill.dm b/code/modules/mining/drilling/drill.dm index f3cbc6e268d..4c5d3cf9bae 100644 --- a/code/modules/mining/drilling/drill.dm +++ b/code/modules/mining/drilling/drill.dm @@ -323,7 +323,7 @@ else if(S) var/tookall = TRUE for(var/obj/item/stack/ore/O in contents) - if(!S.take(O)) + if(!S.obj_storage.try_insert(O)) tookall = FALSE break to_chat(user, "You unload [tookall ? "all" : "some"] of the drill's storage cache into [S].") diff --git a/code/modules/mining/drilling/scanner.dm b/code/modules/mining/drilling/scanner.dm index f913d7251fb..642157c2efe 100644 --- a/code/modules/mining/drilling/scanner.dm +++ b/code/modules/mining/drilling/scanner.dm @@ -95,7 +95,7 @@ name = "advanced ore detector" desc = "A compact, complex device used to quickly locate ore deep underground around you." icon_state = "mining-scanner" //thank you eris spriters - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL origin_tech = list(TECH_MAGNET = 4, TECH_ENGINEERING = 4) materials_base = list(MAT_STEEL = 2000, MAT_GLASS = 1000) scanrange = 5 diff --git a/code/modules/mining/fulton.dm b/code/modules/mining/fulton.dm index 35f56c92edb..c0e91710f5a 100644 --- a/code/modules/mining/fulton.dm +++ b/code/modules/mining/fulton.dm @@ -5,7 +5,7 @@ var/global/list/total_extraction_beacons = list() desc = "A balloon pack that can be used to extract equipment or personnel to a Fulton Recovery Beacon. Anything not bolted down can be moved. Link the pack to a beacon by using the pack in hand." icon = 'icons/obj/fulton.dmi' icon_state = "extraction_pack" - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL var/obj/structure/extraction_point/beacon var/list/beacon_networks = list("station") var/uses_left = 3 diff --git a/code/modules/mining/mine_items.dm b/code/modules/mining/mine_items.dm index b9efca4d8c6..8e628d5716d 100644 --- a/code/modules/mining/mine_items.dm +++ b/code/modules/mining/mine_items.dm @@ -19,7 +19,7 @@ throw_force = 4.0 icon_state = "pickaxe" item_state = "jackhammer" - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY materials_base = list(MAT_STEEL = 3750) var/digspeed = 40 //moving the delay to an item var so R&D can make improved picks. --NEO var/sand_dig = FALSE @@ -81,7 +81,7 @@ name = "plasma cutter" icon_state = "plasmacutter" item_state = "gun" - w_class = ITEMSIZE_NORMAL //it is smaller than the pickaxe + w_class = WEIGHT_CLASS_NORMAL //it is smaller than the pickaxe damtype = "fire" digspeed = 20 //Can slice though normal walls, all girders, or be used in reinforced wall deconstruction/ light thermite on fire origin_tech = list(TECH_MATERIAL = 4, TECH_PHORON = 3, TECH_ENGINEERING = 3) @@ -127,7 +127,7 @@ throw_force = 15 //Discount shuriken. icon_state = "icepick" item_state = "spickaxe" //im lazy fuck u - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL materials_base = list(MAT_STEEL = 2750, MAT_TITANIUM = 2000) digspeed = 25 //More expensive than a diamond pick, a lot smaller but decently slower. origin_tech = list(TECH_MATERIAL = 1, TECH_ENGINEERING = 1) @@ -270,7 +270,7 @@ damage_force = 8.0 throw_force = 4.0 item_state = "shovel" - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL origin_tech = list(TECH_MATERIAL = 1, TECH_ENGINEERING = 1) materials_base = list(MAT_STEEL = 50) attack_verb = list("bashed", "bludgeoned", "thrashed", "whacked") @@ -296,7 +296,7 @@ item_state = "spade" damage_force = 5.0 throw_force = 7.0 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL /obj/item/shovel/spade/bone name = "primitive spade" diff --git a/code/modules/mining/mine_turfs.dm b/code/modules/mining/mine_turfs.dm index 66f36778875..2bf7cf2eac3 100644 --- a/code/modules/mining/mine_turfs.dm +++ b/code/modules/mining/mine_turfs.dm @@ -407,20 +407,6 @@ CREATE_STANDARD_TURFS(/turf/unsimulated/mineral) // to_chat(user, "You dug a hole.") GetDrilled() - else if(istype(W,/obj/item/storage/bag/ore)) - var/obj/item/storage/bag/ore/S = W - if(S.collection_mode) - for(var/obj/item/stack/ore/O in contents) - O.attackby(W,user) - return - - else if(istype(W,/obj/item/storage/bag/fossils)) - var/obj/item/storage/bag/fossils/S = W - if(S.collection_mode) - for(var/obj/item/fossil/F in contents) - F.attackby(W,user) - return - else if(istype(W, /obj/item/stack/rods)) var/obj/structure/lattice/L = locate(/obj/structure/lattice, src) if(L) @@ -581,7 +567,7 @@ CREATE_STANDARD_TURFS(/turf/unsimulated/mineral) else return - return attack_hand(user) + return ..() /turf/simulated/mineral/proc/wreckfinds(var/destroy = FALSE) if(!destroy && prob(90)) //nondestructive methods have a chance of letting you step away to not trash things diff --git a/code/modules/mining/ore.dm b/code/modules/mining/ore.dm index 8d8807e6faa..bbd9c744111 100644 --- a/code/modules/mining/ore.dm +++ b/code/modules/mining/ore.dm @@ -3,7 +3,7 @@ icon = 'icons/obj/stacks_ore.dmi' icon_state = "ore" no_variants = FALSE - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL rad_flags = RAD_BLOCK_CONTENTS | RAD_NO_CONTAMINATE // uh let's like, not? it'd be funny but fields usually have like 400 pieces of ore in just a few tiles. //^ not as horrible now that it's stacked but I'm keeping this. <3 singular_name = "ore" diff --git a/code/modules/mining/ore_box.dm b/code/modules/mining/ore_box.dm index c46e7f24802..72074701def 100644 --- a/code/modules/mining/ore_box.dm +++ b/code/modules/mining/ore_box.dm @@ -11,31 +11,27 @@ var/last_update = 0 var/list/stored_ore = list() -/obj/structure/ore_box/attackby(obj/item/W as obj, mob/user as mob) - if (istype(W, /obj/item/stack/ore)) - if(!user.attempt_insert_item_for_installation(W, src)) +/obj/structure/ore_box/attackby(obj/item/I, mob/user, list/params, clickchain_flags, damage_multiplier) + if (istype(I, /obj/item/stack/ore)) + if(!user.attempt_insert_item_for_installation(I, src)) return - user.visible_message(SPAN_NOTICE("[user] drops [W] into [src]."), SPAN_NOTICE("You drop [W] into [src].")) - else if (istype(W, /obj/item/storage/bag/ore)) //it works differently now - var/obj/item/storage/bag/ore/S = W - if(S.isOreEmpty()) - return - for(var/ore in S.stored_ore) - if(!stored_ore[ore]) - stored_ore[ore] = S.stored_ore[ore] - else - stored_ore[ore] += S.stored_ore[ore] - S.stored_ore = list() //it'll get emptied as a result. - S.total_ore = 0 - user.visible_message(SPAN_NOTICE("[user] offloads ores from [W] into [src]."), SPAN_NOTICE("You offload the ores in [W] into [src].")) - else if (istype(W, /obj/item/storage)) - var/obj/item/storage/S = W + user.visible_message(SPAN_NOTICE("[user] drops [I] into [src]."), SPAN_NOTICE("You drop [I] into [src].")) + else if (istype(I, /obj/item/storage/bag/ore)) //it works differently now + var/offloaded = FALSE + for(var/obj/item/stack/ore/ore in I) + ore.forceMove(src) + offloaded = TRUE + I.obj_storage?.ui_queue_refresh() + if(offloaded) + user.visible_message(SPAN_NOTICE("[user] offloads ores from [I] into [src]."), SPAN_NOTICE("You offload the ores in [I] into [src].")) + else if (istype(I, /obj/item/storage)) + var/obj/item/storage/S = I if(!S.contents.len) return - S.hide_from(usr) + S.obj_storage?.hide(user) for(var/obj/item/stack/ore/O in S.contents) - S.remove_from_storage(O, src) //This will move the item to this item's contents - user.visible_message(SPAN_NOTICE("[user] offloads ores from [W] into [src]."), SPAN_NOTICE("You offload the ores in [W] into [src].")) + S.forceMove(src) + user.visible_message(SPAN_NOTICE("[user] offloads ores from [I] into [src]."), SPAN_NOTICE("You offload the ores in [I] into [src].")) /obj/structure/ore_box/examine(mob/user, dist) . = ..() diff --git a/code/modules/mining/ore_redemption_machine/engineering_points_vendor.dm b/code/modules/mining/ore_redemption_machine/engineering_points_vendor.dm index 9c4cb2edaf6..dfcd85f613a 100644 --- a/code/modules/mining/ore_redemption_machine/engineering_points_vendor.dm +++ b/code/modules/mining/ore_redemption_machine/engineering_points_vendor.dm @@ -142,7 +142,7 @@ desc = "An used voucher that could be used to be redeemed for something at the cargo console" icon = 'icons/obj/vouchers.dmi' icon_state = "engineering_voucher_used" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL var/datum/supply_pack/redeemable_for = null /obj/item/engineering_voucher/proc/redeem(var/mob/user) @@ -231,5 +231,5 @@ desc = "???" icon = 'icons/obj/abductor.dmi' icon_state = "circuit" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL origin_tech = list(TECH_PRECURSOR = 1) diff --git a/code/modules/mining/ore_redemption_machine/mine_point_items.dm b/code/modules/mining/ore_redemption_machine/mine_point_items.dm index 17b8e5d4da2..fe4dd1f39d5 100644 --- a/code/modules/mining/ore_redemption_machine/mine_point_items.dm +++ b/code/modules/mining/ore_redemption_machine/mine_point_items.dm @@ -7,7 +7,7 @@ desc = "A token to redeem a piece of equipment. Use it on a mining equipment vendor." icon = 'icons/obj/mining.dmi' icon_state = "mining_voucher" - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY /**********************Mining Point Card**********************/ diff --git a/code/modules/mining/resonator.dm b/code/modules/mining/resonator.dm index a1662ef4175..7ebf4542980 100644 --- a/code/modules/mining/resonator.dm +++ b/code/modules/mining/resonator.dm @@ -7,7 +7,7 @@ item_state = "resonator" origin_tech = list(TECH_MAGNET = 3, TECH_ENGINEERING = 3) desc = "A handheld device that creates small fields of energy that resonate until they detonate, crushing rock. It can also be activated without a target to create a field at the user's location, to act as a delayed time trap. It's more effective in low temperature." - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL damage_force = 8 throw_force = 10 var/cooldown = 0 diff --git a/code/modules/mining/resonator_vr.dm b/code/modules/mining/resonator_vr.dm index af31d6ca29e..7ea2cc170e9 100644 --- a/code/modules/mining/resonator_vr.dm +++ b/code/modules/mining/resonator_vr.dm @@ -11,7 +11,7 @@ ) origin_tech = list(TECH_MAGNET = 3, TECH_ENGINEERING = 3) desc = "A handheld device that creates small fields of energy that resonate until they detonate, crushing rock. It can also be activated without a target to create a field at the user's location, to act as a delayed time trap. It's more effective in low temperature." - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL damage_force = 8 throw_force = 10 var/cooldown = 0 diff --git a/code/modules/mining/shelter_atoms.dm b/code/modules/mining/shelter_atoms.dm index 3424352228b..8cdb65a886d 100644 --- a/code/modules/mining/shelter_atoms.dm +++ b/code/modules/mining/shelter_atoms.dm @@ -12,7 +12,7 @@ desc = "An emergency shelter programmed into construction nanomachines. It has a license for use printed on the bottom." icon_state = "houseball" icon = 'icons/obj/device_alt.dmi' - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY var/template_id = "shelter_alpha" var/datum/map_template/shelter/template var/used = FALSE diff --git a/code/modules/mining/vertibore.dm b/code/modules/mining/vertibore.dm index ab7e20091ed..324001d5777 100644 --- a/code/modules/mining/vertibore.dm +++ b/code/modules/mining/vertibore.dm @@ -3,7 +3,7 @@ name = "portable shaft excavation device" desc = "A heavily modified shaft bore utilizing phorogenic blasts to tunnel vertically through rock. Much faster than a large industrial drill unit, but is very resource- and power-intensive." description_fluff = "A phoron bore used for rapidly digging through rock that has been modified to allow it to fire straight down at a much higher power. However, this has resulted in a loss of power and resource efficiency, compactness, and modularity as the proprietary capacitor and manipulator cannot be swapped." - w_class = ITEMSIZE_NO_CONTAINER + w_class = WEIGHT_CLASS_HUGE icon = 'icons/obj/mining.dmi' icon_state = "vertibore" item_state = "vertibore" diff --git a/code/modules/mob/grab.dm b/code/modules/mob/grab.dm index dac151afa49..addd4435ccb 100644 --- a/code/modules/mob/grab.dm +++ b/code/modules/mob/grab.dm @@ -97,7 +97,7 @@ var/dancing //determines if assailant and affecting keep looking at each other. Basically a wrestling position item_state = "nothing" - w_class = ITEMSIZE_HUGE + w_class = WEIGHT_CLASS_HUGE /obj/item/grab/Initialize(mapload, mob/victim) . = ..() diff --git a/code/modules/mob/holder.dm b/code/modules/mob/holder.dm index a8e00c7ec73..4942a75ffcc 100644 --- a/code/modules/mob/holder.dm +++ b/code/modules/mob/holder.dm @@ -129,7 +129,7 @@ origin_tech = list(TECH_DATA = 2) /obj/item/holder/mouse - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY /obj/item/holder/borer origin_tech = list(TECH_BIO = 6) @@ -158,22 +158,22 @@ /obj/item/holder/protoblob clothing_flags = ALLOWINTERNALS slot_flags = SLOT_HEAD | SLOT_OCLOTHING | SLOT_HOLSTER | SLOT_ICLOTHING | SLOT_ID | SLOT_MASK | SLOT_GLOVES | SLOT_BACK | SLOT_BELT | SLOT_FEET | SLOT_EARS | SLOT_EYES - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY allowed = list(/obj/item/gun,/obj/item/flashlight,/obj/item/tank,/obj/item/suit_cooling_unit,/obj/item/melee/baton) //Roach Types /obj/item/holder/roach - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY /obj/item/holder/roachling - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY /obj/item/holder/panzer - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY /obj/item/holder/jager - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY /obj/item/holder/seuche - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY /obj/item/holder/fuhrer - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY /obj/item/holder/attackby(obj/item/W as obj, mob/user as mob) for(var/mob/M in src.contents) diff --git a/code/modules/mob/inventory.dm b/code/modules/mob/inventory.dm index 42fce6a6208..73d6ca3cf18 100644 --- a/code/modules/mob/inventory.dm +++ b/code/modules/mob/inventory.dm @@ -1,13 +1,10 @@ // todo: see all this? needs to be decided what to do with and shoved into the inventory handling system proper once evaluated. -/mob - var/obj/item/storage/s_active = null // Even ghosts can/should be able to peek into boxes on the ground - //This proc is called whenever someone clicks an inventory ui slot. /mob/proc/attack_ui(var/slot) var/obj/item/W = get_active_held_item() - var/obj/item/E = item_by_slot(slot) + var/obj/item/E = item_by_slot_id(slot) if (istype(E)) if(istype(W)) E.attackby(W,src) @@ -50,7 +47,7 @@ */ /mob/proc/remove_all_restraints() drop_slots_to_ground(list(SLOT_ID_HANDCUFFED, SLOT_ID_LEGCUFFED), INV_OP_FORCE) - var/obj/item/suit_check = item_by_slot(SLOT_ID_SUIT) + var/obj/item/suit_check = item_by_slot_id(SLOT_ID_SUIT) if(istype(suit_check, /obj/item/clothing/suit/straight_jacket)) drop_item_to_ground(suit_check, INV_OP_FORCE) // guess at if it's a bad thing diff --git a/code/modules/mob/inventory/helpers.dm b/code/modules/mob/inventory/helpers.dm index ae6ea95374d..ef843afeac3 100644 --- a/code/modules/mob/inventory/helpers.dm +++ b/code/modules/mob/inventory/helpers.dm @@ -1,3 +1,6 @@ +//* This file is explicitly licensed under the MIT license. *// +//* Copyright (c) 2023 Citadel Station developers. *// + //* these call other procs in external.dm *// /** @@ -46,11 +49,11 @@ /mob/proc/drop_slots_to_ground(list/slots, flags, datum/callback/cb) if(islist(slots)) for(var/slot in slots) - var/obj/item/I = item_by_slot(slot) + var/obj/item/I = item_by_slot_id(slot) . = drop_item_to_ground(I, flags) cb?.Invoke(I, .) else - var/obj/item/I = item_by_slot(slots) + var/obj/item/I = item_by_slot_id(slots) . = drop_item_to_ground(I, flags) cb?.Invoke(I, .) @@ -60,11 +63,11 @@ // de-equipped from the jumpsuit if(islist(slots)) for(var/slot in slots) - var/obj/item/I = item_by_slot(slot) + var/obj/item/I = item_by_slot_id(slot) . = transfer_item_to_loc(I, A, flags) cb?.Invoke(I, .) else - var/obj/item/I = item_by_slot(slots) + var/obj/item/I = item_by_slot_id(slots) . = transfer_item_to_loc(I, A, flags) cb?.Invoke(I, .) @@ -73,11 +76,11 @@ var/obj/item/I if(islist(slots)) for(var/slot in slots) - I = item_by_slot(slot) + I = item_by_slot_id(slot) if(I) . += I else - I = item_by_slot(slots) + I = item_by_slot_id(slots) if(I) . += I @@ -93,3 +96,92 @@ for(var/slot in slots) if(equip_to_slot_if_possible(I, slot, user, flags)) return slot + +/** + * Attempt to shove an item being held into a storage in a given slot + */ +/mob/proc/attempt_put_held_item_into_storage_in_slot(obj/item/inserting, datum/inventory_slot_meta/slot_like, silent, mob/initiator = src) + if(isnull(inserting)) + inserting = get_active_held_item() + if(!is_holding(inserting)) + return + slot_like = resolve_inventory_slot_meta(slot_like) + var/obj/item/equipped = item_by_slot_id(slot_like.id) + if(isnull(equipped)) + if(!silent) + to_chat(initiator, SPAN_WARNING("There is nothing worn [slot_like.display_preposition] [initiator == src? "your" : "their"] [slot_like.display_name].")) + return FALSE + if(!equipped.obj_storage) + if(!silent) + to_chat(initiator, SPAN_WARNING("[equipped] doesn't have accessible storage.")) + return FALSE + if(!equipped.obj_storage.auto_handle_interacted_insertion(inserting, new /datum/event_args/actor(src, initiator), silent)) + return FALSE + return TRUE + +/** + * Attempt to grab an item from a given slot into hand. + */ +/mob/proc/attempt_grab_item_out_of_storage_in_slot(datum/inventory_slot_meta/slot_like, silent, mob/initiator = src) + slot_like = resolve_inventory_slot_meta(slot_like) + var/obj/item/equipped = item_by_slot_id(slot_like.id) + if(isnull(equipped)) + if(!silent) + to_chat(initiator, SPAN_WARNING("There is nothing worn [slot_like.display_preposition] [initiator == src? "your" : "their"] [slot_like.display_name].")) + return FALSE + if(isnull(equipped.obj_storage)) + if(!silent) + to_chat(initiator, SPAN_WARNING("[equipped] doesn't have accessible storage.")) + return FALSE + return attempt_grab_item_out_of_storage(equipped, silent, initiator) + +/** + * Attempt to grab an item from given storage into hand. + */ +/mob/proc/attempt_grab_item_out_of_storage(obj/storage, silent, mob/initiator = src) + if(get_active_held_item()) + if(!silent) + to_chat(initiator, SPAN_WARNING("[initiator == src? "You" : "They"] already have something held in [initiator == src? "your" : "their"] hand.")) + return FALSE + if(isnull(storage.obj_storage)) + return FALSE + var/obj/item/removing = storage.obj_storage.top_entity_in_contents() + if(isnull(removing)) + if(!silent) + to_chat(initiator, SPAN_WARNING("[initiator == src? "Your" : "Their"] [storage] is empty!")) + return FALSE + var/datum/event_args/actor/actor = new(src, initiator) + if(storage.obj_storage.check_on_found_hooks(actor)) + return + return storage.obj_storage.auto_handle_interacted_removal(removing, actor, silent, put_in_hands = TRUE) + +/** + * Automatically either put in hand object into a storage in a given slot, or + * draw an item from that storage into hand. + */ +/mob/proc/auto_held_insert_or_draw_via_slot(datum/inventory_slot_meta/slot_like, silent, mob/initiator = src) + slot_like = resolve_inventory_slot_meta(slot_like) + var/obj/item/holding = get_active_held_item() + var/obj/item/in_slot = item_by_slot_id(slot_like.id) + if(isnull(in_slot) || isnull(in_slot.obj_storage)) + if(isnull(holding)) + if(isnull(in_slot)) + to_chat(initiator, SPAN_WARNING("[initiator == src? "You" : "They"] have nothing held in [slot_like.display_name]!")) + return FALSE + if(put_in_active_hand(in_slot)) + to_chat(initiator, SPAN_NOTICE("You draw [in_slot] from your [slot_like.display_name].")) + return TRUE + else + to_chat(initiator, SPAN_WARNING("You fail to draw [in_slot] from your [slot_like.display_name]!")) + return FALSE + else + if(equip_to_slot_if_possible(holding, slot_like, user = initiator)) + to_chat(initiator, SPAN_NOTICE("You tuck [holding] away [slot_like.display_preposition] your [slot_like.display_name].")) + return TRUE + else + return FALSE + else + if(isnull(holding)) + return attempt_grab_item_out_of_storage_in_slot(slot_like, silent, initiator) + else + return attempt_put_held_item_into_storage_in_slot(holding, slot_like, silent, initiator) diff --git a/code/modules/mob/inventory/inventory.dm b/code/modules/mob/inventory/inventory.dm index db613954193..25e905dca3d 100644 --- a/code/modules/mob/inventory/inventory.dm +++ b/code/modules/mob/inventory/inventory.dm @@ -52,18 +52,27 @@ if(/datum/inventory_slot_meta/abstract/hand/right) return put_in_right_hand(I, flags) if(/datum/inventory_slot_meta/abstract/put_in_belt) - var/obj/item/storage/S = item_by_slot(SLOT_ID_BELT) - return istype(S) && S.try_insert(I, src, flags & INV_OP_SUPPRESS_WARNING, flags & INV_OP_FORCE) + var/obj/item/held = item_by_slot_id(SLOT_ID_BELT) + if(flags & INV_OP_FORCE) + return held?.obj_storage?.insert(I, new /datum/event_args/actor(src), flags & INV_OP_SUPPRESS_SOUND) + return held?.obj_storage?.auto_handle_interacted_insertion(I, new /datum/event_args/actor(src), flags & INV_OP_SUPPRESS_WARNING, flags & INV_OP_SUPPRESS_SOUND) if(/datum/inventory_slot_meta/abstract/put_in_backpack) - var/obj/item/storage/S = item_by_slot(SLOT_ID_BACK) - return istype(S) && S.try_insert(I, src, flags & INV_OP_SUPPRESS_WARNING, flags & INV_OP_FORCE) + var/obj/item/held = item_by_slot_id(SLOT_ID_BACK) + if(flags & INV_OP_FORCE) + return held?.obj_storage?.insert(I, new /datum/event_args/actor(src), flags & INV_OP_SUPPRESS_SOUND) + return held?.obj_storage?.auto_handle_interacted_insertion(I, new /datum/event_args/actor(src), flags & INV_OP_SUPPRESS_WARNING, flags & INV_OP_SUPPRESS_SOUND) if(/datum/inventory_slot_meta/abstract/put_in_hands) return put_in_hands(I, flags) if(/datum/inventory_slot_meta/abstract/put_in_storage, /datum/inventory_slot_meta/abstract/put_in_storage_try_active) if(slot == /datum/inventory_slot_meta/abstract/put_in_storage_try_active) - if(s_active && Adjacent(s_active) && s_active.try_insert(I, src, flags & INV_OP_SUPPRESS_WARNING, flags & INV_OP_FORCE)) - return TRUE - for(var/obj/item/storage/S in get_equipped_items_in_slots(list( + // todo: redirection + if(flags & INV_OP_FORCE) + if(active_storage?.insert(I, new /datum/event_args/actor(src), flags & INV_OP_SUPPRESS_WARNING)) + return TRUE + else + if(active_storage?.auto_handle_interacted_insertion(I, new /datum/event_args/actor(src), flags & INV_OP_SUPPRESS_WARNING, flags & INV_OP_SUPPRESS_SOUND)) + return TRUE + for(var/obj/item/held in get_equipped_items_in_slots(list( SLOT_ID_BELT, SLOT_ID_BACK, SLOT_ID_UNIFORM, @@ -71,8 +80,11 @@ SLOT_ID_LEFT_POCKET, SLOT_ID_RIGHT_POCKET )) + get_held_items()) - if(S.try_insert(I, src, INV_OP_SUPPRESS_WARNING, flags & INV_OP_FORCE)) - return TRUE + if(isnull(held?.obj_storage)) + continue + if(flags & INV_OP_FORCE) + return held.obj_storage.insert(I, new /datum/event_args/actor(src), flags & INV_OP_SUPPRESS_SOUND) + return held.obj_storage.auto_handle_interacted_insertion(I, new /datum/event_args/actor(src), flags & INV_OP_SUPPRESS_WARNING, flags & INV_OP_SUPPRESS_SOUND) return FALSE if(/datum/inventory_slot_meta/abstract/attach_as_accessory) for(var/obj/item/clothing/C in get_equipped_items()) @@ -199,7 +211,7 @@ return TRUE if(!slot) - slot = slot_by_item(I) + slot = slot_id_by_item(I) if(!(flags & INV_OP_FORCE) && HAS_TRAIT(I, TRAIT_ITEM_NODROP)) if(!(flags & INV_OP_SUPPRESS_WARNING)) @@ -256,15 +268,11 @@ if(/datum/inventory_slot_meta/abstract/hand/right) return (flags & INV_OP_FORCE) || !get_right_held_item() if(/datum/inventory_slot_meta/abstract/put_in_backpack) - var/obj/item/storage/S = item_by_slot(SLOT_ID_BACK) - if(!istype(S)) - return FALSE - return S.can_be_inserted(I, TRUE) + var/obj/item/thing = item_by_slot_id(SLOT_ID_BACK) + return thing?.obj_storage?.can_be_inserted(I, new /datum/event_args/actor(user), TRUE) if(/datum/inventory_slot_meta/abstract/put_in_belt) - var/obj/item/storage/S = item_by_slot(SLOT_ID_BACK) - if(!istype(S)) - return FALSE - return S.can_be_inserted(I, TRUE) + var/obj/item/thing = item_by_slot_id(SLOT_ID_BACK) + return thing?.obj_storage?.can_be_inserted(I, new /datum/event_args/actor(user), TRUE) if(/datum/inventory_slot_meta/abstract/put_in_hands) return (flags & INV_OP_FORCE) || !hands_full() return TRUE @@ -277,7 +285,7 @@ if((flags & INV_OP_IS_FINAL_CHECK) && conflict_result && (slot != SLOT_ID_HANDS)) // try to fit over - var/obj/item/conflicting = item_by_slot(slot) + var/obj/item/conflicting = item_by_slot_id(slot) if(conflicting) // there's something there var/can_fit_over = I.equip_worn_over_check(src, slot, user, conflicting, flags) @@ -457,7 +465,7 @@ // convert to ID after abstract slot checks slot = slot_meta.id - var/old_slot = slot_by_item(I) + var/old_slot = slot_id_by_item(I) if(old_slot) . = _handle_item_reequip(I, slot, old_slot, flags, user) @@ -507,8 +515,8 @@ ASSERT(slot) if(!old_slot) // DO NOT USE _slot_by_item - at this point, the item has already been var-set into the new slot! - // slot_by_item however uses cached values still! - old_slot = slot_by_item(I) + // slot_id_by_item however uses cached values still! + old_slot = slot_id_by_item(I) if(!old_slot) // still not there, wasn't already in inv return FALSE @@ -624,7 +632,7 @@ * gets the primary item in a slot * null if not in inventory. inhands don't count as inventory here, use held item procs. */ -/mob/proc/item_by_slot(slot) +/mob/proc/item_by_slot_id(slot) return _item_by_slot(slot) // why the needless indirection? so people don't override this for slots! /** @@ -660,7 +668,7 @@ * get slot of item if it's equipped. * null if not in inventory. SLOT_HANDS if held. */ -/mob/proc/slot_by_item(obj/item/I) +/mob/proc/slot_id_by_item(obj/item/I) return is_in_inventory(I) || null // short circuited to that too // if equipped/unequipped didn't set worn_slot well jokes on you lmfao diff --git a/code/modules/mob/inventory/items.dm b/code/modules/mob/inventory/items.dm index ea29bdf9ad6..c05f784e213 100644 --- a/code/modules/mob/inventory/items.dm +++ b/code/modules/mob/inventory/items.dm @@ -129,6 +129,9 @@ // close context menus context_close() + // storage stuff + obj_storage?.on_dropped(user) + // get rid of shieldcalls for(var/datum/shieldcall/shieldcall as anything in shieldcalls) if(!shieldcall.shields_in_inventory) @@ -162,6 +165,9 @@ var/mob/living/L = user L.adjust_current_carry_weight(weight_registered) + // storage stuff + obj_storage?.on_pickup(user) + // get rid of shieldcalls for(var/datum/shieldcall/shieldcall as anything in shieldcalls) if(!shieldcall.shields_in_inventory) @@ -263,22 +269,22 @@ switch(slot) if(SLOT_ID_LEFT_POCKET, SLOT_ID_RIGHT_POCKET) - if(H.semantically_has_slot(SLOT_ID_UNIFORM) && !H.item_by_slot(SLOT_ID_UNIFORM)) + if(H.semantically_has_slot(SLOT_ID_UNIFORM) && !H.item_by_slot_id(SLOT_ID_UNIFORM)) if(!(flags & INV_OP_SUPPRESS_WARNING)) to_chat(H, SPAN_WARNING("You need a jumpsuit before you can attach [src].")) return FALSE if(SLOT_ID_WORN_ID) - if(H.semantically_has_slot(SLOT_ID_UNIFORM) && !H.item_by_slot(SLOT_ID_UNIFORM)) + if(H.semantically_has_slot(SLOT_ID_UNIFORM) && !H.item_by_slot_id(SLOT_ID_UNIFORM)) if(!(flags & INV_OP_SUPPRESS_WARNING)) to_chat(H, SPAN_WARNING("You need a jumpsuit before you can attach [src].")) return FALSE if(SLOT_ID_BELT) - if(H.semantically_has_slot(SLOT_ID_UNIFORM) && !H.item_by_slot(SLOT_ID_UNIFORM)) + if(H.semantically_has_slot(SLOT_ID_UNIFORM) && !H.item_by_slot_id(SLOT_ID_UNIFORM)) if(!(flags & INV_OP_SUPPRESS_WARNING)) to_chat(H, SPAN_WARNING("You need a jumpsuit before you can attach [src].")) return FALSE if(SLOT_ID_SUIT_STORAGE) - if(H.semantically_has_slot(SLOT_ID_SUIT) && !H.item_by_slot(SLOT_ID_SUIT)) + if(H.semantically_has_slot(SLOT_ID_SUIT) && !H.item_by_slot_id(SLOT_ID_SUIT)) if(!(flags & INV_OP_SUPPRESS_WARNING)) to_chat(H, SPAN_WARNING("You need a suit before you can attach [src].")) return FALSE diff --git a/code/modules/mob/inventory/slot_meta.dm b/code/modules/mob/inventory/slot_meta.dm index ae765d6e4af..13753a7d158 100644 --- a/code/modules/mob/inventory/slot_meta.dm +++ b/code/modules/mob/inventory/slot_meta.dm @@ -556,7 +556,7 @@ GLOBAL_LIST_EMPTY(inventory_slot_type_cache) /datum/inventory_slot_meta/inventory/suit_storage/allow_equip(obj/item/I, mob/wearer, mob/user, force) . = ..() - var/obj/item/suit_item = wearer.item_by_slot(SLOT_ID_SUIT) + var/obj/item/suit_item = wearer.item_by_slot_id(SLOT_ID_SUIT) if(!suit_item) return FALSE // todo: this check is ass diff --git a/code/modules/mob/inventory/stripping.dm b/code/modules/mob/inventory/stripping.dm index 390da494d8e..ce9ed20c094 100644 --- a/code/modules/mob/inventory/stripping.dm +++ b/code/modules/mob/inventory/stripping.dm @@ -101,7 +101,7 @@ if(!slot_meta) return FALSE - var/obj/item/ours = item_by_slot(slot_id) + var/obj/item/ours = item_by_slot_id(slot_id) var/obj/item/theirs = user.get_active_held_item() if(!ours && !theirs) to_chat(user, SPAN_WARNING("They're not wearing anything in that slot!")) @@ -220,7 +220,7 @@ if(get_held_index(ours) != slot_id_or_index) return FALSE else - if(slot_by_item(ours) != slot_id_or_index) + if(slot_id_by_item(ours) != slot_id_or_index) return FALSE else if(!user.is_holding(theirs)) diff --git a/code/modules/mob/living/bot/cleanbot.dm b/code/modules/mob/living/bot/cleanbot.dm index 08b8d8664cc..d019d087d08 100644 --- a/code/modules/mob/living/bot/cleanbot.dm +++ b/code/modules/mob/living/bot/cleanbot.dm @@ -231,7 +231,7 @@ throw_force = 10.0 throw_speed = 2 throw_range = 5 - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL var/created_name = "Cleanbot" /obj/item/bucket_sensor/attackby(var/obj/item/W, var/mob/user) diff --git a/code/modules/mob/living/bot/farmbot.dm b/code/modules/mob/living/bot/farmbot.dm index 368a1ccc486..bbccdd32b11 100644 --- a/code/modules/mob/living/bot/farmbot.dm +++ b/code/modules/mob/living/bot/farmbot.dm @@ -331,7 +331,7 @@ var/build_step = 0 var/created_name = "Farmbot" var/obj/tank - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL /obj/item/farmbot_arm_assembly/Initialize(mapload, theTank) diff --git a/code/modules/mob/living/bot/floorbot.dm b/code/modules/mob/living/bot/floorbot.dm index 211c434951a..4ebfe70acf6 100644 --- a/code/modules/mob/living/bot/floorbot.dm +++ b/code/modules/mob/living/bot/floorbot.dm @@ -381,9 +381,6 @@ to_chat(user, SPAN_NOTICE("They wont fit in as there is already stuff inside.")) return - if(user.s_active) - user.s_active.close(user) - if(T.use(10)) var/obj/item/bot_assembly/floorbot/B = new if(istype(src, /obj/item/storage/toolbox/mechanical/)) @@ -417,7 +414,7 @@ throw_force = 10 throw_speed = 2 throw_range = 5 - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL created_name = "Floorbot" var/toolbox = /obj/item/storage/toolbox diff --git a/code/modules/mob/living/bot/medibot_construction.dm b/code/modules/mob/living/bot/medibot_construction.dm index 267dc6434a2..945266b0902 100644 --- a/code/modules/mob/living/bot/medibot_construction.dm +++ b/code/modules/mob/living/bot/medibot_construction.dm @@ -7,7 +7,7 @@ icon = 'icons/obj/bots/medibots.dmi' icon_state = "medibot" base_icon_state = "medkit" - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL created_name = "Medibot" // To preserve the name if it's a unique medibot I guess. var/healthanalyzer = /obj/item/healthanalyzer diff --git a/code/modules/mob/living/carbon/alien/diona/diona.dm b/code/modules/mob/living/carbon/alien/diona/diona.dm index cca8ef277ae..3ff026d8123 100644 --- a/code/modules/mob/living/carbon/alien/diona/diona.dm +++ b/code/modules/mob/living/carbon/alien/diona/diona.dm @@ -14,7 +14,7 @@ universal_understand = 0 universal_speak = 0 // Dionaea do not need to speak to people other than other dionaea. - can_pull_size = ITEMSIZE_SMALL + can_pull_size = WEIGHT_CLASS_SMALL can_pull_mobs = MOB_PULL_SMALLER holder_type = /obj/item/holder/diona diff --git a/code/modules/mob/living/carbon/brain/MMI.dm b/code/modules/mob/living/carbon/brain/MMI.dm index 4978c4f5e4b..ef2d3f2a6f9 100644 --- a/code/modules/mob/living/carbon/brain/MMI.dm +++ b/code/modules/mob/living/carbon/brain/MMI.dm @@ -13,7 +13,7 @@ desc = "The Warrior's bland acronym, MMI, obscures the true horror of this monstrosity." icon = 'icons/obj/assemblies.dmi' icon_state = "mmi_empty" - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL can_speak = TRUE origin_tech = list(TECH_BIO = 3) catalogue_data = list(/datum/category_item/catalogue/fauna/brain/assisted) @@ -302,7 +302,7 @@ catalogue_data = list(/datum/category_item/catalogue/technology/drone/drones) icon = 'icons/obj/module.dmi' icon_state = "mainboard" - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL origin_tech = list(TECH_ENGINEERING = 4, TECH_MATERIAL = 3, TECH_DATA = 4) ghost_query_type = /datum/ghost_query/drone_brain @@ -333,7 +333,7 @@ catalogue_data = list(/datum/category_item/catalogue/technology/positronics) icon = 'icons/obj/assemblies.dmi' icon_state = "posibrain" - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL origin_tech = list(TECH_ENGINEERING = 4, TECH_MATERIAL = 4, TECH_BLUESPACE = 2, TECH_DATA = 4) ghost_query_type = /datum/ghost_query/posi_brain catalogue_data = list(/datum/category_item/catalogue/fauna/brain/posibrain) @@ -374,5 +374,5 @@ desc = "A sophisticated board which allows for an artificial intelligence to remotely control a synthetic chassis." icon = 'icons/obj/module.dmi' icon_state = "mainboard" - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL origin_tech = list(TECH_ENGINEERING = 2, TECH_MATERIAL = 2, TECH_BLUESPACE = 2, TECH_DATA = 3) diff --git a/code/modules/mob/living/carbon/brain/posibrain.dm b/code/modules/mob/living/carbon/brain/posibrain.dm index a5ad28c55bb..2050d03fbfb 100644 --- a/code/modules/mob/living/carbon/brain/posibrain.dm +++ b/code/modules/mob/living/carbon/brain/posibrain.dm @@ -3,7 +3,7 @@ desc = "A cube of shining metal, four inches to a side and covered in shallow grooves." icon = 'icons/obj/assemblies.dmi' icon_state = "posibrain" - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL origin_tech = list(TECH_ENGINEERING = 4, TECH_MATERIAL = 4, TECH_BLUESPACE = 2, TECH_DATA = 4) req_access = list(ACCESS_SCIENCE_ROBOTICS) diff --git a/code/modules/mob/living/carbon/brain/robot.dm b/code/modules/mob/living/carbon/brain/robot.dm index ebb046540d5..0ed4096809a 100644 --- a/code/modules/mob/living/carbon/brain/robot.dm +++ b/code/modules/mob/living/carbon/brain/robot.dm @@ -12,7 +12,7 @@ desc = "The pinnacle of artifical intelligence which can be achieved using classical computer science." icon = 'icons/obj/module.dmi' icon_state = "mainboard" - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL origin_tech = list(TECH_ENGINEERING = 4, TECH_MATERIAL = 3, TECH_DATA = 4) catalogue_data = list(/datum/category_item/catalogue/fauna/brain/robotic) diff --git a/code/modules/mob/living/carbon/carbon_defense.dm b/code/modules/mob/living/carbon/carbon_defense.dm index 1c4e878692f..dfc83cfae1f 100644 --- a/code/modules/mob/living/carbon/carbon_defense.dm +++ b/code/modules/mob/living/carbon/carbon_defense.dm @@ -109,7 +109,7 @@ var/damage_mod = 1 //presumably, if they are wearing a helmet that stops pressure effects, then it probably covers the throat as well - var/obj/item/clothing/head/helmet = item_by_slot(SLOT_ID_HEAD) + var/obj/item/clothing/head/helmet = item_by_slot_id(SLOT_ID_HEAD) if(istype(helmet) && (helmet.body_cover_flags & HEAD) && (helmet.min_pressure_protection != null)) // Both min- and max_pressure_protection must be set for it to function at all, so we can just check that one is set. //we don't do an armor_check here because this is not an impact effect like a weapon swung with momentum, that either penetrates or glances off. damage_mod = 1.0 - (helmet.fetch_armor().raw(ARMOR_MELEE)) @@ -171,16 +171,16 @@ var/worn_under_armor //if(SLOT_ID_SUIT) - if(item_by_slot(SLOT_ID_SUIT)) - worn_suit = item_by_slot(SLOT_ID_SUIT) - //worn_suit = item_by_slot(SLOT_ID_SUIT) + if(item_by_slot_id(SLOT_ID_SUIT)) + worn_suit = item_by_slot_id(SLOT_ID_SUIT) + //worn_suit = item_by_slot_id(SLOT_ID_SUIT) worn_suit_armor = worn_suit.fetch_armor().raw(ARMOR_MELEE) else worn_suit_armor = 0 //if(SLOT_ID_UNIFORM) - if(item_by_slot(SLOT_ID_UNIFORM)) - worn_under = item_by_slot(SLOT_ID_UNIFORM) + if(item_by_slot_id(SLOT_ID_UNIFORM)) + worn_under = item_by_slot_id(SLOT_ID_UNIFORM) worn_under_armor = worn_under.fetch_armor().raw(ARMOR_MELEE) else worn_under_armor = 0 diff --git a/code/modules/mob/living/carbon/human/human_helpers.dm b/code/modules/mob/living/carbon/human/human_helpers.dm index 2dfc60e294e..a022d7d3457 100644 --- a/code/modules/mob/living/carbon/human/human_helpers.dm +++ b/code/modules/mob/living/carbon/human/human_helpers.dm @@ -172,7 +172,7 @@ for(var/slot in slots) // Change this type if you move the vision stuff to item or something. - var/obj/item/clothing/O = item_by_slot(slot) + var/obj/item/clothing/O = item_by_slot_id(slot) if(istype(O) && O.enables_planes && (slot in O.active_slots)) compiled_vis |= O.enables_planes diff --git a/code/modules/mob/living/carbon/human/inventory_legacy.dm b/code/modules/mob/living/carbon/human/inventory_legacy.dm index 60294ffee85..95ba4567a92 100644 --- a/code/modules/mob/living/carbon/human/inventory_legacy.dm +++ b/code/modules/mob/living/carbon/human/inventory_legacy.dm @@ -5,71 +5,3 @@ set hidden = 1 attempt_smart_equip() - -//! old behaviors that i can't be assed to rewrite for now - -/mob/living/carbon/human/proc/smart_equipbag() // take most recent item out of bag or place held item in bag - if(incapacitated()) - return - var/obj/item/thing = get_active_held_item() - var/obj/item/equipped_back = item_by_slot(SLOT_ID_BACK) - if(!equipped_back) // We also let you equip a backpack like this - if(!thing) - to_chat(src, "You have no backpack to take something out of!") - return - if(equip_to_slot_if_possible(thing, SLOT_ID_BACK)) - update_inv_hands() - return - if(!istype(equipped_back, /obj/item/storage)) // not a storage item - if(!thing) - equipped_back.attack_hand(src) - else - to_chat(src, "You can't fit anything in!") - return - if(thing) // put thing in backpack - var/obj/item/storage/S = equipped_back - if(!S.can_be_inserted(thing)) - to_chat(src, "You can't fit anything in!") - return - S.handle_item_insertion(thing, src) - return - if(!equipped_back.contents.len) // nothing to take out - to_chat(src, "There's nothing in your backpack to take out!") - return - var/obj/item/stored = equipped_back.contents[equipped_back.contents.len] - if(!stored || stored.on_found(src)) - return - stored.attack_hand(src) // take out thing from backpack - -/mob/living/carbon/human/proc/smart_equipbelt() // put held thing in belt or take most recent item out of belt - if(incapacitated()) - return - var/obj/item/thing = get_active_held_item() - var/obj/item/equipped_belt = item_by_slot(SLOT_ID_BELT) - if(!equipped_belt) // We also let you equip a belt like this - if(!thing) - to_chat(src, "You have no belt to take something out of!") - return - if(equip_to_slot_if_possible(thing, SLOT_ID_BELT)) - update_inv_hands() - return - if(!istype(equipped_belt, /obj/item/storage)) // not a storage item - if(!thing) - equipped_belt.attack_hand(src) - else - to_chat(src, "You can't fit anything in!") - return - if(thing) // put thing in belt - var/obj/item/storage/S = equipped_belt - if(!S.can_be_inserted(thing)) - to_chat(src, "You can't fit anything in!") - return - S.handle_item_insertion(thing, src) - return - if(!equipped_belt.contents.len) // nothing to take out - to_chat(src, "There's nothing in your belt to take out!") - return - var/obj/item/stored = equipped_belt.contents[equipped_belt.contents.len] - if(!stored || stored.on_found(src)) - return - stored.attack_hand(src) // take out thing from belt diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm index c09f370816b..dad9fe7f973 100644 --- a/code/modules/mob/living/carbon/human/update_icons.dm +++ b/code/modules/mob/living/carbon/human/update_icons.dm @@ -817,7 +817,7 @@ GLOBAL_LIST_EMPTY(damage_icon_parts) var/list/obj/item/relevant = get_equipped_items(TRUE, TRUE) if(hud_used) for(var/obj/item/I as anything in relevant) - position_hud_item(I, slot_by_item(I)) + position_hud_item(I, slot_id_by_item(I)) if(client) client.screen |= relevant diff --git a/code/modules/mob/living/defense.dm b/code/modules/mob/living/defense.dm index ea14518ae1c..d912670de6b 100644 --- a/code/modules/mob/living/defense.dm +++ b/code/modules/mob/living/defense.dm @@ -188,7 +188,7 @@ return 0 //only carbon liveforms have this proc /mob/living/emp_act(severity) - var/list/L = src.get_contents() + var/list/L = src.get_equipped_items(TRUE, TRUE) for(var/obj/O in L) O.emp_act(severity) ..() diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index f90f46f6918..5c9b43483fa 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -381,56 +381,19 @@ default behaviour is: adjustToxLoss(amount) /mob/proc/get_contents() - - -//Recursive function to find everything a mob is holding. -/mob/living/get_contents(var/obj/item/storage/Storage = null) - var/list/L = list() - - if(Storage) //If it called itself - L += Storage.return_inv() - - //Leave this commented out, it will cause storage items to exponentially add duplicate to the list - //for(var/obj/item/storage/S in Storage.return_inv()) //Check for storage items - // L += get_contents(S) - - for(var/obj/item/gift/G in Storage.return_inv()) //Check for gift-wrapped items - L += G.gift - if(istype(G.gift, /obj/item/storage)) - L += get_contents(G.gift) - - for(var/obj/item/smallDelivery/D in Storage.return_inv()) //Check for package wrapped items - L += D.wrapped - if(istype(D.wrapped, /obj/item/storage)) //this should never happen - L += get_contents(D.wrapped) - return L - - else - - L += src.contents - for(var/obj/item/storage/S in src.contents) //Check for storage items - L += get_contents(S) - - for(var/obj/item/gift/G in src.contents) //Check for gift-wrapped items - L += G.gift - if(istype(G.gift, /obj/item/storage)) - L += get_contents(G.gift) - - for(var/obj/item/smallDelivery/D in src.contents) //Check for package wrapped items - L += D.wrapped - if(istype(D.wrapped, /obj/item/storage)) //this should never happen - L += get_contents(D.wrapped) - return L - -/mob/living/proc/check_contents_for(A) - var/list/L = src.get_contents() - - for(var/obj/B in L) - if(B.type == A) - return 1 - return 0 - - + . = list() + var/list/obj/processing = get_equipped_items(TRUE, TRUE) + var/i = 1 + var/safety = 100000 + while(i <= length(processing)) + // safety check becuase unlike [contents], byond doens't isn't correctness here. + if(!--safety) + CRASH("RED ALERT RED ALERT SOMEONE FUCKED UP") + var/obj/iterating = processing[i++] + . += iterating + var/list/returned = iterating.return_inventory() + . += returned + /mob/living/proc/can_inject(var/mob/user, var/error_msg, var/target_zone, var/ignore_thickness = FALSE) return 1 diff --git a/code/modules/mob/living/movement.dm b/code/modules/mob/living/movement.dm index b73f22feb8b..0f230d1db43 100644 --- a/code/modules/mob/living/movement.dm +++ b/code/modules/mob/living/movement.dm @@ -20,8 +20,8 @@ /mob/living/Moved(atom/old_loc, movement_dir, forced, list/old_locs, momentum_change) . = ..() - if(s_active && !CheapReachability(s_active)) - s_active.close(src) + if(active_storage) + addtimer(CALLBACK(active_storage, TYPE_PROC_REF(/datum/object_system/storage, reconsider_mob_viewable), src), 0) if(forced && isnull(depth_staged) && isturf(loc)) var/turf/T = loc depth_staged = T.depth_level() diff --git a/code/modules/mob/living/silicon/pai/pai.dm b/code/modules/mob/living/silicon/pai/pai.dm index d2fb19a1dbe..1ec81b7a729 100644 --- a/code/modules/mob/living/silicon/pai/pai.dm +++ b/code/modules/mob/living/silicon/pai/pai.dm @@ -32,7 +32,7 @@ holder_type = /obj/item/holder/pai - can_pull_size = ITEMSIZE_SMALL + can_pull_size = WEIGHT_CLASS_SMALL can_pull_mobs = MOB_PULL_SMALLER idcard_type = /obj/item/card/id diff --git a/code/modules/mob/living/silicon/robot/analyzer.dm b/code/modules/mob/living/silicon/robot/analyzer.dm index fb3fde40757..71c786ce795 100644 --- a/code/modules/mob/living/silicon/robot/analyzer.dm +++ b/code/modules/mob/living/silicon/robot/analyzer.dm @@ -9,7 +9,7 @@ desc = "A hand-held scanner able to diagnose robotic injuries." slot_flags = SLOT_BELT throw_force = 3 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL throw_speed = 5 throw_range = 10 origin_tech = list(TECH_MAGNET = 2, TECH_BIO = 1, TECH_ENGINEERING = 2) diff --git a/code/modules/mob/living/silicon/robot/dogborg/dog_modules_vr.dm b/code/modules/mob/living/silicon/robot/dogborg/dog_modules_vr.dm index d009f813142..93d3d3ec9a7 100644 --- a/code/modules/mob/living/silicon/robot/dogborg/dog_modules_vr.dm +++ b/code/modules/mob/living/silicon/robot/dogborg/dog_modules_vr.dm @@ -7,7 +7,7 @@ throw_force = 0 attack_sound = 'sound/weapons/bite.ogg' attack_verb = list("chomped", "bit", "ripped", "mauled", "enforced") - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL /obj/item/dogborg/jaws/small name = "puppy jaws" @@ -18,7 +18,7 @@ throw_force = 0 attack_sound = 'sound/weapons/bite.ogg' attack_verb = list("nibbled", "bit", "gnawed", "chomped", "nommed") - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL var/emagged = 0 /obj/item/dogborg/jaws/small/attack_self(mob/user) @@ -37,7 +37,6 @@ throw_force = 0 attack_sound = 'sound/weapons/bite.ogg' attack_verb = list("chomped", "bit", "ripped", "mauled", "enforced") - w_class = ITEMSIZE_NORMAL else name = "puppy jaws" icon = 'icons/mob/dogborg_vr.dmi' @@ -47,7 +46,6 @@ throw_force = 0 attack_sound = 'sound/weapons/bite.ogg' attack_verb = list("nibbled", "bit", "gnawed", "chomped", "nommed") - w_class = ITEMSIZE_NORMAL update_icon() //Boop //Newer and better, can sniff reagents, tanks, and boop people! @@ -60,7 +58,7 @@ item_flags = ITEM_NOBLUDGEON | ITEM_ENCUMBERS_WHILE_HELD throw_force = 0 attack_verb = list("nuzzled", "nosed", "booped") - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY /obj/item/dogborg/boop_module/attack_self(mob/user) . = ..() @@ -127,10 +125,10 @@ desc = "Fetch the thing!" icon = 'icons/mob/dogborg_vr.dmi' icon_state = "dbag" - w_class = ITEMSIZE_HUGE - max_w_class = ITEMSIZE_SMALL - max_combined_w_class = ITEMSIZE_SMALL - storage_slots = 1 + w_class = WEIGHT_CLASS_HUGE + max_single_weight_class = WEIGHT_CLASS_SMALL + max_combined_w_class = WEIGHT_CLASS_SMALL + max_items = 1 collection_mode = 0 can_hold = list() // any cant_hold = list(/obj/item/disk/nuclear) @@ -342,7 +340,7 @@ throw_force = 0 //This shouldn't be thrown in the first place. attack_sound = 'sound/weapons/blade1.ogg' attack_verb = list("slashed", "stabbed", "jabbed", "mauled", "sliced") - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL /obj/item/lightreplacer/dogborg name = "light replacer" @@ -459,7 +457,7 @@ icon = 'icons/obj/device_alt.dmi' icon_state = "sleevemate" item_state = "healthanalyzer" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL var/obj/item/implant/mirror/imp = null /obj/item/dogborg/mirrortool/attack_mob(mob/target, mob/user, clickchain_flags, list/params, mult, target_zone, intent) diff --git a/code/modules/mob/living/silicon/robot/dogborg/dog_sleeper_vr.dm b/code/modules/mob/living/silicon/robot/dogborg/dog_sleeper_vr.dm index 402d90424cd..22848219859 100644 --- a/code/modules/mob/living/silicon/robot/dogborg/dog_sleeper_vr.dm +++ b/code/modules/mob/living/silicon/robot/dogborg/dog_sleeper_vr.dm @@ -4,7 +4,7 @@ desc = "Equipment for medical hound. A mounted sleeper that stabilizes patients and can inject reagents in the borg's reserves." icon = 'icons/mob/dogborg_vr.dmi' icon_state = "sleeper" - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY item_flags = ITEM_NOBLUDGEON | ITEM_ENCUMBERS_WHILE_HELD var/mob/living/carbon/patient = null var/mob/living/silicon/robot/hound = null @@ -71,7 +71,7 @@ return if(istype(target, /obj/item) || istype(target, /obj/effect/decal/remains)) var/obj/target_obj = target - if(target_obj.w_class > ITEMSIZE_LARGE) + if(target_obj.w_class > WEIGHT_CLASS_BULKY) to_chat(user, "\The [target] is too large to fit into your [src.name]") return user.visible_message("[hound.name] is ingesting [target.name] into their [src.name].", "You start ingesting [target] into your [src.name]...") diff --git a/code/modules/mob/living/silicon/robot/drone/drone.dm b/code/modules/mob/living/silicon/robot/drone/drone.dm index b772d298abc..7394c2825c7 100644 --- a/code/modules/mob/living/silicon/robot/drone/drone.dm +++ b/code/modules/mob/living/silicon/robot/drone/drone.dm @@ -17,7 +17,7 @@ integrated_light_power = 3 local_transmit = 1 - can_pull_size = ITEMSIZE_NO_CONTAINER + can_pull_size = WEIGHT_CLASS_HUGE can_pull_mobs = MOB_PULL_SMALLER can_enter_vent_with = list( /obj) diff --git a/code/modules/mob/living/silicon/robot/drone/swarm.dm b/code/modules/mob/living/silicon/robot/drone/swarm.dm index afbb4e77196..5cb7268301d 100644 --- a/code/modules/mob/living/silicon/robot/drone/swarm.dm +++ b/code/modules/mob/living/silicon/robot/drone/swarm.dm @@ -19,7 +19,7 @@ integrated_light_power = 3 local_transmit = 0 - can_pull_size = ITEMSIZE_NO_CONTAINER + can_pull_size = WEIGHT_CLASS_HUGE can_pull_mobs = MOB_PULL_SMALLER can_enter_vent_with = list( /obj) diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index ae3ee585727..cb19a4c3f76 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -680,8 +680,8 @@ to_chat(user, "Close the panel first.") else if(cell) to_chat(user, "There is a power cell already installed.") - else if(W.w_class != ITEMSIZE_NORMAL) - to_chat(user, "\The [W] is too [W.w_class < ITEMSIZE_NORMAL ? "small" : "large"] to fit here.") + else if(W.w_class != WEIGHT_CLASS_NORMAL) + to_chat(user, "\The [W] is too [W.w_class < WEIGHT_CLASS_NORMAL ? "small" : "large"] to fit here.") else if(!user.attempt_insert_item_for_installation(W, src)) return @@ -1146,7 +1146,7 @@ B = module_state_3 var/turf/tile = loc if(isturf(tile)) - B.gather_all(tile, src, 1) //Shhh, unless the bag fills, don't spam the borg's chat with stuff that's going on every time they move! + B.obj_storage.interacted_mass_pickup(new /datum/event_args/actor(src), tile) return if(scrubbing) diff --git a/code/modules/mob/living/silicon/robot/robot_items.dm b/code/modules/mob/living/silicon/robot/robot_items.dm index 6528cb20da6..806ead3ebb5 100644 --- a/code/modules/mob/living/silicon/robot/robot_items.dm +++ b/code/modules/mob/living/silicon/robot/robot_items.dm @@ -203,9 +203,9 @@ if( I != src && !I.anchored && !istype(I, /obj/item/clothing/under) && !istype(I, /obj/item/clothing/suit) && !istype(I, /obj/projectile) ) var/add = 0 - if(I.w_class == ITEMSIZE_TINY) + if(I.w_class == WEIGHT_CLASS_TINY) add = 1 - else if(I.w_class == ITEMSIZE_SMALL) + else if(I.w_class == WEIGHT_CLASS_SMALL) add = 3 else add = 5 @@ -423,7 +423,7 @@ desc = "Hand-held device which allows rapid deployment and removal of inflatables." icon = 'icons/obj/storage.dmi' icon_state = "inf_deployer" - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY var/stored_walls = 5 var/stored_doors = 2 @@ -432,7 +432,7 @@ var/mode = 0 // 0 - Walls 1 - Doors /obj/item/inflatable_dispenser/robot - w_class = ITEMSIZE_HUGE + w_class = WEIGHT_CLASS_HUGE stored_walls = 10 stored_doors = 5 max_walls = 10 diff --git a/code/modules/mob/living/silicon/robot/robot_modules/station.dm b/code/modules/mob/living/silicon/robot/robot_modules/station.dm index cae28822824..668d0d647c8 100644 --- a/code/modules/mob/living/silicon/robot/robot_modules/station.dm +++ b/code/modules/mob/living/silicon/robot/robot_modules/station.dm @@ -25,7 +25,7 @@ GLOBAL_LIST_INIT(robot_modules, list( name = "robot module" icon = 'icons/obj/module.dmi' icon_state = "std_module" - w_class = ITEMSIZE_NO_CONTAINER + w_class = WEIGHT_CLASS_HUGE item_state = "std_mod" var/hide_on_manifest = 0 var/channels = list() diff --git a/code/modules/mob/living/simple_animal/animals/mouse.dm b/code/modules/mob/living/simple_animal/animals/mouse.dm index a89313aac41..97956773ef9 100644 --- a/code/modules/mob/living/simple_animal/animals/mouse.dm +++ b/code/modules/mob/living/simple_animal/animals/mouse.dm @@ -21,7 +21,7 @@ mob_size = MOB_SMALL pass_flags = ATOM_PASS_TABLE -// can_pull_size = ITEMSIZE_TINY +// can_pull_size = WEIGHT_CLASS_TINY // can_pull_mobs = MOB_PULL_NONE layer = MOB_LAYER density = 0 diff --git a/code/modules/mob/living/simple_animal/animals/spiderbot.dm b/code/modules/mob/living/simple_animal/animals/spiderbot.dm index e25ffd498e9..e88f7cf342c 100644 --- a/code/modules/mob/living/simple_animal/animals/spiderbot.dm +++ b/code/modules/mob/living/simple_animal/animals/spiderbot.dm @@ -276,7 +276,7 @@ var/list/items = list() for(var/obj/item/I in view(1,src)) - if(I.loc != src && I.w_class <= ITEMSIZE_SMALL && I.Adjacent(src) ) + if(I.loc != src && I.w_class <= WEIGHT_CLASS_SMALL && I.Adjacent(src) ) items.Add(I) var/obj/selection = input("Select an item.", "Pickup") in items diff --git a/code/modules/mob/living/simple_mob/subtypes/animal/passive/mouse.dm b/code/modules/mob/living/simple_mob/subtypes/animal/passive/mouse.dm index abd414b2e89..6172084b24e 100644 --- a/code/modules/mob/living/simple_mob/subtypes/animal/passive/mouse.dm +++ b/code/modules/mob/living/simple_mob/subtypes/animal/passive/mouse.dm @@ -23,7 +23,7 @@ mob_size = MOB_MINISCULE pass_flags = ATOM_PASS_TABLE - can_pull_size = ITEMSIZE_TINY + can_pull_size = WEIGHT_CLASS_TINY can_pull_mobs = MOB_PULL_NONE layer = MOB_LAYER density = 0 diff --git a/code/modules/mob/living/simple_mob/subtypes/animal/pets/bird.dm b/code/modules/mob/living/simple_mob/subtypes/animal/pets/bird.dm index bc0970d5d90..84ca8e56ee6 100644 --- a/code/modules/mob/living/simple_mob/subtypes/animal/pets/bird.dm +++ b/code/modules/mob/living/simple_mob/subtypes/animal/pets/bird.dm @@ -57,7 +57,7 @@ desc = "It's a bird!" icon_state = null item_icons = null - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL /obj/item/holder/bird/sync(var/mob/living/simple_mob/SM) ..() diff --git a/code/modules/mob/living/simple_mob/subtypes/animal/pets/cat.dm b/code/modules/mob/living/simple_mob/subtypes/animal/pets/cat.dm index 8b8d0817d79..59b2b65d9a6 100644 --- a/code/modules/mob/living/simple_mob/subtypes/animal/pets/cat.dm +++ b/code/modules/mob/living/simple_mob/subtypes/animal/pets/cat.dm @@ -158,7 +158,7 @@ /// Tactical kittens! /obj/item/holder/cat/kitten icon_state = "kitten" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL /datum/say_list/cat speak = list("Meow!","Esp!","Purr!","HSSSSS") diff --git a/code/modules/mob/living/simple_mob/subtypes/animal/pets/cat_vr.dm b/code/modules/mob/living/simple_mob/subtypes/animal/pets/cat_vr.dm index f86822527a9..e8a6fc2d834 100644 --- a/code/modules/mob/living/simple_mob/subtypes/animal/pets/cat_vr.dm +++ b/code/modules/mob/living/simple_mob/subtypes/animal/pets/cat_vr.dm @@ -36,7 +36,7 @@ desc = "A small, inquisitive feline, who constantly seems to investigate his surroundings." gender = MALE icon_state = "kitten" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL /mob/living/simple_mob/animal/passive/cat/tabiranth name = "Spirit" diff --git a/code/modules/mob/living/simple_mob/subtypes/animal/roach/roach.dm b/code/modules/mob/living/simple_mob/subtypes/animal/roach/roach.dm index 1ebf39b0c6a..fc85fcb2fe8 100644 --- a/code/modules/mob/living/simple_mob/subtypes/animal/roach/roach.dm +++ b/code/modules/mob/living/simple_mob/subtypes/animal/roach/roach.dm @@ -66,7 +66,7 @@ mob_size = MOB_SMALL pass_flags = ATOM_PASS_TABLE -// can_pull_size = ITEMSIZE_TINY +// can_pull_size = WEIGHT_CLASS_TINY // can_pull_mobs = MOB_PULL_NONE layer = MOB_LAYER density = 0 diff --git a/code/modules/mob/living/simple_mob/subtypes/animal/sif/duck.dm b/code/modules/mob/living/simple_mob/subtypes/animal/sif/duck.dm index 7112eba2d24..fbc3995909c 100644 --- a/code/modules/mob/living/simple_mob/subtypes/animal/sif/duck.dm +++ b/code/modules/mob/living/simple_mob/subtypes/animal/sif/duck.dm @@ -51,7 +51,7 @@ . = ..() var/has_food = FALSE - for(var/obj/item/I in L.get_contents()) // Do they have food? + for(var/obj/item/I in L.get_held_items()) // Do they have food? if(istype(I, /obj/item/reagent_containers/food)) has_food = TRUE break diff --git a/code/modules/mob/living/simple_mob/subtypes/animal/space/mouse_army.dm b/code/modules/mob/living/simple_mob/subtypes/animal/space/mouse_army.dm index c02075cdc61..050a3310de3 100644 --- a/code/modules/mob/living/simple_mob/subtypes/animal/space/mouse_army.dm +++ b/code/modules/mob/living/simple_mob/subtypes/animal/space/mouse_army.dm @@ -46,7 +46,7 @@ mob_size = MOB_MINISCULE pass_flags = ATOM_PASS_TABLE -// can_pull_size = ITEMSIZE_TINY +// can_pull_size = WEIGHT_CLASS_TINY // can_pull_mobs = MOB_PULL_NONE layer = MOB_LAYER density = 0 diff --git a/code/modules/mob/living/simple_mob/subtypes/animal/space/snake_vr.dm b/code/modules/mob/living/simple_mob/subtypes/animal/space/snake_vr.dm index 47fe7c60f1b..d1b0f412d87 100644 --- a/code/modules/mob/living/simple_mob/subtypes/animal/space/snake_vr.dm +++ b/code/modules/mob/living/simple_mob/subtypes/animal/space/snake_vr.dm @@ -171,9 +171,9 @@ desc = "A box containing Noodle's special sugermouse treats." icon = 'icons/mob/snake_vr.dmi' icon_state = "sneksnakbox" - storage_slots = 7 + max_items = 7 -/obj/item/storage/box/snakesnackbox/PopulateContents() +/obj/item/storage/box/snakesnackbox/legacy_spawn_contents() new /obj/item/reagent_containers/food/snacks/snakesnack(src) new /obj/item/reagent_containers/food/snacks/snakesnack(src) new /obj/item/reagent_containers/food/snacks/snakesnack(src) diff --git a/code/modules/mob/living/simple_mob/subtypes/vore/solargrub_larva.dm b/code/modules/mob/living/simple_mob/subtypes/vore/solargrub_larva.dm index 00c3e50acef..c1feb67dee3 100644 --- a/code/modules/mob/living/simple_mob/subtypes/vore/solargrub_larva.dm +++ b/code/modules/mob/living/simple_mob/subtypes/vore/solargrub_larva.dm @@ -28,7 +28,7 @@ var/global/list/grub_machine_overlays = list() mob_size = MOB_MINISCULE pass_flags = ATOM_PASS_TABLE - can_pull_size = ITEMSIZE_TINY + can_pull_size = WEIGHT_CLASS_TINY can_pull_mobs = MOB_PULL_NONE density = 0 diff --git a/code/modules/mob/logout.dm b/code/modules/mob/logout.dm index 4bd4d81517f..9b65b6e2734 100644 --- a/code/modules/mob/logout.dm +++ b/code/modules/mob/logout.dm @@ -14,6 +14,7 @@ SStgui.on_logout(src) // Cleanup any TGUIs the user has open GLOB.player_list -= src disconnect_time = world.realtime // Logging when we disappear. + active_storage?.hide(src) update_client_z(null) log_access_out(src) if(admin_datums[src.ckey]) diff --git a/code/modules/mob/mob_defines.dm b/code/modules/mob/mob_defines.dm index 4a6f712e0b5..08effd56b9f 100644 --- a/code/modules/mob/mob_defines.dm +++ b/code/modules/mob/mob_defines.dm @@ -49,6 +49,13 @@ var/atom/movable/buckled /// Atom we're buckl**ing** to. Used to stop stuff like lava from incinerating those who are mid buckle. var/atom/movable/buckling + + //* HUD + + /// active, opened storage + // todo: doesn't clear from clients properly on logout, relies on login clearing screne. + // todo: we'll eventually need a system to handle ckey transfers properly. + var/datum/object_system/storage/active_storage //? Movespeed /// List of movement speed modifiers applying to this mob @@ -265,7 +272,7 @@ var/const/muteness = 4 //?Carbon /// Maximum w_class the mob can pull. - var/can_pull_size = ITEMSIZE_NO_CONTAINER + var/can_pull_size = WEIGHT_CLASS_HUGE /// Whether or not the mob can pull other mobs. var/can_pull_mobs = MOB_PULL_LARGER diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index f19128feca7..fd9b6f16800 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -16,7 +16,7 @@ return round(log(2, mob_size_A/mob_size_B), 1) /mob/proc/can_wield_item(obj/item/W) - if(W.w_class >= ITEMSIZE_LARGE && issmall(src)) + if(W.w_class >= WEIGHT_CLASS_BULKY && issmall(src)) return FALSE //M is too small to wield this return TRUE @@ -592,7 +592,7 @@ var/list/global/organ_rel_size = list( var/held = is_holding(item) if(!slot) - slot = slot_by_item(item) + slot = slot_id_by_item(item) if(!istype(hud_used) || !slot || !LAZYLEN(hud_used.slot_info)) return diff --git a/code/modules/modular_computers/computers/subtypes/dev_laptop.dm b/code/modules/modular_computers/computers/subtypes/dev_laptop.dm index c417eac71be..20b1fd953bd 100644 --- a/code/modules/modular_computers/computers/subtypes/dev_laptop.dm +++ b/code/modules/modular_computers/computers/subtypes/dev_laptop.dm @@ -13,7 +13,7 @@ light_strength = 3 max_damage = 200 broken_damage = 100 - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL var/icon_state_closed = "laptop-closed" /obj/item/modular_computer/laptop/AltClick(mob/living/carbon/user) diff --git a/code/modules/modular_computers/computers/subtypes/dev_tablet.dm b/code/modules/modular_computers/computers/subtypes/dev_tablet.dm index 54b2d559065..76dfe57f950 100644 --- a/code/modules/modular_computers/computers/subtypes/dev_tablet.dm +++ b/code/modules/modular_computers/computers/subtypes/dev_tablet.dm @@ -7,7 +7,7 @@ icon_state_menu = "menu" hardware_flag = PROGRAM_TABLET max_hardware_size = 1 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL light_strength = 2 // Same as PDAs /obj/item/modular_computer/tablet/lease diff --git a/code/modules/modular_computers/computers/subtypes/dev_telescreen.dm b/code/modules/modular_computers/computers/subtypes/dev_telescreen.dm index e2356e05a48..16d85a8bb71 100644 --- a/code/modules/modular_computers/computers/subtypes/dev_telescreen.dm +++ b/code/modules/modular_computers/computers/subtypes/dev_telescreen.dm @@ -16,7 +16,7 @@ light_strength = 4 max_damage = 300 broken_damage = 150 - w_class = ITEMSIZE_HUGE + w_class = WEIGHT_CLASS_HUGE /obj/item/modular_computer/telescreen/Initialize(mapload) . = ..() diff --git a/code/modules/modular_computers/hardware/_hardware.dm b/code/modules/modular_computers/hardware/_hardware.dm index 02a35188908..1ca2495a5f5 100644 --- a/code/modules/modular_computers/hardware/_hardware.dm +++ b/code/modules/modular_computers/hardware/_hardware.dm @@ -56,7 +56,7 @@ to_chat(user, "Hardware Integrity Test... (Corruption: [damage]/[max_damage]) [damage > damage_failure ? "FAIL" : damage > damage_malfunction ? "WARN" : "PASS"]") /obj/item/computer_hardware/Initialize(mapload) - w_class = hardware_size + set_weight_class(hardware_size) if(istype(loc, /obj/item/modular_computer)) holder2 = loc return ..() diff --git a/code/modules/multiz/structures/ladder.dm b/code/modules/multiz/structures/ladder.dm index 2785bd4cd1e..0ac65d6d7c9 100644 --- a/code/modules/multiz/structures/ladder.dm +++ b/code/modules/multiz/structures/ladder.dm @@ -162,7 +162,7 @@ density = 0 opacity = 0 anchored = 0 - w_class = ITEMSIZE_HUGE + w_class = WEIGHT_CLASS_HUGE var/state = 0 var/created_name = null diff --git a/code/modules/nifsoft/nif.dm b/code/modules/nifsoft/nif.dm index 9312dd6f082..b8f29e5bd79 100644 --- a/code/modules/nifsoft/nif.dm +++ b/code/modules/nifsoft/nif.dm @@ -30,7 +30,7 @@ GLOBAL_LIST_INIT(nif_id_lookup, init_nif_id_lookup()) icon = 'icons/obj/device_alt.dmi' icon_state = "nif_0" - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY /// For savefiles var/id = NIF_ID_BASIC diff --git a/code/modules/nifsoft/nifsoft.dm b/code/modules/nifsoft/nifsoft.dm index 29df6b6df8b..b5e372484eb 100644 --- a/code/modules/nifsoft/nifsoft.dm +++ b/code/modules/nifsoft/nifsoft.dm @@ -216,7 +216,7 @@ SLOT_ID_LEFT_HAND = 'icons/mob/items/lefthand.dmi', SLOT_ID_RIGHT_HAND = 'icons/mob/items/righthand.dmi', ) - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL var/datum/nifsoft/stored = null /obj/item/disk/nifsoft/attack_mob(mob/target, mob/user, clickchain_flags, list/params, mult, target_zone, intent) @@ -309,7 +309,7 @@ desc = "A box of free nifsofts for security employees." icon_state = "disk_kit" -/obj/item/storage/box/nifsofts_security/PopulateContents() +/obj/item/storage/box/nifsofts_security/legacy_spawn_contents() for(var/i = 0 to 7) new /obj/item/disk/nifsoft/security(src) @@ -332,7 +332,7 @@ desc = "A box of free nifsofts for engineering employees." icon_state = "disk_kit" -/obj/item/storage/box/nifsofts_engineering/PopulateContents() +/obj/item/storage/box/nifsofts_engineering/legacy_spawn_contents() for(var/i = 0 to 7) new /obj/item/disk/nifsoft/engineering(src) @@ -367,7 +367,7 @@ desc = "A box of free nifsofts for medical employees." icon_state = "disk_kit" -/obj/item/storage/box/nifsofts_medical/PopulateContents() +/obj/item/storage/box/nifsofts_medical/legacy_spawn_contents() for(var/i = 0 to 7) new /obj/item/disk/nifsoft/medical(src) @@ -390,6 +390,6 @@ desc = "A box of free nifsofts for mining employees." icon_state = "disk_kit" -/obj/item/storage/box/nifsofts_mining/PopulateContents() +/obj/item/storage/box/nifsofts_mining/legacy_spawn_contents() for(var/i = 0 to 7) new /obj/item/disk/nifsoft/mining(src) diff --git a/code/modules/organs/external/external.dm b/code/modules/organs/external/external.dm index 83d45f38017..2c498aea62a 100644 --- a/code/modules/organs/external/external.dm +++ b/code/modules/organs/external/external.dm @@ -979,7 +979,7 @@ Note that amputating the affected organ does in fact remove the infection from t if(DROPLIMB_BURN) new /obj/effect/debris/cleanable/ash(droploc) for(var/obj/item/I in src) - if(I.w_class > ITEMSIZE_SMALL && !istype(I,/obj/item/organ)) + if(I.w_class > WEIGHT_CLASS_SMALL && !istype(I,/obj/item/organ)) I.forceMove(droploc) qdel(src) if(DROPLIMB_BLUNT) @@ -1001,7 +1001,7 @@ Note that amputating the affected organ does in fact remove the infection from t I.throw_at_old(get_edge_target_turf(src,pick(GLOB.alldirs)),rand(1,3),5) for(var/obj/item/I in src) - if(I.w_class <= ITEMSIZE_SMALL) + if(I.w_class <= WEIGHT_CLASS_SMALL) qdel(I) continue I.forceMove(droploc) @@ -1298,7 +1298,7 @@ Note that amputating the affected organ does in fact remove the infection from t for(var/atom/movable/implant in implants) //large items and non-item objs fall to the floor, everything else stays var/obj/item/I = implant - if(istype(I) && I.w_class < ITEMSIZE_NORMAL) + if(istype(I) && I.w_class < WEIGHT_CLASS_NORMAL) implant.forceMove(victim.drop_location()) else implant.forceMove(src) diff --git a/code/modules/organs/external/species/adherent.dm b/code/modules/organs/external/species/adherent.dm index 3f128a3a814..21a16bccc14 100644 --- a/code/modules/organs/external/species/adherent.dm +++ b/code/modules/organs/external/species/adherent.dm @@ -3,7 +3,7 @@ amputation_point = "axis" joint = "central axis" model = "NULL DATA." - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY gendered_icon = 0 dislocated = -1 max_damage = 50 diff --git a/code/modules/organs/external/species/diona.dm b/code/modules/organs/external/species/diona.dm index 460feebd39f..a7030767b8e 100644 --- a/code/modules/organs/external/species/diona.dm +++ b/code/modules/organs/external/species/diona.dm @@ -27,7 +27,7 @@ icon_name = "torso" max_damage = 200 min_broken_damage = 50 - w_class = ITEMSIZE_HUGE + w_class = WEIGHT_CLASS_HUGE body_part_flags = UPPER_TORSO vital = TRUE cannot_amputate = TRUE @@ -39,7 +39,7 @@ icon_name = "groin" max_damage = 100 min_broken_damage = 50 - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY body_part_flags = LOWER_TORSO parent_organ = BP_TORSO @@ -49,7 +49,7 @@ icon_name = "l_arm" max_damage = 30 min_broken_damage = 20 - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL body_part_flags = ARM_LEFT parent_organ = BP_TORSO can_grasp = TRUE @@ -66,7 +66,7 @@ icon_name = "l_leg" max_damage = 30 min_broken_damage = 20 - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL body_part_flags = LEG_LEFT icon_position = LEFT parent_organ = BP_GROIN @@ -85,7 +85,7 @@ icon_name = "l_foot" max_damage = 25 min_broken_damage = 10 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL body_part_flags = FOOT_LEFT icon_position = LEFT parent_organ = BP_R_LEG @@ -107,7 +107,7 @@ icon_name = "l_hand" max_damage = 25 min_broken_damage = 15 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL body_part_flags = HAND_LEFT parent_organ = BP_L_ARM can_grasp = TRUE diff --git a/code/modules/organs/external/subtypes/standard.dm b/code/modules/organs/external/subtypes/standard.dm index 2772e73aa1c..34dd3b361d9 100644 --- a/code/modules/organs/external/subtypes/standard.dm +++ b/code/modules/organs/external/subtypes/standard.dm @@ -10,7 +10,7 @@ icon_name = "torso" max_damage = 100 min_broken_damage = 35 - w_class = ITEMSIZE_HUGE + w_class = WEIGHT_CLASS_HUGE body_part_flags = UPPER_TORSO vital = TRUE amputation_point = "spine" @@ -52,7 +52,7 @@ icon_name = "groin" max_damage = 100 min_broken_damage = 35 - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY body_part_flags = LOWER_TORSO vital = TRUE parent_organ = BP_TORSO @@ -82,7 +82,7 @@ icon_name = "l_arm" max_damage = 80 min_broken_damage = 30 - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL body_part_flags = ARM_LEFT parent_organ = BP_TORSO joint = "left elbow" @@ -122,7 +122,7 @@ icon_name = "l_leg" max_damage = 80 min_broken_damage = 30 - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL body_part_flags = LEG_LEFT icon_position = LEFT parent_organ = BP_GROIN @@ -161,7 +161,7 @@ icon_name = "l_foot" max_damage = 50 min_broken_damage = 15 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL body_part_flags = FOOT_LEFT icon_position = LEFT parent_organ = BP_L_LEG @@ -201,7 +201,7 @@ icon_name = "l_hand" max_damage = 50 min_broken_damage = 15 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL body_part_flags = HAND_LEFT parent_organ = BP_L_ARM joint = "left wrist" @@ -245,7 +245,7 @@ slot_flags = SLOT_BELT max_damage = 75 min_broken_damage = 35 - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL body_part_flags = HEAD vital = TRUE parent_organ = BP_TORSO diff --git a/code/modules/organs/internal/augment/armmounted.dm b/code/modules/organs/internal/augment/armmounted.dm index 84f04fc2819..f76ff37047d 100644 --- a/code/modules/organs/internal/augment/armmounted.dm +++ b/code/modules/organs/internal/augment/armmounted.dm @@ -6,7 +6,7 @@ name = "laser rifle implant" desc = "A large implant that fits into a subject's arm. It deploys a laser-emitting array by some painful means." icon_state = "augment_laser" - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY organ_tag = O_AUG_L_FOREARM parent_organ = BP_L_ARM target_slot = /datum/inventory_slot_meta/abstract/hand/left @@ -40,7 +40,7 @@ name = "crossbow implant" desc = "A small implant that fits into a subject's arm. It deploys a dart launching mechanism through the flesh through unknown means." icon_state = "augment_dart" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL integrated_object_type = /obj/item/gun/energy/crossbow // Wrist-or-hand-mounted implant @@ -49,7 +49,7 @@ name = "resonant analyzer implant" desc = "An augment that fits neatly into the hand, useful for determining the usefulness of an object for research." icon_state = "augment_box" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL integrated_object_type = /obj/item/portable_scanner /obj/item/organ/internal/augment/armmounted/hand/attackby(obj/item/I as obj, mob/user as mob) @@ -81,7 +81,7 @@ desc = "A large implant that fits into a subject's arm. It looks kind of like a skeleton." icon_state = "augment_armframe" organ_tag = O_AUG_R_UPPERARM - w_class = ITEMSIZE_HUGE + w_class = WEIGHT_CLASS_HUGE integrated_object_type = null /obj/item/organ/internal/augment/armmounted/shoulder/attackby(obj/item/I as obj, mob/user as mob) @@ -129,7 +129,7 @@ organ_tag = O_AUG_R_UPPERARM - w_class = ITEMSIZE_HUGE + w_class = WEIGHT_CLASS_HUGE integrated_object_type = null diff --git a/code/modules/organs/internal/augment/bio.dm b/code/modules/organs/internal/augment/bio.dm index 9f80f0a3034..63cf29c0ebf 100644 --- a/code/modules/organs/internal/augment/bio.dm +++ b/code/modules/organs/internal/augment/bio.dm @@ -20,7 +20,7 @@ icon_state = "augment_shades" dead_icon = "augment_shades_dead" - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY organ_tag = O_AUG_EYES diff --git a/code/modules/organs/internal/subtypes/brain.dm b/code/modules/organs/internal/subtypes/brain.dm index 3cbb43fae28..2d54496d1fc 100644 --- a/code/modules/organs/internal/subtypes/brain.dm +++ b/code/modules/organs/internal/subtypes/brain.dm @@ -7,7 +7,7 @@ decay_rate = ORGAN_DECAY_PER_SECOND_BRAIN icon_state = "brain2" damage_force = 1.0 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL throw_force = 1.0 throw_speed = 3 throw_range = 5 diff --git a/code/modules/organs/internal/subtypes/spleen.dm b/code/modules/organs/internal/subtypes/spleen.dm index 967d2c40c49..1dafb9477ea 100644 --- a/code/modules/organs/internal/subtypes/spleen.dm +++ b/code/modules/organs/internal/subtypes/spleen.dm @@ -3,7 +3,7 @@ icon_state = "spleen" organ_tag = O_SPLEEN parent_organ = BP_TORSO - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY var/spleen_tick = 20 // The number of ticks between Spleen cycles. var/spleen_efficiency = 1 // A multiplier for how efficient this spleen is. diff --git a/code/modules/organs/organ.dm b/code/modules/organs/organ.dm index e9c8f2dc255..07dcf906ae5 100644 --- a/code/modules/organs/organ.dm +++ b/code/modules/organs/organ.dm @@ -86,7 +86,7 @@ if(isliving(loc)) owner = loc - w_class = max(src.w_class + mob_size_difference(owner.mob_size, MOB_MEDIUM), 1) //smaller mobs have smaller organs. + set_weight_class(max(src.w_class + mob_size_difference(owner.mob_size, MOB_MEDIUM), 1)) //smaller mobs have smaller organs. if(internal) LAZYDISTINCTADD(owner.internal_organs, src) LAZYSET(owner.internal_organs_by_name, organ_tag, src) diff --git a/code/modules/overmap/legacy/disperser/disperser_charge.dm b/code/modules/overmap/legacy/disperser/disperser_charge.dm index 0421d63dbde..088c9b9218c 100644 --- a/code/modules/overmap/legacy/disperser/disperser_charge.dm +++ b/code/modules/overmap/legacy/disperser/disperser_charge.dm @@ -3,7 +3,7 @@ desc = "A charge to power the obstruction removal ballista with. It looks impossibly round and shiny. This charge does not have a defined purpose." icon = 'icons/obj/munitions.dmi' icon_state = "slug" - w_class = ITEMSIZE_HUGE + w_class = WEIGHT_CLASS_HUGE density = TRUE // atom_flags = ATOM_FLAG_NO_TEMP_CHANGE | ATOM_FLAG_CLIMBABLE var/chargetype diff --git a/code/modules/paperwork/clipboard.dm b/code/modules/paperwork/clipboard.dm index 388f9d2cf9e..8b716d5d7d0 100644 --- a/code/modules/paperwork/clipboard.dm +++ b/code/modules/paperwork/clipboard.dm @@ -4,7 +4,7 @@ icon_state = "clipboard" item_state = "clipboard" throw_force = 0 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL throw_speed = 3 throw_range = 10 var/obj/item/pen/haspen //The stored pen. diff --git a/code/modules/paperwork/folders.dm b/code/modules/paperwork/folders.dm index 06187f4a001..15914b5f342 100644 --- a/code/modules/paperwork/folders.dm +++ b/code/modules/paperwork/folders.dm @@ -3,7 +3,7 @@ desc = "A folder." icon = 'icons/obj/bureaucracy.dmi' icon_state = "folder" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL pressure_resistance = 2 drop_sound = 'sound/items/drop/paper.ogg' pickup_sound = 'sound/items/pickup/paper.ogg' diff --git a/code/modules/paperwork/handlabeler.dm b/code/modules/paperwork/handlabeler.dm index 8cbfb58ac9b..da2019fb79d 100644 --- a/code/modules/paperwork/handlabeler.dm +++ b/code/modules/paperwork/handlabeler.dm @@ -5,12 +5,15 @@ var/label = null var/labels_left = 30 var/mode = 0 //off or on. - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL /obj/item/hand_labeler/attack_mob(mob/target, mob/user, clickchain_flags, list/params, mult, target_zone, intent) if(user.a_intent == INTENT_HARM) return ..() +/obj/item/hand_labeler/allow_auto_storage_insert(datum/event_args/actor/actor, datum/object_system/storage/storage) + return ..() && !mode + /obj/item/hand_labeler/afterattack(atom/target, mob/user, clickchain_flags, list/params) if(!(clickchain_flags & CLICKCHAIN_HAS_PROXIMITY)) return diff --git a/code/modules/paperwork/paper/paper.dm b/code/modules/paperwork/paper/paper.dm index 650e6e82bdc..7118ccaf20d 100644 --- a/code/modules/paperwork/paper/paper.dm +++ b/code/modules/paperwork/paper/paper.dm @@ -24,7 +24,7 @@ icon_state = "paper" item_state = "paper" throw_force = 0 - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY throw_range = 1 throw_speed = 1 plane = MOB_PLANE diff --git a/code/modules/paperwork/paper_bundle.dm b/code/modules/paperwork/paper_bundle.dm index 57edf291b88..97c67398702 100644 --- a/code/modules/paperwork/paper_bundle.dm +++ b/code/modules/paperwork/paper_bundle.dm @@ -5,7 +5,7 @@ icon_state = "paper" item_state = "paper" throw_force = 0 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL throw_range = 2 throw_speed = 1 plane = MOB_PLANE diff --git a/code/modules/paperwork/paperbin.dm b/code/modules/paperwork/paperbin.dm index 9db2479d098..1076fc731af 100644 --- a/code/modules/paperwork/paperbin.dm +++ b/code/modules/paperwork/paperbin.dm @@ -8,7 +8,7 @@ ) item_state = "sheet-metal" throw_force = 1 - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL throw_speed = 3 throw_range = 7 pressure_resistance = 10 diff --git a/code/modules/paperwork/paperplane.dm b/code/modules/paperwork/paperplane.dm index fbadb527638..a77b19d7ee5 100644 --- a/code/modules/paperwork/paperplane.dm +++ b/code/modules/paperwork/paperplane.dm @@ -7,7 +7,7 @@ throw_range = 7 throw_speed = 1 throw_force = 0 - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY var/obj/item/paper/internalPaper @@ -19,11 +19,7 @@ internalPaper = newPaper atom_flags = newPaper.atom_flags color = newPaper.color - if(isstorage(newPaper.loc)) - var/obj/item/storage/S = newPaper.loc - S.remove_from_storage(newPaper, src) - else - newPaper.forceMove(src) + newPaper.forceMove(src) else internalPaper = new /obj/item/paper(src) update_icon() diff --git a/code/modules/paperwork/papershredder.dm b/code/modules/paperwork/papershredder.dm index 4dca0439a4d..53261b7c303 100644 --- a/code/modules/paperwork/papershredder.dm +++ b/code/modules/paperwork/papershredder.dm @@ -95,10 +95,10 @@ /obj/machinery/papershredder/proc/empty_bin(var/mob/living/user, var/obj/item/storage/empty_into) // Sanity. - if(empty_into && !istype(empty_into)) + if(empty_into && (!istype(empty_into) || isnull(empty_into.max_items))) empty_into = null - if(empty_into && empty_into.contents.len >= empty_into.storage_slots) + if(empty_into && empty_into.contents.len >= empty_into.max_items) to_chat(user, "\The [empty_into] is full.") return @@ -106,8 +106,8 @@ var/obj/item/shreddedp/SP = get_shredded_paper() if(!SP) break if(empty_into) - empty_into.handle_item_insertion(SP, user) - if(empty_into.contents.len >= empty_into.storage_slots) + empty_into.obj_storage.insert(SP) + if(empty_into.contents.len >= empty_into.max_items) break if(empty_into) if(paperamount) @@ -154,7 +154,7 @@ icon = 'icons/obj/bureaucracy.dmi' icon_state = "shredp" throw_force = 0 - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY throw_range = 3 throw_speed = 1 diff --git a/code/modules/paperwork/pen.dm b/code/modules/paperwork/pen.dm index 5a5a790fc0c..f4bf0defd63 100644 --- a/code/modules/paperwork/pen.dm +++ b/code/modules/paperwork/pen.dm @@ -21,7 +21,7 @@ item_state = "pen" slot_flags = SLOT_BELT | SLOT_EARS throw_force = 0 - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY throw_speed = 7 throw_range = 15 materials_base = list(MAT_STEEL = 10) @@ -142,7 +142,7 @@ item_state = "pen" slot_flags = SLOT_BELT | SLOT_EARS throw_force = 3 - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY throw_speed = 7 throw_range = 15 armor_penetration = 20 @@ -151,7 +151,7 @@ var/active_embed_chance = 0 var/active_force = 15 var/active_throwforce = 30 - var/active_w_class = ITEMSIZE_NORMAL + var/active_w_class = WEIGHT_CLASS_NORMAL var/active_icon_state var/default_icon_state @@ -182,7 +182,7 @@ sharp = 1 edge = 1 - w_class = active_w_class + set_weight_class(active_w_class) playsound(src, 'sound/weapons/saberon.ogg', 15, 1) damtype = SEARING item_flags |= ITEM_THROW_UNCATCHABLE @@ -205,7 +205,7 @@ throw_force = initial(throw_force) sharp = initial(sharp) edge = initial(edge) - w_class = initial(w_class) + set_weight_class(initial(w_class)) damtype = BRUTE item_flags &= ~ITEM_THROW_UNCATCHABLE @@ -315,7 +315,7 @@ desc = "A colourful crayon. Please refrain from eating it or putting it in your nose." icon = 'icons/obj/crayons.dmi' icon_state = "crayonred" - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY attack_verb = list("attacked", "coloured") colour = "#FF0000" //RGB var/shadeColour = "#220000" //RGB diff --git a/code/modules/paperwork/stamps.dm b/code/modules/paperwork/stamps.dm index 16553cf56d2..67c09c4b03f 100644 --- a/code/modules/paperwork/stamps.dm +++ b/code/modules/paperwork/stamps.dm @@ -5,7 +5,7 @@ icon_state = "stamp-qm" item_state = "stamp" throw_force = 0 - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY slot_flags = SLOT_HOLSTER throw_speed = 7 throw_range = 15 diff --git a/code/modules/photography/album.dm b/code/modules/photography/album.dm index 4efab8361cc..e9737b810d3 100644 --- a/code/modules/photography/album.dm +++ b/code/modules/photography/album.dm @@ -7,14 +7,6 @@ worn_render_flags = WORN_RENDER_INHAND_ALLOW_DEFAULT inhand_default_type = INHAND_DEFAULT_ICON_STORAGE inhand_state = "briefcase" - can_hold = list(/obj/item/photo) - -/obj/item/storage/photo_album/OnMouseDropLegacy(obj/over_object as obj) - if((istype(usr, /mob/living/carbon/human))) - if(!( istype(over_object, /atom/movable/screen) )) - return ..() - playsound(loc, "rustle", 50, 1, -5) - if(over_object == usr && in_range(src, usr) || usr.contents.Find(src)) - if(usr.s_active) - usr.s_active.close(usr) - show_to(usr) + insertion_whitelist = list( + /obj/item/photo, + ) diff --git a/code/modules/photography/camera.dm b/code/modules/photography/camera.dm index 53ba0ee8ec9..84e03e4ae22 100644 --- a/code/modules/photography/camera.dm +++ b/code/modules/photography/camera.dm @@ -8,7 +8,7 @@ worn_render_flags = NONE desc = "A polaroid camera. 10 photos left." item_flags = ITEM_NOBLUDGEON | ITEM_ENCUMBERS_WHILE_HELD - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL slot_flags = SLOT_BELT materials_base = list(MAT_STEEL = 2000) var/pictures_max = 10 diff --git a/code/modules/photography/film.dm b/code/modules/photography/film.dm index 212e2eec9ce..4565eac0622 100644 --- a/code/modules/photography/film.dm +++ b/code/modules/photography/film.dm @@ -8,7 +8,7 @@ worn_render_flags = WORN_RENDER_INHAND_ALLOW_DEFAULT inhand_default_type = INHAND_DEFAULT_ICON_STORAGE inhand_state = "camera" - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY // amount left var/amount = 10 diff --git a/code/modules/photography/photo.dm b/code/modules/photography/photo.dm index 8e837e515a2..fd7f1ead2e3 100644 --- a/code/modules/photography/photo.dm +++ b/code/modules/photography/photo.dm @@ -35,7 +35,7 @@ worn_render_flags = WORN_RENDER_INHAND_ALLOW_DEFAULT inhand_default_type = INHAND_DEFAULT_ICON_GENERAL inhand_state = "paper" - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY drop_sound = 'sound/items/drop/paper.ogg' pickup_sound = 'sound/items/pickup/paper.ogg' diff --git a/code/modules/power/antimatter/shielding.dm b/code/modules/power/antimatter/shielding.dm index f747379b612..8a8784bc5ab 100644 --- a/code/modules/power/antimatter/shielding.dm +++ b/code/modules/power/antimatter/shielding.dm @@ -193,7 +193,7 @@ icon = 'icons/obj/machines/antimatter.dmi' icon_state = "box" item_state = "electronic" - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY throw_force = 5 throw_speed = 1 throw_range = 2 diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm index fb51bba4f98..bacb973f0e3 100644 --- a/code/modules/power/apc.dm +++ b/code/modules/power/apc.dm @@ -559,7 +559,7 @@ CREATE_WALL_MOUNTING_TYPES_SHIFTED(/obj/machinery/power/apc, 22) if (machine_stat & MAINT) to_chat(user,"You need to install the wiring and electronics first.") return - if(W.w_class != ITEMSIZE_NORMAL) + if(W.w_class != WEIGHT_CLASS_NORMAL) to_chat(user,"\The [W] is too [W.w_class < 3? "small" : "large"] to work here.") return if(!user.attempt_insert_item_for_installation(W, src)) @@ -729,7 +729,7 @@ CREATE_WALL_MOUNTING_TYPES_SHIFTED(/obj/machinery/power/apc, 22) if ((machine_stat & BROKEN) \ && !opened \ && W.damage_force >= 5 \ - && W.w_class >= ITEMSIZE_SMALL ) + && W.w_class >= WEIGHT_CLASS_SMALL ) user.visible_message("The [src.name] has been hit with the [W.name] by [user.name]!", \ "You hit the [src.name] with your [W.name]!", \ "You hear a bang!") diff --git a/code/modules/power/cable.dm b/code/modules/power/cable.dm index bf4c1f7090d..4bf55418c23 100644 --- a/code/modules/power/cable.dm +++ b/code/modules/power/cable.dm @@ -544,7 +544,7 @@ GLOBAL_LIST_INIT(possible_cable_coil_colours, list( color = COLOR_RED desc = "A coil of power cable." throw_force = 10 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL throw_speed = 2 throw_range = 5 materials_base = list(MAT_STEEL = 50, MAT_GLASS = 20) @@ -627,9 +627,9 @@ GLOBAL_LIST_INIT(possible_cable_coil_colours, list( /obj/item/stack/cable_coil/proc/update_wclass() if(amount == 1) - w_class = ITEMSIZE_TINY + set_weight_class(WEIGHT_CLASS_TINY) else - w_class = ITEMSIZE_SMALL + set_weight_class(WEIGHT_CLASS_SMALL) /obj/item/stack/cable_coil/examine(mob/user, dist) . = ..() @@ -975,7 +975,7 @@ GLOBAL_LIST_INIT(possible_cable_coil_colours, list( max_amount = MAXCOIL color = COLOR_SILVER throw_force = 10 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL throw_speed = 2 throw_range = 5 materials_base = list(MAT_STEEL = 50, MAT_GLASS = 20) diff --git a/code/modules/power/cell.dm b/code/modules/power/cell.dm index 328ce540713..980695395cb 100644 --- a/code/modules/power/cell.dm +++ b/code/modules/power/cell.dm @@ -13,7 +13,7 @@ throw_force = 5.0 throw_speed = 3 throw_range = 5 - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL /// Are we EMP immune? var/emp_proof = FALSE var/charge diff --git a/code/modules/power/cells/device_cells.dm b/code/modules/power/cells/device_cells.dm index 47705e6da78..dcb9244799c 100644 --- a/code/modules/power/cells/device_cells.dm +++ b/code/modules/power/cells/device_cells.dm @@ -4,7 +4,7 @@ desc = "A small power cell designed to power handheld devices." icon_state = "dcell" item_state = "egg6" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL damage_force = 0 throw_speed = 5 throw_range = 7 diff --git a/code/modules/power/cells/power_cells.dm b/code/modules/power/cells/power_cells.dm index ba24ff587e1..820512bf654 100644 --- a/code/modules/power/cells/power_cells.dm +++ b/code/modules/power/cells/power_cells.dm @@ -99,7 +99,7 @@ desc = "A small one-time-use chemical battery for synthetic crew when they are low on power in emergency situations." icon = 'icons/obj/power.dmi' icon_state = "fbp_cell" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL var/amount = 100 var/used = FALSE @@ -138,7 +138,7 @@ desc = "A tiny power cell with a very low power capacity. Used in light fixtures to power them in the event of an outage." maxcharge = 120 //Emergency lights use 0.2 W per tick, meaning ~10 minutes of emergency power from a cell materials_base = list(MAT_GLASS = 20) - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY /obj/item/cell/emergency_light/Initialize(mapload) . = ..() diff --git a/code/modules/power/lighting/lighting.dm b/code/modules/power/lighting/lighting.dm index 01cbb7b10bc..26319b49770 100644 --- a/code/modules/power/lighting/lighting.dm +++ b/code/modules/power/lighting/lighting.dm @@ -1015,4 +1015,4 @@ var/global/list/light_type_cache = list() desc = "A lamp shade for a lamp." icon = 'icons/obj/lighting.dmi' icon_state = "lampshade" - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY diff --git a/code/modules/power/lighting/lights.dm b/code/modules/power/lighting/lights.dm index 9b8c12f5bcc..fb697578a65 100644 --- a/code/modules/power/lighting/lights.dm +++ b/code/modules/power/lighting/lights.dm @@ -7,7 +7,7 @@ icon = 'icons/obj/lighting.dmi' damage_force = 2 throw_force = 5 - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY materials_base = list(MAT_STEEL = 60) drop_sound = 'sound/items/drop/glass.ogg' pickup_sound = 'sound/items/pickup/glass.ogg' @@ -49,7 +49,7 @@ nightshift_power = 0.5 /obj/item/light/tube/large - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL name = "large light tube" brightness_range = 8 brightness_power = 1 diff --git a/code/modules/power/smes/coil.dm b/code/modules/power/smes/coil.dm index e6ab3ee30fa..76aa4e00ddb 100644 --- a/code/modules/power/smes/coil.dm +++ b/code/modules/power/smes/coil.dm @@ -6,7 +6,7 @@ desc = "The standard superconductive magnetic coil, with average capacity and I/O rating." icon = 'icons/obj/stock_parts.dmi' icon_state = "smes_coil" // Just few icons patched together. If someone wants to make better icon, feel free to do so! - w_class = ITEMSIZE_LARGE // It's LARGE (backpack size) + w_class = WEIGHT_CLASS_BULKY // It's LARGE (backpack size) /// capacity in kWh var/charge_capacity = SMES_COIL_STORAGE_BASIC /// IO in kW diff --git a/code/modules/power/solar.dm b/code/modules/power/solar.dm index 808949184c2..ecbf71a212d 100644 --- a/code/modules/power/solar.dm +++ b/code/modules/power/solar.dm @@ -186,7 +186,7 @@ GLOBAL_LIST_EMPTY(solars_list) icon = 'icons/obj/power.dmi' icon_state = "sp_base" item_state = "camera" - w_class = ITEMSIZE_LARGE // Pretty big! + w_class = WEIGHT_CLASS_BULKY // Pretty big! anchored = 0 var/tracker = 0 var/glass_type = null diff --git a/code/modules/power/tracker.dm b/code/modules/power/tracker.dm index bcd55dffeac..0b038579244 100644 --- a/code/modules/power/tracker.dm +++ b/code/modules/power/tracker.dm @@ -80,4 +80,4 @@ name = "tracker electronics" icon = 'icons/obj/doors/door_assembly.dmi' icon_state = "door_electronics" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL diff --git a/code/modules/projectiles/ammunition/ammo_casing.dm b/code/modules/projectiles/ammunition/ammo_casing.dm index 9b79f0b5738..d27d97faf58 100644 --- a/code/modules/projectiles/ammunition/ammo_casing.dm +++ b/code/modules/projectiles/ammunition/ammo_casing.dm @@ -6,7 +6,7 @@ slot_flags = SLOT_BELT | SLOT_EARS item_flags = ITEM_EASY_LATHE_DECONSTRUCT | ITEM_ENCUMBERS_WHILE_HELD throw_force = 1 - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY preserve_item = 1 drop_sound = 'sound/items/drop/ring.ogg' pickup_sound = 'sound/items/pickup/ring.ogg' diff --git a/code/modules/projectiles/dnalocking.dm b/code/modules/projectiles/dnalocking.dm index 531c0ce1ebd..b5488db0fea 100644 --- a/code/modules/projectiles/dnalocking.dm +++ b/code/modules/projectiles/dnalocking.dm @@ -3,7 +3,7 @@ icon = 'icons/obj/ammo.dmi' icon_state = "dnalockchip" desc = "A state of the art technological chip that can be installed in a firearm. It allows the user to store their DNA and lock the gun's use from unwanted users." - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY origin_tech = list(TECH_COMBAT = 4, TECH_DATA = 4, TECH_BIO = 4) var/list/stored_dna = list() //list of the dna stored in the gun, used to allow users to use it or not diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm index a694d7522cb..0e1454a9ee0 100644 --- a/code/modules/projectiles/gun.dm +++ b/code/modules/projectiles/gun.dm @@ -42,7 +42,7 @@ slot_flags = SLOT_BELT|SLOT_HOLSTER materials_base = list(MAT_STEEL = 2000) rad_flags = RAD_BLOCK_CONTENTS - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL throw_force = 5 throw_speed = 4 throw_range = 5 diff --git a/code/modules/projectiles/guns/ballistic.dm b/code/modules/projectiles/guns/ballistic.dm index 2ac395af296..23d639e8364 100644 --- a/code/modules/projectiles/guns/ballistic.dm +++ b/code/modules/projectiles/guns/ballistic.dm @@ -4,7 +4,7 @@ icon = 'icons/obj/gun/ballistic.dmi' icon_state = "revolver" origin_tech = list(TECH_COMBAT = 2, TECH_MATERIAL = 2) - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL materials_base = list(MAT_STEEL = 1000) recoil = 0 projectile_type = /obj/projectile/bullet/pistol/strong //Only used for chameleon guns @@ -252,7 +252,7 @@ return CLICKCHAIN_DO_NOT_PROPAGATE to_chat(user, "You screw [A] onto [src].") silenced = TRUE - w_class = ITEMSIZE_NORMAL + set_weight_class(WEIGHT_CLASS_NORMAL) update_icon() return CLICKCHAIN_DO_NOT_PROPAGATE else if(istype(A, /obj/item/tool/wrench)) @@ -261,7 +261,7 @@ to_chat(user, "You unscrew [S]] from [src].") user.put_in_hands(S) silenced = FALSE - w_class = ITEMSIZE_SMALL + set_weight_class(WEIGHT_CLASS_SMALL) update_icon() /obj/item/gun/ballistic/attack_self(mob/user) diff --git a/code/modules/projectiles/guns/energy/hooklauncher.dm b/code/modules/projectiles/guns/energy/hooklauncher.dm index cf8df2af173..e9ee3d4e4bc 100644 --- a/code/modules/projectiles/guns/energy/hooklauncher.dm +++ b/code/modules/projectiles/guns/energy/hooklauncher.dm @@ -24,7 +24,7 @@ icon_state = "seal-signet" item_state = "concealed" - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY cell_type = /obj/item/cell/device/weapon/recharge/alien battery_lock = TRUE diff --git a/code/modules/projectiles/guns/energy/laser.dm b/code/modules/projectiles/guns/energy/laser.dm index 5ac9e70ccf2..760e6329028 100644 --- a/code/modules/projectiles/guns/energy/laser.dm +++ b/code/modules/projectiles/guns/energy/laser.dm @@ -7,7 +7,7 @@ wielded_item_state = "laser-wielded" fire_delay = 8 slot_flags = SLOT_BELT|SLOT_BACK - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY damage_force = 10 origin_tech = list(TECH_COMBAT = 3, TECH_MAGNET = 2) materials_base = list(MAT_STEEL = 2000) @@ -48,7 +48,7 @@ item_state = "retro" desc = "An older model of the basic lasergun. Nevertheless, it is still quite deadly and easy to maintain, making it a favorite amongst pirates and other outlaws." slot_flags = SLOT_BELT - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL projectile_type = /obj/projectile/beam fire_delay = 10 //old technology @@ -115,7 +115,7 @@ desc = "A rare weapon, handcrafted by a now defunct specialty manufacturer on Luna for a small fortune. It's certainly aged well." damage_force = 5 slot_flags = SLOT_BELT - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL projectile_type = /obj/projectile/beam origin_tech = null fire_delay = 10 //Old pistol @@ -133,7 +133,7 @@ projectile_type = /obj/projectile/beam/heavylaser/cannon battery_lock = 1 fire_delay = 20 - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY heavy = TRUE one_handed_penalty = 90 // The thing's heavy and huge. accuracy = 75 @@ -174,7 +174,7 @@ fire_delay = 35 damage_force = 10 heavy = TRUE - w_class = ITEMSIZE_HUGE // So it can't fit in a backpack. + w_class = WEIGHT_CLASS_HUGE // So it can't fit in a backpack. accuracy = 25 //shooting at the hip scoped_accuracy = 80 // requires_two_hands = 1 @@ -211,7 +211,7 @@ fire_delay = 20 damage_force = 8 heavy = TRUE - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY accuracy = 70 scoped_accuracy = 95 var/scope_multiplier = 1.5 @@ -280,7 +280,7 @@ desc = "A automatic laser weapon resembling a Tommy-Gun. Designed by Cybersun Industries to be a man portable supressive fire laser weapon." icon_state = "tommylas" item_state = "tommylas" - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY heavy = TRUE slot_flags = SLOT_BACK charge_cost = 60 // 40 shots, lay down the firepower @@ -299,7 +299,7 @@ desc = "A homemade (and somehow safe) laser gun designed around shooting single powerful laser beam draining the cell entirely. Better not miss and better have spare cells." icon_state = "ziplas" item_state = "ziplas" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL slot_flags = SLOT_BELT|SLOT_BACK charge_cost = 1500 //You got 1 shot... projectile_type = /obj/projectile/beam/heavylaser //But it hurts a lot @@ -328,7 +328,7 @@ item_state = "clrifle" fire_delay = 6 slot_flags = SLOT_BELT|SLOT_BACK - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY damage_force = 10 origin_tech = list(TECH_COMBAT = 5, TECH_MAGNET = 2) materials_base = list(MAT_STEEL = 2000, "plastic" = 1000) diff --git a/code/modules/projectiles/guns/energy/modular/gunframes.dm b/code/modules/projectiles/guns/energy/modular/gunframes.dm index 011677d73c7..8fb9c34a61f 100644 --- a/code/modules/projectiles/guns/energy/modular/gunframes.dm +++ b/code/modules/projectiles/guns/energy/modular/gunframes.dm @@ -26,7 +26,7 @@ desc = "A basic modular energy weapon. This rifle has the capability to mount two cores." cores = 2 icon_state = "mod_rifle" - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY /obj/item/gun/energy/modular/rifle/tribeam name = "tribeam modular energy rifle" @@ -37,7 +37,7 @@ name = "compact modular energy pistol" desc = "A compact energy pistol that can fit into a pocket. However, only the laser core can be replaced. All the other components are purpose-built for their size and are integrated into the frame." icon_state = "taserblue" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL /obj/item/gun/energy/modular/compact/Initialize(mapload) . = ..() @@ -61,7 +61,7 @@ battery_lock = TRUE cell_type = /obj/item/cell/device/weapon/modcannon icon_state = "mod_cannon" - w_class = ITEMSIZE_HUGE + w_class = WEIGHT_CLASS_HUGE heavy = TRUE /obj/item/gun/energy/modular/cannon/Initialize(mapload) @@ -80,7 +80,7 @@ battery_lock = TRUE cell_type = /obj/item/cell/device/weapon/recharge/captain icon_state = "modnuc" - w_class = ITEMSIZE_HUGE + w_class = WEIGHT_CLASS_HUGE heavy = TRUE /obj/item/gun/energy/modular/nuke/Initialize(mapload) diff --git a/code/modules/projectiles/guns/energy/nuclear.dm b/code/modules/projectiles/guns/energy/nuclear.dm index 079c4c49694..a82f680d0d9 100644 --- a/code/modules/projectiles/guns/energy/nuclear.dm +++ b/code/modules/projectiles/guns/energy/nuclear.dm @@ -27,7 +27,7 @@ item_state = null //so the human update icon uses the icon_state instead. charge_cost = 100 damage_force = 8 - w_class = ITEMSIZE_LARGE //Probably gonna make it a rifle sooner or later + w_class = WEIGHT_CLASS_BULKY //Probably gonna make it a rifle sooner or later fire_delay = 6 heavy = TRUE projectile_type = /obj/projectile/beam/stun/weak @@ -51,7 +51,7 @@ item_state = null //so the human update icon uses the icon_state instead. charge_cost = 20 damage_force = 8 - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY fire_delay = 3 projectile_type = /obj/projectile/beam/excavation origin_tech = list(TECH_COMBAT = 4, TECH_MAGNET = 2, TECH_ILLEGAL = 2) @@ -72,7 +72,7 @@ origin_tech = list(TECH_COMBAT = 3, TECH_MATERIAL = 5, TECH_POWER = 3) slot_flags = SLOT_BELT damage_force = 8 //looks heavier than a pistol - w_class = ITEMSIZE_LARGE //Looks bigger than a pistol, too. + w_class = WEIGHT_CLASS_BULKY //Looks bigger than a pistol, too. heavy = TRUE fire_delay = 6 //This one's not a handgun, it should have the same fire delay as everything else cell_type = /obj/item/cell/device/weapon/recharge @@ -100,7 +100,7 @@ origin_tech = list(TECH_COMBAT = 5, TECH_MATERIAL = 3, TECH_POWER = 3) slot_flags = SLOT_BELT|SLOT_HOLSTER damage_force = 10 //for the HOS to lay down a good beating in desperate situations. Holdover from TG. - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL fire_delay = 6 //standard rate battery_lock = 0 modifystate = null diff --git a/code/modules/projectiles/guns/energy/particle.dm b/code/modules/projectiles/guns/energy/particle.dm index 8735ef20261..910bedde790 100644 --- a/code/modules/projectiles/guns/energy/particle.dm +++ b/code/modules/projectiles/guns/energy/particle.dm @@ -15,7 +15,7 @@ jurisdictions including NT space, APP guns are officially classed as mining equipment rather than firearms." fire_sound = 'sound/weapons/blaster.ogg' slot_flags = SLOT_BELT - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL projectile_type = /obj/projectile/bullet/particle origin_tech = list(TECH_COMBAT = 3, TECH_MAGNET = 2, TECH_MATERIAL = 2) fire_delay = 10 @@ -31,7 +31,7 @@ desc = "A Kawashima Material Technology Model E-8 anti-particle projector. A down-scale of the same technology behind the Model 9 anti-particle cannon, fitted with an enhanced power-generation unit for theoretically infinite recharges." slot_flags = SLOT_BELT damage_force = 8 //looks heavier than a pistol - w_class = ITEMSIZE_LARGE //bigger than a pistol, too. + w_class = WEIGHT_CLASS_BULKY //bigger than a pistol, too. heavy = TRUE origin_tech = list(TECH_COMBAT = 4, TECH_MATERIAL = 5, TECH_POWER = 3, TECH_MAGNET = 3) fire_delay = 6 //This one's not a handgun, it should have the same fire delay as everything else @@ -53,7 +53,7 @@ projectile_type = /obj/projectile/bullet/particle/heavy battery_lock = 1 fire_delay = 15 // fires faster than a laser cannon. c'mon, it's an awesome-but-impractical endgame gun. - w_class = ITEMSIZE_HUGE // So it can't fit in a backpack. + w_class = WEIGHT_CLASS_HUGE // So it can't fit in a backpack. damage_force = 10 one_handed_penalty = 60 // The thing's heavy and huge. accuracy = 70 @@ -164,7 +164,7 @@ icon = 'icons/obj/gun/energy.dmi' icon_state = "pressurelock" desc = "A safety interlock that can be installed in an antiparticle projector. It prevents the weapon from discharging in pressurised environments." - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY origin_tech = list(TECH_COMBAT = 2, TECH_MATERIAL = 2, TECH_ENGINEERING = 2) // projectiles below diff --git a/code/modules/projectiles/guns/energy/phase.dm b/code/modules/projectiles/guns/energy/phase.dm index ccc597173a5..a330c405500 100644 --- a/code/modules/projectiles/guns/energy/phase.dm +++ b/code/modules/projectiles/guns/energy/phase.dm @@ -17,7 +17,7 @@ desc = "The NT EW15 Apollo is an energy handgun, specifically designed for self-defense against aggressive wildlife." icon_state = "phase" item_state = "taser" //I don't have an in-hand sprite, taser will be fine - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL slot_flags = SLOT_BELT|SLOT_HOLSTER charge_cost = 300 projectile_type = /obj/projectile/energy/phase/light @@ -38,7 +38,7 @@ icon_state = "phaserifle" item_state = "phaserifle" wielded_item_state = "phaserifle-wielded" - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY slot_flags = SLOT_BACK charge_cost = 150 projectile_type = /obj/projectile/energy/phase/heavy @@ -50,7 +50,7 @@ icon_state = "phasecannon" item_state = "phasecannon" wielded_item_state = "phasecannon-wielded" //TODO: New Sprites - w_class = ITEMSIZE_HUGE // This thing is big. + w_class = WEIGHT_CLASS_HUGE // This thing is big. slot_flags = SLOT_BACK heavy = TRUE charge_cost = 100 diff --git a/code/modules/projectiles/guns/energy/special.dm b/code/modules/projectiles/guns/energy/special.dm index 81d08aa9aa4..3a23809c4db 100644 --- a/code/modules/projectiles/guns/energy/special.dm +++ b/code/modules/projectiles/guns/energy/special.dm @@ -5,7 +5,7 @@ item_state = "ionrifle" wielded_item_state = "ionrifle-wielded" origin_tech = list(TECH_COMBAT = 2, TECH_MAGNET = 4) - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY damage_force = 10 slot_flags = SLOT_BACK heavy = TRUE @@ -20,7 +20,7 @@ desc = "The NT Mk63 EW Pan is a man portable anti-armor weapon designed to disable mechanical threats, produced by NT. This model sacrifices capacity for portability." icon_state = "ionpistol" item_state = null - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL damage_force = 5 slot_flags = SLOT_BELT|SLOT_HOLSTER heavy = FALSE @@ -90,7 +90,7 @@ icon_state = "riotgun" item_state = "c20r" slot_flags = SLOT_BELT|SLOT_BACK - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY heavy = TRUE projectile_type = /obj/projectile/meteor cell_type = /obj/item/cell/potato @@ -106,7 +106,7 @@ icon = 'icons/obj/bureaucracy.dmi' icon_state = "pen" item_state = "pen" - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY heavy = FALSE slot_flags = SLOT_BELT one_handed_penalty = 0 @@ -123,7 +123,7 @@ name = "phoron pistol" desc = "A failed experiment in anti-personnel weaponry from the onset of the Syndicate Wars. The Mk.1 NT-P uses an internal resevoir of phoron gas, excited into a photonic state with a standard weapon cell, to fire lethal bolts of phoron-based plasma." icon_state = "toxgun" - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL origin_tech = list(TECH_COMBAT = 5, TECH_PHORON = 4) projectile_type = /obj/projectile/energy/phoron @@ -136,7 +136,7 @@ item_icons = null icon_state = "staff" slot_flags = SLOT_BACK - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY charge_cost = 480 projectile_type = /obj/projectile/change origin_tech = null @@ -189,7 +189,7 @@ icon_state = "dakkalaser" item_state = "dakkalaser" wielded_item_state = "dakkalaser-wielded" - w_class = ITEMSIZE_HUGE + w_class = WEIGHT_CLASS_HUGE heavy = TRUE charge_cost = 24 // 100 shots, it's a spray and pray (to RNGesus) weapon. projectile_type = /obj/projectile/energy/blue_pellet @@ -214,7 +214,7 @@ icon_state = "mhdhowitzer" item_state = "mhdhowitzer" wielded_item_state = "mhdhowitzer-wielded" - w_class = ITEMSIZE_HUGE + w_class = WEIGHT_CLASS_HUGE heavy = TRUE charge_cost = 10000 // Uses large cells, can at max have 3 shots. @@ -326,7 +326,7 @@ desc = "An anomalous weapon, long kept secure. It has recently been acquired by NanoTrasen's Paracausal Monitoring Division. How did it get here?" damage_force = 5 slot_flags = SLOT_BELT - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL projectile_type = /obj/projectile/bullet/pistol/medium/silver origin_tech = null fire_delay = 10 //Old pistol @@ -432,7 +432,7 @@ cell_type = /obj/item/cell accept_cell_type = /obj/item/cell slot_flags = SLOT_BELT|SLOT_BACK - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY heavy = TRUE damage_force = 10 origin_tech = list(TECH_COMBAT = 3, TECH_ENGINEERING = 3, TECH_MAGNET = 2) @@ -457,7 +457,7 @@ cell_type = /obj/item/cell/device/weapon battery_lock = 1 slot_flags = SLOT_BACK - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY heavy = TRUE damage_force = 10 one_handed_penalty = 60 @@ -473,7 +473,7 @@ charge_cost = 400 cell_type = /obj/item/cell/device/weapon slot_flags = SLOT_BELT|SLOT_BACK - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY heavy = TRUE damage_force = 10 origin_tech = list(TECH_COMBAT = 6, TECH_ENGINEERING = 5, TECH_MAGNET = 5) @@ -516,7 +516,7 @@ desc = "This scaled down NT-PLP-EX 'Wyrm' plasma pistol fires magnetically contained balls of plasma at high velocity. Due to the volatility of the round, the weapon is known to overheat and fail catastrophically if fired too frequently." icon_state = "ppistol" slot_flags = SLOT_BELT|SLOT_HOLSTER - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL heavy = FALSE damage_force = 5 origin_tech = list(TECH_COMBAT = 6, TECH_ENGINEERING = 5, TECH_MAGNET = 5) diff --git a/code/modules/projectiles/guns/energy/stun.dm b/code/modules/projectiles/guns/energy/stun.dm index 1e9558da016..960100b4b6b 100644 --- a/code/modules/projectiles/guns/energy/stun.dm +++ b/code/modules/projectiles/guns/energy/stun.dm @@ -49,7 +49,7 @@ name = "mini energy-crossbow" desc = "A weapon favored by many mercenary stealth specialists." icon_state = "crossbow" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL item_state = "crossbow" origin_tech = list(TECH_COMBAT = 2, TECH_MAGNET = 2, TECH_ILLEGAL = 5) materials_base = list(MAT_STEEL = 2000) @@ -68,7 +68,7 @@ /obj/item/gun/energy/crossbow/largecrossbow name = "energy crossbow" desc = "A weapon favored by mercenary infiltration teams." - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY materials_base = list(MAT_STEEL = 200000) damage_force = 10 slot_flags = SLOT_BELT diff --git a/code/modules/projectiles/guns/launcher.dm b/code/modules/projectiles/guns/launcher.dm index 6faff70391a..f95cee55f07 100644 --- a/code/modules/projectiles/guns/launcher.dm +++ b/code/modules/projectiles/guns/launcher.dm @@ -2,7 +2,7 @@ name = "launcher" desc = "A device that launches things." icon = 'icons/obj/gun/launcher.dmi' - w_class = ITEMSIZE_HUGE + w_class = WEIGHT_CLASS_HUGE slot_flags = SLOT_BACK var/release_force = 0 diff --git a/code/modules/projectiles/guns/launcher/crossbow.dm b/code/modules/projectiles/guns/launcher/crossbow.dm index 3e9e120517d..6738cc275a1 100644 --- a/code/modules/projectiles/guns/launcher/crossbow.dm +++ b/code/modules/projectiles/guns/launcher/crossbow.dm @@ -9,7 +9,7 @@ drop_sound = 'sound/items/drop/sword.ogg' pickup_sound = 'sound/items/pickup/sword.ogg' throw_force = 8 - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL sharp = 1 edge = 0 @@ -22,7 +22,7 @@ sharp = 1 edge = 0 throw_force = 5 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL icon = 'icons/obj/weapons.dmi' icon_state = "metal-rod" item_state = "bolt" diff --git a/code/modules/projectiles/guns/launcher/grenade_launcher.dm b/code/modules/projectiles/guns/launcher/grenade_launcher.dm index 26838b8ce07..747c7eb5215 100644 --- a/code/modules/projectiles/guns/launcher/grenade_launcher.dm +++ b/code/modules/projectiles/guns/launcher/grenade_launcher.dm @@ -3,7 +3,7 @@ desc = "A bulky pump-action grenade launcher. Holds up to 6 grenades in a revolving magazine." icon_state = "riotgun" item_state = "riotgun" - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY heavy = TRUE damage_force = 10 one_handed_penalty = 5 @@ -100,7 +100,7 @@ /obj/item/gun/launcher/grenade/underslung name = "underslung grenade launcher" desc = "Not much more than a tube and a firing mechanism, this grenade launcher is designed to be fitted to a rifle." - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL damage_force = 5 max_grenades = 0 diff --git a/code/modules/projectiles/guns/launcher/pneumatic.dm b/code/modules/projectiles/guns/launcher/pneumatic.dm index 513cd1fcf0c..1fcb4298d22 100644 --- a/code/modules/projectiles/guns/launcher/pneumatic.dm +++ b/code/modules/projectiles/guns/launcher/pneumatic.dm @@ -4,7 +4,7 @@ icon_state = "pneumatic" item_state = "pneumatic" slot_flags = SLOT_BELT - w_class = ITEMSIZE_HUGE + w_class = WEIGHT_CLASS_HUGE heavy = TRUE fire_sound_text = "a loud whoosh of moving air" fire_delay = 50 @@ -12,8 +12,8 @@ one_handed_penalty = 10 var/fire_pressure // Used in fire checks/pressure checks. - var/max_w_class = ITEMSIZE_NORMAL // Hopper intake size. - var/max_storage_space = ITEMSIZE_COST_NORMAL * 5 // Total internal storage size. + var/max_single_weight_class = WEIGHT_CLASS_NORMAL // Hopper intake size. + var/max_combined_volume = WEIGHT_VOLUME_NORMAL * 5 // Total internal storage size. var/obj/item/tank/tank = null // Tank of gas for use in firing the cannon. var/obj/item/storage/item_storage @@ -26,9 +26,11 @@ . = ..() item_storage = new(src) item_storage.name = "hopper" - item_storage.max_w_class = max_w_class - item_storage.max_storage_space = max_storage_space - item_storage.use_sound = null + item_storage.max_single_weight_class = max_single_weight_class + item_storage.max_combined_volume = max_combined_volume + item_storage.sfx_insert = null + item_storage.sfx_remove = null + item_storage.sfx_open = null /obj/item/gun/launcher/pneumatic/verb/set_pressure() //set amount of tank pressure. set name = "Set Valve Pressure" @@ -52,8 +54,8 @@ /obj/item/gun/launcher/pneumatic/proc/unload_hopper(mob/user) if(item_storage.contents.len > 0) var/obj/item/removing = item_storage.contents[item_storage.contents.len] - item_storage.remove_from_storage(removing, src.loc) - user.put_in_hands(removing) + item_storage.obj_storage.remove(removing, src.loc, new /datum/event_args/actor(user)) + user.put_in_hands_or_drop(removing) to_chat(user, "You remove [removing] from the hopper.") playsound(src.loc, 'sound/weapons/empty.ogg', 50, 1) else @@ -72,8 +74,8 @@ tank = W user.visible_message("[user] jams [W] into [src]'s valve and twists it closed.","You jam [W] into [src]'s valve and twist it closed.") update_icon() - else if(istype(W) && item_storage.can_be_inserted(W)) - item_storage.handle_item_insertion(W, user) + else if(istype(W) && item_storage.obj_storage.can_be_inserted(W)) + item_storage.obj_storage.try_insert(W, new /datum/event_args/actor(user)) /obj/item/gun/launcher/pneumatic/attack_self(mob/user) . = ..() @@ -101,7 +103,7 @@ return null var/obj/item/launched = item_storage.contents[1] - item_storage.remove_from_storage(launched, src) + item_storage.obj_storage.remove(launched, src) return launched /obj/item/gun/launcher/pneumatic/examine(mob/user, dist) diff --git a/code/modules/projectiles/guns/launcher/syringe_gun.dm b/code/modules/projectiles/guns/launcher/syringe_gun.dm index 303910d9342..3542155b7d5 100644 --- a/code/modules/projectiles/guns/launcher/syringe_gun.dm +++ b/code/modules/projectiles/guns/launcher/syringe_gun.dm @@ -8,7 +8,7 @@ slot_flags = SLOT_BELT | SLOT_EARS throw_force = 3 damage_force = 3 - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY var/obj/item/reagent_containers/syringe/syringe /obj/item/syringe_cartridge/update_icon() @@ -69,7 +69,7 @@ desc = "A spring loaded rifle designed to fit syringes, designed to incapacitate unruly patients from a distance." icon_state = "syringegun" item_state = "syringegun" - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL materials_base = list(MAT_STEEL = 2000) damage_force = 7 slot_flags = SLOT_BELT diff --git a/code/modules/projectiles/guns/magnetic/magnetic.dm b/code/modules/projectiles/guns/magnetic/magnetic.dm index ec96d1d5186..6a85481a008 100644 --- a/code/modules/projectiles/guns/magnetic/magnetic.dm +++ b/code/modules/projectiles/guns/magnetic/magnetic.dm @@ -6,7 +6,7 @@ icon = 'icons/obj/railgun.dmi' one_handed_penalty = 15 origin_tech = list(TECH_COMBAT = 5, TECH_MATERIAL = 4, TECH_ILLEGAL = 2, TECH_MAGNET = 4) - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY var/obj/item/cell/cell // Currently installed powercell. var/obj/item/stock_parts/capacitor/capacitor // Installed capacitor. Higher rating == faster charge between shots. @@ -203,7 +203,7 @@ item_state = "coilgun" icon = 'icons/obj/railgun.dmi' origin_tech = list(TECH_COMBAT = 6, TECH_MATERIAL = 4, TECH_PHORON = 4, TECH_ILLEGAL = 5, TECH_MAGNET = 4) - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY removable_components = TRUE gun_unreliable = 0 diff --git a/code/modules/projectiles/guns/magnetic/magnetic_railgun.dm b/code/modules/projectiles/guns/magnetic/magnetic_railgun.dm index 73aaa29d0c2..650154c9ea9 100644 --- a/code/modules/projectiles/guns/magnetic/magnetic_railgun.dm +++ b/code/modules/projectiles/guns/magnetic/magnetic_railgun.dm @@ -8,7 +8,7 @@ origin_tech = list(TECH_COMBAT = 5, TECH_MATERIAL = 4, TECH_MAGNET = 4) projectile_type = /obj/projectile/bullet/magnetic/slug power_cost = 300 - w_class = ITEMSIZE_HUGE + w_class = WEIGHT_CLASS_HUGE heavy = TRUE slot_flags = SLOT_BELT loaded = /obj/item/rcd_ammo/large @@ -67,7 +67,7 @@ encumbrance = ITEM_ENCUMBRANCE_GUN_RIDICULOUS slot_flags = SLOT_BACK - w_class = ITEMSIZE_NO_CONTAINER + w_class = WEIGHT_CLASS_HUGE firemodes = list( list(mode_name="semiauto", burst=1, fire_delay=0, move_delay=null, one_handed_penalty=15, burst_accuracy=null, dispersion=null), @@ -145,7 +145,7 @@ icon_state = "peacemaker" item_state = "revolver" - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL initial_cell_type = /obj/item/cell/high initial_capacitor_type = /obj/item/stock_parts/capacitor diff --git a/code/modules/projectiles/guns/projectile/automatic.dm b/code/modules/projectiles/guns/projectile/automatic.dm index b96d88507ba..f6117ff3552 100644 --- a/code/modules/projectiles/guns/projectile/automatic.dm +++ b/code/modules/projectiles/guns/projectile/automatic.dm @@ -18,7 +18,7 @@ name = "advanced SMG" desc = "The NT-S3W is an advanced submachine gun design, using a reflective laser optic for increased accuracy over competing models. Chambered for 9mm rounds." icon_state = "advanced_smg" - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL load_method = MAGAZINE caliber = "9mm" origin_tech = list(TECH_COMBAT = 4, TECH_MATERIAL = 2) @@ -39,7 +39,7 @@ desc = "The C-20r is a lightweight and rapid firing SMG, for when you REALLY need someone dead. It has 'Scarborough Arms - Per falcis, per pravitas' inscribed on the stock. Uses 10mm rounds." icon_state = "c20r" item_state = "c20r" - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL damage_force = 10 caliber = "10mm" origin_tech = list(TECH_COMBAT = 5, TECH_MATERIAL = 2, TECH_ILLEGAL = 8) @@ -67,7 +67,7 @@ item_state = "arifle" wielded_item_state = "arifle-wielded" item_state = null - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY damage_force = 10 caliber = "5.56mm" origin_tech = list(TECH_COMBAT = 6, TECH_MATERIAL = 1, TECH_ILLEGAL = 4) @@ -102,7 +102,7 @@ desc = "The WT550 Saber is a cheap self-defense weapon mass-produced by Ward-Takahashi for paramilitary and private use. Uses 9mm rounds." icon_state = "wt550" item_state = "wt550" - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL caliber = "9mm" origin_tech = list(TECH_COMBAT = 5, TECH_MATERIAL = 2) slot_flags = SLOT_BELT @@ -128,7 +128,7 @@ icon_state = "carbine" // This isn't a carbine. :T item_state = "z8carbine" wielded_item_state = "z8carbine-wielded" - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY damage_force = 10 caliber = "7.62mm" origin_tech = list(TECH_COMBAT = 8, TECH_MATERIAL = 3) @@ -201,7 +201,7 @@ desc = "A rather traditionally made L6 SAW with a pleasantly lacquered wooden pistol grip. 'Aussec Armoury-2531' is engraved on the reciever. Uses 5.56mm rounds. It's also compatible with magazines from STS-35 assault rifles." icon_state = "l6closed50" item_state = "l6closed" - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY damage_force = 10 slot_flags = 0 max_shells = 50 @@ -330,7 +330,7 @@ desc = "The AS-24 is a rugged looking automatic shotgun produced for the military by Gurov Projectile Weapons LLC. For very obvious reasons, it's illegal to own in many juristictions. Uses 12g rounds." icon_state = "ashot" item_state = "ashot" - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY damage_force = 10 caliber = "12g" origin_tech = list(TECH_COMBAT = 6, TECH_MATERIAL = 1, TECH_ILLEGAL = 4) @@ -363,7 +363,7 @@ name = "\improper Uzi" desc = "The iconic Uzi is a lightweight, compact, fast firing machine pistol. Cybersun Industries were the last major manufacturer of these designs, which have changed little since the 20th century. Uses .45 rounds." icon_state = "mini-uzi" - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL load_method = MAGAZINE caliber = ".45" origin_tech = list(TECH_COMBAT = 5, TECH_MATERIAL = 2, TECH_ILLEGAL = 5) @@ -415,7 +415,7 @@ desc = "The H90K is a compact, large capacity submachine gun produced by Hephaestus Industries. Despite its fierce reputation, it still manages to feel like a toy. Uses 5.7x28mm rounds." icon_state = "p90smg" item_state = "p90" - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL caliber = "5.7x28mm" fire_sound = 'sound/weapons/gunshot/gunshot_uzi.wav' origin_tech = list(TECH_COMBAT = 5, TECH_MATERIAL = 2) @@ -449,7 +449,7 @@ name = "\improper Tommy Gun" desc = "This weapon was made famous by gangsters in the 20th century. Cybersun Industries is currently reproducing these for a target market of historic gun collectors and classy criminals. Uses .45 rounds." icon_state = "tommygun" - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL caliber = ".45" origin_tech = list(TECH_COMBAT = 5, TECH_MATERIAL = 2, TECH_ILLEGAL = 5) slot_flags = SLOT_BELT // ToDo: Belt sprite. @@ -472,7 +472,7 @@ desc = "The bullpup configured GP3000 is a battle rifle produced by Gurov Projectile Weapons LLC. It is sold almost exclusively to standing armies. Uses 7.62mm rounds." icon_state = "bullpup-small" item_state = "bullpup" - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY damage_force = 10 caliber = "7.62mm" origin_tech = list(TECH_COMBAT = 6, TECH_MATERIAL = 1, TECH_ILLEGAL = 4) @@ -503,7 +503,7 @@ desc = "A 20th century Assault Rifle originally designed by Fabrique National. Famous for its use by mercs in grinding proxy wars in backwater nations. This reproduction was probably made for similar purposes." icon_state = "fal" item_state = "fal" - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY damage_force = 10 caliber = "7.62mm" origin_tech = list(TECH_COMBAT = 6, TECH_MATERIAL = 1, TECH_ILLEGAL = 4) @@ -532,7 +532,7 @@ icon_state = "automat" item_state = "automat" fire_anim = "automat_fire" - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY damage_force = 10 caliber = "7.62mm" heavy = TRUE @@ -564,7 +564,7 @@ desc = "Based off of an ancient design, this hand crafted weapon has been gilded with the gold of melted icons and inscribed with sacred runes and hexagrammic wards. Works best with blessed 12g rounds." icon_state = "holyshotgun" item_state = "holy_shot" - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY heavy = TRUE damage_force = 10 caliber = "12g" @@ -596,7 +596,7 @@ icon_state = "clownrifle" item_state = "clownrifle" wielded_item_state = "clownrifle_wielded" - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY heavy = TRUE damage_force = 10 caliber = "organic" @@ -653,7 +653,7 @@ desc = "The compact NT-SMG-8 'Harpy' submachine gun was designed for NanoTrasen special operations where close-quarters combat is likely. Chambered in 5.7x28mm with three fire modes, this gun is lethal to soft and armored targets alike." icon_state = "combatsmg" item_state = "combatsmg" - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL caliber = "5.7x28mm" fire_sound = 'sound/weapons/gunshot/gunshot_uzi.wav' origin_tech = list(TECH_COMBAT = 6, TECH_MATERIAL = 2) diff --git a/code/modules/projectiles/guns/projectile/boltaction.dm b/code/modules/projectiles/guns/projectile/boltaction.dm index 91c24e49aaa..aa7f9d1fbda 100644 --- a/code/modules/projectiles/guns/projectile/boltaction.dm +++ b/code/modules/projectiles/guns/projectile/boltaction.dm @@ -49,7 +49,7 @@ // Stole hacky terrible code from doublebarrel shotgun. -Spades /obj/item/gun/ballistic/shotgun/pump/rifle/ceremonial/attackby(var/obj/item/A as obj, mob/user as mob) - if(istype(A, /obj/item/surgical/circular_saw) || istype(A, /obj/item/melee/energy) || istype(A, /obj/item/pickaxe/plasmacutter) && w_class != ITEMSIZE_NORMAL) + if(istype(A, /obj/item/surgical/circular_saw) || istype(A, /obj/item/melee/energy) || istype(A, /obj/item/pickaxe/plasmacutter) && w_class != WEIGHT_CLASS_NORMAL) to_chat(user, "You begin to shorten the barrel and stock of \the [src].") if(loaded.len) afterattack(user, user) @@ -58,7 +58,7 @@ return if(do_after(user, 30)) icon_state = "sawnrifle" - w_class = ITEMSIZE_NORMAL + set_weight_class(WEIGHT_CLASS_NORMAL) recoil = 2 // Owch accuracy = -15 // You know damn well why. item_state = "gun" @@ -89,7 +89,7 @@ holy = TRUE /obj/item/gun/ballistic/shotgun/pump/rifle/lever/attackby(var/obj/item/A as obj, mob/user as mob) - if(istype(A, /obj/item/surgical/circular_saw) || istype(A, /obj/item/melee/energy) || istype(A, /obj/item/pickaxe/plasmacutter) && w_class != ITEMSIZE_NORMAL) + if(istype(A, /obj/item/surgical/circular_saw) || istype(A, /obj/item/melee/energy) || istype(A, /obj/item/pickaxe/plasmacutter) && w_class != WEIGHT_CLASS_NORMAL) to_chat(user, "You begin to shorten the barrel and stock of \the [src].") if(loaded.len) afterattack(user, user) @@ -99,7 +99,7 @@ if(do_after(user, 30)) item_state = "mareleg" icon_state = "mareleg" - w_class = ITEMSIZE_NORMAL + set_weight_class(WEIGHT_CLASS_NORMAL) caliber = ".357" load_method = SINGLE_CASING ammo_type = /obj/item/ammo_casing/a357 @@ -133,7 +133,7 @@ holy = TRUE /obj/item/gun/ballistic/shotgun/pump/rifle/lever/vintage/attackby(var/obj/item/A as obj, mob/user as mob) - if(istype(A, /obj/item/surgical/circular_saw) || istype(A, /obj/item/melee/energy) || istype(A, /obj/item/pickaxe/plasmacutter) && w_class != ITEMSIZE_NORMAL) + if(istype(A, /obj/item/surgical/circular_saw) || istype(A, /obj/item/melee/energy) || istype(A, /obj/item/pickaxe/plasmacutter) && w_class != WEIGHT_CLASS_NORMAL) to_chat(user, "You begin to shorten the barrel and stock of \the [src].") if(loaded.len) afterattack(user, user) @@ -143,7 +143,7 @@ if(do_after(user, 30)) item_state = "mareleg" icon_state = "mareleg" - w_class = ITEMSIZE_NORMAL + set_weight_class(WEIGHT_CLASS_NORMAL) caliber = ".44" load_method = SINGLE_CASING ammo_type = /obj/item/ammo_casing/a44 @@ -207,7 +207,7 @@ load_method = SINGLE_CASING|SPEEDLOADER action_sound = 'sound/weapons/riflebolt.ogg' pin = /obj/item/firing_pin/explorer - w_class = ITEMSIZE_HUGE // So it can't fit in a backpack. + w_class = WEIGHT_CLASS_HUGE // So it can't fit in a backpack. ammo_type = /obj/item/ammo_casing/a762/sniperhunter accuracy = 50 //Forced missing fucking sucks ass scoped_accuracy = 100 diff --git a/code/modules/projectiles/guns/projectile/bow.dm b/code/modules/projectiles/guns/projectile/bow.dm index 72e0d2676d4..397abce2ee4 100644 --- a/code/modules/projectiles/guns/projectile/bow.dm +++ b/code/modules/projectiles/guns/projectile/bow.dm @@ -3,7 +3,7 @@ desc = "Some sort of primitive projectile weapon. Used to fire arrows." icon_state = "bow" item_state = "bow" - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY damage_force = 5 load_method = SINGLE_CASING caliber = "arrow" diff --git a/code/modules/projectiles/guns/projectile/caseless.dm b/code/modules/projectiles/guns/projectile/caseless.dm index d5ffb5a9b92..074c35783df 100644 --- a/code/modules/projectiles/guns/projectile/caseless.dm +++ b/code/modules/projectiles/guns/projectile/caseless.dm @@ -3,7 +3,7 @@ desc = "This experimental rifle is the efforts of NanoTrasen's R&D division, made manifest. Uses 5mm solid-phoron caseless rounds, obviously." icon_state = "caseless" item_state = "caseless" - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY caliber = "5mm caseless" origin_tech = list(TECH_COMBAT = 2, TECH_MATERIAL = 3) slot_flags = SLOT_BACK @@ -27,7 +27,7 @@ desc = "A relic dating back to the Xenomorph Wars and the former primary battle rifle of the United Solar Marine Corps. Loads using 10x24mm caseless Magazines" icon_state = "usmc" item_state = "usmc" - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY caliber = "10mmCL" origin_tech = list(TECH_COMBAT = 4, TECH_MATERIAL = 3) slot_flags = SLOT_BACK diff --git a/code/modules/projectiles/guns/projectile/musket.dm b/code/modules/projectiles/guns/projectile/musket.dm index 988921b651b..78d65cdbeb9 100644 --- a/code/modules/projectiles/guns/projectile/musket.dm +++ b/code/modules/projectiles/guns/projectile/musket.dm @@ -14,7 +14,7 @@ caliber = "musket" slot_flags = SLOT_BACK - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY one_handed_penalty = 30 //You should really use both hands origin_tech = list(TECH_COMBAT = 3, TECH_MATERIAL = 2) @@ -66,7 +66,7 @@ desc = "An ivory container for gunpowder." icon = 'icons/obj/ammo.dmi' icon_state = "powderhorn" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL slot_flags = SLOT_BELT amount_per_transfer_from_this = 5 possible_transfer_amounts = list(5) @@ -117,7 +117,7 @@ wielded_item_state = null slot_flags = SLOT_BELT|SLOT_HOLSTER - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL one_handed_penalty = 0 /obj/item/gun/ballistic/musket/pistol/brass diff --git a/code/modules/projectiles/guns/projectile/pistol.dm b/code/modules/projectiles/guns/projectile/pistol.dm index 60937dda482..8be8e0ba5dd 100644 --- a/code/modules/projectiles/guns/projectile/pistol.dm +++ b/code/modules/projectiles/guns/projectile/pistol.dm @@ -105,7 +105,7 @@ name = "silenced pistol" desc = "A small, quiet, easily concealable gun. Uses .45 rounds." icon_state = "silenced_pistol" - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL caliber = ".45" silenced = 1 fire_delay = 1 @@ -190,7 +190,7 @@ description_fluff = "The Lumoco Arms P3 Whisper is a compact, easily concealable gun. Designed by GMC as a simplified improvement to the Konigin, the Whisper comes with a threaded barrel and slender profile. This weapon was favored by Syndicate special operatives during the Phoron War, and retains a somewhat sinister reputation to this day. Due to its slim design it is only compatible with compact 9mm magazines." icon_state = "pistol" item_state = null - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL caliber = "9mm" suppressible = TRUE silenced_icon = "pistol_silencer" @@ -209,7 +209,7 @@ desc = "a silencer" icon = 'icons/obj/gun/ballistic.dmi' icon_state = "silencer" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL /obj/item/gun/ballistic/pirate name = "zip gun" @@ -284,7 +284,7 @@ desc = "It's not size of your gun that matters, just the size of your load. Uses .357 rounds." //OHHH MYYY~ icon_state = "derringer" item_state = "concealed" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL origin_tech = list(TECH_COMBAT = 2, TECH_MATERIAL = 2, TECH_ILLEGAL = 3) handle_casings = CYCLE_CASINGS //player has to take the old casing out manually before reloading load_method = SINGLE_CASING @@ -360,7 +360,7 @@ item_state = "revolver" caliber = "organic" load_method = MAGAZINE - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL origin_tech = list(TECH_COMBAT = 2, TECH_MATERIAL = 2, TECH_ILLEGAL = 3) magazine_type = /obj/item/ammo_magazine/mcompressedbio/compact allowed_magazines = list(/obj/item/ammo_magazine/mcompressedbio/compact) @@ -373,7 +373,7 @@ description_fluff = "Originally produced in 2463 by GMC, the Konigin is considered to be the direct ancestor to the P3 Whisper. Considerably more expensive to manufacture and maintain, the Konigin saw limited use outside of Syndicate special operations cells. By the time GMC ended production of the Konigin-63, the weapon had undergone significant design changes - most notably the installment of a single capacity underbarrel shotgun. This rare design is certainly inspired, and has become something of a collector's item post-war." icon_state = "konigin" item_state = null - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL caliber = "9mm" suppressible = TRUE silenced_icon = "konigin_silencer" @@ -456,7 +456,7 @@ /obj/item/gun/ballistic/ntles/attack_self(mob/user, obj/item/gun/G) if(collapsible && !extended) to_chat(user, "You pull out the stock on the [src], steadying the weapon.") - w_class = ITEMSIZE_LARGE + set_weight_class(WEIGHT_CLASS_BULKY) one_handed_penalty = 10 extended = 1 update_icon() @@ -465,7 +465,7 @@ return else to_chat(user, "You push the stock back into the [src], making it more compact.") - w_class = ITEMSIZE_NORMAL + set_weight_class(WEIGHT_CLASS_NORMAL) one_handed_penalty = 30 extended = 0 update_icon() @@ -480,7 +480,7 @@ item_state = "pistol" caliber = "5.7x28mm" load_method = MAGAZINE - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL origin_tech = list(TECH_COMBAT = 3, TECH_MATERIAL = 2) magazine_type = /obj/item/ammo_magazine/m57x28mm/fiveseven allowed_magazines = list(/obj/item/ammo_magazine/m57x28mm/fiveseven) @@ -499,7 +499,7 @@ item_state = "florayield" caliber = "apidean" load_method = MAGAZINE - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL origin_tech = list(TECH_COMBAT = 4, TECH_MATERIAL = 2, TECH_BIO = 5) magazine_type = /obj/item/ammo_magazine/biovial allowed_magazines = list(/obj/item/ammo_magazine/biovial) @@ -516,7 +516,7 @@ icon_state = "junker_pistol" item_state = "revolver" load_method = SINGLE_CASING - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL origin_tech = list(TECH_COMBAT = 2, TECH_MATERIAL = 2, TECH_ILLEGAL = 3) recoil = 3 handle_casings = CYCLE_CASINGS @@ -529,7 +529,7 @@ icon = 'icons/obj/toy.dmi' icon_state = "toy_pistol" item_state = null - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL caliber = "foamdart" load_method = MAGAZINE magazine_type = /obj/item/ammo_magazine/mfoam/pistol @@ -547,4 +547,4 @@ /obj/item/gun/ballistic/pistol/foam/magnum name = "toy automag" icon_state = "toy_pistol_orange" - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL diff --git a/code/modules/projectiles/guns/projectile/rocket.dm b/code/modules/projectiles/guns/projectile/rocket.dm index d4c5724ef69..9e58df29ac5 100644 --- a/code/modules/projectiles/guns/projectile/rocket.dm +++ b/code/modules/projectiles/guns/projectile/rocket.dm @@ -6,7 +6,7 @@ caliber = "rocket" max_shells = 1 load_method = SINGLE_CASING - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY heavy = TRUE throw_speed = 2 throw_range = 10 @@ -69,7 +69,7 @@ desc = "A single use rocket launcher designed with portability in mind. This disposable launcher must be extended before it can fire." icon_state = "missile" item_state = "missile" - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL slot_flags = SLOT_BELT handle_casings = HOLD_CASINGS ammo_type = /obj/item/ammo_casing/rocket diff --git a/code/modules/projectiles/guns/projectile/semiauto.dm b/code/modules/projectiles/guns/projectile/semiauto.dm index 93ca779b858..f69d83c0caa 100644 --- a/code/modules/projectiles/guns/projectile/semiauto.dm +++ b/code/modules/projectiles/guns/projectile/semiauto.dm @@ -3,7 +3,7 @@ desc = "This is the vintage semi-automatic rifle that famously helped win the second World War on ancient Terra. Another Cybersun Industries reproduction, the blueprints have since proliferated through the exonet, with most back-alley flash-forges creating their own variations of the iconic rifle." icon_state = "garand" item_state = "boltaction" - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY heavy = TRUE caliber = "7.62mm" origin_tech = list(TECH_COMBAT = 2, TECH_MATERIAL = 2) @@ -29,7 +29,7 @@ icon_state = "sgarand" pin = /obj/item/firing_pin/explorer magazine_type = /obj/item/ammo_magazine/m762garand/sniperhunter - w_class = ITEMSIZE_HUGE // We don't need this fitting in backpacks. + w_class = WEIGHT_CLASS_HUGE // We don't need this fitting in backpacks. accuracy = 70 //Forced missing fucking sucks ass scoped_accuracy = 100 @@ -45,7 +45,7 @@ desc = "A biotechnological marvel, this living rifle can grow its ammo when provided with liquified wax. It fires poisonous bolts of barbed chitin." icon_state = "apigun" item_state = "speargun" - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY heavy = TRUE caliber = "apidean" origin_tech = list(TECH_COMBAT = 5, TECH_MATERIAL = 3, TECH_BIO = 7) diff --git a/code/modules/projectiles/guns/projectile/shotgun.dm b/code/modules/projectiles/guns/projectile/shotgun.dm index b4470ed5d97..1d40202a040 100644 --- a/code/modules/projectiles/guns/projectile/shotgun.dm +++ b/code/modules/projectiles/guns/projectile/shotgun.dm @@ -4,7 +4,7 @@ icon_state = "shotgun" item_state = "shotgun" max_shells = 4 - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY heavy = TRUE damage_force = 10 slot_flags = SLOT_BACK @@ -76,7 +76,7 @@ desc = "A heavily modified Hephaestus Industries KS-40. This version bears multiple after-market mods, including a laser sight to help compensate for its shortened stock. 'Property of the Warden' has been etched into the side of the reciever. Uses 12g rounds." icon_state = "shotgun_w" slot_flags = SLOT_BELT|SLOT_BACK - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL ammo_type = /obj/item/ammo_casing/a12g/beanbag /obj/item/gun/ballistic/shotgun/pump/combat/warden/verb/rename_gun() @@ -153,7 +153,7 @@ load_method = SINGLE_CASING|SPEEDLOADER handle_casings = CYCLE_CASINGS max_shells = 2 - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY heavy = TRUE damage_force = 10 slot_flags = SLOT_BACK @@ -198,7 +198,7 @@ if(do_after(user, 30)) //SHIT IS STEALTHY EYYYYY icon_state = "sawnshotgun" item_state = "sawnshotgun" - w_class = ITEMSIZE_NORMAL + set_weight_class(WEIGHT_CLASS_NORMAL) damage_force = 5 slot_flags &= ~SLOT_BACK //you can't sling it on your back slot_flags |= (SLOT_BELT|SLOT_HOLSTER) //but you can wear it on your belt (poorly concealed under a trenchcoat, ideally) - or in a holster, why not. @@ -217,7 +217,7 @@ accuracy = 40 slot_flags = SLOT_BELT|SLOT_HOLSTER ammo_type = /obj/item/ammo_casing/a12g/pellet - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL damage_force = 5 one_handed_penalty = 5 @@ -238,7 +238,7 @@ load_method = SINGLE_CASING|SPEEDLOADER handle_casings = CYCLE_CASINGS max_shells = 4 - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY damage_force = 5 accuracy = 40 slot_flags = SLOT_BACK @@ -263,7 +263,7 @@ accuracy = 80 slot_flags = SLOT_BELT|SLOT_HOLSTER ammo_type = /obj/item/ammo_casing/a10g/silver - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL safety_state = GUN_SAFETY_OFF damage_force = 15 @@ -276,7 +276,7 @@ load_method = SINGLE_CASING handle_casings = CYCLE_CASINGS max_shells = 1 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL damage_force = 5 slot_flags = SLOT_BELT caliber = "12g" @@ -312,7 +312,7 @@ handle_casings = CYCLE_CASINGS ammo_type = /obj/item/ammo_casing/a12g/silver max_shells = 1 - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY damage_force = 25 slot_flags = SLOT_BACK origin_tech = list(TECH_COMBAT = 4, TECH_MATERIAL = 2, TECH_OCCULT = 1) @@ -328,7 +328,7 @@ load_method = SINGLE_CASING handle_casings = CYCLE_CASINGS max_shells = 1 - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY caliber = "12g" ammo_type = /obj/item/ammo_casing/a12g one_handed_penalty = 0 diff --git a/code/modules/projectiles/guns/projectile/sniper.dm b/code/modules/projectiles/guns/projectile/sniper.dm index ce6938c6904..cc90ae00536 100644 --- a/code/modules/projectiles/guns/projectile/sniper.dm +++ b/code/modules/projectiles/guns/projectile/sniper.dm @@ -6,7 +6,7 @@ icon_state = "heavysniper" item_state = "heavysniper" item_state_slots = list(SLOT_ID_RIGHT_HAND = "l6closed-empty", SLOT_ID_LEFT_HAND = "l6closed-empty") // placeholder - w_class = ITEMSIZE_HUGE // So it can't fit in a backpack. + w_class = WEIGHT_CLASS_HUGE // So it can't fit in a backpack. damage_force = 10 heavy = TRUE slot_flags = SLOT_BACK @@ -82,7 +82,7 @@ desc = "The SVD, also known as the Dragunov, is mass produced with an Optical Sniper Sight so simple that even Ivan can use it. Too bad for you that the inscriptions are written in Russian. Uses 7.62mm rounds." icon_state = "SVD" item_state = "SVD" - w_class = ITEMSIZE_HUGE // So it can't fit in a backpack. + w_class = WEIGHT_CLASS_HUGE // So it can't fit in a backpack. damage_force = 10 slot_flags = SLOT_BACK // Needs a sprite. origin_tech = list(TECH_COMBAT = 8, TECH_MATERIAL = 2, TECH_ILLEGAL = 8) diff --git a/code/modules/projectiles/guns/projectile/sniper/collapsible_sniper.dm b/code/modules/projectiles/guns/projectile/sniper/collapsible_sniper.dm index 3828b61bb9b..ff68d4742f1 100644 --- a/code/modules/projectiles/guns/projectile/sniper/collapsible_sniper.dm +++ b/code/modules/projectiles/guns/projectile/sniper/collapsible_sniper.dm @@ -34,7 +34,7 @@ name = "AM rifle part" desc = "A part of an antimateriel rifle." - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL icon = 'icons/obj/gun/ballistic.dmi' @@ -149,7 +149,7 @@ switch(part_count) if(1) name = initial(name) - w_class = ITEMSIZE_NORMAL + set_weight_class(WEIGHT_CLASS_NORMAL) icon_state = initial(icon_state) if(2) if(barrel && trigger_group) @@ -161,7 +161,7 @@ else if(stock && barrel) name = "AM rifle stock-barrel assembly" icon_state = "heavysniper-barstock" - w_class = ITEMSIZE_LARGE + set_weight_class(WEIGHT_CLASS_BULKY) if(3) var/obj/item/gun/ballistic/heavysniper/collapsible/gun = new (get_turf(src), 0) diff --git a/code/modules/projectiles/guns/vox.dm b/code/modules/projectiles/guns/vox.dm index 57015f7d12a..53f3c262bc7 100644 --- a/code/modules/projectiles/guns/vox.dm +++ b/code/modules/projectiles/guns/vox.dm @@ -57,7 +57,7 @@ desc = "A vicious alien beam weapon. Parts of it quiver gelatinously, as though the thing is insectile and alive." icon_state = "darkcannon" item_state = "darkcannon" - w_class = ITEMSIZE_HUGE + w_class = WEIGHT_CLASS_HUGE heavy = TRUE charge_cost = 300 projectile_type = /obj/projectile/beam/stun/darkmatter @@ -121,7 +121,7 @@ desc = "A vicious alien sound weapon. Parts of it quiver gelatinously, as though the thing is insectile and alive." icon_state = "noise" item_state = "noise" - w_class = ITEMSIZE_HUGE + w_class = WEIGHT_CLASS_HUGE heavy = TRUE cell_type = /obj/item/cell/device/weapon/recharge battery_lock = 1 diff --git a/code/modules/projectiles/magazines/magazine.dm b/code/modules/projectiles/magazines/magazine.dm index 307d7beb9f7..8a5326dc009 100644 --- a/code/modules/projectiles/magazines/magazine.dm +++ b/code/modules/projectiles/magazines/magazine.dm @@ -9,7 +9,7 @@ item_state = "syringe_kit" materials_base = list(MAT_STEEL = 500) throw_force = 5 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL throw_speed = 4 throw_range = 10 preserve_item = 1 diff --git a/code/modules/projectiles/magazines/unsorted.dm b/code/modules/projectiles/magazines/unsorted.dm index 958111cd3c6..783a94ddcb0 100644 --- a/code/modules/projectiles/magazines/unsorted.dm +++ b/code/modules/projectiles/magazines/unsorted.dm @@ -150,7 +150,7 @@ /obj/item/ammo_magazine/m45tommydrum name = "Tommy Gun drum magazine (.45)" icon_state = "tommy-drum" - w_class = ITEMSIZE_NORMAL // Bulky ammo doesn't fit in your pockets! + w_class = WEIGHT_CLASS_NORMAL // Bulky ammo doesn't fit in your pockets! mag_type = MAGAZINE ammo_type = /obj/item/ammo_casing/a45 materials_base = list(MAT_STEEL = 3750) @@ -231,7 +231,7 @@ ammo_type = /obj/item/ammo_casing/a10x24mmcaseless icon_state = "usmc-large" caliber = "10mmCL" - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL materials_base = list(MAT_STEEL = 8500) mag_type = MAGAZINE max_ammo = 96 @@ -745,7 +745,7 @@ caliber = "5.56mm" materials_base = list(MAT_STEEL = 10000) ammo_type = /obj/item/ammo_casing/a556 - w_class = ITEMSIZE_NORMAL // This should NOT fit in your pocket!! + w_class = WEIGHT_CLASS_NORMAL // This should NOT fit in your pocket!! max_ammo = 50 multiple_sprites = 1 @@ -931,7 +931,7 @@ caliber = "7.62mm" materials_base = list(MAT_STEEL = 10000) ammo_type = /obj/item/ammo_casing/a762 - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL max_ammo = 50 multiple_sprites = 1 @@ -1146,7 +1146,7 @@ desc = "A heavy plastic box designed to hold belts of foam darts! Wow!" icon_state = "toy_lmg" materials_base = list(MAT_PLASTIC = 10000) - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL max_ammo = 50 /obj/item/ammo_magazine/mfoam/lmg/empty diff --git a/code/modules/projectiles/unsorted/magnetic.dm b/code/modules/projectiles/unsorted/magnetic.dm index c40c16284fc..fb3cecc666e 100644 --- a/code/modules/projectiles/unsorted/magnetic.dm +++ b/code/modules/projectiles/unsorted/magnetic.dm @@ -3,7 +3,7 @@ desc = "A magazine containing steel flechettes." icon = 'icons/obj/ammo.dmi' icon_state = "5.56" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL materials_base = list(MAT_STEEL = 1800) origin_tech = list(TECH_COMBAT = 1) var/remaining = 9 diff --git a/code/modules/reagents/chemistry/machinery.dm b/code/modules/reagents/chemistry/machinery.dm index 665f7952143..dd419177441 100644 --- a/code/modules/reagents/chemistry/machinery.dm +++ b/code/modules/reagents/chemistry/machinery.dm @@ -110,7 +110,7 @@ if(!G.reagents || !G.reagents.total_volume) continue failed = 0 - bag.remove_from_storage(G, src) + bag.obj_storage.remove(G, src) holdingitems += G if(holdingitems && holdingitems.len >= limit) break diff --git a/code/modules/reagents/machinery/chem_master.dm b/code/modules/reagents/machinery/chem_master.dm index 7e3150abd0a..e4f0cd7fd7b 100644 --- a/code/modules/reagents/machinery/chem_master.dm +++ b/code/modules/reagents/machinery/chem_master.dm @@ -235,7 +235,7 @@ data["is_pill_bottle_loaded"] = pill_bottle ? TRUE : FALSE if(pill_bottle) data["pill_bottle_current_amount"] = pill_bottle.contents.len - data["pill_bottle_max_amount"] = pill_bottle.max_storage_space + data["pill_bottle_max_amount"] = pill_bottle.max_combined_volume data["is_beaker_loaded"] = beaker ? TRUE : FALSE data["beaker_current_volume"] = beaker ? round(beaker.reagents.total_volume, 0.01) : null @@ -402,8 +402,8 @@ var/target_loc = drop_location() var/drop_threshold = INFINITY if(pill_bottle) - if(pill_bottle.max_storage_space) - drop_threshold = pill_bottle.max_storage_space - pill_bottle.contents.len + if(pill_bottle.max_combined_volume) + drop_threshold = pill_bottle.max_combined_volume - pill_bottle.contents.len target_loc = pill_bottle for(var/i in 1 to amount) if(i-1 < drop_threshold) diff --git a/code/modules/reagents/reagent_containers.dm b/code/modules/reagents/reagent_containers.dm index af41dc77a88..38fecf0e79d 100644 --- a/code/modules/reagents/reagent_containers.dm +++ b/code/modules/reagents/reagent_containers.dm @@ -3,7 +3,7 @@ desc = "..." icon = 'icons/obj/medical/chemical.dmi' icon_state = null - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL item_flags = ITEM_CAREFUL_BLUDGEON | ITEM_ENCUMBERS_WHILE_HELD /// start reagent list. overrides reagent/volume. list(id = volume); volume must be specified. diff --git a/code/modules/reagents/reagent_containers/dropper.dm b/code/modules/reagents/reagent_containers/dropper.dm index 4a4ef15774d..9d911d7b0e3 100644 --- a/code/modules/reagents/reagent_containers/dropper.dm +++ b/code/modules/reagents/reagent_containers/dropper.dm @@ -8,7 +8,7 @@ icon_state = "dropper0" amount_per_transfer_from_this = 5 possible_transfer_amounts = list(1,2,3,4,5) - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY slot_flags = SLOT_EARS volume = 5 drop_sound = 'sound/items/drop/glass.ogg' diff --git a/code/modules/reagents/reagent_containers/glass.dm b/code/modules/reagents/reagent_containers/glass.dm index cf2664c9df7..7941d2b5e0c 100644 --- a/code/modules/reagents/reagent_containers/glass.dm +++ b/code/modules/reagents/reagent_containers/glass.dm @@ -13,7 +13,7 @@ amount_per_transfer_from_this = 10 possible_transfer_amounts = list(5,10,15,25,30,60) volume = 60 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL atom_flags = OPENCONTAINER | NOCONDUCT integrity_flags = INTEGRITY_ACIDPROOF drop_sound = 'sound/items/drop/bottle.ogg' @@ -126,7 +126,7 @@ ..() if(istype(W,/obj/item/reagent_containers/glass) || istype(W,/obj/item/reagent_containers/food/drinks) || istype(W,/obj/item/reagent_containers/food/condiment)) return - if(W && W.w_class <= w_class && (atom_flags & OPENCONTAINER)) + if(W && W.get_weight_class() <= get_weight_class() && (atom_flags & OPENCONTAINER)) to_chat(user, "You dip \the [W] into \the [src].") reagents.touch_obj(W, reagents.total_volume) @@ -247,7 +247,7 @@ base_icon_state = "vial" materials_base = list(MAT_GLASS = 250) volume = 30 - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY amount_per_transfer_from_this = 10 possible_transfer_amounts = list(5,10,15,30) atom_flags = OPENCONTAINER @@ -269,7 +269,7 @@ base_icon_state = "bucket" item_state = "bucket" materials_base = list(MAT_STEEL = 200) - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL amount_per_transfer_from_this = 20 possible_transfer_amounts = list(10,20,30,60,120) volume = 120 @@ -331,7 +331,7 @@ base_icon_state = "woodbucket" item_state = "woodbucket" materials_base = list(MAT_WOOD = 50) - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY amount_per_transfer_from_this = 20 possible_transfer_amounts = list(10,20,30,60,120) volume = 120 @@ -368,7 +368,7 @@ base_icon_state = "sandbucket" item_state = "woodbucket" materials_base = list("sandstone" = 50) - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY integrity_flags = INTEGRITY_ACIDPROOF /obj/item/reagent_containers/glass/bucket/sandstone/examine(mob/user, dist) @@ -401,7 +401,7 @@ icon_state = "water_cooler_bottle" base_icon_state = "water_cooler_bottle" materials_base = list(MAT_GLASS = 2000) - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL amount_per_transfer_from_this = 20 possible_transfer_amounts = list(10,20,30,60,120) volume = 120 @@ -414,7 +414,7 @@ icon_state = "portable_fuelcan" base_icon_state = "portable_fuelcan" materials_base = list("metal" = 2000) - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL amount_per_transfer_from_this = 10 possible_transfer_amounts = list(10,20,50,100) volume = 60 @@ -443,7 +443,7 @@ icon_state = "portable_fuelcan_tiny" base_icon_state = "portable_fuelcan_tiny" materials_base = list("metal" = 500) - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY volume = 20 /obj/item/reagent_containers/glass/stone diff --git a/code/modules/reagents/reagent_containers/organic.dm b/code/modules/reagents/reagent_containers/organic.dm index 66022b35f6b..71e56dfe8d3 100644 --- a/code/modules/reagents/reagent_containers/organic.dm +++ b/code/modules/reagents/reagent_containers/organic.dm @@ -10,7 +10,7 @@ amount_per_transfer_from_this = 10 possible_transfer_amounts = list(5,10,15,25,30,60) volume = 60 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL atom_flags = NOCONDUCT drop_sound = 'sound/effects/splat.ogg' pickup_sound = 'sound/effects/squelch1.ogg' @@ -133,7 +133,7 @@ ..() if(istype(W,/obj/item/reagent_containers/glass) || istype(W,/obj/item/reagent_containers/food/drinks) || istype(W,/obj/item/reagent_containers/food/condiment)) return - if(W && W.w_class <= w_class && (atom_flags & OPENCONTAINER)) + if(W && W.get_weight_class() <= get_weight_class() && (atom_flags & OPENCONTAINER)) to_chat(user, "You dip \the [W] into \the [src].") reagents.touch_obj(W, reagents.total_volume) @@ -155,7 +155,7 @@ icon_state = "waxcomb" materials_base = list("wax" = 100) volume = 30 - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY amount_per_transfer_from_this = 10 possible_transfer_amounts = list(5,10,15,30) prefill = list("honey" = 30) @@ -166,7 +166,7 @@ icon_state = "waxcomb" materials_base = list("wax" = 100) volume = 30 - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY amount_per_transfer_from_this = 10 possible_transfer_amounts = list(5,10,15,30) prefill = list("cherryjelly" = 30) diff --git a/code/modules/reagents/reagent_containers/patch.dm b/code/modules/reagents/reagent_containers/patch.dm index 073f1e90f28..3530d1e47df 100644 --- a/code/modules/reagents/reagent_containers/patch.dm +++ b/code/modules/reagents/reagent_containers/patch.dm @@ -12,7 +12,7 @@ item_state = "pill" possible_transfer_amounts = null - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY slot_flags = SLOT_EARS volume = 60 diff --git a/code/modules/reagents/reagent_containers/pill.dm b/code/modules/reagents/reagent_containers/pill.dm index 411831fdeeb..110bcd446f9 100644 --- a/code/modules/reagents/reagent_containers/pill.dm +++ b/code/modules/reagents/reagent_containers/pill.dm @@ -13,7 +13,7 @@ rad_flags = RAD_NO_CONTAMINATE possible_transfer_amounts = null - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY slot_flags = SLOT_EARS volume = 60 @@ -21,12 +21,24 @@ var/rename_with_volume = FALSE /obj/item/reagent_containers/pill/Initialize(mapload) + randomize_pixel_offsets() . = ..() if(!icon_state) icon_state = "pill[rand(1,20)]" if(reagents.total_volume && rename_with_volume) name += " ([reagents.total_volume]u)" +/obj/item/reagent_containers/pill/dropped(mob/user, flags, atom/newLoc) + . = ..() + if(. != NONE) + return + randomize_pixel_offsets() + +// todo: generic /obj/item pixel randomization +// todo: randomization must be called **before** ..() on initialize. +/obj/item/reagent_containers/pill/proc/randomize_pixel_offsets() + set_pixel_offsets(rand(-10, 10), rand(-10, 10)) + /obj/item/reagent_containers/pill/attack_mob(mob/target, mob/user, clickchain_flags, list/params, mult, target_zone, intent) if(target == user) if(istype(target, /mob/living/carbon/human)) diff --git a/code/modules/reagents/reagent_containers/spray.dm b/code/modules/reagents/reagent_containers/spray.dm index 7a5728e1bd4..29737d933e8 100644 --- a/code/modules/reagents/reagent_containers/spray.dm +++ b/code/modules/reagents/reagent_containers/spray.dm @@ -8,7 +8,7 @@ atom_flags = OPENCONTAINER slot_flags = SLOT_BELT | SLOT_HOLSTER throw_force = 3 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL throw_speed = 2 throw_range = 10 amount_per_transfer_from_this = 10 @@ -165,7 +165,7 @@ icon_state = "chemsprayer" item_state = "chemsprayer" throw_force = 3 - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL possible_transfer_amounts = null volume = 600 origin_tech = list(TECH_COMBAT = 3, TECH_MATERIAL = 3, TECH_ENGINEERING = 3) @@ -221,7 +221,7 @@ icon = 'icons/obj/toy.dmi' icon_state = "squirtgun" item_state = "squirtgun" - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL volume = 100 var/pumped = TRUE @@ -249,5 +249,5 @@ icon = 'icons/obj/toy.dmi' icon_state = "squirtgun_nt" item_state = "squirtgun_nt" - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL volume = 101 diff --git a/code/modules/reagents/reagent_containers/syringes.dm b/code/modules/reagents/reagent_containers/syringes.dm index d6ad78fc19b..f77a7896199 100644 --- a/code/modules/reagents/reagent_containers/syringes.dm +++ b/code/modules/reagents/reagent_containers/syringes.dm @@ -12,7 +12,7 @@ amount_per_transfer_from_this = 5 possible_transfer_amounts = null volume = 15 - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY slot_flags = SLOT_EARS sharp = 1 integrity_flags = INTEGRITY_ACIDPROOF diff --git a/code/modules/recycling/disposal.dm b/code/modules/recycling/disposal.dm index 75dc74bfb1b..6dad05b59c6 100644 --- a/code/modules/recycling/disposal.dm +++ b/code/modules/recycling/disposal.dm @@ -109,7 +109,7 @@ var/obj/item/storage/bag/trash/T = I to_chat(user, "You empty the bag.") for(var/obj/item/O in T.contents) - T.remove_from_storage(O,src) + T.obj_storage.remove(O, src) T.update_icon() update() return diff --git a/code/modules/recycling/sortingmachinery.dm b/code/modules/recycling/sortingmachinery.dm index d2627e04d29..7707f196576 100644 --- a/code/modules/recycling/sortingmachinery.dm +++ b/code/modules/recycling/sortingmachinery.dm @@ -228,7 +228,7 @@ name = "package wrapper" icon = 'icons/obj/items.dmi' icon_state = "deliveryPaper" - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL var/amount = 25.0 @@ -258,8 +258,8 @@ user.client.screen -= O P.wrapped = O O.forceMove(P) - P.w_class = O.w_class - var/i = round(O.w_class) + P.set_weight_class(O.w_class) + var/i = round(O.get_weight_class()) if(i in list(1,2,3,4,5)) P.icon_state = "deliverycrate[i]" switch(i) @@ -325,7 +325,7 @@ icon_state = "dest_tagger" var/currTag = 0 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL item_state = "electronic" slot_flags = SLOT_BELT diff --git a/code/modules/research/machinery/destructive_analyzer.dm b/code/modules/research/machinery/destructive_analyzer.dm index 28932afe988..213dd7b6284 100644 --- a/code/modules/research/machinery/destructive_analyzer.dm +++ b/code/modules/research/machinery/destructive_analyzer.dm @@ -87,7 +87,7 @@ Note: Must be placed within 3 tiles of the R&D Console /obj/machinery/r_n_d/destructive_analyzer/MouseDroppedOnLegacy(atom/dropping, mob/living/user) if(istype(dropping, /obj/item/storage/part_replacer)) var/obj/item/storage/part_replacer/replacer = dropping - replacer.hide_from(user) + replacer.hide() if(!linked_console) to_chat(user, "\The [src] must be linked to an R&D console first.") return 0 diff --git a/code/modules/research/research.dm b/code/modules/research/research.dm index bcc958f3b36..266a74d55c3 100644 --- a/code/modules/research/research.dm +++ b/code/modules/research/research.dm @@ -238,7 +238,7 @@ research holder datum. icon = 'icons/obj/cloning.dmi' icon_state = "datadisk2" item_state = "card-id" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL materials_base = list(MAT_STEEL = 30, MAT_GLASS = 10) var/datum/tech/stored @@ -253,7 +253,7 @@ research holder datum. icon = 'icons/obj/cloning.dmi' icon_state = "datadisk2" item_state = "card-id" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL materials_base = list(MAT_STEEL = 30, MAT_GLASS = 10) var/datum/design/blueprint diff --git a/code/modules/resleeving/computers.dm b/code/modules/resleeving/computers.dm index 7b7f1c4af76..6510b5fbdf1 100644 --- a/code/modules/resleeving/computers.dm +++ b/code/modules/resleeving/computers.dm @@ -452,5 +452,5 @@ icon = 'icons/obj/cloning.dmi' icon_state = "harddisk" item_state = "card-id" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL var/list/datum/transhuman/mind_record/stored = list() diff --git a/code/modules/resleeving/implant.dm b/code/modules/resleeving/implant.dm index 3f2ef8c504b..c67e7754ba3 100644 --- a/code/modules/resleeving/implant.dm +++ b/code/modules/resleeving/implant.dm @@ -45,7 +45,7 @@ item_state = "syringe_0" throw_speed = 1 throw_range = 5 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL materials_base = list(MAT_STEEL = 2000, MAT_GLASS = 2000) var/list/obj/item/implant/backup/imps = list() var/max_implants = 4 //Iconstates need to exist due to the update proc! @@ -134,7 +134,7 @@ icon_state = "implant" item_state_slots = list(SLOT_ID_RIGHT_HAND = "syringe_kit", SLOT_ID_LEFT_HAND = "syringe_kit") -/obj/item/storage/box/backup_kit/PopulateContents() +/obj/item/storage/box/backup_kit/legacy_spawn_contents() for(var/i = 1 to 7) new /obj/item/implantcase/backup(src) new /obj/item/implanter(src) diff --git a/code/modules/resleeving/infomorph.dm b/code/modules/resleeving/infomorph.dm index 8813bb8c110..c1461ace1e6 100644 --- a/code/modules/resleeving/infomorph.dm +++ b/code/modules/resleeving/infomorph.dm @@ -25,7 +25,7 @@ var/list/infomorph_emotions = list( pass_flags = 1 mob_size = MOB_SMALL - can_pull_size = ITEMSIZE_SMALL + can_pull_size = WEIGHT_CLASS_SMALL can_pull_mobs = MOB_PULL_SMALLER idcard_type = /obj/item/card/id diff --git a/code/modules/resleeving/mirror.dm b/code/modules/resleeving/mirror.dm index b3fe4988ed7..7eb6640b8a9 100644 --- a/code/modules/resleeving/mirror.dm +++ b/code/modules/resleeving/mirror.dm @@ -102,7 +102,7 @@ item_state = "healthanalyzer" slot_flags = SLOT_BELT throw_force = 3 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL throw_speed = 5 throw_range = 10 materials_base = list(MAT_STEEL = 200) @@ -117,7 +117,7 @@ item_state = "healthanalyzer" slot_flags = SLOT_BELT throw_force = 3 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL throw_speed = 5 throw_range = 10 materials_base = list(MAT_STEEL = 200) diff --git a/code/modules/resleeving/sleevecard.dm b/code/modules/resleeving/sleevecard.dm index c1d60660886..9661033f504 100644 --- a/code/modules/resleeving/sleevecard.dm +++ b/code/modules/resleeving/sleevecard.dm @@ -11,7 +11,7 @@ icon_state = "pai" item_state = "electronic" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL slot_flags = SLOT_BELT origin_tech = list(TECH_DATA = 2) show_messages = 0 diff --git a/code/modules/shieldgen/handheld_defuser.dm b/code/modules/shieldgen/handheld_defuser.dm index 2c0d19c2b87..2155a022061 100644 --- a/code/modules/shieldgen/handheld_defuser.dm +++ b/code/modules/shieldgen/handheld_defuser.dm @@ -5,7 +5,7 @@ icon = 'icons/obj/machines/shielding.dmi' icon_state = "hdiffuser_off" origin_tech = list(TECH_MAGNET = 5, TECH_POWER = 5, TECH_ILLEGAL = 2) - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL var/obj/item/cell/device/cell = /obj/item/cell/device var/enabled = 0 diff --git a/code/modules/species/species.dm b/code/modules/species/species.dm index aae67534a72..f49084ac816 100644 --- a/code/modules/species/species.dm +++ b/code/modules/species/species.dm @@ -622,7 +622,7 @@ GLOBAL_LIST_INIT(species_oxygen_tank_by_gas, list( else if(synth) new /obj/item/fbp_backup_cell(box) - box.calibrate_size() + box.obj_storage.fit_to_contents(no_shrink = TRUE) if(H.backbag == 1) H.equip_to_slot_or_del(box, /datum/inventory_slot_meta/abstract/hand/right, INV_OP_SILENT | INV_OP_FLUFFLESS) diff --git a/code/modules/species/xenomorphs/alien_facehugger.dm b/code/modules/species/xenomorphs/alien_facehugger.dm index 266abb25745..6d3c82a512c 100644 --- a/code/modules/species/xenomorphs/alien_facehugger.dm +++ b/code/modules/species/xenomorphs/alien_facehugger.dm @@ -84,7 +84,10 @@ var/const/MAX_ACTIVE_TIME = 400 Proximity(null, target) return -/obj/item/clothing/mask/facehugger/on_found(mob/finder as mob) +/obj/item/clothing/mask/facehugger/on_containing_storage_opening(datum/event_args/actor/actor, datum/object_system/storage/storage) + . = ..() + + var/mob/finder = actor.performer if(stat == CONSCIOUS) Proximity(null, finder) return 1 @@ -141,7 +144,7 @@ var/const/MAX_ACTIVE_TIME = 400 var/mob/living/carbon/target = L // i'm sorry for i have sinned ~silicons - var/obj/item/snowflake_but_also_what_about_head = target.item_by_slot(SLOT_ID_HEAD) + var/obj/item/snowflake_but_also_what_about_head = target.item_by_slot_id(SLOT_ID_HEAD) if(istype(snowflake_but_also_what_about_head, /obj/item/clothing/head/helmet/space)) visible_message(SPAN_DANGER("[src] smashes against [target]'s [snowflake_but_also_what_about_head], but bounces off!")) Die() diff --git a/code/modules/spells/spellbook.dm b/code/modules/spells/spellbook.dm index 053bb6f8489..fc484ecf7c6 100644 --- a/code/modules/spells/spellbook.dm +++ b/code/modules/spells/spellbook.dm @@ -5,7 +5,7 @@ icon_state ="spellbook" throw_speed = 1 throw_range = 5 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL var/uses = 5 var/temp = null var/max_uses = 5 diff --git a/code/modules/spells/targeted/equip/equip.dm b/code/modules/spells/targeted/equip/equip.dm index 5910cd2d535..7fa47bf59ac 100644 --- a/code/modules/spells/targeted/equip/equip.dm +++ b/code/modules/spells/targeted/equip/equip.dm @@ -16,7 +16,7 @@ var/to_create = equipped_summons[slot_id] slot_id = text2num(slot_id) //because the index is text, we access this instead var/obj/item/new_item = summon_item(to_create) - var/obj/item/old_item = L.item_by_slot(slot_id) + var/obj/item/old_item = L.item_by_slot_id(slot_id) if(old_item) if(delete_old) qdel(old_item) diff --git a/code/modules/surgery/implant.dm b/code/modules/surgery/implant.dm index 8c5bf750ebd..4f5bff25520 100644 --- a/code/modules/surgery/implant.dm +++ b/code/modules/surgery/implant.dm @@ -16,11 +16,11 @@ /datum/surgery_step/cavity/proc/get_max_wclass(obj/item/organ/external/affected) switch (affected.organ_tag) if (BP_HEAD) - return ITEMSIZE_TINY + return WEIGHT_CLASS_TINY if (BP_TORSO) - return ITEMSIZE_NORMAL + return WEIGHT_CLASS_NORMAL if (BP_GROIN) - return ITEMSIZE_SMALL + return WEIGHT_CLASS_SMALL return 0 /datum/surgery_step/cavity/proc/get_cavity(obj/item/organ/external/affected) diff --git a/code/modules/telesci/bscyrstal.dm b/code/modules/telesci/bscyrstal.dm index eac988d1fbf..7dd5c187a76 100644 --- a/code/modules/telesci/bscyrstal.dm +++ b/code/modules/telesci/bscyrstal.dm @@ -5,7 +5,7 @@ desc = "A glowing bluespace crystal, not much is known about how they work. It looks very delicate." icon = 'icons/obj/telescience.dmi' icon_state = "bluespace_crystal" - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY origin_tech = list(TECH_BLUESPACE = 6, TECH_MATERIAL = 3) var/blink_range = 8 // The teleport range when crushed/thrown at someone. diff --git a/code/modules/vehicles/ridden/quad.dm b/code/modules/vehicles/ridden/quad.dm index 1526084b723..90321e14f03 100644 --- a/code/modules/vehicles/ridden/quad.dm +++ b/code/modules/vehicles/ridden/quad.dm @@ -21,7 +21,7 @@ desc = "A keyring with a small steel key, and a blue fob reading \"ZOOM!\"." icon = 'icons/obj/vehicles.dmi' icon_state = "quad_keys" - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY /datum/component/riding_handler/vehicle/ridden/quadbike diff --git a/code/modules/vehicles/ridden/three_wheel_carts.dm b/code/modules/vehicles/ridden/three_wheel_carts.dm index 760021431a6..a7bc9019fe4 100644 --- a/code/modules/vehicles/ridden/three_wheel_carts.dm +++ b/code/modules/vehicles/ridden/three_wheel_carts.dm @@ -47,7 +47,7 @@ desc = "The Security Cart Key used to start it." icon = 'icons/obj/vehicles.dmi' icon_state = "securikey" - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY /obj/vehicle/ridden/cart/medical @@ -61,4 +61,4 @@ desc = "The Medical Cart Key used to start it." icon = 'icons/obj/vehicles.dmi' icon_state = "medikey" - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY diff --git a/code/modules/vehicles/ridden/wheelchair.dm b/code/modules/vehicles/ridden/wheelchair.dm index 44e9e654067..30f577ba813 100644 --- a/code/modules/vehicles/ridden/wheelchair.dm +++ b/code/modules/vehicles/ridden/wheelchair.dm @@ -48,7 +48,7 @@ icon = 'icons/obj/furniture.dmi' //Todo, move icon for wheelchair shit into their own folder icon_state = "wheelchair_folded" item_state = "wheelchair" - w_class = ITEMSIZE_HUGE // Can't be put in backpacks. Oh well. + w_class = WEIGHT_CLASS_HUGE // Can't be put in backpacks. Oh well. /// What we unfold to var/unfolded_type = /obj/vehicle/ridden/wheelchair diff --git a/code/modules/vehicles_legacy/Securitrain_vr.dm b/code/modules/vehicles_legacy/Securitrain_vr.dm index e7f0436a38b..005f7ac2b57 100644 --- a/code/modules/vehicles_legacy/Securitrain_vr.dm +++ b/code/modules/vehicles_legacy/Securitrain_vr.dm @@ -32,7 +32,7 @@ desc = "The Security Cart Key used to start it." icon = 'icons/obj/vehicles.dmi' icon_state = "securikey" - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY /obj/vehicle_old/train/security/trolley name = "Train trolley" diff --git a/code/modules/vehicles_legacy/cargo_train.dm b/code/modules/vehicles_legacy/cargo_train.dm index a6bfc1f864e..0f5c981c533 100644 --- a/code/modules/vehicles_legacy/cargo_train.dm +++ b/code/modules/vehicles_legacy/cargo_train.dm @@ -24,7 +24,7 @@ desc = "A keyring with a small steel key, and a yellow fob reading \"Choo Choo!\"." icon = 'icons/obj/vehicles.dmi' icon_state = "train_keys" - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY /obj/vehicle_old/train/trolley name = "cargo train trolley" diff --git a/code/modules/vehicles_legacy/quad.dm b/code/modules/vehicles_legacy/quad.dm index c7a7d252ce4..3d027b5de95 100644 --- a/code/modules/vehicles_legacy/quad.dm +++ b/code/modules/vehicles_legacy/quad.dm @@ -39,7 +39,7 @@ desc = "A keyring with a small steel key, and a blue fob reading \"ZOOM!\"." icon = 'icons/obj/vehicles.dmi' icon_state = "quad_keys" - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY /obj/vehicle_old/train/engine/quadbike/Move(var/turf/destination) var/turf/T = get_turf(src) diff --git a/code/modules/vehicles_legacy/rover_vr.dm b/code/modules/vehicles_legacy/rover_vr.dm index 5f86ad778c5..cbc180b2767 100644 --- a/code/modules/vehicles_legacy/rover_vr.dm +++ b/code/modules/vehicles_legacy/rover_vr.dm @@ -43,7 +43,7 @@ desc = "The Rover key used to start it." icon = 'icons/obj/vehicles.dmi' icon_state = "securikey" - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY /obj/vehicle_old/train/rover/trolley name = "Train trolley" diff --git a/code/modules/vehicles_legacy/skateboard.dm b/code/modules/vehicles_legacy/skateboard.dm index 3b63bc5e91c..463dde8faea 100644 --- a/code/modules/vehicles_legacy/skateboard.dm +++ b/code/modules/vehicles_legacy/skateboard.dm @@ -350,7 +350,7 @@ throw_force = 3.0 throw_speed = 2 throw_range = 5 - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL var/build_step = 0 /obj/item/heavy_skateboard_frame @@ -362,7 +362,7 @@ throw_force = 6.0 throw_speed = 2 throw_range = 4 - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL var/build_step = 0 //Basic Board Construction diff --git a/code/modules/virus2/items_devices.dm b/code/modules/virus2/items_devices.dm index 8bdeccbfb0c..71836887221 100644 --- a/code/modules/virus2/items_devices.dm +++ b/code/modules/virus2/items_devices.dm @@ -4,7 +4,7 @@ name = "antibody scanner" desc = "Scans living beings for antibodies in their blood." icon_state = "health" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL item_state = "electronic" /obj/item/antibody_scanner/attack_mob(mob/target, mob/user, clickchain_flags, list/params, mult, target_zone, intent) @@ -101,7 +101,7 @@ name = "blank GNA disk" icon = 'icons/obj/cloning.dmi' icon_state = "datadisk0" - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY var/datum/disease2/effectholder/effect = null var/list/species = null var/stage = 1 diff --git a/code/modules/vore/eating/belly_obj_vr.dm b/code/modules/vore/eating/belly_obj_vr.dm index 736dae7a024..7cfb2dd4215 100644 --- a/code/modules/vore/eating/belly_obj_vr.dm +++ b/code/modules/vore/eating/belly_obj_vr.dm @@ -414,7 +414,7 @@ I.forceMove(src) items_preserved += I // these are undigestable anyway so just add them regardless for(var/slot in slots) - var/obj/item/I = M.item_by_slot(slot) + var/obj/item/I = M.item_by_slot_id(slot) if(I) M.transfer_item_to_loc(I, src, INV_OP_FORCE) if(contaminates || istype(I,/obj/item/card/id)) diff --git a/code/modules/vore/eating/bellymodes_vr.dm b/code/modules/vore/eating/bellymodes_vr.dm index 17312e6a965..0407ec859c7 100644 --- a/code/modules/vore/eating/bellymodes_vr.dm +++ b/code/modules/vore/eating/bellymodes_vr.dm @@ -118,7 +118,7 @@ //Stripping flag if(mode_flags & DM_FLAG_STRIPPING) for(var/slot in slots) - var/obj/item/I = H.item_by_slot(slot) + var/obj/item/I = H.item_by_slot_id(slot) if(I) H.transfer_item_to_loc(I, src, INV_OP_FORCE) if(contaminates || istype(I,/obj/item/card/id)) diff --git a/code/modules/vore/eating/contaminate_vr.dm b/code/modules/vore/eating/contaminate_vr.dm index cb9893d4a8e..f6b5e3797cc 100644 --- a/code/modules/vore/eating/contaminate_vr.dm +++ b/code/modules/vore/eating/contaminate_vr.dm @@ -90,23 +90,6 @@ var/list/gurgled_overlays = list( else ..() -////////////// -// Special things that happen when wet -////////////// -/obj/item/storage/box/open(mob/user as mob) - if(gurgled) - to_chat(usr, "The soggy box falls apart in your hands.") - var/turf/T = get_turf(src) - for(var/obj/item/I in contents) - remove_from_storage(I, T) - new/obj/effect/debris/cleanable/molten_item(T) - qdel(src) - return - ..() - -////////////// -// Special handling of gurgle_contaminate -////////////// /obj/item/card/id/gurgle_contaminate(var/atom/movable/item_storage = null) digest_act(item_storage) //Digesting these anyway return TRUE @@ -133,33 +116,4 @@ var/list/gurgled_overlays = list( C.charge = 0 return TRUE -/obj/item/storage/box/gurgle_contaminate(var/atom/movable/item_storage = null) - if((. = ..())) - name = "soggy [cleanname]" - desc = "This soggy box is about to fall apart any time." - -//Storages that contaminate contents -/obj/item/storage/backpack/gurgle_contaminate(var/atom/movable/item_storage = null, var/contamination_flavor = "Generic", var/contamination_color = "green") - if(contents) - for(var/obj/item/O in contents) - O.gurgle_contaminate(item_storage, contamination_flavor, contamination_color) - ..() - -/obj/item/storage/belt/gurgle_contaminate(var/atom/movable/item_storage = null, var/contamination_flavor = "Generic", var/contamination_color = "green") - if(contents) - for(var/obj/item/O in contents) - O.gurgle_contaminate(item_storage, contamination_flavor, contamination_color) - ..() - -/obj/item/storage/belt/gurgle_contaminate(var/atom/movable/item_storage = null, var/contamination_flavor = "Generic", var/contamination_color = "green") - if(contents) - for(var/obj/item/O in contents) - O.gurgle_contaminate(item_storage, contamination_flavor, contamination_color) - ..() - -/obj/item/clothing/suit/storage/gurgle_contaminate(var/atom/movable/item_storage = null, var/contamination_flavor = "Generic", var/contamination_color = "green") - if(pockets) - if(pockets.contents) - for(var/obj/item/O in pockets.contents) - O.gurgle_contaminate(item_storage, contamination_flavor, contamination_color) - ..() +// todo: i just backspaced out backpack handling on storage refactor because frankly i'm not a vore coder and this isn't my problem ~silicons diff --git a/code/modules/vore/eating/digest_act_vr.dm b/code/modules/vore/eating/digest_act_vr.dm index 24bb35041b3..e481ebd2a12 100644 --- a/code/modules/vore/eating/digest_act_vr.dm +++ b/code/modules/vore/eating/digest_act_vr.dm @@ -6,12 +6,7 @@ /obj/item/proc/digest_act(var/atom/movable/item_storage = null) if(istype(item_storage,/obj/item/dogborg/sleeper)) for(var/obj/item/O in contents) - if(istype(O,/obj/item/storage/internal)) //Dump contents from dummy pockets. - for(var/obj/item/SO in O) - if(item_storage) - SO.forceMove(item_storage) - qdel(O) - else if(item_storage) + if(item_storage) O.forceMove(item_storage) qdel(src) return w_class @@ -27,12 +22,7 @@ digest_stage -= g_damage else for(var/obj/item/O in contents) - if(istype(O,/obj/item/storage/internal)) //Dump contents from dummy pockets. - for(var/obj/item/SO in O) - if(item_storage) - SO.forceMove(item_storage) - qdel(O) - else if(item_storage) + if(item_storage) O.forceMove(item_storage) qdel(src) return g_damage diff --git a/code/modules/vore/eating/leave_remains_vr.dm b/code/modules/vore/eating/leave_remains_vr.dm index c30bda57234..03fa7c14500 100644 --- a/code/modules/vore/eating/leave_remains_vr.dm +++ b/code/modules/vore/eating/leave_remains_vr.dm @@ -79,7 +79,7 @@ damage_force = 0 throw_force = 0 item_state = "bone" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL var/pred_ckey var/pred_name diff --git a/code/modules/vore/fluffstuff/custom_boxes.dm b/code/modules/vore/fluffstuff/custom_boxes.dm index caf45e50c5f..58d18f6cf71 100644 --- a/code/modules/vore/fluffstuff/custom_boxes.dm +++ b/code/modules/vore/fluffstuff/custom_boxes.dm @@ -5,16 +5,8 @@ /obj/item/storage/box/fluff name = "Undefined Fluff Box" desc = "This should have a description. Tell an admin." - storage_slots = 7 - var/list/has_items = list() - -/obj/item/storage/box/fluff/PopulateContents() - . = ..() - storage_slots = has_items.len - allowed = list() - for(var/P in has_items) - allowed += P - new P(src) + max_items = 7 + // END - DO NOT EDIT PROTOTYPE @@ -23,7 +15,7 @@ /obj/item/storage/box/fluff/charactername name = "" desc = "" - has_items = list( + starts_with = list( /obj/item/clothing/head/thing1, /obj/item/clothing/shoes/thing2, /obj/item/clothing/suit/thing3, @@ -34,7 +26,7 @@ /obj/item/storage/box/fluff/cassandra name = "Cassandra Selone's Spawn Kit" desc = "A spawn Kit, holding Cassandra Selone's Item's" - has_items = list( + starts_with = list( /obj/item/clothing/gloves/fluff/kilano/purple, /obj/item/clothing/under/fluff/kilanosuit/purple, /obj/item/clothing/shoes/boots/fluff/kilano/purple) @@ -43,7 +35,7 @@ /obj/item/storage/box/fluff/tasald name = "Tasald's Kit" desc = "A kit containing Talsald's equipment." - has_items = list( + starts_with = list( /obj/item/clothing/suit/storage/det_suit/fluff/tasald, /obj/item/clothing/suit/storage/det_suit/fluff/tas_coat, /obj/item/clothing/under/det/fluff/tasald, @@ -55,7 +47,7 @@ /obj/item/storage/box/fluff/octavious name = "Octavious's Kit" desc = "A kit containing Octavious's work clothes." - has_items = list( + starts_with = list( /obj/item/clothing/suit/storage/trench/fluff/octaviouscoat, /obj/item/clothing/under/det/fluff/octavious, /obj/item/clothing/mask/gas/plaguedoctor/fluff/octaviousmask, @@ -69,7 +61,7 @@ /obj/item/storage/box/fluff/cirra name = "Instant Pirate Kit" desc = "Just add Akula!" - has_items = list( + starts_with = list( /obj/item/clothing/head/pirate, /obj/item/clothing/glasses/eyepatch, /obj/item/clothing/suit/pirate, @@ -79,7 +71,7 @@ /obj/item/storage/box/fluff/emoticon name = "Emoticon's Mime Kit" desc = "Specially packaged for the hungry catgirl mime with a taste for clown." - has_items = list( + starts_with = list( /obj/item/fluff/id_kit_mime, /obj/item/clothing/gloves/white, /obj/item/clothing/head/beret, @@ -131,7 +123,7 @@ /obj/item/storage/box/fluff/drake name = "United Federation Uniform Kit" desc = "A box containing all the parts of a United Federation Uniform" - has_items = list( + starts_with = list( /obj/item/clothing/under/rank/internalaffairs/fluff/joan, /obj/item/clothing/suit/storage/fluff/modernfedcoat/modernfedsec, /obj/item/clothing/head/caphat/formal/fedcover/fedcoversec, @@ -142,7 +134,7 @@ /obj/item/storage/box/fluff/yonra name = "Yonra's Starting Kit" desc = "A small box containing Yonra's personal effects" - has_items = list( + starts_with = list( /obj/item/melee/fluff/holochain/mass, /obj/item/implanter/reagent_generator/yonra, /obj/item/clothing/accessory/medal/silver/unity) @@ -150,7 +142,7 @@ //Razerwing:Archer Maximus /obj/item/storage/box/fluff/archermaximus desc = "Personal Effects" - has_items = list() + starts_with = list() //ivymoomoo:Ivy Baladeva /obj/item/storage/backpack/messenger/sec/fluff/ivymoomoo @@ -171,17 +163,17 @@ desc = "A little capsule where a designer's swimsuit is stored." icon = 'icons/vore/custom_items_vr.dmi' icon_state = "capsule" - storage_slots = 1 + max_items = 1 foldable = null - w_class = ITEMSIZE_SMALL - max_w_class = ITEMSIZE_NORMAL - can_hold = list(/obj/item/clothing/under/swimsuit/) - has_items = list(/obj/item/clothing/under/swimsuit/fluff/penelope) + w_class = WEIGHT_CLASS_SMALL + max_single_weight_class = WEIGHT_CLASS_NORMAL + insertion_whitelist = list(/obj/item/clothing/under/swimsuit/) + starts_with = list(/obj/item/clothing/under/swimsuit/fluff/penelope) // Aerowing:Sebastian Aji /obj/item/storage/box/fluff/sebastian_aji name = "Sebastian's Lumoco Arms P3 Box" - has_items = list( + starts_with = list( /obj/item/gun/ballistic/pistol, /obj/item/ammo_magazine/m9mm/compact/flash, /obj/item/ammo_magazine/m9mm/compact/flash, @@ -190,7 +182,7 @@ /* /obj/item/storage/box/fluff/briana_moore name = "Briana's Derringer Box" - has_items = list( + starts_with = list( /obj/item/gun/ballistic/derringer/fluff/briana, /obj/item/clothing/accessory/permit/gun/fluff/briana_moore) */ @@ -199,7 +191,7 @@ //SilencedMP5A5:Serdykov Antoz /obj/item/storage/box/fluff/serdykov_antoz name = "Serdy's Weapon Box" - has_items = list( + starts_with = list( /obj/item/clothing/accessory/permit/gun/fluff/silencedmp5a5, /obj/item/gun/ballistic/colt/fluff/serdy) */ @@ -208,7 +200,7 @@ /obj/item/storage/box/fluff/kilano name = "Ne'tra Ky'ram's Kit" desc = "A kit containing Ne'tra Ky'ram's clothing." - has_items = list( + starts_with = list( /obj/item/clothing/suit/storage/hooded/wintercoat/kilanocoat, /obj/item/clothing/under/fluff/kilanosuit, /obj/item/storage/backpack/messenger/sec/fluff/kilano, @@ -222,7 +214,7 @@ /obj/item/storage/box/fluff/morxaina name = "Fashionable clothes set" desc = "Set of custom-made, expensive attire elements." - has_items = list( + starts_with = list( /obj/item/clothing/shoes/fluff/morthighs, /obj/item/clothing/gloves/fluff/morsleeves, /obj/item/clothing/under/fluff/morunder) @@ -230,7 +222,7 @@ // Mewchild: Phi Vietsi /obj/item/storage/box/fluff/vietsi name = "Phi's Personal Items" - has_items = list( + starts_with = list( /obj/item/clothing/accessory/medal/bronze_heart, /obj/item/clothing/gloves/ring/seal/signet/fluff/vietsi) END OF CITADEL CHANGES */ @@ -240,89 +232,89 @@ Swimsuits, for general use, to avoid arriving to work with your swimsuit. /obj/item/storage/box/fluff/swimsuit name = "Black Swimsuit capsule" desc = "A little capsule where a swimsuit is usually stored." - storage_slots = 1 + max_items = 1 icon = 'icons/vore/custom_items_vr.dmi' icon_state = "capsule" foldable = null - w_class = ITEMSIZE_SMALL - max_w_class = ITEMSIZE_NORMAL - can_hold = list(/obj/item/clothing/under/swimsuit/) - has_items = list(/obj/item/clothing/under/swimsuit/black) + w_class = WEIGHT_CLASS_SMALL + max_single_weight_class = WEIGHT_CLASS_NORMAL + insertion_whitelist = list(/obj/item/clothing/under/swimsuit/) + starts_with = list(/obj/item/clothing/under/swimsuit/black) /obj/item/storage/box/fluff/swimsuit/blue name = "Blue Swimsuit capsule" - has_items = list(/obj/item/clothing/under/swimsuit/blue) + starts_with = list(/obj/item/clothing/under/swimsuit/blue) /obj/item/storage/box/fluff/swimsuit/purple name = "Purple Swimsuit capsule" - has_items = list(/obj/item/clothing/under/swimsuit/purple) + starts_with = list(/obj/item/clothing/under/swimsuit/purple) /obj/item/storage/box/fluff/swimsuit/green name = "Green Swimsuit capsule" - has_items = list(/obj/item/clothing/under/swimsuit/green) + starts_with = list(/obj/item/clothing/under/swimsuit/green) /obj/item/storage/box/fluff/swimsuit/red name = "Red Swimsuit capsule" - has_items = list(/obj/item/clothing/under/swimsuit/red) + starts_with = list(/obj/item/clothing/under/swimsuit/red) /obj/item/storage/box/fluff/swimsuit/white name = "White Swimsuit capsule" - has_items = list(/obj/item/clothing/under/swimsuit/white) + starts_with = list(/obj/item/clothing/under/swimsuit/white) /obj/item/storage/box/fluff/swimsuit/blue name = "Striped Swimsuit capsule" - has_items = list(/obj/item/clothing/under/swimsuit/striped) + starts_with = list(/obj/item/clothing/under/swimsuit/striped) /obj/item/storage/box/fluff/swimsuit/earth name = "Earthen Swimsuit capsule" - has_items = list(/obj/item/clothing/under/swimsuit/earth) + starts_with = list(/obj/item/clothing/under/swimsuit/earth) /obj/item/storage/box/fluff/swimsuit/engineering name = "Engineering Swimsuit capsule" - has_items = list(/obj/item/clothing/under/swimsuit/fluff/engineering) + starts_with = list(/obj/item/clothing/under/swimsuit/fluff/engineering) /obj/item/storage/box/fluff/swimsuit/science name = "Science Swimsuit capsule" - has_items = list(/obj/item/clothing/under/swimsuit/fluff/science) + starts_with = list(/obj/item/clothing/under/swimsuit/fluff/science) /obj/item/storage/box/fluff/swimsuit/security name = "Security Swimsuit capsule" - has_items = list(/obj/item/clothing/under/swimsuit/fluff/security) + starts_with = list(/obj/item/clothing/under/swimsuit/fluff/security) /obj/item/storage/box/fluff/swimsuit/medical name = "Medical Swimsuit capsule" - has_items = list(/obj/item/clothing/under/swimsuit/fluff/medical) + starts_with = list(/obj/item/clothing/under/swimsuit/fluff/medical) /obj/item/storage/box/fluff/swimsuit/cowbikini name = "Cow Bikini capsule" - has_items = list(/obj/item/clothing/under/swimsuit/stripper/cowbikini) + starts_with = list(/obj/item/clothing/under/swimsuit/stripper/cowbikini) /obj/item/storage/box/fluff/swimsuit/captain name = "Sexy Captain capsule" - has_items = list(/obj/item/clothing/under/swimsuit/stripper/captain) + starts_with = list(/obj/item/clothing/under/swimsuit/stripper/captain) /obj/item/storage/box/fluff/swimsuit/highclass name = "High Class Swimsuit capsule" - has_items = list(/obj/item/clothing/under/swimsuit/highclass) + starts_with = list(/obj/item/clothing/under/swimsuit/highclass) /obj/item/storage/box/fluff/swimsuit/latex name = "Latex Swimsuit capsule" - has_items = list(/obj/item/clothing/under/swimsuit/latex) + starts_with = list(/obj/item/clothing/under/swimsuit/latex) /obj/item/storage/box/fluff/swimsuit/risque name = "Risque Swimsuit capsule" - has_items = list(/obj/item/clothing/under/swimsuit/risque) + starts_with = list(/obj/item/clothing/under/swimsuit/risque) /obj/item/storage/box/fluff/swimsuit/streamlined name = "Streamlined Swimsuit capsule" - has_items = list(/obj/item/clothing/under/swimsuit/streamlined) + starts_with = list(/obj/item/clothing/under/swimsuit/streamlined) //Monkey boxes for the new primals we have /obj/item/storage/box/monkeycubes/sobakacubes name = "sobaka cube box" desc = "Drymate brand sobaka cubes. Just add water!" -/obj/item/storage/box/monkeycubes/sobakacubes/PopulateContents() +/obj/item/storage/box/monkeycubes/sobakacubes/legacy_spawn_contents() . = ..() for(var/i = 1 to 4) new /obj/item/reagent_containers/food/snacks/monkeycube/wrapped/sobakacube(src) @@ -331,7 +323,7 @@ Swimsuits, for general use, to avoid arriving to work with your swimsuit. name = "saru cube box" desc = "Drymate brand saru cubes. Just add water!" -/obj/item/storage/box/monkeycubes/sarucubes/PopulateContents() +/obj/item/storage/box/monkeycubes/sarucubes/legacy_spawn_contents() . = ..() for(var/i = 1 to 4) new /obj/item/reagent_containers/food/snacks/monkeycube/wrapped/sarucube(src) @@ -340,7 +332,7 @@ Swimsuits, for general use, to avoid arriving to work with your swimsuit. name = "sparra cube box" desc = "Drymate brand sparra cubes. Just add water!" -/obj/item/storage/box/monkeycubes/sparracubes/PopulateContents() +/obj/item/storage/box/monkeycubes/sparracubes/legacy_spawn_contents() . = ..() for(var/i = 1 to 4) new /obj/item/reagent_containers/food/snacks/monkeycube/wrapped/sparracube(src) @@ -349,7 +341,7 @@ Swimsuits, for general use, to avoid arriving to work with your swimsuit. name = "wolpin cube box" desc = "Drymate brand wolpin cubes. Just add water!" -/obj/item/storage/box/monkeycubes/wolpincubes/PopulateContents() +/obj/item/storage/box/monkeycubes/wolpincubes/legacy_spawn_contents() . = ..() for(var/i = 1 to 4) new /obj/item/reagent_containers/food/snacks/monkeycube/wrapped/wolpincube(src) diff --git a/code/modules/vore/fluffstuff/custom_clothes.dm b/code/modules/vore/fluffstuff/custom_clothes.dm index 16700dbe2c8..abcc7fca0e0 100644 --- a/code/modules/vore/fluffstuff/custom_clothes.dm +++ b/code/modules/vore/fluffstuff/custom_clothes.dm @@ -186,9 +186,9 @@ icon_override = 'icons/vore/custom_clothes_vr.dmi' item_state = "vulpine_belt_mob" - storage_slots = 9 + max_items = 9 -/obj/item/storage/belt/utility/fluff/vulpine/PopulateContents() +/obj/item/storage/belt/utility/fluff/vulpine/legacy_spawn_contents() . = ..() new /obj/item/tool/screwdriver(src) new /obj/item/tool/wrench(src) @@ -612,7 +612,7 @@ item_state = null icon_override = null slot_flags = SLOT_GLOVES | SLOT_TIE - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL slot = ACCESSORY_SLOT_ARMBAND //AegisOA:Xander Bevin @@ -639,7 +639,7 @@ icon_override = 'icons/vore/custom_onmob_vr.dmi' icon_state = "goldenstring" item_state = "goldenstring" - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY slot_flags = SLOT_TIE //Chaoko99: Aika Hisakawa diff --git a/code/modules/vore/fluffstuff/custom_guns.dm b/code/modules/vore/fluffstuff/custom_guns.dm index 09974a56d64..06fcf1d39d5 100644 --- a/code/modules/vore/fluffstuff/custom_guns.dm +++ b/code/modules/vore/fluffstuff/custom_guns.dm @@ -43,7 +43,7 @@ icon_override = 'icons/obj/gun/ballistic.dmi' item_state = "battlerifle_i" item_icons = null - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY recoil = 2 // The battlerifle was known for its nasty recoil. max_shells = 36 caliber = "9.5x40mm" @@ -72,7 +72,7 @@ desc = "The X-9MM is a select-fire personal defense weapon designed in-house by Xing Private Security. It was made to compete with the WT550 Saber, but never caught on with NanoTrasen. Uses 9mm rounds." icon_state = "pdw" item_state = "c20r" // Placeholder - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL caliber = "9mm" origin_tech = list(TECH_COMBAT = 5, TECH_MATERIAL = 2) slot_flags = SLOT_BELT @@ -106,7 +106,7 @@ item_icons = list(SLOT_ID_RIGHT_HAND = 'icons/obj/gun/energy.dmi', SLOT_ID_LEFT_HAND = 'icons/obj/gun/energy.dmi') // WORK YOU FUCKING CUNT PIECE OF SHIT BASTARD STUPID BITCH ITEM ICON AAAAHHHH item_state_slots = list(SLOT_ID_RIGHT_HAND = "ge_pistol_r", SLOT_ID_LEFT_HAND = "ge_pistol_l") slot_flags = SLOT_BELT - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL damage_force = 10 origin_tech = list(TECH_COMBAT = 4, TECH_MAGNET = 2) materials_base = list(MAT_STEEL = 2000) @@ -220,7 +220,7 @@ END OF CITADEL CHANGES */ desc = "An STG-560 built by RauMauser. Experience the terror of the Siegfried line, redone for the 26th century! The Kaiser would be proud. Uses unique 7.92x33mm Kurz rounds." icon_state = "stg60" item_state = "arifle" - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY max_shells = 30 caliber = "7.92x33mm" origin_tech = list(TECH_COMBAT = 4, TECH_MATERIAL = 2, TECH_ILLEGAL = 6) @@ -301,7 +301,7 @@ END OF CITADEL CHANGES */ fire_sound = 'sound/weapons/Taser.ogg' charge_cost = 100 damage_force = 8 - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY fire_delay = 6 pixel_x = -16 @@ -398,7 +398,7 @@ END OF CITADEL CHANGES */ magazine_type = /obj/item/ammo_magazine/m380 allowed_magazines = list(/obj/item/ammo_magazine/m380) load_method = MAGAZINE - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL fire_sound = 'sound/weapons/gunshot_pathetic.ogg' origin_tech = list(TECH_COMBAT = 2, TECH_MATERIAL = 3) @@ -450,7 +450,7 @@ END OF CITADEL CHANGES */ desc = "The FS 9x19mm \"Sol\" is a compact and reliable submachine gun. Uses 9mm rounds." icon_state = "SMG-IS" item_state = "wt550" - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY slot_flags = SLOT_BELT caliber = "9mm" magazine_type = /obj/item/ammo_magazine/m9mm @@ -484,7 +484,7 @@ END OF CITADEL CHANGES */ desc = "The FS PDW E \"Martin\" is small holdout e-gun. Don't miss!" icon_state = "PDW" item_state = "gun" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL projectile_type = /obj/projectile/beam/stun charge_cost = 1200 charge_meter = 0 @@ -790,7 +790,7 @@ END OF CITADEL CHANGES */ fire_sound = 'sound/weapons/laser_holdout_1.wav' phase_power = 100 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL charge_cost = 600 modifystate = "holdoutkill" firemodes = list( diff --git a/code/modules/vore/fluffstuff/custom_items.dm b/code/modules/vore/fluffstuff/custom_items.dm index 6472bcba361..328119fb900 100644 --- a/code/modules/vore/fluffstuff/custom_items.dm +++ b/code/modules/vore/fluffstuff/custom_items.dm @@ -293,7 +293,7 @@ slot_flags = SLOT_BELT damage_force = 10 throw_force = 3 - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL damtype = HALLOSS attack_verb = list("flogged", "whipped", "lashed", "disciplined", "chastised", "flayed") @@ -420,7 +420,7 @@ item_state_slots = list(SLOT_ID_RIGHT_HAND = "browncanemob_r", SLOT_ID_LEFT_HAND = "browncanemob_l") damage_force = 5.0 throw_force = 7.0 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL materials_base = list(MAT_STEEL = 50) attack_verb = list("bludgeoned", "whacked", "disciplined", "thrashed") @@ -439,7 +439,7 @@ item_state_slots = list(SLOT_ID_RIGHT_HAND = "alexiswandmob_r", SLOT_ID_LEFT_HAND = "alexiswandmob_l") damage_force = 1.0 throw_force = 2.0 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL materials_base = list(MAT_STEEL = 50) attack_verb = list("sparkled", "whacked", "twinkled", "radiated", "dazzled", "zapped") attack_sound = 'sound/weapons/sparkle.ogg' @@ -568,7 +568,7 @@ desc = "A tiny supplemental battery for powering something or someone synthetic." icon = 'icons/vore/custom_items_vr.dmi' icon_state = "dragor_dot" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL /obj/item/fluff/dragor_dot/attack_self(mob/user) . = ..() @@ -677,7 +677,7 @@ icon = 'icons/obj/device_alt.dmi' icon_state = "hand_tele" item_flags = ITEM_NOBLUDGEON | ITEM_ENCUMBERS_WHILE_HELD - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL origin_tech = list(TECH_MAGNET = 5, TECH_BLUESPACE = 5, TECH_ILLEGAL = 7) var/cell_type = /obj/item/cell/device/weapon @@ -971,7 +971,7 @@ desc = "That's unusual." icon = 'icons/obj/device_alt.dmi' icon_state = "motion2" - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY item_flags = ITEM_NOBLUDGEON | ITEM_ENCUMBERS_WHILE_HELD var/tele_name @@ -1265,7 +1265,7 @@ sharp = 0 edge = 0 throw_force = 7 - w_class = ITEMSIZE_HUGE + w_class = WEIGHT_CLASS_HUGE origin_tech = list(TECH_COMBAT = 2) attack_verb = list("beaten") lightcolor = "#CC33FF" @@ -1341,11 +1341,11 @@ slot_flags = SLOT_BACK item_icons = list(SLOT_ID_BACK = 'icons/vore/custom_onmob_vr.dmi', SLOT_ID_LEFT_HAND = 'icons/vore/custom_items_left_hand_vr.dmi', SLOT_ID_RIGHT_HAND = 'icons/vore/custom_items_right_hand_vr.dmi') - can_hold = list(/obj/item/melee/baton/fluff/stunstaff) + insertion_whitelist = list(/obj/item/melee/baton/fluff/stunstaff) - w_class = ITEMSIZE_HUGE - max_w_class = ITEMSIZE_HUGE - max_storage_space = 16 + w_class = WEIGHT_CLASS_HUGE + max_single_weight_class = WEIGHT_CLASS_HUGE + max_combined_volume = 16 /obj/item/storage/backpack/fluff/stunstaff/Initialize(mapload) . = ..() @@ -1373,7 +1373,7 @@ throw_force = active_throwforce sharp = 1 edge = 1 - w_class = active_w_class + set_weight_class(active_w_class) playsound(user, 'sound/weapons/sparkle.ogg', 50, 1) /obj/item/melee/fluffstuff/proc/deactivate(mob/living/user) @@ -1386,7 +1386,7 @@ throw_force = initial(throw_force) sharp = initial(sharp) edge = initial(edge) - w_class = initial(w_class) + set_weight_class(initial(w_class)) /obj/item/melee/fluffstuff/attack_self(mob/user) . = ..() @@ -1425,12 +1425,12 @@ slot_flags = SLOT_BACK | SLOT_OCLOTHING active_force = 15 active_throwforce = 7 - active_w_class = ITEMSIZE_LARGE + active_w_class = WEIGHT_CLASS_BULKY damage_force = 1 throw_force = 1 throw_speed = 1 throw_range = 5 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL origin_tech = list(TECH_MATERIAL = 2, TECH_COMBAT = 1) item_icons = list(SLOT_ID_LEFT_HAND = 'icons/mob/items/lefthand_melee.dmi', SLOT_ID_RIGHT_HAND = 'icons/mob/items/righthand_melee.dmi', SLOT_ID_BACK = 'icons/vore/custom_items_vr.dmi', SLOT_ID_SUIT = 'icons/vore/custom_items_vr.dmi') var/active_state = "wolfgirlsword" @@ -1542,7 +1542,7 @@ icon = 'icons/vore/custom_items_vr.dmi' icon_state = "jazzcamcorder" item_state = "jazzcamcorder" - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY slot_flags = SLOT_BELT var/obj/machinery/camera/network/thunder/camera diff --git a/code/modules/vore/fluffstuff/custom_items_cit.dm b/code/modules/vore/fluffstuff/custom_items_cit.dm index 788a573b976..698a982b9a2 100644 --- a/code/modules/vore/fluffstuff/custom_items_cit.dm +++ b/code/modules/vore/fluffstuff/custom_items_cit.dm @@ -1,7 +1,7 @@ /obj/item/clothing/accessory/collar/lifecrystal name = "\improper Vey-Med Life-Alert" desc = "A small crystal with a single light on its surface. It's supposed to notify an offsite facility if you're dead for too long." - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL icon = 'icons/vore/custom_items_vr.dmi' icon_override = 'icons/vore/custom_items_vr.dmi' icon_state = "khlife" diff --git a/code/modules/vore/fluffstuff/custom_permits.dm b/code/modules/vore/fluffstuff/custom_permits.dm index 747e48f3468..b4ab896dc05 100644 --- a/code/modules/vore/fluffstuff/custom_permits.dm +++ b/code/modules/vore/fluffstuff/custom_permits.dm @@ -75,7 +75,7 @@ END OF CITADEL CHANGES */ This license expires on DD/Month/YYYY and must be renewed by CentCom prior to this date."} icon = 'icons/obj/card.dmi' icon_state = "guest" - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY // END - PROTOTYPE */ diff --git a/code/modules/vore/fluffstuff/guns/bsharpoon.dm b/code/modules/vore/fluffstuff/guns/bsharpoon.dm index c2d4c74f8c4..f924a0bbbcd 100644 --- a/code/modules/vore/fluffstuff/guns/bsharpoon.dm +++ b/code/modules/vore/fluffstuff/guns/bsharpoon.dm @@ -6,7 +6,7 @@ icon = 'icons/obj/gun/energy.dmi' icon_state = "harpoon-2" - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL throw_speed = 4 throw_range = 20 diff --git a/code/modules/vore/fluffstuff/guns/cell_loaded/cell_loaded.dm b/code/modules/vore/fluffstuff/guns/cell_loaded/cell_loaded.dm index 4d029f72e85..507156a9c10 100644 --- a/code/modules/vore/fluffstuff/guns/cell_loaded/cell_loaded.dm +++ b/code/modules/vore/fluffstuff/guns/cell_loaded/cell_loaded.dm @@ -209,7 +209,7 @@ icon_state = "nsfw_batt" slot_flags = SLOT_BELT | SLOT_EARS throw_force = 1 - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY var/shots_left = 4 leaves_residue = 0 @@ -239,10 +239,10 @@ /obj/item/storage/secure/briefcase/nsfw_pack_hybrid name = "hybrid cell-loaded gun kit" desc = "A storage case for a multi-purpose handgun. Variety hour!" - w_class = ITEMSIZE_NORMAL - max_w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL + max_single_weight_class = WEIGHT_CLASS_NORMAL -/obj/item/storage/secure/briefcase/nsfw_pack_hybrid/PopulateContents() +/obj/item/storage/secure/briefcase/nsfw_pack_hybrid/legacy_spawn_contents() new /obj/item/gun/ballistic/cell_loaded(src) new /obj/item/ammo_magazine/cell_mag/advanced(src) new /obj/item/ammo_casing/microbattery/combat/stun(src) @@ -259,10 +259,10 @@ /obj/item/storage/secure/briefcase/nsfw_pack_hybrid_combat name = "military cell-loaded gun kit" desc = "A storage case for a multi-purpose handgun. Variety hour!" - w_class = ITEMSIZE_NORMAL - max_w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL + max_single_weight_class = WEIGHT_CLASS_NORMAL -/obj/item/storage/secure/briefcase/nsfw_pack_hybrid_combat/PopulateContents() +/obj/item/storage/secure/briefcase/nsfw_pack_hybrid_combat/legacy_spawn_contents() new /obj/item/gun/ballistic/cell_loaded(src) new /obj/item/ammo_magazine/cell_mag/advanced(src) new /obj/item/ammo_casing/microbattery/combat/shotstun(src) diff --git a/code/modules/vore/fluffstuff/guns/cell_loaded/medigun.dm b/code/modules/vore/fluffstuff/guns/cell_loaded/medigun.dm index 4b09db69977..9f1a0e74137 100644 --- a/code/modules/vore/fluffstuff/guns/cell_loaded/medigun.dm +++ b/code/modules/vore/fluffstuff/guns/cell_loaded/medigun.dm @@ -43,10 +43,10 @@ /obj/item/storage/secure/briefcase/ml3m_pack_med name = "\improper AML \'Medigun\' kit" desc = "A storage case for a multi-purpose healing gun. Variety hour!" - w_class = ITEMSIZE_NORMAL - max_w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL + max_single_weight_class = WEIGHT_CLASS_NORMAL -/obj/item/storage/secure/briefcase/ml3m_pack_med/PopulateContents() +/obj/item/storage/secure/briefcase/ml3m_pack_med/legacy_spawn_contents() new /obj/item/gun/ballistic/cell_loaded/medical(src) new /obj/item/ammo_magazine/cell_mag/medical(src) new /obj/item/ammo_casing/microbattery/medical/brute(src) @@ -56,10 +56,10 @@ /obj/item/storage/secure/briefcase/ml3m_pack_cmo name = "\improper Advanced AML \'Medigun\' kit" desc = "A storage case for a multi-purpose healing gun. Variety hour!" - w_class = ITEMSIZE_NORMAL - max_w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL + max_single_weight_class = WEIGHT_CLASS_NORMAL -/obj/item/storage/secure/briefcase/ml3m_pack_cmo/PopulateContents() +/obj/item/storage/secure/briefcase/ml3m_pack_cmo/legacy_spawn_contents() new /obj/item/gun/ballistic/cell_loaded/medical/cmo(src) new /obj/item/ammo_magazine/cell_mag/medical(src) new /obj/item/ammo_casing/microbattery/medical/brute(src) diff --git a/code/modules/vore/fluffstuff/guns/cell_loaded/revolver.dm b/code/modules/vore/fluffstuff/guns/cell_loaded/revolver.dm index 3f199856aa9..2e545edf3da 100644 --- a/code/modules/vore/fluffstuff/guns/cell_loaded/revolver.dm +++ b/code/modules/vore/fluffstuff/guns/cell_loaded/revolver.dm @@ -46,10 +46,10 @@ /obj/item/storage/secure/briefcase/nsfw_pack name = "\improper NT-102b \'Hydra\' gun kit" desc = "A storage case for a multi-purpose handgun. Variety hour!" - w_class = ITEMSIZE_NORMAL - max_w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL + max_single_weight_class = WEIGHT_CLASS_NORMAL -/obj/item/storage/secure/briefcase/nsfw_pack/PopulateContents() +/obj/item/storage/secure/briefcase/nsfw_pack/legacy_spawn_contents() new /obj/item/gun/ballistic/cell_loaded/combat(src) new /obj/item/ammo_magazine/cell_mag/combat(src) for(var/path in subtypesof(/obj/item/ammo_casing/microbattery/combat)) @@ -58,10 +58,10 @@ /obj/item/storage/secure/briefcase/nsfw_pack_hos name = "\improper NT-102b \'Hydra\' gun kit" desc = "A storage case for a multi-purpose handgun. Variety hour!" - w_class = ITEMSIZE_NORMAL - max_w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL + max_single_weight_class = WEIGHT_CLASS_NORMAL -/obj/item/storage/secure/briefcase/nsfw_pack_hos/PopulateContents() +/obj/item/storage/secure/briefcase/nsfw_pack_hos/legacy_spawn_contents() new /obj/item/gun/ballistic/cell_loaded/combat(src) new /obj/item/ammo_magazine/cell_mag/combat(src) new /obj/item/ammo_casing/microbattery/combat/lethal(src) diff --git a/code/modules/vore/fluffstuff/guns/crestrose.dm b/code/modules/vore/fluffstuff/guns/crestrose.dm index 05a96a2efd5..158e6f38fb4 100644 --- a/code/modules/vore/fluffstuff/guns/crestrose.dm +++ b/code/modules/vore/fluffstuff/guns/crestrose.dm @@ -7,7 +7,7 @@ icon_override = 'icons/vore/custom_guns_vr.dmi' item_state = "laser" //placeholder - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL origin_tech = list(TECH_COMBAT = 7, TECH_MATERIAL = 4) slot_flags = null fire_sound = 'sound/weapons/Gunshot_light.ogg' diff --git a/code/modules/vore/fluffstuff/guns/gunsword.dm b/code/modules/vore/fluffstuff/guns/gunsword.dm index ae1b23c1847..602c2d9913c 100644 --- a/code/modules/vore/fluffstuff/guns/gunsword.dm +++ b/code/modules/vore/fluffstuff/guns/gunsword.dm @@ -9,7 +9,7 @@ item_state = null item_icons = null - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL origin_tech = list(TECH_COMBAT = 8, TECH_MATERIAL = 4) slot_flags = null projectile_type = /obj/projectile/beam/stun @@ -41,13 +41,13 @@ throw_force = 5 throw_speed = 1 throw_range = 5 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL origin_tech = list(TECH_MAGNET = 3, TECH_COMBAT = 5) var/active = 0 var/active_force = 30 var/active_throwforce = 20 - var/active_w_class = ITEMSIZE_LARGE + var/active_w_class = WEIGHT_CLASS_BULKY var/active_embed_chance = 0 //In the off chance one of these is supposed to embed, you can just tweak this var sharp = 0 edge = 0 @@ -69,7 +69,7 @@ throw_force = active_throwforce sharp = 1 edge = 1 - w_class = active_w_class + set_weight_class(active_w_class) playsound(user, 'sound/weapons/saberon.ogg', 50, 1) set_light(lrange, lpower, lcolor) attack_verb = list("attacked", "slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut") @@ -88,7 +88,7 @@ throw_force = initial(throw_force) sharp = initial(sharp) edge = initial(edge) - w_class = initial(w_class) + set_weight_class(initial(w_class)) set_light(0,0) attack_verb = list() diff --git a/code/modules/vore/fluffstuff/guns/pummeler.dm b/code/modules/vore/fluffstuff/guns/pummeler.dm index fd96bfc588b..932e1dccae5 100644 --- a/code/modules/vore/fluffstuff/guns/pummeler.dm +++ b/code/modules/vore/fluffstuff/guns/pummeler.dm @@ -23,7 +23,7 @@ origin_tech = list(TECH_COMBAT = 3, TECH_MATERIAL = 3, TECH_MAGNET = 5) slot_flags = SLOT_BELT|SLOT_BACK - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY //Projectile /obj/projectile/pummel diff --git a/code/modules/vore/fluffstuff/life_crystals.dm b/code/modules/vore/fluffstuff/life_crystals.dm index 47e1f110219..1dcb4b135d9 100644 --- a/code/modules/vore/fluffstuff/life_crystals.dm +++ b/code/modules/vore/fluffstuff/life_crystals.dm @@ -3,7 +3,7 @@ name = "life crystal" desc = "A small crystal with four little dots in it. It feels slightly warm to the touch. \ Read manual before use! Can be worn, held, or attached to uniform. NOTE: Device contains antimatter." - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL icon = 'icons/vore/custom_items_vr.dmi' icon_override = 'icons/vore/custom_items_vr.dmi' @@ -145,10 +145,10 @@ icon_state = "khlifebox" desc = "This case can only hold the VM-LC91-1 and a manual." item_state_slots = list(SLOT_ID_RIGHT_HAND = "syringe_kit", SLOT_ID_LEFT_HAND = "syringe_kit") - storage_slots = 2 - can_hold = list(/obj/item/clothing/accessory/collar/vmcrystal) - max_storage_space = ITEMSIZE_COST_SMALL * 2 - w_class = ITEMSIZE_SMALL + max_items = 2 + insertion_whitelist = list(/obj/item/clothing/accessory/collar/vmcrystal) + max_combined_volume = WEIGHT_VOLUME_SMALL * 2 + w_class = WEIGHT_CLASS_SMALL /obj/item/storage/box/vmcrystal/Initialize(mapload) . = ..() diff --git a/code/modules/vore/resizing/holder_micro_vr.dm b/code/modules/vore/resizing/holder_micro_vr.dm index ed0cefed95f..04ca9e64f33 100644 --- a/code/modules/vore/resizing/holder_micro_vr.dm +++ b/code/modules/vore/resizing/holder_micro_vr.dm @@ -5,7 +5,7 @@ desc = "Another crewmember, small enough to fit in your hand." icon_state = "micro" slot_flags = SLOT_FEET | SLOT_HEAD | SLOT_ID - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL item_icons = list() // No in-hand sprites (for now, anyway, we could totally add some) pixel_y = 0 // Override value from parent. diff --git a/code/modules/xenoarcheaology/finds/find_spawning.dm b/code/modules/xenoarcheaology/finds/find_spawning.dm index 964c8e177ee..4cfb15bcc9b 100644 --- a/code/modules/xenoarcheaology/finds/find_spawning.dm +++ b/code/modules/xenoarcheaology/finds/find_spawning.dm @@ -139,9 +139,9 @@ new_item.icon = 'icons/obj/xenoarchaeology.dmi' new_item.icon_state = "box" var/obj/item/storage/box/new_box = new_item - new_box.max_w_class = pick(1,2,2,3,3,3,4,4) - var/storage_amount = 2**(new_box.max_w_class-1) - new_box.max_storage_space = rand(storage_amount, storage_amount * 10) + new_box.max_single_weight_class = pick(1,2,2,3,3,3,4,4) + var/storage_amount = 2**(new_box.max_single_weight_class-1) + new_box.max_combined_volume = rand(storage_amount, storage_amount * 10) if(prob(30)) LAZYSET(new_item.origin_tech, TECH_ARCANE, 1) apply_image_decorations = 1 diff --git a/code/modules/xenoarcheaology/sampling.dm b/code/modules/xenoarcheaology/sampling.dm index 2cb9d546141..d1a07aa1704 100644 --- a/code/modules/xenoarcheaology/sampling.dm +++ b/code/modules/xenoarcheaology/sampling.dm @@ -3,7 +3,7 @@ desc = "It looks extremely delicate." icon = 'icons/obj/xenoarchaeology.dmi' icon_state = "sliver1" - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY sharp = 1 var/datum/geosample/geological_data @@ -21,7 +21,7 @@ icon = 'icons/obj/device.dmi' icon_state = "sampler0" item_state = "screwdriver_brown" - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY var/sampled_turf = "" var/num_stored_bags = 10 @@ -75,7 +75,7 @@ var/image/I = image("icon"=R, "layer"=FLOAT_LAYER) filled_bag.add_overlay(I) filled_bag.add_overlay("evidence") - filled_bag.w_class = ITEMSIZE_TINY + filled_bag.set_weight_class(WEIGHT_CLASS_TINY) to_chat(user, "You take a core sample of the [item_to_sample].") else diff --git a/code/modules/xenoarcheaology/tools/tools.dm b/code/modules/xenoarcheaology/tools/tools.dm index ee7b66a7bc7..4a3cd03e223 100644 --- a/code/modules/xenoarcheaology/tools/tools.dm +++ b/code/modules/xenoarcheaology/tools/tools.dm @@ -5,7 +5,7 @@ icon_state = "measuring" origin_tech = list(TECH_MATERIAL = 1) materials_base = list(MAT_STEEL = 100) - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL /obj/item/storage/bag/fossils name = "Fossil Satchel" @@ -13,17 +13,17 @@ icon = 'icons/obj/mining.dmi' icon_state = "satchel" slot_flags = SLOT_BELT | SLOT_POCKET - w_class = ITEMSIZE_NORMAL - storage_slots = 50 - max_storage_space = ITEMSIZE_COST_NORMAL * 50 - max_w_class = ITEMSIZE_NORMAL - can_hold = list(/obj/item/fossil) + w_class = WEIGHT_CLASS_NORMAL + max_items = 50 + max_combined_volume = WEIGHT_VOLUME_NORMAL * 50 + max_single_weight_class = WEIGHT_CLASS_NORMAL + insertion_whitelist = list(/obj/item/fossil) /obj/item/storage/box/samplebags name = "sample bag box" desc = "A box claiming to contain sample bags." -/obj/item/storage/box/samplebags/PopulateContents() +/obj/item/storage/box/samplebags/legacy_spawn_contents() . = ..() for(var/i = 1 to 7) var/obj/item/evidencebag/S = new(src) @@ -38,7 +38,7 @@ item_state = "lampgreen" origin_tech = list(TECH_BLUESPACE = 3, TECH_MAGNET = 3, TECH_ARCANE = 1) materials_base = list(MAT_STEEL = 10000, MAT_GLASS = 5000) - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL slot_flags = SLOT_BELT var/last_scan_time = 0 @@ -99,7 +99,7 @@ item_state = "analyzer" origin_tech = list(TECH_MAGNET = 2, TECH_ENGINEERING = 2, TECH_BLUESPACE = 2) materials_base = list(MAT_STEEL = 1000, MAT_GLASS = 1000) - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL slot_flags = SLOT_BELT var/list/positive_locations = list() var/datum/depth_scan/current @@ -335,7 +335,7 @@ icon = 'icons/obj/xenoarchaeology.dmi' origin_tech = list(TECH_MAGNET = 3, TECH_ENGINEERING = 3, TECH_BLUESPACE = 2, TECH_ARCANE = 1) materials_base = list(MAT_STEEL = 10000, MAT_GLASS = 5000) - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL slot_flags = SLOT_BELT var/mode = 1 //Start off scanning. 1 = scanning, 0 = measuring var/obj/item/ano_scanner/anomaly_scanner = null diff --git a/code/modules/xenoarcheaology/tools/tools_pickaxe.dm b/code/modules/xenoarcheaology/tools/tools_pickaxe.dm index e8ec2567e23..24bd6ac819d 100644 --- a/code/modules/xenoarcheaology/tools/tools_pickaxe.dm +++ b/code/modules/xenoarcheaology/tools/tools_pickaxe.dm @@ -11,7 +11,7 @@ excavation_amount = 1 drill_sound = 'sound/weapons/thudswoosh.ogg' drill_verb = "brushing" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL /obj/item/pickaxe/one_pick name = "2cm pick" @@ -24,7 +24,7 @@ excavation_amount = 2 drill_sound = 'sound/items/Screwdriver.ogg' drill_verb = "delicately picking" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL /obj/item/pickaxe/two_pick name = "4cm pick" @@ -37,7 +37,7 @@ excavation_amount = 4 drill_sound = 'sound/items/Screwdriver.ogg' drill_verb = "delicately picking" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL /obj/item/pickaxe/three_pick name = "6cm pick" @@ -50,7 +50,7 @@ excavation_amount = 6 drill_sound = 'sound/items/Screwdriver.ogg' drill_verb = "delicately picking" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL /obj/item/pickaxe/four_pick name = "8cm pick" @@ -63,7 +63,7 @@ excavation_amount = 8 drill_sound = 'sound/items/Screwdriver.ogg' drill_verb = "delicately picking" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL /obj/item/pickaxe/five_pick name = "10cm pick" @@ -76,7 +76,7 @@ excavation_amount = 10 drill_sound = 'sound/items/Screwdriver.ogg' drill_verb = "delicately picking" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL /obj/item/pickaxe/six_pick name = "12cm pick" @@ -89,7 +89,7 @@ excavation_amount = 12 drill_sound = 'sound/items/Screwdriver.ogg' drill_verb = "delicately picking" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL /obj/item/pickaxe/hand name = "hand pickaxe" @@ -102,7 +102,7 @@ excavation_amount = 30 drill_sound = 'sound/items/Crowbar.ogg' drill_verb = "clearing" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Pack for holding pickaxes @@ -113,9 +113,9 @@ icon_state = "excavation" desc = "A set of picks for excavation." item_state = "syringe_kit" - storage_slots = 7 - w_class = ITEMSIZE_SMALL - can_hold = list(/obj/item/pickaxe/brush, + max_items = 7 + w_class = WEIGHT_CLASS_SMALL + insertion_whitelist = list(/obj/item/pickaxe/brush, /obj/item/pickaxe/one_pick, /obj/item/pickaxe/two_pick, /obj/item/pickaxe/three_pick, @@ -123,11 +123,11 @@ /obj/item/pickaxe/five_pick, /obj/item/pickaxe/six_pick, /obj/item/pickaxe/hand) - max_storage_space = ITEMSIZE_COST_SMALL * 9 - max_w_class = ITEMSIZE_SMALL - use_to_pickup = 1 + max_combined_volume = WEIGHT_VOLUME_SMALL * 9 + max_single_weight_class = WEIGHT_CLASS_SMALL + allow_mass_gather = TRUE -/obj/item/storage/excavation/PopulateContents() +/obj/item/storage/excavation/legacy_spawn_contents() . = ..() new /obj/item/pickaxe/brush(src) new /obj/item/pickaxe/one_pick(src) @@ -137,28 +137,6 @@ new /obj/item/pickaxe/five_pick(src) new /obj/item/pickaxe/six_pick(src) -/obj/item/storage/excavation/handle_item_insertion() - ..() - sort_picks() - -/obj/item/storage/excavation/proc/sort_picks() - var/list/obj/item/pickaxe/picksToSort = list() - for(var/obj/item/pickaxe/P in src) - picksToSort += P - P.loc = null - while(picksToSort.len) - var/min = 200 // No pick is bigger than 200 - var/selected = 0 - for(var/i = 1 to picksToSort.len) - var/obj/item/pickaxe/current = picksToSort[i] - if(current.excavation_amount <= min) - selected = i - min = current.excavation_amount - var/obj/item/pickaxe/smallest = picksToSort[selected] - smallest.loc = src - picksToSort -= smallest - orient2hud() - /obj/item/pickaxe/excavationdrill name = "excavation drill" icon = 'icons/obj/xenoarchaeology.dmi' diff --git a/code/modules/xenobio/items/extracts.dm b/code/modules/xenobio/items/extracts.dm index a22333e841f..35ab9611043 100644 --- a/code/modules/xenobio/items/extracts.dm +++ b/code/modules/xenobio/items/extracts.dm @@ -5,7 +5,7 @@ icon = 'icons/mob/slimes.dmi' icon_state = "grey slime extract" damage_force = 1 - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY throw_force = 0 throw_speed = 3 throw_range = 6 diff --git a/code/modules/xenobio/items/slime_objects.dm b/code/modules/xenobio/items/slime_objects.dm index 957f6792291..2404b4cfdeb 100644 --- a/code/modules/xenobio/items/slime_objects.dm +++ b/code/modules/xenobio/items/slime_objects.dm @@ -79,7 +79,7 @@ It can also teleport someone else, by throwing it at them or attacking them with it." icon = 'icons/obj/objects.dmi' icon_state = "slime_crystal_small" - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY origin_tech = list(TECH_MAGNET = 6, TECH_BLUESPACE = 3) damage_force = 1 //Needs a token damage_force to ensure you can attack because for some reason you can't attack with 0 damage_force things @@ -119,7 +119,7 @@ icon = 'icons/obj/objects.dmi' icon_state = "slime_crystal_large" uses = 1 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL origin_tech = list(TECH_MAGNET = 5, TECH_BLUESPACE = 4) @@ -148,7 +148,7 @@ item_state = "slime" light_color = LIGHT_COLOR_YELLOW light_wedge = LIGHT_OMNI - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY brightness_on = 6 on = TRUE //Bio-luminesence has one setting, on. power_use = 0 @@ -174,7 +174,7 @@ light_color = "#00FF00" light_power = 0.4 light_range = 2 - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY /obj/item/slime_irradiator/New() START_PROCESSING(SSobj, src) diff --git a/code/modules/xenobio/items/slimepotions.dm b/code/modules/xenobio/items/slimepotions.dm index 86608648ad7..5f0d8d79c18 100644 --- a/code/modules/xenobio/items/slimepotions.dm +++ b/code/modules/xenobio/items/slimepotions.dm @@ -4,7 +4,7 @@ name = "slime agent" desc = "A flask containing strange, mysterious substances excreted by a slime." icon = 'icons/obj/medical/chemical.dmi' - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY origin_tech = list(TECH_BIO = 4) /obj/item/slimepotion/attackby(obj/item/O, mob/user) diff --git a/code/modules/xenobio2/machinery/gene_manipulators.dm b/code/modules/xenobio2/machinery/gene_manipulators.dm index dd46c95d3ca..5599d09ff8d 100644 --- a/code/modules/xenobio2/machinery/gene_manipulators.dm +++ b/code/modules/xenobio2/machinery/gene_manipulators.dm @@ -15,7 +15,7 @@ desc = "A small disk used for carrying data on genetics." icon = 'icons/obj/hydroponics_machines.dmi' icon_state = "disk" - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY var/list/genes = list() var/genesource = "unknown" @@ -37,7 +37,7 @@ name = "biological disk box" desc = "A box of biological data disks, apparently." -/obj/item/storage/box/xenobiodisk/PopulateContents() +/obj/item/storage/box/xenobiodisk/legacy_spawn_contents() for(var/i = 0 to 7) new /obj/item/disk/xenobio(src) diff --git a/icons/screen/actions/actions.dmi b/icons/screen/actions/actions.dmi index a4bc7a2b366..b68438eb0b7 100644 Binary files a/icons/screen/actions/actions.dmi and b/icons/screen/actions/actions.dmi differ diff --git a/icons/screen/hud/common/storage.dmi b/icons/screen/hud/common/storage.dmi new file mode 100644 index 00000000000..6778f69296f Binary files /dev/null and b/icons/screen/hud/common/storage.dmi differ