Skip to content

Commit

Permalink
Add a headshot bang sound like in classic (#648)
Browse files Browse the repository at this point in the history
* Add satisfying headshot bangs like in classic

* add whack sound

* Update Client_Update.cpp

* Add files via upload

* Moved to Resources/Sounds/Feedback

* Play only if inflicted by LocalPlayer

Also lowered volume

* Update AUTHORS

* Update Credits.inc
  • Loading branch information
teodor6140 authored and yvt committed Sep 5, 2017
1 parent d8916aa commit 0cb053c
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Credits
"Mailaender" - FreeDesktop definitions fixes
"Chameleonhider" - Configurable player name drawing
"CenturionFox" - Server Disconnect Screen
"teodor6140" - Headshot feedback "whack" sound

And many others which weren't mentioned here.

Expand Down
Binary file added Resources/Sounds/Feedback/HeadshotFeedback.opus
Binary file not shown.
10 changes: 9 additions & 1 deletion Sources/Client/Client_Update.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -957,7 +957,15 @@ namespace spades {

if (by == world->GetLocalPlayer() && hurtPlayer) {
net->SendHit(hurtPlayer->GetId(), type);


if (type == HitTypeHead) {
Handle<IAudioChunk> c =
audioDevice->RegisterSound("Sounds/Feedback/HeadshotFeedback.opus");
AudioParam param;
param.volume = 10.f;
audioDevice->Play(c, hitPos, param);
}

hitFeedbackIconState = 1.f;
if (hurtPlayer->GetTeamId() == world->GetLocalPlayer()->GetTeamId()) {
hitFeedbackFriendly = true;
Expand Down
1 change: 1 addition & 0 deletions Sources/Gui/Credits.inc
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Credits
"CenturionFox" - Server Disconnect Screen
"DarkDracoon" - European Portuguese translation
"BrunoDiazU" - Spanish translation
"teodor6140" - Headshot feedback "whack" sound
And many others which weren't mentioned here.
Expand Down

0 comments on commit 0cb053c

Please sign in to comment.