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

Function angry_priest

src/priest.c:876–911  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

874}
875
876void
877angry_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,

Callers 3

digFunction · 0.85
sacrifice_your_raceFunction · 0.85

Calls 6

findpriestFunction · 0.85
temple_occupiedFunction · 0.85
wakeupFunction · 0.85
setmangryFunction · 0.85
neweminFunction · 0.70
free_epriFunction · 0.70

Tested by

no test coverage detected