OSDN Git Service

set trivial flags
[jnethack/source.git] / src / priest.c
1 /* NetHack 3.6  priest.c        $NHDT-Date: 1545131519 2018/12/18 11:11:59 $  $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.45 $ */
2 /* Copyright (c) Izchak Miller, Steve Linhart, 1989.              */
3 /* NetHack may be freely redistributed.  See license for details. */
4
5 /* JNetHack Copyright */
6 /* (c) Issei Numata, Naoki Hamada, Shigehiro Miyashita, 1994-2000  */
7 /* For 3.4-, Copyright (c) SHIRAKATA Kentaro, 2002-2019            */
8 /* JNetHack may be freely redistributed.  See license for details. */
9
10 #include "hack.h"
11 #include "mfndpos.h"
12
13 /* these match the categorizations shown by enlightenment */
14 #define ALGN_SINNED (-4) /* worse than strayed (-1..-3) */
15 #define ALGN_PIOUS 14    /* better than fervent (9..13) */
16
17 STATIC_DCL boolean FDECL(histemple_at, (struct monst *, XCHAR_P, XCHAR_P));
18 STATIC_DCL boolean FDECL(has_shrine, (struct monst *));
19
20 void
21 newepri(mtmp)
22 struct monst *mtmp;
23 {
24     if (!mtmp->mextra)
25         mtmp->mextra = newmextra();
26     if (!EPRI(mtmp)) {
27         EPRI(mtmp) = (struct epri *) alloc(sizeof(struct epri));
28         (void) memset((genericptr_t) EPRI(mtmp), 0, sizeof(struct epri));
29     }
30 }
31
32 void
33 free_epri(mtmp)
34 struct monst *mtmp;
35 {
36     if (mtmp->mextra && EPRI(mtmp)) {
37         free((genericptr_t) EPRI(mtmp));
38         EPRI(mtmp) = (struct epri *) 0;
39     }
40     mtmp->ispriest = 0;
41 }
42
43 /*
44  * Move for priests and shopkeepers.  Called from shk_move() and pri_move().
45  * Valid returns are  1: moved  0: didn't  -1: let m_move do it  -2: died.
46  */
47 int
48 move_special(mtmp, in_his_shop, appr, uondoor, avoid, omx, omy, gx, gy)
49 register struct monst *mtmp;
50 boolean in_his_shop;
51 schar appr;
52 boolean uondoor, avoid;
53 register xchar omx, omy, gx, gy;
54 {
55     register xchar nx, ny, nix, niy;
56     register schar i;
57     schar chcnt, cnt;
58     coord poss[9];
59     long info[9];
60     long allowflags;
61 #if 0 /* dead code; see below */
62     struct obj *ib = (struct obj *) 0;
63 #endif
64
65     if (omx == gx && omy == gy)
66         return 0;
67     if (mtmp->mconf) {
68         avoid = FALSE;
69         appr = 0;
70     }
71
72     nix = omx;
73     niy = omy;
74     if (mtmp->isshk)
75         allowflags = ALLOW_SSM;
76     else
77         allowflags = ALLOW_SSM | ALLOW_SANCT;
78     if (passes_walls(mtmp->data))
79         allowflags |= (ALLOW_ROCK | ALLOW_WALL);
80     if (throws_rocks(mtmp->data))
81         allowflags |= ALLOW_ROCK;
82     if (tunnels(mtmp->data))
83         allowflags |= ALLOW_DIG;
84     if (!nohands(mtmp->data) && !verysmall(mtmp->data)) {
85         allowflags |= OPENDOOR;
86         if (monhaskey(mtmp, TRUE))
87             allowflags |= UNLOCKDOOR;
88     }
89     if (is_giant(mtmp->data))
90         allowflags |= BUSTDOOR;
91     cnt = mfndpos(mtmp, poss, info, allowflags);
92
93     if (mtmp->isshk && avoid && uondoor) { /* perhaps we cannot avoid him */
94         for (i = 0; i < cnt; i++)
95             if (!(info[i] & NOTONL))
96                 goto pick_move;
97         avoid = FALSE;
98     }
99
100 #define GDIST(x, y) (dist2(x, y, gx, gy))
101 pick_move:
102     chcnt = 0;
103     for (i = 0; i < cnt; i++) {
104         nx = poss[i].x;
105         ny = poss[i].y;
106         if (IS_ROOM(levl[nx][ny].typ)
107             || (mtmp->isshk && (!in_his_shop || ESHK(mtmp)->following))) {
108             if (avoid && (info[i] & NOTONL))
109                 continue;
110             if ((!appr && !rn2(++chcnt))
111                 || (appr && GDIST(nx, ny) < GDIST(nix, niy))) {
112                 nix = nx;
113                 niy = ny;
114             }
115         }
116     }
117     if (mtmp->ispriest && avoid && nix == omx && niy == omy
118         && onlineu(omx, omy)) {
119         /* might as well move closer as long it's going to stay
120          * lined up */
121         avoid = FALSE;
122         goto pick_move;
123     }
124
125     if (nix != omx || niy != omy) {
126         remove_monster(omx, omy);
127         place_monster(mtmp, nix, niy);
128         newsym(nix, niy);
129         if (mtmp->isshk && !in_his_shop && inhishop(mtmp))
130             check_special_room(FALSE);
131 #if 0 /* dead code; maybe someday someone will track down why... */
132         if (ib) {
133             if (cansee(mtmp->mx, mtmp->my))
134 #if 0 /*JP:T*/
135                 pline("%s picks up %s.", Monnam(mtmp),
136                       distant_name(ib, doname));
137 #else
138                 pline("%s\82Í%s\82ð\8fE\82Á\82½\81D", Monnam(mtmp),
139                       distant_name(ib, doname));
140 #endif
141             obj_extract_self(ib);
142             (void) mpickobj(mtmp, ib);
143         }
144 #endif
145         return 1;
146     }
147     return 0;
148 }
149
150 char
151 temple_occupied(array)
152 register char *array;
153 {
154     register char *ptr;
155
156     for (ptr = array; *ptr; ptr++)
157         if (rooms[*ptr - ROOMOFFSET].rtype == TEMPLE)
158             return *ptr;
159     return '\0';
160 }
161
162 STATIC_OVL boolean
163 histemple_at(priest, x, y)
164 register struct monst *priest;
165 register xchar x, y;
166 {
167     return (boolean) (priest && priest->ispriest
168                       && (EPRI(priest)->shroom == *in_rooms(x, y, TEMPLE))
169                       && on_level(&(EPRI(priest)->shrlevel), &u.uz));
170 }
171
172 boolean
173 inhistemple(priest)
174 struct monst *priest;
175 {
176     /* make sure we have a priest */
177     if (!priest || !priest->ispriest)
178         return FALSE;
179     /* priest must be on right level and in right room */
180     if (!histemple_at(priest, priest->mx, priest->my))
181         return FALSE;
182     /* temple room must still contain properly aligned altar */
183     return has_shrine(priest);
184 }
185
186 /*
187  * pri_move: return 1: moved  0: didn't  -1: let m_move do it  -2: died
188  */
189 int
190 pri_move(priest)
191 register struct monst *priest;
192 {
193     register xchar gx, gy, omx, omy;
194     schar temple;
195     boolean avoid = TRUE;
196
197     omx = priest->mx;
198     omy = priest->my;
199
200     if (!histemple_at(priest, omx, omy))
201         return -1;
202
203     temple = EPRI(priest)->shroom;
204
205     gx = EPRI(priest)->shrpos.x;
206     gy = EPRI(priest)->shrpos.y;
207
208     gx += rn1(3, -1); /* mill around the altar */
209     gy += rn1(3, -1);
210
211     if (!priest->mpeaceful
212         || (Conflict && !resist(priest, RING_CLASS, 0, 0))) {
213         if (monnear(priest, u.ux, u.uy)) {
214             if (Displaced)
215 /*JP
216                 Your("displaced image doesn't fool %s!", mon_nam(priest));
217 */
218                 Your("\8c\89e\82Í%s\82ð\82¾\82Ü\82¹\82È\82©\82Á\82½\81I", mon_nam(priest));
219             (void) mattacku(priest);
220             return 0;
221         } else if (index(u.urooms, temple)) {
222             /* chase player if inside temple & can see him */
223             if (priest->mcansee && m_canseeu(priest)) {
224                 gx = u.ux;
225                 gy = u.uy;
226             }
227             avoid = FALSE;
228         }
229     } else if (Invis)
230         avoid = FALSE;
231
232     return move_special(priest, FALSE, TRUE, FALSE, avoid, omx, omy, gx, gy);
233 }
234
235 /* exclusively for mktemple() */
236 void
237 priestini(lvl, sroom, sx, sy, sanctum)
238 d_level *lvl;
239 struct mkroom *sroom;
240 int sx, sy;
241 boolean sanctum; /* is it the seat of the high priest? */
242 {
243     struct monst *priest;
244     struct obj *otmp;
245     int cnt;
246
247     if (MON_AT(sx + 1, sy))
248         (void) rloc(m_at(sx + 1, sy), FALSE); /* insurance */
249
250     priest = makemon(&mons[sanctum ? PM_HIGH_PRIEST : PM_ALIGNED_PRIEST],
251                      sx + 1, sy, MM_EPRI);
252     if (priest) {
253         EPRI(priest)->shroom = (schar) ((sroom - rooms) + ROOMOFFSET);
254         EPRI(priest)->shralign = Amask2align(levl[sx][sy].altarmask);
255         EPRI(priest)->shrpos.x = sx;
256         EPRI(priest)->shrpos.y = sy;
257         assign_level(&(EPRI(priest)->shrlevel), lvl);
258         priest->mtrapseen = ~0; /* traps are known */
259         priest->mpeaceful = 1;
260         priest->ispriest = 1;
261         priest->isminion = 0;
262         priest->msleeping = 0;
263         set_malign(priest); /* mpeaceful may have changed */
264
265         /* now his/her goodies... */
266         if (sanctum && EPRI(priest)->shralign == A_NONE
267             && on_level(&sanctum_level, &u.uz)) {
268             (void) mongets(priest, AMULET_OF_YENDOR);
269         }
270         /* 2 to 4 spellbooks */
271         for (cnt = rn1(3, 2); cnt > 0; --cnt) {
272             (void) mpickobj(priest, mkobj(SPBOOK_CLASS, FALSE));
273         }
274         /* robe [via makemon()] */
275         if (rn2(2) && (otmp = which_armor(priest, W_ARMC)) != 0) {
276             if (p_coaligned(priest))
277                 uncurse(otmp);
278             else
279                 curse(otmp);
280         }
281     }
282 }
283
284 /* get a monster's alignment type without caller needing EPRI & EMIN */
285 aligntyp
286 mon_aligntyp(mon)
287 struct monst *mon;
288 {
289     aligntyp algn = mon->ispriest ? EPRI(mon)->shralign
290                                   : mon->isminion ? EMIN(mon)->min_align
291                                                   : mon->data->maligntyp;
292
293     if (algn == A_NONE)
294         return A_NONE; /* negative but differs from chaotic */
295     return (algn > 0) ? A_LAWFUL : (algn < 0) ? A_CHAOTIC : A_NEUTRAL;
296 }
297
298 /*
299  * Specially aligned monsters are named specially.
300  *      - aligned priests with ispriest and high priests have shrines
301  *              they retain ispriest and epri when polymorphed
302  *      - aligned priests without ispriest are roamers
303  *              they have isminion set and use emin rather than epri
304  *      - minions do not have ispriest but have isminion and emin
305  *      - caller needs to inhibit Hallucination if it wants to force
306  *              the true name even when under that influence
307  */
308 char *
309 priestname(mon, pname)
310 register struct monst *mon;
311 char *pname; /* caller-supplied output buffer */
312 {
313     boolean do_hallu = Hallucination,
314             aligned_priest = mon->data == &mons[PM_ALIGNED_PRIEST],
315             high_priest = mon->data == &mons[PM_HIGH_PRIEST];
316     char whatcode = '\0';
317     const char *what = do_hallu ? rndmonnam(&whatcode) : mon->data->mname;
318
319     if (!mon->ispriest && !mon->isminion) /* should never happen...  */
320         return strcpy(pname, what);       /* caller must be confused */
321
322     *pname = '\0';
323 #if 0 /*JP*//*\93ú\96{\8cê\82Å\82Í\95s\97v*/
324     if (!do_hallu || !bogon_is_pname(whatcode))
325         Strcat(pname, "the ");
326 #endif
327     if (mon->minvis)
328 /*JP
329         Strcat(pname, "invisible ");
330 */
331         Strcat(pname, "\93§\96¾\82È");
332     if (mon->isminion && EMIN(mon)->renegade)
333 /*JP
334         Strcat(pname, "renegade ");
335 */
336         Strcat(pname, "\97 \90Ø\82è\8eÒ\82Ì");
337
338 #if 1 /*JP*//*\91®\90«\82Í\82±\82±\82Å\95t\82¯\82é*/
339     if (do_hallu || !high_priest || !Is_astralevel(&u.uz)
340         || distu(mon->mx, mon->my) <= 2 || program_state.gameover) {
341         Strcat(pname, halu_gname(mon_aligntyp(mon)));
342         Strcat(pname, "\82Ì");
343     }
344 #endif
345     if (mon->ispriest || aligned_priest) { /* high_priest implies ispriest */
346         if (!aligned_priest && !high_priest) {
347             ; /* polymorphed priest; use ``what'' as is */
348         } else {
349             if (high_priest)
350 #if 0 /*JP*/
351                 Strcat(pname, "high ");
352 #else
353                 {
354                     if (Hallucination)
355                         what = "\96³\94\\8d\82\8b\89\8a¯\97»";
356                     else
357                         what = "\96@\89¤";
358                 }
359             else /* \8fã\8bL\82Å\8a®\90¬\82³\82¹\82Ä\81A\88È\89º\82Ì\83R\81[\83h\82Í\92Ê\82ç\82È\82­\82·\82é */
360 #endif
361             if (Hallucination)
362 /*JP
363                 what = "poohbah";
364 */
365                 what = "\96³\94\\8a¯\97»";
366             else if (mon->female)
367 /*JP
368                 what = "priestess";
369 */
370                 what = "\93ò\91m";
371             else
372 /*JP
373                 what = "priest";
374 */
375                 what = "\91m\97µ";
376         }
377     } else {
378 /*JP
379         if (mon->mtame && !strcmpi(what, "Angel"))
380 */
381         if (mon->mtame && !strcmpi(what, "\93V\8eg"))
382 /*JP
383             Strcat(pname, "guardian ");
384 */
385             Strcat(pname, "\8cx\8cì");
386     }
387
388     Strcat(pname, what);
389 #if 0 /*JP*//*\91®\90«\82Í\82·\82Å\82É\95t\82¯\82Ä\82¢\82é*/
390     /* same as distant_monnam(), more or less... */
391     if (do_hallu || !high_priest || !Is_astralevel(&u.uz)
392         || distu(mon->mx, mon->my) <= 2 || program_state.gameover) {
393         Strcat(pname, " of ");
394         Strcat(pname, halu_gname(mon_aligntyp(mon)));
395     }
396 #endif
397     return pname;
398 }
399
400 boolean
401 p_coaligned(priest)
402 struct monst *priest;
403 {
404     return (boolean) (u.ualign.type == mon_aligntyp(priest));
405 }
406
407 STATIC_OVL boolean
408 has_shrine(pri)
409 struct monst *pri;
410 {
411     struct rm *lev;
412     struct epri *epri_p;
413
414     if (!pri || !pri->ispriest)
415         return FALSE;
416     epri_p = EPRI(pri);
417     lev = &levl[epri_p->shrpos.x][epri_p->shrpos.y];
418     if (!IS_ALTAR(lev->typ) || !(lev->altarmask & AM_SHRINE))
419         return FALSE;
420     return (boolean) (epri_p->shralign
421                       == (Amask2align(lev->altarmask & ~AM_SHRINE)));
422 }
423
424 struct monst *
425 findpriest(roomno)
426 char roomno;
427 {
428     register struct monst *mtmp;
429
430     for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) {
431         if (DEADMONSTER(mtmp))
432             continue;
433         if (mtmp->ispriest && (EPRI(mtmp)->shroom == roomno)
434             && histemple_at(mtmp, mtmp->mx, mtmp->my))
435             return mtmp;
436     }
437     return (struct monst *) 0;
438 }
439
440 /* called from check_special_room() when the player enters the temple room */
441 void
442 intemple(roomno)
443 int roomno;
444 {
445     struct monst *priest, *mtmp;
446     struct epri *epri_p;
447     boolean shrined, sanctum, can_speak;
448     long *this_time, *other_time;
449     const char *msg1, *msg2;
450     char buf[BUFSZ];
451
452     /* don't do anything if hero is already in the room */
453     if (temple_occupied(u.urooms0))
454         return;
455
456     if ((priest = findpriest((char) roomno)) != 0) {
457         /* tended */
458
459         epri_p = EPRI(priest);
460         shrined = has_shrine(priest);
461         sanctum = (priest->data == &mons[PM_HIGH_PRIEST]
462                    && (Is_sanctum(&u.uz) || In_endgame(&u.uz)));
463         can_speak = (priest->mcanmove && !priest->msleeping);
464         if (can_speak && !Deaf && moves >= epri_p->intone_time) {
465             unsigned save_priest = priest->ispriest;
466
467             /* don't reveal the altar's owner upon temple entry in
468                the endgame; for the Sanctum, the next message names
469                Moloch so suppress the "of Moloch" for him here too */
470             if (sanctum && !Hallucination)
471                 priest->ispriest = 0;
472 #if 0 /*JP:T*/
473             pline("%s intones:",
474                   canseemon(priest) ? Monnam(priest) : "A nearby voice");
475 #else
476             pline("%s\82ª\89r\8f¥\82µ\82½\81F",
477                   canseemon(priest) ? Monnam(priest) : "\8bß\82­\82Å\92N\82©");
478 #endif
479             priest->ispriest = save_priest;
480             epri_p->intone_time = moves + (long) d(10, 500); /* ~2505 */
481             /* make sure that we don't suppress entry message when
482                we've just given its "priest intones" introduction */
483             epri_p->enter_time = 0L;
484         }
485         msg1 = msg2 = 0;
486         if (sanctum && Is_sanctum(&u.uz)) {
487             if (priest->mpeaceful) {
488                 /* first time inside */
489 /*JP
490                 msg1 = "Infidel, you have entered Moloch's Sanctum!";
491 */
492                 msg1 = "\88Ù\92[\8eÒ\82æ\81I\82±\82±\82Í\81C\83\82\81[\83\8d\83b\83N\82Ì\90¹\88æ\82¾\81I";
493 /*JP
494                 msg2 = "Be gone!";
495 */
496                 msg2 = "\97§\82¿\82³\82ê\81I";
497                 priest->mpeaceful = 0;
498                 /* became angry voluntarily; no penalty for attacking him */
499                 set_malign(priest);
500             } else {
501                 /* repeat visit, or attacked priest before entering */
502 /*JP
503                 msg1 = "You desecrate this place by your presence!";
504 */
505                 msg1 = "\82¨\82Ü\82¦\82Í\82±\82Ì\90_\90¹\82È\8fê\8f\8a\82ð\89\98\82µ\82Ä\82¢\82é\81I";
506             }
507         } else if (moves >= epri_p->enter_time) {
508 #if 0 /*JP:T*/
509             Sprintf(buf, "Pilgrim, you enter a %s place!",
510                     !shrined ? "desecrated" : "sacred");
511 #else
512             Sprintf(buf, "\8f\84\97ç\8eÒ\82æ\81C\82¨\82Ü\82¦\82Í%s\92n\82É\82¢\82é\81I",
513                     !shrined ? "\95s\8fò\82Ì" : "\90_\90¹\82È\82é");
514 #endif
515             msg1 = buf;
516         }
517         if (msg1 && can_speak && !Deaf) {
518             verbalize1(msg1);
519             if (msg2)
520                 verbalize1(msg2);
521             epri_p->enter_time = moves + (long) d(10, 100); /* ~505 */
522         }
523         if (!sanctum) {
524             if (!shrined || !p_coaligned(priest)
525                 || u.ualign.record <= ALGN_SINNED) {
526 /*JP
527                 msg1 = "have a%s forbidding feeling...";
528 */
529                 msg1 = "%s\8bß\82Ã\82«\82ª\82½\82¢\8bC\8e\9d\82ª\82µ\82½\81D\81D\81D";
530 /*JP
531                 msg2 = (!shrined || !p_coaligned(priest)) ? "" : " strange";
532 */
533                 msg2 = (!shrined || !p_coaligned(priest)) ? "" : "\8aï\96­\82È";
534                 this_time = &epri_p->hostile_time;
535                 other_time = &epri_p->peaceful_time;
536             } else {
537 /*JP
538                 msg1 = "experience %s sense of peace.";
539 */
540                 msg1 = "%s\96\9e\82¿\91«\82è\82½\8bC\8e\9d\82¿\82É\82È\82Á\82½\81D";
541 /*JP
542                 msg2 = (u.ualign.record >= ALGN_PIOUS) ? "a" : "an unusual";
543 */
544                 msg2 = (u.ualign.record >= ALGN_PIOUS) ? "a" : "\82¢\82Â\82É\82È\82­";
545                 this_time = &epri_p->peaceful_time;
546                 other_time = &epri_p->hostile_time;
547             }
548             /* give message if we haven't seen it recently or
549                if alignment update has caused it to switch from
550                forbidding to sense-of-peace or vice versa */
551             if (moves >= *this_time || *other_time >= *this_time) {
552                 You(msg1, msg2);
553                 *this_time = moves + (long) d(10, 20); /* ~55 */
554                 /* avoid being tricked by the RNG:  switch might have just
555                    happened and previous random threshold could be larger */
556                 if (*this_time <= *other_time)
557                     *other_time = *this_time - 1L;
558             }
559         }
560         /* recognize the Valley of the Dead and Moloch's Sanctum
561            once hero has encountered the temple priest on those levels */
562         mapseen_temple(priest);
563     } else {
564         /* untended */
565
566         switch (rn2(4)) {
567         case 0:
568 /*JP
569             You("have an eerie feeling...");
570 */
571             You("\82¼\82Á\82Æ\82µ\82½\81D\81D\81D");
572             break;
573         case 1:
574 /*JP
575             You_feel("like you are being watched.");
576 */
577             You("\8c©\82Â\82ß\82ç\82ê\82Ä\82¢\82é\82æ\82¤\82È\8bC\82ª\82µ\82½\81D");
578             break;
579         case 2:
580 /*JP
581             pline("A shiver runs down your %s.", body_part(SPINE));
582 */
583             pline("\82 \82È\82½\82Ì%s\82ð\90k\82¦\82ª\91\96\82Á\82½\81D", body_part(SPINE));
584             break;
585         default:
586             break; /* no message; unfortunately there's no
587                       EPRI(priest)->eerie_time available to
588                       make sure we give one the first time */
589         }
590         if (!rn2(5)
591             && (mtmp = makemon(&mons[PM_GHOST], u.ux, u.uy, NO_MM_FLAGS))
592                    != 0) {
593             int ngen = mvitals[PM_GHOST].born;
594             if (canspotmon(mtmp))
595 #if 0 /*JP:T*/
596                 pline("A%s ghost appears next to you%c",
597                       ngen < 5 ? "n enormous" : "",
598                       ngen < 10 ? '!' : '.');
599 #else
600                 pline("%s\97H\97ì\82ª\82 \82È\82½\82Ì\82·\82®\82»\82Î\82É\8c»\82í\82ê\82½%s",
601                       ngen < 5 ? "\8b\90\91å\82È" : "",
602                       ngen < 10 ? "\81I" : "\81D");
603 #endif
604             else
605 /*JP
606                 You("sense a presence close by!");
607 */
608                 You("\82·\82®\82»\82Î\82É\89½\82©\82ª\82¢\82é\82Ì\82ð\8a´\82\82½\81I");
609             mtmp->mpeaceful = 0;
610             set_malign(mtmp);
611             if (flags.verbose)
612 /*JP
613                 You("are frightened to death, and unable to move.");
614 */
615                 You("\82Ü\82Á\82³\82¨\82É\82È\82Á\82Ä\8bÁ\82«\81C\93®\82¯\82È\82­\82È\82Á\82½\81D");
616             nomul(-3);
617 /*JP
618             multi_reason = "being terrified of a ghost";
619 */
620             multi_reason = "\97H\97ì\82É\8b°\95|\82µ\82Ä\82¢\82é\8e\9e\82É";
621 /*JP
622             nomovemsg = "You regain your composure.";
623 */
624             nomovemsg = "\82 \82È\82½\82Í\95½\90Ã\82ð\8eæ\82è\96ß\82µ\82½\81D";
625         }
626     }
627 }
628
629 /* reset the move counters used to limit temple entry feedback;
630    leaving the level and then returning yields a fresh start */
631 void
632 forget_temple_entry(priest)
633 struct monst *priest;
634 {
635     struct epri *epri_p = priest->ispriest ? EPRI(priest) : 0;
636
637     if (!epri_p) {
638         impossible("attempting to manipulate shrine data for non-priest?");
639         return;
640     }
641     epri_p->intone_time = epri_p->enter_time = epri_p->peaceful_time =
642         epri_p->hostile_time = 0L;
643 }
644
645 void
646 priest_talk(priest)
647 register struct monst *priest;
648 {
649     boolean coaligned = p_coaligned(priest);
650     boolean strayed = (u.ualign.record < 0);
651
652     /* KMH, conduct */
653     u.uconduct.gnostic++;
654
655     if (priest->mflee || (!priest->ispriest && coaligned && strayed)) {
656 /*JP
657         pline("%s doesn't want anything to do with you!", Monnam(priest));
658 */
659         pline("%s\82Í\82 \82È\82½\82É\8d\\82¢\82½\82­\82È\82¢\82æ\82¤\82¾\81I", Monnam(priest));
660         priest->mpeaceful = 0;
661         return;
662     }
663
664     /* priests don't chat unless peaceful and in their own temple */
665     if (!inhistemple(priest) || !priest->mpeaceful
666         || !priest->mcanmove || priest->msleeping) {
667         static const char *cranky_msg[3] = {
668 /*JP
669             "Thou wouldst have words, eh?  I'll give thee a word or two!",
670 */
671             "\93ð\8c¾\97t\82ð\96]\82Þ\82Ì\82©\81H",
672 /*JP
673             "Talk?  Here is what I have to say!",
674 */
675             "\98b\82·\81H\89½\82ð\8c¾\82¦\82Î\82æ\82¢\82Ì\82¾\81I",
676 /*JP
677             "Pilgrim, I would speak no longer with thee."
678 */
679             "\8f\84\97ç\8eÒ\82æ\81C\93ð\82É\8cê\82é\82±\82Æ\82È\82Ç\82È\82¢\81D"
680         };
681
682         if (!priest->mcanmove || priest->msleeping) {
683 #if 0 /*JP:T*/
684             pline("%s breaks out of %s reverie!", Monnam(priest),
685                   mhis(priest));
686 #else
687             pline("%s\82ÍáÒ\91z\82ð\92\86\92f\82µ\82½\81I", Monnam(priest));
688 #endif
689             priest->mfrozen = priest->msleeping = 0;
690             priest->mcanmove = 1;
691         }
692         priest->mpeaceful = 0;
693         verbalize1(cranky_msg[rn2(3)]);
694         return;
695     }
696
697     /* you desecrated the temple and now you want to chat? */
698     if (priest->mpeaceful && *in_rooms(priest->mx, priest->my, TEMPLE)
699         && !has_shrine(priest)) {
700         verbalize(
701 /*JP
702               "Begone!  Thou desecratest this holy place with thy presence.");
703 */
704               "\97§\82¿\8b\8e\82ê\81I\93ð\82Í\82±\82Ì\90_\90¹\82È\82é\8fê\8f\8a\82ð\89\98\82µ\82Ä\82¢\82é\81D");
705         priest->mpeaceful = 0;
706         return;
707     }
708     if (!money_cnt(invent)) {
709         if (coaligned && !strayed) {
710             long pmoney = money_cnt(priest->minvent);
711             if (pmoney > 0L) {
712                 /* Note: two bits is actually 25 cents.  Hmm. */
713 #if 0 /*JP:T*/
714                 pline("%s gives you %s for an ale.", Monnam(priest),
715                       (pmoney == 1L) ? "one bit" : "two bits");
716 #else
717                 pline("%s\82Í\82 \82È\82½\82ª\83G\81[\83\8b\8eð\82ð\88ù\82ß\82é\82æ\82¤\82É\81C%s\82ð\97^\82¦\82½\81D", Monnam(priest),
718                       (pmoney == 1L) ? "\8bà\89Ý1\96\87" : "\8bà\89Ý2\96\87");
719 #endif
720                 money2u(priest, pmoney > 1L ? 2 : 1);
721             } else
722 /*JP
723                 pline("%s preaches the virtues of poverty.", Monnam(priest));
724 */
725                 pline("%s\82Í\90´\95n\82Ì\94ü\93¿\82É\82Â\82¢\82Ä\90à\8b³\82µ\82½\81D", Monnam(priest));
726             exercise(A_WIS, TRUE);
727         } else
728 /*JP
729             pline("%s is not interested.", Monnam(priest));
730 */
731             pline("%s\82Í\8b»\96¡\82ð\8e¦\82³\82È\82¢\81D", Monnam(priest));
732         return;
733     } else {
734         long offer;
735
736 /*JP
737         pline("%s asks you for a contribution for the temple.",
738 */
739         pline("%s\82Í\82 \82È\82½\82É\8e\9b\89@\82Ö\82Ì\8añ\91¡\82ð\8b\81\82ß\82½\81D",
740               Monnam(priest));
741         if ((offer = bribe(priest)) == 0) {
742 /*JP
743             verbalize("Thou shalt regret thine action!");
744 */
745             verbalize("\93ð\82Ì\8ds\88×\82Í\90_\82ð\96`\93À\82·\82é\82à\82Ì\82È\82è\81I");
746             if (coaligned)
747                 adjalign(-1);
748         } else if (offer < (u.ulevel * 200)) {
749             if (money_cnt(invent) > (offer * 2L)) {
750 /*JP
751                 verbalize("Cheapskate.");
752 */
753                 verbalize("\83P\83`\82ß\81D");
754             } else {
755 /*JP
756                 verbalize("I thank thee for thy contribution.");
757 */
758                 verbalize("\93ð\82Ì\8añ\91¡\82É\95ñ\82¢\82æ\82¤\82¼\81D");
759                 /* give player some token */
760                 exercise(A_WIS, TRUE);
761             }
762         } else if (offer < (u.ulevel * 400)) {
763 /*JP
764             verbalize("Thou art indeed a pious individual.");
765 */
766             verbalize("\93ð\81C\82Ü\82³\82É\8chåi\82È\82è\81D");
767             if (money_cnt(invent) < (offer * 2L)) {
768                 if (coaligned && u.ualign.record <= ALGN_SINNED)
769                     adjalign(1);
770 /*JP
771                 verbalize("I bestow upon thee a blessing.");
772 */
773                 verbalize("\93ð\82É\8fj\95\9f\82ð\81D");
774                 incr_itimeout(&HClairvoyant, rn1(500, 500));
775             }
776         } else if (offer < (u.ulevel * 600)
777                    /* u.ublessed is only active when Protection is
778                       enabled via something other than worn gear
779                       (theft by gremlin clears the intrinsic but not
780                       its former magnitude, making it recoverable) */
781                    && (!(HProtection & INTRINSIC)
782                        || (u.ublessed < 20
783                            && (u.ublessed < 9 || !rn2(u.ublessed))))) {
784 /*JP
785             verbalize("Thy devotion has been rewarded.");
786 */
787             verbalize("\93ð\82ª\8c£\90g\82É\95ñ\82í\82ñ\81D");
788             if (!(HProtection & INTRINSIC)) {
789                 HProtection |= FROMOUTSIDE;
790                 if (!u.ublessed)
791                     u.ublessed = rn1(3, 2);
792             } else
793                 u.ublessed++;
794         } else {
795 /*JP
796             verbalize("Thy selfless generosity is deeply appreciated.");
797 */
798             verbalize("\93ð\8e©\90g\82Ì\90^\89¿\82Í\91å\82¢\82É\94F\82ß\82ç\82ê\82½\81D");
799             if (money_cnt(invent) < (offer * 2L) && coaligned) {
800                 if (strayed && (moves - u.ucleansed) > 5000L) {
801                     u.ualign.record = 0; /* cleanse thee */
802                     u.ucleansed = moves;
803                 } else {
804                     adjalign(2);
805                 }
806             }
807         }
808     }
809 }
810
811 struct monst *
812 mk_roamer(ptr, alignment, x, y, peaceful)
813 register struct permonst *ptr;
814 aligntyp alignment;
815 xchar x, y;
816 boolean peaceful;
817 {
818     register struct monst *roamer;
819     register boolean coaligned = (u.ualign.type == alignment);
820
821 #if 0 /* this was due to permonst's pxlth field which is now gone */
822     if (ptr != &mons[PM_ALIGNED_PRIEST] && ptr != &mons[PM_ANGEL])
823         return (struct monst *) 0;
824 #endif
825
826     if (MON_AT(x, y))
827         (void) rloc(m_at(x, y), FALSE); /* insurance */
828
829     if (!(roamer = makemon(ptr, x, y, MM_ADJACENTOK | MM_EMIN)))
830         return (struct monst *) 0;
831
832     EMIN(roamer)->min_align = alignment;
833     EMIN(roamer)->renegade = (coaligned && !peaceful);
834     roamer->ispriest = 0;
835     roamer->isminion = 1;
836     roamer->mtrapseen = ~0; /* traps are known */
837     roamer->mpeaceful = peaceful;
838     roamer->msleeping = 0;
839     set_malign(roamer); /* peaceful may have changed */
840
841     /* MORE TO COME */
842     return roamer;
843 }
844
845 void
846 reset_hostility(roamer)
847 register struct monst *roamer;
848 {
849     if (!roamer->isminion)
850         return;
851     if (roamer->data != &mons[PM_ALIGNED_PRIEST]
852         && roamer->data != &mons[PM_ANGEL])
853         return;
854
855     if (EMIN(roamer)->min_align != u.ualign.type) {
856         roamer->mpeaceful = roamer->mtame = 0;
857         set_malign(roamer);
858     }
859     newsym(roamer->mx, roamer->my);
860 }
861
862 boolean
863 in_your_sanctuary(mon, x, y)
864 struct monst *mon; /* if non-null, <mx,my> overrides <x,y> */
865 xchar x, y;
866 {
867     register char roomno;
868     register struct monst *priest;
869
870     if (mon) {
871         if (is_minion(mon->data) || is_rider(mon->data))
872             return FALSE;
873         x = mon->mx, y = mon->my;
874     }
875     if (u.ualign.record <= ALGN_SINNED) /* sinned or worse */
876         return FALSE;
877     if ((roomno = temple_occupied(u.urooms)) == 0
878         || roomno != *in_rooms(x, y, TEMPLE))
879         return FALSE;
880     if ((priest = findpriest(roomno)) == 0)
881         return FALSE;
882     return (boolean) (has_shrine(priest) && p_coaligned(priest)
883                       && priest->mpeaceful);
884 }
885
886 /* when attacking "priest" in his temple */
887 void
888 ghod_hitsu(priest)
889 struct monst *priest;
890 {
891     int x, y, ax, ay, roomno = (int) temple_occupied(u.urooms);
892     struct mkroom *troom;
893
894     if (!roomno || !has_shrine(priest))
895         return;
896
897     ax = x = EPRI(priest)->shrpos.x;
898     ay = y = EPRI(priest)->shrpos.y;
899     troom = &rooms[roomno - ROOMOFFSET];
900
901     if ((u.ux == x && u.uy == y) || !linedup(u.ux, u.uy, x, y, 1)) {
902         if (IS_DOOR(levl[u.ux][u.uy].typ)) {
903             if (u.ux == troom->lx - 1) {
904                 x = troom->hx;
905                 y = u.uy;
906             } else if (u.ux == troom->hx + 1) {
907                 x = troom->lx;
908                 y = u.uy;
909             } else if (u.uy == troom->ly - 1) {
910                 x = u.ux;
911                 y = troom->hy;
912             } else if (u.uy == troom->hy + 1) {
913                 x = u.ux;
914                 y = troom->ly;
915             }
916         } else {
917             switch (rn2(4)) {
918             case 0:
919                 x = u.ux;
920                 y = troom->ly;
921                 break;
922             case 1:
923                 x = u.ux;
924                 y = troom->hy;
925                 break;
926             case 2:
927                 x = troom->lx;
928                 y = u.uy;
929                 break;
930             default:
931                 x = troom->hx;
932                 y = u.uy;
933                 break;
934             }
935         }
936         if (!linedup(u.ux, u.uy, x, y, 1))
937             return;
938     }
939
940     switch (rn2(3)) {
941     case 0:
942 /*JP
943         pline("%s roars in anger:  \"Thou shalt suffer!\"",
944 */
945         pline("%s\82Í\93{\82è\82Ì\90º\82ð\82 \82°\82½\81F\81u\93ð\81C\8bê\82µ\82Þ\82ª\82æ\82¢\81I\81v",
946               a_gname_at(ax, ay));
947         break;
948     case 1:
949 #if 0 /*JP:T*/
950         pline("%s voice booms:  \"How darest thou harm my servant!\"",
951               s_suffix(a_gname_at(ax, ay)));
952 #else
953         pline("%s\82Ì\90º\82ª\8b¿\82¢\82½\81F\81u\82í\82ª\89º\96l\82É\8bê\82µ\82Þ\82ª\82æ\82¢\81I\81v",
954               a_gname_at(ax, ay));
955 #endif
956         break;
957     default:
958 /*JP
959         pline("%s roars:  \"Thou dost profane my shrine!\"",
960 */
961         pline("%s\82Ì\90º\82ª\95·\82±\82¦\82é\81F\81u\93ð\81C\89ä\82ª\90¹\93°\82ð\89\98\82µ\82½\82è\81I\81v",
962               a_gname_at(ax, ay));
963         break;
964     }
965
966     buzz(-10 - (AD_ELEC - 1), 6, x, y, sgn(tbx),
967          sgn(tby)); /* bolt of lightning */
968     exercise(A_WIS, FALSE);
969 }
970
971 void
972 angry_priest()
973 {
974     register struct monst *priest;
975     struct rm *lev;
976
977     if ((priest = findpriest(temple_occupied(u.urooms))) != 0) {
978         struct epri *eprip = EPRI(priest);
979
980         wakeup(priest, FALSE);
981         setmangry(priest, FALSE);
982         /*
983          * If the altar has been destroyed or converted, let the
984          * priest run loose.
985          * (When it's just a conversion and there happens to be
986          * a fresh corpse nearby, the priest ought to have an
987          * opportunity to try converting it back; maybe someday...)
988          */
989         lev = &levl[eprip->shrpos.x][eprip->shrpos.y];
990         if (!IS_ALTAR(lev->typ)
991             || ((aligntyp) Amask2align(lev->altarmask & AM_MASK)
992                 != eprip->shralign)) {
993             if (!EMIN(priest))
994                 newemin(priest);
995             priest->ispriest = 0; /* now a roaming minion */
996             priest->isminion = 1;
997             EMIN(priest)->min_align = eprip->shralign;
998             EMIN(priest)->renegade = FALSE;
999             /* discard priest's memory of his former shrine;
1000                if we ever implement the re-conversion mentioned
1001                above, this will need to be removed */
1002             free_epri(priest);
1003         }
1004     }
1005 }
1006
1007 /*
1008  * When saving bones, find priests that aren't on their shrine level,
1009  * and remove them.  This avoids big problems when restoring bones.
1010  * [Perhaps we should convert them into roamers instead?]
1011  */
1012 void
1013 clearpriests()
1014 {
1015     struct monst *mtmp;
1016
1017     for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) {
1018         if (DEADMONSTER(mtmp))
1019             continue;
1020         if (mtmp->ispriest && !on_level(&(EPRI(mtmp)->shrlevel), &u.uz))
1021             mongone(mtmp);
1022     }
1023 }
1024
1025 /* munge priest-specific structure when restoring -dlc */
1026 void
1027 restpriest(mtmp, ghostly)
1028 register struct monst *mtmp;
1029 boolean ghostly;
1030 {
1031     if (u.uz.dlevel) {
1032         if (ghostly)
1033             assign_level(&(EPRI(mtmp)->shrlevel), &u.uz);
1034     }
1035 }
1036
1037 /*
1038  * align_str(), piousness(), mstatusline() and ustatusline() used to be
1039  * in pline.c, presumeably because the latter two generate one line of
1040  * output.  The USE_OLDARGS config gets warnings from 2016ish-vintage
1041  * gcc (for -Wint-to-pointer-cast, activated by -Wall or -W) when they
1042  * follow pline() itself.  Fixing up the variadic calls like is done for
1043  * lev_comp would be needlessly messy there.
1044  *
1045  * They don't belong here.  If/when enlightenment ever gets split off
1046  * from cmd.c (which definitely doesn't belong there), they should go
1047  * with it.
1048  */
1049
1050 const char *
1051 align_str(alignment)
1052 aligntyp alignment;
1053 {
1054     switch ((int) alignment) {
1055     case A_CHAOTIC:
1056 /*JP
1057         return "chaotic";
1058 */
1059         return "\8d¬\93×";
1060     case A_NEUTRAL:
1061 /*JP
1062         return "neutral";
1063 */
1064         return "\92\86\97§";
1065     case A_LAWFUL:
1066 /*JP
1067         return "lawful";
1068 */
1069         return "\92\81\8f\98";
1070     case A_NONE:
1071 /*JP
1072         return "unaligned";
1073 */
1074         return "\96³\90S";
1075     }
1076 /*JP
1077     return "unknown";
1078 */
1079     return "\95s\96¾";
1080 }
1081
1082 /* used for self-probing */
1083 char *
1084 piousness(showneg, suffix)
1085 boolean showneg;
1086 const char *suffix;
1087 {
1088     static char buf[32]; /* bigger than "insufficiently neutral" */
1089     const char *pio;
1090
1091     /* note: piousness 20 matches MIN_QUEST_ALIGN (quest.h) */
1092     if (u.ualign.record >= 20)
1093 /*JP
1094         pio = "piously";
1095 */
1096         pio = "\8chåi\82È";
1097     else if (u.ualign.record > 13)
1098 /*JP
1099         pio = "devoutly";
1100 */
1101         pio = "\90M\90S\90[\82¢";
1102     else if (u.ualign.record > 8)
1103 /*JP
1104         pio = "fervently";
1105 */
1106         pio = "\94M\90S\82È";
1107     else if (u.ualign.record > 3)
1108 /*JP
1109         pio = "stridently";
1110 */
1111         pio = "\91å\82°\82³\82È";
1112     else if (u.ualign.record == 3)
1113         pio = "";
1114     else if (u.ualign.record > 0)
1115 /*JP
1116         pio = "haltingly";
1117 */
1118         pio = "\95s\8a®\91S\82È";
1119     else if (u.ualign.record == 0)
1120 /*JP
1121         pio = "nominally";
1122 */
1123         pio = "\8c`\82¾\82¯\82Ì";
1124     else if (!showneg)
1125 /*JP
1126         pio = "insufficiently";
1127 */
1128         pio = "\95s\8f\\95ª\82È";
1129     else if (u.ualign.record >= -3)
1130 /*JP
1131         pio = "strayed";
1132 */
1133         pio = "\96À\82¢\82ð\8e\9d\82Á\82½";
1134     else if (u.ualign.record >= -8)
1135 /*JP
1136         pio = "sinned";
1137 */
1138         pio = "\8dß\82ð\95\89\82Á\82½";
1139     else
1140 /*JP
1141         pio = "transgressed";
1142 */
1143         pio = "\88í\92E\82µ\82½";
1144
1145     Sprintf(buf, "%s", pio);
1146     if (suffix && (!showneg || u.ualign.record >= 0)) {
1147 #if 0 /*JP*/
1148         if (u.ualign.record != 3)
1149             Strcat(buf, " ");
1150 #endif
1151         Strcat(buf, suffix);
1152     }
1153     return buf;
1154 }
1155
1156 /* stethoscope or probing applied to monster -- one-line feedback */
1157 void
1158 mstatusline(mtmp)
1159 struct monst *mtmp;
1160 {
1161     aligntyp alignment = mon_aligntyp(mtmp);
1162     char info[BUFSZ], monnambuf[BUFSZ];
1163
1164     info[0] = 0;
1165     if (mtmp->mtame) {
1166 /*JP
1167         Strcat(info, ", tame");
1168 */
1169         Strcat(info, ", \8e\94\82¢\82È\82ç\82³\82ê\82Ä\82¢\82é");
1170         if (wizard) {
1171             Sprintf(eos(info), " (%d", mtmp->mtame);
1172             if (!mtmp->isminion)
1173                 Sprintf(eos(info), "; hungry %ld; apport %d",
1174                         EDOG(mtmp)->hungrytime, EDOG(mtmp)->apport);
1175             Strcat(info, ")");
1176         }
1177     } else if (mtmp->mpeaceful)
1178 /*JP
1179         Strcat(info, ", peaceful");
1180 */
1181         Strcat(info, ", \97F\8dD\93I");
1182
1183     if (mtmp->data == &mons[PM_LONG_WORM]) {
1184         int segndx, nsegs = count_wsegs(mtmp);
1185
1186         /* the worm code internals don't consider the head of be one of
1187            the worm's segments, but we count it as such when presenting
1188            worm feedback to the player */
1189         if (!nsegs) {
1190 /*JP
1191             Strcat(info, ", single segment");
1192 */
1193             Strcat(info, ", \91S\91Ì");
1194         } else {
1195             ++nsegs; /* include head in the segment count */
1196             segndx = wseg_at(mtmp, bhitpos.x, bhitpos.y);
1197 #if 0 /*JP:T*/
1198             Sprintf(eos(info), ", %d%s of %d segments",
1199                     segndx, ordin(segndx), nsegs);
1200 #else
1201             Sprintf(eos(info), ", %d\90ß\82Ì\82¤\82¿%d\94Ô\96Ú",
1202                     nsegs, segndx);
1203 #endif
1204         }
1205     }
1206     if (mtmp->cham >= LOW_PM && mtmp->data != &mons[mtmp->cham])
1207         /* don't reveal the innate form (chameleon, vampire, &c),
1208            just expose the fact that this current form isn't it */
1209 /*JP
1210         Strcat(info, ", shapechanger");
1211 */
1212         Strcat(info, ", \95Ï\89»");
1213     /* pets eating mimic corpses mimic while eating, so this comes first */
1214     if (mtmp->meating)
1215 /*JP
1216         Strcat(info, ", eating");
1217 */
1218         Strcat(info, ", \90H\8e\96\92\86");
1219     /* a stethoscope exposes mimic before getting here so this
1220        won't be relevant for it, but wand of probing doesn't */
1221     if (mtmp->mundetected || mtmp->m_ap_type)
1222         mhidden_description(mtmp, TRUE, eos(info));
1223     if (mtmp->mcan)
1224 /*JP
1225         Strcat(info, ", cancelled");
1226 */
1227         Strcat(info, ", \96³\97Í");
1228     if (mtmp->mconf)
1229 /*JP
1230         Strcat(info, ", confused");
1231 */
1232         Strcat(info, ", \8d¬\97\90\8fó\91Ô");
1233     if (mtmp->mblinded || !mtmp->mcansee)
1234 /*JP
1235         Strcat(info, ", blind");
1236 */
1237         Strcat(info, ", \96Ó\96Ú");
1238     if (mtmp->mstun)
1239 /*JP
1240         Strcat(info, ", stunned");
1241 */
1242         Strcat(info, ", \82­\82ç\82­\82ç\8fó\91Ô");
1243     if (mtmp->msleeping)
1244 /*JP
1245         Strcat(info, ", asleep");
1246 */
1247         Strcat(info, ", \90\87\96°\8fó\91Ô");
1248 #if 0 /* unfortunately mfrozen covers temporary sleep and being busy \
1249          (donning armor, for instance) as well as paralysis */
1250     else if (mtmp->mfrozen)
1251         Strcat(info, ", paralyzed");
1252 #else
1253     else if (mtmp->mfrozen || !mtmp->mcanmove)
1254 /*JP
1255         Strcat(info, ", can't move");
1256 */
1257         Strcat(info, ", \93®\82¯\82È\82¢");
1258 #endif
1259     /* [arbitrary reason why it isn't moving] */
1260     else if (mtmp->mstrategy & STRAT_WAITMASK)
1261 /*JP
1262         Strcat(info, ", meditating");
1263 */
1264         Strcat(info, ", \96»\91z\92\86");
1265     if (mtmp->mflee)
1266 /*JP
1267         Strcat(info, ", scared");
1268 */
1269         Strcat(info, ", \8b¯\82¦\82Ä\82¢\82é");
1270     if (mtmp->mtrapped)
1271 /*JP
1272         Strcat(info, ", trapped");
1273 */
1274         Strcat(info, ", ã©\82É\82©\82©\82Á\82Ä\82¢\82é");
1275     if (mtmp->mspeed)
1276 #if 0 /*JP:T*/
1277         Strcat(info, (mtmp->mspeed == MFAST) ? ", fast"
1278                       : (mtmp->mspeed == MSLOW) ? ", slow"
1279                          : ", [? speed]");
1280 #else
1281         Strcat(info, (mtmp->mspeed == MFAST) ? ", \91f\91\81\82¢"
1282                       : (mtmp->mspeed == MSLOW) ? ", \92x\82¢"
1283                          : ", \91¬\93x\95s\96¾");
1284 #endif
1285     if (mtmp->minvis)
1286 /*JP
1287         Strcat(info, ", invisible");
1288 */
1289         Strcat(info, ", \95s\89Â\8e\8b");
1290     if (mtmp == u.ustuck)
1291 #if 0 /*JP:T*/
1292         Strcat(info, sticks(youmonst.data) ? ", held by you"
1293                       : !u.uswallow ? ", holding you"
1294                          : attacktype_fordmg(u.ustuck->data, AT_ENGL, AD_DGST)
1295                             ? ", digesting you"
1296                             : is_animal(u.ustuck->data) ? ", swallowing you"
1297                                : ", engulfing you");
1298 #else
1299         Strcat(info, sticks(youmonst.data) ? ", \82 \82È\82½\82ª\92Í\82Ü\82¦\82Ä\82¢\82é"
1300                       : !u.uswallow ? ", \92Í\82Ü\82¦\82Ä\82¢\82é"
1301                          : attacktype_fordmg(u.ustuck->data, AT_ENGL, AD_DGST)
1302                             ? ", \8fÁ\89»\82µ\82Ä\82¢\82é"
1303                             : is_animal(u.ustuck->data) ? ", \88ù\82Ý\8d\9e\82ñ\82Å\82¢\82é"
1304                                : ", \8aª\82«\8d\9e\82ñ\82Å\82¢\82é");
1305 #endif
1306     if (mtmp == u.usteed)
1307 /*JP
1308         Strcat(info, ", carrying you");
1309 */
1310         Strcat(info, ", \82 \82È\82½\82ð\8fæ\82¹\82Ä\82¢\82é");
1311
1312     /* avoid "Status of the invisible newt ..., invisible" */
1313     /* and unlike a normal mon_nam, use "saddled" even if it has a name */
1314     Strcpy(monnambuf, x_monnam(mtmp, ARTICLE_THE, (char *) 0,
1315                                (SUPPRESS_IT | SUPPRESS_INVISIBLE), FALSE));
1316
1317 /*JP
1318     pline("Status of %s (%s):  Level %d  HP %d(%d)  AC %d%s.", monnambuf,
1319 */
1320     pline("%s\82Ì\8fó\91Ô (%s)\81F Level %d  HP %d(%d)  AC %d%s", monnambuf,
1321           align_str(alignment), mtmp->m_lev, mtmp->mhp, mtmp->mhpmax,
1322           find_mac(mtmp), info);
1323 }
1324
1325 /* stethoscope or probing applied to hero -- one-line feedback */
1326 void
1327 ustatusline()
1328 {
1329     char info[BUFSZ];
1330
1331     info[0] = '\0';
1332     if (Sick) {
1333 #if 0 /*JP*/
1334         Strcat(info, ", dying from");
1335         if (u.usick_type & SICK_VOMITABLE)
1336             Strcat(info, " food poisoning");
1337         if (u.usick_type & SICK_NONVOMITABLE) {
1338             if (u.usick_type & SICK_VOMITABLE)
1339                 Strcat(info, " and");
1340             Strcat(info, " illness");
1341         }
1342 #else
1343         Strcat(info, ", ");
1344         if (u.usick_type & SICK_VOMITABLE)
1345             Strcat(info, "\90H\92\86\93Å");
1346         if (u.usick_type & SICK_NONVOMITABLE) {
1347             if (u.usick_type & SICK_VOMITABLE)
1348                 Strcat(info, "\82Æ");
1349             Strcat(info, "\95a\8bC");
1350         }
1351         Strcat(info, "\82Å\8e\80\82É\82Â\82Â\82 \82é");
1352 #endif
1353     }
1354     if (Stoned)
1355 /*JP
1356         Strcat(info, ", solidifying");
1357 */
1358         Strcat(info, ", \90Î\89»\82µ\82Â\82Â\82 \82é");
1359     if (Slimed)
1360 /*JP
1361         Strcat(info, ", becoming slimy");
1362 */
1363         Strcat(info, ", \83X\83\89\83C\83\80\82É\82È\82è\82Â\82Â\82 \82é");
1364     if (Strangled)
1365 /*JP
1366         Strcat(info, ", being strangled");
1367 */
1368         Strcat(info, ", \8eñ\82ð\8di\82ß\82ç\82ê\82Ä\82¢\82é");
1369     if (Vomiting)
1370 #if 0 /*JP:T*/
1371         Strcat(info, ", nauseated"); /* !"nauseous" */
1372 #else
1373         Strcat(info, ", \93f\82«\8bC\82ª\82·\82é");
1374 #endif
1375     if (Confusion)
1376 /*JP
1377         Strcat(info, ", confused");
1378 */
1379         Strcat(info, ", \8d¬\97\90\8fó\91Ô");
1380     if (Blind) {
1381 #if 0 /*JP*/
1382         Strcat(info, ", blind");
1383         if (u.ucreamed) {
1384             if ((long) u.ucreamed < Blinded || Blindfolded
1385                 || !haseyes(youmonst.data))
1386                 Strcat(info, ", cover");
1387             Strcat(info, "ed by sticky goop");
1388         } /* note: "goop" == "glop"; variation is intentional */
1389 #else
1390         Strcat(info, ", ");
1391         if (u.ucreamed) {
1392             Strcat(info, "\82Ë\82Î\82Ë\82Î\82×\82Æ\82Â\82­\82à\82Ì\82Å");
1393             if ((long)u.ucreamed < Blinded || Blindfolded
1394                 || !haseyes(youmonst.data))
1395               Strcat(info, "\95¢\82í\82ê\82Ä");
1396         }
1397         Strcat(info, "\96Ó\96Ú\8fó\91Ô");
1398 #endif
1399     }
1400     if (Stunned)
1401 /*JP
1402         Strcat(info, ", stunned");
1403 */
1404         Strcat(info, ", \82­\82ç\82­\82ç\8fó\91Ô");
1405     if (!u.usteed && Wounded_legs) {
1406         const char *what = body_part(LEG);
1407         if ((Wounded_legs & BOTH_SIDES) == BOTH_SIDES)
1408             what = makeplural(what);
1409 /*JP
1410         Sprintf(eos(info), ", injured %s", what);
1411 */
1412         Sprintf(eos(info), ", %s\82É\82¯\82ª\82ð\82µ\82Ä\82¢\82é", what);
1413     }
1414     if (Glib)
1415 /*JP
1416         Sprintf(eos(info), ", slippery %s", makeplural(body_part(HAND)));
1417 */
1418         Sprintf(eos(info), ", %s\82ª\82Ê\82é\82Ê\82é", makeplural(body_part(HAND)));
1419     if (u.utrap)
1420 /*JP
1421         Strcat(info, ", trapped");
1422 */
1423         Strcat(info, ", ã©\82É\82©\82©\82Á\82Ä\82¢\82é");
1424     if (Fast)
1425 /*JP
1426         Strcat(info, Very_fast ? ", very fast" : ", fast");
1427 */
1428         Strcat(info, Very_fast ? ", \82Æ\82Ä\82à\91f\91\81\82¢" : ", \91f\91\81\82¢");
1429     if (u.uundetected)
1430 /*JP
1431         Strcat(info, ", concealed");
1432 */
1433         Strcat(info, ", \89B\82ê\82Ä\82¢\82é");
1434     if (Invis)
1435 /*JP
1436         Strcat(info, ", invisible");
1437 */
1438         Strcat(info, ", \95s\89Â\8e\8b");
1439     if (u.ustuck) {
1440 #if 0 /*JP*/
1441         if (sticks(youmonst.data))
1442             Strcat(info, ", holding ");
1443         else
1444             Strcat(info, ", held by ");
1445         Strcat(info, mon_nam(u.ustuck));
1446 #else
1447         Strcat(info, ", ");
1448         Strcat(info, mon_nam(u.ustuck));
1449         if (sticks(youmonst.data))
1450             Strcat(info, "\82ð\92Í\82Ü\82¦\82Ä\82¢\82é");
1451         else
1452             Strcat(info, "\82É\92Í\82Ü\82¦\82ç\82ê\82Ä\82¢\82é");
1453 #endif
1454     }
1455
1456 /*JP
1457     pline("Status of %s (%s):  Level %d  HP %d(%d)  AC %d%s.", plname,
1458 */
1459     pline("%s\82Ì\8fó\91Ô (%s)\81F Level %d  HP %d(%d)  AC %d%s", plname,
1460           piousness(FALSE, align_str(u.ualign.type)),
1461           Upolyd ? mons[u.umonnum].mlevel : u.ulevel, Upolyd ? u.mh : u.uhp,
1462           Upolyd ? u.mhmax : u.uhpmax, u.uac, info);
1463 }
1464
1465 /*priest.c*/