Skip to content

Commit

Permalink
Some Bolt-Action Fixes (sniper rifle mag manip independent of bolt, a…
Browse files Browse the repository at this point in the history
…mong other things) (tgstation#75079)

- because pipeguns can no longer misfire, removes the code relevant to
cleaning them with a cloth
- the above makes it so that you can insert/remove a sniper rifle's
magazine regardless of bolt open/close status, which is neat
- also nudges some code around so that affixing a bayonet or whacking
your gun with any item no longer spams it with "can't jam!" or "bolt
closed!"
## Why It's Good For The Game
less random irrelevant popups, and also the magazine on sniper rifles
thing just kind of irked me
  • Loading branch information
Hatterhat committed May 16, 2023
1 parent 0683573 commit 0bace67
Showing 1 changed file with 11 additions and 17 deletions.
28 changes: 11 additions & 17 deletions code/modules/projectiles/guns/ballistic/rifle.dm
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,6 @@
return FALSE
return ..()

/obj/item/gun/ballistic/rifle/attackby(obj/item/A, mob/user, params)
if (!bolt_locked && !istype(A, /obj/item/stack/sheet/cloth))
balloon_alert(user, "[bolt_wording] is closed!")
return
return ..()

/obj/item/gun/ballistic/rifle/examine(mob/user)
. = ..()
. += "The bolt is [bolt_locked ? "open" : "closed"]."
Expand Down Expand Up @@ -101,19 +95,20 @@
return ..()

/obj/item/gun/ballistic/rifle/boltaction/attackby(obj/item/item, mob/user, params)
. = ..()
if(!can_jam)
balloon_alert(user, "can't jam!")
return

if(!bolt_locked)
if(!bolt_locked && !istype(item, /obj/item/knife))
balloon_alert(user, "bolt closed!")
return

if(istype(item, /obj/item/gun_maintenance_supplies) && do_after(user, 10 SECONDS, target = src))
user.visible_message(span_notice("[user] finishes maintenance of [src]."))
jamming_chance = initial(jamming_chance)
qdel(item)
. = ..()

if(istype(item, /obj/item/gun_maintenance_supplies))
if(!can_jam)
balloon_alert(user, "can't jam!")
return
if(do_after(user, 10 SECONDS, target = src))
user.visible_message(span_notice("[user] finishes maintaining [src]."))
jamming_chance = initial(jamming_chance)
qdel(item)

/obj/item/gun/ballistic/rifle/boltaction/blow_up(mob/user)
. = FALSE
Expand Down Expand Up @@ -181,7 +176,6 @@
initial_fire_sound = 'sound/weapons/gun/sniper/shot.ogg'
alternative_fire_sound = 'sound/weapons/gun/shotgun/shot.ogg'
can_modify_ammo = TRUE
can_misfire = FALSE
can_bayonet = TRUE
knife_y_offset = 11
can_be_sawn_off = FALSE
Expand Down

0 comments on commit 0bace67

Please sign in to comment.