Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Техника клонирования #861

Merged
merged 3 commits into from
Dec 23, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -49,54 +49,3 @@
contents = list()
new /obj/item/storage/backpack/satchel( src )
new /obj/item/radio/headset( src )

/obj/structure/closet/secure_closet/personal/attackby(obj/item/W as obj, mob/user as mob)
if (src.opened)
if(istype(W, /obj/item/grab))
var/obj/item/grab/G = W
if(G.grabbed_thing)
src.MouseDrop_T(G.grabbed_thing, user) //act like they were dragged onto the closet
return
user.drop_held_item()
if (W) W.loc = src.loc
else if(istype(W, /obj/item/card/id))
if(src.broken)
to_chat(user, span_warning("It appears to be broken."))
return
var/obj/item/card/id/I = W
if(!I || !I.registered_name) return
if(src.allowed(user) || !src.registered_name || (istype(I) && (src.registered_name == I.registered_name)))
//they can open all lockers, or nobody owns this, or they own this locker
src.locked = !( src.locked )
if(src.locked) src.icon_state = src.icon_locked
else src.icon_state = src.icon_closed

if(!src.registered_name)
src.registered_name = I.registered_name
src.desc = "Owned by [I.registered_name]."
else
to_chat(user, span_warning("Access Denied"))
return
to_chat(user, span_warning("Access Denied"))


/obj/structure/closet/secure_closet/personal/verb/reset()
set src in oview(1) // One square distance
set category = "Object"
set name = "Reset Lock"
if(!usr.canmove || usr.stat || usr.restrained()) // Don't use it if you're not able to! Checks for stuns, ghost and restrain
return
if(!ishuman(usr))
return
if (src.locked || !src.registered_name)
to_chat(usr, span_warning("You need to unlock it first."))
else if (src.broken)
to_chat(usr, span_warning("It appears to be broken."))
else
if (src.opened)
if(!src.close())
return
src.locked = TRUE
src.icon_state = src.icon_locked
src.registered_name = null
src.desc = "It's a secure locker for personnel. The first card swiped gains control."
Loading