From ce5cd16b7eff06e1d962f131ca499ed7be141cae Mon Sep 17 00:00:00 2001 From: Arkatos1 Date: Sun, 28 Apr 2019 00:57:12 +0200 Subject: [PATCH] Fire cabinet QoL update --- code/game/objects/structures/extinguisher.dm | 27 ++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/code/game/objects/structures/extinguisher.dm b/code/game/objects/structures/extinguisher.dm index 568fb0ededc..04f0a2e0d43 100644 --- a/code/game/objects/structures/extinguisher.dm +++ b/code/game/objects/structures/extinguisher.dm @@ -28,6 +28,23 @@ else has_extinguisher = new/obj/item/extinguisher +/obj/structure/extinguisher_cabinet/examine(mob/user) + ..() + to_chat(user, "Alt-click to [opened ? "close":"open"] it.") + +/obj/structure/extinguisher_cabinet/AltClick(mob/living/user) + if(!istype(user) || user.incapacitated()) + to_chat(user, "You can't do that right now!") + return + if(!in_range(src, user)) + return + if(!iscarbon(usr)) + return + playsound(loc, 'sound/machines/click.ogg', 15, TRUE, -3) + opened = !opened + update_icon() + return + /obj/structure/extinguisher_cabinet/Destroy() QDEL_NULL(has_extinguisher) return ..() @@ -40,8 +57,11 @@ user.drop_item(O) contents += O has_extinguisher = O + update_icon() to_chat(user, "You place [O] in [src].") + 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 +85,7 @@ new material_drop(T) qdel(src) else + playsound(loc, 'sound/machines/click.ogg', 15, TRUE, -3) opened = !opened update_icon() @@ -81,21 +102,27 @@ to_chat(user, "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, "You take [has_extinguisher] from [src].") 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, "You telekinetically remove [has_extinguisher] from [src].") has_extinguisher = null opened = 1 else + playsound(loc, 'sound/machines/click.ogg', 15, TRUE, -3) opened = !opened update_icon()