Skip to content

Commit

Permalink
gun scope hotkey (#5454)
Browse files Browse the repository at this point in the history
  • Loading branch information
WatermelonsEverywhere authored Jun 18, 2024
1 parent 08cfbbf commit bdaaf07
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
14 changes: 14 additions & 0 deletions code/modules/projectiles/gun.dm
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,20 @@ For the sake of consistency, I suggest always rounding up on even values when ap
var/overcharge_level = 0 //What our current overcharge level is. Peaks at overcharge_max
var/overcharge_max = 10

/mob/living/proc/attempt_scope()
var/obj/item/I = get_active_hand()
if(!I)
return
if(!istype(I, /obj/item/gun))
return

var/obj/item/gun/G = I
G.toggle_scope(src)

/mob/living/verb/scope_hotkey()
set name = ".toggle_scope"
attempt_scope()

/obj/item/gun/wield(mob/user)
if(!wield_delay)
..()
Expand Down
5 changes: 4 additions & 1 deletion interface/skin.dmf
Original file line number Diff line number Diff line change
Expand Up @@ -639,6 +639,9 @@ macro "hotkeymode"
elem
name = "SHIFT+X"
command = ".wield"
elem
name = "SHIFT+C"
command = ".toggle_scope"
elem
name = "Y"
command = "Activate-Held-Object"
Expand Down Expand Up @@ -1456,4 +1459,4 @@ window "text_editor"
anchor2 = none
border = line
saved-params = ""
multi-line = true
multi-line = true

0 comments on commit bdaaf07

Please sign in to comment.