mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-05-18 12:50:29 +01:00
d5849910e5
* Begin clickcode attack_self fix Begins the work to make everything call back to parent for attack_self so that signals are sacred. * Makes MORE things call the attack_self() parent Yes, I could make special_handling a var on obj/item HOWEVER i want it to be specific so it can be tracked down later and ONLY the objects that use it can be refactored instead of sitting there literally forever and it just becoming 'a thing'. * Finishes making the rest of attack_self call parent. As mentioned, things such as 'specialty_goggles' 'special_handling' and the such are only there to help with attack_self until the attack_self is recoded for those items. * begone foul demon * some more cleanup * These * GOD this was annoying * yeh * Fix this * fLARES * Thesee too * toys! * Even more! * More fixes * Even more * rest of em * these too * Update syndie.dm * hardref clear * Update code/game/gamemodes/nuclear/pinpointer.dm * Update code/game/objects/effects/mines.dm * Update code/game/objects/items/blueprints_vr.dm * Update code/game/objects/items/blueprints_vr.dm * Update code/game/objects/items/contraband_vr.dm * Update code/game/objects/items/crayons.dm * Update code/game/objects/items/crayons.dm * Update code/game/objects/items/gunbox.dm * Update code/game/objects/items/gunbox.dm * Update code/game/objects/items/gunbox_vr.dm * Update code/game/objects/items/gunbox_vr.dm * Update code/game/objects/items/weapons/gift_wrappaper.dm * Update code/game/objects/items/crayons.dm * Update code/game/objects/items/crayons.dm * Update code/game/objects/items/gunbox.dm * these too * Update maintpanel_stack.dm * angry warning * Fixes packaged snacks. Fixes improper var default. * Special handling for these * proper poly types * Fixes magclaws Makes the 'features' it had just part of base magboots that can be adjusted via varswap. * Fixes jackets Fixes https://github.com/VOREStation/VOREStation/issues/18941 * Small bugfix Makes p_Theyre properly capitialize Makes examine show proper wording * Update gift_wrappaper.dm
101 lines
2.8 KiB
Plaintext
101 lines
2.8 KiB
Plaintext
//CONTAINS: Evidence bags and fingerprint cards
|
|
|
|
/obj/item/evidencebag
|
|
name = "evidence bag"
|
|
desc = "An empty evidence bag. Use by clicking on the bag and dragging it to the item you want to bag."
|
|
icon = 'icons/obj/storage.dmi'
|
|
icon_state = "evidenceobj"
|
|
item_state = null
|
|
w_class = ITEMSIZE_SMALL
|
|
var/obj/item/stored_item = null
|
|
|
|
|
|
/obj/item/evidencebag/MouseDrop(var/obj/item/I)
|
|
if (!ishuman(usr))
|
|
return
|
|
if(!istype(I) || I.anchored)
|
|
return ..()
|
|
|
|
var/mob/living/carbon/human/user = usr
|
|
|
|
if(!user.item_is_in_hands(src))
|
|
return //bag must be in your hands to use
|
|
|
|
if (isturf(I.loc))
|
|
if (!user.Adjacent(I))
|
|
return
|
|
else
|
|
//If it isn't on the floor. Do some checks to see if it's in our hands or a box. Otherwise give up.
|
|
if(istype(I.loc,/obj/item/storage)) //in a container.
|
|
var/sdepth = I.storage_depth(user)
|
|
if (sdepth > MAX_STORAGE_REACH)
|
|
return //too deeply nested to access
|
|
|
|
var/obj/item/storage/U = I.loc
|
|
user.client.screen -= I
|
|
U.contents.Remove(I)
|
|
else if(user.item_is_in_hands(I))
|
|
user.drop_from_inventory(I)
|
|
else
|
|
return
|
|
|
|
if(istype(I, /obj/item/evidencebag))
|
|
to_chat(user, span_notice("You find putting an evidence bag in another evidence bag to be slightly absurd."))
|
|
return
|
|
|
|
if(I.w_class > 3)
|
|
to_chat(user, span_notice("[I] won't fit in [src]."))
|
|
return
|
|
|
|
if(contents.len)
|
|
to_chat(user, span_notice("[src] already has something inside it."))
|
|
return
|
|
|
|
user.visible_message("[user] puts [I] into [src]", "You put [I] inside [src].",\
|
|
"You hear a rustle as someone puts something into a plastic bag.")
|
|
|
|
icon_state = "evidence"
|
|
|
|
var/xx = I.pixel_x //save the offset of the item
|
|
var/yy = I.pixel_y
|
|
I.pixel_x = 0 //then remove it so it'll stay within the evidence bag
|
|
I.pixel_y = 0
|
|
var/image/img = image("icon"=I, "layer"=FLOAT_LAYER) //take a snapshot. (necessary to stop the underlays appearing under our inventory-HUD slots ~Carn
|
|
I.pixel_x = xx //and then return it
|
|
I.pixel_y = yy
|
|
add_overlay(img)
|
|
add_overlay("evidence") //should look nicer for transparent stuff. not really that important, but hey.
|
|
|
|
desc = "An evidence bag containing [I]."
|
|
I.loc = src
|
|
stored_item = I
|
|
w_class = I.w_class
|
|
return
|
|
|
|
|
|
/obj/item/evidencebag/attack_self(mob/user)
|
|
. = ..(user)
|
|
if(.)
|
|
return TRUE
|
|
if(LAZYLEN(contents))
|
|
var/obj/item/I = contents[1]
|
|
user.visible_message("[user] takes [I] out of [src]", "You take [I] out of [src].",\
|
|
"You hear someone rustle around in a plastic bag, and remove something.")
|
|
cut_overlays() //remove the overlays
|
|
|
|
user.put_in_hands(I)
|
|
stored_item = null
|
|
|
|
w_class = initial(w_class)
|
|
icon_state = "evidenceobj"
|
|
desc = "An empty evidence bag."
|
|
else
|
|
to_chat(user, "[src] is empty.")
|
|
icon_state = "evidenceobj"
|
|
return
|
|
|
|
/obj/item/evidencebag/examine(mob/user)
|
|
. = ..()
|
|
if(stored_item)
|
|
user.examinate(stored_item)
|