From c98eeb3268ea6c9736a022efc5df34f499edd66a Mon Sep 17 00:00:00 2001 From: homexp13 Date: Tue, 10 Dec 2024 16:12:39 +0300 Subject: [PATCH] dmr --- code/modules/projectiles/guns/rifles.dm | 35 +++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/code/modules/projectiles/guns/rifles.dm b/code/modules/projectiles/guns/rifles.dm index dd73350c577..852e26f0fac 100644 --- a/code/modules/projectiles/guns/rifles.dm +++ b/code/modules/projectiles/guns/rifles.dm @@ -216,6 +216,10 @@ //------------------------------------------------------- //DMR-37 DMR +#define DMR_BUMP_FIRE_DELAY 0.3 SECONDS +#define DMR_BUMP_DAMAGE_MULT 0.6 +#define DMR_BUMP_ACCURACY_MULT 0.9 + /obj/item/weapon/gun/rifle/dmr37 name = "\improper DMR-37 SCA designated marksman rifle" desc = "The San Cristo Arms DMR-37 is the TerraGov Marine Corps designated marksman rifle. It is rather well-known for it's very consistent target placement at longer than usual range, it however lacks a burst fire mode or an automatic mode. It is mostly used by people who prefer to do more careful shooting than most. Uses 10x27mm caseless caliber." @@ -289,6 +293,37 @@ burst_amount = 1 movement_acc_penalty_mult = 6 + var/bump_fire = FALSE + +/obj/item/weapon/gun/rifle/dmr37/toggle_aim_mode(mob/living/carbon/human/user) + if(bump_fire) + balloon_alert(user, "You can't aim while bump fire") + return + return ..() + +/obj/item/weapon/gun/rifle/dmr37/unique_action(mob/user) + if(!user) + CRASH("switch_modes called with no user.") + + if(bump_fire) + fire_delay = initial(fire_delay) + damage_mult = initial(damage_mult) + accuracy_mult = initial(accuracy_mult) + bump_fire = FALSE + + balloon_alert(user, "You started shooting normally") + else + if(HAS_TRAIT(src, TRAIT_GUN_IS_AIMING)) + toggle_aim_mode(user) + fire_delay = DMR_BUMP_FIRE_DELAY + damage_mult = DMR_BUMP_DAMAGE_MULT + accuracy_mult = DMR_BUMP_ACCURACY_MULT + bump_fire = TRUE + + balloon_alert(user, "You started to bump fire") + + SEND_SIGNAL(src, COMSIG_GUN_AUTOFIREDELAY_MODIFIED, fire_delay) + /obj/item/weapon/gun/rifle/dmr37/marksman starting_attachment_types = list(/obj/item/attachable/scope, /obj/item/attachable/angledgrip, /obj/item/attachable/extended_barrel)