A storage for the research department (#10614)

This commit is contained in:
FieryTech
2020-11-23 13:13:38 +01:00
committed by GitHub
parent 7edb613305
commit 5e7f18626c
6 changed files with 582 additions and 196 deletions
@@ -0,0 +1,57 @@
/obj/structure/closet/secure_closet/sciguncabinet
name = "science gun cabinet"
req_access = list(access_tox_storage)
icon = 'icons/obj/sciguncabinet.dmi'
icon_state = "base"
icon_off ="base"
icon_broken ="base"
icon_locked ="base"
icon_closed ="base"
icon_opened = "base"
anchored = 1
canbemoved = 1
/obj/structure/closet/secure_closet/sciguncabinet/Initialize()
..()
return INITIALIZE_HINT_LATELOAD
/obj/structure/closet/secure_closet/sciguncabinet/LateInitialize()
..()
update_icon()
/obj/structure/closet/secure_closet/sciguncabinet/toggle()
..()
update_icon()
/obj/structure/closet/secure_closet/sciguncabinet/update_icon()
cut_overlays()
if(opened)
add_overlay("door_open")
else
var/lazors = 0
var/shottas = 0
for (var/obj/item/gun/G in contents)
if (istype(G, /obj/item/gun/energy))
lazors++
if (istype(G, /obj/item/gun/projectile/))
shottas++
if (lazors || shottas)
for (var/i = 0 to 2)
if (lazors > 0 && (shottas <= 0 || prob(50)))
lazors--
add_overlay("laser[i]")
else if (shottas > 0)
shottas--
add_overlay("projectile[i]")
add_overlay("door")
if(welded)
add_overlay(welded_overlay_state)
if(broken)
add_overlay("broken")
else if (locked)
add_overlay("locked")
else
add_overlay("open")