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

Function responsive_mon_at

src/sounds.c:1412–1423  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1410
1411/* is there a monster at <x,y> that can see the hero and react? */
1412staticfn struct monst *
1413responsive_mon_at(int x, int y)
1414{
1415 struct monst *mtmp = isok(x, y) ? m_at(x, y) : 0;
1416
1417 if (mtmp && (helpless(mtmp) /* immobilized monst */
1418 || !mtmp->mcansee || !haseyes(mtmp->data) /* blind monst */
1419 || (Invis && !perceives(mtmp->data)) /* unseen hero */
1420 || (x != mtmp->mx || y != mtmp->my))) /* worm tail */
1421 mtmp = (struct monst *) 0;
1422 return mtmp;
1423}
1424
1425/* player chose 'uarmh' for #tip (pickup.c); visual #chat, sort of... */
1426int

Callers 1

tiphatFunction · 0.85

Calls 1

isokFunction · 0.85

Tested by

no test coverage detected