MCPcopy Create free account
hub / github.com/diasurgical/devilution / PlayEffect

Function PlayEffect

Source/effects.cpp:978–1002  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

976}
977
978void PlayEffect(int i, int mode)
979{
980 int sndIdx, mi, lVolume, lPan;
981 TSnd *snd;
982
983 if (plr[myplr].pLvlLoad) {
984 return;
985 }
986
987 sndIdx = random_(164, 2);
988 if (!gbSndInited || !gbSoundOn || gbBufferMsgs) {
989 return;
990 }
991
992 mi = monster[i]._mMTidx;
993 snd = Monsters[mi].Snds[mode][sndIdx];
994 if (!snd || snd_playing(snd)) {
995 return;
996 }
997
998 if (!calc_snd_position(monster[i]._mx, monster[i]._my, &lVolume, &lPan))
999 return;
1000
1001 snd_play_snd(snd, lVolume, lPan);
1002}
1003
1004BOOL calc_snd_position(int x, int y, int *plVolume, int *plPan)
1005{

Callers 12

M_StartHitFunction · 0.85
M2MStartHitFunction · 0.85
MonstStartKillFunction · 0.85
M2MStartKillFunction · 0.85
M_DoAttackFunction · 0.85
M_DoRAttackFunction · 0.85
M_DoRSpAttackFunction · 0.85
M_DoSpStandFunction · 0.85
MAI_SnakeFunction · 0.85
MAI_RhinoFunction · 0.85
missiles.cppFile · 0.85
MonsterMHitFunction · 0.85

Calls 4

random_Function · 0.85
snd_playingFunction · 0.85
calc_snd_positionFunction · 0.85
snd_play_sndFunction · 0.85

Tested by

no test coverage detected