Merge pull request #11397 from Arkatos1/cabinet

Fire extinguisher cabinet QoL update
This commit is contained in:
variableundefined
2019-04-30 13:05:12 +08:00
committed by GitHub
@@ -28,6 +28,22 @@
else
has_extinguisher = new/obj/item/extinguisher
/obj/structure/extinguisher_cabinet/examine(mob/user)
..()
to_chat(user, "<span class='notice'>Alt-click to [opened ? "close":"open"] it.</span>")
/obj/structure/extinguisher_cabinet/AltClick(mob/living/user)
if(!istype(user) || user.incapacitated())
to_chat(user, "<span class='warning'>You can't do that right now!</span>")
return
if(!in_range(src, user))
return
if(!iscarbon(usr))
return
playsound(loc, 'sound/machines/click.ogg', 15, TRUE, -3)
opened = !opened
update_icon()
/obj/structure/extinguisher_cabinet/Destroy()
QDEL_NULL(has_extinguisher)
return ..()
@@ -37,11 +53,16 @@
return
if(istype(O, /obj/item/extinguisher))
if(!has_extinguisher && opened)
if(!user.drop_item())
return
user.drop_item(O)
contents += O
has_extinguisher = O
update_icon()
to_chat(user, "<span class='notice'>You place [O] in [src].</span>")
return TRUE
else
playsound(loc, 'sound/machines/click.ogg', 15, TRUE, -3)
opened = !opened
else if(istype(O, /obj/item/weldingtool))
if(has_extinguisher)
@@ -65,6 +86,7 @@
new material_drop(T)
qdel(src)
else
playsound(loc, 'sound/machines/click.ogg', 15, TRUE, -3)
opened = !opened
update_icon()
@@ -81,21 +103,27 @@
to_chat(user, "<span class='notice'>You try to move your [temp.name], but cannot!")
return
if(has_extinguisher)
if(icon_state == "extinguisher_closed")
playsound(loc, 'sound/machines/click.ogg', 15, TRUE, -3)
user.put_in_hands(has_extinguisher)
to_chat(user, "<span class='notice'>You take [has_extinguisher] from [src].</span>")
has_extinguisher = null
opened = 1
else
playsound(loc, 'sound/machines/click.ogg', 15, TRUE, -3)
opened = !opened
update_icon()
/obj/structure/extinguisher_cabinet/attack_tk(mob/user)
if(has_extinguisher)
if(icon_state == "extinguisher_closed")
playsound(loc, 'sound/machines/click.ogg', 15, TRUE, -3)
has_extinguisher.loc = loc
to_chat(user, "<span class='notice'>You telekinetically remove [has_extinguisher] from [src].</span>")
has_extinguisher = null
opened = 1
else
playsound(loc, 'sound/machines/click.ogg', 15, TRUE, -3)
opened = !opened
update_icon()