1 /* NetHack 3.6 priest.c $NHDT-Date: 1446892452 2015/11/07 10:34:12 $ $NHDT-Branch: master $:$NHDT-Revision: 1.41 $ */
2 /* Copyright (c) Izchak Miller, Steve Linhart, 1989. */
3 /* NetHack may be freely redistributed. See license for details. */
8 /* these match the categorizations shown by enlightenment */
9 #define ALGN_SINNED (-4) /* worse than strayed (-1..-3) */
10 #define ALGN_PIOUS 14 /* better than fervent (9..13) */
12 STATIC_DCL boolean
FDECL(histemple_at
, (struct monst
*, XCHAR_P
, XCHAR_P
));
13 STATIC_DCL boolean
FDECL(has_shrine
, (struct monst
*));
20 mtmp
->mextra
= newmextra();
22 EPRI(mtmp
) = (struct epri
*) alloc(sizeof(struct epri
));
23 (void) memset((genericptr_t
) EPRI(mtmp
), 0, sizeof(struct epri
));
31 if (mtmp
->mextra
&& EPRI(mtmp
)) {
32 free((genericptr_t
) EPRI(mtmp
));
33 EPRI(mtmp
) = (struct epri
*) 0;
39 * Move for priests and shopkeepers. Called from shk_move() and pri_move().
40 * Valid returns are 1: moved 0: didn't -1: let m_move do it -2: died.
43 move_special(mtmp
, in_his_shop
, appr
, uondoor
, avoid
, omx
, omy
, gx
, gy
)
44 register struct monst
*mtmp
;
47 boolean uondoor
, avoid
;
48 register xchar omx
, omy
, gx
, gy
;
50 register xchar nx
, ny
, nix
, niy
;
56 struct obj
*ib
= (struct obj
*) 0;
58 if (omx
== gx
&& omy
== gy
)
68 allowflags
= ALLOW_SSM
;
70 allowflags
= ALLOW_SSM
| ALLOW_SANCT
;
71 if (passes_walls(mtmp
->data
))
72 allowflags
|= (ALLOW_ROCK
| ALLOW_WALL
);
73 if (throws_rocks(mtmp
->data
))
74 allowflags
|= ALLOW_ROCK
;
75 if (tunnels(mtmp
->data
))
76 allowflags
|= ALLOW_DIG
;
77 if (!nohands(mtmp
->data
) && !verysmall(mtmp
->data
)) {
78 allowflags
|= OPENDOOR
;
79 if (monhaskey(mtmp
, TRUE
))
80 allowflags
|= UNLOCKDOOR
;
82 if (is_giant(mtmp
->data
))
83 allowflags
|= BUSTDOOR
;
84 cnt
= mfndpos(mtmp
, poss
, info
, allowflags
);
86 if (mtmp
->isshk
&& avoid
&& uondoor
) { /* perhaps we cannot avoid him */
87 for (i
= 0; i
< cnt
; i
++)
88 if (!(info
[i
] & NOTONL
))
93 #define GDIST(x, y) (dist2(x, y, gx, gy))
96 for (i
= 0; i
< cnt
; i
++) {
99 if (IS_ROOM(levl
[nx
][ny
].typ
)
100 || (mtmp
->isshk
&& (!in_his_shop
|| ESHK(mtmp
)->following
))) {
101 if (avoid
&& (info
[i
] & NOTONL
))
103 if ((!appr
&& !rn2(++chcnt
))
104 || (appr
&& GDIST(nx
, ny
) < GDIST(nix
, niy
))) {
110 if (mtmp
->ispriest
&& avoid
&& nix
== omx
&& niy
== omy
111 && onlineu(omx
, omy
)) {
112 /* might as well move closer as long it's going to stay
118 if (nix
!= omx
|| niy
!= omy
) {
119 remove_monster(omx
, omy
);
120 place_monster(mtmp
, nix
, niy
);
122 if (mtmp
->isshk
&& !in_his_shop
&& inhishop(mtmp
))
123 check_special_room(FALSE
);
125 if (cansee(mtmp
->mx
, mtmp
->my
))
126 pline("%s picks up %s.", Monnam(mtmp
),
127 distant_name(ib
, doname
));
128 obj_extract_self(ib
);
129 (void) mpickobj(mtmp
, ib
);
137 temple_occupied(array
)
138 register char *array
;
142 for (ptr
= array
; *ptr
; ptr
++)
143 if (rooms
[*ptr
- ROOMOFFSET
].rtype
== TEMPLE
)
149 histemple_at(priest
, x
, y
)
150 register struct monst
*priest
;
153 return (boolean
) (priest
&& priest
->ispriest
154 && (EPRI(priest
)->shroom
== *in_rooms(x
, y
, TEMPLE
))
155 && on_level(&(EPRI(priest
)->shrlevel
), &u
.uz
));
160 struct monst
*priest
;
162 /* make sure we have a priest */
163 if (!priest
|| !priest
->ispriest
)
165 /* priest must be on right level and in right room */
166 if (!histemple_at(priest
, priest
->mx
, priest
->my
))
168 /* temple room must still contain properly aligned altar */
169 return has_shrine(priest
);
173 * pri_move: return 1: moved 0: didn't -1: let m_move do it -2: died
177 register struct monst
*priest
;
179 register xchar gx
, gy
, omx
, omy
;
181 boolean avoid
= TRUE
;
186 if (!histemple_at(priest
, omx
, omy
))
189 temple
= EPRI(priest
)->shroom
;
191 gx
= EPRI(priest
)->shrpos
.x
;
192 gy
= EPRI(priest
)->shrpos
.y
;
194 gx
+= rn1(3, -1); /* mill around the altar */
197 if (!priest
->mpeaceful
198 || (Conflict
&& !resist(priest
, RING_CLASS
, 0, 0))) {
199 if (monnear(priest
, u
.ux
, u
.uy
)) {
201 Your("displaced image doesn't fool %s!", mon_nam(priest
));
202 (void) mattacku(priest
);
204 } else if (index(u
.urooms
, temple
)) {
205 /* chase player if inside temple & can see him */
206 if (priest
->mcansee
&& m_canseeu(priest
)) {
215 return move_special(priest
, FALSE
, TRUE
, FALSE
, avoid
, omx
, omy
, gx
, gy
);
218 /* exclusively for mktemple() */
220 priestini(lvl
, sroom
, sx
, sy
, sanctum
)
222 struct mkroom
*sroom
;
224 boolean sanctum
; /* is it the seat of the high priest? */
226 struct monst
*priest
;
230 if (MON_AT(sx
+ 1, sy
))
231 (void) rloc(m_at(sx
+ 1, sy
), FALSE
); /* insurance */
233 priest
= makemon(&mons
[sanctum
? PM_HIGH_PRIEST
: PM_ALIGNED_PRIEST
],
234 sx
+ 1, sy
, MM_EPRI
);
236 EPRI(priest
)->shroom
= (schar
) ((sroom
- rooms
) + ROOMOFFSET
);
237 EPRI(priest
)->shralign
= Amask2align(levl
[sx
][sy
].altarmask
);
238 EPRI(priest
)->shrpos
.x
= sx
;
239 EPRI(priest
)->shrpos
.y
= sy
;
240 assign_level(&(EPRI(priest
)->shrlevel
), lvl
);
241 priest
->mtrapseen
= ~0; /* traps are known */
242 priest
->mpeaceful
= 1;
243 priest
->ispriest
= 1;
244 priest
->isminion
= 0;
245 priest
->msleeping
= 0;
246 set_malign(priest
); /* mpeaceful may have changed */
248 /* now his/her goodies... */
249 if (sanctum
&& EPRI(priest
)->shralign
== A_NONE
250 && on_level(&sanctum_level
, &u
.uz
)) {
251 (void) mongets(priest
, AMULET_OF_YENDOR
);
253 /* 2 to 4 spellbooks */
254 for (cnt
= rn1(3, 2); cnt
> 0; --cnt
) {
255 (void) mpickobj(priest
, mkobj(SPBOOK_CLASS
, FALSE
));
257 /* robe [via makemon()] */
258 if (rn2(2) && (otmp
= which_armor(priest
, W_ARMC
)) != 0) {
259 if (p_coaligned(priest
))
267 /* get a monster's alignment type without caller needing EPRI & EMIN */
272 aligntyp algn
= mon
->ispriest
? EPRI(mon
)->shralign
273 : mon
->isminion
? EMIN(mon
)->min_align
274 : mon
->data
->maligntyp
;
277 return A_NONE
; /* negative but differs from chaotic */
278 return (algn
> 0) ? A_LAWFUL
: (algn
< 0) ? A_CHAOTIC
: A_NEUTRAL
;
282 * Specially aligned monsters are named specially.
283 * - aligned priests with ispriest and high priests have shrines
284 * they retain ispriest and epri when polymorphed
285 * - aligned priests without ispriest are roamers
286 * they have isminion set and use emin rather than epri
287 * - minions do not have ispriest but have isminion and emin
288 * - caller needs to inhibit Hallucination if it wants to force
289 * the true name even when under that influence
292 priestname(mon
, pname
)
293 register struct monst
*mon
;
294 char *pname
; /* caller-supplied output buffer */
296 boolean do_hallu
= Hallucination
,
297 aligned_priest
= mon
->data
== &mons
[PM_ALIGNED_PRIEST
],
298 high_priest
= mon
->data
== &mons
[PM_HIGH_PRIEST
];
299 char whatcode
= '\0';
300 const char *what
= do_hallu
? rndmonnam(&whatcode
) : mon
->data
->mname
;
302 if (!mon
->ispriest
&& !mon
->isminion
) /* should never happen... */
303 return strcpy(pname
, what
); /* caller must be confused */
306 if (!do_hallu
|| !bogon_is_pname(whatcode
))
307 Strcat(pname
, "the ");
309 Strcat(pname
, "invisible ");
310 if (mon
->isminion
&& EMIN(mon
)->renegade
)
311 Strcat(pname
, "renegade ");
313 if (mon
->ispriest
|| aligned_priest
) { /* high_priest implies ispriest */
314 if (!aligned_priest
&& !high_priest
) {
315 ; /* polymorphed priest; use ``what'' as is */
318 Strcat(pname
, "high ");
321 else if (mon
->female
)
327 if (mon
->mtame
&& !strcmpi(what
, "Angel"))
328 Strcat(pname
, "guardian ");
332 /* same as distant_monnam(), more or less... */
333 if (do_hallu
|| !high_priest
|| !Is_astralevel(&u
.uz
)
334 || distu(mon
->mx
, mon
->my
) <= 2 || program_state
.gameover
) {
335 Strcat(pname
, " of ");
336 Strcat(pname
, halu_gname(mon_aligntyp(mon
)));
343 struct monst
*priest
;
345 return (boolean
) (u
.ualign
.type
== mon_aligntyp(priest
));
355 if (!pri
|| !pri
->ispriest
)
358 lev
= &levl
[epri_p
->shrpos
.x
][epri_p
->shrpos
.y
];
359 if (!IS_ALTAR(lev
->typ
) || !(lev
->altarmask
& AM_SHRINE
))
361 return (boolean
) (epri_p
->shralign
362 == (Amask2align(lev
->altarmask
& ~AM_SHRINE
)));
369 register struct monst
*mtmp
;
371 for (mtmp
= fmon
; mtmp
; mtmp
= mtmp
->nmon
) {
372 if (DEADMONSTER(mtmp
))
374 if (mtmp
->ispriest
&& (EPRI(mtmp
)->shroom
== roomno
)
375 && histemple_at(mtmp
, mtmp
->mx
, mtmp
->my
))
378 return (struct monst
*) 0;
381 /* called from check_special_room() when the player enters the temple room */
386 struct monst
*priest
, *mtmp
;
388 boolean shrined
, sanctum
, can_speak
;
389 long *this_time
, *other_time
;
390 const char *msg1
, *msg2
;
393 /* don't do anything if hero is already in the room */
394 if (temple_occupied(u
.urooms0
))
397 if ((priest
= findpriest((char) roomno
)) != 0) {
400 epri_p
= EPRI(priest
);
401 shrined
= has_shrine(priest
);
402 sanctum
= (priest
->data
== &mons
[PM_HIGH_PRIEST
]
403 && (Is_sanctum(&u
.uz
) || In_endgame(&u
.uz
)));
404 can_speak
= (priest
->mcanmove
&& !priest
->msleeping
);
405 if (can_speak
&& !Deaf
&& moves
>= epri_p
->intone_time
) {
406 unsigned save_priest
= priest
->ispriest
;
408 /* don't reveal the altar's owner upon temple entry in
409 the endgame; for the Sanctum, the next message names
410 Moloch so suppress the "of Moloch" for him here too */
411 if (sanctum
&& !Hallucination
)
412 priest
->ispriest
= 0;
414 canseemon(priest
) ? Monnam(priest
) : "A nearby voice");
415 priest
->ispriest
= save_priest
;
416 epri_p
->intone_time
= moves
+ (long) d(10, 500); /* ~2505 */
417 /* make sure that we don't suppress entry message when
418 we've just given its "priest intones" introduction */
419 epri_p
->enter_time
= 0L;
422 if (sanctum
&& Is_sanctum(&u
.uz
)) {
423 if (priest
->mpeaceful
) {
424 /* first time inside */
425 msg1
= "Infidel, you have entered Moloch's Sanctum!";
427 priest
->mpeaceful
= 0;
428 /* became angry voluntarily; no penalty for attacking him */
431 /* repeat visit, or attacked priest before entering */
432 msg1
= "You desecrate this place by your presence!";
434 } else if (moves
>= epri_p
->enter_time
) {
435 Sprintf(buf
, "Pilgrim, you enter a %s place!",
436 !shrined
? "desecrated" : "sacred");
439 if (msg1
&& can_speak
&& !Deaf
) {
443 epri_p
->enter_time
= moves
+ (long) d(10, 100); /* ~505 */
446 if (!shrined
|| !p_coaligned(priest
)
447 || u
.ualign
.record
<= ALGN_SINNED
) {
448 msg1
= "have a%s forbidding feeling...";
449 msg2
= (!shrined
|| !p_coaligned(priest
)) ? "" : " strange";
450 this_time
= &epri_p
->hostile_time
;
451 other_time
= &epri_p
->peaceful_time
;
453 msg1
= "experience %s sense of peace.";
454 msg2
= (u
.ualign
.record
>= ALGN_PIOUS
) ? "a" : "an unusual";
455 this_time
= &epri_p
->peaceful_time
;
456 other_time
= &epri_p
->hostile_time
;
458 /* give message if we haven't seen it recently or
459 if alignment update has caused it to switch from
460 forbidding to sense-of-peace or vice versa */
461 if (moves
>= *this_time
|| *other_time
>= *this_time
) {
463 *this_time
= moves
+ (long) d(10, 20); /* ~55 */
464 /* avoid being tricked by the RNG: switch might have just
465 happened and previous random threshold could be larger */
466 if (*this_time
<= *other_time
)
467 *other_time
= *this_time
- 1L;
470 /* recognize the Valley of the Dead and Moloch's Sanctum
471 once hero has encountered the temple priest on those levels */
472 mapseen_temple(priest
);
478 You("have an eerie feeling...");
481 You_feel("like you are being watched.");
484 pline("A shiver runs down your %s.", body_part(SPINE
));
487 break; /* no message; unfortunately there's no
488 EPRI(priest)->eerie_time available to
489 make sure we give one the first time */
492 && (mtmp
= makemon(&mons
[PM_GHOST
], u
.ux
, u
.uy
, NO_MM_FLAGS
))
494 int ngen
= mvitals
[PM_GHOST
].born
;
495 if (canspotmon(mtmp
))
496 pline("A%s ghost appears next to you%c",
497 ngen
< 5 ? "n enormous" : "",
498 ngen
< 10 ? '!' : '.');
500 You("sense a presence close by!");
504 You("are frightened to death, and unable to move.");
506 multi_reason
= "being terrified of a ghost";
507 nomovemsg
= "You regain your composure.";
512 /* reset the move counters used to limit temple entry feedback;
513 leaving the level and then returning yields a fresh start */
515 forget_temple_entry(priest
)
516 struct monst
*priest
;
518 struct epri
*epri_p
= priest
->ispriest
? EPRI(priest
) : 0;
521 impossible("attempting to manipulate shrine data for non-priest?");
524 epri_p
->intone_time
= epri_p
->enter_time
= epri_p
->peaceful_time
=
525 epri_p
->hostile_time
= 0L;
530 register struct monst
*priest
;
532 boolean coaligned
= p_coaligned(priest
);
533 boolean strayed
= (u
.ualign
.record
< 0);
536 u
.uconduct
.gnostic
++;
538 if (priest
->mflee
|| (!priest
->ispriest
&& coaligned
&& strayed
)) {
539 pline("%s doesn't want anything to do with you!", Monnam(priest
));
540 priest
->mpeaceful
= 0;
544 /* priests don't chat unless peaceful and in their own temple */
545 if (!inhistemple(priest
) || !priest
->mpeaceful
546 || !priest
->mcanmove
|| priest
->msleeping
) {
547 static const char *cranky_msg
[3] = {
548 "Thou wouldst have words, eh? I'll give thee a word or two!",
549 "Talk? Here is what I have to say!",
550 "Pilgrim, I would speak no longer with thee."
553 if (!priest
->mcanmove
|| priest
->msleeping
) {
554 pline("%s breaks out of %s reverie!", Monnam(priest
),
556 priest
->mfrozen
= priest
->msleeping
= 0;
557 priest
->mcanmove
= 1;
559 priest
->mpeaceful
= 0;
560 verbalize1(cranky_msg
[rn2(3)]);
564 /* you desecrated the temple and now you want to chat? */
565 if (priest
->mpeaceful
&& *in_rooms(priest
->mx
, priest
->my
, TEMPLE
)
566 && !has_shrine(priest
)) {
568 "Begone! Thou desecratest this holy place with thy presence.");
569 priest
->mpeaceful
= 0;
572 if (!money_cnt(invent
)) {
573 if (coaligned
&& !strayed
) {
574 long pmoney
= money_cnt(priest
->minvent
);
576 /* Note: two bits is actually 25 cents. Hmm. */
577 pline("%s gives you %s for an ale.", Monnam(priest
),
578 (pmoney
== 1L) ? "one bit" : "two bits");
579 money2u(priest
, pmoney
> 1L ? 2 : 1);
581 pline("%s preaches the virtues of poverty.", Monnam(priest
));
582 exercise(A_WIS
, TRUE
);
584 pline("%s is not interested.", Monnam(priest
));
589 pline("%s asks you for a contribution for the temple.",
591 if ((offer
= bribe(priest
)) == 0) {
592 verbalize("Thou shalt regret thine action!");
595 } else if (offer
< (u
.ulevel
* 200)) {
596 if (money_cnt(invent
) > (offer
* 2L)) {
597 verbalize("Cheapskate.");
599 verbalize("I thank thee for thy contribution.");
600 /* give player some token */
601 exercise(A_WIS
, TRUE
);
603 } else if (offer
< (u
.ulevel
* 400)) {
604 verbalize("Thou art indeed a pious individual.");
605 if (money_cnt(invent
) < (offer
* 2L)) {
606 if (coaligned
&& u
.ualign
.record
<= ALGN_SINNED
)
608 verbalize("I bestow upon thee a blessing.");
609 incr_itimeout(&HClairvoyant
, rn1(500, 500));
611 } else if (offer
< (u
.ulevel
* 600)
612 /* u.ublessed is only active when Protection is
613 enabled via something other than worn gear
614 (theft by gremlin clears the intrinsic but not
615 its former magnitude, making it recoverable) */
616 && (!(HProtection
& INTRINSIC
)
618 && (u
.ublessed
< 9 || !rn2(u
.ublessed
))))) {
619 verbalize("Thy devotion has been rewarded.");
620 if (!(HProtection
& INTRINSIC
)) {
621 HProtection
|= FROMOUTSIDE
;
623 u
.ublessed
= rn1(3, 2);
627 verbalize("Thy selfless generosity is deeply appreciated.");
628 if (money_cnt(invent
) < (offer
* 2L) && coaligned
) {
629 if (strayed
&& (moves
- u
.ucleansed
) > 5000L) {
630 u
.ualign
.record
= 0; /* cleanse thee */
641 mk_roamer(ptr
, alignment
, x
, y
, peaceful
)
642 register struct permonst
*ptr
;
647 register struct monst
*roamer
;
648 register boolean coaligned
= (u
.ualign
.type
== alignment
);
650 #if 0 /* this was due to permonst's pxlth field which is now gone */
651 if (ptr
!= &mons
[PM_ALIGNED_PRIEST
] && ptr
!= &mons
[PM_ANGEL
])
652 return (struct monst
*) 0;
656 (void) rloc(m_at(x
, y
), FALSE
); /* insurance */
658 if (!(roamer
= makemon(ptr
, x
, y
, MM_ADJACENTOK
| MM_EMIN
)))
659 return (struct monst
*) 0;
661 EMIN(roamer
)->min_align
= alignment
;
662 EMIN(roamer
)->renegade
= (coaligned
&& !peaceful
);
663 roamer
->ispriest
= 0;
664 roamer
->isminion
= 1;
665 roamer
->mtrapseen
= ~0; /* traps are known */
666 roamer
->mpeaceful
= peaceful
;
667 roamer
->msleeping
= 0;
668 set_malign(roamer
); /* peaceful may have changed */
675 reset_hostility(roamer
)
676 register struct monst
*roamer
;
678 if (!roamer
->isminion
)
680 if (roamer
->data
!= &mons
[PM_ALIGNED_PRIEST
]
681 && roamer
->data
!= &mons
[PM_ANGEL
])
684 if (EMIN(roamer
)->min_align
!= u
.ualign
.type
) {
685 roamer
->mpeaceful
= roamer
->mtame
= 0;
688 newsym(roamer
->mx
, roamer
->my
);
692 in_your_sanctuary(mon
, x
, y
)
693 struct monst
*mon
; /* if non-null, <mx,my> overrides <x,y> */
696 register char roomno
;
697 register struct monst
*priest
;
700 if (is_minion(mon
->data
) || is_rider(mon
->data
))
702 x
= mon
->mx
, y
= mon
->my
;
704 if (u
.ualign
.record
<= ALGN_SINNED
) /* sinned or worse */
706 if ((roomno
= temple_occupied(u
.urooms
)) == 0
707 || roomno
!= *in_rooms(x
, y
, TEMPLE
))
709 if ((priest
= findpriest(roomno
)) == 0)
711 return (boolean
) (has_shrine(priest
) && p_coaligned(priest
)
712 && priest
->mpeaceful
);
715 /* when attacking "priest" in his temple */
718 struct monst
*priest
;
720 int x
, y
, ax
, ay
, roomno
= (int) temple_occupied(u
.urooms
);
721 struct mkroom
*troom
;
723 if (!roomno
|| !has_shrine(priest
))
726 ax
= x
= EPRI(priest
)->shrpos
.x
;
727 ay
= y
= EPRI(priest
)->shrpos
.y
;
728 troom
= &rooms
[roomno
- ROOMOFFSET
];
730 if ((u
.ux
== x
&& u
.uy
== y
) || !linedup(u
.ux
, u
.uy
, x
, y
, 1)) {
731 if (IS_DOOR(levl
[u
.ux
][u
.uy
].typ
)) {
732 if (u
.ux
== troom
->lx
- 1) {
735 } else if (u
.ux
== troom
->hx
+ 1) {
738 } else if (u
.uy
== troom
->ly
- 1) {
741 } else if (u
.uy
== troom
->hy
+ 1) {
765 if (!linedup(u
.ux
, u
.uy
, x
, y
, 1))
771 pline("%s roars in anger: \"Thou shalt suffer!\"",
775 pline("%s voice booms: \"How darest thou harm my servant!\"",
776 s_suffix(a_gname_at(ax
, ay
)));
779 pline("%s roars: \"Thou dost profane my shrine!\"",
784 buzz(-10 - (AD_ELEC
- 1), 6, x
, y
, sgn(tbx
),
785 sgn(tby
)); /* bolt of lightning */
786 exercise(A_WIS
, FALSE
);
792 register struct monst
*priest
;
795 if ((priest
= findpriest(temple_occupied(u
.urooms
))) != 0) {
796 struct epri
*eprip
= EPRI(priest
);
800 * If the altar has been destroyed or converted, let the
802 * (When it's just a conversion and there happens to be
803 * a fresh corpse nearby, the priest ought to have an
804 * opportunity to try converting it back; maybe someday...)
806 lev
= &levl
[eprip
->shrpos
.x
][eprip
->shrpos
.y
];
807 if (!IS_ALTAR(lev
->typ
)
808 || ((aligntyp
) Amask2align(lev
->altarmask
& AM_MASK
)
809 != eprip
->shralign
)) {
812 priest
->ispriest
= 0; /* now a roaming minion */
813 priest
->isminion
= 1;
814 EMIN(priest
)->min_align
= eprip
->shralign
;
815 EMIN(priest
)->renegade
= FALSE
;
816 /* discard priest's memory of his former shrine;
817 if we ever implement the re-conversion mentioned
818 above, this will need to be removed */
825 * When saving bones, find priests that aren't on their shrine level,
826 * and remove them. This avoids big problems when restoring bones.
827 * [Perhaps we should convert them into roamers instead?]
834 for (mtmp
= fmon
; mtmp
; mtmp
= mtmp
->nmon
) {
835 if (DEADMONSTER(mtmp
))
837 if (mtmp
->ispriest
&& !on_level(&(EPRI(mtmp
)->shrlevel
), &u
.uz
))
842 /* munge priest-specific structure when restoring -dlc */
844 restpriest(mtmp
, ghostly
)
845 register struct monst
*mtmp
;
850 assign_level(&(EPRI(mtmp
)->shrlevel
), &u
.uz
);