* This would be equivalent to: * ranged_attk_assessed(mtmp, mon_avoiding_this_attack) * but without the added assessment function call overhead. */
| 2410 | * but without the added assessment function call overhead. |
| 2411 | */ |
| 2412 | boolean |
| 2413 | ranged_attk_available(struct monst *mtmp) |
| 2414 | { |
| 2415 | int i, typ = -1; |
| 2416 | struct permonst *ptr = mtmp->data; |
| 2417 | |
| 2418 | for (i = 0; i < NATTK; i++) { |
| 2419 | if (DISTANCE_ATTK_TYPE(ptr->mattk[i].aatyp) |
| 2420 | && (typ = get_atkdam_type(ptr->mattk[i].adtyp)) >= 0 |
| 2421 | && m_seenres(mtmp, cvt_adtyp_to_mseenres(typ)) == 0) |
| 2422 | return TRUE; |
| 2423 | } |
| 2424 | return FALSE; |
| 2425 | } |
| 2426 | |
| 2427 | /* FIXME: |
| 2428 | * sequencing issue: a monster's attack might cause poly'd hero |
no test coverage detected