OSDN Git Service

use _pragma
[jnethack/source.git] / src / pray.c
1 /* NetHack 3.6  pray.c  $NHDT-Date: 1519662898 2018/02/26 16:34:58 $  $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.96 $ */
2 /* Copyright (c) Benson I. Margulies, Mike Stephenson, 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
12 STATIC_PTR int NDECL(prayer_done);
13 STATIC_DCL struct obj *NDECL(worst_cursed_item);
14 STATIC_DCL int NDECL(in_trouble);
15 STATIC_DCL void FDECL(fix_worst_trouble, (int));
16 STATIC_DCL void FDECL(angrygods, (ALIGNTYP_P));
17 STATIC_DCL void FDECL(at_your_feet, (const char *));
18 STATIC_DCL void NDECL(gcrownu);
19 STATIC_DCL void FDECL(pleased, (ALIGNTYP_P));
20 STATIC_DCL void FDECL(godvoice, (ALIGNTYP_P, const char *));
21 STATIC_DCL void FDECL(god_zaps_you, (ALIGNTYP_P));
22 STATIC_DCL void FDECL(fry_by_god, (ALIGNTYP_P, BOOLEAN_P));
23 STATIC_DCL void FDECL(gods_angry, (ALIGNTYP_P));
24 STATIC_DCL void FDECL(gods_upset, (ALIGNTYP_P));
25 STATIC_DCL void FDECL(consume_offering, (struct obj *));
26 STATIC_DCL boolean FDECL(water_prayer, (BOOLEAN_P));
27 STATIC_DCL boolean FDECL(blocked_boulder, (int, int));
28
29 /* simplify a few tests */
30 #define Cursed_obj(obj, typ) ((obj) && (obj)->otyp == (typ) && (obj)->cursed)
31
32 /*
33  * Logic behind deities and altars and such:
34  * + prayers are made to your god if not on an altar, and to the altar's god
35  *   if you are on an altar
36  * + If possible, your god answers all prayers, which is why bad things happen
37  *   if you try to pray on another god's altar
38  * + sacrifices work basically the same way, but the other god may decide to
39  *   accept your allegiance, after which they are your god.  If rejected,
40  *   your god takes over with your punishment.
41  * + if you're in Gehennom, all messages come from Moloch
42  */
43
44 /*
45  *      Moloch, who dwells in Gehennom, is the "renegade" cruel god
46  *      responsible for the theft of the Amulet from Marduk, the Creator.
47  *      Moloch is unaligned.
48  */
49 /*JP
50 static const char *Moloch = "Moloch";
51 */
52 static const char *Moloch = "\83\82\81[\83\8d\83b\83N";
53
54 static const char *godvoices[] = {
55 /*JP
56     "booms out", "thunders", "rings out", "booms",
57 */
58     "\8b¿\82«\82í\82½\82Á\82½", "\97\8b\82Ì\82æ\82¤\82É\8b¿\82¢\82½", "\82Æ\82Ç\82ë\82¢\82½", "\8b¿\82¢\82½",
59 };
60
61 /* values calculated when prayer starts, and used when completed */
62 static aligntyp p_aligntyp;
63 static int p_trouble;
64 static int p_type; /* (-1)-3: (-1)=really naughty, 3=really good */
65
66 #define PIOUS 20
67 #define DEVOUT 14
68 #define FERVENT 9
69 #define STRIDENT 4
70
71 /*
72  * The actual trouble priority is determined by the order of the
73  * checks performed in in_trouble() rather than by these numeric
74  * values, so keep that code and these values synchronized in
75  * order to have the values be meaningful.
76  */
77
78 #define TROUBLE_STONED 14
79 #define TROUBLE_SLIMED 13
80 #define TROUBLE_STRANGLED 12
81 #define TROUBLE_LAVA 11
82 #define TROUBLE_SICK 10
83 #define TROUBLE_STARVING 9
84 #define TROUBLE_REGION 8 /* stinking cloud */
85 #define TROUBLE_HIT 7
86 #define TROUBLE_LYCANTHROPE 6
87 #define TROUBLE_COLLAPSING 5
88 #define TROUBLE_STUCK_IN_WALL 4
89 #define TROUBLE_CURSED_LEVITATION 3
90 #define TROUBLE_UNUSEABLE_HANDS 2
91 #define TROUBLE_CURSED_BLINDFOLD 1
92
93 #define TROUBLE_PUNISHED (-1)
94 #define TROUBLE_FUMBLING (-2)
95 #define TROUBLE_CURSED_ITEMS (-3)
96 #define TROUBLE_SADDLE (-4)
97 #define TROUBLE_BLIND (-5)
98 #define TROUBLE_POISONED (-6)
99 #define TROUBLE_WOUNDED_LEGS (-7)
100 #define TROUBLE_HUNGRY (-8)
101 #define TROUBLE_STUNNED (-9)
102 #define TROUBLE_CONFUSED (-10)
103 #define TROUBLE_HALLUCINATION (-11)
104
105
106 #define ugod_is_angry() (u.ualign.record < 0)
107 #define on_altar() IS_ALTAR(levl[u.ux][u.uy].typ)
108 #define on_shrine() ((levl[u.ux][u.uy].altarmask & AM_SHRINE) != 0)
109 #define a_align(x, y) ((aligntyp) Amask2align(levl[x][y].altarmask & AM_MASK))
110
111 /* critically low hit points if hp <= 5 or hp <= maxhp/N for some N */
112 boolean
113 critically_low_hp(only_if_injured)
114 boolean only_if_injured; /* determines whether maxhp <= 5 matters */
115 {
116     int divisor, hplim, curhp = Upolyd ? u.mh : u.uhp,
117                         maxhp = Upolyd ? u.mhmax : u.uhpmax;
118
119     if (only_if_injured && !(curhp < maxhp))
120         return FALSE;
121     /* if maxhp is extremely high, use lower threshold for the division test
122        (golden glow cuts off at 11+5*lvl, nurse interaction at 25*lvl; this
123        ought to use monster hit dice--and a smaller multiplier--rather than
124        ulevel when polymorphed, but polyself doesn't maintain that) */
125     hplim = 15 * u.ulevel;
126     if (maxhp > hplim)
127         maxhp = hplim;
128     /* 7 used to be the unconditional divisor */
129     switch (xlev_to_rank(u.ulevel)) { /* maps 1..30 into 0..8 */
130     case 0:
131     case 1:
132         divisor = 5;
133         break; /* explvl 1 to 5 */
134     case 2:
135     case 3:
136         divisor = 6;
137         break; /* explvl 6 to 13 */
138     case 4:
139     case 5:
140         divisor = 7;
141         break; /* explvl 14 to 21 */
142     case 6:
143     case 7:
144         divisor = 8;
145         break; /* explvl 22 to 29 */
146     default:
147         divisor = 9;
148         break; /* explvl 30+ */
149     }
150     /* 5 is a magic number in TROUBLE_HIT handling below */
151     return (boolean) (curhp <= 5 || curhp * divisor <= maxhp);
152 }
153
154 /* return True if surrounded by impassible rock, regardless of the state
155    of your own location (for example, inside a doorless closet) */
156 boolean
157 stuck_in_wall()
158 {
159     int i, j, x, y, count = 0;
160
161     if (Passes_walls)
162         return FALSE;
163     for (i = -1; i <= 1; i++) {
164         x = u.ux + i;
165         for (j = -1; j <= 1; j++) {
166             if (!i && !j)
167                 continue;
168             y = u.uy + j;
169             if (!isok(x, y)
170                 || (IS_ROCK(levl[x][y].typ)
171                     && (levl[x][y].typ != SDOOR || levl[x][y].typ != SCORR))
172                 || (blocked_boulder(i, j) && !throws_rocks(youmonst.data)))
173                 ++count;
174         }
175     }
176     return (count == 8) ? TRUE : FALSE;
177 }
178
179 /*
180  * Return 0 if nothing particular seems wrong, positive numbers for
181  * serious trouble, and negative numbers for comparative annoyances.
182  * This returns the worst problem. There may be others, and the gods
183  * may fix more than one.
184  *
185  * This could get as bizarre as noting surrounding opponents, (or
186  * hostile dogs), but that's really hard.
187  *
188  * We could force rehumanize of polyselfed people, but we can't tell
189  * unintentional shape changes from the other kind. Oh well.
190  * 3.4.2: make an exception if polymorphed into a form which lacks
191  * hands; that's a case where the ramifications override this doubt.
192  */
193 STATIC_OVL int
194 in_trouble()
195 {
196     struct obj *otmp;
197     int i;
198
199     /*
200      * major troubles
201      */
202     if (Stoned)
203         return TROUBLE_STONED;
204     if (Slimed)
205         return TROUBLE_SLIMED;
206     if (Strangled)
207         return TROUBLE_STRANGLED;
208     if (u.utrap && u.utraptype == TT_LAVA)
209         return TROUBLE_LAVA;
210     if (Sick)
211         return TROUBLE_SICK;
212     if (u.uhs >= WEAK)
213         return TROUBLE_STARVING;
214     if (region_danger())
215         return TROUBLE_REGION;
216     if (critically_low_hp(FALSE))
217         return TROUBLE_HIT;
218     if (u.ulycn >= LOW_PM)
219         return TROUBLE_LYCANTHROPE;
220     if (near_capacity() >= EXT_ENCUMBER && AMAX(A_STR) - ABASE(A_STR) > 3)
221         return TROUBLE_COLLAPSING;
222     if (stuck_in_wall())
223         return TROUBLE_STUCK_IN_WALL;
224     if (Cursed_obj(uarmf, LEVITATION_BOOTS)
225         || stuck_ring(uleft, RIN_LEVITATION)
226         || stuck_ring(uright, RIN_LEVITATION))
227         return TROUBLE_CURSED_LEVITATION;
228     if (nohands(youmonst.data) || !freehand()) {
229         /* for bag/box access [cf use_container()]...
230            make sure it's a case that we know how to handle;
231            otherwise "fix all troubles" would get stuck in a loop */
232         if (welded(uwep))
233             return TROUBLE_UNUSEABLE_HANDS;
234         if (Upolyd && nohands(youmonst.data)
235             && (!Unchanging || ((otmp = unchanger()) != 0 && otmp->cursed)))
236             return TROUBLE_UNUSEABLE_HANDS;
237     }
238     if (Blindfolded && ublindf->cursed)
239         return TROUBLE_CURSED_BLINDFOLD;
240
241     /*
242      * minor troubles
243      */
244     if (Punished || (u.utrap && u.utraptype == TT_BURIEDBALL))
245         return TROUBLE_PUNISHED;
246     if (Cursed_obj(uarmg, GAUNTLETS_OF_FUMBLING)
247         || Cursed_obj(uarmf, FUMBLE_BOOTS))
248         return TROUBLE_FUMBLING;
249     if (worst_cursed_item())
250         return TROUBLE_CURSED_ITEMS;
251     if (u.usteed) { /* can't voluntarily dismount from a cursed saddle */
252         otmp = which_armor(u.usteed, W_SADDLE);
253         if (Cursed_obj(otmp, SADDLE))
254             return TROUBLE_SADDLE;
255     }
256
257     if (Blinded > 1 && haseyes(youmonst.data)
258         && (!u.uswallow
259             || !attacktype_fordmg(u.ustuck->data, AT_ENGL, AD_BLND)))
260         return TROUBLE_BLIND;
261     for (i = 0; i < A_MAX; i++)
262         if (ABASE(i) < AMAX(i))
263             return TROUBLE_POISONED;
264     if (Wounded_legs && !u.usteed)
265         return TROUBLE_WOUNDED_LEGS;
266     if (u.uhs >= HUNGRY)
267         return TROUBLE_HUNGRY;
268     if (HStun & TIMEOUT)
269         return TROUBLE_STUNNED;
270     if (HConfusion & TIMEOUT)
271         return TROUBLE_CONFUSED;
272     if (HHallucination & TIMEOUT)
273         return TROUBLE_HALLUCINATION;
274     return 0;
275 }
276
277 /* select an item for TROUBLE_CURSED_ITEMS */
278 STATIC_OVL struct obj *
279 worst_cursed_item()
280 {
281     register struct obj *otmp;
282
283     /* if strained or worse, check for loadstone first */
284     if (near_capacity() >= HVY_ENCUMBER) {
285         for (otmp = invent; otmp; otmp = otmp->nobj)
286             if (Cursed_obj(otmp, LOADSTONE))
287                 return otmp;
288     }
289     /* weapon takes precedence if it is interfering
290        with taking off a ring or putting on a shield */
291     if (welded(uwep) && (uright || bimanual(uwep))) { /* weapon */
292         otmp = uwep;
293     /* gloves come next, due to rings */
294     } else if (uarmg && uarmg->cursed) { /* gloves */
295         otmp = uarmg;
296     /* then shield due to two handed weapons and spells */
297     } else if (uarms && uarms->cursed) { /* shield */
298         otmp = uarms;
299     /* then cloak due to body armor */
300     } else if (uarmc && uarmc->cursed) { /* cloak */
301         otmp = uarmc;
302     } else if (uarm && uarm->cursed) { /* suit */
303         otmp = uarm;
304     /* if worn helmet of opposite alignment is making you an adherent
305        of the current god, he/she/it won't uncurse that for you */
306     } else if (uarmh && uarmh->cursed /* helmet */
307                && uarmh->otyp != HELM_OF_OPPOSITE_ALIGNMENT) {
308         otmp = uarmh;
309     } else if (uarmf && uarmf->cursed) { /* boots */
310         otmp = uarmf;
311     } else if (uarmu && uarmu->cursed) { /* shirt */
312         otmp = uarmu;
313     } else if (uamul && uamul->cursed) { /* amulet */
314         otmp = uamul;
315     } else if (uleft && uleft->cursed) { /* left ring */
316         otmp = uleft;
317     } else if (uright && uright->cursed) { /* right ring */
318         otmp = uright;
319     } else if (ublindf && ublindf->cursed) { /* eyewear */
320         otmp = ublindf; /* must be non-blinding lenses */
321     /* if weapon wasn't handled above, do it now */
322     } else if (welded(uwep)) { /* weapon */
323         otmp = uwep;
324     /* active secondary weapon even though it isn't welded */
325     } else if (uswapwep && uswapwep->cursed && u.twoweap) {
326         otmp = uswapwep;
327     /* all worn items ought to be handled by now */
328     } else {
329         for (otmp = invent; otmp; otmp = otmp->nobj) {
330             if (!otmp->cursed)
331                 continue;
332             if (otmp->otyp == LOADSTONE || confers_luck(otmp))
333                 break;
334         }
335     }
336     return otmp;
337 }
338
339 STATIC_OVL void
340 fix_worst_trouble(trouble)
341 int trouble;
342 {
343     int i;
344     struct obj *otmp = 0;
345     const char *what = (const char *) 0;
346 #if 0 /*JP*/
347     static NEARDATA const char leftglow[] = "Your left ring softly glows",
348                                rightglow[] = "Your right ring softly glows";
349 #else
350     static NEARDATA const char leftglow[] = "\8d\82Ì\8ew\97Ö",
351                                rightglow[] = "\89E\82Ì\8ew\97Ö";
352 #endif
353
354     switch (trouble) {
355     case TROUBLE_STONED:
356 /*JP
357         make_stoned(0L, "You feel more limber.", 0, (char *) 0);
358 */
359         make_stoned(0L, "\93î\82ç\82©\82­\82È\82Á\82½\82æ\82¤\82È\8bC\82ª\82µ\82½\81D", 0, (char *) 0);
360         break;
361     case TROUBLE_SLIMED:
362 /*JP
363         make_slimed(0L, "The slime disappears.");
364 */
365         make_slimed(0L, "\82Ç\82ë\82Ç\82ë\8a´\82Í\8fÁ\82¦\82½\81D");
366         break;
367     case TROUBLE_STRANGLED:
368         if (uamul && uamul->otyp == AMULET_OF_STRANGULATION) {
369 /*JP
370             Your("amulet vanishes!");
371 */
372             Your("\96\82\8f\9c\82¯\82Í\8fÁ\82¦\82³\82Á\82½\81I");
373             useup(uamul);
374         }
375 /*JP
376         You("can breathe again.");
377 */
378         You("\82Ü\82½\8cÄ\8bz\82Å\82«\82é\82æ\82¤\82É\82È\82Á\82½\81D");
379         Strangled = 0;
380         context.botl = 1;
381         break;
382     case TROUBLE_LAVA:
383 /*JP
384         You("are back on solid ground.");
385 */
386         You("\8cÅ\82¢\92n\96Ê\82É\96ß\82Á\82½\81D");
387         /* teleport should always succeed, but if not, just untrap them */
388         if (!safe_teleds(FALSE))
389             u.utrap = 0;
390         break;
391     case TROUBLE_STARVING:
392         /* temporarily lost strength recovery now handled by init_uhunger() */
393         /*FALLTHRU*/
394     case TROUBLE_HUNGRY:
395 /*JP
396         Your("%s feels content.", body_part(STOMACH));
397 */
398         Your("\90H\97~\82Í\96\9e\82½\82³\82ê\82½\81D");
399         init_uhunger();
400         context.botl = 1;
401         break;
402     case TROUBLE_SICK:
403 /*JP
404         You_feel("better.");
405 */
406         You("\8bC\95ª\82ª\97Ç\82­\82È\82Á\82½\81D");
407         make_sick(0L, (char *) 0, FALSE, SICK_ALL);
408         break;
409     case TROUBLE_REGION:
410         /* stinking cloud, with hero vulnerable to HP loss */
411         region_safety();
412         break;
413     case TROUBLE_HIT:
414         /* "fix all troubles" will keep trying if hero has
415            5 or less hit points, so make sure they're always
416            boosted to be more than that */
417 /*JP
418         You_feel("much better.");
419 */
420         You("\82Æ\82Ä\82à\8bC\95ª\82ª\97Ç\82­\82È\82Á\82½\81D");
421         if (Upolyd) {
422             u.mhmax += rnd(5);
423             if (u.mhmax <= 5)
424                 u.mhmax = 5 + 1;
425             u.mh = u.mhmax;
426         }
427         if (u.uhpmax < u.ulevel * 5 + 11)
428             u.uhpmax += rnd(5);
429         if (u.uhpmax <= 5)
430             u.uhpmax = 5 + 1;
431         u.uhp = u.uhpmax;
432         context.botl = 1;
433         break;
434     case TROUBLE_COLLAPSING:
435         /* override Fixed_abil; uncurse that if feasible */
436 #if 0 /*JP*/
437         You_feel("%sstronger.",
438                  (AMAX(A_STR) - ABASE(A_STR) > 6) ? "much " : "");
439 #else
440         You_feel("%s\8b­\82­\82È\82Á\82½\82æ\82¤\82¾\81D",
441                  (AMAX(A_STR) - ABASE(A_STR) > 6) ? "\82Æ\82Ä\82à" : "");
442 #endif
443         ABASE(A_STR) = AMAX(A_STR);
444         context.botl = 1;
445         if (Fixed_abil) {
446             if ((otmp = stuck_ring(uleft, RIN_SUSTAIN_ABILITY)) != 0) {
447                 if (otmp == uleft)
448                     what = leftglow;
449             } else if ((otmp = stuck_ring(uright, RIN_SUSTAIN_ABILITY)) != 0) {
450                 if (otmp == uright)
451                     what = rightglow;
452             }
453             if (otmp)
454                 goto decurse;
455         }
456         break;
457     case TROUBLE_STUCK_IN_WALL:
458         /* no control, but works on no-teleport levels */
459         if (safe_teleds(FALSE)) {
460 /*JP
461         Your("surroundings change.");
462 */
463         Your("\8aÂ\8b«\82ª\95Ï\89»\82µ\82½\81D");
464         } else {
465             /* safe_teleds() couldn't find a safe place; perhaps the
466                level is completely full.  As a last resort, confer
467                intrinsic wall/rock-phazing.  Hero might get stuck
468                again fairly soon....
469                Without something like this, fix_all_troubles can get
470                stuck in an infinite loop trying to fix STUCK_IN_WALL
471                and repeatedly failing. */
472             set_itimeout(&HPasses_walls, (long) (d(4, 4) + 4)); /* 8..20 */
473             /* how else could you move between packed rocks or among
474                lattice forming "solid" rock? */
475 /*JP
476             You_feel("much slimmer.");
477 */
478             You_feel("\82Æ\82Ä\82à\83X\83\8a\83\80\82É\82È\82Á\82½\8bC\82ª\82µ\82½\81D");
479         }
480         break;
481     case TROUBLE_CURSED_LEVITATION:
482         if (Cursed_obj(uarmf, LEVITATION_BOOTS)) {
483             otmp = uarmf;
484         } else if ((otmp = stuck_ring(uleft, RIN_LEVITATION)) != 0) {
485             if (otmp == uleft)
486                 what = leftglow;
487         } else if ((otmp = stuck_ring(uright, RIN_LEVITATION)) != 0) {
488             if (otmp == uright)
489                 what = rightglow;
490         }
491         goto decurse;
492     case TROUBLE_UNUSEABLE_HANDS:
493         if (welded(uwep)) {
494             otmp = uwep;
495             goto decurse;
496         }
497         if (Upolyd && nohands(youmonst.data)) {
498             if (!Unchanging) {
499 /*JP
500                 Your("shape becomes uncertain.");
501 */
502                 Your("\91Ì\8c^\82Í\95s\96¾\8am\82É\82È\82Á\82½\81D");
503                 rehumanize(); /* "You return to {normal} form." */
504             } else if ((otmp = unchanger()) != 0 && otmp->cursed) {
505                 /* otmp is an amulet of unchanging */
506                 goto decurse;
507             }
508         }
509         if (nohands(youmonst.data) || !freehand())
510             impossible("fix_worst_trouble: couldn't cure hands.");
511         break;
512     case TROUBLE_CURSED_BLINDFOLD:
513         otmp = ublindf;
514         goto decurse;
515     case TROUBLE_LYCANTHROPE:
516         you_unwere(TRUE);
517         break;
518     /*
519      */
520     case TROUBLE_PUNISHED:
521 /*JP
522         Your("chain disappears.");
523 */
524         Your("\8d½\82Í\8fÁ\82¦\82½\81D");
525         if (u.utrap && u.utraptype == TT_BURIEDBALL)
526             buried_ball_to_freedom();
527         else
528             unpunish();
529         break;
530     case TROUBLE_FUMBLING:
531         if (Cursed_obj(uarmg, GAUNTLETS_OF_FUMBLING))
532             otmp = uarmg;
533         else if (Cursed_obj(uarmf, FUMBLE_BOOTS))
534             otmp = uarmf;
535         goto decurse;
536         /*NOTREACHED*/
537         break;
538     case TROUBLE_CURSED_ITEMS:
539         otmp = worst_cursed_item();
540         if (otmp == uright)
541             what = rightglow;
542         else if (otmp == uleft)
543             what = leftglow;
544     decurse:
545         if (!otmp) {
546             impossible("fix_worst_trouble: nothing to uncurse.");
547             return;
548         }
549         if (!Blind || (otmp == ublindf && Blindfolded_only)) {
550 #if 0 /*JP*/
551             pline("%s %s.",
552                   what ? what : (const char *) Yobjnam2(otmp, "softly glow"),
553                   hcolor(NH_AMBER));
554 #else
555             Your("%s\82Í%s\82â\82í\82ç\82©\82­\8bP\82¢\82½\81D",
556                  what ? what : (const char *)xname(otmp),
557                  jconj_adj(hcolor(NH_AMBER)));
558 #endif
559             iflags.last_msg = PLNMSG_OBJ_GLOWS;
560             otmp->bknown = !Hallucination;
561         }
562         uncurse(otmp);
563         update_inventory();
564         break;
565     case TROUBLE_POISONED:
566         /* override Fixed_abil; ignore items which confer that */
567         if (Hallucination)
568 /*JP
569             pline("There's a tiger in your tank.");
570 */
571             pline("\82 \82È\82½\82Ì\83^\83\93\83N\82Ì\92\86\82É\83g\83\89\82ª\82¢\82é\81D");
572         else
573 /*JP
574             You_feel("in good health again.");
575 */
576             You("\82Ü\82½\8c\92\8dN\82É\82È\82Á\82½\82æ\82¤\82È\8bC\82ª\82µ\82½\81D");
577         for (i = 0; i < A_MAX; i++) {
578             if (ABASE(i) < AMAX(i)) {
579                 ABASE(i) = AMAX(i);
580                 context.botl = 1;
581             }
582         }
583         (void) encumber_msg();
584         break;
585     case TROUBLE_BLIND: {
586 #if 0 /*JP*/
587         const char *eyes = body_part(EYE);
588
589         if (eyecount(youmonst.data) != 1)
590             eyes = makeplural(eyes);
591         Your("%s %s better.", eyes, vtense(eyes, "feel"));
592 #else
593         pline("%s\82ª\89ñ\95\9c\82µ\82½\82æ\82¤\82È\8bC\82ª\82µ\82½\81D", body_part(EYE));
594 #endif
595         u.ucreamed = 0;
596         make_blinded(0L, FALSE);
597         break;
598     }
599     case TROUBLE_WOUNDED_LEGS:
600         heal_legs();
601         break;
602     case TROUBLE_STUNNED:
603         make_stunned(0L, TRUE);
604         break;
605     case TROUBLE_CONFUSED:
606         make_confused(0L, TRUE);
607         break;
608     case TROUBLE_HALLUCINATION:
609 /*JP
610         pline("Looks like you are back in Kansas.");
611 */
612         pline("\8c©\82Ä\81I\83J\83\93\83U\83X\82É\96ß\82Á\82Ä\82«\82½\82ñ\82¾\82í\81D");
613         (void) make_hallucinated(0L, FALSE, 0L);
614         break;
615     case TROUBLE_SADDLE:
616         otmp = which_armor(u.usteed, W_SADDLE);
617         if (!Blind) {
618 /*JP
619             pline("%s %s.", Yobjnam2(otmp, "softly glow"), hcolor(NH_AMBER));
620 */
621             pline("%s\82Í%s\82â\82í\82ç\82©\82­\8bP\82¢\82½\81D", y_monnam(u.usteed), hcolor(NH_AMBER));
622             otmp->bknown = TRUE;
623         }
624         uncurse(otmp);
625         break;
626     }
627 }
628
629 /* "I am sometimes shocked by... the nuns who never take a bath without
630  * wearing a bathrobe all the time.  When asked why, since no man can see them,
631  * they reply 'Oh, but you forget the good God'.  Apparently they conceive of
632  * the Deity as a Peeping Tom, whose omnipotence enables Him to see through
633  * bathroom walls, but who is foiled by bathrobes." --Bertrand Russell, 1943
634  * Divine wrath, dungeon walls, and armor follow the same principle.
635  */
636 STATIC_OVL void
637 god_zaps_you(resp_god)
638 aligntyp resp_god;
639 {
640     if (u.uswallow) {
641         pline(
642 /*JP
643           "Suddenly a bolt of lightning comes down at you from the heavens!");
644 */
645           "\93Ë\91R\8bó\82©\82ç\88î\8dÈ\82ª\97\8e\82¿\82Ä\82«\82½\81I");
646 /*JP
647         pline("It strikes %s!", mon_nam(u.ustuck));
648 */
649         pline("\88î\8dÈ\82Í%s\82É\96½\92\86\82µ\82½\81I", mon_nam(u.ustuck));
650         if (!resists_elec(u.ustuck)) {
651 /*JP
652             pline("%s fries to a crisp!", Monnam(u.ustuck));
653 */
654             pline("%s\82Í\83p\83\8a\83p\83\8a\82É\82È\82Á\82½\81I", Monnam(u.ustuck));
655             /* Yup, you get experience.  It takes guts to successfully
656              * pull off this trick on your god, anyway.
657              * Other credit/blame applies (luck or alignment adjustments),
658              * but not direct kill count (pacifist conduct).
659              */
660             xkilled(u.ustuck, XKILL_NOMSG | XKILL_NOCONDUCT);
661         } else
662 /*JP
663             pline("%s seems unaffected.", Monnam(u.ustuck));
664 */
665             pline("%s\82Í\89e\8b¿\82ð\8eó\82¯\82È\82¢\82æ\82¤\82¾\81D", Monnam(u.ustuck));
666     } else {
667 /*JP
668         pline("Suddenly, a bolt of lightning strikes you!");
669 */
670         pline("\93Ë\91R\81C\88î\8dÈ\82ª\82 \82È\82½\82É\96½\92\86\82µ\82½\81I");
671         if (Reflecting) {
672             shieldeff(u.ux, u.uy);
673             if (Blind)
674 /*JP
675                 pline("For some reason you're unaffected.");
676 */
677                 pline("\82È\82º\82©\82 \82È\82½\82Í\89e\8b¿\82ð\8eó\82¯\82È\82¢\81D");
678             else
679 /*JP
680                 (void) ureflects("%s reflects from your %s.", "It");
681 */
682                 (void) ureflects("%s\82Í%s\82É\82æ\82Á\82Ä\94½\8eË\82³\82ê\82½\81D", "\89½\82©");
683         } else if (Shock_resistance) {
684             shieldeff(u.ux, u.uy);
685 /*JP
686             pline("It seems not to affect you.");
687 */
688             pline("\88î\8dÈ\82Í\89e\8b¿\82ð\97^\82¦\82È\82¢\82æ\82¤\82¾\81D");
689         } else
690             fry_by_god(resp_god, FALSE);
691     }
692
693 /*JP
694     pline("%s is not deterred...", align_gname(resp_god));
695 */
696     pline("%s\82Í\82 \82«\82ç\82ß\82È\82©\82Á\82½\81D\81D\81D", align_gname(resp_god));
697     if (u.uswallow) {
698 /*JP
699         pline("A wide-angle disintegration beam aimed at you hits %s!",
700 */
701         pline("\82 \82È\82½\82ð\91_\82Á\82½\8dL\8ap\95²\8dÓ\8cõ\90ü\82ª%s\82É\96½\92\86\82µ\82½\81I",
702               mon_nam(u.ustuck));
703         if (!resists_disint(u.ustuck)) {
704 /*JP
705             pline("%s disintegrates into a pile of dust!", Monnam(u.ustuck));
706 */
707             pline("%s\82Í\82¿\82è\82Ì\8eR\82É\82È\82Á\82½\81I", Monnam(u.ustuck));
708             xkilled(u.ustuck, XKILL_NOMSG | XKILL_NOCORPSE | XKILL_NOCONDUCT);
709         } else
710 /*JP
711             pline("%s seems unaffected.", Monnam(u.ustuck));
712 */
713             pline("%s\82Í\89e\8b¿\82ð\8eó\82¯\82È\82¢\82æ\82¤\82¾\81D", Monnam(u.ustuck));
714     } else {
715 /*JP
716         pline("A wide-angle disintegration beam hits you!");
717 */
718         pline("\8dL\8ap\95²\8dÓ\8cõ\90ü\82ª\82 \82È\82½\82É\96½\92\86\82µ\82½\81I");
719
720         /* disintegrate shield and body armor before disintegrating
721          * the impudent mortal, like black dragon breath -3.
722          */
723         if (uarms && !(EReflecting & W_ARMS)
724             && !(EDisint_resistance & W_ARMS))
725             (void) destroy_arm(uarms);
726         if (uarmc && !(EReflecting & W_ARMC)
727             && !(EDisint_resistance & W_ARMC))
728             (void) destroy_arm(uarmc);
729         if (uarm && !(EReflecting & W_ARM) && !(EDisint_resistance & W_ARM)
730             && !uarmc)
731             (void) destroy_arm(uarm);
732         if (uarmu && !uarm && !uarmc)
733             (void) destroy_arm(uarmu);
734         if (!Disint_resistance) {
735             fry_by_god(resp_god, TRUE);
736         } else {
737 /*JP
738             You("bask in its %s glow for a minute...", NH_BLACK);
739 */
740             You("\82µ\82Î\82ç\82­\81C\82»\82Ì%s\8bP\82«\82Å\92g\82Ü\82Á\82½\81D\81D\81D", NH_BLACK);
741 /*JP
742             godvoice(resp_god, "I believe it not!");
743 */
744             godvoice(resp_god, "\90M\82\82ç\82ê\82Ê\81I");
745         }
746         if (Is_astralevel(&u.uz) || Is_sanctum(&u.uz)) {
747             /* one more try for high altars */
748 /*JP
749             verbalize("Thou cannot escape my wrath, mortal!");
750 */
751             verbalize("\92è\96½\82Ì\8eÒ\82æ\81C\93ð\89ä\82ª\93{\82è\82©\82ç\93¦\82ª\82ê\82é\82±\82Æ\82È\82ç\82ñ\81I");
752             summon_minion(resp_god, FALSE);
753             summon_minion(resp_god, FALSE);
754             summon_minion(resp_god, FALSE);
755 /*JP
756             verbalize("Destroy %s, my servants!", uhim());
757 */
758             verbalize("%s\82ð\8eE\82¹\81C\82í\82ª\89º\96l\82æ\81I", uhim());
759         }
760     }
761 }
762
763 STATIC_OVL void
764 fry_by_god(resp_god, via_disintegration)
765 aligntyp resp_god;
766 boolean via_disintegration;
767 {
768 #if 0 /*JP*/
769     You("%s!", !via_disintegration ? "fry to a crisp"
770                                    : "disintegrate into a pile of dust");
771 #else
772     You("%s\81I", !via_disintegration ? "\83p\83\8a\83p\83\8a\82É\82È\82Á\82½"
773                                     : "\82¿\82è\82Ì\8eR\82É\82È\82Á\82½");
774 #endif
775     killer.format = KILLED_BY;
776 /*JP
777     Sprintf(killer.name, "the wrath of %s", align_gname(resp_god));
778 */
779     Sprintf(killer.name, "%s\82Ì\93{\82è\82É\90G\82ê", align_gname(resp_god));
780     done(DIED);
781 }
782
783 STATIC_OVL void
784 angrygods(resp_god)
785 aligntyp resp_god;
786 {
787     int maxanger;
788
789     if (Inhell)
790         resp_god = A_NONE;
791     u.ublessed = 0;
792
793     /* changed from tmp = u.ugangr + abs (u.uluck) -- rph */
794     /* added test for alignment diff -dlc */
795     if (resp_god != u.ualign.type)
796         maxanger = u.ualign.record / 2 + (Luck > 0 ? -Luck / 3 : -Luck);
797     else
798         maxanger = 3 * u.ugangr + ((Luck > 0 || u.ualign.record >= STRIDENT)
799                                    ? -Luck / 3
800                                    : -Luck);
801     if (maxanger < 1)
802         maxanger = 1; /* possible if bad align & good luck */
803     else if (maxanger > 15)
804         maxanger = 15; /* be reasonable */
805
806     switch (rn2(maxanger)) {
807     case 0:
808     case 1:
809 #if 0 /*JP*/
810         You_feel("that %s is %s.", align_gname(resp_god),
811                  Hallucination ? "bummed" : "displeased");
812 #else
813         You("%s\82ª%s\82¢\82é\82æ\82¤\82È\8bC\82ª\82µ\82½\81D", align_gname(resp_god),
814             Hallucination ? "\82Ë\82¾\82Á\82Ä" : "\97§\95 \82µ\82Ä");
815 #endif
816         break;
817     case 2:
818     case 3:
819         godvoice(resp_god, (char *) 0);
820 #if 0 /*JP*/
821         pline("\"Thou %s, %s.\"",
822               (ugod_is_angry() && resp_god == u.ualign.type)
823                   ? "hast strayed from the path"
824                   : "art arrogant",
825               youmonst.data->mlet == S_HUMAN ? "mortal" : "creature");
826 #else
827         pline("\81u\93ð%s\81C%s\82æ\81D\81v",
828               (ugod_is_angry() && resp_god == u.ualign.type)
829               ? "\82»\82Ì\93¹\82©\82ç\93¥\82Ý\8fo\82Ä\82¨\82é"
830               : "\98ü\96\9d\82È\82è",
831               youmonst.data->mlet == S_HUMAN ? "\92è\96½\82Ì\82à\82Ì" : "\90\95¨");
832 #endif
833 /*JP
834         verbalize("Thou must relearn thy lessons!");
835 */
836         verbalize("\93ð\82¢\82Ü\88ê\93x\8aw\82Ô\82×\82µ\81I");
837         (void) adjattrib(A_WIS, -1, FALSE);
838         losexp((char *) 0);
839         break;
840     case 6:
841         if (!Punished) {
842             gods_angry(resp_god);
843             punish((struct obj *) 0);
844             break;
845         } /* else fall thru */
846     case 4:
847     case 5:
848         gods_angry(resp_god);
849         if (!Blind && !Antimagic)
850 /*JP
851             pline("%s glow surrounds you.", An(hcolor(NH_BLACK)));
852 */
853             pline("%s\8cõ\82ª\82 \82È\82½\82ð\8eæ\82è\8aª\82¢\82½\81D", An(hcolor(NH_BLACK)));
854         rndcurse();
855         break;
856     case 7:
857     case 8:
858         godvoice(resp_god, (char *) 0);
859 #if 0 /*JP*/
860         verbalize("Thou durst %s me?",
861                   (on_altar() && (a_align(u.ux, u.uy) != resp_god))
862                       ? "scorn"
863                       : "call upon");
864 #else
865         verbalize("\93ð\81C\89ä%s\81H",
866                   (on_altar() && (a_align(u.ux,u.uy) != resp_god))
867                   ? "\82ð\82³\82°\82·\82Ý\82µ\82©\81H"
868                   : "\82É\8bF\82è\82ð\8b\81\82ß\82µ\82©\81H");
869 #endif
870 #if 0 /*JP*/
871         pline("\"Then die, %s!\"",
872               youmonst.data->mlet == S_HUMAN ? "mortal" : "creature");
873 #else
874         pline("\81u\8e\80\82Ë\81C%s\82æ\81I\81v",
875               youmonst.data->mlet == S_HUMAN ? "\92è\96½\82Ì\82à\82Ì" : "\90\95¨");
876 #endif
877         summon_minion(resp_god, FALSE);
878         break;
879
880     default:
881         gods_angry(resp_god);
882         god_zaps_you(resp_god);
883         break;
884     }
885     u.ublesscnt = rnz(300);
886     return;
887 }
888
889 /* helper to print "str appears at your feet", or appropriate */
890 static void
891 at_your_feet(str)
892 const char *str;
893 {
894     if (Blind)
895         str = Something;
896     if (u.uswallow) {
897         /* barrier between you and the floor */
898 #if 0 /*JP*/
899         pline("%s %s into %s %s.", str, vtense(str, "drop"),
900               s_suffix(mon_nam(u.ustuck)), mbodypart(u.ustuck, STOMACH));
901 #else
902         pline("%s\82ª%s\82Ì%s\82É\97\8e\82¿\82½\81D", str,
903               mon_nam(u.ustuck), mbodypart(u.ustuck, STOMACH));
904 #endif
905     } else {
906 #if 0 /*JP*/
907         pline("%s %s %s your %s!", str,
908               Blind ? "lands" : vtense(str, "appear"),
909               Levitation ? "beneath" : "at", makeplural(body_part(FOOT)));
910 #else
911         pline("%s\82ª\82 \82È\82½\82Ì%s\82É%s\81I", str,
912               Levitation ? "\89º\95û" : "\91«\8c³",
913               Blind ? "\92\85\92n\82µ\82½" : "\8c»\82í\82ê\82½");
914 #endif
915     }
916 }
917
918 STATIC_OVL void
919 gcrownu()
920 {
921     struct obj *obj;
922     boolean already_exists, in_hand;
923     short class_gift;
924     int sp_no;
925 #define ok_wep(o) ((o) && ((o)->oclass == WEAPON_CLASS || is_weptool(o)))
926
927     HSee_invisible |= FROMOUTSIDE;
928     HFire_resistance |= FROMOUTSIDE;
929     HCold_resistance |= FROMOUTSIDE;
930     HShock_resistance |= FROMOUTSIDE;
931     HSleep_resistance |= FROMOUTSIDE;
932     HPoison_resistance |= FROMOUTSIDE;
933     godvoice(u.ualign.type, (char *) 0);
934
935     obj = ok_wep(uwep) ? uwep : 0;
936     already_exists = in_hand = FALSE; /* lint suppression */
937     switch (u.ualign.type) {
938     case A_LAWFUL:
939         u.uevent.uhand_of_elbereth = 1;
940 /*JP
941         verbalize("I crown thee...  The Hand of Elbereth!");
942 */
943         verbalize("\93ð\82É\81D\81D\81D\83G\83\8b\83x\83\8c\83X\82Ì\8cä\8eè\82Ì\89h\97_\82ð\82³\82¸\82¯\82æ\82¤\81I");
944         break;
945     case A_NEUTRAL:
946         u.uevent.uhand_of_elbereth = 2;
947         in_hand = (uwep && uwep->oartifact == ART_VORPAL_BLADE);
948         already_exists =
949             exist_artifact(LONG_SWORD, artiname(ART_VORPAL_BLADE));
950 /*JP
951         verbalize("Thou shalt be my Envoy of Balance!");
952 */
953         verbalize("\93ð\81C\89ä\82ª\92²\98a\82Ì\8eg\8eÒ\82È\82è\81I");
954         break;
955     case A_CHAOTIC:
956         u.uevent.uhand_of_elbereth = 3;
957         in_hand = (uwep && uwep->oartifact == ART_STORMBRINGER);
958         already_exists =
959             exist_artifact(RUNESWORD, artiname(ART_STORMBRINGER));
960 #if 0 /*JP*/
961         verbalize("Thou art chosen to %s for My Glory!",
962                   already_exists && !in_hand ? "take lives" : "steal souls");
963 #else
964         verbalize("\93ð\81C\89ä\82ª\89h\8cõ\82Ì\82½\82ß%s\8eÒ\82Æ\82µ\82Ä\91I\82Î\82ê\82ñ\81I",
965                   already_exists && !in_hand ?
966                               "\90\82«\82È\82ª\82ç\82¦\82ñ" : "\8d°\82ð\92D\82¢\82µ\82½\82ß\82é");
967 #endif
968         break;
969     }
970
971     class_gift = STRANGE_OBJECT;
972     /* 3.3.[01] had this in the A_NEUTRAL case below,
973        preventing chaotic wizards from receiving a spellbook */
974     if (Role_if(PM_WIZARD)
975         && (!uwep || (uwep->oartifact != ART_VORPAL_BLADE
976                       && uwep->oartifact != ART_STORMBRINGER))
977         && !carrying(SPE_FINGER_OF_DEATH)) {
978         class_gift = SPE_FINGER_OF_DEATH;
979     make_splbk:
980         obj = mksobj(class_gift, TRUE, FALSE);
981         bless(obj);
982         obj->bknown = TRUE;
983 /*JP
984         at_your_feet("A spellbook");
985 */
986         at_your_feet("\96\82\96@\8f\91");
987         dropy(obj);
988         u.ugifts++;
989         /* when getting a new book for known spell, enhance
990            currently wielded weapon rather than the book */
991         for (sp_no = 0; sp_no < MAXSPELL; sp_no++)
992             if (spl_book[sp_no].sp_id == class_gift) {
993                 if (ok_wep(uwep))
994                     obj = uwep; /* to be blessed,&c */
995                 break;
996             }
997     } else if (Role_if(PM_MONK) && (!uwep || !uwep->oartifact)
998                && !carrying(SPE_RESTORE_ABILITY)) {
999         /* monks rarely wield a weapon */
1000         class_gift = SPE_RESTORE_ABILITY;
1001         goto make_splbk;
1002     }
1003
1004     switch (u.ualign.type) {
1005     case A_LAWFUL:
1006         if (class_gift != STRANGE_OBJECT) {
1007             ; /* already got bonus above */
1008         } else if (obj && obj->otyp == LONG_SWORD && !obj->oartifact) {
1009             if (!Blind)
1010 /*JP
1011                 Your("sword shines brightly for a moment.");
1012 */
1013                 Your("\8c\95\82Í\82µ\82Î\82ç\82­\82Ì\8aÔ\96¾\82é\82­\8bP\82¢\82½\81D");
1014             obj = oname(obj, artiname(ART_EXCALIBUR));
1015             if (obj && obj->oartifact == ART_EXCALIBUR)
1016                 u.ugifts++;
1017         }
1018         /* acquire Excalibur's skill regardless of weapon or gift */
1019         unrestrict_weapon_skill(P_LONG_SWORD);
1020         if (obj && obj->oartifact == ART_EXCALIBUR)
1021             discover_artifact(ART_EXCALIBUR);
1022         break;
1023     case A_NEUTRAL:
1024         if (class_gift != STRANGE_OBJECT) {
1025             ; /* already got bonus above */
1026         } else if (obj && in_hand) {
1027 /*JP
1028             Your("%s goes snicker-snack!", xname(obj));
1029 */
1030             Your("%s\82Í\83T\83N\83T\83N\82É\82È\82Á\82½\81I", xname(obj));
1031             obj->dknown = TRUE;
1032         } else if (!already_exists) {
1033             obj = mksobj(LONG_SWORD, FALSE, FALSE);
1034             obj = oname(obj, artiname(ART_VORPAL_BLADE));
1035             obj->spe = 1;
1036 /*JP
1037             at_your_feet("A sword");
1038 */
1039             at_your_feet("\8c\95");
1040             dropy(obj);
1041             u.ugifts++;
1042         }
1043         /* acquire Vorpal Blade's skill regardless of weapon or gift */
1044         unrestrict_weapon_skill(P_LONG_SWORD);
1045         if (obj && obj->oartifact == ART_VORPAL_BLADE)
1046             discover_artifact(ART_VORPAL_BLADE);
1047         break;
1048     case A_CHAOTIC: {
1049         char swordbuf[BUFSZ];
1050
1051 /*JP
1052         Sprintf(swordbuf, "%s sword", hcolor(NH_BLACK));
1053 */
1054         Sprintf(swordbuf, "%s\8c\95", hcolor(NH_BLACK));
1055         if (class_gift != STRANGE_OBJECT) {
1056             ; /* already got bonus above */
1057         } else if (obj && in_hand) {
1058 /*JP
1059             Your("%s hums ominously!", swordbuf);
1060 */
1061             Your("%s\82Í\8bC\96¡\82Ì\88«\82¢\89¹\82ð\97§\82Ä\82½\81I", swordbuf);
1062             obj->dknown = TRUE;
1063         } else if (!already_exists) {
1064             obj = mksobj(RUNESWORD, FALSE, FALSE);
1065             obj = oname(obj, artiname(ART_STORMBRINGER));
1066             obj->spe = 1;
1067             at_your_feet(An(swordbuf));
1068             dropy(obj);
1069             u.ugifts++;
1070         }
1071         /* acquire Stormbringer's skill regardless of weapon or gift */
1072         unrestrict_weapon_skill(P_BROAD_SWORD);
1073         if (obj && obj->oartifact == ART_STORMBRINGER)
1074             discover_artifact(ART_STORMBRINGER);
1075         break;
1076     }
1077     default:
1078         obj = 0; /* lint */
1079         break;
1080     }
1081
1082     /* enhance weapon regardless of alignment or artifact status */
1083     if (ok_wep(obj)) {
1084         bless(obj);
1085         obj->oeroded = obj->oeroded2 = 0;
1086         obj->oerodeproof = TRUE;
1087         obj->bknown = obj->rknown = TRUE;
1088         if (obj->spe < 1)
1089             obj->spe = 1;
1090         /* acquire skill in this weapon */
1091         unrestrict_weapon_skill(weapon_type(obj));
1092     } else if (class_gift == STRANGE_OBJECT) {
1093         /* opportunity knocked, but there was nobody home... */
1094 /*JP
1095         You_feel("unworthy.");
1096 */
1097         You("\89¿\92l\82ª\82È\82¢\82Æ\8ev\82Á\82½\81D");
1098     }
1099     update_inventory();
1100
1101     /* lastly, confer an extra skill slot/credit beyond the
1102        up-to-29 you can get from gaining experience levels */
1103     add_weapon_skill(1);
1104     return;
1105 }
1106
1107 STATIC_OVL void
1108 pleased(g_align)
1109 aligntyp g_align;
1110 {
1111     /* don't use p_trouble, worst trouble may get fixed while praying */
1112     int trouble = in_trouble(); /* what's your worst difficulty? */
1113     int pat_on_head = 0, kick_on_butt;
1114
1115 #if 0 /*JP*/
1116     You_feel("that %s is %s.", align_gname(g_align),
1117              (u.ualign.record >= DEVOUT)
1118                  ? Hallucination ? "pleased as punch" : "well-pleased"
1119                  : (u.ualign.record >= STRIDENT)
1120                        ? Hallucination ? "ticklish" : "pleased"
1121                        : Hallucination ? "full" : "satisfied");
1122 #else
1123         pline("%s\82ª%s\82æ\82¤\82È\8bC\82ª\82µ\82½\81D", align_gname(g_align),
1124               (u.ualign.record >= DEVOUT)
1125                   ? Hallucination ? "\82­\82»\8b@\8c\99\82¢\82¢" : "\82²\8b@\8c\99\97í\82µ\82¢"
1126                   : (u.ualign.record >= STRIDENT)
1127                         ? Hallucination ? "\82­\82·\82®\82Á\82½\82ª\82Á\82Ä\82¢\82é" : "\8fã\8b@\8c\99\82Å\82 \82é"
1128                         : Hallucination ? "\95 \82¢\82Á\82Ï\82¢\82Å\82 \82é" : "\96\9e\91«\82µ\82Ä\82¢\82é");
1129 #endif
1130
1131     /* not your deity */
1132     if (on_altar() && p_aligntyp != u.ualign.type) {
1133         adjalign(-1);
1134         return;
1135     } else if (u.ualign.record < 2 && trouble <= 0)
1136         adjalign(1);
1137
1138     /*
1139      * Depending on your luck & align level, the god you prayed to will:
1140      *  - fix your worst problem if it's major;
1141      *  - fix all your major problems;
1142      *  - fix your worst problem if it's minor;
1143      *  - fix all of your problems;
1144      *  - do you a gratuitous favor.
1145      *
1146      * If you make it to the the last category, you roll randomly again
1147      * to see what they do for you.
1148      *
1149      * If your luck is at least 0, then you are guaranteed rescued from
1150      * your worst major problem.
1151      */
1152     if (!trouble && u.ualign.record >= DEVOUT) {
1153         /* if hero was in trouble, but got better, no special favor */
1154         if (p_trouble == 0)
1155             pat_on_head = 1;
1156     } else {
1157         int action, prayer_luck;
1158         int tryct = 0;
1159
1160         /* Negative luck is normally impossible here (can_pray() forces
1161            prayer failure in that situation), but it's possible for
1162            Luck to drop during the period of prayer occupation and
1163            become negative by the time we get here.  [Reported case
1164            was lawful character whose stinking cloud caused a delayed
1165            killing of a peaceful human, triggering the "murderer"
1166            penalty while successful prayer was in progress.  It could
1167            also happen due to inconvenient timing on Friday 13th, but
1168            the magnitude there (-1) isn't big enough to cause trouble.]
1169            We don't bother remembering start-of-prayer luck, just make
1170            sure it's at least -1 so that Luck+2 is big enough to avoid
1171            a divide by zero crash when generating a random number.  */
1172         prayer_luck = max(Luck, -1); /* => (prayer_luck + 2 > 0) */
1173         action = rn1(prayer_luck + (on_altar() ? 3 + on_shrine() : 2), 1);
1174         if (!on_altar())
1175             action = min(action, 3);
1176         if (u.ualign.record < STRIDENT)
1177             action = (u.ualign.record > 0 || !rnl(2)) ? 1 : 0;
1178
1179         switch (min(action, 5)) {
1180         case 5:
1181             pat_on_head = 1;
1182             /*FALLTHRU*/
1183         case 4:
1184             do
1185                 fix_worst_trouble(trouble);
1186             while ((trouble = in_trouble()) != 0);
1187             break;
1188
1189         case 3:
1190             fix_worst_trouble(trouble);
1191         case 2:
1192             /* arbitrary number of tries */
1193             while ((trouble = in_trouble()) > 0 && (++tryct < 10))
1194                 fix_worst_trouble(trouble);
1195             break;
1196
1197         case 1:
1198             if (trouble > 0)
1199                 fix_worst_trouble(trouble);
1200         case 0:
1201             break; /* your god blows you off, too bad */
1202         }
1203     }
1204
1205     /* note: can't get pat_on_head unless all troubles have just been
1206        fixed or there were no troubles to begin with; hallucination
1207        won't be in effect so special handling for it is superfluous */
1208     if (pat_on_head)
1209         switch (rn2((Luck + 6) >> 1)) {
1210         case 0:
1211             break;
1212         case 1:
1213             if (uwep && (welded(uwep) || uwep->oclass == WEAPON_CLASS
1214                          || is_weptool(uwep))) {
1215                 char repair_buf[BUFSZ];
1216
1217                 *repair_buf = '\0';
1218                 if (uwep->oeroded || uwep->oeroded2)
1219 #if 0 /*JP*/
1220                     Sprintf(repair_buf, " and %s now as good as new",
1221                             otense(uwep, "are"));
1222 #else
1223                     Sprintf(repair_buf, "\82³\82ç\82É\90V\95i\93¯\97l\82É\82È\82Á\82½\81D");
1224 #endif
1225
1226                 if (uwep->cursed) {
1227                     if (!Blind) {
1228 #if 0 /*JP*/
1229                         pline("%s %s%s.", Yobjnam2(uwep, "softly glow"),
1230                               hcolor(NH_AMBER), repair_buf);
1231 #else
1232                         Your("%s\82Í%s\82â\82í\82ç\82©\82­\8bP\82¢\82½\81D%s", xname(uwep), 
1233                              jconj_adj(hcolor(NH_AMBER)), repair_buf);
1234 #endif
1235                         iflags.last_msg = PLNMSG_OBJ_GLOWS;
1236                     } else
1237 #if 0 /*JP*/
1238                         You_feel("the power of %s over %s.", u_gname(),
1239                                  yname(uwep));
1240 #else
1241                         pline("%s\82Ì\97Í\82ª%s\82É\92\8d\82ª\82ê\82Ä\82¢\82é\82Ì\82ð\8a´\82\82½\81D", u_gname(),
1242                               xname(uwep));
1243 #endif
1244                     uncurse(uwep);
1245                     uwep->bknown = TRUE;
1246                     *repair_buf = '\0';
1247                 } else if (!uwep->blessed) {
1248                     if (!Blind) {
1249 #if 0 /*JP*/
1250                         pline("%s with %s aura%s.",
1251                               Yobjnam2(uwep, "softly glow"),
1252                               an(hcolor(NH_LIGHT_BLUE)), repair_buf);
1253 #else
1254                         Your("%s\82Í%s\82â\82í\82ç\82©\82È\83I\81[\83\89\82É\82Â\82Â\82Ü\82ê\82½\81D%s",
1255                              xname(uwep), 
1256                              an(hcolor(NH_LIGHT_BLUE)), repair_buf);
1257 #endif
1258                         iflags.last_msg = PLNMSG_OBJ_GLOWS;
1259                     } else
1260 #if 0 /*JP*/
1261                         You_feel("the blessing of %s over %s.", u_gname(),
1262                                  yname(uwep));
1263 #else
1264                         pline("%s\82Ì\8fj\95\9f\82ª%s\82É\92\8d\82ª\82ê\82Ä\82¢\82é\82Ì\82ð\8a´\82\82½\81D", u_gname(),
1265                               xname(uwep));
1266 #endif
1267                     bless(uwep);
1268                     uwep->bknown = TRUE;
1269                     *repair_buf = '\0';
1270                 }
1271
1272                 /* fix any rust/burn/rot damage, but don't protect
1273                    against future damage */
1274                 if (uwep->oeroded || uwep->oeroded2) {
1275                     uwep->oeroded = uwep->oeroded2 = 0;
1276                     /* only give this message if we didn't just bless
1277                        or uncurse (which has already given a message) */
1278                     if (*repair_buf)
1279 #if 0 /*JP*/
1280                         pline("%s as good as new!",
1281                               Yobjnam2(uwep, Blind ? "feel" : "look"));
1282 #else
1283                         Your("%s\82Í\90V\95i\93¯\97l\82É\82È\82Á\82½%s\81I",
1284                              xname(uwep), Blind ? "\82æ\82¤\82È\8bC\82ª\82·\82é" : "");
1285 #endif
1286                 }
1287                 update_inventory();
1288             }
1289             break;
1290         case 3:
1291             /* takes 2 hints to get the music to enter the stronghold;
1292                skip if you've solved it via mastermind or destroyed the
1293                drawbridge (both set uopened_dbridge) or if you've already
1294                travelled past the Valley of the Dead (gehennom_entered) */
1295             if (!u.uevent.uopened_dbridge && !u.uevent.gehennom_entered) {
1296                 if (u.uevent.uheard_tune < 1) {
1297                     godvoice(g_align, (char *) 0);
1298 #if 0 /*JP*/
1299                     verbalize("Hark, %s!", youmonst.data->mlet == S_HUMAN
1300                                                ? "mortal"
1301                                                : "creature");
1302 #else
1303                     verbalize("%s\82æ\81C\95·\82¯\81I", youmonst.data->mlet == S_HUMAN
1304                                                   ? "\92è\96½\82Ì\8eÒ"
1305                                                   : "\90\95¨");
1306 #endif
1307                     verbalize(
1308 /*JP
1309                        "To enter the castle, thou must play the right tune!");
1310 */
1311                         "\93ð\8fé\82É\93ü\82ç\82ñ\82Æ\97~\82·\82é\82È\82ç\82Î\81C\90³\82µ\82«\92²\82×\82ð\91t\82Å\82é\82×\82µ\81I");
1312                     u.uevent.uheard_tune++;
1313                     break;
1314                 } else if (u.uevent.uheard_tune < 2) {
1315 /*JP
1316                     You_hear("a divine music...");
1317 */
1318                     You_hear("\90_\82Ì\89¹\8ay\82ð\95·\82¢\82½\81D\81D\81D");
1319 /*JP
1320                     pline("It sounds like:  \"%s\".", tune);
1321 */
1322                     pline("\82»\82ê\82Í\8e\9f\82Ì\82æ\82¤\82É\95·\82±\82¦\82½:  \81u%s\81v", tune);
1323                     u.uevent.uheard_tune++;
1324                     break;
1325                 }
1326             }
1327             /*FALLTHRU*/
1328         case 2:
1329             if (!Blind)
1330 /*JP
1331                 You("are surrounded by %s glow.", an(hcolor(NH_GOLDEN)));
1332 */
1333                 You("%s\8bP\82«\82É\82Â\82Â\82Ü\82ê\82½\81D", hcolor(NH_GOLDEN));
1334             /* if any levels have been lost (and not yet regained),
1335                treat this effect like blessed full healing */
1336             if (u.ulevel < u.ulevelmax) {
1337                 u.ulevelmax -= 1; /* see potion.c */
1338                 pluslvl(FALSE);
1339             } else {
1340                 u.uhpmax += 5;
1341                 if (Upolyd)
1342                     u.mhmax += 5;
1343             }
1344             u.uhp = u.uhpmax;
1345             if (Upolyd)
1346                 u.mh = u.mhmax;
1347             ABASE(A_STR) = AMAX(A_STR);
1348             if (u.uhunger < 900)
1349                 init_uhunger();
1350             /* luck couldn't have been negative at start of prayer because
1351                the prayer would have failed, but might have been decremented
1352                due to a timed event (delayed death of peaceful monster hit
1353                by hero-created stinking cloud) during the praying interval */
1354             if (u.uluck < 0)
1355                 u.uluck = 0;
1356             /* superfluous; if hero was blinded we'd be handling trouble
1357                rather than issuing a pat-on-head */
1358             u.ucreamed = 0;
1359             make_blinded(0L, TRUE);
1360             context.botl = 1;
1361             break;
1362         case 4: {
1363             register struct obj *otmp;
1364             int any = 0;
1365
1366             if (Blind)
1367 /*JP
1368                 You_feel("the power of %s.", u_gname());
1369 */
1370                 You("%s\82Ì\97Í\82ð\8a´\82\82½\81D", u_gname());
1371             else
1372 /*JP
1373                 You("are surrounded by %s aura.", an(hcolor(NH_LIGHT_BLUE)));
1374 */
1375                 You("%s\83I\81[\83\89\82É\82Â\82Â\82Ü\82ê\82½\81D", an(hcolor(NH_LIGHT_BLUE)));
1376             for (otmp = invent; otmp; otmp = otmp->nobj) {
1377                 if (otmp->cursed
1378                     && (otmp != uarmh /* [see worst_cursed_item()] */
1379                         || uarmh->otyp != HELM_OF_OPPOSITE_ALIGNMENT)) {
1380                     if (!Blind) {
1381 #if 0 /*JP*/
1382                         pline("%s %s.", Yobjnam2(otmp, "softly glow"),
1383                               hcolor(NH_AMBER));
1384 #else
1385                         Your("%s\82Í%s\82â\82í\82ç\82©\82­\8bP\82¢\82½\81D", xname(otmp),
1386                              jconj_adj(hcolor(NH_AMBER)));
1387 #endif
1388                         iflags.last_msg = PLNMSG_OBJ_GLOWS;
1389                         otmp->bknown = TRUE;
1390                         ++any;
1391                     }
1392                     uncurse(otmp);
1393                 }
1394             }
1395             if (any)
1396                 update_inventory();
1397             break;
1398         }
1399         case 5: {
1400             static NEARDATA const char msg[] =
1401 /*JP
1402                 "\"and thus I grant thee the gift of %s!\"";
1403 */
1404                 "\81u\82³\82ç\82É\93ð\82É%s\82ð\82³\82¸\82¯\82æ\82¤\81I\81v";
1405
1406             godvoice(u.ualign.type,
1407 /*JP
1408                      "Thou hast pleased me with thy progress,");
1409 */
1410                      "\93ð\82Ì\90¬\92·\82Í\94ñ\8fí\82É\96]\82Ü\82µ\82¢\81C");
1411             if (!(HTelepat & INTRINSIC)) {
1412                 HTelepat |= FROMOUTSIDE;
1413 /*JP
1414                 pline(msg, "Telepathy");
1415 */
1416                 pline(msg, "\83e\83\8c\83p\83V\81[");
1417                 if (Blind)
1418                     see_monsters();
1419             } else if (!(HFast & INTRINSIC)) {
1420                 HFast |= FROMOUTSIDE;
1421 /*JP
1422                 pline(msg, "Speed");
1423 */
1424                 pline(msg, "\91¬\82³");
1425             } else if (!(HStealth & INTRINSIC)) {
1426                 HStealth |= FROMOUTSIDE;
1427 /*JP
1428                 pline(msg, "Stealth");
1429 */
1430                 pline(msg, "\94E\82Ì\97Í");
1431             } else {
1432                 if (!(HProtection & INTRINSIC)) {
1433                     HProtection |= FROMOUTSIDE;
1434                     if (!u.ublessed)
1435                         u.ublessed = rn1(3, 2);
1436                 } else
1437                     u.ublessed++;
1438 /*JP
1439                 pline(msg, "my protection");
1440 */
1441                 pline(msg, "\89ä\82ª\8cì\82è");
1442             }
1443 /*JP
1444             verbalize("Use it wisely in my name!");
1445 */
1446             verbalize("\89ä\82ª\96¼\82É\89\97\82¢\82Ä\97L\8cø\82É\8eg\82¤\82ª\82æ\82¢\81I");
1447             break;
1448         }
1449         case 7:
1450         case 8:
1451             if (u.ualign.record >= PIOUS && !u.uevent.uhand_of_elbereth) {
1452                 gcrownu();
1453                 break;
1454             }
1455             /*FALLTHRU*/
1456         case 6: {
1457             struct obj *otmp;
1458             int sp_no, trycnt = u.ulevel + 1;
1459
1460             /* not yet known spells given preference over already known ones
1461              */
1462             /* Also, try to grant a spell for which there is a skill slot */
1463             otmp = mkobj(SPBOOK_CLASS, TRUE);
1464             while (--trycnt > 0) {
1465                 if (otmp->otyp != SPE_BLANK_PAPER) {
1466                     for (sp_no = 0; sp_no < MAXSPELL; sp_no++)
1467                         if (spl_book[sp_no].sp_id == otmp->otyp)
1468                             break;
1469                     if (sp_no == MAXSPELL
1470                         && !P_RESTRICTED(spell_skilltype(otmp->otyp)))
1471                         break; /* usable, but not yet known */
1472                 } else {
1473                     if (!objects[SPE_BLANK_PAPER].oc_name_known
1474                         || carrying(MAGIC_MARKER))
1475                         break;
1476                 }
1477                 otmp->otyp = rnd_class(bases[SPBOOK_CLASS], SPE_BLANK_PAPER);
1478             }
1479             bless(otmp);
1480 /*JP
1481             at_your_feet("A spellbook");
1482 */
1483             at_your_feet("\96\82\96@\8f\91");
1484             place_object(otmp, u.ux, u.uy);
1485             newsym(u.ux, u.uy);
1486             break;
1487         }
1488         default:
1489             impossible("Confused deity!");
1490             break;
1491         }
1492
1493     u.ublesscnt = rnz(350);
1494     kick_on_butt = u.uevent.udemigod ? 1 : 0;
1495     if (u.uevent.uhand_of_elbereth)
1496         kick_on_butt++;
1497     if (kick_on_butt)
1498         u.ublesscnt += kick_on_butt * rnz(1000);
1499
1500     return;
1501 }
1502
1503 /* either blesses or curses water on the altar,
1504  * returns true if it found any water here.
1505  */
1506 STATIC_OVL boolean
1507 water_prayer(bless_water)
1508 boolean bless_water;
1509 {
1510     register struct obj *otmp;
1511     register long changed = 0;
1512     boolean other = FALSE, bc_known = !(Blind || Hallucination);
1513
1514     for (otmp = level.objects[u.ux][u.uy]; otmp; otmp = otmp->nexthere) {
1515         /* turn water into (un)holy water */
1516         if (otmp->otyp == POT_WATER
1517             && (bless_water ? !otmp->blessed : !otmp->cursed)) {
1518             otmp->blessed = bless_water;
1519             otmp->cursed = !bless_water;
1520             otmp->bknown = bc_known;
1521             changed += otmp->quan;
1522         } else if (otmp->oclass == POTION_CLASS)
1523             other = TRUE;
1524     }
1525     if (!Blind && changed) {
1526 #if 0 /*JP*/
1527         pline("%s potion%s on the altar glow%s %s for a moment.",
1528               ((other && changed > 1L) ? "Some of the"
1529                                        : (other ? "One of the" : "The")),
1530               ((other || changed > 1L) ? "s" : ""), (changed > 1L ? "" : "s"),
1531               (bless_water ? hcolor(NH_LIGHT_BLUE) : hcolor(NH_BLACK)));
1532 #else
1533         pline("%s\8dÕ\92d\82Ì\96ò\82Í\88ê\8fu%s\8bP\82¢\82½\81D",
1534               (other && changed > 1L) ? "\82¢\82­\82Â\82©\82Ì"
1535                                       : "",
1536               jconj_adj(bless_water ? hcolor(NH_LIGHT_BLUE) : hcolor(NH_BLACK)));
1537 #endif
1538     }
1539     return (boolean) (changed > 0L);
1540 }
1541
1542 STATIC_OVL void
1543 godvoice(g_align, words)
1544 aligntyp g_align;
1545 const char *words;
1546 {
1547 #if 0 /*JP*/
1548     const char *quot = "";
1549
1550     if (words)
1551         quot = "\"";
1552     else
1553         words = "";
1554
1555     pline_The("voice of %s %s: %s%s%s", align_gname(g_align),
1556               godvoices[rn2(SIZE(godvoices))], quot, words, quot);
1557 #else
1558     if (words)
1559         pline("%s\82Ì\90º\82ª%s: \81u%s\81v", align_gname(g_align),
1560               godvoices[rn2(SIZE(godvoices))], words);
1561     else
1562         pline("%s\82Ì\90º\82ª%s\81F", align_gname(g_align),
1563               godvoices[rn2(SIZE(godvoices))]);
1564 #endif
1565 }
1566
1567 STATIC_OVL void
1568 gods_angry(g_align)
1569 aligntyp g_align;
1570 {
1571 /*JP
1572     godvoice(g_align, "Thou hast angered me.");
1573 */
1574     godvoice(g_align, "\93ð\81C\89ä\82ð\93{\82ç\82µ\82ß\82½\82è\81D");
1575 }
1576
1577 /* The g_align god is upset with you. */
1578 STATIC_OVL void
1579 gods_upset(g_align)
1580 aligntyp g_align;
1581 {
1582     if (g_align == u.ualign.type)
1583         u.ugangr++;
1584     else if (u.ugangr)
1585         u.ugangr--;
1586     angrygods(g_align);
1587 }
1588
1589 STATIC_OVL void
1590 consume_offering(otmp)
1591 register struct obj *otmp;
1592 {
1593     if (Hallucination)
1594         switch (rn2(3)) {
1595         case 0:
1596 /*JP
1597             Your("sacrifice sprouts wings and a propeller and roars away!");
1598 */
1599             Your("\8c£\8fã\95¨\82Í\89H\82ð\82Í\82â\82µ\81C\83v\83\8d\83y\83\89\82ª\82Ü\82í\82è\81C\94ò\82ñ\82Å\82Á\82½\81I");
1600             break;
1601         case 1:
1602 /*JP
1603             Your("sacrifice puffs up, swelling bigger and bigger, and pops!");
1604 */
1605             Your("\8c£\8fã\95¨\82Í\95¬\89\8c\82ð\82 \82°\81C\82Ç\82ñ\82Ç\82ñ\96c\82ê\81C\82»\82µ\82Ä\82Í\82\82¯\82½\81I");
1606             break;
1607         case 2:
1608             Your(
1609 /*JP
1610      "sacrifice collapses into a cloud of dancing particles and fades away!");
1611 */
1612      "\8c£\8fã\95¨\82Í\8d×\82©\82­\8dÓ\82¯\81C\97x\82è\8fo\82µ\81C\82Ç\82±\82©\82É\8ds\82Á\82Ä\82µ\82Ü\82Á\82½\81I");
1613             break;
1614         }
1615     else if (Blind && u.ualign.type == A_LAWFUL)
1616 /*JP
1617         Your("sacrifice disappears!");
1618 */
1619         Your("\8c£\8fã\95¨\82Í\8fÁ\82¦\82½\81I");
1620     else
1621 #if 0 /*JP*/
1622         Your("sacrifice is consumed in a %s!",
1623              u.ualign.type == A_LAWFUL ? "flash of light" : "burst of flame");
1624 #else
1625         Your("\8c£\8fã\95¨\82Í%s\8fÁ\82¦\82³\82Á\82½\81I",
1626              u.ualign.type == A_LAWFUL ? "\82Ü\82Î\82ä\82¢\8cõ\82ð\95ú\82¿" : "\89\8a\82ð\8fã\82°");
1627 #endif
1628     if (carried(otmp))
1629         useup(otmp);
1630     else
1631         useupf(otmp, 1L);
1632     exercise(A_WIS, TRUE);
1633 }
1634
1635 int
1636 dosacrifice()
1637 {
1638     static NEARDATA const char cloud_of_smoke[] =
1639 /*JP
1640         "A cloud of %s smoke surrounds you...";
1641 */
1642         "%s\89\8c\82ª\82 \82È\82½\82ð\8eæ\82è\88Í\82ñ\82¾\81D\81D\81D";
1643     register struct obj *otmp;
1644     int value = 0, pm;
1645     boolean highaltar;
1646     aligntyp altaralign = a_align(u.ux, u.uy);
1647
1648     if (!on_altar() || u.uswallow) {
1649 /*JP
1650         You("are not standing on an altar.");
1651 */
1652         You("\8dÕ\92d\82Ì\8fã\82É\97§\82Á\82Ä\82¢\82È\82¢\81D");
1653         return 0;
1654     }
1655     highaltar = ((Is_astralevel(&u.uz) || Is_sanctum(&u.uz))
1656                  && (levl[u.ux][u.uy].altarmask & AM_SHRINE));
1657
1658     otmp = floorfood("sacrifice", 1);
1659     if (!otmp)
1660         return 0;
1661     /*
1662      * Was based on nutritional value and aging behavior (< 50 moves).
1663      * Sacrificing a food ration got you max luck instantly, making the
1664      * gods as easy to please as an angry dog!
1665      *
1666      * Now only accepts corpses, based on the game's evaluation of their
1667      * toughness.  Human and pet sacrifice, as well as sacrificing unicorns
1668      * of your alignment, is strongly discouraged.
1669      */
1670 #define MAXVALUE 24 /* Highest corpse value (besides Wiz) */
1671
1672     if (otmp->otyp == CORPSE) {
1673         register struct permonst *ptr = &mons[otmp->corpsenm];
1674         struct monst *mtmp;
1675         extern const int monstr[];
1676
1677         /* KMH, conduct */
1678         u.uconduct.gnostic++;
1679
1680         /* you're handling this corpse, even if it was killed upon the altar
1681          */
1682         feel_cockatrice(otmp, TRUE);
1683         if (rider_corpse_revival(otmp, FALSE))
1684             return 1;
1685
1686         if (otmp->corpsenm == PM_ACID_BLOB
1687             || (monstermoves <= peek_at_iced_corpse_age(otmp) + 50)) {
1688             value = monstr[otmp->corpsenm] + 1;
1689             if (otmp->oeaten)
1690                 value = eaten_stat(value, otmp);
1691         }
1692
1693         if (your_race(ptr)) {
1694             if (is_demon(youmonst.data)) {
1695 /*JP
1696                 You("find the idea very satisfying.");
1697 */
1698                 You("\82»\82Ì\8dl\82¦\82Í\91f\90°\82µ\82¢\82Æ\8ev\82Á\82½\81D");
1699                 exercise(A_WIS, TRUE);
1700             } else if (u.ualign.type != A_CHAOTIC) {
1701 /*JP
1702                 pline("You'll regret this infamous offense!");
1703 */
1704                 pline("\93ð\81C\82±\82Ì\95\8e\90J\82Ì\8ds\82È\82¢\82ð\8cã\89÷\82·\82é\82×\82µ\81I");
1705                 exercise(A_WIS, FALSE);
1706             }
1707
1708             if (highaltar
1709                 && (altaralign != A_CHAOTIC || u.ualign.type != A_CHAOTIC)) {
1710                 goto desecrate_high_altar;
1711             } else if (altaralign != A_CHAOTIC && altaralign != A_NONE) {
1712                 /* curse the lawful/neutral altar */
1713 /*JP
1714                 pline_The("altar is stained with %s blood.", urace.adj);
1715 */
1716                 pline("\8dÕ\92d\82Í%s\82Ì\8c\8c\82Å\89\98\82ê\82Ä\82¢\82é\81D", urace.adj);
1717                 levl[u.ux][u.uy].altarmask = AM_CHAOTIC;
1718                 angry_priest();
1719             } else {
1720                 struct monst *dmon;
1721                 const char *demonless_msg;
1722
1723                 /* Human sacrifice on a chaotic or unaligned altar */
1724                 /* is equivalent to demon summoning */
1725                 if (altaralign == A_CHAOTIC && u.ualign.type != A_CHAOTIC) {
1726                     pline(
1727 /*JP
1728                     "The blood floods the altar, which vanishes in %s cloud!",
1729 */
1730                     "\8c\8c\82ª\8dÕ\92d\82©\82ç\82 \82Ó\82ê\81C\8dÕ\92d\82Í%s\89_\82Æ\82È\82è\8fÁ\82¦\82½\81I",
1731                           an(hcolor(NH_BLACK)));
1732                     levl[u.ux][u.uy].typ = ROOM;
1733                     levl[u.ux][u.uy].altarmask = 0;
1734                     newsym(u.ux, u.uy);
1735                     angry_priest();
1736 /*JP
1737                     demonless_msg = "cloud dissipates";
1738 */
1739                     demonless_msg = "\89_\82Í\8fÁ\82¦\82½\81D";
1740                 } else {
1741                     /* either you're chaotic or altar is Moloch's or both */
1742 /*JP
1743                     pline_The("blood covers the altar!");
1744 */
1745                     pline("\8c\8c\82ª\8dÕ\92d\82ð\95¢\82Á\82½\81I");
1746                     change_luck(altaralign == A_NONE ? -2 : 2);
1747 /*JP
1748                     demonless_msg = "blood coagulates";
1749 */
1750                     demonless_msg = "\8c\8c\82ª\82±\82Ñ\82è\82Â\82¢\82½";
1751                 }
1752                 if ((pm = dlord(altaralign)) != NON_PM
1753                     && (dmon = makemon(&mons[pm], u.ux, u.uy, NO_MM_FLAGS))
1754                            != 0) {
1755                     char dbuf[BUFSZ];
1756
1757                     Strcpy(dbuf, a_monnam(dmon));
1758 /*JP
1759                     if (!strcmpi(dbuf, "it"))
1760 */
1761                     if (!strcmpi(dbuf, "\89½\8eÒ\82©"))
1762 /*JP
1763                         Strcpy(dbuf, "something dreadful");
1764 */
1765                         Strcpy(dbuf, "\89½\82©\8b°\82ë\82µ\82¢\82à\82Ì");
1766                     else
1767                         dmon->mstrategy &= ~STRAT_APPEARMSG;
1768 /*JP
1769                     You("have summoned %s!", dbuf);
1770 */
1771                     You("%s\82ð\8f¢\8a«\82µ\82½\81I", dbuf);
1772                     if (sgn(u.ualign.type) == sgn(dmon->data->maligntyp))
1773                         dmon->mpeaceful = TRUE;
1774 /*JP
1775                     You("are terrified, and unable to move.");
1776 */
1777                     You("\8b°\95|\82Å\93®\82¯\82È\82­\82È\82Á\82½\81D");
1778                     nomul(-3);
1779 /*JP
1780                     multi_reason = "being terrified of a demon";
1781 */
1782                     multi_reason = "\88«\97ì\82É\8b°\95|\82µ\82Ä\82¢\82é\8e\9e\82É";
1783                     nomovemsg = 0;
1784                 } else
1785 /*JP
1786                     pline_The("%s.", demonless_msg);
1787 */
1788                     pline("%s\81D", demonless_msg);
1789             }
1790
1791             if (u.ualign.type != A_CHAOTIC) {
1792                 adjalign(-5);
1793                 u.ugangr += 3;
1794                 (void) adjattrib(A_WIS, -1, TRUE);
1795                 if (!Inhell)
1796                     angrygods(u.ualign.type);
1797                 change_luck(-5);
1798             } else
1799                 adjalign(5);
1800             if (carried(otmp))
1801                 useup(otmp);
1802             else
1803                 useupf(otmp, 1L);
1804             return 1;
1805         } else if (has_omonst(otmp)
1806                    && (mtmp = get_mtraits(otmp, FALSE)) != 0
1807                    && mtmp->mtame) {
1808                 /* mtmp is a temporary pointer to a tame monster's attributes,
1809                  * not a real monster */
1810 /*JP
1811             pline("So this is how you repay loyalty?");
1812 */
1813             pline("\82»\82ê\82Å\82±\82ê\82ª\82 \82È\82½\82Ì\92\89\8b`\82É\95ñ\82¢\82é\82à\82Ì\82©\81H");
1814             adjalign(-3);
1815             value = -1;
1816             HAggravate_monster |= FROMOUTSIDE;
1817         } else if (is_undead(ptr)) { /* Not demons--no demon corpses */
1818             if (u.ualign.type != A_CHAOTIC)
1819                 value += 1;
1820         } else if (is_unicorn(ptr)) {
1821             int unicalign = sgn(ptr->maligntyp);
1822
1823             if (unicalign == altaralign) {
1824                 /* When same as altar, always a very bad action.
1825                  */
1826 #if 0 /*JP*/
1827                 pline("Such an action is an insult to %s!",
1828                       (unicalign == A_CHAOTIC) ? "chaos"
1829                          : unicalign ? "law" : "balance");
1830 #else
1831                 pline("\82»\82Ì\82æ\82¤\82È\8ds\93®\82Í\81w%s\81x\82É\94½\82·\82é\81I",
1832                       (unicalign == A_CHAOTIC) ? "\8d¬\93×"
1833                          : unicalign ? "\92\81\8f\98" : "\92²\98a");
1834 #endif
1835                 (void) adjattrib(A_WIS, -1, TRUE);
1836                 value = -5;
1837             } else if (u.ualign.type == altaralign) {
1838                 /* When different from altar, and altar is same as yours,
1839                  * it's a very good action.
1840                  */
1841                 if (u.ualign.record < ALIGNLIM)
1842 /*JP
1843                     You_feel("appropriately %s.", align_str(u.ualign.type));
1844 */
1845                     You("%s\82É\82Ó\82³\82í\82µ\82¢\82Æ\8a´\82\82½\81D", align_str(u.ualign.type));
1846                 else
1847 /*JP
1848                     You_feel("you are thoroughly on the right path.");
1849 */
1850                     You("\8a®\91S\82É\90³\82µ\82¢\93¹\82ð\95à\82ñ\82Å\82¢\82é\82Ì\82ð\8a´\82\82½\81D");
1851                 adjalign(5);
1852                 value += 3;
1853             } else if (unicalign == u.ualign.type) {
1854                 /* When sacrificing unicorn of your alignment to altar not of
1855                  * your alignment, your god gets angry and it's a conversion.
1856                  */
1857                 u.ualign.record = -1;
1858                 value = 1;
1859             } else {
1860                 /* Otherwise, unicorn's alignment is different from yours
1861                  * and different from the altar's.  It's an ordinary (well,
1862                  * with a bonus) sacrifice on a cross-aligned altar.
1863                  */
1864                 value += 3;
1865             }
1866         }
1867     } /* corpse */
1868
1869     if (otmp->otyp == AMULET_OF_YENDOR) {
1870         if (!highaltar) {
1871         too_soon:
1872             if (altaralign == A_NONE && Inhell)
1873                 /* hero has left Moloch's Sanctum so is in the process
1874                    of getting away with the Amulet (outside of Gehennom,
1875                    fall through to the "ashamed" feedback) */
1876                 gods_upset(A_NONE);
1877             else
1878 #if 0 /*JP*/
1879                 You_feel("%s.",
1880                          Hallucination
1881                             ? "homesick"
1882                             /* if on track, give a big hint */
1883                             : (altaralign == u.ualign.type)
1884                                ? "an urge to return to the surface"
1885                                /* else headed towards celestial disgrace */
1886                                : "ashamed");
1887 #else
1888                 You_feel("%s\81D",
1889                          Hallucination
1890                             ? "\8cÌ\8b½\82ª\97ö\82µ\82­\82È\82Á\82½"
1891                             /* if on track, give a big hint */
1892                             : (altaralign == u.ualign.type)
1893                                ? "\92n\8fã\82É\8bA\82è\82½\82¢\8bC\8e\9d\82É\8bì\82è\97§\82Ä\82ç\82ê\82½"
1894                                /* else headed towards celestial disgrace */
1895                                : "\92p\82¸\82©\82µ\82¢\8ev\82¢\82ª\82µ\82½");
1896 #endif
1897             return 1;
1898         } else {
1899             /* The final Test.  Did you win? */
1900             if (uamul == otmp)
1901                 Amulet_off();
1902             u.uevent.ascended = 1;
1903             if (carried(otmp))
1904                 useup(otmp); /* well, it's gone now */
1905             else
1906                 useupf(otmp, 1L);
1907 /*JP
1908             You("offer the Amulet of Yendor to %s...", a_gname());
1909 */
1910             You("\83C\83F\83\93\83_\81[\82Ì\96\82\8f\9c\82¯\82ð%s\82É\8c£\8fã\82µ\82½\81D\81D\81D",a_gname());
1911             if (altaralign == A_NONE) {
1912                 /* Moloch's high altar */
1913                 if (u.ualign.record > -99)
1914                     u.ualign.record = -99;
1915                 /*[apparently shrug/snarl can be sensed without being seen]*/
1916 #if 0 /*JP*/
1917                 pline("%s shrugs and retains dominion over %s,", Moloch,
1918                       u_gname());
1919 #else
1920                 pline("%s\82Í\8c¨\82ð\82·\82­\82ß\81C%s\82É\91Î\82·\82é\97D\90¨\82ð\88Û\8e\9d\82µ\82½\81D", Moloch,
1921                       u_gname());
1922 #endif
1923 /*JP
1924                 pline("then mercilessly snuffs out your life.");
1925 */
1926                 pline("\82»\82µ\82Ä\96³\8e\9c\94ß\82É\82 \82È\82½\82Ì\96½\82ð\92D\82Á\82½\81D");
1927 /*JP
1928 */
1929 #if 0 /*JP*/
1930                 Sprintf(killer.name, "%s indifference", s_suffix(Moloch));
1931 #else
1932                 Sprintf(killer.name, "\97â\92W\82È%s", Moloch);
1933 #endif
1934                 killer.format = KILLED_BY;
1935                 done(DIED);
1936                 /* life-saved (or declined to die in wizard/explore mode) */
1937 /*JP
1938                 pline("%s snarls and tries again...", Moloch);
1939 */
1940                 pline("%s\82Í\82Ì\82Ì\82µ\82è\81C\82à\82¤\88ê\93x\8e\8e\82µ\82½\81D\81D\81D", Moloch);
1941                 fry_by_god(A_NONE, TRUE); /* wrath of Moloch */
1942                 /* declined to die in wizard or explore mode */
1943                 pline(cloud_of_smoke, hcolor(NH_BLACK));
1944                 done(ESCAPED);
1945             } else if (u.ualign.type != altaralign) {
1946                 /* And the opposing team picks you up and
1947                    carries you off on their shoulders */
1948                 adjalign(-99);
1949 #if 0 /*JP*/
1950                 pline("%s accepts your gift, and gains dominion over %s...",
1951                       a_gname(), u_gname());
1952 #else
1953                 pline("%s\82Í\82 \82È\82½\82Ì\91\97\82è\95¨\82ð\8eó\82¯\82Æ\82è\81C%s\82Ì\8c \97Í\82ð\93¾\82½\81D\81D\81D",
1954                       a_gname(), u_gname());
1955 #endif
1956 /*JP
1957                 pline("%s is enraged...", u_gname());
1958 */
1959                 pline("%s\82Í\8c\83\93{\82µ\82½\81D\81D\81D", u_gname());
1960 /*JP
1961                 pline("Fortunately, %s permits you to live...", a_gname());
1962 */
1963                 pline("\8dK\89^\82É\82à\81C%s\82Í\82 \82È\82½\82Ì\91\8dÝ\82ð\8b\96\82µ\82Ä\82¢\82é\81D\81D\81D",a_gname());
1964                 pline(cloud_of_smoke, hcolor(NH_ORANGE));
1965                 done(ESCAPED);
1966             } else { /* super big win */
1967                 adjalign(10);
1968                 u.uachieve.ascended = 1;
1969                 pline(
1970 /*JP
1971                "An invisible choir sings, and you are bathed in radiance...");
1972 */
1973                 "\82Ç\82±\82©\82ç\82Æ\82à\82È\82­\90¹\89Ì\91à\82Ì\89Ì\82ª\95·\82±\82¦\81C\82 \82È\82½\82Í\8cõ\82É\95ï\82Ü\82ê\82½\81D\81D\81D");
1974 /*JP
1975                 godvoice(altaralign, "Mortal, thou hast done well!");
1976 */
1977                 godvoice(altaralign, "\92è\96½\82Ì\8eÒ\82æ\81C\82æ\82­\82â\82Á\82½\81I");
1978                 display_nhwindow(WIN_MESSAGE, FALSE);
1979                 verbalize(
1980 /*JP
1981           "In return for thy service, I grant thee the gift of Immortality!");
1982 */
1983           "\93ð\82Ì\88Ì\8bÆ\82É\91Î\82µ\81C\95s\8e\80\82Ì\91Ì\82ð\8eö\82¯\82æ\82¤\82¼\81I");
1984 #if 0 /*JP*/
1985                 You("ascend to the status of Demigod%s...",
1986                     flags.female ? "dess" : "");
1987 #else
1988                 You("\8f¸\93V\82µ\81C%s\90_\82Æ\82È\82Á\82½\81D\81D\81D",
1989                     flags.female ? "\8f\97" : "");
1990 #endif
1991                 done(ASCENDED);
1992             }
1993         }
1994     } /* real Amulet */
1995
1996     if (otmp->otyp == FAKE_AMULET_OF_YENDOR) {
1997         if (!highaltar && !otmp->known)
1998             goto too_soon;
1999 /*JP
2000         You_hear("a nearby thunderclap.");
2001 */
2002         You("\8bß\82­\82É\97\8b\82ª\97\8e\82¿\82½\89¹\82ð\95·\82¢\82½\81D");
2003         if (!otmp->known) {
2004 #if 0 /*JP*/
2005             You("realize you have made a %s.",
2006                 Hallucination ? "boo-boo" : "mistake");
2007 #else
2008             You("%s\82±\82Æ\82É\8bC\82ª\82Â\82¢\82½\81D",
2009                 Hallucination ? "\81u\83n\83Y\83\8c\81v\82¾\82Á\82½" : "\8aÔ\88á\82¢\82ð\94Æ\82µ\82½");
2010 #endif
2011             otmp->known = TRUE;
2012             change_luck(-1);
2013             return 1;
2014         } else {
2015             /* don't you dare try to fool the gods */
2016             if (Deaf)
2017 #if 0 /*JP*/
2018                 pline("Oh, no."); /* didn't hear thunderclap */
2019 #else
2020                 pline("\82È\82ñ\82Ä\82±\82Á\82½\81D"); /* didn't hear thunderclap */
2021 #endif
2022             change_luck(-3);
2023             adjalign(-1);
2024             u.ugangr += 3;
2025             value = -3;
2026         }
2027     } /* fake Amulet */
2028
2029     if (value == 0) {
2030         pline1(nothing_happens);
2031         return 1;
2032     }
2033
2034     if (altaralign != u.ualign.type && highaltar) {
2035     desecrate_high_altar:
2036         /*
2037          * REAL BAD NEWS!!! High altars cannot be converted.  Even an attempt
2038          * gets the god who owns it truly pissed off.
2039          */
2040 /*JP
2041         You_feel("the air around you grow charged...");
2042 */
2043         You("\89ñ\82è\82Ì\8bó\8bC\82É\83G\83l\83\8b\83M\81[\82ª\96\9e\82¿\82Ä\82¢\82­\82æ\82¤\82È\8bC\82ª\82µ\82½\81D\81D\81D");
2044 /*JP
2045         pline("Suddenly, you realize that %s has noticed you...", a_gname());
2046 */
2047         pline("\93Ë\91R\81C%s\82ª\82 \82È\82½\82ð\82\82Á\82Æ\8c©\82Ä\82¢\82é\82Ì\82É\8bC\82ª\82Â\82¢\82½\81D\81D\81D",a_gname());
2048         godvoice(altaralign,
2049 /*JP
2050                  "So, mortal!  You dare desecrate my High Temple!");
2051 */
2052                  "\92è\96½\82Ì\8eÒ\82æ\81I\82¨\82Ü\82¦\82Í\89ä\82ª\90_\90¹\82È\82é\8e\9b\89@\82ð\89\98\82·\82Ì\82©\81I");
2053         /* Throw everything we have at the player */
2054         god_zaps_you(altaralign);
2055     } else if (value
2056                < 0) { /* I don't think the gods are gonna like this... */
2057         gods_upset(altaralign);
2058     } else {
2059         int saved_anger = u.ugangr;
2060         int saved_cnt = u.ublesscnt;
2061         int saved_luck = u.uluck;
2062
2063         /* Sacrificing at an altar of a different alignment */
2064         if (u.ualign.type != altaralign) {
2065             /* Is this a conversion ? */
2066             /* An unaligned altar in Gehennom will always elicit rejection. */
2067             if (ugod_is_angry() || (altaralign == A_NONE && Inhell)) {
2068                 if (u.ualignbase[A_CURRENT] == u.ualignbase[A_ORIGINAL]
2069                     && altaralign != A_NONE) {
2070 /*JP
2071                     You("have a strong feeling that %s is angry...",
2072 */
2073                     You("%s\82ª\93{\82Á\82Ä\82¢\82é\82Ì\82ð\8am\90M\82µ\82½\81D\81D\81D",
2074                         u_gname());
2075                     consume_offering(otmp);
2076 /*JP
2077                     pline("%s accepts your allegiance.", a_gname());
2078 */
2079                     pline("%s\82Í\82 \82È\82½\82Ì\91®\90«\82ð\8eó\82¯\82¢\82ê\82½\81D", a_gname());
2080
2081                     uchangealign(altaralign, 0);
2082                     /* Beware, Conversion is costly */
2083                     change_luck(-3);
2084                     u.ublesscnt += 300;
2085                 } else {
2086                     u.ugangr += 3;
2087                     adjalign(-5);
2088 /*JP
2089                     pline("%s rejects your sacrifice!", a_gname());
2090 */
2091                     pline("%s\82Í\82 \82È\82½\82Ì\8c£\8fã\95¨\82ð\8eó\82¯\82¢\82ê\82È\82¢\81I", a_gname());
2092 /*JP
2093                     godvoice(altaralign, "Suffer, infidel!");
2094 */
2095                     godvoice(altaralign, "\88Ù\92[\8eÒ\82æ\81I\8e¸\82¹\82ë\81I\81I");
2096                     change_luck(-5);
2097                     (void) adjattrib(A_WIS, -2, TRUE);
2098                     if (!Inhell)
2099                         angrygods(u.ualign.type);
2100                 }
2101                 return 1;
2102             } else {
2103                 consume_offering(otmp);
2104 #if 0 /*JP*/
2105                 You("sense a conflict between %s and %s.", u_gname(),
2106                     a_gname());
2107 #else
2108                 You("%s\82Æ%s\8aÔ\82Ì\91\88\82¢\82ð\8a´\82\82½\81D", u_gname(),
2109                     a_gname());
2110 #endif
2111                 if (rn2(8 + u.ulevel) > 5) {
2112                     struct monst *pri;
2113 /*JP
2114                     You_feel("the power of %s increase.", u_gname());
2115 */
2116                     You("%s\82Ì\97Í\82ª\91\9d\91å\82µ\82½\82æ\82¤\82È\8bC\82ª\82µ\82½\81D", u_gname());
2117                     exercise(A_WIS, TRUE);
2118                     change_luck(1);
2119                     /* Yes, this is supposed to be &=, not |= */
2120                     levl[u.ux][u.uy].altarmask &= AM_SHRINE;
2121                     /* the following accommodates stupid compilers */
2122                     levl[u.ux][u.uy].altarmask =
2123                         levl[u.ux][u.uy].altarmask
2124                         | (Align2amask(u.ualign.type));
2125                     if (!Blind)
2126 #if 0 /*JP*/
2127                         pline_The("altar glows %s.",
2128                                   hcolor((u.ualign.type == A_LAWFUL)
2129                                             ? NH_WHITE
2130                                             : u.ualign.type
2131                                                ? NH_BLACK
2132                                                : (const char *) "gray"));
2133 #else
2134                         pline("\8dÕ\92d\82Í%s\8bP\82¢\82½\81D",
2135                               jconj_adj(hcolor((u.ualign.type == A_LAWFUL)
2136                                             ? NH_WHITE
2137                                             : u.ualign.type
2138                                                ? NH_BLACK
2139                                                : (const char *)"\8aD\90F\82Ì")));
2140 #endif
2141
2142                     if (rnl(u.ulevel) > 6 && u.ualign.record > 0
2143                         && rnd(u.ualign.record) > (3 * ALIGNLIM) / 4)
2144                         summon_minion(altaralign, TRUE);
2145                     /* anger priest; test handles bones files */
2146                     if ((pri = findpriest(temple_occupied(u.urooms)))
2147                         && !p_coaligned(pri))
2148                         angry_priest();
2149                 } else {
2150 /*JP
2151                     pline("Unluckily, you feel the power of %s decrease.",
2152 */
2153                     pline("\95s\8dK\82É\82à\81C%s\82Ì\97Í\82ª\8c¸\8f­\82µ\82½\82Ì\82ð\8a´\82\82½\81D",
2154                           u_gname());
2155                     change_luck(-1);
2156                     exercise(A_WIS, FALSE);
2157                     if (rnl(u.ulevel) > 6 && u.ualign.record > 0
2158                         && rnd(u.ualign.record) > (7 * ALIGNLIM) / 8)
2159                         summon_minion(altaralign, TRUE);
2160                 }
2161                 return 1;
2162             }
2163         }
2164
2165         consume_offering(otmp);
2166         /* OK, you get brownie points. */
2167         if (u.ugangr) {
2168             u.ugangr -= ((value * (u.ualign.type == A_CHAOTIC ? 2 : 3))
2169                          / MAXVALUE);
2170             if (u.ugangr < 0)
2171                 u.ugangr = 0;
2172             if (u.ugangr != saved_anger) {
2173                 if (u.ugangr) {
2174 #if 0 /*JP*/
2175                     pline("%s seems %s.", u_gname(),
2176                           Hallucination ? "groovy" : "slightly mollified");
2177 #else
2178                     pline("%s\82Í%s\82É\8c©\82¦\82é\81D", u_gname(),
2179                           Hallucination ? "\91f\93G" : "\82¿\82å\82Á\82Æ\98a\82ç\82¢\82¾\82æ\82¤");
2180 #endif
2181
2182                     if ((int) u.uluck < 0)
2183                         change_luck(1);
2184                 } else {
2185 #if 0 /*JP*/
2186                     pline("%s seems %s.", u_gname(),
2187                           Hallucination ? "cosmic (not a new fact)"
2188                                         : "mollified");
2189 #else
2190                     pline("%s\82Í%s\82É\8c©\82¦\82é\81D", u_gname(),
2191                           Hallucination ? "\93ø\90F(\90V\8e\96\8eÀ\82Å\82Í\82È\82¢)"
2192                                         : "\8cy\95Ì\82µ\82½\82æ\82¤");
2193 #endif
2194
2195                     if ((int) u.uluck < 0)
2196                         u.uluck = 0;
2197                 }
2198             } else { /* not satisfied yet */
2199                 if (Hallucination)
2200 /*JP
2201                     pline_The("gods seem tall.");
2202 */
2203                     pline("\90_\82Í\82¨\8d\82\82­\82Æ\82Ü\82Á\82Ä\82¢\82é\82æ\82¤\82É\8c©\82¦\82é\81D");
2204                 else
2205 /*JP
2206                     You("have a feeling of inadequacy.");
2207 */
2208                     You("\82Ü\82¾\82Ü\82¾\82¾\82Æ\8a´\82\82½\81D");
2209             }
2210         } else if (ugod_is_angry()) {
2211             if (value > MAXVALUE)
2212                 value = MAXVALUE;
2213             if (value > -u.ualign.record)
2214                 value = -u.ualign.record;
2215             adjalign(value);
2216 /*JP
2217             You_feel("partially absolved.");
2218 */
2219             You("\8f­\82µ\82¾\82¯\82ä\82é\82µ\82Ä\82à\82ç\82¦\82½\82æ\82¤\82È\8bC\82ª\82µ\82½\81D");
2220         } else if (u.ublesscnt > 0) {
2221             u.ublesscnt -= ((value * (u.ualign.type == A_CHAOTIC ? 500 : 300))
2222                             / MAXVALUE);
2223             if (u.ublesscnt < 0)
2224                 u.ublesscnt = 0;
2225             if (u.ublesscnt != saved_cnt) {
2226                 if (u.ublesscnt) {
2227                     if (Hallucination)
2228 /*JP
2229                         You("realize that the gods are not like you and I.");
2230 */
2231                         You("\90_\82Æ\83c\81[\83J\81[\82Ì\92\87\82Å\82Í\82È\82¢\82±\82Æ\82ð\8cå\82Á\82½\81D");
2232                     else
2233 /*JP
2234                         You("have a hopeful feeling.");
2235 */
2236                         pline("\8aó\96]\82ª\8c©\82¦\82Ä\82«\82½\82æ\82¤\82È\8bC\82ª\82µ\82½\81D");
2237                     if ((int) u.uluck < 0)
2238                         change_luck(1);
2239                 } else {
2240                     if (Hallucination)
2241 /*JP
2242                         pline("Overall, there is a smell of fried onions.");
2243 */
2244                         pline("\82½\82Ü\82Ë\82¬\82ð\97g\82°\82½\93õ\82¢\82ª\82µ\82½\81D");
2245                     else
2246 /*JP
2247                         You("have a feeling of reconciliation.");
2248 */
2249                         You("\8b\96\82³\82ê\82½\8bC\82ª\82µ\82½\81D");
2250                     if ((int) u.uluck < 0)
2251                         u.uluck = 0;
2252                 }
2253             }
2254         } else {
2255             int nartifacts = nartifact_exist();
2256
2257             /* you were already in pretty good standing */
2258             /* The player can gain an artifact */
2259             /* The chance goes down as the number of artifacts goes up */
2260             if (u.ulevel > 2 && u.uluck >= 0
2261                 && !rn2(10 + (2 * u.ugifts * nartifacts))) {
2262                 otmp = mk_artifact((struct obj *) 0, a_align(u.ux, u.uy));
2263                 if (otmp) {
2264                     if (otmp->spe < 0)
2265                         otmp->spe = 0;
2266                     if (otmp->cursed)
2267                         uncurse(otmp);
2268                     otmp->oerodeproof = TRUE;
2269 /*JP
2270                     at_your_feet("An object");
2271 */
2272                     at_your_feet("\89½\82©");
2273                     dropy(otmp);
2274 /*JP
2275                     godvoice(u.ualign.type, "Use my gift wisely!");
2276 */
2277                     godvoice(u.ualign.type, "\89ä\82ª\97^\82¦\82µ\82à\82Ì\8c«\82­\8eg\82¤\82×\82µ\81I");
2278                     u.ugifts++;
2279                     u.ublesscnt = rnz(300 + (50 * nartifacts));
2280                     exercise(A_WIS, TRUE);
2281                     /* make sure we can use this weapon */
2282                     unrestrict_weapon_skill(weapon_type(otmp));
2283                     if (!Hallucination && !Blind) {
2284                         otmp->dknown = 1;
2285                         makeknown(otmp->otyp);
2286                         discover_artifact(otmp->oartifact);
2287                     }
2288                     return 1;
2289                 }
2290             }
2291             change_luck((value * LUCKMAX) / (MAXVALUE * 2));
2292             if ((int) u.uluck < 0)
2293                 u.uluck = 0;
2294             if (u.uluck != saved_luck) {
2295                 if (Blind)
2296 #if 0 /*JP*/
2297                     You("think %s brushed your %s.", something,
2298                         body_part(FOOT));
2299 #else
2300                     pline("%s\82ª\82 \82È\82½\82Ì%s\82ð\82­\82·\82®\82Á\82½\82æ\82¤\82¾\81D", something,
2301                           body_part(FOOT));
2302 #endif
2303                 else
2304 #if 0 /*JP*/
2305                     You(Hallucination
2306                     ? "see crabgrass at your %s.  A funny thing in a dungeon."
2307                             : "glimpse a four-leaf clover at your %s.",
2308                         makeplural(body_part(FOOT)));
2309 #else
2310                     You(Hallucination
2311                     ? "\91«\8c³\82É\83y\83\93\83y\83\93\91\90\82ð\82Ý\82Â\82¯\82½\81D\96À\8b{\82É\82µ\82Ä\82Í\92¿\82µ\82¢\81D"
2312                             : "\8el\97t\82Ì\83N\83\8d\81[\83o\81[\82ð\91«\8c³\82É\8c©\82Â\82¯\82½\81D");
2313 #endif
2314             }
2315         }
2316     }
2317     return 1;
2318 }
2319
2320 /* determine prayer results in advance; also used for enlightenment */
2321 boolean
2322 can_pray(praying)
2323 boolean praying; /* false means no messages should be given */
2324 {
2325     int alignment;
2326
2327     p_aligntyp = on_altar() ? a_align(u.ux, u.uy) : u.ualign.type;
2328     p_trouble = in_trouble();
2329
2330     if (is_demon(youmonst.data) && (p_aligntyp != A_CHAOTIC)) {
2331         if (praying)
2332 #if 0 /*JP*/
2333             pline_The("very idea of praying to a %s god is repugnant to you.",
2334                       p_aligntyp ? "lawful" : "neutral");
2335 #else
2336             pline("%s\82Ì\90_\82É\8bF\82è\82ð\82³\82³\82°\82é\82Ì\82Í\8fí\8e¯\82É\94w\82­\81D",
2337                 p_aligntyp ? "\92\81\8f\98" : "\92\86\97§");
2338 #endif
2339         return FALSE;
2340     }
2341
2342     if (praying)
2343 /*JP
2344         You("begin praying to %s.", align_gname(p_aligntyp));
2345 */
2346         You("%s\82É\8bF\82è\82ð\95ù\82°\82½\81D", align_gname(p_aligntyp));
2347
2348     if (u.ualign.type && u.ualign.type == -p_aligntyp)
2349         alignment = -u.ualign.record; /* Opposite alignment altar */
2350     else if (u.ualign.type != p_aligntyp)
2351         alignment = u.ualign.record / 2; /* Different alignment altar */
2352     else
2353         alignment = u.ualign.record;
2354
2355     if ((p_trouble > 0) ? (u.ublesscnt > 200)      /* big trouble */
2356            : (p_trouble < 0) ? (u.ublesscnt > 100) /* minor difficulties */
2357               : (u.ublesscnt > 0))                 /* not in trouble */
2358         p_type = 0;                     /* too soon... */
2359     else if ((int) Luck < 0 || u.ugangr || alignment < 0)
2360         p_type = 1; /* too naughty... */
2361     else /* alignment >= 0 */ {
2362         if (on_altar() && u.ualign.type != p_aligntyp)
2363             p_type = 2;
2364         else
2365             p_type = 3;
2366     }
2367
2368     if (is_undead(youmonst.data) && !Inhell
2369         && (p_aligntyp == A_LAWFUL || (p_aligntyp == A_NEUTRAL && !rn2(10))))
2370         p_type = -1;
2371     /* Note:  when !praying, the random factor for neutrals makes the
2372        return value a non-deterministic approximation for enlightenment.
2373        This case should be uncommon enough to live with... */
2374
2375     return !praying ? (boolean) (p_type == 3 && !Inhell) : TRUE;
2376 }
2377
2378 /* #pray commmand */
2379 int
2380 dopray()
2381 {
2382     /* Confirm accidental slips of Alt-P */
2383 /*JP
2384     if (ParanoidPray && yn("Are you sure you want to pray?") != 'y')
2385 */
2386     if (ParanoidPray && yn("\8bF\82è\82Ü\82·\82©\81H") != 'y')
2387         return 0;
2388
2389     u.uconduct.gnostic++;
2390
2391     /* set up p_type and p_alignment */
2392     if (!can_pray(TRUE))
2393         return 0;
2394
2395     if (wizard && p_type >= 0) {
2396 /*JP
2397         if (yn("Force the gods to be pleased?") == 'y') {
2398 */
2399         if (yn("\96³\97\9d\96î\97\9d\90_\82É\94÷\8fÎ\82ñ\82Å\82à\82ç\82¢\82Ü\82·\82©\81H") == 'y') {
2400             u.ublesscnt = 0;
2401             if (u.uluck < 0)
2402                 u.uluck = 0;
2403             if (u.ualign.record <= 0)
2404                 u.ualign.record = 1;
2405             u.ugangr = 0;
2406             if (p_type < 2)
2407                 p_type = 3;
2408         }
2409     }
2410     nomul(-3);
2411 /*JP
2412     multi_reason = "praying";
2413 */
2414     multi_reason = "\8bF\82Á\82Ä\82¢\82é\8e\9e\82É";
2415 /*JP
2416     nomovemsg = "You finish your prayer.";
2417 */
2418     nomovemsg = "\8bF\82è\8fI\82¦\82½\81D";
2419     afternmv = prayer_done;
2420
2421     if (p_type == 3 && !Inhell) {
2422         /* if you've been true to your god you can't die while you pray */
2423         if (!Blind)
2424 /*JP
2425             You("are surrounded by a shimmering light.");
2426 */
2427             You("\82©\82·\82©\82È\8cõ\82É\82Â\82Â\82Ü\82ê\82½\81D");
2428         u.uinvulnerable = TRUE;
2429     }
2430
2431     return 1;
2432 }
2433
2434 STATIC_PTR int
2435 prayer_done() /* M. Stephenson (1.0.3b) */
2436 {
2437     aligntyp alignment = p_aligntyp;
2438
2439     u.uinvulnerable = FALSE;
2440     if (p_type == -1) {
2441 #if 0 /*JP*/
2442         godvoice(alignment,
2443                  (alignment == A_LAWFUL)
2444                     ? "Vile creature, thou durst call upon me?"
2445                     : "Walk no more, perversion of nature!");
2446 #else
2447         godvoice(alignment,
2448                  (alignment == A_LAWFUL)
2449                     ? "\94Ú\97ò\82È\90\95¨\82æ\81C\93ð\81C\89ä\82É\8bF\82è\82ð\8b\81\82ß\82½\82©\81H"
2450                     : "\93®\82­\82È\81I\8e\80\82É\82¼\82±\82È\82¢\82Ì\90\95¨\82æ\81I");
2451 #endif
2452 /*JP
2453         You_feel("like you are falling apart.");
2454 */
2455         You("\83o\83\89\83o\83\89\82É\82È\82Á\82½\82æ\82¤\82È\8bC\82ª\82µ\82½\81D");
2456         /* KMH -- Gods have mastery over unchanging */
2457         rehumanize();
2458         /* no Half_physical_damage adjustment here */
2459 /*JP
2460         losehp(rnd(20), "residual undead turning effect", KILLED_BY_AN);
2461 */
2462         losehp(rnd(20), "\95s\8e\80\82Ì\90\95¨\82ð\93y\82É\95Ô\82·\97Í\82Å", KILLED_BY_AN);
2463         exercise(A_CON, FALSE);
2464         return 1;
2465     }
2466     if (Inhell) {
2467 /*JP
2468         pline("Since you are in Gehennom, %s won't help you.",
2469 */
2470         pline("\83Q\83w\83i\82É%s\82Ì\97Í\82Í\93Í\82©\82È\82¢\81D",
2471               align_gname(alignment));
2472         /* haltingly aligned is least likely to anger */
2473         if (u.ualign.record <= 0 || rnl(u.ualign.record))
2474             angrygods(u.ualign.type);
2475         return 0;
2476     }
2477
2478     if (p_type == 0) {
2479         if (on_altar() && u.ualign.type != alignment)
2480             (void) water_prayer(FALSE);
2481         u.ublesscnt += rnz(250);
2482         change_luck(-3);
2483         gods_upset(u.ualign.type);
2484     } else if (p_type == 1) {
2485         if (on_altar() && u.ualign.type != alignment)
2486             (void) water_prayer(FALSE);
2487         angrygods(u.ualign.type); /* naughty */
2488     } else if (p_type == 2) {
2489         if (water_prayer(FALSE)) {
2490             /* attempted water prayer on a non-coaligned altar */
2491             u.ublesscnt += rnz(250);
2492             change_luck(-3);
2493             gods_upset(u.ualign.type);
2494         } else
2495             pleased(alignment);
2496     } else {
2497         /* coaligned */
2498         if (on_altar())
2499             (void) water_prayer(TRUE);
2500         pleased(alignment); /* nice */
2501     }
2502     return 1;
2503 }
2504
2505 /* #turn command */
2506 int
2507 doturn()
2508 {
2509     /* Knights & Priest(esse)s only please */
2510     struct monst *mtmp, *mtmp2;
2511     int once, range, xlev;
2512
2513     if (!Role_if(PM_PRIEST) && !Role_if(PM_KNIGHT)) {
2514         /* Try to use the "turn undead" spell.
2515          *
2516          * This used to be based on whether hero knows the name of the
2517          * turn undead spellbook, but it's possible to know--and be able
2518          * to cast--the spell while having lost the book ID to amnesia.
2519          * (It also used to tell spelleffects() to cast at self?)
2520          */
2521         int sp_no;
2522
2523         for (sp_no = 0; sp_no < MAXSPELL; ++sp_no) {
2524             if (spl_book[sp_no].sp_id == NO_SPELL)
2525                 break;
2526             else if (spl_book[sp_no].sp_id == SPE_TURN_UNDEAD)
2527                 return spelleffects(sp_no, FALSE);
2528         }
2529 /*JP
2530         You("don't know how to turn undead!");
2531 */
2532         You("\95s\8e\80\82Ì\90\82«\95¨\82ð\93y\82É\96ß\82·\95û\96@\82ð\92m\82ç\82È\82¢\81I");
2533         return 0;
2534     }
2535     u.uconduct.gnostic++;
2536
2537     if ((u.ualign.type != A_CHAOTIC
2538          && (is_demon(youmonst.data) || is_undead(youmonst.data)))
2539         || u.ugangr > 6) { /* "Die, mortal!" */
2540 /*JP
2541         pline("For some reason, %s seems to ignore you.", u_gname());
2542 */
2543         pline("\82È\82º\82©\81C%s\82Í\82 \82È\82½\82ð\96³\8e\8b\82µ\82½\82æ\82¤\82¾\81D", u_gname());
2544         aggravate();
2545         exercise(A_WIS, FALSE);
2546         return 0;
2547     }
2548     if (Inhell) {
2549 /*JP
2550         pline("Since you are in Gehennom, %s won't help you.", u_gname());
2551 */
2552         pline("\83Q\83w\83i\82É%s\82Ì\97Í\82Í\93Í\82©\82È\82¢\81D", u_gname());
2553         aggravate();
2554         return 0;
2555     }
2556 /*JP
2557     pline("Calling upon %s, you chant an arcane formula.", u_gname());
2558 */
2559     pline("%s\82É\8bF\82è\82ð\8b\81\82ß\82é\82Æ\81C\82 \82È\82½\82Í\95s\89Â\8ev\8bc\82È\8c¾\97t\82Ì\90¹\89Ì\82ð\95·\82¢\82½\81D", u_gname());
2560     exercise(A_WIS, TRUE);
2561
2562     /* note: does not perform unturn_dead() on victims' inventories */
2563     range = BOLT_LIM + (u.ulevel / 5); /* 5 to 11 */
2564     range *= range;
2565     once = 0;
2566     for (mtmp = fmon; mtmp; mtmp = mtmp2) {
2567         mtmp2 = mtmp->nmon;
2568
2569         if (DEADMONSTER(mtmp))
2570             continue;
2571         if (!cansee(mtmp->mx, mtmp->my) || distu(mtmp->mx, mtmp->my) > range)
2572             continue;
2573
2574         if (!mtmp->mpeaceful
2575             && (is_undead(mtmp->data) || is_vampshifter(mtmp)
2576                 || (is_demon(mtmp->data) && (u.ulevel > (MAXULEV / 2))))) {
2577             mtmp->msleeping = 0;
2578             if (Confusion) {
2579                 if (!once++)
2580 /*JP
2581                     pline("Unfortunately, your voice falters.");
2582 */
2583                     pline("\8ec\94O\82È\82ª\82ç\81C\82 \82È\82½\82Ì\90º\82Í\82Ç\82à\82Á\82Ä\82µ\82Ü\82Á\82½\81D");
2584                 mtmp->mflee = 0;
2585                 mtmp->mfrozen = 0;
2586                 mtmp->mcanmove = 1;
2587             } else if (!resist(mtmp, '\0', 0, TELL)) {
2588                 xlev = 6;
2589                 switch (mtmp->data->mlet) {
2590                 /* this is intentional, lichs are tougher
2591                    than zombies. */
2592                 case S_LICH:
2593                     xlev += 2; /*FALLTHRU*/
2594                 case S_GHOST:
2595                     xlev += 2; /*FALLTHRU*/
2596                 case S_VAMPIRE:
2597                     xlev += 2; /*FALLTHRU*/
2598                 case S_WRAITH:
2599                     xlev += 2; /*FALLTHRU*/
2600                 case S_MUMMY:
2601                     xlev += 2; /*FALLTHRU*/
2602                 case S_ZOMBIE:
2603                     if (u.ulevel >= xlev && !resist(mtmp, '\0', 0, NOTELL)) {
2604                         if (u.ualign.type == A_CHAOTIC) {
2605                             mtmp->mpeaceful = 1;
2606                             set_malign(mtmp);
2607                         } else { /* damn them */
2608                             killed(mtmp);
2609                         }
2610                         break;
2611                     } /* else flee */
2612                 /*FALLTHRU*/
2613                 default:
2614                     monflee(mtmp, 0, FALSE, TRUE);
2615                     break;
2616                 }
2617             }
2618         }
2619     }
2620     nomul(-(5 - ((u.ulevel - 1) / 6))); /* -5 .. -1 */
2621 /*JP
2622     multi_reason = "trying to turn the monsters";
2623 */
2624     multi_reason = "\89ö\95¨\82ð\93y\82É\96ß\82»\82¤\82Æ\82µ\82Ä\82¢\82é\8e\9e\82É";
2625     nomovemsg = You_can_move_again;
2626     return 1;
2627 }
2628
2629 const char *
2630 a_gname()
2631 {
2632     return a_gname_at(u.ux, u.uy);
2633 }
2634
2635 /* returns the name of an altar's deity */
2636 const char *
2637 a_gname_at(x, y)
2638 xchar x, y;
2639 {
2640     if (!IS_ALTAR(levl[x][y].typ))
2641         return (char *) 0;
2642
2643     return align_gname(a_align(x, y));
2644 }
2645
2646 /* returns the name of the hero's deity */
2647 const char *
2648 u_gname()
2649 {
2650     return align_gname(u.ualign.type);
2651 }
2652
2653 const char *
2654 align_gname(alignment)
2655 aligntyp alignment;
2656 {
2657     const char *gnam;
2658
2659     switch (alignment) {
2660     case A_NONE:
2661         gnam = Moloch;
2662         break;
2663     case A_LAWFUL:
2664         gnam = urole.lgod;
2665         break;
2666     case A_NEUTRAL:
2667         gnam = urole.ngod;
2668         break;
2669     case A_CHAOTIC:
2670         gnam = urole.cgod;
2671         break;
2672     default:
2673         impossible("unknown alignment.");
2674 /*JP
2675         gnam = "someone";
2676 */
2677         gnam = "\92N\82©";
2678         break;
2679     }
2680     if (*gnam == '_')
2681         ++gnam;
2682     return gnam;
2683 }
2684
2685 static const char *hallu_gods[] = {
2686 #if 0 /*JP*/
2687     "the Flying Spaghetti Monster", /* Church of the FSM */
2688     "Eris",                         /* Discordianism */
2689     "the Martians",                 /* every science fiction ever */
2690     "Xom",                          /* Crawl */
2691     "AnDoR dRaKoN",                 /* ADOM */
2692     "the Central Bank of Yendor",   /* economics */
2693     "Tooth Fairy",                  /* real world(?) */
2694     "Om",                           /* Discworld */
2695     "Yawgmoth",                     /* Magic: the Gathering */
2696     "Morgoth",                      /* LoTR */
2697     "Cthulhu",                      /* Lovecraft */
2698     "the Ori",                      /* Stargate */
2699     "destiny",                      /* why not? */
2700     "your Friend the Computer",     /* Paranoia */
2701 #else
2702     "\8bó\94ò\82Ô\83X\83p\83Q\83b\83e\83B\83\82\83\93\83X\83^\81[", /* Church of the FSM */
2703     "\83G\83\8a\83X",                       /* Discordianism */
2704     "\89Î\90¯\90l",                       /* every science fiction ever */
2705     "\83]\83\80",                         /* Crawl */
2706     "\83A\83\93\83h\81[\83\8b\81E\83h\83\89\83R\83\93",         /* ADOM */
2707     "\83C\83F\83\93\83_\81[\92\86\89\9b\8bâ\8ds",           /* economics */
2708     "\8e\95\82Ì\97d\90¸",                     /* real world(?) */
2709     "\83I\83\80",                         /* Discworld */
2710     "\83\88\81[\83O\83\82\83X",                   /* Magic: the Gathering */
2711     "\83\82\83\8b\83S\83X",                     /* LoTR */
2712     "\83N\83g\83D\83\8b\83t",                   /* Lovecraft */
2713     "\83I\81[\83\89\83C",                     /* Stargate */
2714     "\83l\90\",                         /* why not? */
2715     "\90e\88¤\82È\82é\83R\83\93\83s\83\85\81[\83^",         /* Paranoia */
2716 #endif
2717 };
2718
2719 /* hallucination handling for priest/minion names: select a random god
2720    iff character is hallucinating */
2721 const char *
2722 halu_gname(alignment)
2723 aligntyp alignment;
2724 {
2725     const char *gnam = NULL;
2726     int which;
2727
2728     if (!Hallucination)
2729         return align_gname(alignment);
2730
2731     /* The priest may not have initialized god names. If this is the
2732      * case, and we roll priest, we need to try again. */
2733     do
2734         which = randrole();
2735     while (!roles[which].lgod);
2736
2737     switch (rn2(9)) {
2738     case 0:
2739     case 1:
2740         gnam = roles[which].lgod;
2741         break;
2742     case 2:
2743     case 3:
2744         gnam = roles[which].ngod;
2745         break;
2746     case 4:
2747     case 5:
2748         gnam = roles[which].cgod;
2749         break;
2750     case 6:
2751     case 7:
2752         gnam = hallu_gods[rn2(sizeof hallu_gods / sizeof *hallu_gods)];
2753         break;
2754     case 8:
2755         gnam = Moloch;
2756         break;
2757     default:
2758         impossible("rn2 broken in halu_gname?!?");
2759     }
2760     if (!gnam) {
2761         impossible("No random god name?");
2762 #if 0 /*JP*/
2763         gnam = "your Friend the Computer"; /* Paranoia */
2764 #else
2765         gnam = "\90e\88¤\82È\82é\83R\83\93\83s\83\85\81[\83^"; /* Paranoia */
2766 #endif
2767     }
2768     if (*gnam == '_')
2769         ++gnam;
2770     return gnam;
2771 }
2772
2773 /* deity's title */
2774 const char *
2775 align_gtitle(alignment)
2776 aligntyp alignment;
2777 {
2778 /*JP
2779     const char *gnam, *result = "god";
2780 */
2781     const char *gnam, *result = "\8eå\90_";
2782
2783     switch (alignment) {
2784     case A_LAWFUL:
2785         gnam = urole.lgod;
2786         break;
2787     case A_NEUTRAL:
2788         gnam = urole.ngod;
2789         break;
2790     case A_CHAOTIC:
2791         gnam = urole.cgod;
2792         break;
2793     default:
2794         gnam = 0;
2795         break;
2796     }
2797     if (gnam && *gnam == '_')
2798 /*JP
2799         result = "goddess";
2800 */
2801         result = "\8f\97\90_";
2802     return result;
2803 }
2804
2805 void
2806 altar_wrath(x, y)
2807 register int x, y;
2808 {
2809     aligntyp altaralign = a_align(x, y);
2810
2811     if (!strcmp(align_gname(altaralign), u_gname())) {
2812 /*JP
2813         godvoice(altaralign, "How darest thou desecrate my altar!");
2814 */
2815         godvoice(altaralign, "\93ð\81C\89ä\82ª\8dÕ\92d\82ð\89\98\82·\82©\81I");
2816         (void) adjattrib(A_WIS, -1, FALSE);
2817     } else {
2818 /*JP
2819         pline("A voice (could it be %s?) whispers:", align_gname(altaralign));
2820 */
2821         pline("\82³\82³\82â\82«\90º(\82½\82Ô\82ñ%s\81H)\82ª\95·\82±\82¦\82é:", align_gname(altaralign));
2822 /*JP
2823         verbalize("Thou shalt pay, infidel!");
2824 */
2825         verbalize("\88Ù\92[\8eÒ\82æ\81I\95ñ\82¢\82ð\8eó\82¯\82æ\81I");
2826         change_luck(-1);
2827     }
2828 }
2829
2830 /* assumes isok() at one space away, but not necessarily at two */
2831 STATIC_OVL boolean
2832 blocked_boulder(dx, dy)
2833 int dx, dy;
2834 {
2835     register struct obj *otmp;
2836     long count = 0L;
2837
2838     for (otmp = level.objects[u.ux + dx][u.uy + dy]; otmp;
2839          otmp = otmp->nexthere) {
2840         if (otmp->otyp == BOULDER)
2841             count += otmp->quan;
2842     }
2843
2844     switch (count) {
2845     case 0:
2846         /* no boulders--not blocked */
2847         return FALSE;
2848     case 1:
2849         /* possibly blocked depending on if it's pushable */
2850         break;
2851     default:
2852         /* more than one boulder--blocked after they push the top one;
2853            don't force them to push it first to find out */
2854         return TRUE;
2855     }
2856
2857     if (!isok(u.ux + 2 * dx, u.uy + 2 * dy))
2858         return TRUE;
2859     if (IS_ROCK(levl[u.ux + 2 * dx][u.uy + 2 * dy].typ))
2860         return TRUE;
2861     if (sobj_at(BOULDER, u.ux + 2 * dx, u.uy + 2 * dy))
2862         return TRUE;
2863
2864     return FALSE;
2865 }
2866
2867 /*pray.c*/