OSDN Git Service

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