mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-07-12 08:27:13 +01:00
142862c8bc
Updated crate and locker sprites and icon overlay code to use a new standalone 'securitypanel' overlay to lay the groundwork for, in the future, being able to install/uninstall access-code locks on containers just like you can in airlocks. For lockers, little visual change at all. For crates, the security panel is now an overlay within the 'handle' section of the crate rather than being a chunky box off to the side on front. Locked/unlocked/emag sprites also updated for the new panel location.    Moved closet.dmi, crate.dmi, guncabinet.dmi, safe.dmi, and walllocker.dmi to a new subfolder /icons/obj/containers, and updated all references to them in code, for sake of organization. Ideally (IMHO), we'd differentiate structure-based storage containers from item-based storage containers, but that's a larger organizational task and outside of scope- this just moves storage structures into one common location. Deleted sciguncabinet.dmi, as its contents had already been migrated to guncabinet.dmi and it was no longer referenced anywhere in the codebase.
31 lines
1.0 KiB
Plaintext
31 lines
1.0 KiB
Plaintext
/obj/item/material/lock_construct
|
|
name = "lock"
|
|
desc = "A crude but useful lock and bolt."
|
|
icon = 'icons/obj/containers/crate.dmi'
|
|
icon_state = "largebinemag"
|
|
w_class = WEIGHT_CLASS_TINY
|
|
var/lock_data
|
|
|
|
/obj/item/material/lock_construct/Initialize(newloc, material_key)
|
|
. = ..()
|
|
force = 0
|
|
throwforce = 0
|
|
lock_data = generateRandomString(round(material.integrity/50))
|
|
|
|
/obj/item/material/lock_construct/attackby(obj/item/attacking_item, mob/user)
|
|
if(istype(attacking_item, /obj/item/key))
|
|
var/obj/item/key/K = attacking_item
|
|
if(!K.key_data)
|
|
to_chat(user, SPAN_NOTICE("You fashion \the [attacking_item] to unlock \the [src]"))
|
|
K.key_data = lock_data
|
|
else
|
|
to_chat(user, SPAN_WARNING("\The [attacking_item] already unlocks something."))
|
|
return
|
|
..()
|
|
|
|
/obj/item/material/lock_construct/proc/create_lock(var/atom/target, var/mob/user)
|
|
. = new /datum/lock(target,lock_data)
|
|
user.drop_from_inventory(src,user)
|
|
user.visible_message(SPAN_NOTICE("\The [user] attaches \the [src] to \the [target]."))
|
|
qdel(src)
|