Skip to content

Commit

Permalink
a
Browse files Browse the repository at this point in the history
  • Loading branch information
Git-Nivrak committed Jun 13, 2024
1 parent b0e1823 commit 28c8f91
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
3 changes: 3 additions & 0 deletions code/datums/ammo/ammo.dm
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@
/// The flicker that plays when a bullet hits a target. Usually red. Can be nulled so it doesn't show up at all.
var/hit_effect_color = "#FF0000"

/// How much fire delay to add to the weapon after firing this kind of ammo
var/fire_delay_modifier = 0

/datum/ammo/New()
set_bullet_traits()

Expand Down
6 changes: 3 additions & 3 deletions code/datums/ammo/bullet/revolver.dm
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
damage = 35
penetration = ARMOR_PENETRATION_TIER_4
accuracy = HIT_ACCURACY_TIER_3
fire_delay_modifier = 1 SECONDS

/datum/ammo/bullet/revolver/heavy/on_hit_mob(mob/entity, obj/projectile/bullet)
slowdown(entity, bullet)
pushback(entity, bullet, 4)
/datum/ammo/bullet/revolver/heavy/on_hit_mob(mob/M, obj/projectile/P)
knockback(M, P, 4)

/datum/ammo/bullet/revolver/incendiary
name = "incendiary revolver bullet"
Expand Down
4 changes: 3 additions & 1 deletion code/modules/projectiles/gun.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1142,6 +1142,8 @@ and you're good to go.
flags_gun_features &= ~GUN_BURST_FIRING
return NONE

var/ammo_fire_delay = projectile_to_fire.ammo.fire_delay_modifier // Save this early because projectile_to_fire is going to be nulled

apply_bullet_effects(projectile_to_fire, user, reflex, dual_wield) //User can be passed as null.
SEND_SIGNAL(projectile_to_fire, COMSIG_BULLET_USER_EFFECTS, user)

Expand Down Expand Up @@ -1204,7 +1206,7 @@ and you're good to go.
if(check_for_attachment_fire)
active_attachable.last_fired = world.time
else
last_fired = world.time
last_fired = world.time + ammo_fire_delay
var/delay_left = (last_fired + fire_delay + additional_fire_group_delay) - world.time
if(fire_delay_group && delay_left > 0)
LAZYSET(user.fire_delay_next_fire, src, world.time + delay_left)
Expand Down

0 comments on commit 28c8f91

Please sign in to comment.