| 874 | } |
| 875 | |
| 876 | void |
| 877 | angry_priest(void) |
| 878 | { |
| 879 | struct monst *priest; |
| 880 | struct rm *lev; |
| 881 | |
| 882 | if ((priest = findpriest(temple_occupied(u.urooms))) != 0) { |
| 883 | struct epri *eprip = EPRI(priest); |
| 884 | |
| 885 | wakeup(priest, FALSE); |
| 886 | setmangry(priest, FALSE); |
| 887 | /* |
| 888 | * If the altar has been destroyed or converted, let the |
| 889 | * priest run loose. |
| 890 | * (When it's just a conversion and there happens to be |
| 891 | * a fresh corpse nearby, the priest ought to have an |
| 892 | * opportunity to try converting it back; maybe someday...) |
| 893 | */ |
| 894 | lev = &levl[eprip->shrpos.x][eprip->shrpos.y]; |
| 895 | if (!IS_ALTAR(lev->typ) |
| 896 | || ((aligntyp) Amask2align(lev->altarmask & AM_MASK) |
| 897 | != eprip->shralign)) { |
| 898 | if (!EMIN(priest)) |
| 899 | newemin(priest); |
| 900 | priest->ispriest = 0; /* now a roaming minion */ |
| 901 | priest->isminion = 1; |
| 902 | assert(has_emin(priest)); |
| 903 | EMIN(priest)->min_align = eprip->shralign; |
| 904 | EMIN(priest)->renegade = FALSE; |
| 905 | /* discard priest's memory of his former shrine; |
| 906 | if we ever implement the re-conversion mentioned |
| 907 | above, this will need to be removed */ |
| 908 | free_epri(priest); |
| 909 | } |
| 910 | } |
| 911 | } |
| 912 | |
| 913 | /* |
| 914 | * When saving bones, find priests that aren't on their shrine level, |
no test coverage detected