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

Function detect_wsegs

src/worm.c:502–519  ·  view source on GitHub ↗

* detect_wsegs() * * Display all of the segments of the given worm for detection. */

Source from the content-addressed store, hash-verified

500 * Display all of the segments of the given worm for detection.
501 */
502void
503detect_wsegs(struct monst *worm, boolean use_detection_glyph)
504{
505 int num;
506 struct wseg *curr = wtails[worm->wormno];
507 int what_tail = what_mon(PM_LONG_WORM_TAIL, newsym_rn2);
508
509 while (curr != wheads[worm->wormno]) {
510 num = use_detection_glyph ? detected_monnum_to_glyph(what_tail,
511 worm->female ? FEMALE : MALE)
512 : worm->mtame ? petnum_to_glyph(what_tail,
513 worm->female ? FEMALE : MALE)
514 : monnum_to_glyph(what_tail,
515 worm->female ? FEMALE : MALE);
516 show_glyph(curr->wx, curr->wy, num);
517 curr = curr->nseg;
518 }
519}
520
521/*
522 * save_worm()

Callers 1

map_monstFunction · 0.85

Calls 1

show_glyphFunction · 0.85

Tested by

no test coverage detected