diff -uwr nethack-linux/include/extern.h nethack-astral-call-fix/include/extern.h --- nethack-linux/include/extern.h 2008-05-26 19:47:02.000000000 +0200 +++ nethack-astral-call-fix/include/extern.h 2008-11-13 16:09:16.000000000 +0100 @@ -1576,6 +1576,7 @@ E const char *FDECL(a_gname_at, (XCHAR_P x,XCHAR_P y)); E const char *FDECL(align_gname, (ALIGNTYP_P)); E const char *FDECL(halu_gname, (ALIGNTYP_P)); +E const char *FDECL(rnd_gname, (int)); E const char *FDECL(align_gtitle, (ALIGNTYP_P)); E void FDECL(altar_wrath, (int,int)); diff -uwr nethack-linux/src/pray.c nethack-astral-call-fix/src/pray.c --- nethack-linux/src/pray.c 2008-05-26 19:47:02.000000000 +0200 +++ nethack-astral-call-fix/src/pray.c 2008-11-13 16:09:16.000000000 +0100 @@ -1788,12 +1788,21 @@ halu_gname(alignment) aligntyp alignment; { + if (!Hallucination) return align_gname(alignment); + + return rnd_gname(ROLE_RANDOM); +} + +/* select a random god based on role if provided */ +const char * +rnd_gname(role) +int role; +{ const char *gnam; int which; - if (!Hallucination) return align_gname(alignment); - - which = randrole(); + /* select random role if valid role supplied */ + which = (validrole(role)) ? role : randrole(); switch (rn2(3)) { case 0: gnam = roles[which].lgod; break; case 1: gnam = roles[which].ngod; break; diff -uwr nethack-linux/src/priest.c nethack-astral-call-fix/src/priest.c --- nethack-linux/src/priest.c 2008-05-26 19:47:02.000000000 +0200 +++ nethack-astral-call-fix/src/priest.c 2008-11-13 16:33:07.000000000 +0100 @@ -274,7 +274,14 @@ Strcat(pname, "priest "); } Strcat(pname, "of "); + /* Astral Call bugfix */ + if (mon->data == &mons[PM_HIGH_PRIEST] && !Hallucination && + Is_astralevel(&u.uz) && distu(mon->mx, mon->my) > 2) { + Strcat(pname, rnd_gname(str2role((char*)urole.name.m))); + Strcat(pname, "?"); + } else { Strcat(pname, halu_gname((int)EPRI(mon)->shralign)); + } return(pname); } /* use emin instead of epri */