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

Function mon_avoiding_this_attack

src/mhitu.c:2392–2405  ·  view source on GitHub ↗

can be used as ranged_attk_assessed() callback. Returns TRUE if monster is avoiding use of this attack */

Source from the content-addressed store, hash-verified

2390/* can be used as ranged_attk_assessed() callback.
2391 Returns TRUE if monster is avoiding use of this attack */
2392boolean
2393mon_avoiding_this_attack(
2394 struct monst *mtmp,
2395 int attkidx)
2396{
2397 struct permonst *ptr = mtmp->data;
2398 int typ = -1;
2399
2400 if (attkidx >= 0
2401 && (typ = get_atkdam_type(ptr->mattk[attkidx].adtyp)) >= 0
2402 && m_seenres(mtmp, cvt_adtyp_to_mseenres(typ)))
2403 return TRUE;
2404 return FALSE;
2405}
2406
2407/*
2408 * This would be equivalent to:

Callers

nothing calls this directly

Calls 2

get_atkdam_typeFunction · 0.85
cvt_adtyp_to_mseenresFunction · 0.85

Tested by

no test coverage detected