1 /* NetHack 3.6 pray.c $NHDT-Date: 1446854232 2015/11/06 23:57:12 $ $NHDT-Branch: master $:$NHDT-Revision: 1.87 $ */
2 /* Copyright (c) Benson I. Margulies, Mike Stephenson, Steve Linhart, 1989. */
3 /* NetHack may be freely redistributed. See license for details. */
5 /* JNetHack Copyright */
6 /* (c) Issei Numata, Naoki Hamada, Shigehiro Miyashita, 1994-2000 */
7 /* For 3.4-, Copyright (c) SHIRAKATA Kentaro, 2002-2016 */
8 /* JNetHack may be freely redistributed. See license for details. */
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));
29 /* simplify a few tests */
30 #define Cursed_obj(obj, typ) ((obj) && (obj)->otyp == (typ) && (obj)->cursed)
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
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.
50 static const char *Moloch = "Moloch";
52 static const char *Moloch = "
\83\82\81[
\83\8d\83b
\83N";
54 static const char *godvoices[] = {
56 "booms out", "thunders", "rings out", "booms",
58 "
\8b¿
\82«
\82í
\82½
\82Á
\82½", "
\97\8b\82Ì
\82æ
\82¤
\82É
\8b¿
\82¢
\82½", "
\82Æ
\82Ç
\82ë
\82¢
\82½", "
\8b¿
\82¢
\82½",
61 /* values calculated when prayer starts, and used when completed */
62 static aligntyp p_aligntyp;
64 static int p_type; /* (-1)-3: (-1)=really naughty, 3=really good */
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.
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 */
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
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)
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))
111 /* critically low hit points if hp <= 5 or hp <= maxhp/N for some N */
113 critically_low_hp(only_if_injured)
114 boolean only_if_injured; /* determines whether maxhp <= 5 matters */
116 int divisor, hplim, curhp = Upolyd ? u.mh : u.uhp,
117 maxhp = Upolyd ? u.mhmax : u.uhpmax;
119 if (only_if_injured && !(curhp < maxhp))
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;
128 /* 7 used to be the unconditional divisor */
129 switch (xlev_to_rank(u.ulevel)) { /* maps 1..30 into 0..8 */
133 break; /* explvl 1 to 5 */
137 break; /* explvl 6 to 13 */
141 break; /* explvl 14 to 21 */
145 break; /* explvl 22 to 29 */
148 break; /* explvl 30+ */
150 /* 5 is a magic number in TROUBLE_HIT handling below */
151 return (boolean) (curhp <= 5 || curhp * divisor <= maxhp);
155 * Return 0 if nothing particular seems wrong, positive numbers for
156 * serious trouble, and negative numbers for comparative annoyances.
157 * This returns the worst problem. There may be others, and the gods
158 * may fix more than one.
160 * This could get as bizarre as noting surrounding opponents, (or
161 * hostile dogs), but that's really hard.
163 * We could force rehumanize of polyselfed people, but we can't tell
164 * unintentional shape changes from the other kind. Oh well.
165 * 3.4.2: make an exception if polymorphed into a form which lacks
166 * hands; that's a case where the ramifications override this doubt.
178 return TROUBLE_STONED;
180 return TROUBLE_SLIMED;
182 return TROUBLE_STRANGLED;
183 if (u.utrap && u.utraptype == TT_LAVA)
188 return TROUBLE_STARVING;
190 return TROUBLE_REGION;
191 if (critically_low_hp(FALSE))
193 if (u.ulycn >= LOW_PM)
194 return TROUBLE_LYCANTHROPE;
195 if (near_capacity() >= EXT_ENCUMBER && AMAX(A_STR) - ABASE(A_STR) > 3)
196 return TROUBLE_COLLAPSING;
198 for (i = -1; i <= 1; i++)
199 for (j = -1; j <= 1; j++) {
202 if (!isok(u.ux + i, u.uy + j)
203 || IS_ROCK(levl[u.ux + i][u.uy + j].typ)
204 || (blocked_boulder(i, j) && !throws_rocks(youmonst.data)))
207 if (count == 8 && !Passes_walls)
208 return TROUBLE_STUCK_IN_WALL;
210 if (Cursed_obj(uarmf, LEVITATION_BOOTS)
211 || stuck_ring(uleft, RIN_LEVITATION)
212 || stuck_ring(uright, RIN_LEVITATION))
213 return TROUBLE_CURSED_LEVITATION;
214 if (nohands(youmonst.data) || !freehand()) {
215 /* for bag/box access [cf use_container()]...
216 make sure it's a case that we know how to handle;
217 otherwise "fix all troubles" would get stuck in a loop */
219 return TROUBLE_UNUSEABLE_HANDS;
220 if (Upolyd && nohands(youmonst.data)
221 && (!Unchanging || ((otmp = unchanger()) != 0 && otmp->cursed)))
222 return TROUBLE_UNUSEABLE_HANDS;
224 if (Blindfolded && ublindf->cursed)
225 return TROUBLE_CURSED_BLINDFOLD;
230 if (Punished || (u.utrap && u.utraptype == TT_BURIEDBALL))
231 return TROUBLE_PUNISHED;
232 if (Cursed_obj(uarmg, GAUNTLETS_OF_FUMBLING)
233 || Cursed_obj(uarmf, FUMBLE_BOOTS))
234 return TROUBLE_FUMBLING;
235 if (worst_cursed_item())
236 return TROUBLE_CURSED_ITEMS;
237 if (u.usteed) { /* can't voluntarily dismount from a cursed saddle */
238 otmp = which_armor(u.usteed, W_SADDLE);
239 if (Cursed_obj(otmp, SADDLE))
240 return TROUBLE_SADDLE;
243 if (Blinded > 1 && haseyes(youmonst.data)
245 || !attacktype_fordmg(u.ustuck->data, AT_ENGL, AD_BLND)))
246 return TROUBLE_BLIND;
247 for (i = 0; i < A_MAX; i++)
248 if (ABASE(i) < AMAX(i))
249 return TROUBLE_POISONED;
250 if (Wounded_legs && !u.usteed)
251 return TROUBLE_WOUNDED_LEGS;
253 return TROUBLE_HUNGRY;
255 return TROUBLE_STUNNED;
256 if (HConfusion & TIMEOUT)
257 return TROUBLE_CONFUSED;
258 if (HHallucination & TIMEOUT)
259 return TROUBLE_HALLUCINATION;
263 /* select an item for TROUBLE_CURSED_ITEMS */
264 STATIC_OVL struct obj *
267 register struct obj *otmp;
269 /* if strained or worse, check for loadstone first */
270 if (near_capacity() >= HVY_ENCUMBER) {
271 for (otmp = invent; otmp; otmp = otmp->nobj)
272 if (Cursed_obj(otmp, LOADSTONE))
275 /* weapon takes precedence if it is interfering
276 with taking off a ring or putting on a shield */
277 if (welded(uwep) && (uright || bimanual(uwep))) { /* weapon */
279 /* gloves come next, due to rings */
280 } else if (uarmg && uarmg->cursed) { /* gloves */
282 /* then shield due to two handed weapons and spells */
283 } else if (uarms && uarms->cursed) { /* shield */
285 /* then cloak due to body armor */
286 } else if (uarmc && uarmc->cursed) { /* cloak */
288 } else if (uarm && uarm->cursed) { /* suit */
290 } else if (uarmh && uarmh->cursed) { /* helmet */
292 } else if (uarmf && uarmf->cursed) { /* boots */
294 } else if (uarmu && uarmu->cursed) { /* shirt */
296 } else if (uamul && uamul->cursed) { /* amulet */
298 } else if (uleft && uleft->cursed) { /* left ring */
300 } else if (uright && uright->cursed) { /* right ring */
302 } else if (ublindf && ublindf->cursed) { /* eyewear */
303 otmp = ublindf; /* must be non-blinding lenses */
304 /* if weapon wasn't handled above, do it now */
305 } else if (welded(uwep)) { /* weapon */
307 /* active secondary weapon even though it isn't welded */
308 } else if (uswapwep && uswapwep->cursed && u.twoweap) {
310 /* all worn items ought to be handled by now */
312 for (otmp = invent; otmp; otmp = otmp->nobj) {
315 if (otmp->otyp == LOADSTONE || confers_luck(otmp))
323 fix_worst_trouble(trouble)
327 struct obj *otmp = 0;
328 const char *what = (const char *) 0;
330 static NEARDATA const char leftglow[] = "Your left ring softly glows",
331 rightglow[] = "Your right ring softly glows";
333 static NEARDATA const char leftglow[] = "
\8d¶
\82Ì
\8ew
\97Ö",
334 rightglow[] = "
\89E
\82Ì
\8ew
\97Ö";
340 make_stoned(0L, "You feel more limber.", 0, (char *) 0);
342 make_stoned(0L, "
\93î
\82ç
\82©
\82
\82È
\82Á
\82½
\82æ
\82¤
\82È
\8bC
\82ª
\82µ
\82½
\81D", 0, (char *) 0);
346 make_slimed(0L, "The slime disappears.");
348 make_slimed(0L, "
\82Ç
\82ë
\82Ç
\82ë
\8a´
\82Í
\8fÁ
\82¦
\82½
\81D");
350 case TROUBLE_STRANGLED:
351 if (uamul && uamul->otyp == AMULET_OF_STRANGULATION) {
353 Your("amulet vanishes!");
355 Your("
\96\82\8f\9c\82¯
\82Í
\8fÁ
\82¦
\82³
\82Á
\82½
\81I");
359 You("can breathe again.");
361 You("
\82Ü
\82½
\8cÄ
\8bz
\82Å
\82«
\82é
\82æ
\82¤
\82É
\82È
\82Á
\82½
\81D");
367 You("are back on solid ground.");
369 You("
\8cÅ
\82¢
\92n
\96Ê
\82É
\96ß
\82Á
\82½
\81D");
370 /* teleport should always succeed, but if not,
373 if (!safe_teleds(FALSE))
376 case TROUBLE_STARVING:
381 Your("%s feels content.", body_part(STOMACH));
383 Your("
\90H
\97~
\82Í
\96\9e\82½
\82³
\82ê
\82½
\81D");
391 You("
\8bC
\95ª
\82ª
\97Ç
\82
\82È
\82Á
\82½
\81D");
392 make_sick(0L, (char *) 0, FALSE, SICK_ALL);
395 /* stinking cloud, with hero vulnerable to HP loss */
399 /* "fix all troubles" will keep trying if hero has
400 5 or less hit points, so make sure they're always
401 boosted to be more than that */
403 You_feel("much better.");
405 You("
\82Æ
\82Ä
\82à
\8bC
\95ª
\82ª
\97Ç
\82
\82È
\82Á
\82½
\81D");
412 if (u.uhpmax < u.ulevel * 5 + 11)
419 case TROUBLE_COLLAPSING:
420 /* override Fixed_abil; uncurse that if feasible */
422 You_feel("%sstronger.",
423 (AMAX(A_STR) - ABASE(A_STR) > 6) ? "much " : "");
425 You_feel("%s
\8b
\82
\82È
\82Á
\82½
\82æ
\82¤
\82¾
\81D",
426 (AMAX(A_STR) - ABASE(A_STR) > 6) ? "
\82Æ
\82Ä
\82à" : "");
428 ABASE(A_STR) = AMAX(A_STR);
431 if ((otmp = stuck_ring(uleft, RIN_SUSTAIN_ABILITY)) != 0) {
434 } else if ((otmp = stuck_ring(uright, RIN_SUSTAIN_ABILITY))
443 case TROUBLE_STUCK_IN_WALL:
445 Your("surroundings change.");
447 Your("
\8aÂ
\8b«
\82ª
\95Ï
\89»
\82µ
\82½
\81D");
448 /* no control, but works on no-teleport levels */
449 (void) safe_teleds(FALSE);
451 case TROUBLE_CURSED_LEVITATION:
452 if (Cursed_obj(uarmf, LEVITATION_BOOTS)) {
454 } else if ((otmp = stuck_ring(uleft, RIN_LEVITATION)) != 0) {
457 } else if ((otmp = stuck_ring(uright, RIN_LEVITATION)) != 0) {
462 case TROUBLE_UNUSEABLE_HANDS:
467 if (Upolyd && nohands(youmonst.data)) {
470 Your("shape becomes uncertain.");
472 Your("
\91Ì
\8c^
\82Í
\95s
\96¾
\8am
\82É
\82È
\82Á
\82½
\81D");
473 rehumanize(); /* "You return to {normal} form." */
474 } else if ((otmp = unchanger()) != 0 && otmp->cursed) {
475 /* otmp is an amulet of unchanging */
479 if (nohands(youmonst.data) || !freehand())
480 impossible("fix_worst_trouble: couldn't cure hands.");
482 case TROUBLE_CURSED_BLINDFOLD:
485 case TROUBLE_LYCANTHROPE:
490 case TROUBLE_PUNISHED:
492 Your("chain disappears.");
494 Your("
\8d½
\82Í
\8fÁ
\82¦
\82½
\81D");
495 if (u.utrap && u.utraptype == TT_BURIEDBALL)
496 buried_ball_to_freedom();
500 case TROUBLE_FUMBLING:
501 if (Cursed_obj(uarmg, GAUNTLETS_OF_FUMBLING))
503 else if (Cursed_obj(uarmf, FUMBLE_BOOTS))
508 case TROUBLE_CURSED_ITEMS:
509 otmp = worst_cursed_item();
512 else if (otmp == uleft)
516 impossible("fix_worst_trouble: nothing to uncurse.");
519 if (!Blind || (otmp == ublindf && Blindfolded_only)) {
522 what ? what : (const char *) Yobjnam2(otmp, "softly glow"),
525 Your("%s
\82Í%s
\82â
\82í
\82ç
\82©
\82
\8bP
\82¢
\82½
\81D",
526 what ? what : (const char *)xname(otmp),
527 jconj_adj(hcolor(NH_AMBER)));
529 iflags.last_msg = PLNMSG_OBJ_GLOWS;
535 case TROUBLE_POISONED:
536 /* override Fixed_abil; ignore items which confer that */
539 pline("There's a tiger in your tank.");
541 pline("
\82 \82È
\82½
\82Ì
\83^
\83\93\83N
\82Ì
\92\86\82É
\83g
\83\89\82ª
\82¢
\82é
\81D");
544 You_feel("in good health again.");
546 You("
\82Ü
\82½
\8c\92\8dN
\82É
\82È
\82Á
\82½
\82æ
\82¤
\82È
\8bC
\82ª
\82µ
\82½
\81D");
547 for (i = 0; i < A_MAX; i++) {
548 if (ABASE(i) < AMAX(i)) {
553 (void) encumber_msg();
555 case TROUBLE_BLIND: {
557 const char *eyes = body_part(EYE);
559 if (eyecount(youmonst.data) != 1)
560 eyes = makeplural(eyes);
561 Your("%s %s better.", eyes, vtense(eyes, "feel"));
563 pline("%s
\82ª
\89ñ
\95\9c\82µ
\82½
\82æ
\82¤
\82È
\8bC
\82ª
\82µ
\82½
\81D", body_part(EYE));
566 make_blinded(0L, FALSE);
569 case TROUBLE_WOUNDED_LEGS:
572 case TROUBLE_STUNNED:
573 make_stunned(0L, TRUE);
575 case TROUBLE_CONFUSED:
576 make_confused(0L, TRUE);
578 case TROUBLE_HALLUCINATION:
580 pline("Looks like you are back in Kansas.");
582 pline("
\8c©
\82Ä
\81I
\83J
\83\93\83U
\83X
\82É
\96ß
\82Á
\82Ä
\82«
\82½
\82ñ
\82¾
\82í
\81D");
583 (void) make_hallucinated(0L, FALSE, 0L);
586 otmp = which_armor(u.usteed, W_SADDLE);
589 pline("%s %s.", Yobjnam2(otmp, "softly glow"), hcolor(NH_AMBER));
591 pline("%s
\82Í%s
\82â
\82í
\82ç
\82©
\82
\8bP
\82¢
\82½
\81D", y_monnam(u.usteed), hcolor(NH_AMBER));
599 /* "I am sometimes shocked by... the nuns who never take a bath without
600 * wearing a bathrobe all the time. When asked why, since no man can see
602 * they reply 'Oh, but you forget the good God'. Apparently they conceive of
603 * the Deity as a Peeping Tom, whose omnipotence enables Him to see through
604 * bathroom walls, but who is foiled by bathrobes." --Bertrand Russell, 1943
605 * Divine wrath, dungeon walls, and armor follow the same principle.
608 god_zaps_you(resp_god)
614 "Suddenly a bolt of lightning comes down at you from the heavens!");
616 "
\93Ë
\91R
\8bó
\82©
\82ç
\88î
\8dÈ
\82ª
\97\8e\82¿
\82Ä
\82«
\82½
\81I");
618 pline("It strikes %s!", mon_nam(u.ustuck));
620 pline("
\88î
\8dÈ
\82Í%s
\82É
\96½
\92\86\82µ
\82½
\81I", mon_nam(u.ustuck));
621 if (!resists_elec(u.ustuck)) {
623 pline("%s fries to a crisp!", Monnam(u.ustuck));
625 pline("%s
\82Í
\83p
\83\8a\83p
\83\8a\82É
\82È
\82Á
\82½
\81I", Monnam(u.ustuck));
626 /* Yup, you get experience. It takes guts to successfully
627 * pull off this trick on your god, anyway.
629 xkilled(u.ustuck, 0);
632 pline("%s seems unaffected.", Monnam(u.ustuck));
634 pline("%s
\82Í
\89e
\8b¿
\82ð
\8eó
\82¯
\82È
\82¢
\82æ
\82¤
\82¾
\81D", Monnam(u.ustuck));
637 pline("Suddenly, a bolt of lightning strikes you!");
639 pline("
\93Ë
\91R
\81C
\88î
\8dÈ
\82ª
\82 \82È
\82½
\82É
\96½
\92\86\82µ
\82½
\81I");
641 shieldeff(u.ux, u.uy);
644 pline("For some reason you're unaffected.");
646 pline("
\82È
\82º
\82©
\82 \82È
\82½
\82Í
\89e
\8b¿
\82ð
\8eó
\82¯
\82È
\82¢
\81D");
649 (void) ureflects("%s reflects from your %s.", "It");
651 (void) ureflects("%s
\82Í%s
\82É
\82æ
\82Á
\82Ä
\94½
\8eË
\82³
\82ê
\82½
\81D", "
\89½
\82©");
652 } else if (Shock_resistance) {
653 shieldeff(u.ux, u.uy);
655 pline("It seems not to affect you.");
657 pline("
\88î
\8dÈ
\82Í
\89e
\8b¿
\82ð
\97^
\82¦
\82È
\82¢
\82æ
\82¤
\82¾
\81D");
659 fry_by_god(resp_god, FALSE);
663 pline("%s is not deterred...", align_gname(resp_god));
665 pline("%s
\82Í
\82 \82«
\82ç
\82ß
\82È
\82©
\82Á
\82½
\81D
\81D
\81D", align_gname(resp_god));
668 pline("A wide-angle disintegration beam aimed at you hits %s!",
670 pline("
\82 \82È
\82½
\82ð
\91_
\82Á
\82½
\8dL
\8ap
\95²
\8dÓ
\8cõ
\90ü
\82ª%s
\82É
\96½
\92\86\82µ
\82½
\81I",
672 if (!resists_disint(u.ustuck)) {
674 pline("%s disintegrates into a pile of dust!", Monnam(u.ustuck));
676 pline("%s
\82Í
\82¿
\82è
\82Ì
\8eR
\82É
\82È
\82Á
\82½
\81I", Monnam(u.ustuck));
677 xkilled(u.ustuck, 2); /* no corpse */
680 pline("%s seems unaffected.", Monnam(u.ustuck));
682 pline("%s
\82Í
\89e
\8b¿
\82ð
\8eó
\82¯
\82È
\82¢
\82æ
\82¤
\82¾
\81D", Monnam(u.ustuck));
685 pline("A wide-angle disintegration beam hits you!");
687 pline("
\8dL
\8ap
\95²
\8dÓ
\8cõ
\90ü
\82ª
\82 \82È
\82½
\82É
\96½
\92\86\82µ
\82½
\81I");
689 /* disintegrate shield and body armor before disintegrating
690 * the impudent mortal, like black dragon breath -3.
692 if (uarms && !(EReflecting & W_ARMS)
693 && !(EDisint_resistance & W_ARMS))
694 (void) destroy_arm(uarms);
695 if (uarmc && !(EReflecting & W_ARMC)
696 && !(EDisint_resistance & W_ARMC))
697 (void) destroy_arm(uarmc);
698 if (uarm && !(EReflecting & W_ARM) && !(EDisint_resistance & W_ARM)
700 (void) destroy_arm(uarm);
701 if (uarmu && !uarm && !uarmc)
702 (void) destroy_arm(uarmu);
703 if (!Disint_resistance)
704 fry_by_god(resp_god, TRUE);
707 You("bask in its %s glow for a minute...", NH_BLACK);
709 You("
\82µ
\82Î
\82ç
\82
\81C
\82»
\82Ì%s
\8bP
\82«
\82Å
\92g
\82Ü
\82Á
\82½
\81D
\81D
\81D", NH_BLACK);
711 godvoice(resp_god, "I believe it not!");
713 godvoice(resp_god, "
\90M
\82¶
\82ç
\82ê
\82Ê
\81I");
715 if (Is_astralevel(&u.uz) || Is_sanctum(&u.uz)) {
716 /* one more try for high altars */
718 verbalize("Thou cannot escape my wrath, mortal!");
720 verbalize("
\92è
\96½
\82Ì
\8eÒ
\82æ
\81C
\93ð
\89ä
\82ª
\93{
\82è
\82©
\82ç
\93¦
\82ª
\82ê
\82é
\82±
\82Æ
\82È
\82ç
\82ñ
\81I");
721 summon_minion(resp_god, FALSE);
722 summon_minion(resp_god, FALSE);
723 summon_minion(resp_god, FALSE);
725 verbalize("Destroy %s, my servants!", uhim());
727 verbalize("%s
\82ð
\8eE
\82¹
\81C
\82í
\82ª
\89º
\96l
\82æ
\81I", uhim());
733 fry_by_god(resp_god, via_disintegration)
735 boolean via_disintegration;
738 You("%s!", !via_disintegration ? "fry to a crisp"
739 : "disintegrate into a pile of dust");
741 You("%s
\81I", !via_disintegration ? "
\83p
\83\8a\83p
\83\8a\82É
\82È
\82Á
\82½"
742 : "
\82¿
\82è
\82Ì
\8eR
\82É
\82È
\82Á
\82½");
744 killer.format = KILLED_BY;
746 Sprintf(killer.name, "the wrath of %s", align_gname(resp_god));
748 Sprintf(killer.name, "%s
\82Ì
\93{
\82è
\82É
\90G
\82ê", align_gname(resp_god));
762 /* changed from tmp = u.ugangr + abs (u.uluck) -- rph */
763 /* added test for alignment diff -dlc */
764 if (resp_god != u.ualign.type)
765 maxanger = u.ualign.record / 2 + (Luck > 0 ? -Luck / 3 : -Luck);
767 maxanger = 3 * u.ugangr + ((Luck > 0 || u.ualign.record >= STRIDENT)
771 maxanger = 1; /* possible if bad align & good luck */
772 else if (maxanger > 15)
773 maxanger = 15; /* be reasonable */
775 switch (rn2(maxanger)) {
779 You_feel("that %s is %s.", align_gname(resp_god),
780 Hallucination ? "bummed" : "displeased");
782 You("%s
\82ª%s
\82¢
\82é
\82æ
\82¤
\82È
\8bC
\82ª
\82µ
\82½
\81D", align_gname(resp_god),
783 Hallucination ? "
\82Ë
\82¾
\82Á
\82Ä" : "
\97§
\95 \82µ
\82Ä");
788 godvoice(resp_god, (char *) 0);
790 pline("\"Thou %s, %s.\"",
791 (ugod_is_angry() && resp_god == u.ualign.type)
792 ? "hast strayed from the path"
794 youmonst.data->mlet == S_HUMAN ? "mortal" : "creature");
796 pline("
\81u
\93ð%s
\81C%s
\82æ
\81D
\81v",
797 (ugod_is_angry() && resp_god == u.ualign.type)
798 ? "
\82»
\82Ì
\93¹
\82©
\82ç
\93¥
\82Ý
\8fo
\82Ä
\82¨
\82é"
799 : "
\98ü
\96\9d\82È
\82è",
800 youmonst.data->mlet == S_HUMAN ? "
\92è
\96½
\82Ì
\82à
\82Ì" : "
\90¶
\95¨");
803 verbalize("Thou must relearn thy lessons!");
805 verbalize("
\93ð
\82¢
\82Ü
\88ê
\93x
\8aw
\82Ô
\82×
\82µ
\81I");
806 (void) adjattrib(A_WIS, -1, FALSE);
811 gods_angry(resp_god);
812 punish((struct obj *) 0);
814 } /* else fall thru */
817 gods_angry(resp_god);
818 if (!Blind && !Antimagic)
820 pline("%s glow surrounds you.", An(hcolor(NH_BLACK)));
822 pline("%s
\8cõ
\82ª
\82 \82È
\82½
\82ð
\8eæ
\82è
\8aª
\82¢
\82½
\81D", An(hcolor(NH_BLACK)));
827 godvoice(resp_god, (char *) 0);
829 verbalize("Thou durst %s me?",
830 (on_altar() && (a_align(u.ux, u.uy) != resp_god))
834 verbalize("
\93ð
\81C
\89ä%s
\81H",
835 (on_altar() && (a_align(u.ux,u.uy) != resp_god))
836 ? "
\82ð
\82³
\82°
\82·
\82Ý
\82µ
\82©
\81H"
837 : "
\82É
\8bF
\82è
\82ð
\8b\81\82ß
\82µ
\82©
\81H");
840 pline("\"Then die, %s!\"",
841 youmonst.data->mlet == S_HUMAN ? "mortal" : "creature");
843 pline("
\81u
\8e\80\82Ë
\81C%s
\82æ
\81I
\81v",
844 youmonst.data->mlet == S_HUMAN ? "
\92è
\96½
\82Ì
\82à
\82Ì" : "
\90¶
\95¨");
846 summon_minion(resp_god, FALSE);
850 gods_angry(resp_god);
851 god_zaps_you(resp_god);
854 u.ublesscnt = rnz(300);
858 /* helper to print "str appears at your feet", or appropriate */
866 /* barrier between you and the floor */
868 pline("%s %s into %s %s.", str, vtense(str, "drop"),
869 s_suffix(mon_nam(u.ustuck)), mbodypart(u.ustuck, STOMACH));
871 pline("%s
\82ª%s
\82Ì%s
\82É
\97\8e\82¿
\82½
\81D", str,
872 mon_nam(u.ustuck), mbodypart(u.ustuck, STOMACH));
876 pline("%s %s %s your %s!", str,
877 Blind ? "lands" : vtense(str, "appear"),
878 Levitation ? "beneath" : "at", makeplural(body_part(FOOT)));
880 pline("%s
\82ª
\82 \82È
\82½
\82Ì%s
\82É%s
\81I", str,
881 Levitation ? "
\89º
\95û" : "
\91«
\8c³",
882 Blind ? "
\92\85\92n
\82µ
\82½" : "
\8c»
\82í
\82ê
\82½");
891 boolean already_exists, in_hand;
894 #define ok_wep(o) ((o) && ((o)->oclass == WEAPON_CLASS || is_weptool(o)))
896 HSee_invisible |= FROMOUTSIDE;
897 HFire_resistance |= FROMOUTSIDE;
898 HCold_resistance |= FROMOUTSIDE;
899 HShock_resistance |= FROMOUTSIDE;
900 HSleep_resistance |= FROMOUTSIDE;
901 HPoison_resistance |= FROMOUTSIDE;
902 godvoice(u.ualign.type, (char *) 0);
904 obj = ok_wep(uwep) ? uwep : 0;
905 already_exists = in_hand = FALSE; /* lint suppression */
906 switch (u.ualign.type) {
908 u.uevent.uhand_of_elbereth = 1;
910 verbalize("I crown thee... The Hand of Elbereth!");
912 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");
915 u.uevent.uhand_of_elbereth = 2;
916 in_hand = (uwep && uwep->oartifact == ART_VORPAL_BLADE);
918 exist_artifact(LONG_SWORD, artiname(ART_VORPAL_BLADE));
920 verbalize("Thou shalt be my Envoy of Balance!");
922 verbalize("
\93ð
\81C
\89ä
\82ª
\92²
\98a
\82Ì
\8eg
\8eÒ
\82È
\82è
\81I");
925 u.uevent.uhand_of_elbereth = 3;
926 in_hand = (uwep && uwep->oartifact == ART_STORMBRINGER);
928 exist_artifact(RUNESWORD, artiname(ART_STORMBRINGER));
930 verbalize("Thou art chosen to %s for My Glory!",
931 already_exists && !in_hand ? "take lives" : "steal souls");
933 verbalize("
\93ð
\81C
\89ä
\82ª
\89h
\8cõ
\82Ì
\82½
\82ß%s
\8eÒ
\82Æ
\82µ
\82Ä
\91I
\82Î
\82ê
\82ñ
\81I",
934 already_exists && !in_hand ?
935 "
\90¶
\82«
\82È
\82ª
\82ç
\82¦
\82ñ" : "
\8d°
\82ð
\92D
\82¢
\82µ
\82½
\82ß
\82é");
940 class_gift = STRANGE_OBJECT;
941 /* 3.3.[01] had this in the A_NEUTRAL case below,
942 preventing chaotic wizards from receiving a spellbook */
943 if (Role_if(PM_WIZARD)
944 && (!uwep || (uwep->oartifact != ART_VORPAL_BLADE
945 && uwep->oartifact != ART_STORMBRINGER))
946 && !carrying(SPE_FINGER_OF_DEATH)) {
947 class_gift = SPE_FINGER_OF_DEATH;
949 obj = mksobj(class_gift, TRUE, FALSE);
953 at_your_feet("A spellbook");
955 at_your_feet("
\96\82\96@
\8f\91");
958 /* when getting a new book for known spell, enhance
959 currently wielded weapon rather than the book */
960 for (sp_no = 0; sp_no < MAXSPELL; sp_no++)
961 if (spl_book[sp_no].sp_id == class_gift) {
963 obj = uwep; /* to be blessed,&c */
966 } else if (Role_if(PM_MONK) && (!uwep || !uwep->oartifact)
967 && !carrying(SPE_RESTORE_ABILITY)) {
968 /* monks rarely wield a weapon */
969 class_gift = SPE_RESTORE_ABILITY;
973 switch (u.ualign.type) {
975 if (class_gift != STRANGE_OBJECT) {
976 ; /* already got bonus above */
977 } else if (obj && obj->otyp == LONG_SWORD && !obj->oartifact) {
980 Your("sword shines brightly for a moment.");
982 Your("
\8c\95\82Í
\82µ
\82Î
\82ç
\82
\82Ì
\8aÔ
\96¾
\82é
\82
\8bP
\82¢
\82½
\81D");
983 obj = oname(obj, artiname(ART_EXCALIBUR));
984 if (obj && obj->oartifact == ART_EXCALIBUR)
987 /* acquire Excalibur's skill regardless of weapon or gift */
988 unrestrict_weapon_skill(P_LONG_SWORD);
989 if (obj && obj->oartifact == ART_EXCALIBUR)
990 discover_artifact(ART_EXCALIBUR);
993 if (class_gift != STRANGE_OBJECT) {
994 ; /* already got bonus above */
995 } else if (obj && in_hand) {
997 Your("%s goes snicker-snack!", xname(obj));
999 Your("%s
\82Í
\83T
\83N
\83T
\83N
\82É
\82È
\82Á
\82½
\81I", xname(obj));
1001 } else if (!already_exists) {
1002 obj = mksobj(LONG_SWORD, FALSE, FALSE);
1003 obj = oname(obj, artiname(ART_VORPAL_BLADE));
1006 at_your_feet("A sword");
1008 at_your_feet("
\8c\95");
1012 /* acquire Vorpal Blade's skill regardless of weapon or gift */
1013 unrestrict_weapon_skill(P_LONG_SWORD);
1014 if (obj && obj->oartifact == ART_VORPAL_BLADE)
1015 discover_artifact(ART_VORPAL_BLADE);
1018 char swordbuf[BUFSZ];
1021 Sprintf(swordbuf, "%s sword", hcolor(NH_BLACK));
1023 Sprintf(swordbuf, "%s
\8c\95", hcolor(NH_BLACK));
1024 if (class_gift != STRANGE_OBJECT) {
1025 ; /* already got bonus above */
1026 } else if (obj && in_hand) {
1028 Your("%s hums ominously!", swordbuf);
1030 Your("%s
\82Í
\8bC
\96¡
\82Ì
\88«
\82¢
\89¹
\82ð
\97§
\82Ä
\82½
\81I", swordbuf);
1032 } else if (!already_exists) {
1033 obj = mksobj(RUNESWORD, FALSE, FALSE);
1034 obj = oname(obj, artiname(ART_STORMBRINGER));
1036 at_your_feet(An(swordbuf));
1040 /* acquire Stormbringer's skill regardless of weapon or gift */
1041 unrestrict_weapon_skill(P_BROAD_SWORD);
1042 if (obj && obj->oartifact == ART_STORMBRINGER)
1043 discover_artifact(ART_STORMBRINGER);
1051 /* enhance weapon regardless of alignment or artifact status */
1054 obj->oeroded = obj->oeroded2 = 0;
1055 obj->oerodeproof = TRUE;
1056 obj->bknown = obj->rknown = TRUE;
1059 /* acquire skill in this weapon */
1060 unrestrict_weapon_skill(weapon_type(obj));
1061 } else if (class_gift == STRANGE_OBJECT) {
1062 /* opportunity knocked, but there was nobody home... */
1064 You_feel("unworthy.");
1066 You("
\89¿
\92l
\82ª
\82È
\82¢
\82Æ
\8ev
\82Á
\82½
\81D");
1070 /* lastly, confer an extra skill slot/credit beyond the
1071 up-to-29 you can get from gaining experience levels */
1072 add_weapon_skill(1);
1080 /* don't use p_trouble, worst trouble may get fixed while praying */
1081 int trouble = in_trouble(); /* what's your worst difficulty? */
1082 int pat_on_head = 0, kick_on_butt;
1085 You_feel("that %s is %s.", align_gname(g_align),
1086 (u.ualign.record >= DEVOUT)
1087 ? Hallucination ? "pleased as punch" : "well-pleased"
1088 : (u.ualign.record >= STRIDENT)
1089 ? Hallucination ? "ticklish" : "pleased"
1090 : Hallucination ? "full" : "satisfied");
1092 pline("%s
\82ª%s
\82æ
\82¤
\82È
\8bC
\82ª
\82µ
\82½
\81D", align_gname(g_align),
1093 (u.ualign.record >= DEVOUT)
1094 ? Hallucination ? "
\82
\82»
\8b@
\8c\99\82¢
\82¢" : "
\82²
\8b@
\8c\99\97í
\82µ
\82¢"
1095 : (u.ualign.record >= STRIDENT)
1096 ? Hallucination ? "
\82
\82·
\82®
\82Á
\82½
\82ª
\82Á
\82Ä
\82¢
\82é" : "
\8fã
\8b@
\8c\99\82Å
\82 \82é"
1097 : Hallucination ? "
\95 \82¢
\82Á
\82Ï
\82¢
\82Å
\82 \82é" : "
\96\9e\91«
\82µ
\82Ä
\82¢
\82é");
1100 /* not your deity */
1101 if (on_altar() && p_aligntyp != u.ualign.type) {
1104 } else if (u.ualign.record < 2 && trouble <= 0)
1108 * Depending on your luck & align level, the god you prayed to will:
1109 * - fix your worst problem if it's major;
1110 * - fix all your major problems;
1111 * - fix your worst problem if it's minor;
1112 * - fix all of your problems;
1113 * - do you a gratuitous favor.
1115 * If you make it to the the last category, you roll randomly again
1116 * to see what they do for you.
1118 * If your luck is at least 0, then you are guaranteed rescued from
1119 * your worst major problem.
1121 if (!trouble && u.ualign.record >= DEVOUT) {
1122 /* if hero was in trouble, but got better, no special favor */
1126 int action, prayer_luck;
1129 /* Negative luck is normally impossible here (can_pray() forces
1130 prayer failure in that situation), but it's possible for
1131 Luck to drop during the period of prayer occupation and
1132 become negative by the time we get here. [Reported case
1133 was lawful character whose stinking cloud caused a delayed
1134 killing of a peaceful human, triggering the "murderer"
1135 penalty while successful prayer was in progress. It could
1136 also happen due to inconvenient timing on Friday 13th, but
1137 the magnitude there (-1) isn't big enough to cause trouble.]
1138 We don't bother remembering start-of-prayer luck, just make
1139 sure it's at least -1 so that Luck+2 is big enough to avoid
1140 a divide by zero crash when generating a random number. */
1141 prayer_luck = max(Luck, -1); /* => (prayer_luck + 2 > 0) */
1142 action = rn1(prayer_luck + (on_altar() ? 3 + on_shrine() : 2), 1);
1144 action = min(action, 3);
1145 if (u.ualign.record < STRIDENT)
1146 action = (u.ualign.record > 0 || !rnl(2)) ? 1 : 0;
1148 switch (min(action, 5)) {
1153 fix_worst_trouble(trouble);
1154 while ((trouble = in_trouble()) != 0);
1158 fix_worst_trouble(trouble);
1160 /* arbitrary number of tries */
1161 while ((trouble = in_trouble()) > 0 && (++tryct < 10))
1162 fix_worst_trouble(trouble);
1167 fix_worst_trouble(trouble);
1169 break; /* your god blows you off, too bad */
1173 /* note: can't get pat_on_head unless all troubles have just been
1174 fixed or there were no troubles to begin with; hallucination
1175 won't be in effect so special handling for it is superfluous */
1177 switch (rn2((Luck + 6) >> 1)) {
1181 if (uwep && (welded(uwep) || uwep->oclass == WEAPON_CLASS
1182 || is_weptool(uwep))) {
1183 char repair_buf[BUFSZ];
1186 if (uwep->oeroded || uwep->oeroded2)
1188 Sprintf(repair_buf, " and %s now as good as new",
1189 otense(uwep, "are"));
1191 Sprintf(repair_buf, "
\82³
\82ç
\82É
\90V
\95i
\93¯
\97l
\82É
\82È
\82Á
\82½
\81D");
1197 pline("%s %s%s.", Yobjnam2(uwep, "softly glow"),
1198 hcolor(NH_AMBER), repair_buf);
1200 Your("%s
\82Í%s
\82â
\82í
\82ç
\82©
\82
\8bP
\82¢
\82½
\81D%s", xname(uwep),
1201 jconj_adj(hcolor(NH_AMBER)), repair_buf);
1203 iflags.last_msg = PLNMSG_OBJ_GLOWS;
1206 You_feel("the power of %s over %s.", u_gname(),
1209 pline("%s
\82Ì
\97Í
\82ª%s
\82É
\92\8d\82ª
\82ê
\82Ä
\82¢
\82é
\82Ì
\82ð
\8a´
\82¶
\82½
\81D", u_gname(),
1213 uwep->bknown = TRUE;
1215 } else if (!uwep->blessed) {
1218 pline("%s with %s aura%s.",
1219 Yobjnam2(uwep, "softly glow"),
1220 an(hcolor(NH_LIGHT_BLUE)), repair_buf);
1222 Your("%s
\82Í%s
\82â
\82í
\82ç
\82©
\82È
\83I
\81[
\83\89\82É
\82Â
\82Â
\82Ü
\82ê
\82½
\81D%s",
1224 an(hcolor(NH_LIGHT_BLUE)), repair_buf);
1226 iflags.last_msg = PLNMSG_OBJ_GLOWS;
1229 You_feel("the blessing of %s over %s.", u_gname(),
1232 pline("%s
\82Ì
\8fj
\95\9f\82ª%s
\82É
\92\8d\82ª
\82ê
\82Ä
\82¢
\82é
\82Ì
\82ð
\8a´
\82¶
\82½
\81D", u_gname(),
1236 uwep->bknown = TRUE;
1240 /* fix any rust/burn/rot damage, but don't protect
1241 against future damage */
1242 if (uwep->oeroded || uwep->oeroded2) {
1243 uwep->oeroded = uwep->oeroded2 = 0;
1244 /* only give this message if we didn't just bless
1245 or uncurse (which has already given a message) */
1248 pline("%s as good as new!",
1249 Yobjnam2(uwep, Blind ? "feel" : "look"));
1251 Your("%s
\82Í
\90V
\95i
\93¯
\97l
\82É
\82È
\82Á
\82½%s
\81I",
1252 xname(uwep), Blind ? "
\82æ
\82¤
\82È
\8bC
\82ª
\82·
\82é" : "");
1259 /* takes 2 hints to get the music to enter the stronghold;
1260 skip if you've solved it via mastermind or destroyed the
1261 drawbridge (both set uopened_dbridge) or if you've already
1262 travelled past the Valley of the Dead (gehennom_entered) */
1263 if (!u.uevent.uopened_dbridge && !u.uevent.gehennom_entered) {
1264 if (u.uevent.uheard_tune < 1) {
1265 godvoice(g_align, (char *) 0);
1267 verbalize("Hark, %s!", youmonst.data->mlet == S_HUMAN
1271 verbalize("%s
\82æ
\81C
\95·
\82¯
\81I", youmonst.data->mlet == S_HUMAN
1272 ? "
\92è
\96½
\82Ì
\8eÒ"
1277 "To enter the castle, thou must play the right tune!");
1279 "
\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");
1280 u.uevent.uheard_tune++;
1282 } else if (u.uevent.uheard_tune < 2) {
1284 You_hear("a divine music...");
1286 You_hear("
\90_
\82Ì
\89¹
\8ay
\82ð
\95·
\82¢
\82½
\81D
\81D
\81D");
1288 pline("It sounds like: \"%s\".", tune);
1290 pline("
\82»
\82ê
\82Í
\8e\9f\82Ì
\82æ
\82¤
\82É
\95·
\82±
\82¦
\82½:
\81u%s
\81v", tune);
1291 u.uevent.uheard_tune++;
1295 /* Otherwise, falls into next case */
1299 You("are surrounded by %s glow.", an(hcolor(NH_GOLDEN)));
1301 You("%s
\8bP
\82«
\82É
\82Â
\82Â
\82Ü
\82ê
\82½
\81D", hcolor(NH_GOLDEN));
1302 /* if any levels have been lost (and not yet regained),
1303 treat this effect like blessed full healing */
1304 if (u.ulevel < u.ulevelmax) {
1305 u.ulevelmax -= 1; /* see potion.c */
1315 ABASE(A_STR) = AMAX(A_STR);
1316 if (u.uhunger < 900)
1320 make_blinded(0L, TRUE);
1324 register struct obj *otmp;
1329 You_feel("the power of %s.", u_gname());
1331 You("%s
\82Ì
\97Í
\82ð
\8a´
\82¶
\82½
\81D", u_gname());
1334 You("are surrounded by %s aura.", an(hcolor(NH_LIGHT_BLUE)));
1336 You("%s
\83I
\81[
\83\89\82É
\82Â
\82Â
\82Ü
\82ê
\82½
\81D", an(hcolor(NH_LIGHT_BLUE)));
1337 for (otmp = invent; otmp; otmp = otmp->nobj) {
1341 pline("%s %s.", Yobjnam2(otmp, "softly glow"),
1344 Your("%s
\82Í%s
\82â
\82í
\82ç
\82©
\82
\8bP
\82¢
\82½
\81D", xname(otmp),
1345 jconj_adj(hcolor(NH_AMBER)));
1347 iflags.last_msg = PLNMSG_OBJ_GLOWS;
1348 otmp->bknown = TRUE;
1359 static NEARDATA const char msg[] =
1361 "\"and thus I grant thee the gift of %s!\"";
1363 "
\81u
\82³
\82ç
\82É
\93ð
\82É%s
\82ð
\82³
\82¸
\82¯
\82æ
\82¤
\81I
\81v";
1365 godvoice(u.ualign.type,
1367 "Thou hast pleased me with thy progress,");
1369 "
\93ð
\82Ì
\90¬
\92·
\82Í
\94ñ
\8fí
\82É
\96]
\82Ü
\82µ
\82¢
\81C");
1370 if (!(HTelepat & INTRINSIC)) {
1371 HTelepat |= FROMOUTSIDE;
1373 pline(msg, "Telepathy");
1375 pline(msg, "
\83e
\83\8c\83p
\83V
\81[");
1378 } else if (!(HFast & INTRINSIC)) {
1379 HFast |= FROMOUTSIDE;
1381 pline(msg, "Speed");
1383 pline(msg, "
\91¬
\82³");
1384 } else if (!(HStealth & INTRINSIC)) {
1385 HStealth |= FROMOUTSIDE;
1387 pline(msg, "Stealth");
1389 pline(msg, "
\94E
\82Ì
\97Í");
1391 if (!(HProtection & INTRINSIC)) {
1392 HProtection |= FROMOUTSIDE;
1394 u.ublessed = rn1(3, 2);
1398 pline(msg, "my protection");
1400 pline(msg, "
\89ä
\82ª
\8cì
\82è");
1403 verbalize("Use it wisely in my name!");
1405 verbalize("
\89ä
\82ª
\96¼
\82É
\89\97\82¢
\82Ä
\97L
\8cø
\82É
\8eg
\82¤
\82ª
\82æ
\82¢
\81I");
1410 if (u.ualign.record >= PIOUS && !u.uevent.uhand_of_elbereth) {
1413 } /* else FALLTHRU */
1416 int sp_no, trycnt = u.ulevel + 1;
1418 /* not yet known spells given preference over already known ones
1420 /* Also, try to grant a spell for which there is a skill slot */
1421 otmp = mkobj(SPBOOK_CLASS, TRUE);
1422 while (--trycnt > 0) {
1423 if (otmp->otyp != SPE_BLANK_PAPER) {
1424 for (sp_no = 0; sp_no < MAXSPELL; sp_no++)
1425 if (spl_book[sp_no].sp_id == otmp->otyp)
1427 if (sp_no == MAXSPELL
1428 && !P_RESTRICTED(spell_skilltype(otmp->otyp)))
1429 break; /* usable, but not yet known */
1431 if (!objects[SPE_BLANK_PAPER].oc_name_known
1432 || carrying(MAGIC_MARKER))
1435 otmp->otyp = rnd_class(bases[SPBOOK_CLASS], SPE_BLANK_PAPER);
1439 at_your_feet("A spellbook");
1441 at_your_feet("
\96\82\96@
\8f\91");
1442 place_object(otmp, u.ux, u.uy);
1447 impossible("Confused deity!");
1451 u.ublesscnt = rnz(350);
1452 kick_on_butt = u.uevent.udemigod ? 1 : 0;
1453 if (u.uevent.uhand_of_elbereth)
1456 u.ublesscnt += kick_on_butt * rnz(1000);
1461 /* either blesses or curses water on the altar,
1462 * returns true if it found any water here.
1465 water_prayer(bless_water)
1466 boolean bless_water;
1468 register struct obj *otmp;
1469 register long changed = 0;
1470 boolean other = FALSE, bc_known = !(Blind || Hallucination);
1472 for (otmp = level.objects[u.ux][u.uy]; otmp; otmp = otmp->nexthere) {
1473 /* turn water into (un)holy water */
1474 if (otmp->otyp == POT_WATER
1475 && (bless_water ? !otmp->blessed : !otmp->cursed)) {
1476 otmp->blessed = bless_water;
1477 otmp->cursed = !bless_water;
1478 otmp->bknown = bc_known;
1479 changed += otmp->quan;
1480 } else if (otmp->oclass == POTION_CLASS)
1483 if (!Blind && changed) {
1485 pline("%s potion%s on the altar glow%s %s for a moment.",
1486 ((other && changed > 1L) ? "Some of the"
1487 : (other ? "One of the" : "The")),
1488 ((other || changed > 1L) ? "s" : ""), (changed > 1L ? "" : "s"),
1489 (bless_water ? hcolor(NH_LIGHT_BLUE) : hcolor(NH_BLACK)));
1491 pline("%s
\8dÕ
\92d
\82Ì
\96ò
\82Í
\88ê
\8fu%s
\8bP
\82¢
\82½
\81D",
1492 (other && changed > 1L) ? "
\82¢
\82
\82Â
\82©
\82Ì"
1494 jconj_adj(bless_water ? hcolor(NH_LIGHT_BLUE) : hcolor(NH_BLACK)));
1497 return (boolean) (changed > 0L);
1501 godvoice(g_align, words)
1506 const char *quot = "";
1513 pline_The("voice of %s %s: %s%s%s", align_gname(g_align),
1514 godvoices[rn2(SIZE(godvoices))], quot, words, quot);
1517 pline("%s
\82Ì
\90º
\82ª%s:
\81u%s
\81v", align_gname(g_align),
1518 godvoices[rn2(SIZE(godvoices))], words);
1520 pline("%s
\82Ì
\90º
\82ª%s
\81F", align_gname(g_align),
1521 godvoices[rn2(SIZE(godvoices))]);
1530 godvoice(g_align, "Thou hast angered me.");
1532 godvoice(g_align, "
\93ð
\81C
\89ä
\82ð
\93{
\82ç
\82µ
\82ß
\82½
\82è
\81D");
1535 /* The g_align god is upset with you. */
1540 if (g_align == u.ualign.type)
1548 consume_offering(otmp)
1549 register struct obj *otmp;
1555 Your("sacrifice sprouts wings and a propeller and roars away!");
1557 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");
1561 Your("sacrifice puffs up, swelling bigger and bigger, and pops!");
1563 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");
1568 "sacrifice collapses into a cloud of dancing particles and fades away!");
1570 "
\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");
1573 else if (Blind && u.ualign.type == A_LAWFUL)
1575 Your("sacrifice disappears!");
1577 Your("
\8c£
\8fã
\95¨
\82Í
\8fÁ
\82¦
\82½
\81I");
1580 Your("sacrifice is consumed in a %s!",
1581 u.ualign.type == A_LAWFUL ? "flash of light" : "burst of flame");
1583 Your("
\8c£
\8fã
\95¨
\82Í%s
\8fÁ
\82¦
\82³
\82Á
\82½
\81I",
1584 u.ualign.type == A_LAWFUL ? "
\82Ü
\82Î
\82ä
\82¢
\8cõ
\82ð
\95ú
\82¿" : "
\89\8a\82ð
\8fã
\82°");
1590 exercise(A_WIS, TRUE);
1596 static NEARDATA const char cloud_of_smoke[] =
1598 "A cloud of %s smoke surrounds you...";
1600 "%s
\89\8c\82ª
\82 \82È
\82½
\82ð
\8eæ
\82è
\88Í
\82ñ
\82¾
\81D
\81D
\81D";
1601 register struct obj *otmp;
1604 aligntyp altaralign = a_align(u.ux, u.uy);
1606 if (!on_altar() || u.uswallow) {
1608 You("are not standing on an altar.");
1610 You("
\8dÕ
\92d
\82Ì
\8fã
\82É
\97§
\82Á
\82Ä
\82¢
\82È
\82¢
\81D");
1613 highaltar = ((Is_astralevel(&u.uz) || Is_sanctum(&u.uz))
1614 && (levl[u.ux][u.uy].altarmask & AM_SHRINE));
1617 otmp = floorfood("sacrifice", 1);
1619 otmp = floorfood("
\95ù
\82°
\82é", 1);
1623 * Was based on nutritional value and aging behavior (< 50 moves).
1624 * Sacrificing a food ration got you max luck instantly, making the
1625 * gods as easy to please as an angry dog!
1627 * Now only accepts corpses, based on the game's evaluation of their
1628 * toughness. Human and pet sacrifice, as well as sacrificing unicorns
1629 * of your alignment, is strongly discouraged.
1631 #define MAXVALUE 24 /* Highest corpse value (besides Wiz) */
1633 if (otmp->otyp == CORPSE) {
1634 register struct permonst *ptr = &mons[otmp->corpsenm];
1636 extern const int monstr[];
1639 u.uconduct.gnostic++;
1641 /* you're handling this corpse, even if it was killed upon the altar
1643 feel_cockatrice(otmp, TRUE);
1644 if (rider_corpse_revival(otmp, FALSE))
1647 if (otmp->corpsenm == PM_ACID_BLOB
1648 || (monstermoves <= peek_at_iced_corpse_age(otmp) + 50)) {
1649 value = monstr[otmp->corpsenm] + 1;
1651 value = eaten_stat(value, otmp);
1654 if (your_race(ptr)) {
1655 if (is_demon(youmonst.data)) {
1657 You("find the idea very satisfying.");
1659 You("
\82»
\82Ì
\8dl
\82¦
\82Í
\91f
\90°
\82µ
\82¢
\82Æ
\8ev
\82Á
\82½
\81D");
1660 exercise(A_WIS, TRUE);
1661 } else if (u.ualign.type != A_CHAOTIC) {
1663 pline("You'll regret this infamous offense!");
1665 pline("
\93ð
\81C
\82±
\82Ì
\95\8e\90J
\82Ì
\8ds
\82È
\82¢
\82ð
\8cã
\89÷
\82·
\82é
\82×
\82µ
\81I");
1666 exercise(A_WIS, FALSE);
1670 && (altaralign != A_CHAOTIC || u.ualign.type != A_CHAOTIC)) {
1671 goto desecrate_high_altar;
1672 } else if (altaralign != A_CHAOTIC && altaralign != A_NONE) {
1673 /* curse the lawful/neutral altar */
1675 pline_The("altar is stained with %s blood.", urace.adj);
1677 pline("
\8dÕ
\92d
\82Í%s
\82Ì
\8c\8c\82Å
\89\98\82ê
\82Ä
\82¢
\82é
\81D", urace.adj);
1678 levl[u.ux][u.uy].altarmask = AM_CHAOTIC;
1682 const char *demonless_msg;
1684 /* Human sacrifice on a chaotic or unaligned altar */
1685 /* is equivalent to demon summoning */
1686 if (altaralign == A_CHAOTIC && u.ualign.type != A_CHAOTIC) {
1689 "The blood floods the altar, which vanishes in %s cloud!",
1691 "
\8c\8c\82ª
\8dÕ
\92d
\82©
\82ç
\82 \82Ó
\82ê
\81C
\8dÕ
\92d
\82Í%s
\89_
\82Æ
\82È
\82è
\8fÁ
\82¦
\82½
\81I",
1692 an(hcolor(NH_BLACK)));
1693 levl[u.ux][u.uy].typ = ROOM;
1694 levl[u.ux][u.uy].altarmask = 0;
1698 demonless_msg = "cloud dissipates";
1700 demonless_msg = "
\89_
\82Í
\8fÁ
\82¦
\82½
\81D";
1702 /* either you're chaotic or altar is Moloch's or both */
1704 pline_The("blood covers the altar!");
1706 pline("
\8c\8c\82ª
\8dÕ
\92d
\82ð
\95¢
\82Á
\82½
\81I");
1707 change_luck(altaralign == A_NONE ? -2 : 2);
1709 demonless_msg = "blood coagulates";
1711 demonless_msg = "
\8c\8c\82ª
\82±
\82Ñ
\82è
\82Â
\82¢
\82½";
1713 if ((pm = dlord(altaralign)) != NON_PM
1714 && (dmon = makemon(&mons[pm], u.ux, u.uy, NO_MM_FLAGS))
1718 Strcpy(dbuf, a_monnam(dmon));
1720 if (!strcmpi(dbuf, "it"))
1722 if (!strcmpi(dbuf, "
\89½
\8eÒ
\82©"))
1724 Strcpy(dbuf, "something dreadful");
1726 Strcpy(dbuf, "
\89½
\82©
\8b°
\82ë
\82µ
\82¢
\82à
\82Ì");
1728 dmon->mstrategy &= ~STRAT_APPEARMSG;
1730 You("have summoned %s!", dbuf);
1732 You("%s
\82ð
\8f¢
\8a«
\82µ
\82½
\81I", dbuf);
1733 if (sgn(u.ualign.type) == sgn(dmon->data->maligntyp))
1734 dmon->mpeaceful = TRUE;
1736 You("are terrified, and unable to move.");
1738 You("
\8b°
\95|
\82Å
\93®
\82¯
\82È
\82
\82È
\82Á
\82½
\81D");
1740 multi_reason = "being terrified of a demon";
1744 pline_The("%s.", demonless_msg);
1746 pline("%s
\81D", demonless_msg);
1749 if (u.ualign.type != A_CHAOTIC) {
1752 (void) adjattrib(A_WIS, -1, TRUE);
1754 angrygods(u.ualign.type);
1763 } else if (has_omonst(otmp)
1764 && (mtmp = get_mtraits(otmp, FALSE)) != 0
1766 /* mtmp is a temporary pointer to a tame monster's attributes,
1767 * not a real monster */
1769 pline("So this is how you repay loyalty?");
1771 pline("
\82»
\82ê
\82Å
\82±
\82ê
\82ª
\82 \82È
\82½
\82Ì
\92\89\8b`
\82É
\95ñ
\82¢
\82é
\82à
\82Ì
\82©
\81H");
1774 HAggravate_monster |= FROMOUTSIDE;
1775 } else if (is_undead(ptr)) { /* Not demons--no demon corpses */
1776 if (u.ualign.type != A_CHAOTIC)
1778 } else if (is_unicorn(ptr)) {
1779 int unicalign = sgn(ptr->maligntyp);
1781 if (unicalign == altaralign) {
1782 /* When same as altar, always a very bad action.
1785 pline("Such an action is an insult to %s!",
1786 (unicalign == A_CHAOTIC) ? "chaos"
1787 : unicalign ? "law" : "balance");
1789 pline("
\82»
\82Ì
\82æ
\82¤
\82È
\8ds
\93®
\82Í
\81w%s
\81x
\82É
\94½
\82·
\82é
\81I",
1790 (unicalign == A_CHAOTIC) ? "
\8d¬
\93×"
1791 : unicalign ? "
\92\81\8f\98" : "
\92²
\98a");
1793 (void) adjattrib(A_WIS, -1, TRUE);
1795 } else if (u.ualign.type == altaralign) {
1796 /* When different from altar, and altar is same as yours,
1797 * it's a very good action.
1799 if (u.ualign.record < ALIGNLIM)
1801 You_feel("appropriately %s.", align_str(u.ualign.type));
1803 You("%s
\82É
\82Ó
\82³
\82í
\82µ
\82¢
\82Æ
\8a´
\82¶
\82½
\81D", align_str(u.ualign.type));
1806 You_feel("you are thoroughly on the right path.");
1808 You("
\8a®
\91S
\82É
\90³
\82µ
\82¢
\93¹
\82ð
\95à
\82ñ
\82Å
\82¢
\82é
\82Ì
\82ð
\8a´
\82¶
\82½
\81D");
1811 } else if (unicalign == u.ualign.type) {
1812 /* When sacrificing unicorn of your alignment to altar not of
1813 * your alignment, your god gets angry and it's a conversion.
1815 u.ualign.record = -1;
1818 /* Otherwise, unicorn's alignment is different from yours
1819 * and different from the altar's. It's an ordinary (well,
1820 * with a bonus) sacrifice on a cross-aligned altar.
1827 if (otmp->otyp == AMULET_OF_YENDOR) {
1830 if (altaralign == A_NONE && Inhell)
1831 /* hero has left Moloch's Sanctum so is in the process
1832 of getting away with the Amulet (outside of Gehennom,
1833 fall through to the "ashamed" feedback) */
1840 /* if on track, give a big hint */
1841 : (altaralign == u.ualign.type)
1842 ? "an urge to return to the surface"
1843 /* else headed towards celestial disgrace */
1848 ? "
\8cÌ
\8b½
\82ª
\97ö
\82µ
\82
\82È
\82Á
\82½"
1849 /* if on track, give a big hint */
1850 : (altaralign == u.ualign.type)
1851 ? "
\92n
\8fã
\82É
\8bA
\82è
\82½
\82¢
\8bC
\8e\9d\82É
\8bì
\82è
\97§
\82Ä
\82ç
\82ê
\82½"
1852 /* else headed towards celestial disgrace */
1853 : "
\92p
\82¸
\82©
\82µ
\82¢
\8ev
\82¢
\82ª
\82µ
\82½");
1857 /* The final Test. Did you win? */
1860 u.uevent.ascended = 1;
1862 useup(otmp); /* well, it's gone now */
1866 You("offer the Amulet of Yendor to %s...", a_gname());
1868 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());
1869 if (altaralign == A_NONE) {
1870 /* Moloch's high altar */
1871 if (u.ualign.record > -99)
1872 u.ualign.record = -99;
1873 /*[apparently shrug/snarl can be sensed without being seen]*/
1875 pline("%s shrugs and retains dominion over %s,", Moloch,
1878 pline("%s
\82Í
\8c¨
\82ð
\82·
\82
\82ß
\81C%s
\82É
\91Î
\82·
\82é
\97D
\90¨
\82ð
\88Û
\8e\9d\82µ
\82½
\81D", Moloch,
1882 pline("then mercilessly snuffs out your life.");
1884 pline("
\82»
\82µ
\82Ä
\96³
\8e\9c\94ß
\82É
\82 \82È
\82½
\82Ì
\96½
\82ð
\92D
\82Á
\82½
\81D");
1888 Sprintf(killer.name, "%s indifference", s_suffix(Moloch));
1890 Sprintf(killer.name, "
\97â
\92W
\82È%s", Moloch);
1892 killer.format = KILLED_BY;
1894 /* life-saved (or declined to die in wizard/explore mode) */
1896 pline("%s snarls and tries again...", Moloch);
1898 pline("%s
\82Í
\82Ì
\82Ì
\82µ
\82è
\81C
\82à
\82¤
\88ê
\93x
\8e\8e\82µ
\82½
\81D
\81D
\81D", Moloch);
1899 fry_by_god(A_NONE, TRUE); /* wrath of Moloch */
1900 /* declined to die in wizard or explore mode */
1901 pline(cloud_of_smoke, hcolor(NH_BLACK));
1903 } else if (u.ualign.type != altaralign) {
1904 /* And the opposing team picks you up and
1905 carries you off on their shoulders */
1908 pline("%s accepts your gift, and gains dominion over %s...",
1909 a_gname(), u_gname());
1911 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",
1912 a_gname(), u_gname());
1915 pline("%s is enraged...", u_gname());
1917 pline("%s
\82Í
\8c\83\93{
\82µ
\82½
\81D
\81D
\81D", u_gname());
1919 pline("Fortunately, %s permits you to live...", a_gname());
1921 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());
1922 pline(cloud_of_smoke, hcolor(NH_ORANGE));
1924 } else { /* super big win */
1926 u.uachieve.ascended = 1;
1929 "An invisible choir sings, and you are bathed in radiance...");
1931 "
\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");
1933 godvoice(altaralign, "Congratulations, mortal!");
1935 godvoice(altaralign, "
\82æ
\82
\82â
\82Á
\82½
\81I
\92è
\96½
\82Ì
\8eÒ
\82æ
\81I");
1936 display_nhwindow(WIN_MESSAGE, FALSE);
1939 "In return for thy service, I grant thee the gift of Immortality!");
1941 "
\93ð
\82Ì
\88Ì
\8bÆ
\82É
\91Î
\82µ
\81C
\95s
\8e\80\82Ì
\91Ì
\82ð
\95ù
\82°
\82æ
\82¤
\82¼
\81I");
1943 You("ascend to the status of Demigod%s...",
1944 flags.female ? "dess" : "");
1946 You("
\8f¸
\93V
\82µ
\81C%s
\90_
\82Æ
\82È
\82Á
\82½
\81D
\81D
\81D",
1947 flags.female ? "
\8f\97" : "");
1954 if (otmp->otyp == FAKE_AMULET_OF_YENDOR) {
1955 if (!highaltar && !otmp->known)
1958 You_hear("a nearby thunderclap.");
1960 You("
\8bß
\82
\82É
\97\8b\82ª
\97\8e\82¿
\82½
\89¹
\82ð
\95·
\82¢
\82½
\81D");
1963 You("realize you have made a %s.",
1964 Hallucination ? "boo-boo" : "mistake");
1966 You("%s
\82±
\82Æ
\82É
\8bC
\82ª
\82Â
\82¢
\82½
\81D",
1967 Hallucination ? "
\81u
\83n
\83Y
\83\8c\81v
\82¾
\82Á
\82½" : "
\8aÔ
\88á
\82¢
\82ð
\94Æ
\82µ
\82½");
1973 /* don't you dare try to fool the gods */
1976 pline("Oh, no."); /* didn't hear thunderclap */
1978 pline("
\82È
\82ñ
\82Ä
\82±
\82Á
\82½
\81D"); /* didn't hear thunderclap */
1988 pline1(nothing_happens);
1992 if (altaralign != u.ualign.type && highaltar) {
1993 desecrate_high_altar:
1995 * REAL BAD NEWS!!! High altars cannot be converted. Even an attempt
1996 * gets the god who owns it truly pissed off.
1999 You_feel("the air around you grow charged...");
2001 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");
2003 pline("Suddenly, you realize that %s has noticed you...", a_gname());
2005 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());
2006 godvoice(altaralign,
2008 "So, mortal! You dare desecrate my High Temple!");
2010 "
\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");
2011 /* Throw everything we have at the player */
2012 god_zaps_you(altaralign);
2014 < 0) { /* I don't think the gods are gonna like this... */
2015 gods_upset(altaralign);
2017 int saved_anger = u.ugangr;
2018 int saved_cnt = u.ublesscnt;
2019 int saved_luck = u.uluck;
2021 /* Sacrificing at an altar of a different alignment */
2022 if (u.ualign.type != altaralign) {
2023 /* Is this a conversion ? */
2024 /* An unaligned altar in Gehennom will always elicit rejection. */
2025 if (ugod_is_angry() || (altaralign == A_NONE && Inhell)) {
2026 if (u.ualignbase[A_CURRENT] == u.ualignbase[A_ORIGINAL]
2027 && altaralign != A_NONE) {
2029 You("have a strong feeling that %s is angry...",
2031 You("%s
\82ª
\93{
\82Á
\82Ä
\82¢
\82é
\82Ì
\82ð
\8am
\90M
\82µ
\82½
\81D
\81D
\81D",
2033 consume_offering(otmp);
2035 pline("%s accepts your allegiance.", a_gname());
2037 pline("%s
\82Í
\82 \82È
\82½
\82Ì
\91®
\90«
\82ð
\8eó
\82¯
\82¢
\82ê
\82½
\81D", a_gname());
2039 uchangealign(altaralign, 0);
2040 /* Beware, Conversion is costly */
2047 pline("%s rejects your sacrifice!", a_gname());
2049 pline("%s
\82Í
\82 \82È
\82½
\82Ì
\8c£
\8fã
\95¨
\82ð
\8eó
\82¯
\82¢
\82ê
\82È
\82¢
\81I", a_gname());
2051 godvoice(altaralign, "Suffer, infidel!");
2053 godvoice(altaralign, "
\88Ù
\92[
\8eÒ
\82æ
\81I
\8e¸
\82¹
\82ë
\81I
\81I");
2055 (void) adjattrib(A_WIS, -2, TRUE);
2057 angrygods(u.ualign.type);
2061 consume_offering(otmp);
2063 You("sense a conflict between %s and %s.", u_gname(),
2066 You("%s
\82Æ%s
\8aÔ
\82Ì
\91\88\82¢
\82ð
\8a´
\82¶
\82½
\81D", u_gname(),
2069 if (rn2(8 + u.ulevel) > 5) {
2072 You_feel("the power of %s increase.", u_gname());
2074 You("%s
\82Ì
\97Í
\82ª
\91\9d\91å
\82µ
\82½
\82æ
\82¤
\82È
\8bC
\82ª
\82µ
\82½
\81D", u_gname());
2075 exercise(A_WIS, TRUE);
2077 /* Yes, this is supposed to be &=, not |= */
2078 levl[u.ux][u.uy].altarmask &= AM_SHRINE;
2079 /* the following accommodates stupid compilers */
2080 levl[u.ux][u.uy].altarmask =
2081 levl[u.ux][u.uy].altarmask
2082 | (Align2amask(u.ualign.type));
2085 pline_The("altar glows %s.",
2086 hcolor((u.ualign.type == A_LAWFUL)
2090 : (const char *) "gray"));
2092 pline("
\8dÕ
\92d
\82Í%s
\8bP
\82¢
\82½
\81D",
2093 jconj_adj(hcolor((u.ualign.type == A_LAWFUL)
2097 : (const char *)"
\8aD
\90F
\82Ì")));
2100 if (rnl(u.ulevel) > 6 && u.ualign.record > 0
2101 && rnd(u.ualign.record) > (3 * ALIGNLIM) / 4)
2102 summon_minion(altaralign, TRUE);
2103 /* anger priest; test handles bones files */
2104 if ((pri = findpriest(temple_occupied(u.urooms)))
2105 && !p_coaligned(pri))
2109 pline("Unluckily, you feel the power of %s decrease.",
2111 pline("
\95s
\8dK
\82É
\82à
\81C%s
\82Ì
\97Í
\82ª
\8c¸
\8f
\82µ
\82½
\82Ì
\82ð
\8a´
\82¶
\82½
\81D",
2114 exercise(A_WIS, FALSE);
2115 if (rnl(u.ulevel) > 6 && u.ualign.record > 0
2116 && rnd(u.ualign.record) > (7 * ALIGNLIM) / 8)
2117 summon_minion(altaralign, TRUE);
2123 consume_offering(otmp);
2124 /* OK, you get brownie points. */
2126 u.ugangr -= ((value * (u.ualign.type == A_CHAOTIC ? 2 : 3))
2130 if (u.ugangr != saved_anger) {
2133 pline("%s seems %s.", u_gname(),
2134 Hallucination ? "groovy" : "slightly mollified");
2136 pline("%s
\82Í%s
\82É
\8c©
\82¦
\82é
\81D", u_gname(),
2137 Hallucination ? "
\91f
\93G" : "
\82¿
\82å
\82Á
\82Æ
\98a
\82ç
\82¢
\82¾
\82æ
\82¤");
2140 if ((int) u.uluck < 0)
2144 pline("%s seems %s.", u_gname(),
2145 Hallucination ? "cosmic (not a new fact)"
2148 pline("%s
\82Í%s
\82É
\8c©
\82¦
\82é
\81D", u_gname(),
2149 Hallucination ? "
\93ø
\90F(
\90V
\8e\96\8eÀ
\82Å
\82Í
\82È
\82¢)"
2150 : "
\8cy
\95Ì
\82µ
\82½
\82æ
\82¤");
2153 if ((int) u.uluck < 0)
2156 } else { /* not satisfied yet */
2159 pline_The("gods seem tall.");
2161 pline("
\90_
\82Í
\82¨
\8d\82\82
\82Æ
\82Ü
\82Á
\82Ä
\82¢
\82é
\82æ
\82¤
\82É
\8c©
\82¦
\82é
\81D");
2164 You("have a feeling of inadequacy.");
2166 You("
\82Ü
\82¾
\82Ü
\82¾
\82¾
\82Æ
\8a´
\82¶
\82½
\81D");
2168 } else if (ugod_is_angry()) {
2169 if (value > MAXVALUE)
2171 if (value > -u.ualign.record)
2172 value = -u.ualign.record;
2175 You_feel("partially absolved.");
2177 You("
\8f
\82µ
\82¾
\82¯
\82ä
\82é
\82µ
\82Ä
\82à
\82ç
\82¦
\82½
\82æ
\82¤
\82È
\8bC
\82ª
\82µ
\82½
\81D");
2178 } else if (u.ublesscnt > 0) {
2179 u.ublesscnt -= ((value * (u.ualign.type == A_CHAOTIC ? 500 : 300))
2181 if (u.ublesscnt < 0)
2183 if (u.ublesscnt != saved_cnt) {
2187 You("realize that the gods are not like you and I.");
2189 You("
\90_
\82Æ
\83c
\81[
\83J
\81[
\82Ì
\92\87\82Å
\82Í
\82È
\82¢
\82±
\82Æ
\82ð
\8cå
\82Á
\82½
\81D");
2192 You("have a hopeful feeling.");
2194 pline("
\8aó
\96]
\82ª
\8c©
\82¦
\82Ä
\82«
\82½
\82æ
\82¤
\82È
\8bC
\82ª
\82µ
\82½
\81D");
2195 if ((int) u.uluck < 0)
2200 pline("Overall, there is a smell of fried onions.");
2202 pline("
\82½
\82Ü
\82Ë
\82¬
\82ð
\97g
\82°
\82½
\93õ
\82¢
\82ª
\82µ
\82½
\81D");
2205 You("have a feeling of reconciliation.");
2207 You("
\8b\96\82³
\82ê
\82½
\8bC
\82ª
\82µ
\82½
\81D");
2208 if ((int) u.uluck < 0)
2213 int nartifacts = nartifact_exist();
2215 /* you were already in pretty good standing */
2216 /* The player can gain an artifact */
2217 /* The chance goes down as the number of artifacts goes up */
2218 if (u.ulevel > 2 && u.uluck >= 0
2219 && !rn2(10 + (2 * u.ugifts * nartifacts))) {
2220 otmp = mk_artifact((struct obj *) 0, a_align(u.ux, u.uy));
2226 otmp->oerodeproof = TRUE;
2228 at_your_feet("An object");
2230 at_your_feet("
\89½
\82©");
2233 godvoice(u.ualign.type, "Use my gift wisely!");
2235 godvoice(u.ualign.type, "
\89ä
\82ª
\97^
\82¦
\82µ
\82à
\82Ì
\8c«
\82
\8eg
\82¤
\82×
\82µ
\81I");
2237 u.ublesscnt = rnz(300 + (50 * nartifacts));
2238 exercise(A_WIS, TRUE);
2239 /* make sure we can use this weapon */
2240 unrestrict_weapon_skill(weapon_type(otmp));
2241 if (!Hallucination && !Blind) {
2243 makeknown(otmp->otyp);
2244 discover_artifact(otmp->oartifact);
2249 change_luck((value * LUCKMAX) / (MAXVALUE * 2));
2250 if ((int) u.uluck < 0)
2252 if (u.uluck != saved_luck) {
2255 You("think %s brushed your %s.", something,
2258 pline("%s
\82ª
\82 \82È
\82½
\82Ì%s
\82ð
\82
\82·
\82®
\82Á
\82½
\82æ
\82¤
\82¾
\81D", something,
2264 ? "see crabgrass at your %s. A funny thing in a dungeon."
2265 : "glimpse a four-leaf clover at your %s.",
2266 makeplural(body_part(FOOT)));
2269 ? "
\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"
2270 : "
\8el
\97t
\82Ì
\83N
\83\8d\81[
\83o
\81[
\82ð
\91«
\8c³
\82É
\8c©
\82Â
\82¯
\82½
\81D");
2278 /* determine prayer results in advance; also used for enlightenment */
2281 boolean praying; /* false means no messages should be given */
2285 p_aligntyp = on_altar() ? a_align(u.ux, u.uy) : u.ualign.type;
2286 p_trouble = in_trouble();
2288 if (is_demon(youmonst.data) && (p_aligntyp != A_CHAOTIC)) {
2291 pline_The("very idea of praying to a %s god is repugnant to you.",
2292 p_aligntyp ? "lawful" : "neutral");
2294 pline("%s
\82Ì
\90_
\82É
\8bF
\82è
\82ð
\82³
\82³
\82°
\82é
\82Ì
\82Í
\8fí
\8e¯
\82É
\94w
\82
\81D",
2295 p_aligntyp ? "
\92\81\8f\98" : "
\92\86\97§");
2302 You("begin praying to %s.", align_gname(p_aligntyp));
2304 You("%s
\82É
\8bF
\82è
\82ð
\95ù
\82°
\82½
\81D", align_gname(p_aligntyp));
2306 if (u.ualign.type && u.ualign.type == -p_aligntyp)
2307 alignment = -u.ualign.record; /* Opposite alignment altar */
2308 else if (u.ualign.type != p_aligntyp)
2309 alignment = u.ualign.record / 2; /* Different alignment altar */
2311 alignment = u.ualign.record;
2313 if ((p_trouble > 0) ? (u.ublesscnt > 200) /* big trouble */
2314 : (p_trouble < 0) ? (u.ublesscnt > 100) /* minor difficulties */
2315 : (u.ublesscnt > 0)) /* not in trouble */
2316 p_type = 0; /* too soon... */
2317 else if ((int) Luck < 0 || u.ugangr || alignment < 0)
2318 p_type = 1; /* too naughty... */
2319 else /* alignment >= 0 */ {
2320 if (on_altar() && u.ualign.type != p_aligntyp)
2326 if (is_undead(youmonst.data) && !Inhell
2327 && (p_aligntyp == A_LAWFUL || (p_aligntyp == A_NEUTRAL && !rn2(10))))
2329 /* Note: when !praying, the random factor for neutrals makes the
2330 return value a non-deterministic approximation for enlightenment.
2331 This case should be uncommon enough to live with... */
2333 return !praying ? (boolean) (p_type == 3 && !Inhell) : TRUE;
2336 /* #pray commmand */
2340 /* Confirm accidental slips of Alt-P */
2342 if (ParanoidPray && yn("Are you sure you want to pray?") != 'y')
2344 if (ParanoidPray && yn("
\8bF
\82è
\82Ü
\82·
\82©
\81H") != 'y')
2347 u.uconduct.gnostic++;
2349 /* set up p_type and p_alignment */
2350 if (!can_pray(TRUE))
2353 if (wizard && p_type >= 0) {
2355 if (yn("Force the gods to be pleased?") == 'y') {
2357 if (yn("
\96³
\97\9d\96î
\97\9d\90_
\82É
\94÷
\8fÎ
\82ñ
\82Å
\82à
\82ç
\82¢
\82Ü
\82·
\82©
\81H") == 'y') {
2361 if (u.ualign.record <= 0)
2362 u.ualign.record = 1;
2369 multi_reason = "praying";
2371 nomovemsg = "You finish your prayer.";
2373 nomovemsg = "
\8bF
\82è
\8fI
\82¦
\82½
\81D";
2374 afternmv = prayer_done;
2376 if (p_type == 3 && !Inhell) {
2377 /* if you've been true to your god you can't die while you pray */
2380 You("are surrounded by a shimmering light.");
2382 You("
\82©
\82·
\82©
\82È
\8cõ
\82É
\82Â
\82Â
\82Ü
\82ê
\82½
\81D");
2383 u.uinvulnerable = TRUE;
2390 prayer_done() /* M. Stephenson (1.0.3b) */
2392 aligntyp alignment = p_aligntyp;
2394 u.uinvulnerable = FALSE;
2398 (alignment == A_LAWFUL)
2399 ? "Vile creature, thou durst call upon me?"
2400 : "Walk no more, perversion of nature!");
2403 (alignment == A_LAWFUL)
2404 ? "
\94Ú
\97ò
\82È
\90¶
\95¨
\82æ
\81C
\93ð
\81C
\89ä
\82É
\8bF
\82è
\82ð
\8b\81\82ß
\82½
\82©
\81H"
2405 : "
\93®
\82
\82È
\81I
\8e\80\82É
\82¼
\82±
\82È
\82¢
\82Ì
\90¶
\95¨
\82æ
\81I");
2408 You_feel("like you are falling apart.");
2410 You("
\83o
\83\89\83o
\83\89\82É
\82È
\82Á
\82½
\82æ
\82¤
\82È
\8bC
\82ª
\82µ
\82½
\81D");
2411 /* KMH -- Gods have mastery over unchanging */
2413 /* no Half_physical_damage adjustment here */
2415 losehp(rnd(20), "residual undead turning effect", KILLED_BY_AN);
2417 losehp(rnd(20), "
\95s
\8e\80\82Ì
\90¶
\95¨
\82ð
\93y
\82É
\95Ô
\82·
\97Í
\82Å", KILLED_BY_AN);
2418 exercise(A_CON, FALSE);
2423 pline("Since you are in Gehennom, %s won't help you.",
2425 pline("
\83Q
\83w
\83i
\82É%s
\82Ì
\97Í
\82Í
\93Í
\82©
\82È
\82¢
\81D",
2426 align_gname(alignment));
2427 /* haltingly aligned is least likely to anger */
2428 if (u.ualign.record <= 0 || rnl(u.ualign.record))
2429 angrygods(u.ualign.type);
2434 if (on_altar() && u.ualign.type != alignment)
2435 (void) water_prayer(FALSE);
2436 u.ublesscnt += rnz(250);
2438 gods_upset(u.ualign.type);
2439 } else if (p_type == 1) {
2440 if (on_altar() && u.ualign.type != alignment)
2441 (void) water_prayer(FALSE);
2442 angrygods(u.ualign.type); /* naughty */
2443 } else if (p_type == 2) {
2444 if (water_prayer(FALSE)) {
2445 /* attempted water prayer on a non-coaligned altar */
2446 u.ublesscnt += rnz(250);
2448 gods_upset(u.ualign.type);
2454 (void) water_prayer(TRUE);
2455 pleased(alignment); /* nice */
2464 /* Knights & Priest(esse)s only please */
2465 struct monst *mtmp, *mtmp2;
2466 int once, range, xlev;
2468 if (!Role_if(PM_PRIEST) && !Role_if(PM_KNIGHT)) {
2469 /* Try to use the "turn undead" spell.
2471 * This used to be based on whether hero knows the name of the
2472 * turn undead spellbook, but it's possible to know--and be able
2473 * to cast--the spell while having lost the book ID to amnesia.
2474 * (It also used to tell spelleffects() to cast at self?)
2478 for (sp_no = 0; sp_no < MAXSPELL; ++sp_no) {
2479 if (spl_book[sp_no].sp_id == NO_SPELL)
2481 else if (spl_book[sp_no].sp_id == SPE_TURN_UNDEAD)
2482 return spelleffects(sp_no, FALSE);
2485 You("don't know how to turn undead!");
2487 You("
\95s
\8e\80\82Ì
\90¶
\82«
\95¨
\82ð
\93y
\82É
\96ß
\82·
\95û
\96@
\82ð
\92m
\82ç
\82È
\82¢
\81I");
2490 u.uconduct.gnostic++;
2492 if ((u.ualign.type != A_CHAOTIC
2493 && (is_demon(youmonst.data) || is_undead(youmonst.data)))
2494 || u.ugangr > 6) { /* "Die, mortal!" */
2496 pline("For some reason, %s seems to ignore you.", u_gname());
2498 pline("
\82È
\82º
\82©
\81C%s
\82Í
\82 \82È
\82½
\82ð
\96³
\8e\8b\82µ
\82½
\82æ
\82¤
\82¾
\81D", u_gname());
2500 exercise(A_WIS, FALSE);
2505 pline("Since you are in Gehennom, %s won't help you.", u_gname());
2507 pline("
\83Q
\83w
\83i
\82É%s
\82Ì
\97Í
\82Í
\93Í
\82©
\82È
\82¢
\81D", u_gname());
2512 pline("Calling upon %s, you chant an arcane formula.", u_gname());
2514 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());
2515 exercise(A_WIS, TRUE);
2517 /* note: does not perform unturn_dead() on victims' inventories */
2518 range = BOLT_LIM + (u.ulevel / 5); /* 5 to 11 */
2521 for (mtmp = fmon; mtmp; mtmp = mtmp2) {
2524 if (DEADMONSTER(mtmp))
2526 if (!cansee(mtmp->mx, mtmp->my) || distu(mtmp->mx, mtmp->my) > range)
2529 if (!mtmp->mpeaceful
2530 && (is_undead(mtmp->data) || is_vampshifter(mtmp)
2531 || (is_demon(mtmp->data) && (u.ulevel > (MAXULEV / 2))))) {
2532 mtmp->msleeping = 0;
2536 pline("Unfortunately, your voice falters.");
2538 pline("
\8ec
\94O
\82È
\82ª
\82ç
\81C
\82 \82È
\82½
\82Ì
\90º
\82Í
\82Ç
\82à
\82Á
\82Ä
\82µ
\82Ü
\82Á
\82½
\81D");
2542 } else if (!resist(mtmp, '\0', 0, TELL)) {
2544 switch (mtmp->data->mlet) {
2545 /* this is intentional, lichs are tougher
2548 xlev += 2; /*FALLTHRU*/
2550 xlev += 2; /*FALLTHRU*/
2552 xlev += 2; /*FALLTHRU*/
2554 xlev += 2; /*FALLTHRU*/
2556 xlev += 2; /*FALLTHRU*/
2558 if (u.ulevel >= xlev && !resist(mtmp, '\0', 0, NOTELL)) {
2559 if (u.ualign.type == A_CHAOTIC) {
2560 mtmp->mpeaceful = 1;
2562 } else { /* damn them */
2569 monflee(mtmp, 0, FALSE, TRUE);
2576 multi_reason = "trying to turn the monsters";
2577 nomovemsg = You_can_move_again;
2584 return a_gname_at(u.ux, u.uy);
2587 /* returns the name of an altar's deity */
2592 if (!IS_ALTAR(levl[x][y].typ))
2595 return align_gname(a_align(x, y));
2598 /* returns the name of the hero's deity */
2602 return align_gname(u.ualign.type);
2606 align_gname(alignment)
2611 switch (alignment) {
2625 impossible("unknown alignment.");
2637 static const char *hallu_gods[] = {
2639 "the Flying Spaghetti Monster", /* Church of the FSM */
2640 "Eris", /* Discordianism */
2641 "the Martians", /* every science fiction ever */
2643 "AnDoR dRaKoN", /* ADOM */
2644 "the Central Bank of Yendor", /* economics */
2645 "Tooth Fairy", /* real world(?) */
2646 "Om", /* Discworld */
2647 "Yawgmoth", /* Magic: the Gathering */
2648 "Morgoth", /* LoTR */
2649 "Cthulhu", /* Lovecraft */
2650 "the Ori", /* Stargate */
2651 "destiny", /* why not? */
2652 "your Friend the Computer", /* Paranoia */
2654 "
\8bó
\94ò
\82Ô
\83X
\83p
\83Q
\83b
\83e
\83B
\83\82\83\93\83X
\83^
\81[", /* Church of the FSM */
2655 "
\83G
\83\8a\83X", /* Discordianism */
2656 "
\89Î
\90¯
\90l", /* every science fiction ever */
2657 "
\83]
\83\80", /* Crawl */
2658 "
\83A
\83\93\83h
\81[
\83\8b\81E
\83h
\83\89\83R
\83\93", /* ADOM */
2659 "
\83C
\83F
\83\93\83_
\81[
\92\86\89\9b\8bâ
\8ds", /* economics */
2660 "
\8e\95\82Ì
\97d
\90¸", /* real world(?) */
2661 "
\83I
\83\80", /* Discworld */
2662 "
\83\88\81[
\83O
\83\82\83X", /* Magic: the Gathering */
2663 "
\83\82\83\8b\83S
\83X", /* LoTR */
2664 "
\83N
\83g
\83D
\83\8b\83t", /* Lovecraft */
2665 "
\83I
\81[
\83\89\83C", /* Stargate */
2666 "
\83l
\90\", /* why not? */
2667 "
\90e
\88¤
\82È
\82é
\83R
\83\93\83s
\83\85\81[
\83^", /* Paranoia */
2671 /* hallucination handling for priest/minion names: select a random god
2672 iff character is hallucinating */
2674 halu_gname(alignment)
2677 const char *gnam = NULL;
2681 return align_gname(alignment);
2683 /* The priest may not have initialized god names. If this is the
2684 * case, and we roll priest, we need to try again. */
2687 while (!roles[which].lgod);
2692 gnam = roles[which].lgod;
2696 gnam = roles[which].ngod;
2700 gnam = roles[which].cgod;
2704 gnam = hallu_gods[rn2(sizeof hallu_gods / sizeof *hallu_gods)];
2710 impossible("rn2 broken in halu_gname?!?");
2713 impossible("No random god name?");
2715 gnam = "your Friend the Computer"; /* Paranoia */
2717 gnam = "
\90e
\88¤
\82È
\82é
\83R
\83\93\83s
\83\85\81[
\83^"; /* Paranoia */
2727 align_gtitle(alignment)
2731 const char *gnam, *result = "god";
2733 const char *gnam, *result = "
\8eå
\90_";
2735 switch (alignment) {
2749 if (gnam && *gnam == '_')
2753 result = "
\8f\97\90_";
2761 aligntyp altaralign = a_align(x, y);
2763 if (!strcmp(align_gname(altaralign), u_gname())) {
2765 godvoice(altaralign, "How darest thou desecrate my altar!");
2767 godvoice(altaralign, "
\93ð
\81C
\89ä
\82ª
\8dÕ
\92d
\82ð
\89\98\82·
\82©
\81I");
2768 (void) adjattrib(A_WIS, -1, FALSE);
2771 pline("A voice (could it be %s?) whispers:", align_gname(altaralign));
2773 pline("
\82³
\82³
\82â
\82«
\90º(
\82½
\82Ô
\82ñ%s
\81H)
\82ª
\95·
\82±
\82¦
\82é:", align_gname(altaralign));
2775 verbalize("Thou shalt pay, infidel!");
2777 verbalize("
\88Ù
\92[
\8eÒ
\82æ
\81I
\95ñ
\82¢
\82ð
\8eó
\82¯
\82æ
\81I");
2782 /* assumes isok() at one space away, but not necessarily at two */
2784 blocked_boulder(dx, dy)
2787 register struct obj *otmp;
2790 for (otmp = level.objects[u.ux + dx][u.uy + dy]; otmp;
2791 otmp = otmp->nexthere) {
2792 if (otmp->otyp == BOULDER)
2793 count += otmp->quan;
2798 /* no boulders--not blocked */
2801 /* possibly blocked depending on if it's pushable */
2804 /* more than one boulder--blocked after they push the top one;
2805 don't force them to push it first to find out */
2809 if (!isok(u.ux + 2 * dx, u.uy + 2 * dy))
2811 if (IS_ROCK(levl[u.ux + 2 * dx][u.uy + 2 * dy].typ))
2813 if (sobj_at(BOULDER, u.ux + 2 * dx, u.uy + 2 * dy))