mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-22 20:48:56 +01:00
* Crate, Closet Refactors & Access Secured Stuff * CI * e --------- Co-authored-by: SyncIt21 <110812394+SyncIt21@users.noreply.github.com> Co-authored-by: Gandalf <9026500+Gandalf2k15@users.noreply.github.com>
34 lines
977 B
Plaintext
34 lines
977 B
Plaintext
/obj/structure/closet/infinite
|
|
name = "infinite closet"
|
|
desc = "It's closets, all the way down."
|
|
var/replicating_type
|
|
var/stop_replicating_at = 4
|
|
var/auto_close_time = 15 SECONDS // Set to 0 to disable auto-closing.
|
|
|
|
/obj/structure/closet/infinite/Initialize(mapload)
|
|
. = ..()
|
|
START_PROCESSING(SSobj, src)
|
|
|
|
/obj/structure/closet/infinite/Destroy()
|
|
STOP_PROCESSING(SSobj, src)
|
|
. = ..()
|
|
|
|
/obj/structure/closet/infinite/process()
|
|
if(!replicating_type)
|
|
if(!length(contents))
|
|
return
|
|
else
|
|
replicating_type = contents[1].type
|
|
|
|
if(replicating_type && !opened && (length(contents) < stop_replicating_at))
|
|
new replicating_type(src)
|
|
|
|
/obj/structure/closet/infinite/after_close(mob/living/user, force)
|
|
. = ..()
|
|
if(auto_close_time)
|
|
addtimer(CALLBACK(src, PROC_REF(close_on_my_own)), auto_close_time, TIMER_OVERRIDE | TIMER_UNIQUE)
|
|
|
|
/obj/structure/closet/infinite/proc/close_on_my_own()
|
|
if(close())
|
|
visible_message(span_notice("\The [src] closes on its own."))
|