mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-01-01 04:52:16 +00:00
Refactored hitby to be in line with TG's version. Refactored item weight defines to a more clear naming scheme, also in line with TG's version. Refactored how the movement bumps are handled, ported signals to handle them, in preparation for the movement update. Fixed disposal hit bouncing the hitting atom on the wall. Items do not push other items anymore if they are tiny.
31 lines
1019 B
Plaintext
31 lines
1019 B
Plaintext
/obj/item/material/lock_construct
|
|
name = "lock"
|
|
desc = "A crude but useful lock and bolt."
|
|
icon = 'icons/obj/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)
|