-
-
Notifications
You must be signed in to change notification settings - Fork 444
/
Copy pathstorage.dm
86 lines (72 loc) · 2.49 KB
/
storage.dm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
/obj/item/storage
name = "storage"
icon = 'icons/obj/storage.dmi'
w_class = WEIGHT_CLASS_NORMAL
var/rummage_if_nodrop = TRUE
var/component_type = /datum/component/storage/concrete
/// Should we preload the contents of this type?
/// BE CAREFUL, THERE'S SOME REALLY NASTY SHIT IN THIS TYPEPATH
/// SANTA IS EVIL
var/preload = FALSE
/obj/item/storage/get_dumping_location(obj/item/storage/source,mob/user)
return src
/obj/item/storage/Initialize(mapload)
. = ..()
AddComponent(component_type)
PopulateContents()
/obj/item/storage/AllowDrop()
return FALSE
/obj/item/storage/contents_explosion(severity, target)
for(var/thing in contents)
switch(severity)
if(EXPLODE_DEVASTATE)
SSexplosions.high_mov_atom += thing
if(EXPLODE_HEAVY)
SSexplosions.med_mov_atom += thing
if(EXPLODE_LIGHT)
SSexplosions.low_mov_atom += thing
/obj/item/storage/canStrip(mob/who)
. = ..()
if(!. && rummage_if_nodrop)
return TRUE
/obj/item/storage/doStrip(mob/who)
if(HAS_TRAIT(src, TRAIT_NODROP) && rummage_if_nodrop)
var/datum/component/storage/CP = GetComponent(/datum/component/storage)
CP.do_quick_empty()
return TRUE
return ..()
/obj/item/storage/contents_explosion(severity, target)
//Cyberboss says: "USE THIS TO FILL IT, NOT INITIALIZE OR NEW"
/obj/item/storage/proc/PopulateContents()
/obj/item/storage/proc/emptyStorage()
var/datum/component/storage/ST = GetComponent(/datum/component/storage)
ST.do_quick_empty()
/// Returns a list of object types to be preloaded by our code
/// I'll say it again, be very careful with this. We only need it for a few things
/// Don't do anything stupid, please
/obj/item/storage/proc/get_types_to_preload()
return
/obj/item/storage/vv_get_dropdown()
. = ..()
VV_DROPDOWN_SEPERATOR
VV_DROPDOWN_OPTION(VV_HK_SPAWN_ITEM_INSIDE, "Spawn Item Inside")
/obj/item/storage/vv_do_topic(list/href_list)
. = ..()
if(href_list[VV_HK_SPAWN_ITEM_INSIDE] && check_rights(R_SPAWN))
var/valid_id = FALSE
var/chosen_id
while(!valid_id)
chosen_id = input(usr, "Enter the typepath of the item you want to add.", "Search items") as null|text
if(isnull(chosen_id)) //Get me out of here!
break
if (!ispath(text2path(chosen_id)))
chosen_id = pick_closest_path(chosen_id, make_types_fancy(subtypesof(/obj/item)))
if (ispath(chosen_id))
valid_id = TRUE
else
valid_id = TRUE
if(!valid_id)
to_chat(usr, span_warning("A reagent with that ID doesn't exist!"))
if(valid_id)
var/obj/item/item = new chosen_id(src)
item.forceMove(src)