| 976 | } |
| 977 | |
| 978 | void 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 | |
| 1004 | BOOL calc_snd_position(int x, int y, int *plVolume, int *plPan) |
| 1005 | { |
no test coverage detected