MCPcopy Create free account
hub / github.com/NetHack/NetHack / ranged_attk_available

Function ranged_attk_available

src/mhitu.c:2412–2425  ·  view source on GitHub ↗

* This would be equivalent to: * ranged_attk_assessed(mtmp, mon_avoiding_this_attack) * but without the added assessment function call overhead. */

Source from the content-addressed store, hash-verified

2410 * but without the added assessment function call overhead.
2411 */
2412boolean
2413ranged_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

Callers 2

dochugFunction · 0.85
m_balks_at_approachingFunction · 0.85

Calls 2

get_atkdam_typeFunction · 0.85
cvt_adtyp_to_mseenresFunction · 0.85

Tested by

no test coverage detected