| 1373 | } |
| 1374 | |
| 1375 | staticfn int |
| 1376 | m_lined_up(struct monst *mtarg, struct monst *mtmp) |
| 1377 | { |
| 1378 | boolean utarget = (mtarg == &gy.youmonst); |
| 1379 | coordxy tx = utarget ? mtmp->mux : mtarg->mx; |
| 1380 | coordxy ty = utarget ? mtmp->muy : mtarg->my; |
| 1381 | boolean ignore_boulders = utarget && (throws_rocks(mtmp->data) |
| 1382 | || m_carrying(mtmp, WAN_STRIKING)); |
| 1383 | |
| 1384 | /* hero concealment usually trumps monst awareness of being lined up */ |
| 1385 | if (utarget && Upolyd && rn2(25) |
| 1386 | && (u.uundetected || (U_AP_TYPE != M_AP_NOTHING |
| 1387 | && U_AP_TYPE != M_AP_MONSTER))) |
| 1388 | return FALSE; |
| 1389 | |
| 1390 | /* [no callers care about the 1 vs 2 situation any more] */ |
| 1391 | return linedup(tx, ty, mtmp->mx, mtmp->my, |
| 1392 | utarget ? (ignore_boulders ? 1 : 2) : 0); |
| 1393 | } |
| 1394 | |
| 1395 | |
| 1396 | /* is mtmp in position to use ranged attack on hero? */ |