Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ребаланс рюкзаков и сумок #3844

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions code/__DEFINES/inventory_sizes.dm
Expand Up @@ -16,5 +16,6 @@
#define base_storage_capacity(w_class) (7*(w_class-1))

#define DEFAULT_BACKPACK_STORAGE base_storage_capacity(5)
#define DEFAULT_SATCHEL_STORAGE (DEFAULT_BACKPACK_STORAGE - 10)
#define DEFAULT_LARGEBOX_STORAGE base_storage_capacity(4)
#define DEFAULT_BOX_STORAGE base_storage_capacity(3)
6 changes: 5 additions & 1 deletion code/game/objects/items/weapons/storage/backpack.dm
Expand Up @@ -13,6 +13,7 @@
action_button_name = "Storage"
max_w_class = ITEM_SIZE_NORMAL
max_storage_space = DEFAULT_BACKPACK_STORAGE
reachable_while_equipped = FALSE
var/opened = 0

/obj/item/weapon/storage/backpack/ui_action_click()
Expand All @@ -30,6 +31,8 @@
/obj/item/weapon/storage/backpack/equipped(mob/user, slot)
if (slot == SLOT_BACK && length(use_sound))
playsound(src, pick(use_sound), VOL_EFFECTS_MASTER, null, null, -5)
if(!reachable_while_equipped)
close(loc)
..(user, slot)

/*
Expand Down Expand Up @@ -124,6 +127,8 @@
desc = "It's a very fancy satchel made with fine leather."
icon_state = "satchel"
item_state = "satchel"
max_storage_space = DEFAULT_SATCHEL_STORAGE
reachable_while_equipped = TRUE

/obj/item/weapon/storage/backpack/satchel/withwallet

Expand Down Expand Up @@ -270,7 +275,6 @@
icon_state = "satchel-flat"
item_state = "satchel-flat"
w_class = ITEM_SIZE_NORMAL //Can fit in backpacks itself.
max_storage_space = DEFAULT_BACKPACK_STORAGE - 10
level = 1
cant_hold = list(/obj/item/weapon/storage/backpack/satchel/flat) //muh recursive backpacks

Expand Down
11 changes: 8 additions & 3 deletions code/game/objects/items/weapons/storage/storage.dm
Expand Up @@ -15,6 +15,7 @@
var/max_w_class = ITEM_SIZE_SMALL //Max size of objects that this object can store (in effect only if can_hold isn't set)
var/max_storage_space = null //Total storage cost of items this can hold. Will be autoset based on storage_slots if left null.
var/storage_slots = null //The number of storage slots in this container.
var/reachable_while_equipped = TRUE

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.
Expand Down Expand Up @@ -44,7 +45,7 @@
return

if(over_object == usr && Adjacent(usr)) // this must come before the screen objects only block
src.open(usr)
open(usr)
return

if (!( istype(over_object, /obj/screen) ))
Expand Down Expand Up @@ -96,6 +97,10 @@
storage_ui.hide_from(user)

/obj/item/weapon/storage/proc/open(mob/user)
if(!reachable_while_equipped && slot_equipped == SLOT_BACK)
to_chat(user, "<span class='warning'>You can't reach into your [name] while it's equipped!</span>")
return

if (length(use_sound))
playsound(src, pick(use_sound), VOL_EFFECTS_MASTER, null, null, -5)

Expand Down Expand Up @@ -307,8 +312,8 @@
return

/obj/item/weapon/storage/attack_hand(mob/user)
if (src.loc == user)
src.open(user)
if (loc == user)
open(user)
else
..()
storage_ui.on_hand_attack(user)
Expand Down