MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / PlayPlayerDamageSound

Function PlayPlayerDamageSound

Descent3/damage.cpp:722–750  ·  view source on GitHub ↗

Plays the sound for a player being damaged

Source from the content-addressed store, hash-verified

720
721// Plays the sound for a player being damaged
722void PlayPlayerDamageSound(object *playerobj, int damage_type) {
723 int sound_handle;
724
725 switch (damage_type) {
726 case PD_ENERGY_WEAPON:
727 sound_handle = SOUND_HIT_BY_ENERGY_WEAPON;
728 break;
729 case PD_MATTER_WEAPON:
730 sound_handle = SOUND_HIT_BY_MATTER_WEAPON;
731 break;
732 case PD_CONCUSSIVE_FORCE:
733 sound_handle = SOUND_HIT_BY_CONCUSSIVE_FORCE;
734 break;
735 case PD_WALL_HIT:
736 sound_handle = SOUND_PLAYER_HIT_WALL;
737 break;
738 case PD_VOLATILE_HISS:
739 sound_handle = SOUND_VOLATILE_HISS;
740 break;
741
742 default:
743 Int3();
744 case PD_MELEE_ATTACK: // melee sounds handled in aimain.cpp for now
745 case PD_NONE:
746 return;
747 }
748
749 Sound_system.Play3dSound(sound_handle, SND_PRIORITY_HIGHEST, playerobj);
750}
751
752// Plays the sound for a player being damaged
753void PlayPlayerInvulnerabilitySound(object *playerobj) {

Callers 1

ApplyDamageToPlayerFunction · 0.85

Calls 1

Play3dSoundMethod · 0.80

Tested by

no test coverage detected