Files
Aurora.3/code/modules/lock/lock_construct.dm
Alberyk 59be553606 Material door updates: lock and damage (#5659)
-ported locks and keys from baystation
-fixed the simple door damage interaction, now you can properly destroy it and etc
2018-12-08 21:40:06 +01:00

31 lines
1003 B
Plaintext

/obj/item/weapon/material/lock_construct
name = "lock"
desc = "A crude but useful lock and bolt."
icon = 'icons/obj/storage.dmi'
icon_state = "largebinemag"
w_class = 1
var/lock_data
/obj/item/weapon/material/lock_construct/New()
..()
force = 0
throwforce = 0
lock_data = generateRandomString(round(material.integrity/50))
/obj/item/weapon/material/lock_construct/attackby(var/obj/item/I, var/mob/user)
if(istype(I,/obj/item/weapon/key))
var/obj/item/weapon/key/K = I
if(!K.key_data)
to_chat(user, "<span class='notice'>You fashion \the [I] to unlock \the [src]</span>")
K.key_data = lock_data
else
to_chat(user, "<span class='warning'>\The [I] already unlocks something.</span>")
return
..()
/obj/item/weapon/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 class='notice'>\The [user] attaches \the [src] to \the [target].</span>")
qdel(src)