From 79beb274c4d7eedabc3b72bd2a75d012742e1cdd Mon Sep 17 00:00:00 2001 From: Kapu1178 <75460809+Kapu1178@users.noreply.github.com> Date: Sat, 25 May 2024 17:05:44 -0400 Subject: [PATCH] right click locks the air alarm (#961) --- code/modules/atmospherics/machinery/airalarm.dm | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/code/modules/atmospherics/machinery/airalarm.dm b/code/modules/atmospherics/machinery/airalarm.dm index a58d8b85b9fd..05b0ce7d7b8c 100644 --- a/code/modules/atmospherics/machinery/airalarm.dm +++ b/code/modules/atmospherics/machinery/airalarm.dm @@ -907,6 +907,20 @@ DEFINE_INTERACTABLE(/obj/machinery/airalarm) return ..() +/obj/machinery/airalarm/attack_hand_secondary(mob/user, list/modifiers) + . = ..() + if(. == SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN) + return + if(!can_interact(user)) + return + if(!user.canUseTopic(src, USE_CLOSE|USE_SILICON_REACH) || !isturf(loc)) + return + if(!ishuman(user)) + return + + togglelock(user) + return SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN + /obj/machinery/airalarm/rcd_vals(mob/user, obj/item/construction/rcd/the_rcd) if((buildstage == AIRALARM_BUILD_NO_CIRCUIT) && (the_rcd.upgrade & RCD_UPGRADE_SIMPLE_CIRCUITS)) return list("mode" = RCD_UPGRADE_SIMPLE_CIRCUITS, "delay" = 20, "cost" = 1) @@ -926,7 +940,7 @@ DEFINE_INTERACTABLE(/obj/machinery/airalarm) if(machine_stat & (NOPOWER|BROKEN)) to_chat(user, span_warning("It does nothing!")) else - if(src.allowed(usr) && !wires.is_cut(WIRE_IDSCAN)) + if(allowed(user) && !wires.is_cut(WIRE_IDSCAN)) locked = !locked to_chat(user, span_notice("You [ locked ? "lock" : "unlock"] the air alarm interface.")) if(!locked)