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));
1616 otmp = floorfood("sacrifice", 1);
1620 * Was based on nutritional value and aging behavior (< 50 moves).
1621 * Sacrificing a food ration got you max luck instantly, making the
1622 * gods as easy to please as an angry dog!
1624 * Now only accepts corpses, based on the game's evaluation of their
1625 * toughness. Human and pet sacrifice, as well as sacrificing unicorns
1626 * of your alignment, is strongly discouraged.
1628 #define MAXVALUE 24 /* Highest corpse value (besides Wiz) */
1630 if (otmp->otyp == CORPSE) {
1631 register struct permonst *ptr = &mons[otmp->corpsenm];
1633 extern const int monstr[];
1636 u.uconduct.gnostic++;
1638 /* you're handling this corpse, even if it was killed upon the altar
1640 feel_cockatrice(otmp, TRUE);
1641 if (rider_corpse_revival(otmp, FALSE))
1644 if (otmp->corpsenm == PM_ACID_BLOB
1645 || (monstermoves <= peek_at_iced_corpse_age(otmp) + 50)) {
1646 value = monstr[otmp->corpsenm] + 1;
1648 value = eaten_stat(value, otmp);
1651 if (your_race(ptr)) {
1652 if (is_demon(youmonst.data)) {
1654 You("find the idea very satisfying.");
1656 You("
\82»
\82Ì
\8dl
\82¦
\82Í
\91f
\90°
\82µ
\82¢
\82Æ
\8ev
\82Á
\82½
\81D");
1657 exercise(A_WIS, TRUE);
1658 } else if (u.ualign.type != A_CHAOTIC) {
1660 pline("You'll regret this infamous offense!");
1662 pline("
\93ð
\81C
\82±
\82Ì
\95\8e\90J
\82Ì
\8ds
\82È
\82¢
\82ð
\8cã
\89÷
\82·
\82é
\82×
\82µ
\81I");
1663 exercise(A_WIS, FALSE);
1667 && (altaralign != A_CHAOTIC || u.ualign.type != A_CHAOTIC)) {
1668 goto desecrate_high_altar;
1669 } else if (altaralign != A_CHAOTIC && altaralign != A_NONE) {
1670 /* curse the lawful/neutral altar */
1672 pline_The("altar is stained with %s blood.", urace.adj);
1674 pline("
\8dÕ
\92d
\82Í%s
\82Ì
\8c\8c\82Å
\89\98\82ê
\82Ä
\82¢
\82é
\81D", urace.adj);
1675 levl[u.ux][u.uy].altarmask = AM_CHAOTIC;
1679 const char *demonless_msg;
1681 /* Human sacrifice on a chaotic or unaligned altar */
1682 /* is equivalent to demon summoning */
1683 if (altaralign == A_CHAOTIC && u.ualign.type != A_CHAOTIC) {
1686 "The blood floods the altar, which vanishes in %s cloud!",
1688 "
\8c\8c\82ª
\8dÕ
\92d
\82©
\82ç
\82 \82Ó
\82ê
\81C
\8dÕ
\92d
\82Í%s
\89_
\82Æ
\82È
\82è
\8fÁ
\82¦
\82½
\81I",
1689 an(hcolor(NH_BLACK)));
1690 levl[u.ux][u.uy].typ = ROOM;
1691 levl[u.ux][u.uy].altarmask = 0;
1695 demonless_msg = "cloud dissipates";
1697 demonless_msg = "
\89_
\82Í
\8fÁ
\82¦
\82½
\81D";
1699 /* either you're chaotic or altar is Moloch's or both */
1701 pline_The("blood covers the altar!");
1703 pline("
\8c\8c\82ª
\8dÕ
\92d
\82ð
\95¢
\82Á
\82½
\81I");
1704 change_luck(altaralign == A_NONE ? -2 : 2);
1706 demonless_msg = "blood coagulates";
1708 demonless_msg = "
\8c\8c\82ª
\82±
\82Ñ
\82è
\82Â
\82¢
\82½";
1710 if ((pm = dlord(altaralign)) != NON_PM
1711 && (dmon = makemon(&mons[pm], u.ux, u.uy, NO_MM_FLAGS))
1715 Strcpy(dbuf, a_monnam(dmon));
1717 if (!strcmpi(dbuf, "it"))
1719 if (!strcmpi(dbuf, "
\89½
\8eÒ
\82©"))
1721 Strcpy(dbuf, "something dreadful");
1723 Strcpy(dbuf, "
\89½
\82©
\8b°
\82ë
\82µ
\82¢
\82à
\82Ì");
1725 dmon->mstrategy &= ~STRAT_APPEARMSG;
1727 You("have summoned %s!", dbuf);
1729 You("%s
\82ð
\8f¢
\8a«
\82µ
\82½
\81I", dbuf);
1730 if (sgn(u.ualign.type) == sgn(dmon->data->maligntyp))
1731 dmon->mpeaceful = TRUE;
1733 You("are terrified, and unable to move.");
1735 You("
\8b°
\95|
\82Å
\93®
\82¯
\82È
\82
\82È
\82Á
\82½
\81D");
1737 multi_reason = "being terrified of a demon";
1741 pline_The("%s.", demonless_msg);
1743 pline("%s
\81D", demonless_msg);
1746 if (u.ualign.type != A_CHAOTIC) {
1749 (void) adjattrib(A_WIS, -1, TRUE);
1751 angrygods(u.ualign.type);
1760 } else if (has_omonst(otmp)
1761 && (mtmp = get_mtraits(otmp, FALSE)) != 0
1763 /* mtmp is a temporary pointer to a tame monster's attributes,
1764 * not a real monster */
1766 pline("So this is how you repay loyalty?");
1768 pline("
\82»
\82ê
\82Å
\82±
\82ê
\82ª
\82 \82È
\82½
\82Ì
\92\89\8b`
\82É
\95ñ
\82¢
\82é
\82à
\82Ì
\82©
\81H");
1771 HAggravate_monster |= FROMOUTSIDE;
1772 } else if (is_undead(ptr)) { /* Not demons--no demon corpses */
1773 if (u.ualign.type != A_CHAOTIC)
1775 } else if (is_unicorn(ptr)) {
1776 int unicalign = sgn(ptr->maligntyp);
1778 if (unicalign == altaralign) {
1779 /* When same as altar, always a very bad action.
1782 pline("Such an action is an insult to %s!",
1783 (unicalign == A_CHAOTIC) ? "chaos"
1784 : unicalign ? "law" : "balance");
1786 pline("
\82»
\82Ì
\82æ
\82¤
\82È
\8ds
\93®
\82Í
\81w%s
\81x
\82É
\94½
\82·
\82é
\81I",
1787 (unicalign == A_CHAOTIC) ? "
\8d¬
\93×"
1788 : unicalign ? "
\92\81\8f\98" : "
\92²
\98a");
1790 (void) adjattrib(A_WIS, -1, TRUE);
1792 } else if (u.ualign.type == altaralign) {
1793 /* When different from altar, and altar is same as yours,
1794 * it's a very good action.
1796 if (u.ualign.record < ALIGNLIM)
1798 You_feel("appropriately %s.", align_str(u.ualign.type));
1800 You("%s
\82É
\82Ó
\82³
\82í
\82µ
\82¢
\82Æ
\8a´
\82¶
\82½
\81D", align_str(u.ualign.type));
1803 You_feel("you are thoroughly on the right path.");
1805 You("
\8a®
\91S
\82É
\90³
\82µ
\82¢
\93¹
\82ð
\95à
\82ñ
\82Å
\82¢
\82é
\82Ì
\82ð
\8a´
\82¶
\82½
\81D");
1808 } else if (unicalign == u.ualign.type) {
1809 /* When sacrificing unicorn of your alignment to altar not of
1810 * your alignment, your god gets angry and it's a conversion.
1812 u.ualign.record = -1;
1815 /* Otherwise, unicorn's alignment is different from yours
1816 * and different from the altar's. It's an ordinary (well,
1817 * with a bonus) sacrifice on a cross-aligned altar.
1824 if (otmp->otyp == AMULET_OF_YENDOR) {
1827 if (altaralign == A_NONE && Inhell)
1828 /* hero has left Moloch's Sanctum so is in the process
1829 of getting away with the Amulet (outside of Gehennom,
1830 fall through to the "ashamed" feedback) */
1837 /* if on track, give a big hint */
1838 : (altaralign == u.ualign.type)
1839 ? "an urge to return to the surface"
1840 /* else headed towards celestial disgrace */
1845 ? "
\8cÌ
\8b½
\82ª
\97ö
\82µ
\82
\82È
\82Á
\82½"
1846 /* if on track, give a big hint */
1847 : (altaralign == u.ualign.type)
1848 ? "
\92n
\8fã
\82É
\8bA
\82è
\82½
\82¢
\8bC
\8e\9d\82É
\8bì
\82è
\97§
\82Ä
\82ç
\82ê
\82½"
1849 /* else headed towards celestial disgrace */
1850 : "
\92p
\82¸
\82©
\82µ
\82¢
\8ev
\82¢
\82ª
\82µ
\82½");
1854 /* The final Test. Did you win? */
1857 u.uevent.ascended = 1;
1859 useup(otmp); /* well, it's gone now */
1863 You("offer the Amulet of Yendor to %s...", a_gname());
1865 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());
1866 if (altaralign == A_NONE) {
1867 /* Moloch's high altar */
1868 if (u.ualign.record > -99)
1869 u.ualign.record = -99;
1870 /*[apparently shrug/snarl can be sensed without being seen]*/
1871 pline("%s shrugs and retains dominion over %s,", Moloch,
1873 pline("then mercilessly snuffs out your life.");
1874 Sprintf(killer.name, "%s indifference", s_suffix(Moloch));
1875 killer.format = KILLED_BY;
1877 /* life-saved (or declined to die in wizard/explore mode) */
1878 pline("%s snarls and tries again...", Moloch);
1879 fry_by_god(A_NONE, TRUE); /* wrath of Moloch */
1880 /* declined to die in wizard or explore mode */
1881 pline(cloud_of_smoke, hcolor(NH_BLACK));
1883 } else if (u.ualign.type != altaralign) {
1884 /* And the opposing team picks you up and
1885 carries you off on their shoulders */
1888 pline("%s accepts your gift, and gains dominion over %s...",
1889 a_gname(), u_gname());
1891 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",
1892 a_gname(), u_gname());
1895 pline("%s is enraged...", u_gname());
1897 pline("%s
\82Í
\8c\83\93{
\82µ
\82½
\81D
\81D
\81D", u_gname());
1899 pline("Fortunately, %s permits you to live...", a_gname());
1901 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());
1902 pline(cloud_of_smoke, hcolor(NH_ORANGE));
1904 } else { /* super big win */
1906 u.uachieve.ascended = 1;
1909 "An invisible choir sings, and you are bathed in radiance...");
1911 "
\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");
1913 godvoice(altaralign, "Congratulations, mortal!");
1915 godvoice(altaralign, "
\82æ
\82
\82â
\82Á
\82½
\81I
\92è
\96½
\82Ì
\8eÒ
\82æ
\81I");
1916 display_nhwindow(WIN_MESSAGE, FALSE);
1919 "In return for thy service, I grant thee the gift of Immortality!");
1921 "
\93ð
\82Ì
\88Ì
\8bÆ
\82É
\91Î
\82µ
\81C
\95s
\8e\80\82Ì
\91Ì
\82ð
\95ù
\82°
\82æ
\82¤
\82¼
\81I");
1923 You("ascend to the status of Demigod%s...",
1924 flags.female ? "dess" : "");
1926 You("
\8f¸
\93V
\82µ
\81C%s
\90_
\82Æ
\82È
\82Á
\82½
\81D
\81D
\81D",
1927 flags.female ? "
\8f\97" : "");
1934 if (otmp->otyp == FAKE_AMULET_OF_YENDOR) {
1935 if (!highaltar && !otmp->known)
1938 You_hear("a nearby thunderclap.");
1940 You("
\8bß
\82
\82É
\97\8b\82ª
\97\8e\82¿
\82½
\89¹
\82ð
\95·
\82¢
\82½
\81D");
1943 You("realize you have made a %s.",
1944 Hallucination ? "boo-boo" : "mistake");
1946 You("%s
\82±
\82Æ
\82É
\8bC
\82ª
\82Â
\82¢
\82½
\81D",
1947 Hallucination ? "
\81u
\83n
\83Y
\83\8c\81v
\82¾
\82Á
\82½" : "
\8aÔ
\88á
\82¢
\82ð
\94Æ
\82µ
\82½");
1953 /* don't you dare try to fool the gods */
1956 pline("Oh, no."); /* didn't hear thunderclap */
1958 pline("
\82È
\82ñ
\82Ä
\82±
\82Á
\82½
\81D"); /* didn't hear thunderclap */
1968 pline1(nothing_happens);
1972 if (altaralign != u.ualign.type && highaltar) {
1973 desecrate_high_altar:
1975 * REAL BAD NEWS!!! High altars cannot be converted. Even an attempt
1976 * gets the god who owns it truly pissed off.
1979 You_feel("the air around you grow charged...");
1981 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");
1983 pline("Suddenly, you realize that %s has noticed you...", a_gname());
1985 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());
1986 godvoice(altaralign,
1988 "So, mortal! You dare desecrate my High Temple!");
1990 "
\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");
1991 /* Throw everything we have at the player */
1992 god_zaps_you(altaralign);
1994 < 0) { /* I don't think the gods are gonna like this... */
1995 gods_upset(altaralign);
1997 int saved_anger = u.ugangr;
1998 int saved_cnt = u.ublesscnt;
1999 int saved_luck = u.uluck;
2001 /* Sacrificing at an altar of a different alignment */
2002 if (u.ualign.type != altaralign) {
2003 /* Is this a conversion ? */
2004 /* An unaligned altar in Gehennom will always elicit rejection. */
2005 if (ugod_is_angry() || (altaralign == A_NONE && Inhell)) {
2006 if (u.ualignbase[A_CURRENT] == u.ualignbase[A_ORIGINAL]
2007 && altaralign != A_NONE) {
2009 You("have a strong feeling that %s is angry...",
2011 You("%s
\82ª
\93{
\82Á
\82Ä
\82¢
\82é
\82Ì
\82ð
\8am
\90M
\82µ
\82½
\81D
\81D
\81D",
2013 consume_offering(otmp);
2015 pline("%s accepts your allegiance.", a_gname());
2017 pline("%s
\82Í
\82 \82È
\82½
\82Ì
\91®
\90«
\82ð
\8eó
\82¯
\82¢
\82ê
\82½
\81D", a_gname());
2019 uchangealign(altaralign, 0);
2020 /* Beware, Conversion is costly */
2027 pline("%s rejects your sacrifice!", a_gname());
2029 pline("%s
\82Í
\82 \82È
\82½
\82Ì
\8c£
\8fã
\95¨
\82ð
\8eó
\82¯
\82¢
\82ê
\82È
\82¢
\81I", a_gname());
2031 godvoice(altaralign, "Suffer, infidel!");
2033 godvoice(altaralign, "
\88Ù
\92[
\8eÒ
\82æ
\81I
\8e¸
\82¹
\82ë
\81I
\81I");
2035 (void) adjattrib(A_WIS, -2, TRUE);
2037 angrygods(u.ualign.type);
2041 consume_offering(otmp);
2043 You("sense a conflict between %s and %s.", u_gname(),
2046 You("%s
\82Æ%s
\8aÔ
\82Ì
\91\88\82¢
\82ð
\8a´
\82¶
\82½
\81D", u_gname(),
2049 if (rn2(8 + u.ulevel) > 5) {
2052 You_feel("the power of %s increase.", u_gname());
2054 You("%s
\82Ì
\97Í
\82ª
\91\9d\91å
\82µ
\82½
\82æ
\82¤
\82È
\8bC
\82ª
\82µ
\82½
\81D", u_gname());
2055 exercise(A_WIS, TRUE);
2057 /* Yes, this is supposed to be &=, not |= */
2058 levl[u.ux][u.uy].altarmask &= AM_SHRINE;
2059 /* the following accommodates stupid compilers */
2060 levl[u.ux][u.uy].altarmask =
2061 levl[u.ux][u.uy].altarmask
2062 | (Align2amask(u.ualign.type));
2065 pline_The("altar glows %s.",
2066 hcolor((u.ualign.type == A_LAWFUL)
2070 : (const char *) "gray"));
2072 pline("
\8dÕ
\92d
\82Í%s
\8bP
\82¢
\82½
\81D",
2073 jconj_adj(hcolor((u.ualign.type == A_LAWFUL)
2077 : (const char *)"
\8aD
\90F
\82Ì")));
2080 if (rnl(u.ulevel) > 6 && u.ualign.record > 0
2081 && rnd(u.ualign.record) > (3 * ALIGNLIM) / 4)
2082 summon_minion(altaralign, TRUE);
2083 /* anger priest; test handles bones files */
2084 if ((pri = findpriest(temple_occupied(u.urooms)))
2085 && !p_coaligned(pri))
2089 pline("Unluckily, you feel the power of %s decrease.",
2091 pline("
\95s
\8dK
\82É
\82à
\81C%s
\82Ì
\97Í
\82ª
\8c¸
\8f
\82µ
\82½
\82Ì
\82ð
\8a´
\82¶
\82½
\81D",
2094 exercise(A_WIS, FALSE);
2095 if (rnl(u.ulevel) > 6 && u.ualign.record > 0
2096 && rnd(u.ualign.record) > (7 * ALIGNLIM) / 8)
2097 summon_minion(altaralign, TRUE);
2103 consume_offering(otmp);
2104 /* OK, you get brownie points. */
2106 u.ugangr -= ((value * (u.ualign.type == A_CHAOTIC ? 2 : 3))
2110 if (u.ugangr != saved_anger) {
2113 pline("%s seems %s.", u_gname(),
2114 Hallucination ? "groovy" : "slightly mollified");
2116 pline("%s
\82Í%s
\82É
\8c©
\82¦
\82é
\81D", u_gname(),
2117 Hallucination ? "
\91f
\93G" : "
\82¿
\82å
\82Á
\82Æ
\98a
\82ç
\82¢
\82¾
\82æ
\82¤");
2120 if ((int) u.uluck < 0)
2124 pline("%s seems %s.", u_gname(),
2125 Hallucination ? "cosmic (not a new fact)"
2128 pline("%s
\82Í%s
\82É
\8c©
\82¦
\82é
\81D", u_gname(),
2129 Hallucination ? "
\93ø
\90F(
\90V
\8e\96\8eÀ
\82Å
\82Í
\82È
\82¢)"
2130 : "
\8cy
\95Ì
\82µ
\82½
\82æ
\82¤");
2133 if ((int) u.uluck < 0)
2136 } else { /* not satisfied yet */
2139 pline_The("gods seem tall.");
2141 pline("
\90_
\82Í
\82¨
\8d\82\82
\82Æ
\82Ü
\82Á
\82Ä
\82¢
\82é
\82æ
\82¤
\82É
\8c©
\82¦
\82é
\81D");
2144 You("have a feeling of inadequacy.");
2146 You("
\82Ü
\82¾
\82Ü
\82¾
\82¾
\82Æ
\8a´
\82¶
\82½
\81D");
2148 } else if (ugod_is_angry()) {
2149 if (value > MAXVALUE)
2151 if (value > -u.ualign.record)
2152 value = -u.ualign.record;
2155 You_feel("partially absolved.");
2157 You("
\8f
\82µ
\82¾
\82¯
\82ä
\82é
\82µ
\82Ä
\82à
\82ç
\82¦
\82½
\82æ
\82¤
\82È
\8bC
\82ª
\82µ
\82½
\81D");
2158 } else if (u.ublesscnt > 0) {
2159 u.ublesscnt -= ((value * (u.ualign.type == A_CHAOTIC ? 500 : 300))
2161 if (u.ublesscnt < 0)
2163 if (u.ublesscnt != saved_cnt) {
2167 You("realize that the gods are not like you and I.");
2169 You("
\90_
\82Æ
\83c
\81[
\83J
\81[
\82Ì
\92\87\82Å
\82Í
\82È
\82¢
\82±
\82Æ
\82ð
\8cå
\82Á
\82½
\81D");
2172 You("have a hopeful feeling.");
2174 pline("
\8aó
\96]
\82ª
\8c©
\82¦
\82Ä
\82«
\82½
\82æ
\82¤
\82È
\8bC
\82ª
\82µ
\82½
\81D");
2175 if ((int) u.uluck < 0)
2180 pline("Overall, there is a smell of fried onions.");
2182 pline("
\82½
\82Ü
\82Ë
\82¬
\82ð
\97g
\82°
\82½
\93õ
\82¢
\82ª
\82µ
\82½
\81D");
2185 You("have a feeling of reconciliation.");
2187 You("
\8b\96\82³
\82ê
\82½
\8bC
\82ª
\82µ
\82½
\81D");
2188 if ((int) u.uluck < 0)
2193 int nartifacts = nartifact_exist();
2195 /* you were already in pretty good standing */
2196 /* The player can gain an artifact */
2197 /* The chance goes down as the number of artifacts goes up */
2198 if (u.ulevel > 2 && u.uluck >= 0
2199 && !rn2(10 + (2 * u.ugifts * nartifacts))) {
2200 otmp = mk_artifact((struct obj *) 0, a_align(u.ux, u.uy));
2206 otmp->oerodeproof = TRUE;
2208 at_your_feet("An object");
2210 at_your_feet("
\89½
\82©");
2213 godvoice(u.ualign.type, "Use my gift wisely!");
2215 godvoice(u.ualign.type, "
\89ä
\82ª
\97^
\82¦
\82µ
\82à
\82Ì
\8c«
\82
\8eg
\82¤
\82×
\82µ
\81I");
2217 u.ublesscnt = rnz(300 + (50 * nartifacts));
2218 exercise(A_WIS, TRUE);
2219 /* make sure we can use this weapon */
2220 unrestrict_weapon_skill(weapon_type(otmp));
2221 if (!Hallucination && !Blind) {
2223 makeknown(otmp->otyp);
2224 discover_artifact(otmp->oartifact);
2229 change_luck((value * LUCKMAX) / (MAXVALUE * 2));
2230 if ((int) u.uluck < 0)
2232 if (u.uluck != saved_luck) {
2235 You("think %s brushed your %s.", something,
2238 pline("%s
\82ª
\82 \82È
\82½
\82Ì%s
\82ð
\82
\82·
\82®
\82Á
\82½
\82æ
\82¤
\82¾
\81D", something,
2244 ? "see crabgrass at your %s. A funny thing in a dungeon."
2245 : "glimpse a four-leaf clover at your %s.",
2246 makeplural(body_part(FOOT)));
2249 ? "
\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"
2250 : "
\8el
\97t
\82Ì
\83N
\83\8d\81[
\83o
\81[
\82ð
\91«
\8c³
\82É
\8c©
\82Â
\82¯
\82½
\81D");
2258 /* determine prayer results in advance; also used for enlightenment */
2261 boolean praying; /* false means no messages should be given */
2265 p_aligntyp = on_altar() ? a_align(u.ux, u.uy) : u.ualign.type;
2266 p_trouble = in_trouble();
2268 if (is_demon(youmonst.data) && (p_aligntyp != A_CHAOTIC)) {
2271 pline_The("very idea of praying to a %s god is repugnant to you.",
2272 p_aligntyp ? "lawful" : "neutral");
2274 pline("%s
\82Ì
\90_
\82É
\8bF
\82è
\82ð
\82³
\82³
\82°
\82é
\82Ì
\82Í
\8fí
\8e¯
\82É
\94w
\82
\81D",
2275 p_aligntyp ? "
\92\81\8f\98" : "
\92\86\97§");
2282 You("begin praying to %s.", align_gname(p_aligntyp));
2284 You("%s
\82É
\8bF
\82è
\82ð
\95ù
\82°
\82½
\81D", align_gname(p_aligntyp));
2286 if (u.ualign.type && u.ualign.type == -p_aligntyp)
2287 alignment = -u.ualign.record; /* Opposite alignment altar */
2288 else if (u.ualign.type != p_aligntyp)
2289 alignment = u.ualign.record / 2; /* Different alignment altar */
2291 alignment = u.ualign.record;
2293 if ((p_trouble > 0) ? (u.ublesscnt > 200) /* big trouble */
2294 : (p_trouble < 0) ? (u.ublesscnt > 100) /* minor difficulties */
2295 : (u.ublesscnt > 0)) /* not in trouble */
2296 p_type = 0; /* too soon... */
2297 else if ((int) Luck < 0 || u.ugangr || alignment < 0)
2298 p_type = 1; /* too naughty... */
2299 else /* alignment >= 0 */ {
2300 if (on_altar() && u.ualign.type != p_aligntyp)
2306 if (is_undead(youmonst.data) && !Inhell
2307 && (p_aligntyp == A_LAWFUL || (p_aligntyp == A_NEUTRAL && !rn2(10))))
2309 /* Note: when !praying, the random factor for neutrals makes the
2310 return value a non-deterministic approximation for enlightenment.
2311 This case should be uncommon enough to live with... */
2313 return !praying ? (boolean) (p_type == 3 && !Inhell) : TRUE;
2316 /* #pray commmand */
2320 /* Confirm accidental slips of Alt-P */
2322 if (ParanoidPray && yn("Are you sure you want to pray?") != 'y')
2324 if (ParanoidPray && yn("
\8bF
\82è
\82Ü
\82·
\82©
\81H") != 'y')
2327 u.uconduct.gnostic++;
2329 /* set up p_type and p_alignment */
2330 if (!can_pray(TRUE))
2333 if (wizard && p_type >= 0) {
2335 if (yn("Force the gods to be pleased?") == 'y') {
2337 if (yn("
\96³
\97\9d\96î
\97\9d\90_
\82É
\94÷
\8fÎ
\82ñ
\82Å
\82à
\82ç
\82¢
\82Ü
\82·
\82©
\81H") == 'y') {
2341 if (u.ualign.record <= 0)
2342 u.ualign.record = 1;
2349 multi_reason = "praying";
2351 nomovemsg = "You finish your prayer.";
2353 nomovemsg = "
\8bF
\82è
\8fI
\82¦
\82½
\81D";
2354 afternmv = prayer_done;
2356 if (p_type == 3 && !Inhell) {
2357 /* if you've been true to your god you can't die while you pray */
2360 You("are surrounded by a shimmering light.");
2362 You("
\82©
\82·
\82©
\82È
\8cõ
\82É
\82Â
\82Â
\82Ü
\82ê
\82½
\81D");
2363 u.uinvulnerable = TRUE;
2370 prayer_done() /* M. Stephenson (1.0.3b) */
2372 aligntyp alignment = p_aligntyp;
2374 u.uinvulnerable = FALSE;
2378 (alignment == A_LAWFUL)
2379 ? "Vile creature, thou durst call upon me?"
2380 : "Walk no more, perversion of nature!");
2383 (alignment == A_LAWFUL)
2384 ? "
\94Ú
\97ò
\82È
\90¶
\95¨
\82æ
\81C
\93ð
\81C
\89ä
\82É
\8bF
\82è
\82ð
\8b\81\82ß
\82½
\82©
\81H"
2385 : "
\93®
\82
\82È
\81I
\8e\80\82É
\82¼
\82±
\82È
\82¢
\82Ì
\90¶
\95¨
\82æ
\81I");
2388 You_feel("like you are falling apart.");
2390 You("
\83o
\83\89\83o
\83\89\82É
\82È
\82Á
\82½
\82æ
\82¤
\82È
\8bC
\82ª
\82µ
\82½
\81D");
2391 /* KMH -- Gods have mastery over unchanging */
2393 /* no Half_physical_damage adjustment here */
2395 losehp(rnd(20), "residual undead turning effect", KILLED_BY_AN);
2397 losehp(rnd(20), "
\95s
\8e\80\82Ì
\90¶
\95¨
\82ð
\93y
\82É
\95Ô
\82·
\97Í
\82Å", KILLED_BY_AN);
2398 exercise(A_CON, FALSE);
2403 pline("Since you are in Gehennom, %s won't help you.",
2405 pline("
\83Q
\83w
\83i
\82É%s
\82Ì
\97Í
\82Í
\93Í
\82©
\82È
\82¢
\81D",
2406 align_gname(alignment));
2407 /* haltingly aligned is least likely to anger */
2408 if (u.ualign.record <= 0 || rnl(u.ualign.record))
2409 angrygods(u.ualign.type);
2414 if (on_altar() && u.ualign.type != alignment)
2415 (void) water_prayer(FALSE);
2416 u.ublesscnt += rnz(250);
2418 gods_upset(u.ualign.type);
2419 } else if (p_type == 1) {
2420 if (on_altar() && u.ualign.type != alignment)
2421 (void) water_prayer(FALSE);
2422 angrygods(u.ualign.type); /* naughty */
2423 } else if (p_type == 2) {
2424 if (water_prayer(FALSE)) {
2425 /* attempted water prayer on a non-coaligned altar */
2426 u.ublesscnt += rnz(250);
2428 gods_upset(u.ualign.type);
2434 (void) water_prayer(TRUE);
2435 pleased(alignment); /* nice */
2444 /* Knights & Priest(esse)s only please */
2445 struct monst *mtmp, *mtmp2;
2446 int once, range, xlev;
2448 if (!Role_if(PM_PRIEST) && !Role_if(PM_KNIGHT)) {
2449 /* Try to use the "turn undead" spell.
2451 * This used to be based on whether hero knows the name of the
2452 * turn undead spellbook, but it's possible to know--and be able
2453 * to cast--the spell while having lost the book ID to amnesia.
2454 * (It also used to tell spelleffects() to cast at self?)
2458 for (sp_no = 0; sp_no < MAXSPELL; ++sp_no) {
2459 if (spl_book[sp_no].sp_id == NO_SPELL)
2461 else if (spl_book[sp_no].sp_id == SPE_TURN_UNDEAD)
2462 return spelleffects(sp_no, FALSE);
2465 You("don't know how to turn undead!");
2467 You("
\95s
\8e\80\82Ì
\90¶
\82«
\95¨
\82ð
\93y
\82É
\96ß
\82·
\95û
\96@
\82ð
\92m
\82ç
\82È
\82¢
\81I");
2470 u.uconduct.gnostic++;
2472 if ((u.ualign.type != A_CHAOTIC
2473 && (is_demon(youmonst.data) || is_undead(youmonst.data)))
2474 || u.ugangr > 6) { /* "Die, mortal!" */
2476 pline("For some reason, %s seems to ignore you.", u_gname());
2478 pline("
\82È
\82º
\82©
\81C%s
\82Í
\82 \82È
\82½
\82ð
\96³
\8e\8b\82µ
\82½
\82æ
\82¤
\82¾
\81D", u_gname());
2480 exercise(A_WIS, FALSE);
2485 pline("Since you are in Gehennom, %s won't help you.", u_gname());
2487 pline("
\83Q
\83w
\83i
\82É%s
\82Ì
\97Í
\82Í
\93Í
\82©
\82È
\82¢
\81D", u_gname());
2492 pline("Calling upon %s, you chant an arcane formula.", u_gname());
2494 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());
2495 exercise(A_WIS, TRUE);
2497 /* note: does not perform unturn_dead() on victims' inventories */
2498 range = BOLT_LIM + (u.ulevel / 5); /* 5 to 11 */
2501 for (mtmp = fmon; mtmp; mtmp = mtmp2) {
2504 if (DEADMONSTER(mtmp))
2506 if (!cansee(mtmp->mx, mtmp->my) || distu(mtmp->mx, mtmp->my) > range)
2509 if (!mtmp->mpeaceful
2510 && (is_undead(mtmp->data) || is_vampshifter(mtmp)
2511 || (is_demon(mtmp->data) && (u.ulevel > (MAXULEV / 2))))) {
2512 mtmp->msleeping = 0;
2516 pline("Unfortunately, your voice falters.");
2518 pline("
\8ec
\94O
\82È
\82ª
\82ç
\81C
\82 \82È
\82½
\82Ì
\90º
\82Í
\82Ç
\82à
\82Á
\82Ä
\82µ
\82Ü
\82Á
\82½
\81D");
2522 } else if (!resist(mtmp, '\0', 0, TELL)) {
2524 switch (mtmp->data->mlet) {
2525 /* this is intentional, lichs are tougher
2528 xlev += 2; /*FALLTHRU*/
2530 xlev += 2; /*FALLTHRU*/
2532 xlev += 2; /*FALLTHRU*/
2534 xlev += 2; /*FALLTHRU*/
2536 xlev += 2; /*FALLTHRU*/
2538 if (u.ulevel >= xlev && !resist(mtmp, '\0', 0, NOTELL)) {
2539 if (u.ualign.type == A_CHAOTIC) {
2540 mtmp->mpeaceful = 1;
2542 } else { /* damn them */
2549 monflee(mtmp, 0, FALSE, TRUE);
2556 multi_reason = "trying to turn the monsters";
2557 nomovemsg = You_can_move_again;
2564 return a_gname_at(u.ux, u.uy);
2567 /* returns the name of an altar's deity */
2572 if (!IS_ALTAR(levl[x][y].typ))
2575 return align_gname(a_align(x, y));
2578 /* returns the name of the hero's deity */
2582 return align_gname(u.ualign.type);
2586 align_gname(alignment)
2591 switch (alignment) {
2605 impossible("unknown alignment.");
2617 static const char *hallu_gods[] = {
2618 "the Flying Spaghetti Monster", /* Church of the FSM */
2619 "Eris", /* Discordianism */
2620 "the Martians", /* every science fiction ever */
2622 "AnDoR dRaKoN", /* ADOM */
2623 "the Central Bank of Yendor", /* economics */
2624 "Tooth Fairy", /* real world(?) */
2625 "Om", /* Discworld */
2626 "Yawgmoth", /* Magic: the Gathering */
2627 "Morgoth", /* LoTR */
2628 "Cthulhu", /* Lovecraft */
2629 "the Ori", /* Stargate */
2630 "destiny", /* why not? */
2631 "your Friend the Computer", /* Paranoia */
2634 /* hallucination handling for priest/minion names: select a random god
2635 iff character is hallucinating */
2637 halu_gname(alignment)
2640 const char *gnam = NULL;
2644 return align_gname(alignment);
2646 /* The priest may not have initialized god names. If this is the
2647 * case, and we roll priest, we need to try again. */
2650 while (!roles[which].lgod);
2655 gnam = roles[which].lgod;
2659 gnam = roles[which].ngod;
2663 gnam = roles[which].cgod;
2667 gnam = hallu_gods[rn2(sizeof hallu_gods / sizeof *hallu_gods)];
2673 impossible("rn2 broken in halu_gname?!?");
2676 impossible("No random god name?");
2678 gnam = "your Friend the Computer"; /* Paranoia */
2680 gnam = "
\90e
\88¤
\82È
\82é
\83R
\83\93\83s
\83\85\81[
\83^"; /* Paranoia */
2690 align_gtitle(alignment)
2694 const char *gnam, *result = "god";
2696 const char *gnam, *result = "
\8eå
\90_";
2698 switch (alignment) {
2712 if (gnam && *gnam == '_')
2716 result = "
\8f\97\90_";
2724 aligntyp altaralign = a_align(x, y);
2726 if (!strcmp(align_gname(altaralign), u_gname())) {
2728 godvoice(altaralign, "How darest thou desecrate my altar!");
2730 godvoice(altaralign, "
\93ð
\81C
\89ä
\82ª
\8dÕ
\92d
\82ð
\89\98\82·
\82©
\81I");
2731 (void) adjattrib(A_WIS, -1, FALSE);
2734 pline("A voice (could it be %s?) whispers:", align_gname(altaralign));
2736 pline("
\82³
\82³
\82â
\82«
\90º(
\82½
\82Ô
\82ñ%s
\81H)
\82ª
\95·
\82±
\82¦
\82é:", align_gname(altaralign));
2738 verbalize("Thou shalt pay, infidel!");
2740 verbalize("
\88Ù
\92[
\8eÒ
\82æ
\81I
\95ñ
\82¢
\82ð
\8eó
\82¯
\82æ
\81I");
2745 /* assumes isok() at one space away, but not necessarily at two */
2747 blocked_boulder(dx, dy)
2750 register struct obj *otmp;
2753 for (otmp = level.objects[u.ux + dx][u.uy + dy]; otmp;
2754 otmp = otmp->nexthere) {
2755 if (otmp->otyp == BOULDER)
2756 count += otmp->quan;
2761 /* no boulders--not blocked */
2764 /* possibly blocked depending on if it's pushable */
2767 /* more than one boulder--blocked after they push the top one;
2768 don't force them to push it first to find out */
2772 if (!isok(u.ux + 2 * dx, u.uy + 2 * dy))
2774 if (IS_ROCK(levl[u.ux + 2 * dx][u.uy + 2 * dy].typ))
2776 if (sobj_at(BOULDER, u.ux + 2 * dx, u.uy + 2 * dy))