Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions code/__DEFINES/inventory.dm
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,33 @@ DEFINE_BITFIELD(no_equip_flags, list(
/// The index of the entry in 'afk_thefts' with the time it happened
#define AFK_THEFT_TIME 3

/// A list of things that any suit storage can hold
/// Should consist of ubiquitous, non-specialized items
/// or items that are meant to be "suit storage agnostic" as
/// a benefit, which of the time of this commit only applies
/// to the captain's jetpack, here
GLOBAL_LIST_INIT(any_suit_storage, typecacheof(list(
/obj/item/clipboard,
/obj/item/flashlight,
/obj/item/tank/internals/emergency_oxygen,
/obj/item/tank/internals/plasmaman,
/obj/item/lighter,
/obj/item/pen,
/obj/item/modular_computer/pda,
/obj/item/toy,
/obj/item/radio,
/obj/item/storage/bag/books,
/obj/item/storage/fancy/cigarettes,
/obj/item/tank/jetpack/oxygen/captain,
/obj/item/stack/spacecash,
/obj/item/storage/wallet,
/obj/item/folder,
/obj/item/storage/box/matches,
/obj/item/cigarette,
/obj/item/storage/belt/holster,
/obj/item/storage/pouch,
)))

//Allowed equipment lists for security vests.

GLOBAL_LIST_INIT(detective_vest_allowed, list(
Expand Down Expand Up @@ -236,6 +263,7 @@ GLOBAL_LIST_INIT(security_vest_allowed, list(
/obj/item/storage/belt/holster/energy,
/obj/item/gun/ballistic/shotgun/automatic/combat/compact,
/obj/item/pen/red/security,
/obj/item/storage/belt/security/webbing,
))

GLOBAL_LIST_INIT(security_wintercoat_allowed, list(
Expand Down Expand Up @@ -282,6 +310,8 @@ GLOBAL_LIST_INIT(mining_suit_allowed, list(
/obj/item/pickaxe,
/obj/item/resonator,
/obj/item/spear,
/obj/item/storage/belt/mining,
/obj/item/storage/belt/chest_pouch,
))

/// List of all "tools" that can fit into belts or work from toolboxes
Expand Down
3 changes: 3 additions & 0 deletions code/__DEFINES/living.dm
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@
/// Living mob is being unpinned by some movable (source = the movable doing the unpinning, atom/movable/unpinning)
#define COMSIG_LIVING_UNPINNED_BY "living_unpinned_by"

/// Sent when a carbon's clothes are examined
#define COMSIG_CARBON_CLOTHING_EXAMINE "carbon_clothing_examine"

/// Various lists of body zones affected by pain.

#define BODY_ZONES_ALL list(BODY_ZONE_HEAD, BODY_ZONE_CHEST, BODY_ZONE_L_ARM, BODY_ZONE_R_ARM, BODY_ZONE_L_LEG, BODY_ZONE_R_LEG)
Expand Down
3 changes: 0 additions & 3 deletions code/__HELPERS/mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,6 @@
CRASH("No socks to choose from!")
return pick(SSaccessories.socks_list)

/proc/random_backpack()
return pick(GLOB.backpacklist)

/proc/random_hairstyle(gender)
switch(gender)
if(MALE)
Expand Down
12 changes: 1 addition & 11 deletions code/_globalvars/lists/flavor_misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -106,17 +106,7 @@ GLOBAL_LIST_INIT(security_depts_prefs, sort_list(list(
#define GSATCHEL "Grey Satchel"
#define GMESSENGER "Grey Messenger Bag"
#define LSATCHEL "Leather Satchel"
GLOBAL_LIST_INIT(backpacklist, list(
DBACKPACK,
DDUFFELBAG,
DSATCHEL,
DMESSENGER,
GBACKPACK,
GDUFFELBAG,
GSATCHEL,
GMESSENGER,
LSATCHEL,
))
#define BELT_POUCH "Chest Pouches"

//Suit/Skirt
#define PREF_SUIT "Jumpsuit"
Expand Down
4 changes: 4 additions & 0 deletions code/controllers/subsystem/wardrobe.dm
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,10 @@ SUBSYSTEM_DEF(wardrobe)
play_with[WARDROBE_CALLBACK_REMOVE] = CALLBACK(null, TYPE_PROC_REF(/obj/item/storage/box/survival, wardrobe_removal))
initial_callbacks[/obj/item/storage/box/survival] = play_with

play_with = new /list(WARDROBE_CALLBACK_REMOVE)
play_with[WARDROBE_CALLBACK_REMOVE] = CALLBACK(null, TYPE_PROC_REF(/obj/item/storage/pouch/survival, wardrobe_removal))
initial_callbacks[/obj/item/storage/pouch/survival] = play_with

/datum/controller/subsystem/wardrobe/proc/load_outfits()
for(var/datum/outfit/to_stock as anything in subtypesof(/datum/outfit))
if(!initial(to_stock.preload)) // Clearly not interested
Expand Down
31 changes: 31 additions & 0 deletions code/datums/outfit.dm
Original file line number Diff line number Diff line change
Expand Up @@ -498,3 +498,34 @@
if(!check_rights(NONE))
return
usr.client.open_outfit_editor(src)

/// Replaces the current belt with the passed in belt, without losing whatever was in the current belt slot
/// Returns TRUE if the replacement was successful, FALSE if it failed
/datum/outfit/proc/replace_belt_keep_old(obj/item/replaced_belt)
if(!belt)
belt = replaced_belt
return TRUE

// try to move the existing belt to the backpack
if(l_hand && r_hand && belt::w_class <= WEIGHT_CLASS_NORMAL)
LAZYADD(backpack_contents, belt)
belt = replaced_belt
return TRUE

// try to carry the existing belt in a hand
if(!l_hand)
l_hand = belt
belt = replaced_belt
return TRUE

if(!r_hand)
r_hand = belt
belt = replaced_belt
return TRUE

// failed to equip the new belt, try to add it to the backpack instead
if(replaced_belt::w_class <= WEIGHT_CLASS_NORMAL)
LAZYADD(backpack_contents, replaced_belt)
return TRUE

return FALSE
23 changes: 12 additions & 11 deletions code/datums/storage/storage.dm
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ GLOBAL_LIST_EMPTY(cached_storage_typecaches)
if(!can_insert(to_insert, user, messages = messages, force = force))
return FALSE

SEND_SIGNAL(parent, COMSIG_STORAGE_STORED_ITEM, to_insert, user, force)
SEND_SIGNAL(parent, COMSIG_ATOM_STORED_ITEM, to_insert, user, force)
SEND_SIGNAL(src, COMSIG_STORAGE_STORED_ITEM, to_insert, user, force)
to_insert.forceMove(real_location)
item_insertion_feedback(user, to_insert, override)
Expand Down Expand Up @@ -512,7 +512,7 @@ GLOBAL_LIST_EMPTY(cached_storage_typecaches)
*/
/datum/storage/proc/item_insertion_feedback(mob/user, obj/item/thing, override = FALSE)
if(animated)
animate_parent()
animate_storage()

if(override)
return
Expand Down Expand Up @@ -557,7 +557,7 @@ GLOBAL_LIST_EMPTY(cached_storage_typecaches)
thing.moveToNullspace()

if(animated)
animate_parent()
animate_storage()

refresh_views()
parent.update_appearance()
Expand Down Expand Up @@ -836,10 +836,11 @@ GLOBAL_LIST_EMPTY(cached_storage_typecaches)
user.active_storage.hide_contents(user)
hide_contents(user)
return COMPONENT_CANCEL_ATTACK_CHAIN
if(ishuman(user))
var/mob/living/carbon/human/hum = user
if(hum.l_store == parent || hum.r_store == parent)
return
// Non-module change: Commented out because it messes with pocket pouches
// if(ishuman(user))
// var/mob/living/carbon/human/hum = user
// if(hum.l_store == parent || hum.r_store == parent)
// return
if(parent.loc == user)
INVOKE_ASYNC(src, PROC_REF(open_storage), user)
return COMPONENT_CANCEL_ATTACK_CHAIN
Expand Down Expand Up @@ -915,7 +916,7 @@ GLOBAL_LIST_EMPTY(cached_storage_typecaches)
return FALSE

if(animated)
animate_parent()
animate_storage()

if(rustle_sound)
play_storage_sound() // NON-MODULE CHANGE
Expand Down Expand Up @@ -1107,9 +1108,9 @@ GLOBAL_LIST_EMPTY(cached_storage_typecaches)
parent.balloon_alert(user, "will now pick up one at a time")

/// Gives a spiffy animation to our parent to represent opening and closing.
/datum/storage/proc/animate_parent()
var/matrix/old_matrix = parent.transform
animate(parent, time = 1.5, loop = 0, transform = parent.transform.Scale(1.07, 0.9))
/datum/storage/proc/animate_storage(atom/animate = parent)
var/matrix/old_matrix = animate.transform
animate(animate, time = 1.5, loop = 0, transform = animate.transform.Scale(1.07, 0.9))
animate(time = 2, transform = old_matrix)

/// Signal proc for [COMSIG_ATOM_CONTENTS_WEIGHT_CLASS_CHANGED] to drop items out of our storage if they're suddenly too heavy.
Expand Down
2 changes: 2 additions & 0 deletions code/game/objects/items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@

///Icon file for mob worn overlays.
var/icon/worn_icon
///Icon file used in occasional cases where the item must be mirrored
var/mirror_icon
///Icon state for mob worn overlays, if null the normal icon_state will be used.
var/worn_icon_state
///Icon state for the belt overlay, if null the normal icon_state will be used.
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/devices/laserpointer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
item_flags = NOBLUDGEON
slot_flags = ITEM_SLOT_BELT
custom_materials = list(/datum/material/iron = SMALL_MATERIAL_AMOUNT * 5, /datum/material/glass = SMALL_MATERIAL_AMOUNT * 5)
w_class = WEIGHT_CLASS_SMALL
w_class = WEIGHT_CLASS_TINY
///Currently stored blulespace crystal, if any. Required to use the pointer through walls
var/obj/item/stack/ore/bluespace_crystal/crystal_lens
///Currently stored micro-laser diode
Expand Down
3 changes: 2 additions & 1 deletion code/game/objects/items/devices/scanners/health_analyzer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
item_flags = NOBLUDGEON
slot_flags = ITEM_SLOT_BELT
throwforce = 3
w_class = WEIGHT_CLASS_TINY
w_class = WEIGHT_CLASS_SMALL
throw_speed = 3
throw_range = 7
custom_materials = list(/datum/material/iron=SMALL_MATERIAL_AMOUNT *2)
Expand Down Expand Up @@ -625,6 +625,7 @@
desc = "A helpful, child-proofed, and most importantly, extremely cheap MeLo-Tech medical scanner used to diagnose injuries and recommend treatment for serious wounds. While it might not sound very informative for it to be able to tell you if you have a gaping hole in your body or not, it applies a temporary holoimage near the wound with information that is guaranteed to double the efficacy and speed of treatment."
mode = SCANNER_NO_MODE
give_wound_treatment_bonus = TRUE
w_class = WEIGHT_CLASS_TINY

/// Cooldown for when the analyzer will allow you to ask it for encouragement. Don't get greedy!
var/next_encouragement
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
item_flags = NOBLUDGEON
slot_flags = ITEM_SLOT_BELT
throwforce = 3
w_class = WEIGHT_CLASS_TINY
w_class = WEIGHT_CLASS_SMALL
throw_speed = 3
throw_range = 7
custom_materials = list(/datum/material/iron=SMALL_MATERIAL_AMOUNT*2)
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/food/bait.dm
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
lefthand_file = 'icons/mob/inhands/items_lefthand.dmi'
righthand_file = 'icons/mob/inhands/items_righthand.dmi'
inhand_icon_state = "pen"
w_class = WEIGHT_CLASS_TINY
bait_quality = TRAIT_GREAT_QUALITY_BAIT //this is only here for autowiki purposes, it's removed on init.
food_reagents = list(/datum/reagent/drug/kronkaine = 2) //The kronkaine is the thing that makes this a great bait.
tastes = list("hypocrisy" = 1)
Expand Down Expand Up @@ -89,4 +90,3 @@
/obj/item/food/bait/doughball/synthetic/unconsumable/Initialize(mapload)
. = ..()
ADD_TRAIT(src, TRAIT_BAIT_UNCONSUMABLE, INNATE_TRAIT)

10 changes: 10 additions & 0 deletions code/game/objects/items/storage/backpack.dm
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,16 @@
desc = "A trendy looking satchel."
icon_state = "satchel-norm"
inhand_icon_state = "satchel-norm"
slot_flags = ITEM_SLOT_BACK|ITEM_SLOT_BELT

/obj/item/storage/backpack/satchel/equipped(mob/user, slot, initial)
if(slot & ITEM_SLOT_BELT)
AddComponent(/datum/component/slows_with_backpack)
return ..()

/obj/item/storage/backpack/satchel/dropped(mob/user, silent)
. = ..()
qdel(GetComponent(/datum/component/slows_with_backpack))

/obj/item/storage/backpack/satchel/leather
name = "leather satchel"
Expand Down
2 changes: 2 additions & 0 deletions code/game/objects/items/storage/bags.dm
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,7 @@
/obj/item/reagent_containers/cup/tube,
/obj/item/reagent_containers/hypospray/medipen,
/obj/item/reagent_containers/syringe,
/obj/item/food/meat/slab,
))

/*
Expand Down Expand Up @@ -560,6 +561,7 @@
/obj/item/stack/ore/bluespace_crystal,
/obj/item/stock_parts,
/obj/item/wallframe/camera,
/obj/item/stack/sheet,
))

/obj/item/storage/bag/harpoon_quiver
Expand Down
14 changes: 14 additions & 0 deletions code/game/objects/items/storage/belt.dm
Original file line number Diff line number Diff line change
Expand Up @@ -865,3 +865,17 @@
/obj/item/seeds,
/obj/item/shovel/spade,
))

/obj/item/storage/belt/chest_pouch
name = "chest pouches"
desc = "A bunch of pouches worn across the chest."
gender = PLURAL
icon_state = "explorer2"
inhand_icon_state = "explorer2"
worn_icon_state = "explorer2"
storage_type = /datum/storage/backpack
mirror_icon = 'icons/mob/clothing/belt.dmi'

/obj/item/storage/belt/chest_pouch/Initialize(mapload)
. = ..()
AddComponent(/datum/component/slows_with_backpack)
3 changes: 2 additions & 1 deletion code/game/objects/items/storage/medkit.dm
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,7 @@
/obj/item/storage/pill_bottle/Initialize(mapload)
. = ..()
atom_storage.allow_quick_gather = TRUE
atom_storage.max_specific_storage = WEIGHT_CLASS_TINY
atom_storage.set_holdable(list(
/obj/item/reagent_containers/pill,
/obj/item/food/bait/natural,
Expand Down Expand Up @@ -802,7 +803,7 @@
inhand_icon_state = "contsolid"
lefthand_file = 'icons/mob/inhands/equipment/medical_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/medical_righthand.dmi'
w_class = WEIGHT_CLASS_SMALL
w_class = WEIGHT_CLASS_NORMAL

/obj/item/storage/test_tube_rack/Initialize(mapload)
. = ..()
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/storage/toolbox.dm
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
if (!user.put_in_inactive_hand(picked_item))
return ITEM_INTERACT_BLOCKING

atom_storage.animate_parent()
atom_storage.animate_storage()
if (istype(picked_item, /obj/item/weldingtool))
var/obj/item/weldingtool/welder = picked_item
if (!welder.welding)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/antagonists/clown_ops/outfits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
/obj/item/reagent_containers/spray/waterflower/lube = 1,
/obj/item/mod/skin_applier/honkerative = 1,
)
box = /obj/item/storage/box/survival/syndie
box = /obj/item/storage/pouch/survival/syndie
implants = list(/obj/item/implant/sad_trombone)

uplink_type = /obj/item/uplink/clownop
Expand Down
2 changes: 1 addition & 1 deletion code/modules/antagonists/nukeop/outfits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
belt = /obj/item/gun/ballistic/automatic/pistol/clandestine

skillchips = list(/obj/item/skillchip/disk_verifier)
box = /obj/item/storage/box/survival/syndie
box = /obj/item/storage/pouch/survival/syndie
/// Amount of TC to automatically store in this outfit's uplink.
var/tc = 25
/// Enables big voice on this outfit's headset, used for nukie leaders.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
id_trim = /datum/id_trim/chameleon/operative

backpack_contents = list(
/obj/item/storage/box/survival,
/obj/item/storage/pouch/survival,
/obj/item/implanter/uplink,
/obj/item/clothing/mask/chameleon,
/obj/item/storage/fancy/cigarettes/cigpack_syndicate,
Expand Down
2 changes: 1 addition & 1 deletion code/modules/bitrunning/server/obj_generation.dm
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
QDEL_LIST(bag.contents)

bag.contents += list(
new /obj/item/storage/box/survival,
new /obj/item/storage/pouch/survival,
new /obj/item/storage/medkit/regular,
new /obj/item/flashlight,
)
Expand Down
3 changes: 3 additions & 0 deletions code/modules/client/preferences/clothing.dm
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
DSATCHEL,
DDUFFELBAG,
DMESSENGER,
BELT_POUCH,
)

/datum/preference/choiced/backpack/create_default_value()
Expand All @@ -48,6 +49,8 @@
return /obj/item/storage/backpack/duffelbag
if (GMESSENGER)
return /obj/item/storage/backpack/messenger
if (BELT_POUCH)
return /obj/item/storage/belt/chest_pouch

// In a perfect world, these would be your department's backpack.
// However, this doesn't factor in assistants, or no high slot, and would
Expand Down
1 change: 1 addition & 0 deletions code/modules/clothing/ears/_ears.dm
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
resistance_flags = FLAMMABLE
custom_price = PAYCHECK_COMMAND * 1.5
flags_cover = EARS_COVERED
w_class = WEIGHT_CLASS_SMALL

/obj/item/clothing/ears/earmuffs/Initialize(mapload)
. = ..()
Expand Down
Loading
Loading