* 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
| 1484 | * sit.c] |
| 1485 | */ |
| 1486 | void |
| 1487 | see_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 | |
| 1531 | staticfn void |
| 1532 | mimic_light_blocking(struct monst *mtmp) |
no test coverage detected