Skip to content

Commit

Permalink
dmr
Browse files Browse the repository at this point in the history
  • Loading branch information
homexp13 committed Dec 10, 2024
1 parent da9ed9b commit c98eeb3
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions code/modules/projectiles/guns/rifles.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit c98eeb3

Please sign in to comment.