/*
* Absorbs /obj/item/weapon/secstorage.
* Reimplements it only slightly to use existing storage functionality.
*
* Contains:
* Secure Briefcase
* Wall Safe
*/
// -----------------------------
// Generic Item
// -----------------------------
/obj/item/weapon/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 = ITEMSIZE_NORMAL
max_w_class = ITEMSIZE_SMALL
max_storage_space = ITEMSIZE_SMALL * 7
use_sound = 'sound/items/storage/briefcase.ogg'
examine(mob/user)
if(..(user, 1))
to_chat(user, "The service panel is [src.open ? "open" : "closed"].")
attackby(obj/item/weapon/W as obj, mob/user as mob)
if(locked)
if (istype(W, /obj/item/weapon/melee/energy/blade) && emag_act(INFINITY, user, "You slice through the lock of \the [src]"))
var/datum/effect/effect/system/spark_spread/spark_system = new /datum/effect/effect/system/spark_spread()
spark_system.set_up(5, 0, src.loc)
spark_system.start()
playsound(src.loc, 'sound/weapons/blade1.ogg', 50, 1)
playsound(src.loc, "sparks", 50, 1)
return
if (W.is_screwdriver())
if (do_after(user, 20 * W.toolspeed))
src.open =! src.open
playsound(src, W.usesound, 50, 1)
user.show_message(text("You [] the service panel.", (src.open ? "open" : "close")))
return
if (istype(W, /obj/item/device/multitool) && (src.open == 1)&& (!src.l_hacking))
user.show_message("Now attempting to reset internal memory, please hold.", 1)
src.l_hacking = 1
if (do_after(usr, 100))
if (prob(40))
src.l_setshort = 1
src.l_set = 0
user.show_message("Internal memory reset. Please give it a few seconds to reinitialize.", 1)
sleep(80)
src.l_setshort = 0
src.l_hacking = 0
else
user.show_message("Unable to reset internal memory.", 1)
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
..()
MouseDrop(over_object, src_location, over_location)
if (locked)
src.add_fingerprint(usr)
return
..()
attack_self(mob/user as mob)
user.set_machine(src)
var/dat = text("[]
\n\nLock Status: []",src, (src.locked ? "LOCKED" : "UNLOCKED"))
var/message = "Code"
if ((src.l_set == 0) && (!src.emagged) && (!src.l_setshort))
dat += text("
\n5-DIGIT PASSCODE NOT SET.
ENTER NEW PASSCODE.")
if (src.emagged)
dat += text("
\nLOCKING SYSTEM ERROR - 1701") if (src.l_setshort) dat += text("
\nALERT: MEMORY SYSTEM ERROR - 6040 201") message = text("[]", src.code) if (!src.locked) message = "*****" dat += text("