called when returning to a previously visited level */
| 4803 | |
| 4804 | /* called when returning to a previously visited level */ |
| 4805 | void |
| 4806 | hide_monst(struct monst *mon) |
| 4807 | { |
| 4808 | boolean hider_under = hides_under(mon->data) || mon->data->mlet == S_EEL; |
| 4809 | |
| 4810 | if ((is_hider(mon->data) || hider_under) |
| 4811 | && !(mon->mundetected || M_AP_TYPE(mon))) { |
| 4812 | coordxy x = mon->mx, y = mon->my; |
| 4813 | char save_viz = gv.viz_array[y][x]; |
| 4814 | |
| 4815 | /* override vision, forcing hero to be unable to see monster's spot */ |
| 4816 | gv.viz_array[y][x] &= ~(IN_SIGHT | COULD_SEE); |
| 4817 | if (is_hider(mon->data)) |
| 4818 | (void) restrap(mon); |
| 4819 | /* try again if mimic missed its 1/3 chance to hide */ |
| 4820 | if (mon->data->mlet == S_MIMIC && !M_AP_TYPE(mon)) |
| 4821 | (void) restrap(mon); |
| 4822 | gv.viz_array[y][x] = save_viz; |
| 4823 | if (hider_under) |
| 4824 | (void) hideunder(mon); |
| 4825 | } |
| 4826 | } |
| 4827 | |
| 4828 | void |
| 4829 | mon_animal_list(boolean construct) |