Skip to content

Commit

Permalink
Adds a scaling direct hit sound to the XM88 (#5117)
Browse files Browse the repository at this point in the history
# About the pull request

Adds a scaling impact sound for every direct hit you obtain with the
XM88, depending on the current penetration value.

# Explain why it's good for the game

The bullseye mechanic makes this weapon very, very powerful. However,
you don't really feel like you're doing any more damage with it. The
XM88 doesn't really give the user any proper feedback if they're
managing to nail several direct hits. A good sound effect can give them
a dopamine rush, and in turn, make the weapon more fun to use.

# Testing Photographs and Procedure
<details>
<summary>Screenshots & Videos</summary>



https://github.com/cmss13-devs/cmss13/assets/17518895/555995ab-74ef-4174-ac71-0f5eecbead3f



</details>


# Changelog
:cl:
soundadd: The XM88 now has a scaling hit sound for every direct hit you
manage to land with it.
/:cl:
  • Loading branch information
VileBeggar authored Dec 6, 2023
1 parent 35be415 commit e448b00
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)

#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 e448b00

Please sign in to comment.