Skip to content

Commit

Permalink
2
Browse files Browse the repository at this point in the history
  • Loading branch information
AndroBetel committed Feb 20, 2024
1 parent 94f7960 commit c88ad11
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
12 changes: 12 additions & 0 deletions code/modules/cm_marines/smartgun_mount.dm
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,8 @@
burst_scatter_mult = SCATTER_AMOUNT_TIER_7
update_icon()
AddComponent(/datum/component/automatedfire/autofire, fire_delay, burst_fire_delay, burst_amount, gun_firemode, autofire_slow_mult, CALLBACK(src, PROC_REF(set_burst_firing)), CALLBACK(src, PROC_REF(reset_fire)), CALLBACK(src, PROC_REF(try_fire)), CALLBACK(src, PROC_REF(display_ammo)))
AddComponent(/datum/component/iff_fire_prevention)


/obj/structure/machinery/m56d_hmg/Destroy(force) //Make sure we pick up our trash.
operator?.unset_interaction()
Expand Down Expand Up @@ -723,6 +725,16 @@
final_angle += rand(-total_scatter_angle, total_scatter_angle)
target = get_angle_target_turf(T, final_angle, 30)

var/before_fire_cancel = SEND_SIGNAL(src, COMSIG_GUN_BEFORE_FIRE, in_chamber, target, operator)

if(before_fire_cancel)
if(before_fire_cancel & COMPONENT_CANCEL_GUN_BEFORE_FIRE)
return AUTOFIRE_CONTINUE

if(before_fire_cancel & COMPONENT_HARD_CANCEL_GUN_BEFORE_FIRE)
return


in_chamber.weapon_cause_data = create_cause_data(initial(name), operator)
in_chamber.setDir(dir)
in_chamber.def_zone = pick("chest","chest","chest","head")
Expand Down
4 changes: 2 additions & 2 deletions code/modules/projectiles/guns/smartgun.dm
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@
else
drain -= 50
recalculate_attachment_bonuses()

/*
/obj/item/weapon/gun/smartgun/proc/toggle_auto_fire(mob/user)
if(!(flags_item & WIELDED))
to_chat(user, "[icon2html(src, usr)] You need to wield \the [src] to enable autofire.")
Expand Down Expand Up @@ -547,7 +547,7 @@
Fire(target,user)
target = null
/*
/obj/item/weapon/gun/smartgun/proc/toggle_motion_detector(mob/user)
to_chat(user, "[icon2html(src, usr)] You [motion_detector? "<B>disable</b>" : "<B>enable</b>"] \the [src]'s motion detector.")
playsound(loc,'sound/machines/click.ogg', 25, 1)
Expand Down

0 comments on commit c88ad11

Please sign in to comment.