MCPcopy Index your code
hub / github.com/NetHack/NetHack / notice_mon

Function notice_mon

src/hack.c:1707–1732  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1705}
1706
1707void
1708notice_mon(struct monst *mtmp)
1709{
1710 if (a11y.mon_notices && !a11y.mon_notices_blocked) {
1711 boolean spot = canspotmon(mtmp)
1712 && !(is_hider(mtmp->data)
1713 && (mtmp->mundetected
1714 || M_AP_TYPE(mtmp) == M_AP_FURNITURE
1715 || M_AP_TYPE(mtmp) == M_AP_OBJECT));
1716
1717 if (spot && !mtmp->mspotted && !DEADMONSTER(mtmp)) {
1718 mtmp->mspotted = TRUE;
1719 set_msg_xy(mtmp->mx, mtmp->my);
1720 You("%s %s.", canseemon(mtmp) ? "see" : "notice",
1721 x_monnam(mtmp,
1722 mtmp->mtame ? ARTICLE_YOUR
1723 : (!has_mgivenname(mtmp)
1724 && !type_is_pname(mtmp->data)) ? ARTICLE_A
1725 : ARTICLE_NONE,
1726 (mtmp->mpeaceful && !mtmp->mtame) ? "peaceful" : 0,
1727 has_mgivenname(mtmp) ? SUPPRESS_SADDLE : 0, FALSE));
1728 } else if (!spot) {
1729 mtmp->mspotted = FALSE;
1730 }
1731 }
1732}
1733
1734staticfn int QSORTCALLBACK
1735notice_mons_cmp(const genericptr ptr1, const genericptr ptr2)

Callers 2

notice_all_monsFunction · 0.85
postmovFunction · 0.85

Calls 3

set_msg_xyFunction · 0.85
YouFunction · 0.85
canseemonFunction · 0.85

Tested by

no test coverage detected