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

Function mon_is_gecko

src/sounds.c:658–674  ·  view source on GitHub ↗

return True if mon is a gecko or seems to look like one (hallucination) */

Source from the content-addressed store, hash-verified

656
657/* return True if mon is a gecko or seems to look like one (hallucination) */
658staticfn boolean
659mon_is_gecko(struct monst *mon)
660{
661 int glyph;
662
663 /* return True if it is actually a gecko */
664 if (mon->data == &mons[PM_GECKO])
665 return TRUE;
666 /* return False if it is a long worm; we might be chatting to its tail
667 (not strictly needed; long worms are MS_SILENT so won't get here) */
668 if (mon->data == &mons[PM_LONG_WORM])
669 return FALSE;
670 /* result depends upon whether map spot shows a gecko, which will
671 be due to hallucination or to mimickery since mon isn't one */
672 glyph = glyph_at(mon->mx, mon->my);
673 return (boolean) (glyph_to_mon(glyph) == PM_GECKO);
674}
675
676DISABLE_WARNING_FORMAT_NONLITERAL
677

Callers 1

domonnoiseFunction · 0.85

Calls 1

glyph_atFunction · 0.85

Tested by

no test coverage detected