OSDN Git Service

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