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

Function see_monsters

src/display.c:1486–1529  ·  view source on GitHub ↗

* Loop through all of the monsters and update them. Called when: * + going blind & telepathic * + regaining sight & telepathic * + getting and losing infravision * + hallucinating * + doing a full screen redraw * + see invisible times out or a ring of see invisible is taken off * or intrinsic see invisible is stolen by a gremlin * + when a potion

Source from the content-addressed store, hash-verified

1484 * sit.c]
1485 */
1486void
1487see_monsters(void)
1488{
1489 struct monst *mon;
1490 int new_warn_obj_cnt = 0;
1491
1492 if (gd.defer_see_monsters)
1493 return;
1494
1495 /* steed and unseen engulfer/holder/holdee are recognized via touch
1496 even if they aren't going to be rendered; other monsters
1497 may get flagged as having been seen by display_monster() if it's
1498 called by newsym() */
1499 if (u.usteed)
1500 u.usteed->meverseen = 1;
1501 if (u.ustuck)
1502 u.ustuck->meverseen = 1;
1503
1504 /* loop through level.monsters (aka fmon) */
1505 for (mon = fmon; mon; mon = mon->nmon) {
1506 if (DEADMONSTER(mon))
1507 continue;
1508 if ((mon->mstate & MON_STILL_ARRIVING) != 0)
1509 continue;
1510 newsym(mon->mx, mon->my);
1511 if (mon->wormno)
1512 see_wsegs(mon);
1513 if (Warn_of_mon
1514 && (svc.context.warntype.obj & mon->data->mflags2) != 0L)
1515 new_warn_obj_cnt++;
1516 }
1517
1518 /*
1519 * Make Sting glow blue or stop glowing if required.
1520 */
1521 if (new_warn_obj_cnt != gw.warn_obj_cnt) {
1522 Sting_effects(new_warn_obj_cnt);
1523 gw.warn_obj_cnt = new_warn_obj_cnt;
1524 }
1525
1526 /* when mounted, hero's location gets caught by monster loop */
1527 if (!u.usteed)
1528 newsym(u.ux, u.uy);
1529}
1530
1531staticfn void
1532mimic_light_blocking(struct monst *mtmp)

Callers 15

moveloop_preambleFunction · 0.85
allmain.cFile · 0.85
attrcurseFunction · 0.85
toggle_blindnessFunction · 0.85
make_hallucinatedFunction · 0.85
peffect_see_invisibleFunction · 0.85
do_vicinity_mapFunction · 0.85
Helmet_onFunction · 0.85
Helmet_offFunction · 0.85
dragon_armor_handlingFunction · 0.85
Amulet_offFunction · 0.85

Calls 3

newsymFunction · 0.85
see_wsegsFunction · 0.85
Sting_effectsFunction · 0.85

Tested by

no test coverage detected