Files
Aurora.3/code/game/objects/items/weapons/storage/secure.dm
Alberyk 76b743a986 Adds the Aut'akh unathi (#5919)
* Base work for the unathi robot subspecies.

* Adds metabolism species, kidney vars, and the robot unathi organs.

* Moves some action buttons to organs, pretty much a bay port right now. Todo: the unathi and alien stuff should also go here.

* First autakh implant power.

* Fixes the organs action button this time.

* Finishes more implants, and interactions with flashs and vaurca.

* Prepare for great changes.

* Drops the real bomb, boss.

* He who fights with monsters.

* Far more work into augments and limb removing powers.

* Limb verbs should be good now.

* A LOT of work into the assited organ, allowing it to bleed and etc, as well adding a new chem that will stop bleeding in their case.

* Probably the last work on implants.

* Some extra touches.

* Some tweaks to the species.

* More fixes and adds kyre's sprites.

* More runtime fixes.

* Fixes the species name too.

* Fixes travis.

* Updates this file too to work with the new tools procs.

* Adds changelog

* Fixed changelog.

* Unathi hair and lore description.

* Some tweaks to this too.

* Locks away them for now, they will be released after we got all the events and etc done.

* Changes this chemical.

* Fixes an airlock runtime.

* Adds the non scan flag to the autakh, mostly due to some bizzare interactions with changelings and cloning.

* Organs removal changes; can't take out the organ if it is too damage.

* Restricts them back again.

* Robotic organs now have the proper icons and names.

* Adds sprites for their organs and some extra tweaks.

* Fixes this missing icon.

* emp should also now hurt assited organs.

* Tweaks more organ related things.

* Fixes the head not being properly set as well.

* Fixes their flags.

* fixes the flag for real this time.

* Poze's review.

* Changes the au'takh organ buttons to don't be animated.

* Helps with adminbus or something.

* Fowl's requested changes.

* Fixes a typo.

* Robotic limb's brute and burn mods are now controlled by the limb model.

* Fowl's changes once more.

* Stops some spam.

* More grammar.

* No eal.

* Skull's review.
2019-01-23 19:27:44 +01:00

196 lines
6.2 KiB
Plaintext

