Skip to content

Commit

Permalink
right click locks the air alarm (#961)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kapu1178 authored May 25, 2024
1 parent 39c09fe commit 79beb27
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion code/modules/atmospherics/machinery/airalarm.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit 79beb27

Please sign in to comment.