mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 02:09:41 +00:00
52 lines
1.2 KiB
Plaintext
52 lines
1.2 KiB
Plaintext
/obj/structure/closet/secure_closet/guncabinet
|
|
name = "gun cabinet"
|
|
icon = 'icons/obj/guncabinet.dmi'
|
|
icon_state = "base"
|
|
req_one_access = list(access_armory)
|
|
closet_appearance = null
|
|
|
|
/obj/structure/closet/secure_closet/guncabinet/Initialize()
|
|
. = ..()
|
|
update_icon()
|
|
|
|
/obj/structure/closet/secure_closet/guncabinet/toggle()
|
|
..()
|
|
update_icon()
|
|
|
|
/obj/structure/closet/secure_closet/guncabinet/update_icon()
|
|
overlays.Cut()
|
|
if(opened)
|
|
overlays += icon(icon,"door_open")
|
|
else
|
|
var/lazors = 0
|
|
var/shottas = 0
|
|
for (var/obj/item/weapon/gun/G in contents)
|
|
if (istype(G, /obj/item/weapon/gun/energy))
|
|
lazors++
|
|
if (istype(G, /obj/item/weapon/gun/projectile))
|
|
shottas++
|
|
for (var/i = 0 to 2)
|
|
if(lazors || shottas) // only make icons if we have one of the two types.
|
|
var/image/gun = image(icon(src.icon))
|
|
if (lazors > shottas)
|
|
lazors--
|
|
gun.icon_state = "laser"
|
|
else if (shottas)
|
|
shottas--
|
|
gun.icon_state = "projectile"
|
|
gun.pixel_x = i*4
|
|
overlays += gun
|
|
|
|
overlays += icon(src.icon, "door")
|
|
|
|
if(sealed)
|
|
overlays += icon(src.icon,"sealed")
|
|
|
|
if(broken)
|
|
overlays += icon(src.icon,"broken")
|
|
else if (locked)
|
|
overlays += icon(src.icon,"locked")
|
|
else
|
|
overlays += icon(src.icon,"open")
|
|
|