/*
* 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 = 3
max_w_class = 2
max_storage_space = 14
use_sound = 'sound/items/storage/briefcase.ogg'
examine(mob/user)
if(..(user, 1))
user << text("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]"))
W:spark_system.queue()
playsound(src.loc, 'sound/weapons/blade1.ogg', 50, 1)
playsound(src.loc, "sparks", 50, 1)
return
if (W.isscrewdriver())
if (do_after(user, 20))
src.open =! src.open
user.show_message(text("<span class='notice'>You [] the service panel.</span>", (src.open ? "open" : "close")))
return
if ((W.ismultitool()) && (src.open == 1)&& (!src.l_hacking))
user.show_message("<span class='notice'>Now attempting to reset internal memory, please hold.</span>", 1)
src.l_hacking = 1
if (do_after(usr, 100))
if (prob(40))
src.l_setshort = 1
src.l_set = 0
user.show_message("<span class='notice'>Internal memory reset. Please give it a few seconds to reinitialize.</span>", 1)
sleep(80)
src.l_setshort = 0
src.l_hacking = 0
else
user.show_message("<span class='warning'>Unable to reset internal memory.</span>", 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("<TT><B>[]</B><BR>\n\nLock Status: []",src, (src.locked ? "LOCKED" : "UNLOCKED"))
var/message = "Code"
if ((src.l_set == 0) && (!src.emagged) && (!src.l_setshort))
dat += text("<p>\n<b>5-DIGIT PASSCODE NOT SET.<br>ENTER NEW PASSCODE.</b>")
if (src.emagged)
dat += text("<p>\n<font color=red><b>LOCKING SYSTEM ERROR - 1701</b></font>")
if (src.l_setshort)
dat += text("<p>\n<font color=red><b>ALERT: MEMORY SYSTEM ERROR - 6040 201</b></font>")
message = text("[]", src.code)
if (!src.locked)
message = "*****"
dat += text("<HR>\n>[]<BR>\n<A href='?src=\ref[];type=1'>1</A>-<A href='?src=\ref[];type=2'>2</A>-<A href='?src=\ref[];type=3'>3</A><BR>\n<A href='?src=\ref[];type=4'>4</A>-<A href='?src=\ref[];type=5'>5</A>-<A href='?src=\ref[];type=6'>6</A><BR>\n<A href='?src=\ref[];type=7'>7</A>-<A href='?src=\ref[];type=8'>8</A>-<A href='?src=\ref[];type=9'>9</A><BR>\n<A href='?src=\ref[];type=R'>R</A>-<A href='?src=\ref[];type=0'>0</A>-<A href='?src=\ref[];type=E'>E</A><BR>\n</TT>", message, src, src, src, src, src, src, src, src, src, src, src, src)
user << browse(dat, "window=caselock;size=300x280")
Topic(href, href_list)
..()
if ((usr.stat || usr.restrained()) || (get_dist(src, usr) > 1))
return
if (href_list["type"])
if (href_list["type"] == "E")
if ((src.l_set == 0) && (length(src.code) == 5) && (!src.l_setshort) && (src.code != "ERROR"))
src.l_code = src.code
src.l_set = 1
else if ((src.code == src.l_code) && (src.emagged == 0) && (src.l_set == 1))
src.locked = 0
cut_overlays()
add_overlay(icon_opened)
src.code = null
else
src.code = "ERROR"
else
if ((href_list["type"] == "R") && (src.emagged == 0) && (!src.l_setshort))
src.locked = 1
cut_overlays()
src.code = null
src.close(usr)
else
src.code += text("[]", href_list["type"])
if (length(src.code) > 5)
src.code = "ERROR"
src.add_fingerprint(usr)
for(var/mob/M in viewers(1, src.loc))
if ((M.client && M.machine == src))
src.attack_self(M)
return
return
/obj/item/weapon/storage/secure/emag_act(var/remaining_charges, var/mob/user, var/feedback)
if(!emagged)
emagged = 1
add_overlay(icon_sparking)
sleep(6)
cut_overlays()
add_overlay(icon_locking)
locked = 0
user << (feedback ? feedback : "You short out the lock of \the [src].")
return 1
// -----------------------------
// Secure Briefcase
// -----------------------------
/obj/item/weapon/storage/secure/briefcase
name = "secure briefcase"
icon = 'icons/obj/storage.dmi'
icon_state = "secure"
item_state = "sec-case"
desc = "A large briefcase with a digital locking system."
force = 8.0
throw_speed = 1
throw_range = 4
w_class = 4.0
attack_hand(mob/user as mob)
if ((src.loc == user) && (src.locked == 1))
usr << "<span class='warning'>[src] is locked and cannot be opened!</span>"
else if ((src.loc == user) && (!src.locked))
src.open(usr)
else
..()
for(var/mob/M in range(1))
if (M.s_active == src)
src.close(M)
src.add_fingerprint(user)
return
// -----------------------------
// Secure Safe
// -----------------------------
/obj/item/weapon/storage/secure/safe
name = "secure safe"
icon = 'icons/obj/storage.dmi'
icon_state = "safe"
icon_opened = "safe0"
icon_locking = "safeb"
icon_sparking = "safespark"
force = 8.0
w_class = 8.0
max_w_class = 8
anchored = 1.0
density = 0
cant_hold = list(/obj/item/weapon/storage/secure/briefcase)
New()
..()
new /obj/item/weapon/paper(src)
new /obj/item/weapon/pen(src)
attack_hand(mob/user as mob)
return attack_self(user)
/*obj/item/weapon/storage/secure/safe/HoS/New()
..()
//new /obj/item/weapon/storage/lockbox/clusterbang(src) This item is currently broken... and probably shouldnt exist to begin with (even though it's cool)
*/