return 1: guard moved, -2: died */
| 833 | |
| 834 | /* return 1: guard moved, -2: died */ |
| 835 | staticfn int |
| 836 | gd_move_cleanup( |
| 837 | struct monst *grd, |
| 838 | boolean semi_dead, |
| 839 | boolean disappear_msg_seen) |
| 840 | { |
| 841 | int x, y; |
| 842 | boolean see_guard; |
| 843 | |
| 844 | /* |
| 845 | * The following is a kludge. We need to keep the guard around in |
| 846 | * order to be able to make the fake corridor disappear as the |
| 847 | * player moves out of it, but we also need the guard out of the |
| 848 | * way. We send the guard to never-never land. We set ogx ogy to |
| 849 | * mx my in order to avoid a check at the top of this function. |
| 850 | * At the end of the process, the guard is killed in restfakecorr(). |
| 851 | */ |
| 852 | x = grd->mx, y = grd->my; |
| 853 | see_guard = canspotmon(grd); |
| 854 | parkguard(grd); /* move to <0,0> */ |
| 855 | wallify_vault(grd); |
| 856 | restfakecorr(grd); |
| 857 | debugpline2("gd_move_cleanup: %scleanup%s", |
| 858 | grd->isgd ? "" : "final ", |
| 859 | grd->isgd ? " attempt" : ""); |
| 860 | if (!semi_dead && (in_fcorridor(grd, u.ux, u.uy) || cansee(x, y))) { |
| 861 | if (!disappear_msg_seen && see_guard) |
| 862 | pline("Suddenly, %s disappears.", noit_mon_nam(grd)); |
| 863 | return 1; |
| 864 | } |
| 865 | return -2; |
| 866 | } |
| 867 | |
| 868 | staticfn void |
| 869 | gd_letknow(struct monst *grd) |
no test coverage detected