From ce5cd16b7eff06e1d962f131ca499ed7be141cae Mon Sep 17 00:00:00 2001 From: Arkatos1 Date: Sun, 28 Apr 2019 00:57:12 +0200 Subject: [PATCH 1/3] 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() From 3181843ce40d145991cb6237c00ef0ecd275ca65 Mon Sep 17 00:00:00 2001 From: Arkatos1 Date: Sun, 28 Apr 2019 12:31:07 +0200 Subject: [PATCH 2/3] Code review fixes, no drop sanity check --- code/game/objects/structures/extinguisher.dm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/game/objects/structures/extinguisher.dm b/code/game/objects/structures/extinguisher.dm index 04f0a2e0d43..0bb117bf4ac 100644 --- a/code/game/objects/structures/extinguisher.dm +++ b/code/game/objects/structures/extinguisher.dm @@ -43,7 +43,6 @@ playsound(loc, 'sound/machines/click.ogg', 15, TRUE, -3) opened = !opened update_icon() - return /obj/structure/extinguisher_cabinet/Destroy() QDEL_NULL(has_extinguisher) @@ -54,6 +53,8 @@ return if(istype(O, /obj/item/extinguisher)) if(!has_extinguisher && opened) + if((O.flags & NODROP) || (flags & NODROP)) + return user.drop_item(O) contents += O has_extinguisher = O From 718d05f0fb692b04dce91564bf0c9804222242d1 Mon Sep 17 00:00:00 2001 From: Arkatos1 Date: Sun, 28 Apr 2019 20:27:45 +0200 Subject: [PATCH 3/3] Code review fixes --- code/game/objects/structures/extinguisher.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/game/objects/structures/extinguisher.dm b/code/game/objects/structures/extinguisher.dm index 0bb117bf4ac..303862ff66f 100644 --- a/code/game/objects/structures/extinguisher.dm +++ b/code/game/objects/structures/extinguisher.dm @@ -53,7 +53,7 @@ return if(istype(O, /obj/item/extinguisher)) if(!has_extinguisher && opened) - if((O.flags & NODROP) || (flags & NODROP)) + if(!user.drop_item()) return user.drop_item(O) contents += O