| 2247 | } |
| 2248 | |
| 2249 | int M_DoRSpAttack(int i) |
| 2250 | { |
| 2251 | if ((DWORD)i >= MAXMONSTERS) |
| 2252 | app_fatal("M_DoRSpAttack: Invalid monster %d", i); |
| 2253 | if (monster[i].MType == NULL) |
| 2254 | app_fatal("M_DoRSpAttack: Monster %d \"%s\" MType NULL", i, monster[i].mName); |
| 2255 | if (monster[i].MType == NULL) // BUGFIX: should check MData |
| 2256 | app_fatal("M_DoRSpAttack: Monster %d \"%s\" MData NULL", i, monster[i].mName); |
| 2257 | |
| 2258 | if (monster[i]._mAnimFrame == monster[i].MData->mAFNum2 && !monster[i]._mAnimCnt) { |
| 2259 | AddMissile( |
| 2260 | monster[i]._mx, |
| 2261 | monster[i]._my, |
| 2262 | monster[i]._menemyx, |
| 2263 | monster[i]._menemyy, |
| 2264 | monster[i]._mdir, |
| 2265 | monster[i]._mVar1, |
| 2266 | 1, |
| 2267 | i, |
| 2268 | monster[i]._mVar3, |
| 2269 | 0); |
| 2270 | PlayEffect(i, 3); |
| 2271 | } |
| 2272 | |
| 2273 | if (monster[i]._mAi == AI_MEGA && monster[i]._mAnimFrame == 3) { |
| 2274 | int hadV2 = monster[i]._mVar2; |
| 2275 | monster[i]._mVar2++; |
| 2276 | if (hadV2 == 0) { |
| 2277 | monster[i]._mFlags |= MFLAG_ALLOW_SPECIAL; |
| 2278 | } else if (monster[i]._mVar2 == 15) { |
| 2279 | monster[i]._mFlags &= ~MFLAG_ALLOW_SPECIAL; |
| 2280 | } |
| 2281 | } |
| 2282 | |
| 2283 | if (monster[i]._mAnimFrame == monster[i]._mAnimLen) { |
| 2284 | M_StartStand(i, monster[i]._mdir); |
| 2285 | return TRUE; |
| 2286 | } |
| 2287 | |
| 2288 | return FALSE; |
| 2289 | } |
| 2290 | |
| 2291 | BOOL M_DoSAttack(int i) |
| 2292 | { |
no test coverage detected