Files
BatrachophrenoandGitHub 142862c8bc Container cleanup, standalone security panel (#20909)
Updated crate and locker sprites and icon overlay code to use a new
standalone 'securitypanel' overlay to lay the groundwork for, in the
future, being able to install/uninstall access-code locks on containers
just like you can in airlocks. For lockers, little visual change at all.
For crates, the security panel is now an overlay within the 'handle'
section of the crate rather than being a chunky box off to the side on
front. Locked/unlocked/emag sprites also updated for the new panel
location.
![Screenshot 2025-06-28
130646](https://github.com/user-attachments/assets/4b4469e7-5d62-42e0-9d9b-27c2f70a4239)
![Screenshot 2025-06-28
130944](https://github.com/user-attachments/assets/5741094f-9214-435a-8ef1-97e5c06b1c61)
![Screenshot 2025-06-28
130951](https://github.com/user-attachments/assets/3d9563b5-a89c-407d-9f8b-190d6382fb8b)

Moved closet.dmi, crate.dmi, guncabinet.dmi, safe.dmi, and
walllocker.dmi to a new subfolder /icons/obj/containers, and updated all
references to them in code, for sake of organization. Ideally (IMHO),
we'd differentiate structure-based storage containers from item-based
storage containers, but that's a larger organizational task and outside
of scope- this just moves storage structures into one common location.

Deleted sciguncabinet.dmi, as its contents had already been migrated to
guncabinet.dmi and it was no longer referenced anywhere in the codebase.
2026-01-14 17:38:00 +00:00

63 lines
1.6 KiB
Plaintext

/obj/structure/tranqcabinet
name = "tranquilizer rifle cabinet"
desc = "A wall mounted cabinet designed to hold a tranquilizer rifle."
icon = 'icons/obj/containers/closet.dmi'
icon_state = "tranq_closed"
anchored = 1
density = 0
var/obj/item/gun/projectile/heavysniper/tranq/has_tranq
var/opened = 0
/obj/structure/tranqcabinet/New()
..()
has_tranq = new/obj/item/gun/projectile/heavysniper/tranq(src)
/obj/structure/tranqcabinet/attackby(obj/item/attacking_item, mob/user)
if(isrobot(user))
return
if(istype(attacking_item, /obj/item/gun/projectile/heavysniper/tranq))
if(!has_tranq && opened)
user.remove_from_mob(attacking_item)
contents += attacking_item
has_tranq = attacking_item
to_chat(user, SPAN_NOTICE("You place [attacking_item] in [src]."))
else
opened = !opened
else
opened = !opened
update_icon()
/obj/structure/tranqcabinet/attack_hand(mob/user)
if(isrobot(user))
return
if (!user.can_use_hand())
return
if(has_tranq)
user.put_in_hands(has_tranq)
to_chat(user, SPAN_NOTICE("You take [has_tranq] from [src]."))
has_tranq = null
opened = 1
else
opened = !opened
update_icon()
/obj/structure/tranqcabinet/do_simple_ranged_interaction(var/mob/user)
if(has_tranq)
has_tranq.forceMove(loc)
to_chat(user, SPAN_NOTICE("You telekinetically remove [has_tranq] from [src]."))
has_tranq = null
opened = 1
else
opened = !opened
update_icon()
/obj/structure/tranqcabinet/update_icon()
if(!opened)
icon_state = "tranq_closed"
return
if(has_tranq)
icon_state = "tranq_full"
else
icon_state = "tranq_empty"