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

Function display_warning

src/display.c:633–651  ·  view source on GitHub ↗

* display_warning() * * This is also *not* a map_XXXX() function! Monster warnings float * above everything just like monsters do, but only if the monster * is not showing. * * Do not call for worm tails. */

Source from the content-addressed store, hash-verified

631 * Do not call for worm tails.
632 */
633staticfn void
634display_warning(struct monst *mon)
635{
636 coordxy x = mon->mx, y = mon->my;
637 int glyph;
638
639 if (mon_warning(mon)) {
640 int wl = Hallucination ? rn2_on_display_rng(WARNCOUNT - 1) + 1
641 : warning_of(mon);
642
643 glyph = warning_to_glyph(wl);
644 } else if (MATCH_WARN_OF_MON(mon)) {
645 glyph = mon_to_glyph(mon, rn2_on_display_rng);
646 } else {
647 impossible("display_warning did not match warning type?");
648 return;
649 }
650 show_mon_or_warn(x, y, glyph);
651}
652
653int
654warning_of(struct monst *mon)

Callers 1

newsymFunction · 0.85

Calls 5

mon_warningFunction · 0.85
rn2_on_display_rngFunction · 0.85
warning_ofFunction · 0.85
show_mon_or_warnFunction · 0.85
impossibleFunction · 0.70

Tested by

no test coverage detected