/*
* Absorbs /obj/item/secstorage.
* Reimplements it only slightly to use existing storage functionality.
*
* Contains:
* Secure Briefcase
* Wall Safe
*/
// -----------------------------
// Generic Item
// -----------------------------
ABSTRACT_TYPE(/obj/item/storage/secure)
name = "secstorage"
var/icon_locking = "secureb"
var/icon_sparking = "securespark"
var/icon_opened = "secure0"
var/locked = 1
var/code = ""
var/l_code = null
var/l_set = 0
var/l_setshort = 0
var/l_hacking = 0
var/emagged = 0
var/open = 0
w_class = WEIGHT_CLASS_BULKY
max_w_class = WEIGHT_CLASS_NORMAL
max_storage_space = DEFAULT_BOX_STORAGE
use_sound = 'sound/items/storage/briefcase.ogg'
/obj/item/storage/secure/get_examine_text(mob/user, distance, is_adjacent, infix, suffix)
. = ..()
if(distance <= 1)
. += "The service panel is [src.open ? "open" : "closed"]."
/obj/item/storage/secure/attackby(obj/item/attacking_item, mob/user)
if(locked)
if (istype(attacking_item, /obj/item/melee/energy/blade) && emag_act(INFINITY, user, "You slice through the lock of \the [src]"))
var/obj/item/melee/energy/blade/blade = attacking_item
blade.spark_system.queue()
playsound(src.loc, 'sound/weapons/blade.ogg', 50, 1)
playsound(src.loc, /singleton/sound_category/spark_sound, 50, 1)
return
if (attacking_item.isscrewdriver())
if(attacking_item.use_tool(src, user, 20, volume = 50))
src.open =! src.open
to_chat(user, SPAN_NOTICE("You [src.open ? "open" : "close"] the service panel."))
return
if ((attacking_item.ismultitool()) && (src.open == 1)&& (!src.l_hacking))
to_chat(user, SPAN_NOTICE("Now attempting to reset internal memory, please hold."))
src.l_hacking = 1
if (do_after(usr, 100))
if (prob(40))
src.l_setshort = 1
src.l_set = 0
to_chat(user, SPAN_NOTICE("Internal memory reset."))
src.l_setshort = 0
src.l_hacking = 0
else
to_chat(user, SPAN_WARNING("Unable to reset internal memory."))
src.l_hacking = 0
else src.l_hacking = 0
return
//At this point you have exhausted all the special things to do when locked
// ... but it's still locked.
return
// -> storage/attackby() what with handle insertion, etc
..()
/obj/item/storage/secure/mouse_drop_dragged(atom/over, mob/user, src_location, over_location, params)
if (locked)
src.add_fingerprint(user)
return
..()
/obj/item/storage/secure/attack_self(mob/user as mob)
user.set_machine(src)
var/dat = "[src]
\n\nLock Status: [(src.locked ? "LOCKED" : "UNLOCKED")]"
var/message = "Code"
if ((src.l_set == 0) && (!src.emagged) && (!src.l_setshort))
dat += "
\n5-DIGIT PASSCODE NOT SET.
ENTER NEW PASSCODE."
if (src.emagged)
dat += "
\nLOCKING SYSTEM ERROR - 1701" if (src.l_setshort) dat += "
\nALERT: MEMORY SYSTEM ERROR - 6040 201" message = "[src.code]" if (!src.locked) message = "*****" dat += "