From c53003ecece537eef6de8b2e942a262102824366 Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Tue, 16 May 2023 20:50:30 +0100 Subject: [PATCH] [MIRROR] Some Bolt-Action Fixes (sniper rifle mag manip independent of bolt, among other things) [MDB IGNORE] (#21236) * Some Bolt-Action Fixes (sniper rifle mag manip independent of bolt, among other things) (#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 * Some Bolt-Action Fixes (sniper rifle mag manip independent of bolt, among other things) --------- Co-authored-by: Hatterhat <31829017+Hatterhat@users.noreply.github.com> --- .../projectiles/guns/ballistic/rifle.dm | 28 ++++++++----------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/code/modules/projectiles/guns/ballistic/rifle.dm b/code/modules/projectiles/guns/ballistic/rifle.dm index b451e29593c..22d6db23bbb 100644 --- a/code/modules/projectiles/guns/ballistic/rifle.dm +++ b/code/modules/projectiles/guns/ballistic/rifle.dm @@ -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"]." @@ -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 @@ -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