Revert "12/21 modernizations from TG live"
This commit is contained in:
@@ -8,12 +8,12 @@
|
||||
/obj/item/weapon/storage
|
||||
name = "storage"
|
||||
icon = 'icons/obj/storage.dmi'
|
||||
w_class = WEIGHT_CLASS_NORMAL
|
||||
w_class = 3
|
||||
var/silent = 0 // No message on putting items in
|
||||
var/list/can_hold = new/list() //List of objects which this item can store (if set, it can't store anything else)
|
||||
var/list/cant_hold = new/list() //List of objects which this item can't store (in effect only if can_hold isn't set)
|
||||
var/list/is_seeing = new/list() //List of mobs which are currently seeing the contents of this item's storage
|
||||
var/max_w_class = WEIGHT_CLASS_SMALL //Max size of objects that this object can store (in effect only if can_hold isn't set)
|
||||
var/max_w_class = 2 //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
|
||||
@@ -24,11 +24,10 @@
|
||||
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/weapon/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
|
||||
if(iscarbon(usr) || isdrone(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)
|
||||
@@ -37,9 +36,8 @@
|
||||
if (istype(usr.loc,/obj/mecha)) // 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 && (src.ClickAccessible(M, depth=STORAGE_VIEW_DEPTH) || Adjacent(M)))
|
||||
orient2hud(M)
|
||||
if(over_object == M && Adjacent(M)) // this must come before the screen objects only block
|
||||
orient2hud(M) // dunno why it wasn't before
|
||||
if(M.s_active)
|
||||
M.s_active.close(M)
|
||||
show_to(M)
|
||||
@@ -59,21 +57,14 @@
|
||||
var/obj/screen/inventory/hand/H = over_object
|
||||
if(!M.unEquip(src))
|
||||
return
|
||||
M.put_in_hand(src,H.held_index)
|
||||
switch(H.slot_id)
|
||||
if(slot_r_hand)
|
||||
M.put_in_r_hand(src)
|
||||
if(slot_l_hand)
|
||||
M.put_in_l_hand(src)
|
||||
|
||||
add_fingerprint(usr)
|
||||
|
||||
|
||||
/obj/item/weapon/storage/MouseDrop_T(atom/movable/O, mob/user)
|
||||
if(istype(O, /obj/item))
|
||||
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)
|
||||
|
||||
|
||||
//Check if this storage can dump the items
|
||||
/obj/item/weapon/storage/proc/content_can_dump(atom/dest_object, mob/user)
|
||||
if(Adjacent(user) && dest_object.Adjacent(user))
|
||||
@@ -89,7 +80,7 @@
|
||||
if(I.on_found(user))
|
||||
return
|
||||
if(can_be_inserted(I,0,user))
|
||||
handle_item_insertion(I, TRUE, user)
|
||||
src_object.remove_from_storage(I, src)
|
||||
orient2hud(user)
|
||||
src_object.orient2hud(user)
|
||||
if(user.s_active) //refresh the HUD to show the transfered contents
|
||||
@@ -122,7 +113,7 @@
|
||||
is_seeing |= user
|
||||
|
||||
|
||||
/obj/item/weapon/storage/throw_at(atom/target, range, speed, mob/thrower, spin=1, diagonals_first = 0)
|
||||
/obj/item/weapon/storage/throw_at(atom/target, range, speed, mob/thrower, spin)
|
||||
close_all()
|
||||
return ..()
|
||||
|
||||
@@ -167,7 +158,6 @@
|
||||
for(var/obj/O in contents)
|
||||
O.screen_loc = "[cx],[cy]"
|
||||
O.layer = ABOVE_HUD_LAYER
|
||||
O.plane = ABOVE_HUD_PLANE
|
||||
cx++
|
||||
if(cx > mx)
|
||||
cx = tx
|
||||
@@ -187,7 +177,6 @@
|
||||
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
|
||||
@@ -198,7 +187,6 @@
|
||||
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
|
||||
@@ -217,7 +205,7 @@
|
||||
number = 1
|
||||
|
||||
|
||||
//This proc determines the size of the inventory to be displayed. Please touch it only if you know what you're doing.
|
||||
//This proc determins the size of the inventory to be displayed. Please touch it only if you know what you're doing.
|
||||
/obj/item/weapon/storage/proc/orient2hud(mob/user)
|
||||
var/adjusted_contents = contents.len
|
||||
|
||||
@@ -320,15 +308,8 @@
|
||||
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)
|
||||
playsound(src.loc, "rustle", 50, 1, -5)
|
||||
|
||||
if(!prevent_warning)
|
||||
for(var/mob/M in viewers(usr, null))
|
||||
@@ -348,7 +329,7 @@
|
||||
|
||||
|
||||
//Call this proc to handle the removal of an item from the storage item. The item will be moved to the atom sent as new_target
|
||||
/obj/item/weapon/storage/proc/remove_from_storage(obj/item/W, atom/new_location)
|
||||
/obj/item/weapon/storage/proc/remove_from_storage(obj/item/W, atom/new_location, burn = 0)
|
||||
if(!istype(W))
|
||||
return 0
|
||||
|
||||
@@ -364,43 +345,37 @@
|
||||
var/mob/M = loc
|
||||
W.dropped(M)
|
||||
W.layer = initial(W.layer)
|
||||
W.plane = initial(W.plane)
|
||||
W.loc = new_location
|
||||
|
||||
for(var/mob/M in can_see_contents())
|
||||
orient2hud(M)
|
||||
show_to(M)
|
||||
|
||||
if(usr)
|
||||
orient2hud(usr)
|
||||
if(usr.s_active)
|
||||
usr.s_active.show_to(usr)
|
||||
if(W.maptext)
|
||||
W.maptext = ""
|
||||
W.on_exit_storage(src)
|
||||
update_icon()
|
||||
W.mouse_opacity = initial(W.mouse_opacity)
|
||||
if(burn)
|
||||
W.fire_act()
|
||||
return 1
|
||||
|
||||
/obj/item/weapon/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)
|
||||
|
||||
/obj/item/weapon/storage/empty_object_contents(burn, src.loc)
|
||||
for(var/obj/item/Item in contents)
|
||||
remove_from_storage(Item, src.loc, burn)
|
||||
|
||||
//This proc is called when you want to place an item into the storage item.
|
||||
/obj/item/weapon/storage/attackby(obj/item/W, mob/user, params)
|
||||
..()
|
||||
if(istype(W, /obj/item/weapon/hand_labeler))
|
||||
var/obj/item/weapon/hand_labeler/labeler = W
|
||||
if(labeler.mode)
|
||||
return 0
|
||||
. = 1 //no afterattack
|
||||
if(iscyborg(user))
|
||||
if(isrobot(user))
|
||||
return //Robots can't interact with storage items.
|
||||
|
||||
if(!can_be_inserted(W, 0 , user))
|
||||
return
|
||||
|
||||
handle_item_insertion(W, 0 , user)
|
||||
if(!istype(W, /obj/item/device/boobytrap))
|
||||
handle_item_insertion(W, 0 , user)
|
||||
|
||||
|
||||
/obj/item/weapon/storage/attack_hand(mob/user)
|
||||
@@ -413,11 +388,11 @@
|
||||
|
||||
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.
|
||||
if(H.l_store == src && !H.get_active_hand()) //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())
|
||||
if(H.r_store == src && !H.get_active_hand())
|
||||
H.put_in_hands(src)
|
||||
H.r_store = null
|
||||
return
|
||||
@@ -490,12 +465,10 @@
|
||||
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()
|
||||
|
||||
|
||||
@@ -510,7 +483,7 @@
|
||||
|
||||
|
||||
/obj/item/weapon/storage/emp_act(severity)
|
||||
if(!isliving(loc))
|
||||
if(!istype(loc, /mob/living))
|
||||
for(var/obj/O in contents)
|
||||
O.emp_act(severity)
|
||||
..()
|
||||
@@ -518,7 +491,7 @@
|
||||
|
||||
/obj/item/weapon/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(user.get_active_hand() == src)
|
||||
if(verbs.Find(/obj/item/weapon/storage/verb/quick_empty))
|
||||
quick_empty()
|
||||
|
||||
@@ -526,8 +499,3 @@
|
||||
if(A in contents)
|
||||
usr = null
|
||||
remove_from_storage(A, loc)
|
||||
|
||||
/obj/item/weapon/storage/contents_explosion(severity, target)
|
||||
for(var/atom/A in contents)
|
||||
A.ex_act(severity, target)
|
||||
CHECK_TICK
|
||||
|
||||
Reference in New Issue
Block a user