Skip to content

Commit

Permalink
adds the sounds and the code
Browse files Browse the repository at this point in the history
  • Loading branch information
VileBeggar committed Dec 3, 2023
1 parent dbc71b6 commit 199af2c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions code/modules/projectiles/guns/lever_action.dm
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,7 @@ their unique feature is that a direct hit will buff your damage and firerate
hit_buff_reset_cooldown = 2 SECONDS //how much time after a direct hit until streaks reset
var/floating_penetration = FLOATING_PENETRATION_TIER_0 //holder var
var/floating_penetration_upper_limit = FLOATING_PENETRATION_TIER_4
var/direct_hit_sound = 'sound/weapons/gun_xm88_directhit_low.ogg'
attachable_allowed = list(
/obj/item/attachable/bayonet/upp, // Barrel
/obj/item/attachable/bayonet,
Expand Down Expand Up @@ -499,12 +500,16 @@ their unique feature is that a direct hit will buff your damage and firerate
switch(floating_penetration)
if(FLOATING_PENETRATION_TIER_1)
P.ammo = GLOB.ammo_list[/datum/ammo/bullet/lever_action/xm88/pen20]
direct_hit_sound = "sound/weapons/gun_xm88_directhit_low.ogg"
if(FLOATING_PENETRATION_TIER_2)
P.ammo = GLOB.ammo_list[/datum/ammo/bullet/lever_action/xm88/pen30]
direct_hit_sound = "sound/weapons/gun_xm88_directhit_medium.ogg"
if(FLOATING_PENETRATION_TIER_3)
P.ammo = GLOB.ammo_list[/datum/ammo/bullet/lever_action/xm88/pen40]
direct_hit_sound = "sound/weapons/gun_xm88_directhit_medium.ogg"
if(FLOATING_PENETRATION_TIER_4)
P.ammo = GLOB.ammo_list[/datum/ammo/bullet/lever_action/xm88/pen50]
direct_hit_sound = "sound/weapons/gun_xm88_directhit_high.ogg"
return ..()

/obj/item/weapon/gun/lever_action/xm88/unload(mob/user)
Expand All @@ -524,6 +529,7 @@ their unique feature is that a direct hit will buff your damage and firerate
lever_message = initial(lever_message)
wield_delay = initial(wield_delay)
cur_onehand_chance = initial(cur_onehand_chance)
direct_hit_sound = "sound/weapons/gun_xm88_directhit_low.ogg"
if(in_chamber)
var/obj/projectile/P = in_chamber
P.ammo = GLOB.ammo_list[/datum/ammo/bullet/lever_action/xm88]
Expand All @@ -536,6 +542,10 @@ their unique feature is that a direct hit will buff your damage and firerate
if(one_hand_lever)
addtimer(VARSET_CALLBACK(src, cur_onehand_chance, reset_onehand_chance), 4 SECONDS, TIMER_OVERRIDE|TIMER_UNIQUE)

/obj/item/weapon/gun/lever_action/xm88/direct_hit_buff(mob/user, mob/target, one_hand_lever = FALSE)
. = ..()
playsound(target, direct_hit_sound, 75, vary = TRUE)

#undef FLOATING_PENETRATION_TIER_0
#undef FLOATING_PENETRATION_TIER_1
#undef FLOATING_PENETRATION_TIER_2
Expand Down
Binary file added sound/weapons/gun_xm88_directhit_high.ogg
Binary file not shown.
Binary file added sound/weapons/gun_xm88_directhit_low.ogg
Binary file not shown.
Binary file added sound/weapons/gun_xm88_directhit_medium.ogg
Binary file not shown.

0 comments on commit 199af2c

Please sign in to comment.