Merge branch 'master' into upstream-merge-37381

This commit is contained in:
deathride58
2018-04-27 09:19:52 +00:00
committed by GitHub
409 changed files with 91049 additions and 23527 deletions
+53 -77
View File
@@ -18,32 +18,42 @@
righthand_file = 'icons/mob/inhands/equipment/backpack_righthand.dmi'
w_class = WEIGHT_CLASS_BULKY
slot_flags = SLOT_BACK //ERROOOOO
max_w_class = WEIGHT_CLASS_NORMAL
max_combined_w_class = 21
storage_slots = 21
resistance_flags = NONE
max_integrity = 300
/obj/item/storage/backpack/ComponentInitialize()
. = ..()
GET_COMPONENT(STR, /datum/component/storage)
STR.max_combined_w_class = 21
STR.max_w_class = WEIGHT_CLASS_NORMAL
STR.max_items = 21
/*
* Backpack Types
*/
/obj/item/storage/backpack/old
max_combined_w_class = 12
/obj/item/storage/backpack/old/ComponentInitialize()
. = ..()
GET_COMPONENT(STR, /datum/component/storage)
STR.max_combined_w_class = 12
/obj/item/storage/backpack/holding
name = "bag of holding"
desc = "A backpack that opens into a localized pocket of Blue Space."
icon_state = "holdingpack"
item_state = "holdingpack"
max_w_class = WEIGHT_CLASS_GIGANTIC
max_combined_w_class = 35
resistance_flags = FIRE_PROOF
flags_2 = NO_MAT_REDEMPTION_2
var/pshoom = 'sound/items/pshoom.ogg'
var/alt_sound = 'sound/items/pshoom_2.ogg'
armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 60, "acid" = 50)
component_type = /datum/component/storage/concrete/bluespace/bag_of_holding
/obj/item/storage/backpack/holding/ComponentInitialize()
. = ..()
GET_COMPONENT(STR, /datum/component/storage)
STR.allow_big_nesting = TRUE
STR.max_w_class = WEIGHT_CLASS_GIGANTIC
STR.max_combined_w_class = 35
/obj/item/storage/backpack/holding/suicide_act(mob/living/user)
user.visible_message("<span class='suicide'>[user] is jumping into [src]! It looks like [user.p_theyre()] trying to commit suicide.</span>")
@@ -54,57 +64,23 @@
qdel(user)
return
/obj/item/storage/backpack/holding/dump_content_at(atom/dest_object, mob/user)
if(Adjacent(user))
var/atom/dumping_location = dest_object.get_dumping_location()
if(get_dist(user, dumping_location) < 8)
if(dumping_location.storage_contents_dump_act(src, user))
if(alt_sound && prob(1))
playsound(src, alt_sound, 40, 1)
else
playsound(src, pshoom, 40, 1)
user.Beam(dumping_location,icon_state="rped_upgrade",time=5)
return 1
to_chat(user, "The [src.name] buzzes.")
playsound(src, 'sound/machines/buzz-sigh.ogg', 50, 0)
return 0
/obj/item/storage/backpack/holding/handle_item_insertion(obj/item/W, prevent_warning = 0, mob/living/user)
if((istype(W, /obj/item/storage/backpack/holding) || count_by_type(W.GetAllContents(), /obj/item/storage/backpack/holding)))
var/turf/loccheck = get_turf(src)
if(is_reebe(loccheck.z))
user.visible_message("<span class='warning'>An unseen force knocks [user] to the ground!</span>", "<span class='big_brass'>\"I think not!\"</span>")
user.Knockdown(60)
return
var/safety = alert(user, "Doing this will have extremely dire consequences for the station and its crew. Be sure you know what you're doing.", "Put in [name]?", "Proceed", "Abort")
if(safety == "Abort" || !in_range(src, user) || !src || !W || user.incapacitated())
return
investigate_log("has become a singularity. Caused by [user.key]", INVESTIGATE_SINGULO)
to_chat(user, "<span class='danger'>The Bluespace interfaces of the two devices catastrophically malfunction!</span>")
qdel(W)
var/obj/singularity/singulo = new /obj/singularity (get_turf(src))
singulo.energy = 300 //should make it a bit bigger~
message_admins("[key_name_admin(user)] detonated a bag of holding")
log_game("[key_name(user)] detonated a bag of holding")
qdel(src)
singulo.process()
return
. = ..()
/obj/item/storage/backpack/holding/singularity_act(current_size)
var/dist = max((current_size - 2),1)
explosion(src.loc,(dist),(dist*2),(dist*4))
return
/obj/item/storage/backpack/santabag
name = "Santa's Gift Bag"
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 = "giftbag"
w_class = WEIGHT_CLASS_BULKY
max_w_class = WEIGHT_CLASS_NORMAL
max_combined_w_class = 60
/obj/item/storage/backpack/santabag/ComponentInitialize()
. = ..()
GET_COMPONENT(STR, /datum/component/storage)
STR.max_w_class = WEIGHT_CLASS_NORMAL
STR.max_combined_w_class = 60
/obj/item/storage/backpack/santabag/suicide_act(mob/user)
user.visible_message("<span class='suicide'>[user] places [src] over their head and pulls it tight! It looks like they aren't in the Christmas spirit...</span>")
@@ -151,7 +127,6 @@
desc = "It's a special backpack made exclusively for Nanotrasen officers."
icon_state = "captainpack"
item_state = "captainpack"
resistance_flags = NONE
/obj/item/storage/backpack/industrial
name = "industrial backpack"
@@ -183,7 +158,6 @@
desc = "A specially designed backpack. It's fire resistant and smells vaguely of plasma."
icon_state = "toxpack"
item_state = "toxpack"
resistance_flags = NONE
/obj/item/storage/backpack/virology
name = "virology backpack"
@@ -191,7 +165,6 @@
icon_state = "viropack"
item_state = "viropack"
/*
* Satchel Types
*/
@@ -206,7 +179,6 @@
name = "leather satchel"
desc = "It's a very fancy satchel made with fine leather."
icon_state = "satchel"
resistance_flags = NONE
/obj/item/storage/backpack/satchel/leather/withwallet/PopulateContents()
new /obj/item/storage/wallet/random(src)
@@ -216,7 +188,6 @@
desc = "A tough satchel with extra pockets."
icon_state = "satchel-eng"
item_state = "engiepack"
resistance_flags = NONE
/obj/item/storage/backpack/satchel/med
name = "medical satchel"
@@ -247,7 +218,6 @@
desc = "Useful for holding research materials."
icon_state = "satchel-tox"
item_state = "satchel-tox"
resistance_flags = NONE
/obj/item/storage/backpack/satchel/hyd
name = "botanist satchel"
@@ -272,18 +242,26 @@
desc = "An exclusive satchel for Nanotrasen officers."
icon_state = "satchel-cap"
item_state = "captainpack"
resistance_flags = NONE
/obj/item/storage/backpack/satchel/flat
name = "smuggler's satchel"
desc = "A very slim satchel that can easily fit into tight spaces."
icon_state = "satchel-flat"
w_class = WEIGHT_CLASS_NORMAL //Can fit in backpacks itself.
max_combined_w_class = 15
level = 1
cant_hold = list(/obj/item/storage/backpack/satchel/flat) //muh recursive backpacks
component_type = /datum/component/storage/concrete/secret_satchel
/obj/item/storage/backpack/satchel/flat/hide(var/intact)
/obj/item/storage/backpack/stachel/flat/Initialize()
. = ..()
SSpersistence.new_secret_satchels += src
/obj/item/storage/backpack/satchel/flat/ComponentInitialize()
. = ..()
GET_COMPONENT(STR, /datum/component/storage)
STR.max_combined_w_class = 15
STR.cant_hold = typecacheof(list(/obj/item/storage/backpack/satchel/flat)) //muh recursive backpacks
/obj/item/storage/backpack/satchel/flat/hide(intact)
if(intact)
invisibility = INVISIBILITY_MAXIMUM
anchored = TRUE //otherwise you can start pulling, cover it, and drag around an invisible backpack.
@@ -293,10 +271,6 @@
anchored = FALSE
icon_state = initial(icon_state)
/obj/item/storage/backpack/satchel/flat/Initialize(mapload)
. = ..()
SSpersistence.new_secret_satchels += src
/obj/item/storage/backpack/satchel/flat/PopulateContents()
new /obj/item/stack/tile/plasteel(src)
new /obj/item/crowbar(src)
@@ -308,7 +282,7 @@
/obj/item/storage/backpack/satchel/flat/secret
var/list/reward_one_of_these = list() //Intended for map editing
var/list/reward_all_of_these = list() //use paths!
var/revealed = 0
var/revealed = FALSE
/obj/item/storage/backpack/satchel/flat/secret/Initialize()
. = ..()
@@ -324,13 +298,7 @@
new reward(src)
for(var/R in reward_all_of_these)
new R(src)
revealed = 1
/obj/item/storage/backpack/satchel/flat/can_be_inserted(obj/item/W, stop_messages = 0, mob/user)
if(SSpersistence.spawned_objects[W])
to_chat(user, "<span class='warning'>[W] is unstable after its journey through space and time, it wouldn't survive another trip.</span>")
return FALSE
return ..()
revealed = TRUE
/obj/item/storage/backpack/duffelbag
name = "duffel bag"
@@ -338,14 +306,17 @@
icon_state = "duffel"
item_state = "duffel"
slowdown = 1
max_combined_w_class = 30
/obj/item/storage/backpack/duffelbag/ComponentInitialize()
. = ..()
GET_COMPONENT(STR, /datum/component/storage)
STR.max_combined_w_class = 30
/obj/item/storage/backpack/duffelbag/captain
name = "captain's duffel bag"
desc = "A large duffel bag for holding extra captainly goods."
icon_state = "duffel-captain"
item_state = "duffel-captain"
resistance_flags = NONE
/obj/item/storage/backpack/duffelbag/med
name = "medical duffel bag"
@@ -393,7 +364,6 @@
desc = "A large duffel bag for holding extra tools and supplies."
icon_state = "duffel-eng"
item_state = "duffel-eng"
resistance_flags = NONE
/obj/item/storage/backpack/duffelbag/drone
name = "drone duffel bag"
@@ -426,9 +396,13 @@
desc = "A large duffel bag for holding extra tactical supplies."
icon_state = "duffel-syndie"
item_state = "duffel-syndieammo"
silent = 1
slowdown = 0
/obj/item/storage/backpack/duffelbag/syndie/ComponentInitialize()
. = ..()
GET_COMPONENT(STR, /datum/component/storage)
STR.silent = TRUE
/obj/item/storage/backpack/duffelbag/syndie/hitman
desc = "A large duffel bag for holding extra things. There is a Nanotrasen logo on the back."
icon_state = "duffel-syndieammo"
@@ -561,9 +535,11 @@
new /obj/item/grenade/syndieminibomb(src)
// For ClownOps.
/obj/item/storage/backpack/duffelbag/clown/syndie
/obj/item/storage/backpack/duffelbag/clown/syndie/ComponentInitialize()
. = ..()
GET_COMPONENT(STR, /datum/component/storage)
slowdown = 0
silent = TRUE
STR.silent = TRUE
/obj/item/storage/backpack/duffelbag/clown/syndie/PopulateContents()
new /obj/item/device/pda/clown(src)
+112 -174
View File
@@ -17,12 +17,16 @@
// Generic non-item
/obj/item/storage/bag
allow_quick_gather = 1
allow_quick_empty = 1
display_contents_with_number = 1 // should work fine now
use_to_pickup = 1
slot_flags = SLOT_BELT
/obj/item/storage/bag/ComponentInitialize()
. = ..()
GET_COMPONENT(STR, /datum/component/storage)
STR.allow_quick_gather = TRUE
STR.allow_quick_empty = TRUE
STR.display_numerical_stacking = TRUE
STR.click_gather = TRUE
// -----------------------------
// Trash bag
// -----------------------------
@@ -36,11 +40,14 @@
righthand_file = 'icons/mob/inhands/equipment/custodial_righthand.dmi'
w_class = WEIGHT_CLASS_BULKY
max_w_class = WEIGHT_CLASS_SMALL
max_combined_w_class = 30
storage_slots = 30
can_hold = list() // any
cant_hold = list(/obj/item/disk/nuclear)
/obj/item/storage/bag/trash/ComponentInitialize()
. = ..()
GET_COMPONENT(STR, /datum/component/storage)
STR.max_w_class = WEIGHT_CLASS_SMALL
STR.max_combined_w_class = 30
STR.max_items = 30
STR.cant_hold = typecacheof(list(/obj/item/disk/nuclear))
/obj/item/storage/bag/trash/suicide_act(mob/user)
user.visible_message("<span class='suicide'>[user] puts [src] over [user.p_their()] head and starts chomping at the insides! Disgusting!</span>")
@@ -70,10 +77,14 @@
name = "trash bag of holding"
desc = "The latest and greatest in custodial convenience, a trashbag that is capable of holding vast quantities of garbage."
icon_state = "bluetrashbag"
max_combined_w_class = 60
storage_slots = 60
flags_2 = NO_MAT_REDEMPTION_2
/obj/item/storage/bag/trash/bluespace/ComponentInitialize()
. = ..()
GET_COMPONENT(STR, /datum/component/storage)
STR.max_combined_w_class = 60
STR.max_items = 60
// -----------------------------
// Mining Satchel
// -----------------------------
@@ -85,13 +96,18 @@
icon_state = "satchel"
slot_flags = SLOT_BELT | SLOT_POCKET
w_class = WEIGHT_CLASS_NORMAL
storage_slots = 8
max_combined_w_class = 16 //Doesn't matter what this is, so long as it's more or equal to storage_slots * ore.w_class
max_w_class = WEIGHT_CLASS_HUGE
can_hold = list(/obj/item/stack/ore)
component_type = /datum/component/storage/concrete/stack
var/spam_protection = FALSE //If this is TRUE, the holder won't receive any messages when they fail to pick up ore through crossing it
var/datum/component/mobhook
/obj/item/storage/bag/ore/ComponentInitialize()
. = ..()
GET_COMPONENT(STR, /datum/component/storage/concrete/stack)
STR.allow_quick_empty = TRUE
STR.can_hold = typecacheof(list(/obj/item/stack/ore))
STR.max_w_class = WEIGHT_CLASS_HUGE
STR.max_combined_stack_amount = 50
/obj/item/storage/bag/ore/equipped(mob/user)
. = ..()
if (mobhook && mobhook.parent != user)
@@ -112,20 +128,21 @@
return
if (istype(user.pulling, /obj/structure/ore_box))
box = user.pulling
for(var/A in tile)
if (!is_type_in_typecache(A, can_hold))
continue
if (box)
user.transferItemToLoc(A, box)
show_message = TRUE
else if(can_be_inserted(A, TRUE, user))
handle_item_insertion(A, TRUE, user)
show_message = TRUE
else
if(!spam_protection)
to_chat(user, "<span class='warning'>Your [name] is full and can't hold any more!</span>")
spam_protection = TRUE
GET_COMPONENT(STR, /datum/component/storage)
if(STR)
for(var/A in tile)
if (!is_type_in_typecache(A, STR.can_hold))
continue
if (box)
user.transferItemToLoc(A, box)
show_message = TRUE
else if(SendSignal(COMSIG_TRY_STORAGE_INSERT, A, user, TRUE))
show_message = TRUE
else
if(!spam_protection)
to_chat(user, "<span class='warning'>Your [name] is full and can't hold any more!</span>")
spam_protection = TRUE
continue
if(show_message)
playsound(user, "rustle", 50, TRUE)
if (box)
@@ -142,10 +159,15 @@
/obj/item/storage/bag/ore/holding //miners, your messiah has arrived
name = "mining satchel of holding"
desc = "A revolution in convenience, this satchel allows for huge amounts of ore storage. It's been outfitted with anti-malfunction safety measures."
storage_slots = INFINITY
max_combined_w_class = INFINITY
icon_state = "satchel_bspace"
/obj/item/storage/bag/ore/holding/ComponentInitialize()
. = ..()
GET_COMPONENT(STR, /datum/component/storage/concrete/stack)
STR.max_items = INFINITY
STR.max_combined_w_class = INFINITY
STR.max_combined_stack_amount = INFINITY
// -----------------------------
// Plant bag
// -----------------------------
@@ -154,13 +176,17 @@
name = "plant bag"
icon = 'icons/obj/hydroponics/equipment.dmi'
icon_state = "plantbag"
storage_slots = 100; //the number of plant pieces it can carry.
max_combined_w_class = 100 //Doesn't matter what this is, so long as it's more or equal to storage_slots * plants.w_class
max_w_class = WEIGHT_CLASS_NORMAL
w_class = WEIGHT_CLASS_TINY
can_hold = list(/obj/item/reagent_containers/food/snacks/grown, /obj/item/seeds, /obj/item/grown, /obj/item/reagent_containers/honeycomb)
resistance_flags = FLAMMABLE
/obj/item/storage/bag/plants/ComponentInitialize()
. = ..()
GET_COMPONENT(STR, /datum/component/storage)
STR.max_w_class = WEIGHT_CLASS_NORMAL
STR.max_combined_w_class = 100
STR.max_items = 100
STR.can_hold = typecacheof(list(/obj/item/reagent_containers/food/snacks/grown, /obj/item/seeds, /obj/item/grown, /obj/item/reagent_containers/honeycomb))
////////
/obj/item/storage/bag/plants/portaseeder
@@ -176,8 +202,6 @@
return
for(var/obj/item/O in contents)
seedify(O, 1)
close_all()
// -----------------------------
// Sheet Snatcher
@@ -193,123 +217,15 @@
var/capacity = 300; //the number of sheets it can carry.
w_class = WEIGHT_CLASS_NORMAL
component_type = /datum/component/storage/concrete/stack
allow_quick_empty = 1 // this function is superceded
/obj/item/storage/bag/sheetsnatcher/can_be_inserted(obj/item/W, stop_messages = 0)
if(!istype(W, /obj/item/stack/sheet) || istype(W, /obj/item/stack/sheet/mineral/sandstone) || istype(W, /obj/item/stack/sheet/mineral/wood))
if(!stop_messages)
to_chat(usr, "The snatcher does not accept [W].")
return 0 //I don't care, but the existing code rejects them for not being "sheets" *shrug* -Sayu
var/current = 0
for(var/obj/item/stack/sheet/S in contents)
current += S.amount
if(capacity == current)//If it's full, you're done
if(!stop_messages)
to_chat(usr, "<span class='danger'>The snatcher is full.</span>")
return 0
return 1
// Modified handle_item_insertion. Would prefer not to, but...
/obj/item/storage/bag/sheetsnatcher/handle_item_insertion(obj/item/W, prevent_warning = 0)
var/obj/item/stack/sheet/S = W
if(!istype(S))
return 0
var/amount
var/inserted = 0
var/current = 0
for(var/obj/item/stack/sheet/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/sheet/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)
usr.dropItemToGround(S)
if (usr.client && usr.s_active != src)
usr.client.screen -= S
S.dropped(usr)
if(!S.amount)
qdel(S)
else
if(S.pulledby)
S.pulledby.stop_pulling()
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)
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/sheet/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.
standard_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/sheet/S in contents)
while(S.amount)
var/obj/item/stack/sheet/N = new S.type(location)
var/stacksize = min(S.amount,N.max_amount)
N.amount = stacksize
S.amount -= stacksize
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, atom/new_location)
var/obj/item/stack/sheet/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/sheet/temp = new S.type(src)
temp.amount = S.amount - S.max_amount
S.amount = S.max_amount
return ..(S,new_location)
/obj/item/storage/bag/sheetsnatcher/ComponentInitialize()
. = ..()
GET_COMPONENT(STR, /datum/component/storage/concrete/stack)
STR.allow_quick_empty = TRUE
STR.can_hold = typecacheof(list(/obj/item/stack/sheet))
STR.cant_hold = typecacheof(list(/obj/item/stack/sheet/mineral/sandstone, /obj/item/stack/sheet/mineral/wood))
STR.max_combined_stack_amount = 300
// -----------------------------
// Sheet Snatcher (Cyborg)
@@ -320,6 +236,10 @@
desc = ""
capacity = 500//Borgs get more because >specialization
/obj/item/storage/bag/sheetsnatcher/borg/ComponentInitialize()
. = ..()
GET_COMPONENT(STR, /datum/component/storage/concrete/stack)
STR.max_combined_stack_amount = 500
// -----------------------------
// Book bag
@@ -330,14 +250,18 @@
desc = "A bag for books."
icon = 'icons/obj/library.dmi'
icon_state = "bookbag"
display_contents_with_number = 0 //This would look really stupid otherwise
storage_slots = 7
max_combined_w_class = 21
max_w_class = WEIGHT_CLASS_NORMAL
w_class = WEIGHT_CLASS_BULKY //Bigger than a book because physics
can_hold = list(/obj/item/book, /obj/item/storage/book, /obj/item/spellbook)
resistance_flags = FLAMMABLE
/obj/item/storage/bag/books/ComponentInitialize()
. = ..()
GET_COMPONENT(STR, /datum/component/storage)
STR.max_w_class = WEIGHT_CLASS_NORMAL
STR.max_combined_w_class = 21
STR.max_items = 7
STR.display_numerical_stacking = FALSE
STR.can_hold = typecacheof(list(/obj/item/book, /obj/item/storage/book, /obj/item/spellbook))
/*
* Trays - Agouri
*/
@@ -353,14 +277,18 @@
w_class = WEIGHT_CLASS_BULKY
flags_1 = CONDUCT_1
materials = list(MAT_METAL=3000)
preposition = "on"
/obj/item/storage/bag/tray/ComponentInitialize()
. = ..()
GET_COMPONENT(STR, /datum/component/storage)
STR.insert_preposition = "on"
/obj/item/storage/bag/tray/attack(mob/living/M, mob/living/user)
..()
. = ..()
// Drop all the things. All of them.
var/list/obj/item/oldContents = contents.Copy()
quick_empty()
GET_COMPONENT(STR, /datum/component/storage)
STR.quick_empty()
// Make each item scatter a bit
for(var/obj/item/I in oldContents)
spawn()
@@ -377,20 +305,20 @@
if(ishuman(M) || ismonkey(M))
if(prob(10))
M.Knockdown(40)
update_icon()
/obj/item/storage/bag/tray/proc/rebuild_overlays()
/obj/item/storage/bag/tray/update_icon()
cut_overlays()
for(var/obj/item/I in contents)
add_overlay(mutable_appearance(I.icon, I.icon_state))
/obj/item/storage/bag/tray/remove_from_storage(obj/item/W as obj, atom/new_location)
..()
rebuild_overlays()
/obj/item/storage/bag/tray/handle_item_insertion(obj/item/I, prevent_warning = 0)
add_overlay(mutable_appearance(I.icon, I.icon_state))
/obj/item/storage/bag/tray/Entered()
. = ..()
update_icon()
/obj/item/storage/bag/tray/Exited()
. = ..()
update_icon()
/*
* Chemistry bag
@@ -401,12 +329,17 @@
icon = 'icons/obj/chemical.dmi'
icon_state = "bag"
desc = "A bag for storing pills, patches, and bottles."
storage_slots = 50
max_combined_w_class = 200
w_class = WEIGHT_CLASS_TINY
can_hold = list(/obj/item/reagent_containers/pill, /obj/item/reagent_containers/glass/beaker, /obj/item/reagent_containers/glass/bottle)
resistance_flags = FLAMMABLE
/obj/item/storage/bag/chemistry/ComponentInitialize()
. = ..()
GET_COMPONENT(STR, /datum/component/storage)
STR.max_combined_w_class = 200
STR.max_items = 50
STR.insert_preposition = "in"
STR.can_hold = typecacheof(list(/obj/item/reagent_containers/pill, /obj/item/reagent_containers/glass/beaker, /obj/item/reagent_containers/glass/bottle))
/*
* Biowaste bag (mostly for xenobiologists)
*/
@@ -416,8 +349,13 @@
icon = 'icons/obj/chemical.dmi'
icon_state = "biobag"
desc = "A bag for the safe transportation and disposal of biowaste and other biological materials."
storage_slots = 25
max_combined_w_class = 200
w_class = WEIGHT_CLASS_TINY
can_hold = list(/obj/item/slime_extract, /obj/item/reagent_containers/syringe, /obj/item/reagent_containers/glass/beaker, /obj/item/reagent_containers/glass/bottle, /obj/item/reagent_containers/blood, /obj/item/reagent_containers/hypospray/medipen, /obj/item/reagent_containers/food/snacks/deadmouse, /obj/item/reagent_containers/food/snacks/monkeycube)
resistance_flags = FLAMMABLE
/obj/item/storage/bag/bio/ComponentInitialize()
. = ..()
GET_COMPONENT(STR, /datum/component/storage)
STR.max_combined_w_class = 200
STR.max_items = 25
STR.insert_preposition = "in"
STR.can_hold = typecacheof(list(/obj/item/slime_extract, /obj/item/reagent_containers/syringe, /obj/item/reagent_containers/glass/beaker, /obj/item/reagent_containers/glass/bottle, /obj/item/reagent_containers/blood, /obj/item/reagent_containers/hypospray/medipen, /obj/item/reagent_containers/food/snacks/deadmouse, /obj/item/reagent_containers/food/snacks/monkeycube))
+155 -115
View File
@@ -32,40 +32,30 @@
desc = "Holds tools."
icon_state = "utilitybelt"
item_state = "utility"
<<<<<<< HEAD
can_hold = list(
=======
content_overlays = TRUE
/obj/item/storage/belt/utility/ComponentInitialize()
. = ..()
GET_COMPONENT(STR, /datum/component/storage)
var/static/list/can_hold = typecacheof(list(
>>>>>>> 4fca080... Merge pull request #37381 from DaxDupont/toolbelts
/obj/item/crowbar,
/obj/item/screwdriver,
/obj/item/weldingtool,
/obj/item/wirecutters,
/obj/item/wrench,
/obj/item/device/multitool,
/obj/item/device/flashlight,
/obj/item/multitool,
/obj/item/flashlight,
/obj/item/stack/cable_coil,
/obj/item/device/t_scanner,
/obj/item/device/analyzer,
/obj/item/device/geiger_counter,
/obj/item/t_scanner,
/obj/item/analyzer,
/obj/item/geiger_counter,
/obj/item/extinguisher/mini,
/obj/item/device/radio,
/obj/item/radio,
/obj/item/clothing/gloves,
/obj/item/holosign_creator,
<<<<<<< HEAD
/obj/item/device/assembly/signaler
)
content_overlays = TRUE
=======
/obj/item/assembly/signaler
))
STR.can_hold = can_hold
>>>>>>> 4fca080... Merge pull request #37381 from DaxDupont/toolbelts
/obj/item/storage/belt/utility/chief
name = "\improper Chief Engineer's toolbelt" //"the Chief Engineer's toolbelt", because "Chief Engineer's toolbelt" is not a proper noun
@@ -77,20 +67,19 @@
new /obj/item/screwdriver/power(src)
new /obj/item/crowbar/power(src)
new /obj/item/weldingtool/experimental(src)//This can be changed if this is too much
new /obj/item/device/multitool(src)
new /obj/item/multitool(src)
new /obj/item/stack/cable_coil(src,30,pick("red","yellow","orange"))
new /obj/item/extinguisher/mini(src)
new /obj/item/device/analyzer(src)
new /obj/item/analyzer(src)
//much roomier now that we've managed to remove two tools
/obj/item/storage/belt/utility/full/PopulateContents()
new /obj/item/screwdriver(src)
new /obj/item/wrench(src)
new /obj/item/weldingtool(src)
new /obj/item/crowbar(src)
new /obj/item/wirecutters(src)
new /obj/item/device/multitool(src)
new /obj/item/multitool(src)
new /obj/item/stack/cable_coil(src,30,pick("red","yellow","orange"))
/obj/item/storage/belt/utility/full/engi/PopulateContents()
@@ -99,7 +88,7 @@
new /obj/item/weldingtool/largetank(src)
new /obj/item/crowbar(src)
new /obj/item/wirecutters(src)
new /obj/item/device/multitool(src)
new /obj/item/multitool(src)
new /obj/item/stack/cable_coil(src,30,pick("red","yellow","orange"))
@@ -109,7 +98,7 @@
new /obj/item/weldingtool(src)
new /obj/item/crowbar(src)
new /obj/item/wirecutters(src)
new /obj/item/device/t_scanner(src)
new /obj/item/t_scanner(src)
new /obj/item/extinguisher/mini(src)
/obj/item/storage/belt/utility/servant/PopulateContents()
@@ -118,20 +107,21 @@
new /obj/item/wrench/brass(src)
new /obj/item/crowbar/brass(src)
new /obj/item/weldingtool/experimental/brass(src)
new /obj/item/device/multitool(src)
new /obj/item/multitool(src)
new /obj/item/stack/cable_coil(src, 30, "yellow")
/obj/item/storage/belt/medical
name = "medical belt"
desc = "Can hold various medical equipment."
icon_state = "medicalbelt"
item_state = "medical"
max_w_class = WEIGHT_CLASS_BULKY
can_hold = list(
/obj/item/device/healthanalyzer,
/obj/item/storage/belt/medical/ComponentInitialize()
. = ..()
GET_COMPONENT(STR, /datum/component/storage)
STR.max_w_class = WEIGHT_CLASS_BULKY
STR.can_hold = typecacheof(list(
/obj/item/healthanalyzer,
/obj/item/dnainjector,
/obj/item/reagent_containers/dropper,
/obj/item/reagent_containers/glass/beaker,
@@ -143,11 +133,11 @@
/obj/item/storage/fancy/cigarettes,
/obj/item/storage/pill_bottle,
/obj/item/stack/medical,
/obj/item/device/flashlight/pen,
/obj/item/flashlight/pen,
/obj/item/extinguisher/mini,
/obj/item/reagent_containers/hypospray,
/obj/item/device/sensor_device,
/obj/item/device/radio,
/obj/item/sensor_device,
/obj/item/radio,
/obj/item/clothing/gloves/,
/obj/item/lazarus_injector,
/obj/item/bikehorn/rubberducky,
@@ -161,7 +151,7 @@
/obj/item/retractor,
/obj/item/cautery,
/obj/item/hemostat,
/obj/item/device/geiger_counter,
/obj/item/geiger_counter,
/obj/item/clothing/neck/stethoscope,
/obj/item/stamp,
/obj/item/clothing/glasses,
@@ -171,76 +161,80 @@
/obj/item/storage/bag/bio,
/obj/item/reagent_containers/blood,
/obj/item/tank/internals/emergency_oxygen,
/obj/item/pinpointer/crew,
/obj/item/gun/syringe/syndicate,
/obj/item/implantcase,
/obj/item/implant,
/obj/item/implanter,
/obj/item/hypospray
)
// CIT CHANGE added hypospray mk IIs to belt /obj/item/hypospray
/obj/item/pinpointer/crew
))
/obj/item/storage/belt/security
name = "security belt"
desc = "Can hold security gear like handcuffs and flashes."
icon_state = "securitybelt"
item_state = "security"//Could likely use a better one.
storage_slots = 5
max_w_class = WEIGHT_CLASS_NORMAL //Because the baton wouldn't fit otherwise. - Neerti
can_hold = list(
content_overlays = TRUE
/obj/item/storage/belt/security/ComponentInitialize()
. = ..()
GET_COMPONENT(STR, /datum/component/storage)
STR.max_items = 5
STR.max_w_class = WEIGHT_CLASS_NORMAL
STR.can_hold = typecacheof(list(
/obj/item/melee/baton,
/obj/item/melee/classic_baton,
/obj/item/grenade,
/obj/item/reagent_containers/spray/pepper,
/obj/item/restraints/handcuffs,
/obj/item/device/assembly/flash/handheld,
/obj/item/assembly/flash/handheld,
/obj/item/clothing/glasses,
/obj/item/ammo_casing/shotgun,
/obj/item/ammo_box,
/obj/item/reagent_containers/food/snacks/donut,
/obj/item/kitchen/knife/combat,
/obj/item/device/flashlight/seclite,
/obj/item/flashlight/seclite,
/obj/item/melee/classic_baton/telescopic,
/obj/item/device/radio,
/obj/item/radio,
/obj/item/clothing/gloves,
/obj/item/restraints/legcuffs/bola,
/obj/item/holosign_creator/security
)
content_overlays = TRUE
/obj/item/restraints/legcuffs/bola
))
/obj/item/storage/belt/security/full/PopulateContents()
new /obj/item/reagent_containers/spray/pepper(src)
new /obj/item/restraints/handcuffs(src)
new /obj/item/grenade/flashbang(src)
new /obj/item/device/assembly/flash/handheld(src)
new /obj/item/assembly/flash/handheld(src)
new /obj/item/melee/baton/loaded(src)
update_icon()
/obj/item/storage/belt/mining
name = "explorer's webbing"
desc = "A versatile chest rig, cherished by miners and hunters alike."
icon_state = "explorer1"
item_state = "explorer1"
storage_slots = 6
w_class = WEIGHT_CLASS_BULKY
max_w_class = WEIGHT_CLASS_BULKY //Pickaxes are big.
max_combined_w_class = 20 //Not an issue with this whitelist, probably.
can_hold = list(
/obj/item/storage/belt/mining/ComponentInitialize()
. = ..()
GET_COMPONENT(STR, /datum/component/storage)
STR.max_items = 6
STR.max_w_class = WEIGHT_CLASS_BULKY
STR.max_combined_w_class = 20
STR.can_hold = typecacheof(list(
/obj/item/crowbar,
/obj/item/screwdriver,
/obj/item/weldingtool,
/obj/item/wirecutters,
/obj/item/wrench,
/obj/item/device/multitool,
/obj/item/device/flashlight,
/obj/item/multitool,
/obj/item/flashlight,
/obj/item/stack/cable_coil,
/obj/item/device/analyzer,
/obj/item/analyzer,
/obj/item/extinguisher/mini,
/obj/item/device/radio,
/obj/item/radio,
/obj/item/clothing/gloves,
/obj/item/resonator,
/obj/item/device/mining_scanner,
/obj/item/mining_scanner,
/obj/item/pickaxe,
/obj/item/stack/sheet/animalhide,
/obj/item/stack/sheet/sinew,
@@ -251,19 +245,19 @@
/obj/item/stack/medical,
/obj/item/kitchen/knife,
/obj/item/reagent_containers/hypospray,
/obj/item/device/gps,
/obj/item/gps,
/obj/item/storage/bag/ore,
/obj/item/survivalcapsule,
/obj/item/device/t_scanner/adv_mining_scanner,
/obj/item/t_scanner/adv_mining_scanner,
/obj/item/reagent_containers/pill,
/obj/item/storage/pill_bottle,
/obj/item/stack/ore,
/obj/item/reagent_containers/food/drinks,
/obj/item/organ/regenerative_core,
/obj/item/device/wormhole_jaunter,
/obj/item/wormhole_jaunter,
/obj/item/storage/bag/plants,
/obj/item/stack/marker_beacon
)
))
/obj/item/storage/belt/mining/vendor
@@ -276,27 +270,35 @@
/obj/item/storage/belt/mining/primitive
name = "hunter's belt"
desc = "A versatile belt, woven from sinew."
storage_slots = 5
icon_state = "ebelt"
item_state = "ebelt"
/obj/item/storage/belt/mining/primitive/ComponentInitialize()
. = ..()
GET_COMPONENT(STR, /datum/component/storage)
STR.max_items = 5
/obj/item/storage/belt/soulstone
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 = "soulstonebelt"
item_state = "soulstonebelt"
storage_slots = 6
can_hold = list(
/obj/item/device/soulstone
)
/obj/item/storage/belt/soulstone/ComponentInitialize()
. = ..()
GET_COMPONENT(STR, /datum/component/storage)
STR.max_items = 6
STR.can_hold = typecacheof(list(
/obj/item/soulstone
))
/obj/item/storage/belt/soulstone/full/PopulateContents()
for(var/i in 1 to 6)
new /obj/item/device/soulstone(src)
new /obj/item/soulstone(src)
/obj/item/storage/belt/soulstone/full/chappy/PopulateContents()
for(var/i in 1 to 6)
new /obj/item/device/soulstone/anybody/chaplain(src)
new /obj/item/soulstone/anybody/chaplain(src)
/obj/item/storage/belt/champion
name = "championship belt"
@@ -304,8 +306,12 @@
icon_state = "championbelt"
item_state = "champion"
materials = list(MAT_GOLD=400)
storage_slots = 1
can_hold = list(
/obj/item/storage/belt/champion/ComponentInitialize()
. = ..()
GET_COMPONENT(STR, /datum/component/storage)
STR.max_items = 1
STR.can_hold = list(
/obj/item/clothing/mask/luchador
)
@@ -314,7 +320,11 @@
desc = "A set of tactical webbing worn by Syndicate boarding parties."
icon_state = "militarywebbing"
item_state = "militarywebbing"
max_w_class = WEIGHT_CLASS_SMALL
/obj/item/storage/belt/military/ComponentInitialize()
. = ..()
GET_COMPONENT(STR, /datum/component/storage)
STR.max_w_class = WEIGHT_CLASS_SMALL
/obj/item/storage/belt/military/abductor
name = "agent belt"
@@ -329,10 +339,9 @@
new /obj/item/weldingtool/abductor(src)
new /obj/item/crowbar/abductor(src)
new /obj/item/wirecutters/abductor(src)
new /obj/item/device/multitool/abductor(src)
new /obj/item/multitool/abductor(src)
new /obj/item/stack/cable_coil(src,30,"white")
/obj/item/storage/belt/military/army
name = "army belt"
desc = "A belt used by military forces."
@@ -344,25 +353,34 @@
desc = "A tactical assault belt."
icon_state = "assaultbelt"
item_state = "security"
storage_slots = 6
/obj/item/storage/belt/military/assault/ComponentInitialize()
. = ..()
GET_COMPONENT(STR, /datum/component/storage)
STR.max_items = 6
/obj/item/storage/belt/grenade
name = "grenadier belt"
desc = "A belt for holding grenades."
icon_state = "grenadebeltnew"
item_state = "security"
max_w_class = WEIGHT_CLASS_BULKY
display_contents_with_number = TRUE
storage_slots = 30
max_combined_w_class = 60 //needs to be this high
can_hold = list(
/obj/item/storage/belt/grenade/ComponentInitialize()
. = ..()
GET_COMPONENT(STR, /datum/component/storage)
STR.max_items = 30
STR.display_numerical_stacking = TRUE
STR.max_combined_w_class = 60
STR.max_w_class = WEIGHT_CLASS_BULKY
STR.can_hold = typecacheof(list(
/obj/item/grenade,
/obj/item/screwdriver,
/obj/item/lighter,
/obj/item/device/multitool,
/obj/item/multitool,
/obj/item/reagent_containers/food/drinks/bottle/molotov,
/obj/item/grenade/plastic/c4,
)
))
/obj/item/storage/belt/grenade/full/PopulateContents()
new /obj/item/grenade/flashbang(src)
new /obj/item/grenade/smokebomb(src)
@@ -391,17 +409,21 @@
new /obj/item/grenade/syndieminibomb(src)
new /obj/item/grenade/syndieminibomb(src)
new /obj/item/screwdriver(src)
new /obj/item/device/multitool(src)
new /obj/item/multitool(src)
/obj/item/storage/belt/wands
name = "wand belt"
desc = "A belt designed to hold various rods of power. A veritable fanny pack of exotic magic."
icon_state = "soulstonebelt"
item_state = "soulstonebelt"
storage_slots = 6
can_hold = list(
/obj/item/storage/belt/wands/ComponentInitialize()
. = ..()
GET_COMPONENT(STR, /datum/component/storage)
STR.max_items = 6
STR.can_hold = typecacheof(list(
/obj/item/gun/magic/wand
)
))
/obj/item/storage/belt/wands/full/PopulateContents()
new /obj/item/gun/magic/wand/death(src)
@@ -420,45 +442,57 @@
desc = "A belt used to hold most janitorial supplies."
icon_state = "janibelt"
item_state = "janibelt"
storage_slots = 6
max_w_class = WEIGHT_CLASS_BULKY // Set to this so the light replacer can fit.
can_hold = list(
/obj/item/storage/belt/janitor/ComponentInitialize()
. = ..()
GET_COMPONENT(STR, /datum/component/storage)
STR.max_items = 6
STR.max_w_class = WEIGHT_CLASS_BULKY // Set to this so the light replacer can fit.
STR.can_hold = typecacheof(list(
/obj/item/grenade/chem_grenade,
/obj/item/device/lightreplacer,
/obj/item/device/flashlight,
/obj/item/lightreplacer,
/obj/item/flashlight,
/obj/item/reagent_containers/spray,
/obj/item/soap,
/obj/item/holosign_creator,
/obj/item/key/janitor,
/obj/item/clothing/gloves,
/obj/item/melee/flyswatter,
/obj/item/device/assembly/mousetrap
)
/obj/item/assembly/mousetrap
))
/obj/item/storage/belt/bandolier
name = "bandolier"
desc = "A bandolier for holding shotgun ammunition."
icon_state = "bandolier"
item_state = "bandolier"
storage_slots = 18
display_contents_with_number = TRUE
can_hold = list(
/obj/item/storage/belt/bandolier/ComponentInitialize()
. = ..()
GET_COMPONENT(STR, /datum/component/storage)
STR.max_items = 18
STR.display_numerical_stacking = TRUE
STR.can_hold = typecacheof(list(
/obj/item/ammo_casing/shotgun
)
))
/obj/item/storage/belt/holster
name = "shoulder holster"
desc = "A holster to carry a handgun and ammo. WARNING: Badasses only."
icon_state = "holster"
item_state = "holster"
storage_slots = 3
max_w_class = WEIGHT_CLASS_NORMAL
can_hold = list(
alternate_worn_layer = UNDER_SUIT_LAYER
/obj/item/storage/belt/holster/ComponentInitialize()
. = ..()
GET_COMPONENT(STR, /datum/component/storage)
STR.max_items = 3
STR.max_w_class = WEIGHT_CLASS_NORMAL
STR.can_hold = typecacheof(list(
/obj/item/gun/ballistic/automatic/pistol,
/obj/item/gun/ballistic/revolver,
/obj/item/ammo_box,
)
alternate_worn_layer = UNDER_SUIT_LAYER
))
/obj/item/storage/belt/holster/full/PopulateContents()
new /obj/item/gun/ballistic/revolver/detective(src)
@@ -470,8 +504,12 @@
desc = "A dorky fannypack for keeping small items in."
icon_state = "fannypack_leather"
item_state = "fannypack_leather"
storage_slots = 3
max_w_class = WEIGHT_CLASS_SMALL
/obj/item/storage/belt/fannypack/ComponentInitialize()
. = ..()
GET_COMPONENT(STR, /datum/component/storage)
STR.max_items = 3
STR.max_w_class = WEIGHT_CLASS_SMALL
/obj/item/storage/belt/fannypack/black
name = "black fannypack"
@@ -528,26 +566,29 @@
desc = "An ornate sheath designed to hold an officer's blade."
icon_state = "sheath"
item_state = "sheath"
storage_slots = 1
rustle_jimmies = FALSE
w_class = WEIGHT_CLASS_BULKY
max_w_class = WEIGHT_CLASS_BULKY
can_hold = list(
/obj/item/storage/belt/sabre/ComponentInitialize()
. = ..()
GET_COMPONENT(STR, /datum/component/storage)
STR.max_items = 1
STR.rustle_sound = FALSE
STR.max_w_class = WEIGHT_CLASS_BULKY
STR.can_hold = typecacheof(list(
/obj/item/melee/sabre
)
))
/obj/item/storage/belt/sabre/examine(mob/user)
..()
if(contents.len)
if(length(contents))
to_chat(user, "<span class='notice'>Alt-click it to quickly draw the blade.</span>")
/obj/item/storage/belt/sabre/AltClick(mob/user)
if(!iscarbon(user) || !user.canUseTopic(src, BE_CLOSE, ismonkey(user)))
return
if(contents.len)
if(length(contents))
var/obj/item/I = contents[1]
user.visible_message("[user] takes [I] out of [src].", "<span class='notice'>You take [I] out of [src].</span>",\
)
user.visible_message("[user] takes [I] out of [src].", "<span class='notice'>You take [I] out of [src].</span>")
user.put_in_hands(I)
update_icon()
else
@@ -564,7 +605,6 @@
L.regenerate_icons()
..()
/obj/item/storage/belt/sabre/PopulateContents()
new /obj/item/melee/sabre(src)
update_icon()
update_icon()
+5 -3
View File
@@ -5,11 +5,15 @@
icon_state ="book"
throw_speed = 2
throw_range = 5
storage_slots = 1
w_class = WEIGHT_CLASS_NORMAL
resistance_flags = FLAMMABLE
var/title = "book"
/obj/item/storage/book/ComponentInitialize()
. = ..()
GET_COMPONENT(STR, /datum/component/storage)
STR.max_items = 1
/obj/item/storage/book/attack_self(mob/user)
to_chat(user, "<span class='notice'>The pages of [title] have been cut out!</span>")
@@ -205,8 +209,6 @@ GLOBAL_LIST_INIT(bibleitemstates, list("bible", "koran", "scrapbook", "bible",
attack_verb = list("attacked", "burned", "blessed", "damned", "scorched")
var/uses = 1
/obj/item/storage/book/bible/syndicate/attack_self(mob/living/carbon/human/H)
if (uses)
H.mind.isholy = TRUE
+33 -18
View File
@@ -64,9 +64,6 @@
if(!ispath(foldable))
return
//Close any open UI windows first
close_all()
to_chat(user, "<span class='notice'>You fold [src] flat.</span>")
var/obj/item/I = new foldable
qdel(src)
@@ -360,7 +357,11 @@
desc = "<B>Instructions:</B> <I>Heat in microwave. Product will cool if not eaten within seven minutes.</I>"
icon_state = "donkpocketbox"
illustration=null
can_hold = list(/obj/item/reagent_containers/food/snacks/donkpocket)
/obj/item/storage/box/donkpockets/ComponentInitialize()
. = ..()
GET_COMPONENT(STR, /datum/component/storage)
STR.can_hold = typecacheof(list(/obj/item/reagent_containers/food/snacks/donkpocket))
/obj/item/storage/box/donkpockets/PopulateContents()
for(var/i in 1 to 6)
@@ -370,10 +371,14 @@
name = "monkey cube box"
desc = "Drymate brand monkey cubes. Just add water!"
icon_state = "monkeycubebox"
storage_slots = 7
can_hold = list(/obj/item/reagent_containers/food/snacks/monkeycube)
illustration = null
/obj/item/storage/box/monkeycubes/ComponentInitialize()
. = ..()
GET_COMPONENT(STR, /datum/component/storage)
STR.max_items = 7
STR.can_hold = typecacheof(list(/obj/item/reagent_containers/food/snacks/monkeycube))
/obj/item/storage/box/monkeycubes/PopulateContents()
for(var/i in 1 to 5)
new /obj/item/reagent_containers/food/snacks/monkeycube(src)
@@ -522,12 +527,15 @@
desc = "Eight wrappers of fun! Ages 8 and up. Not suitable for children."
icon = 'icons/obj/toy.dmi'
icon_state = "spbox"
storage_slots = 8
can_hold = list(/obj/item/toy/snappop)
/obj/item/storage/box/snappops/ComponentInitialize()
. = ..()
GET_COMPONENT(STR, /datum/component/storage)
STR.can_hold = typecacheof(list(/obj/item/toy/snappop))
STR.max_items = 8
/obj/item/storage/box/snappops/PopulateContents()
for(var/i in 1 to storage_slots)
new /obj/item/toy/snappop(src)
SendSignal(COMSIG_TRY_STORAGE_FILL_TYPE, /obj/item/toy/snappop)
/obj/item/storage/box/matches
name = "matchbox"
@@ -535,14 +543,17 @@
icon = 'icons/obj/cigarettes.dmi'
icon_state = "matchbox"
item_state = "zippo"
storage_slots = 10
w_class = WEIGHT_CLASS_TINY
slot_flags = SLOT_BELT
can_hold = list(/obj/item/match)
/obj/item/storage/box/matches/ComponentInitialize()
. = ..()
GET_COMPONENT(STR, /datum/component/storage)
STR.max_items = 10
STR.can_hold = typecacheof(list(/obj/item/match))
/obj/item/storage/box/matches/PopulateContents()
for(var/i in 1 to storage_slots)
new /obj/item/match(src)
SendSignal(COMSIG_TRY_STORAGE_FILL_TYPE, /obj/item/match)
/obj/item/storage/box/matches/attackby(obj/item/match/W as obj, mob/user as mob, params)
if(istype(W, /obj/item/match))
@@ -557,10 +568,14 @@
lefthand_file = 'icons/mob/inhands/equipment/medical_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/medical_righthand.dmi'
foldable = /obj/item/stack/sheet/cardboard //BubbleWrap
storage_slots=21
can_hold = list(/obj/item/light/tube, /obj/item/light/bulb)
max_combined_w_class = 21
use_to_pickup = 1 // for picking up broken bulbs, not that most people will try
/obj/item/storage/box/lights/ComponentInitialize()
. = ..()
GET_COMPONENT(STR, /datum/component/storage)
STR.max_items = 21
STR.can_hold = typecacheof(list(/obj/item/light/tube, /obj/item/light/bulb))
STR.max_combined_w_class = 21
STR.click_gather = TRUE
/obj/item/storage/box/lights/bulbs/PopulateContents()
for(var/i in 1 to 21)
+6 -14
View File
@@ -10,13 +10,17 @@
throw_speed = 2
throw_range = 4
w_class = WEIGHT_CLASS_BULKY
max_w_class = WEIGHT_CLASS_NORMAL
max_combined_w_class = 21
attack_verb = list("bashed", "battered", "bludgeoned", "thrashed", "whacked")
resistance_flags = FLAMMABLE
max_integrity = 150
var/folder_path = /obj/item/folder //this is the path of the folder that gets spawned in New()
/obj/item/storage/briefcase/ComponentInitialize()
. = ..()
GET_COMPONENT(STR, /datum/component/storage)
STR.max_w_class = WEIGHT_CLASS_NORMAL
STR.max_combined_w_class = 21
/obj/item/storage/briefcase/PopulateContents()
new /obj/item/pen(src)
var/obj/item/folder/folder = new folder_path(src)
@@ -31,20 +35,8 @@
..()
/obj/item/storage/briefcase/sniperbundle
name = "briefcase"
desc = "It's label reads genuine hardened Captain leather, but suspiciously has no other tags or branding. Smells like L'Air du Temps."
icon_state = "briefcase"
flags_1 = CONDUCT_1
force = 10
hitsound = "swing_hit"
throw_speed = 2
throw_range = 4
w_class = WEIGHT_CLASS_BULKY
max_w_class = WEIGHT_CLASS_NORMAL
max_combined_w_class = 21
attack_verb = list("bashed", "battered", "bludgeoned", "thrashed", "whacked")
resistance_flags = FLAMMABLE
max_integrity = 150
/obj/item/storage/briefcase/sniperbundle/PopulateContents()
..() // in case you need any paperwork done after your rampage
+10 -6
View File
@@ -3,22 +3,26 @@
//////////////////////////////////
/obj/item/storage/daki
name = "dakimakura"
name = "dakimakura"
desc = "A large pillow depicting a girl in a compromising position. Featuring as many dimensions as you."
icon = 'icons/obj/daki.dmi'
icon_state = "daki_base"
slot_flags = SLOT_BACK
storage_slots = 3
w_class = 4
max_w_class = 3
max_combined_w_class = 21
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.
/obj/item/storage/daki/ComponentInitialize()
. = ..()
GET_COMPONENT(STR, /datum/component/storage)
STR.max_w_class = WEIGHT_CLASS_SMALL
STR.max_combined_w_class = 21
STR.max_items = 3
STR.cant_hold = typecacheof(list(/obj/item/disk/nuclear))
/obj/item/storage/daki/attack_self(mob/living/user)
var/body_choice
var/custom_name
if(icon_state == "daki_base")
body_choice = input("Pick a body.") in dakimakura_options
icon_state = "daki_[body_choice]"
+52 -26
View File
@@ -25,7 +25,8 @@
var/fancy_open = FALSE
/obj/item/storage/fancy/PopulateContents()
for(var/i = 1 to storage_slots)
GET_COMPONENT(STR, /datum/component/storage)
for(var/i = 1 to STR.max_items)
new spawn_type(src)
/obj/item/storage/fancy/update_icon()
@@ -37,7 +38,7 @@
/obj/item/storage/fancy/examine(mob/user)
..()
if(fancy_open)
if(contents.len == 1)
if(length(contents) == 1)
to_chat(user, "There is one [icon_type] left.")
else
to_chat(user, "There are [contents.len <= 0 ? "no" : "[contents.len]"] [icon_type]s left.")
@@ -45,20 +46,17 @@
/obj/item/storage/fancy/attack_self(mob/user)
fancy_open = !fancy_open
update_icon()
/obj/item/storage/fancy/dump_content_at(atom/dest_object, mob/user)
. = ..()
if(.)
fancy_open = TRUE
update_icon()
/obj/item/storage/fancy/handle_item_insertion(obj/item/W, prevent_warning = 0, mob/user)
/obj/item/storage/fancy/Exited()
. = ..()
fancy_open = TRUE
return ..()
update_icon()
/obj/item/storage/fancy/remove_from_storage(obj/item/W, atom/new_location, burn = 0)
/obj/item/storage/fancy/Entered()
. = ..()
fancy_open = TRUE
return ..()
update_icon()
/*
* Donut Box
@@ -69,11 +67,15 @@
icon_state = "donutbox6"
icon_type = "donut"
name = "donut box"
storage_slots = 6
can_hold = list(/obj/item/reagent_containers/food/snacks/donut)
spawn_type = /obj/item/reagent_containers/food/snacks/donut
fancy_open = TRUE
/obj/item/storage/fancy/donut_box/ComponentInitialize()
. = ..()
GET_COMPONENT(STR, /datum/component/storage)
STR.max_items = 6
STR.can_hold = typecacheof(list(/obj/item/reagent_containers/food/snacks/donut))
/*
* Egg Box
*/
@@ -87,10 +89,14 @@
righthand_file = 'icons/mob/inhands/misc/food_righthand.dmi'
name = "egg box"
desc = "A carton for containing eggs."
storage_slots = 12
can_hold = list(/obj/item/reagent_containers/food/snacks/egg)
spawn_type = /obj/item/reagent_containers/food/snacks/egg
/obj/item/storage/fancy/egg_box/ComponentInitialize()
. = ..()
GET_COMPONENT(STR, /datum/component/storage)
STR.max_items = 12
STR.can_hold = typecacheof(list(/obj/item/reagent_containers/food/snacks/egg))
/*
* Candle Box
*/
@@ -102,12 +108,16 @@
icon_state = "candlebox5"
icon_type = "candle"
item_state = "candlebox5"
storage_slots = 5
throwforce = 2
slot_flags = SLOT_BELT
spawn_type = /obj/item/candle
fancy_open = TRUE
/obj/item/storage/fancy/candle_box/ComponentInitialize()
. = ..()
GET_COMPONENT(STR, /datum/component/storage)
STR.max_items = 5
/obj/item/storage/fancy/candle_box/attack_self(mob_user)
return
@@ -123,11 +133,15 @@
w_class = WEIGHT_CLASS_TINY
throwforce = 0
slot_flags = SLOT_BELT
storage_slots = 6
can_hold = list(/obj/item/clothing/mask/cigarette, /obj/item/lighter)
icon_type = "cigarette"
spawn_type = /obj/item/clothing/mask/cigarette/space_cigarette
/obj/item/storage/fancy/cigarettes/ComponentInitialize()
. = ..()
GET_COMPONENT(STR, /datum/component/storage)
STR.max_items = 6
STR.can_hold = typecacheof(list(/obj/item/clothing/mask/cigarette, /obj/item/lighter))
/obj/item/storage/fancy/cigarettes/examine(mob/user)
..()
to_chat(user, "<span class='notice'>Alt-click to extract contents.</span>")
@@ -137,7 +151,7 @@
return
var/obj/item/clothing/mask/cigarette/W = locate(/obj/item/clothing/mask/cigarette) in contents
if(W && contents.len > 0)
remove_from_storage(W, user)
SendSignal(COMSIG_TRY_STORAGE_TAKE, W, user)
user.put_in_hands(W)
contents -= W
to_chat(user, "<span class='notice'>You take a [icon_type] out of the pack.</span>")
@@ -174,7 +188,7 @@
if(cig)
if(M == user && contents.len > 0 && !user.wear_mask)
var/obj/item/clothing/mask/cigarette/W = cig
remove_from_storage(W, M)
SendSignal(COMSIG_TRY_STORAGE_TAKE, W, M)
M.equip_to_slot_if_possible(W, slot_wear_mask)
contents -= W
to_chat(user, "<span class='notice'>You take a [icon_type] out of the pack.</span>")
@@ -243,11 +257,15 @@
w_class = WEIGHT_CLASS_TINY
icon = 'icons/obj/cigarettes.dmi'
icon_state = "cig_paper_pack"
storage_slots = 10
icon_type = "rolling paper"
can_hold = list(/obj/item/rollingpaper)
spawn_type = /obj/item/rollingpaper
/obj/item/storage/fancy/rollingpapers/ComponentInitialize()
. = ..()
GET_COMPONENT(STR, /datum/component/storage)
STR.max_items = 10
STR.can_hold = typecacheof(list(/obj/item/rollingpaper))
/obj/item/storage/fancy/rollingpapers/update_icon()
cut_overlays()
if(!contents.len)
@@ -263,11 +281,15 @@
icon = 'icons/obj/cigarettes.dmi'
icon_state = "cigarcase"
w_class = WEIGHT_CLASS_NORMAL
storage_slots = 5
can_hold = list(/obj/item/clothing/mask/cigarette/cigar)
icon_type = "premium cigar"
spawn_type = /obj/item/clothing/mask/cigarette/cigar
/obj/item/storage/fancy/cigarettes/cigars/ComponentInitialize()
. = ..()
GET_COMPONENT(STR, /datum/component/storage)
STR.max_items = 5
STR.can_hold = typecacheof(list(/obj/item/clothing/mask/cigarette/cigar))
/obj/item/storage/fancy/cigarettes/cigars/update_icon()
cut_overlays()
if(fancy_open)
@@ -302,6 +324,10 @@
icon_type = "chocolate"
lefthand_file = 'icons/mob/inhands/misc/food_lefthand.dmi'
righthand_file = 'icons/mob/inhands/misc/food_righthand.dmi'
storage_slots = 8
can_hold = list(/obj/item/reagent_containers/food/snacks/tinychocolate)
spawn_type = /obj/item/reagent_containers/food/snacks/tinychocolate
/obj/item/storage/fancy/heart_box/ComponentInitialize()
. = ..()
GET_COMPONENT(STR, /datum/component/storage)
STR.max_items = 8
STR.can_hold = typecacheof(list(/obj/item/reagent_containers/food/snacks/tinychocolate))
+13 -21
View File
@@ -16,7 +16,7 @@
righthand_file = 'icons/mob/inhands/equipment/medical_righthand.dmi'
throw_speed = 3
throw_range = 7
var/empty = 0
var/empty = FALSE
/obj/item/storage/firstaid/regular
icon_state = "firstaid"
@@ -41,7 +41,6 @@
icon_state = "firstaid"
desc = "A first aid kit with the ability to heal common types of injuries."
/obj/item/storage/firstaid/ancient/PopulateContents()
if(empty)
return
@@ -142,7 +141,11 @@
name = "combat medical kit"
desc = "I hope you've got insurance."
icon_state = "bezerk"
max_w_class = WEIGHT_CLASS_NORMAL
/obj/item/storage/firstaid/tactical/ComponentInitialize()
. = ..()
GET_COMPONENT(STR, /datum/component/storage)
STR.max_w_class = WEIGHT_CLASS_NORMAL
/obj/item/storage/firstaid/tactical/PopulateContents()
if(empty)
@@ -155,10 +158,10 @@
new /obj/item/reagent_containers/syringe/lethal/choral(src)
new /obj/item/clothing/glasses/hud/health/night(src)
/*
* Pill Bottles
*/
/obj/item/storage/pill_bottle
name = "pill bottle"
desc = "It's an airtight container for storing medication."
@@ -168,24 +171,13 @@
lefthand_file = 'icons/mob/inhands/equipment/medical_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/medical_righthand.dmi'
w_class = WEIGHT_CLASS_SMALL
can_hold = list(/obj/item/reagent_containers/pill, /obj/item/dice)
allow_quick_gather = 1
use_to_pickup = 1
/obj/item/storage/pill_bottle/MouseDrop(obj/over_object) //Quick pillbottle fix. -Agouri
if(ishuman(usr) || ismonkey(usr)) //Can monkeys even place items in the pocket slots? Leaving this in just in case~
var/mob/M = usr
if(!istype(over_object, /obj/screen) || !Adjacent(M))
return ..()
if(!M.incapacitated() && istype(over_object, /obj/screen/inventory/hand))
var/obj/screen/inventory/hand/H = over_object
if(M.putItemFromInventoryInHandIfPossible(src, H.held_index))
add_fingerprint(usr)
if(over_object == usr && in_range(src, usr) || usr.contents.Find(src))
if(usr.s_active)
usr.s_active.close(usr)
src.show_to(usr)
/obj/item/storage/pill_bottle/ComponentInitialize()
. = ..()
GET_COMPONENT(STR, /datum/component/storage)
STR.allow_quick_gather = TRUE
STR.click_gather = TRUE
STR.can_hold = typecacheof(list(/obj/item/reagent_containers/pill, /obj/item/dice))
/obj/item/storage/pill_bottle/suicide_act(mob/user)
user.visible_message("<span class='suicide'>[user] is trying to get the cap off [src]! It looks like [user.p_theyre()] trying to commit suicide!</span>")
@@ -1,88 +0,0 @@
/obj/item/storage/internal
storage_slots = 2
max_w_class = WEIGHT_CLASS_SMALL
max_combined_w_class = 50 // Limited by slots, not combined weight class
w_class = WEIGHT_CLASS_BULKY
rustle_jimmies = FALSE
/obj/item/storage/internal/Adjacent(A)
if(loc)
return loc.Adjacent(A)
/obj/item/storage/internal/pocket
var/priority = TRUE
// TRUE if opens when clicked, like a backpack.
// FALSE if opens only when dragged on mob's icon (hidden pocket)
var/quickdraw = FALSE
// TRUE if you can quickdraw items from it with alt-click.
/obj/item/storage/internal/pocket/New()
..()
if(loc)
name = loc.name
/obj/item/storage/internal/pocket/handle_item_insertion(obj/item/W, prevent_warning = 0, mob/user)
. = ..()
if(. && silent && !prevent_warning)
if(quickdraw)
to_chat(user, "<span class='notice'>You discreetly slip [W] into [src]. Alt-click [src] to remove it.</span>")
else
to_chat(user, "<span class='notice'>You discreetly slip [W] into [src].</span>")
/obj/item/storage/internal/pocket/big
max_w_class = WEIGHT_CLASS_NORMAL
/obj/item/storage/internal/pocket/small
storage_slots = 1
/obj/item/storage/internal/pocket/tiny
storage_slots = 1
max_w_class = WEIGHT_CLASS_TINY
priority = FALSE
/obj/item/storage/internal/pocket/shoes
can_hold = list(
/obj/item/kitchen/knife, /obj/item/switchblade, /obj/item/pen,
/obj/item/scalpel, /obj/item/reagent_containers/syringe, /obj/item/dnainjector,
/obj/item/reagent_containers/hypospray/medipen, /obj/item/reagent_containers/dropper,
/obj/item/implanter, /obj/item/screwdriver, /obj/item/weldingtool/mini,
/obj/item/device/firing_pin
)
//can hold both regular pens and energy daggers. made for your every-day tactical curators/murderers.
priority = FALSE
quickdraw = TRUE
silent = TRUE
/obj/item/storage/internal/pocket/shoes/clown
can_hold = list(
/obj/item/kitchen/knife, /obj/item/switchblade, /obj/item/pen,
/obj/item/scalpel, /obj/item/reagent_containers/syringe, /obj/item/dnainjector,
/obj/item/reagent_containers/hypospray/medipen, /obj/item/reagent_containers/dropper,
/obj/item/implanter, /obj/item/screwdriver, /obj/item/weldingtool/mini,
/obj/item/device/firing_pin, /obj/item/bikehorn)
/obj/item/storage/internal/pocket/small/detective
priority = TRUE // so the detectives would discover pockets in their hats
/obj/item/storage/internal/pocket/small/detective/PopulateContents()
new /obj/item/reagent_containers/food/drinks/flask/det(src)
/obj/item/storage/internal/pocket/pocketprotector
storage_slots = 3
max_w_class = WEIGHT_CLASS_TINY
can_hold = list( //Same items as a PDA
/obj/item/pen,
/obj/item/toy/crayon,
/obj/item/lipstick,
/obj/item/device/flashlight/pen,
/obj/item/clothing/mask/cigarette)
/obj/item/storage/internal/pocket/pocketprotector/cosmetology/PopulateContents()
for(var/i in 1 to 3)
new /obj/item/lipstick/random(src)
/obj/item/storage/internal/pocket/pocketprotector/full/PopulateContents()
new /obj/item/pen/red(src)
new /obj/item/pen(src)
new /obj/item/pen/blue(src)
+27 -44
View File
@@ -6,29 +6,33 @@
lefthand_file = 'icons/mob/inhands/equipment/medical_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/medical_righthand.dmi'
w_class = WEIGHT_CLASS_BULKY
max_w_class = WEIGHT_CLASS_NORMAL
max_combined_w_class = 14 //The sum of the w_classes of all the items in this storage item.
storage_slots = 4
req_access = list(ACCESS_ARMORY)
var/locked = TRUE
var/broken = FALSE
var/open = FALSE
var/icon_locked = "lockbox+l"
var/icon_closed = "lockbox"
var/icon_broken = "lockbox+b"
/obj/item/storage/lockbox/ComponentInitialize()
. = ..()
GET_COMPONENT(STR, /datum/component/storage)
STR.max_w_class = WEIGHT_CLASS_NORMAL
STR.max_combined_w_class = 14
STR.max_items = 4
/obj/item/storage/lockbox/attackby(obj/item/W, mob/user, params)
var/locked = SendSignal(COMSIG_IS_STORAGE_LOCKED)
if(W.GetID())
if(broken)
to_chat(user, "<span class='danger'>It appears to be broken.</span>")
return
if(allowed(user))
locked = !locked
SendSignal(COMSIG_TRY_STORAGE_SET_LOCKSTATE, !locked)
locked = SendSignal(COMSIG_IS_STORAGE_LOCKED)
if(locked)
icon_state = icon_locked
to_chat(user, "<span class='danger'>You lock the [src.name]!</span>")
close_all()
SendSignal(COMSIG_TRY_STORAGE_HIDE_ALL)
return
else
icon_state = icon_closed
@@ -42,51 +46,25 @@
else
to_chat(user, "<span class='danger'>It's locked!</span>")
/obj/item/storage/lockbox/MouseDrop(over_object, src_location, over_location)
if (locked)
src.add_fingerprint(usr)
to_chat(usr, "<span class='warning'>It's locked!</span>")
return 0
..()
/obj/item/storage/lockbox/emag_act(mob/user)
if(!broken)
broken = TRUE
locked = FALSE
SendSignal(COMSIG_TRY_STORAGE_SET_LOCKSTATE, FALSE)
desc += "It appears to be broken."
icon_state = src.icon_broken
if(user)
visible_message("<span class='warning'>\The [src] has been broken by [user] with an electromagnetic card!</span>")
return
/obj/item/storage/lockbox/show_to(mob/user)
if(locked)
to_chat(user, "<span class='warning'>It's locked!</span>")
else
..()
return
//Check the destination item type for contentto.
/obj/item/storage/lockbox/storage_contents_dump_act(obj/item/storage/src_object, mob/user)
if(locked)
to_chat(user, "<span class='warning'>It's locked!</span>")
return null
open = TRUE
return ..()
/obj/item/storage/lockbox/can_be_inserted(obj/item/W, stop_messages = 0)
if(locked)
return 0
return ..()
/obj/item/storage/lockbox/handle_item_insertion(obj/item/W, prevent_warning = 0, mob/user)
/obj/item/storage/lockbox/Entered()
. = ..()
open = TRUE
update_icon()
return ..()
/obj/item/storage/lockbox/remove_from_storage(obj/item/W, atom/new_location, burn = 0)
/obj/item/storage/lockbox/Exited()
. = ..()
open = TRUE
update_icon()
return ..()
/obj/item/storage/lockbox/loyalty
name = "lockbox of mindshield implants"
@@ -97,7 +75,6 @@
new /obj/item/implantcase/mindshield(src)
new /obj/item/implanter/mindshield(src)
/obj/item/storage/lockbox/clusterbang
name = "lockbox of clusterbangs"
desc = "You have a bad feeling about opening this."
@@ -114,23 +91,28 @@
lefthand_file = 'icons/mob/inhands/equipment/medical_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/medical_righthand.dmi'
w_class = WEIGHT_CLASS_NORMAL
max_w_class = WEIGHT_CLASS_SMALL
storage_slots = 10
max_combined_w_class = 20
req_access = list(ACCESS_CAPTAIN)
icon_locked = "medalbox+l"
icon_closed = "medalbox"
icon_broken = "medalbox+b"
can_hold = list(/obj/item/clothing/accessory/medal)
/obj/item/storage/lockbox/medal/ComponentInitialize()
. = ..()
GET_COMPONENT(STR, /datum/component/storage)
STR.max_w_class = WEIGHT_CLASS_SMALL
STR.max_items = 10
STR.max_combined_w_class = 20
STR.can_hold = typecacheof(list(/obj/item/clothing/accessory/medal))
/obj/item/storage/lockbox/medal/examine(mob/user)
..()
var/locked = SendSignal(COMSIG_IS_STORAGE_LOCKED)
if(!locked)
to_chat(user, "<span class='notice'>Alt-click to [open ? "close":"open"] it.</span>")
/obj/item/storage/lockbox/medal/AltClick(mob/user)
if(user.canUseTopic(src, BE_CLOSE))
if(!locked)
if(!SendSignal(COMSIG_IS_STORAGE_LOCKED))
open = (open ? FALSE : TRUE)
update_icon()
..()
@@ -148,6 +130,7 @@
/obj/item/storage/lockbox/medal/update_icon()
cut_overlays()
var/locked = SendSignal(COMSIG_IS_STORAGE_LOCKED)
if(locked)
icon_state = "medalbox+l"
open = FALSE
+51 -60
View File
@@ -15,7 +15,6 @@
var/icon_locking = "secureb"
var/icon_sparking = "securespark"
var/icon_opened = "secure0"
var/locked = TRUE
var/code = ""
var/l_code = null
var/l_set = 0
@@ -23,16 +22,20 @@
var/l_hacking = 0
var/open = FALSE
w_class = WEIGHT_CLASS_NORMAL
max_w_class = WEIGHT_CLASS_SMALL
max_combined_w_class = 14
desc = "This shouldn't exist. If it does, create an issue report."
/obj/item/storage/secure/ComponentInitialize()
. = ..()
GET_COMPONENT(STR, /datum/component/storage)
STR.max_w_class = WEIGHT_CLASS_SMALL
STR.max_combined_w_class = 14
/obj/item/storage/secure/examine(mob/user)
..()
to_chat(user, text("The service panel is currently <b>[open ? "unscrewed" : "screwed shut"]</b>."))
/obj/item/storage/secure/attackby(obj/item/W, mob/user, params)
if(locked)
if(SendSignal(COMSIG_IS_STORAGE_LOCKED))
if (istype(W, /obj/item/screwdriver))
if (W.use_tool(src, user, 20))
open =! open
@@ -41,15 +44,15 @@
if (istype(W, /obj/item/wirecutters))
to_chat(user, "<span class='danger'>[src] is protected from this sort of tampering, yet it appears the internal memory wires can still be <b>pulsed</b>.</span>")
if ((istype(W, /obj/item/device/multitool)) && (!l_hacking))
if(src.open == 1)
if(open == 1)
to_chat(user, "<span class='danger'>Now attempting to reset internal memory, please hold.</span>")
src.l_hacking = 1
l_hacking = 1
if (W.use_tool(src, user, 400))
to_chat(user, "<span class='danger'>Internal memory reset - lock has been disengaged.</span>")
src.l_set = 0
src.l_hacking = 0
l_set = 0
l_hacking = 0
else
src.l_hacking = 0
l_hacking = 0
else
to_chat(user, "<span class='notice'>You must <b>unscrew</b> the service panel before you can pulse the wiring.</span>")
return
@@ -60,23 +63,17 @@
// -> storage/attackby() what with handle insertion, etc
return ..()
/obj/item/storage/secure/MouseDrop(over_object, src_location, over_location)
if (locked)
src.add_fingerprint(usr)
to_chat(usr, "<span class='warning'>It's locked!</span>")
return 0
..()
/obj/item/storage/secure/attack_self(mob/user)
var/locked = SendSignal(COMSIG_IS_STORAGE_LOCKED)
user.set_machine(src)
var/dat = text("<TT><B>[]</B><BR>\n\nLock Status: []",src, (src.locked ? "LOCKED" : "UNLOCKED"))
var/dat = text("<TT><B>[]</B><BR>\n\nLock Status: []",src, (locked ? "LOCKED" : "UNLOCKED"))
var/message = "Code"
if ((src.l_set == 0) && (!src.l_setshort))
if ((l_set == 0) && (!l_setshort))
dat += text("<p>\n<b>5-DIGIT PASSCODE NOT SET.<br>ENTER NEW PASSCODE.</b>")
if (src.l_setshort)
if (l_setshort)
dat += text("<p>\n<font color=red><b>ALERT: MEMORY SYSTEM ERROR - 6040 201</b></font>")
message = text("[]", src.code)
if (!src.locked)
message = text("[]", code)
if (!locked)
message = "*****"
dat += text("<HR>\n>[]<BR>\n<A href='?src=[REF(src)];type=1'>1</A>-<A href='?src=[REF(src)];type=2'>2</A>-<A href='?src=[REF(src)];type=3'>3</A><BR>\n<A href='?src=[REF(src)];type=4'>4</A>-<A href='?src=[REF(src)];type=5'>5</A>-<A href='?src=[REF(src)];type=6'>6</A><BR>\n<A href='?src=[REF(src)];type=7'>7</A>-<A href='?src=[REF(src)];type=8'>8</A>-<A href='?src=[REF(src)];type=9'>9</A><BR>\n<A href='?src=[REF(src)];type=R'>R</A>-<A href='?src=[REF(src)];type=0'>0</A>-<A href='?src=[REF(src)];type=E'>E</A><BR>\n</TT>", message)
user << browse(dat, "window=caselock;size=300x280")
@@ -87,44 +84,33 @@
return
if (href_list["type"])
if (href_list["type"] == "E")
if ((src.l_set == 0) && (length(src.code) == 5) && (!src.l_setshort) && (src.code != "ERROR"))
src.l_code = src.code
src.l_set = 1
else if ((src.code == src.l_code) && (src.l_set == 1))
src.locked = FALSE
if ((l_set == 0) && (length(code) == 5) && (!l_setshort) && (code != "ERROR"))
l_code = code
l_set = 1
else if ((code == l_code) && (l_set == 1))
SendSignal(COMSIG_TRY_STORAGE_SET_LOCKSTATE, FALSE)
cut_overlays()
add_overlay(icon_opened)
src.code = null
code = null
else
src.code = "ERROR"
code = "ERROR"
else
if ((href_list["type"] == "R") && (!src.l_setshort))
src.locked = TRUE
if ((href_list["type"] == "R") && (!l_setshort))
SendSignal(COMSIG_TRY_STORAGE_SET_LOCKSTATE, TRUE)
cut_overlays()
src.code = null
src.close(usr)
code = null
SendSignal(COMSIG_TRY_STORAGE_HIDE_FROM, usr)
else
src.code += text("[]", sanitize_text(href_list["type"]))
if (length(src.code) > 5)
src.code = "ERROR"
src.add_fingerprint(usr)
for(var/mob/M in viewers(1, src.loc))
code += text("[]", sanitize_text(href_list["type"]))
if (length(code) > 5)
code = "ERROR"
add_fingerprint(usr)
for(var/mob/M in viewers(1, loc))
if ((M.client && M.machine == src))
src.attack_self(M)
attack_self(M)
return
return
/obj/item/storage/secure/storage_contents_dump_act(obj/item/storage/src_object, mob/user)
if(locked)
to_chat(user, "<span class='warning'>It's locked!</span>")
return null
return ..()
/obj/item/storage/secure/can_be_inserted(obj/item/W, stop_messages = 0)
if(locked)
return 0
return ..()
// -----------------------------
// Secure Briefcase
@@ -142,20 +128,17 @@
throw_speed = 2
throw_range = 4
w_class = WEIGHT_CLASS_BULKY
max_w_class = WEIGHT_CLASS_NORMAL
max_combined_w_class = 21
attack_verb = list("bashed", "battered", "bludgeoned", "thrashed", "whacked")
/obj/item/storage/secure/briefcase/PopulateContents()
new /obj/item/paper(src)
new /obj/item/pen(src)
/obj/item/storage/secure/briefcase/attack_hand(mob/user)
if ((src.loc == user) && (src.locked == 1))
to_chat(usr, "<span class='warning'>[src] is locked and cannot be opened!</span>")
add_fingerprint(user)
else
..()
/obj/item/storage/secure/briefcase/ComponentInitialize()
. = ..()
GET_COMPONENT(STR, /datum/component/storage)
STR.max_combined_w_class = 21
STR.max_w_class = WEIGHT_CLASS_NORMAL
//Syndie variant of Secure Briefcase. Contains space cash, slightly more robust.
/obj/item/storage/secure/briefcase/syndie
@@ -163,7 +146,8 @@
/obj/item/storage/secure/briefcase/syndie/PopulateContents()
..()
for(var/i = 0, i < storage_slots - 2, i++)
GET_COMPONENT(STR, /datum/component/storage)
for(var/i = 0, i < STR.max_items - 2, i++)
new /obj/item/stack/spacecash/c1000(src)
@@ -181,16 +165,23 @@
desc = "Excellent for securing things away from grubby hands."
force = 8
w_class = WEIGHT_CLASS_GIGANTIC
max_w_class = 8
anchored = TRUE
density = FALSE
cant_hold = list(/obj/item/storage/secure/briefcase)
/obj/item/storage/secure/safe/ComponentInitialize()
. = ..()
GET_COMPONENT(STR, /datum/component/storage)
STR.cant_hold = typecacheof(list(/obj/item/storage/secure/briefcase))
STR.max_w_class = 8 //??
/obj/item/storage/secure/safe/PopulateContents()
new /obj/item/paper(src)
new /obj/item/pen(src)
/obj/item/storage/secure/safe/attack_hand(mob/user)
. = ..()
if(.)
return
return attack_self(user)
/obj/item/storage/secure/safe/HoS
+6 -566
View File
@@ -1,583 +1,23 @@
// External storage-related logic:
// /mob/proc/ClickOn() in /_onclick/click.dm - clicking items in storages
// /mob/living/Move() in /modules/mob/living/living.dm - hiding storage boxes on mob movement
// /item/attackby() in /game/objects/items.dm - use_to_pickup and allow_quick_gather functionality
// -- c0
/obj/item/storage
name = "storage"
icon = 'icons/obj/storage.dmi'
w_class = WEIGHT_CLASS_NORMAL
var/silent = 0 // No message on putting items in
var/list/can_hold = new/list() //Typecache of objects which this item can store (if set, it can't store anything else)
var/list/cant_hold = new/list() //Typecache of objects which this item can't store
var/list/is_seeing = new/list() //List of mobs which are currently seeing the contents of this item's storage
var/max_w_class = WEIGHT_CLASS_SMALL //Max size of objects that this object can store (in effect only if can_hold isn't set)
var/max_combined_w_class = 14 //The sum of the w_classes of all the items in this storage item.
var/storage_slots = 7 //The number of storage slots in this container.
var/obj/screen/storage/boxes = null
var/obj/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, 2 = pick all of a type
var/preposition = "in" // You put things 'in' a bag, but trays need 'on'.
var/rustle_jimmies = TRUE //Play the rustle sound on insertion
/obj/item/storage/MouseDrop(atom/over_object)
if(ismob(usr)) //all the check for item manipulation are in other places, you can safely open any storages as anything and its not buggy, i checked
var/mob/M = usr
if(!over_object)
return
if (ismecha(M.loc)) // stops inventory actions in a mech
return
// this must come before the screen objects only block, dunno why it wasn't before
if(over_object == M && M.CanReach(src,view_only = TRUE))
orient2hud(M)
if(M.s_active)
M.s_active.close(M)
show_to(M)
return
if(!M.incapacitated())
if(!istype(over_object, /obj/screen))
return dump_content_at(over_object, M)
if(loc != usr || (loc && loc.loc == usr))
return
playsound(loc, "rustle", 50, 1, -5)
if(istype(over_object, /obj/screen/inventory/hand))
var/obj/screen/inventory/hand/H = over_object
M.putItemFromInventoryInHandIfPossible(src, H.held_index)
add_fingerprint(usr)
/obj/item/storage/MouseDrop_T(atom/movable/O, mob/user)
if(isitem(O))
var/obj/item/I = O
if(iscarbon(user) || isdrone(user))
var/mob/living/L = user
if(!L.incapacitated() && I == L.get_active_held_item())
if(can_be_inserted(I, 0))
handle_item_insertion(I, 0 , L)
var/component_type = /datum/component/storage/concrete
/obj/item/storage/get_dumping_location(obj/item/storage/source,mob/user)
return src
//Tries to dump content
/obj/item/storage/proc/dump_content_at(atom/dest_object, mob/user)
var/atom/dump_destination = dest_object.get_dumping_location()
if(Adjacent(user) && dump_destination && user.Adjacent(dump_destination))
if(dump_destination.storage_contents_dump_act(src, user))
playsound(loc, "rustle", 50, 1, -5)
return 1
return 0
/obj/item/storage/Initialize()
. = ..()
PopulateContents()
//Object behaviour on storage dump
/obj/item/storage/storage_contents_dump_act(obj/item/storage/src_object, mob/user)
var/list/things = src_object.contents.Copy()
var/datum/progressbar/progress = new(user, things.len, src)
while (do_after(user, 10, TRUE, src, FALSE, CALLBACK(src, .proc/handle_mass_item_insertion, things, src_object, user, progress)))
stoplag(1)
qdel(progress)
orient2hud(user)
src_object.orient2hud(user)
if(user.s_active) //refresh the HUD to show the transfered contents
user.s_active.close(user)
user.s_active.show_to(user)
return 1
/obj/item/storage/proc/handle_mass_item_insertion(list/things, obj/item/storage/src_object, mob/user, datum/progressbar/progress)
for(var/obj/item/I in things)
things -= I
if(I.loc != src_object)
continue
if(user.s_active != src_object)
if(I.on_found(user))
break
if(can_be_inserted(I,0,user))
handle_item_insertion(I, TRUE, user)
if (TICK_CHECK)
progress.update(progress.goal - things.len)
return TRUE
progress.update(progress.goal - things.len)
return FALSE
/obj/item/storage/proc/return_inv()
var/list/L = list()
L += contents
for(var/obj/item/storage/S in src)
L += S.return_inv()
return L
/obj/item/storage/proc/show_to(mob/user)
if(!user.client)
return
if(user.s_active != src && (user.stat == CONSCIOUS))
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 |= boxes
user.client.screen |= closer
user.client.screen |= contents
user.s_active = src
is_seeing |= user
/obj/item/storage/throw_at(atom/target, range, speed, mob/thrower, spin=1, diagonals_first = 0, datum/callback/callback)
close_all()
return ..()
/obj/item/storage/proc/hide_from(mob/user)
if(!user.client)
return
user.client.screen -= boxes
user.client.screen -= closer
user.client.screen -= contents
if(user.s_active == src)
user.s_active = null
is_seeing -= user
/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
/obj/item/storage/proc/close(mob/user)
hide_from(user)
user.s_active = null
/obj/item/storage/proc/close_all()
for(var/mob/M in can_see_contents())
close(M)
. = 1 //returns 1 if any mobs actually got a close(M) call
//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
boxes.screen_loc = "[tx]:,[ty] to [mx],[my]"
for(var/obj/O in contents)
if(QDELETED(O))
continue
O.screen_loc = "[cx],[cy]"
O.layer = ABOVE_HUD_LAYER
O.plane = ABOVE_HUD_PLANE
cx++
if(cx > mx)
cx = tx
cy--
closer.screen_loc = "[mx+1],[my]"
//This proc draws out the inventory and places the items on it. It uses the standard position.
/obj/item/storage/proc/standard_orient_objs(rows, cols, list/obj/item/display_contents)
var/cx = 4
var/cy = 2+rows
boxes.screen_loc = "4:16,2:16 to [4+cols]:16,[2+rows]:16"
if(display_contents_with_number)
for(var/datum/numbered_display/ND in display_contents)
ND.sample_object.mouse_opacity = MOUSE_OPACITY_OPAQUE
ND.sample_object.screen_loc = "[cx]:16,[cy]:16"
ND.sample_object.maptext = "<font color='white'>[(ND.number > 1)? "[ND.number]" : ""]</font>"
ND.sample_object.layer = ABOVE_HUD_LAYER
ND.sample_object.plane = ABOVE_HUD_PLANE
cx++
if(cx > (4+cols))
cx = 4
cy--
else
for(var/obj/O in contents)
if(QDELETED(O))
continue
O.mouse_opacity = MOUSE_OPACITY_OPAQUE //This is here so storage items that spawn with contents correctly have the "click around item to equip"
O.screen_loc = "[cx]:16,[cy]:16"
O.maptext = ""
O.layer = ABOVE_HUD_LAYER
O.plane = ABOVE_HUD_PLANE
cx++
if(cx > (4+cols))
cx = 4
cy--
closer.screen_loc = "[4+cols+1]:16,2:16"
/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 determines 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)
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)
if(QDELETED(I))
continue
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) )
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.
standard_orient_objs(row_num, col_count, numbered_contents)
//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, stop_messages = 0, mob/user)
if(!istype(W) || (W.flags_1 & ABSTRACT_1))
return //Not an item
if(loc == W)
return 0 //Means the item is already in the storage item
if(contents.len >= storage_slots)
if(!stop_messages)
to_chat(usr, "<span class='warning'>[src] is full, make some space!</span>")
return 0 //Storage item is full
if(can_hold.len)
if(!is_type_in_typecache(W, can_hold))
if(!stop_messages)
to_chat(usr, "<span class='warning'>[src] cannot hold [W]!</span>")
return 0
if(is_type_in_typecache(W, cant_hold)) //Check for specific items which this container can't hold.
if(!stop_messages)
to_chat(usr, "<span class='warning'>[src] cannot hold [W]!</span>")
return 0
if(W.w_class > max_w_class)
if(!stop_messages)
to_chat(usr, "<span class='warning'>[W] is too big for [src]!</span>")
return 0
var/sum_w_class = W.w_class
for(var/obj/item/I in contents)
sum_w_class += I.w_class //Adds up the combined w_classes which will be in the storage item if the item is added to it.
if(sum_w_class > max_combined_w_class)
if(!stop_messages)
to_chat(usr, "<span class='warning'>[W] won't fit in [src], make some space!</span>")
return 0
if(W.w_class >= w_class && (istype(W, /obj/item/storage)))
if(!istype(src, /obj/item/storage/backpack/holding)) //bohs should be able to hold backpacks again. The override for putting a boh in a boh is in backpack.dm.
if(!stop_messages)
to_chat(usr, "<span class='warning'>[src] cannot hold [W] as it's a storage item of the same size!</span>")
return 0 //To prevent the stacking of same sized storage items.
if(W.flags_1 & NODROP_1) //SHOULD be handled in unEquip, but better safe than sorry.
to_chat(usr, "<span class='warning'>\the [W] is stuck to your hand, you can't put it in \the [src]!</span>")
return 0
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, prevent_warning = 0, mob/user)
if(!istype(W))
return 0
if(usr)
if(!usr.transferItemToLoc(W, src))
return 0
else
W.forceMove(src)
if(silent)
prevent_warning = 1
if(W.pulledby)
W.pulledby.stop_pulling()
W.on_enter_storage(src)
if(usr)
if(usr.client && usr.s_active != src)
usr.client.screen -= W
if(usr.observers && usr.observers.len)
for(var/M in usr.observers)
var/mob/dead/observe = M
if(observe.client && observe.s_active != src)
observe.client.screen -= W
add_fingerprint(usr)
if(rustle_jimmies && !prevent_warning)
playsound(src.loc, "rustle", 50, 1, -5)
if(!prevent_warning)
for(var/mob/M in viewers(usr, null))
if(M == usr)
to_chat(usr, "<span class='notice'>You put [W] [preposition]to [src].</span>")
else if(in_range(M, usr)) //If someone is standing close enough, they can tell what it is...
M.show_message("<span class='notice'>[usr] puts [W] [preposition]to [src].</span>", 1)
else if(W && W.w_class >= 3) //Otherwise they can only see large or normal items from a distance...
M.show_message("<span class='notice'>[usr] puts [W] [preposition]to [src].</span>", 1)
orient2hud(usr)
for(var/mob/M in can_see_contents())
show_to(M)
W.mouse_opacity = MOUSE_OPACITY_OPAQUE //So you can click on the area around the item to equip it, instead of having to pixel hunt
update_icon()
return 1
//Call this proc to handle the removal of an item from the storage item. The item will be moved to the new_location target, if that is null it's being deleted
/obj/item/storage/proc/remove_from_storage(obj/item/W, atom/new_location)
if(!istype(W))
return 0
//Cache this as it should be reusable down the bottom, will not apply if anyone adds a sleep to dropped
//or moving objects, things that should never happen
var/list/seeing_mobs = can_see_contents()
for(var/mob/M in seeing_mobs)
M.client.screen -= W
if(ismob(loc))
var/mob/M = loc
W.dropped(M)
if(new_location)
W.forceMove(new_location)
//Reset the items values
W.layer = initial(W.layer)
W.plane = initial(W.plane)
W.mouse_opacity = initial(W.mouse_opacity)
if(W.maptext)
W.maptext = ""
//We don't want to call this if the item is being destroyed
W.on_exit_storage(src)
else
//Being destroyed, just move to nullspace now (so it's not in contents for the icon update)
W.moveToNullspace()
for(var/mob/M in seeing_mobs)
orient2hud(M)
show_to(M)
update_icon()
return 1
/obj/item/storage/deconstruct(disassembled = TRUE)
var/drop_loc = loc
if(ismob(loc))
drop_loc = get_turf(src)
for(var/obj/item/I in contents)
remove_from_storage(I, drop_loc)
qdel(src)
//This proc is called when you want to place an item into the storage item.
/obj/item/storage/attackby(obj/item/W, mob/user, params)
..()
if(istype(W, /obj/item/hand_labeler))
var/obj/item/hand_labeler/labeler = W
if(labeler.mode)
return 0
. = 1 //no afterattack
if(iscyborg(user))
return //Robots can't interact with storage items.
if(!can_be_inserted(W, 0 , user))
return 1
handle_item_insertion(W, 0 , user)
/obj/item/storage/ComponentInitialize()
AddComponent(component_type)
/obj/item/storage/AllowDrop()
return TRUE
/obj/item/storage/attack_hand(mob/user)
if(user.s_active == src && loc == user) //if you're already looking inside the storage item
user.s_active.close(user)
close(user)
return
if(rustle_jimmies)
playsound(loc, "rustle", 50, 1, -5)
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
orient2hud(user)
if(loc == user)
if(user.s_active)
user.s_active.close(user)
show_to(user)
else
..()
for(var/mob/M in range(1))
if(M.s_active == src)
close(M)
add_fingerprint(user)
/obj/item/storage/attack_paw(mob/user)
return attack_hand(user)
/obj/item/storage/verb/toggle_gathering_mode()
set name = "Switch Gathering Method"
set category = "Object"
if(usr.stat || !usr.canmove || usr.restrained())
return
collection_mode = (collection_mode+1)%3
switch (collection_mode)
if(2)
to_chat(usr, "[src] now picks up all items of a single type at once.")
if(1)
to_chat(usr, "[src] now picks up all items in a tile at once.")
if(0)
to_chat(usr, "[src] now picks up one item at a time.")
// Empty all the contents onto the current turf
/obj/item/storage/verb/quick_empty()
set name = "Empty Contents"
set category = "Object"
if((!ishuman(usr) && (loc != usr)) || usr.stat || usr.restrained() ||!usr.canmove)
return
var/turf/T = get_turf(src)
var/list/things = contents.Copy()
var/datum/progressbar/progress = new(usr, things.len, T)
while (do_after(usr, 10, TRUE, T, FALSE, CALLBACK(src, .proc/mass_remove_from_storage, T, things, progress)))
stoplag(1)
qdel(progress)
/obj/item/storage/proc/mass_remove_from_storage(atom/target, list/things, datum/progressbar/progress)
for(var/obj/item/I in things)
things -= I
if (I.loc != src)
continue
remove_from_storage(I, target)
if (TICK_CHECK)
progress.update(progress.goal - things.len)
return TRUE
progress.update(progress.goal - things.len)
return FALSE
// Empty all the contents onto the current turf, without checking the user's status.
/obj/item/storage/proc/do_quick_empty()
var/turf/T = get_turf(src)
if(usr)
hide_from(usr)
for(var/obj/item/I in contents)
remove_from_storage(I, T)
/obj/item/storage/Initialize(mapload)
. = ..()
can_hold = typecacheof(can_hold)
cant_hold = typecacheof(cant_hold)
if(allow_quick_empty)
verbs += /obj/item/storage/verb/quick_empty
else
verbs -= /obj/item/storage/verb/quick_empty
if(allow_quick_gather)
verbs += /obj/item/storage/verb/toggle_gathering_mode
else
verbs -= /obj/item/storage/verb/toggle_gathering_mode
boxes = new /obj/screen/storage()
boxes.name = "storage"
boxes.master = src
boxes.icon_state = "block"
boxes.screen_loc = "7,7 to 10,8"
boxes.layer = HUD_LAYER
boxes.plane = HUD_PLANE
closer = new /obj/screen/close()
closer.master = src
closer.icon_state = "backpack_close"
closer.layer = ABOVE_HUD_LAYER
closer.plane = ABOVE_HUD_PLANE
orient2hud()
PopulateContents()
/obj/item/storage/Destroy()
for(var/obj/O in contents)
O.mouse_opacity = initial(O.mouse_opacity)
close_all()
qdel(boxes)
qdel(closer)
return ..()
/obj/item/storage/emp_act(severity)
if(!isliving(loc))
for(var/obj/O in contents)
O.emp_act(severity)
..()
/obj/item/storage/attack_self(mob/user)
//Clicking on itself will empty it, if it has the verb to do that.
if(user.get_active_held_item() == src)
if(verbs.Find(/obj/item/storage/verb/quick_empty))
quick_empty()
/obj/item/storage/handle_atom_del(atom/A)
if(A in contents)
usr = null
remove_from_storage(A, null)
/obj/item/storage/contents_explosion(severity, target)
for(var/atom/A in contents)
A.ex_act(severity, target)
+18 -6
View File
@@ -109,10 +109,14 @@
name = "suspicious looking toolbox"
icon_state = "syndicate"
item_state = "toolbox_syndi"
silent = 1
force = 15
throwforce = 18
/obj/item/storage/toolbox/syndicate/ComponentInitialize()
. = ..()
GET_COMPONENT(STR, /datum/component/storage)
STR.silent = TRUE
/obj/item/storage/toolbox/syndicate/PopulateContents()
new /obj/item/screwdriver/nuke(src)
new /obj/item/wrench(src)
@@ -145,12 +149,16 @@
has_latches = FALSE
resistance_flags = FIRE_PROOF | ACID_PROOF
w_class = WEIGHT_CLASS_HUGE
max_w_class = WEIGHT_CLASS_NORMAL
max_combined_w_class = 28
storage_slots = 28
attack_verb = list("robusted", "crushed", "smashed")
var/fabricator_type = /obj/item/clockwork/replica_fabricator/scarab
/obj/item/storage/toolbox/brass/ComponentInitialize()
. = ..()
GET_COMPONENT(STR, /datum/component/storage)
STR.max_w_class = WEIGHT_CLASS_NORMAL
STR.max_combined_w_class = 28
STR.max_items = 28
/obj/item/storage/toolbox/brass/prefilled/PopulateContents()
new fabricator_type(src)
new /obj/item/screwdriver/brass(src)
@@ -180,10 +188,14 @@
desc = "A toolbox painted bright green. Why anyone would store art supplies in a toolbox is beyond you, but it has plenty of extra space."
icon_state = "green"
item_state = "artistic_toolbox"
max_combined_w_class = 20
storage_slots = 10
w_class = WEIGHT_CLASS_GIGANTIC //Holds more than a regular toolbox!
/obj/item/storage/toolbox/artistic/ComponentInitialize()
. = ..()
GET_COMPONENT(STR, /datum/component/storage)
STR.max_combined_w_class = 20
STR.max_items = 10
/obj/item/storage/toolbox/artistic/PopulateContents()
new/obj/item/storage/crayons(src)
new/obj/item/crowbar(src)
+11 -3
View File
@@ -192,8 +192,12 @@
/obj/item/storage/box/syndie_kit/space
name = "boxed space suit and helmet"
can_hold = list(/obj/item/clothing/suit/space/syndicate, /obj/item/clothing/head/helmet/space/syndicate)
max_w_class = WEIGHT_CLASS_NORMAL
/obj/item/storage/box/syndie_kit/space/ComponentInitialize()
. = ..()
GET_COMPONENT(STR, /datum/component/storage)
STR.max_w_class = WEIGHT_CLASS_NORMAL
STR.can_hold = typecacheof(list(/obj/item/clothing/suit/space/syndicate, /obj/item/clothing/head/helmet/space/syndicate))
/obj/item/storage/box/syndie_kit/space/PopulateContents()
new /obj/item/clothing/suit/space/syndicate/black/red(src) // Black and red is so in right now
@@ -212,7 +216,11 @@
/obj/item/storage/box/syndie_kit/chemical
name = "boxed chemical kit"
storage_slots = 14
/obj/item/storage/box/syndie_kit/chemical/ComponentInitialize()
. = ..()
GET_COMPONENT(STR, /datum/component/storage)
STR.max_items = 14
/obj/item/storage/box/syndie_kit/chemical/PopulateContents()
new /obj/item/reagent_containers/glass/bottle/polonium(src)
+26 -27
View File
@@ -1,11 +1,19 @@
/obj/item/storage/wallet
name = "wallet"
desc = "It can hold a few small and personal things."
storage_slots = 4
icon_state = "wallet"
w_class = WEIGHT_CLASS_SMALL
resistance_flags = FLAMMABLE
can_hold = list(
slot_flags = SLOT_ID
var/obj/item/card/id/front_id = null
var/list/combined_access
/obj/item/storage/wallet/ComponentInitialize()
. = ..()
GET_COMPONENT(STR, /datum/component/storage)
STR.max_items = 4
STR.can_hold = typecacheof(list(
/obj/item/stack/spacecash,
/obj/item/card,
/obj/item/clothing/mask/cigarette,
@@ -26,48 +34,39 @@
/obj/item/reagent_containers/dropper,
/obj/item/reagent_containers/syringe,
/obj/item/screwdriver,
/obj/item/stamp)
slot_flags = SLOT_ID
/obj/item/stamp))
var/obj/item/card/id/front_id = null
var/list/combined_access = list()
/obj/item/storage/wallet/remove_from_storage(obj/item/W, atom/new_location)
. = ..(W, new_location)
if(.)
if(istype(W, /obj/item/card/id))
if(W == front_id)
front_id = null
refreshID()
update_icon()
/obj/item/storage/wallet/Exited(atom/movable/AM)
. = ..()
refreshID()
/obj/item/storage/wallet/proc/refreshID()
combined_access.Cut()
if(!(front_id in src))
front_id = null
for(var/obj/item/card/id/I in contents)
LAZYINITLIST(combined_access)
LAZYCLEARLIST(combined_access)
if(!front_id)
front_id = I
update_icon()
combined_access |= I.access
update_icon()
/obj/item/storage/wallet/handle_item_insertion(obj/item/W, prevent_warning = 0)
/obj/item/storage/wallet/Entered(atom/movable/AM)
. = ..()
if(.)
if(istype(W, /obj/item/card/id))
refreshID()
refreshID()
/obj/item/storage/wallet/update_icon()
icon_state = "wallet"
var/new_state = "wallet"
if(front_id)
icon_state = "wallet_[front_id.icon_state]"
new_state = "wallet_[front_id.icon_state]"
if(new_state != icon_state) //avoid so many icon state changes.
icon_state = new_state
/obj/item/storage/wallet/GetID()
return front_id
/obj/item/storage/wallet/GetAccess()
if(combined_access.len)
if(LAZYLEN(combined_access))
return combined_access
else
return ..()