MCPcopy Create free account
hub / github.com/OpenXcom/OpenXcom / playDeathSound

Method playDeathSound

src/Battlescape/UnitDieBState.cpp:295–309  ·  view source on GitHub ↗

* Plays the death sound. */

Source from the content-addressed store, hash-verified

293 * Plays the death sound.
294 */
295void UnitDieBState::playDeathSound()
296{
297 if ((_unit->getType() == "SOLDIER" && _unit->getGender() == GENDER_MALE) || _unit->getType() == "MALE_CIVILIAN")
298 {
299 _parent->getResourcePack()->getSound("BATTLE.CAT", RNG::generate(41,43))->play();
300 }
301 else if ((_unit->getType() == "SOLDIER" && _unit->getGender() == GENDER_FEMALE) || _unit->getType() == "FEMALE_CIVILIAN")
302 {
303 _parent->getResourcePack()->getSound("BATTLE.CAT", RNG::generate(44,46))->play();
304 }
305 else
306 {
307 _parent->getResourcePack()->getSound("BATTLE.CAT", _unit->getDeathSound())->play();
308 }
309}
310
311}

Callers

nothing calls this directly

Calls 7

generateFunction · 0.85
getTypeMethod · 0.45
getGenderMethod · 0.45
playMethod · 0.45
getSoundMethod · 0.45
getResourcePackMethod · 0.45
getDeathSoundMethod · 0.45

Tested by

no test coverage detected