mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-30 00:21:11 +01:00
The Last of the Lockers (#13954)
This commit is contained in:
@@ -1,16 +1,18 @@
|
||||
/obj/structure/extinguisher_cabinet
|
||||
name = "extinguisher cabinet"
|
||||
desc = "A small wall mounted cabinet designed to hold a fire extinguisher."
|
||||
icon = 'icons/obj/closet.dmi'
|
||||
icon_state = "extinguisher_closed"
|
||||
desc_info = "Alt-click to close the door."
|
||||
icon = 'icons/obj/wallmounts.dmi'
|
||||
icon_state = "cabinet"
|
||||
anchored = 1
|
||||
density = 0
|
||||
var/obj/item/extinguisher/has_extinguisher
|
||||
var/opened = 0
|
||||
|
||||
/obj/structure/extinguisher_cabinet/New()
|
||||
/obj/structure/extinguisher_cabinet/Initialize()
|
||||
..()
|
||||
has_extinguisher = new/obj/item/extinguisher(src)
|
||||
update_icon()
|
||||
|
||||
/obj/structure/extinguisher_cabinet/attackby(obj/item/O, mob/user)
|
||||
if(isrobot(user))
|
||||
@@ -35,41 +37,35 @@
|
||||
/obj/structure/extinguisher_cabinet/attack_hand(mob/user)
|
||||
if(isrobot(user))
|
||||
return
|
||||
if (ishuman(user))
|
||||
var/mob/living/carbon/human/H = user
|
||||
var/obj/item/organ/external/temp = H.organs_by_name[BP_R_HAND]
|
||||
if (user.hand)
|
||||
temp = H.organs_by_name[BP_L_HAND]
|
||||
if(temp && !temp.is_usable())
|
||||
to_chat(user, "<span class='notice'>You try to move your [temp.name], but cannot!</span>")
|
||||
return
|
||||
if(use_check_and_message(usr))
|
||||
return 0
|
||||
if(has_extinguisher)
|
||||
user.put_in_hands(has_extinguisher)
|
||||
to_chat(user, "<span class='notice'>You take [has_extinguisher] from [src].</span>")
|
||||
playsound(src.loc, 'sound/effects/extout.ogg', 50, 0)
|
||||
has_extinguisher = null
|
||||
opened = 1
|
||||
opened = TRUE
|
||||
else
|
||||
opened = !opened
|
||||
update_icon()
|
||||
|
||||
/obj/structure/extinguisher_cabinet/update_icon()
|
||||
if(!opened)
|
||||
icon_state = "extinguisher_closed"
|
||||
return
|
||||
cut_overlays()
|
||||
if(has_extinguisher)
|
||||
if(istype(has_extinguisher, /obj/item/extinguisher/mini))
|
||||
icon_state = "extinguisher_mini"
|
||||
add_overlay("extinguisher_mini")
|
||||
else
|
||||
icon_state = "extinguisher_full"
|
||||
add_overlay("extinguisher_full")
|
||||
if(opened)
|
||||
add_overlay("cabinet_door_open")
|
||||
else
|
||||
icon_state = "extinguisher_empty"
|
||||
add_overlay("cabinet_door_closed")
|
||||
|
||||
/obj/structure/extinguisher_cabinet/do_simple_ranged_interaction(var/mob/user)
|
||||
if(has_extinguisher)
|
||||
has_extinguisher.dropInto(loc)
|
||||
has_extinguisher = null
|
||||
opened = 1
|
||||
opened = TRUE
|
||||
else
|
||||
opened = !opened
|
||||
update_icon()
|
||||
|
||||
Reference in New Issue
Block a user