Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bolt-action rifle corrections. #3493

Merged
merged 4 commits into from
Nov 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 13 additions & 7 deletions code/modules/projectiles/gun.dm
Original file line number Diff line number Diff line change
Expand Up @@ -654,12 +654,6 @@
if(usr == loc)
toggle_safety(usr)

/obj/item/gun/CtrlClick(var/mob/user)
if(loc == user)
toggle_safety(user)
return TRUE
. = ..()

/obj/item/gun/proc/safety()
return has_safety && safety_state

Expand Down Expand Up @@ -718,4 +712,16 @@
return FALSE
if(get_active_hand() != autofiring || incapacitated())
return FALSE
return TRUE
return TRUE

/obj/item/gun/get_alt_interactions(mob/user)
. = ..()
LAZYADD(., /decl/interaction_handler/toggle_safety)

/decl/interaction_handler/toggle_safety
name = "Toggle Gun Safety"
expected_target_type = /obj/item/gun

/decl/interaction_handler/toggle_safety/invoked(atom/target, mob/user, obj/item/prop)
var/obj/item/gun/gun = target
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noting that I removed the loc check as it's a bit pointless. I can add it back via an interaction flag if desired.

gun.toggle_safety(user)
6 changes: 4 additions & 2 deletions code/modules/projectiles/guns/projectile/bolt_action.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
handle_casings = HOLD_CASINGS
load_method = SINGLE_CASING
max_shells = 1
ammo_type = /obj/item/ammo_casing/shell
ammo_type = /obj/item/ammo_casing/rifle
one_hand_penalty = 2
load_sound = 'sound/weapons/guns/interaction/rifle_load.ogg'
fire_delay = 8
Expand Down Expand Up @@ -49,6 +49,7 @@
unload_shell()
else
to_chat(user, "<span class='notice'>You work the bolt open.</span>")
playsound(src.loc, 'sound/weapons/guns/interaction/rifle_boltback.ogg', 50, 1)
else
to_chat(user, "<span class='notice'>You work the bolt closed.</span>")
playsound(src.loc, 'sound/weapons/guns/interaction/rifle_boltforward.ogg', 50, 1)
Expand Down Expand Up @@ -85,4 +86,5 @@
bulk = 8
scoped_accuracy = 8 //increased accuracy over the LWAP because only one shot
scope_zoom = 2
fire_delay = 12
fire_delay = 12
ammo_type = /obj/item/ammo_casing/shell
Binary file modified icons/obj/guns/bolt_action.dmi
Binary file not shown.