-/* NetHack 3.6 pray.c $NHDT-Date: 1519662898 2018/02/26 16:34:58 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.96 $ */
+/* NetHack 3.6 pray.c $NHDT-Date: 1573346192 2019/11/10 00:36:32 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.118 $ */
/* Copyright (c) Benson I. Margulies, Mike Stephenson, Steve Linhart, 1989. */
/* NetHack may be freely redistributed. See license for details. */
/* JNetHack Copyright */
/* (c) Issei Numata, Naoki Hamada, Shigehiro Miyashita, 1994-2000 */
-/* For 3.4-, Copyright (c) SHIRAKATA Kentaro, 2002-2019 */
+/* For 3.4-, Copyright (c) SHIRAKATA Kentaro, 2002-2022 */
/* JNetHack may be freely redistributed. See license for details. */
#include "hack.h"
y = u.uy + j;
if (!isok(x, y)
|| (IS_ROCK(levl[x][y].typ)
- && (levl[x][y].typ != SDOOR || levl[x][y].typ != SCORR))
+ && (levl[x][y].typ != SDOOR && levl[x][y].typ != SCORR))
|| (blocked_boulder(i, j) && !throws_rocks(youmonst.data)))
++count;
}
&& (!u.uswallow
|| !attacktype_fordmg(u.ustuck->data, AT_ENGL, AD_BLND)))
return TROUBLE_BLIND;
+ /* deafness isn't it's own trouble; healing magic cures deafness
+ when it cures blindness, so do the same with trouble repair */
+ if ((HDeaf & TIMEOUT) > 1L)
+ return TROUBLE_BLIND;
+
for (i = 0; i < A_MAX; i++)
if (ABASE(i) < AMAX(i))
return TROUBLE_POISONED;
You("\8cÅ\82¢\92n\96Ê\82É\96ß\82Á\82½\81D");
/* teleport should always succeed, but if not, just untrap them */
if (!safe_teleds(FALSE))
- u.utrap = 0;
+ reset_utrap(TRUE);
break;
case TROUBLE_STARVING:
/* temporarily lost strength recovery now handled by init_uhunger() */
break;
case TROUBLE_COLLAPSING:
/* override Fixed_abil; uncurse that if feasible */
-#if 0 /*JP*/
+#if 0 /*JP:T*/
You_feel("%sstronger.",
(AMAX(A_STR) - ABASE(A_STR) > 6) ? "much " : "");
#else
/* no control, but works on no-teleport levels */
if (safe_teleds(FALSE)) {
/*JP
- Your("surroundings change.");
+ Your("surroundings change.");
*/
- Your("\8aÂ\8b«\82ª\95Ï\89»\82µ\82½\81D");
+ Your("\8aÂ\8b«\82ª\95Ï\89»\82µ\82½\81D");
} else {
/* safe_teleds() couldn't find a safe place; perhaps the
level is completely full. As a last resort, confer
what = rightglow;
else if (otmp == uleft)
what = leftglow;
- decurse:
+ decurse:
if (!otmp) {
impossible("fix_worst_trouble: nothing to uncurse.");
return;
}
+ if (otmp == uarmg && Glib) {
+ make_glib(0);
+/*JP
+ Your("%s are no longer slippery.", gloves_simple_name(uarmg));
+*/
+ Your("%s\82Í\82à\82¤\82Ê\82é\82Ê\82é\82Å\82Í\82È\82\82È\82Á\82½\81D", gloves_simple_name(uarmg));
+ if (!otmp->cursed)
+ break;
+ }
if (!Blind || (otmp == ublindf && Blindfolded_only)) {
#if 0 /*JP*/
pline("%s %s.",
#else
Your("%s\82Í%s\82â\82í\82ç\82©\82\8bP\82¢\82½\81D",
what ? what : (const char *)xname(otmp),
- jconj_adj(hcolor(NH_AMBER)));
+ hcolor_adv(NH_AMBER));
#endif
iflags.last_msg = PLNMSG_OBJ_GLOWS;
- otmp->bknown = !Hallucination;
+ otmp->bknown = !Hallucination; /* ok to skip set_bknown() */
}
uncurse(otmp);
update_inventory();
}
(void) encumber_msg();
break;
- case TROUBLE_BLIND: {
+ case TROUBLE_BLIND: { /* handles deafness as well as blindness */
+ char msgbuf[BUFSZ];
#if 0 /*JP*/
const char *eyes = body_part(EYE);
+#endif
+ boolean cure_deaf = (HDeaf & TIMEOUT) ? TRUE : FALSE;
- if (eyecount(youmonst.data) != 1)
- eyes = makeplural(eyes);
- Your("%s %s better.", eyes, vtense(eyes, "feel"));
+ msgbuf[0] = '\0';
+ if (Blinded) {
+#if 0 /*JP*/
+ if (eyecount(youmonst.data) != 1)
+ eyes = makeplural(eyes);
+#endif
+#if 0 /*JP:T*/
+ Sprintf(msgbuf, "Your %s %s better", eyes, vtense(eyes, "feel"));
+#else
+ Sprintf(msgbuf, "%s\82ª\89ñ\95\9c\82µ\82½\82æ\82¤\82È\8bC\82ª\82µ\82½", body_part(EYE));
+#endif
+ u.ucreamed = 0;
+ make_blinded(0L, FALSE);
+ }
+ if (cure_deaf) {
+ make_deaf(0L, FALSE);
+ if (!Deaf)
+#if 0 /*JP:T*/
+ Sprintf(eos(msgbuf), "%s can hear again",
+ !*msgbuf ? "You" : " and you");
#else
- pline("%s\82ª\89ñ\95\9c\82µ\82½\82æ\82¤\82È\8bC\82ª\82µ\82½\81D", body_part(EYE));
+ Sprintf(eos(msgbuf), "%s\82Ü\82½\95·\82±\82¦\82é\82æ\82¤\82É\82È\82Á\82½",
+ !*msgbuf ? "" : "\81C\82»\82µ\82Ä");
#endif
- u.ucreamed = 0;
- make_blinded(0L, FALSE);
+ }
+ if (*msgbuf)
+/*JP
+ pline("%s.", msgbuf);
+*/
+ pline("%s\81D", msgbuf);
break;
}
case TROUBLE_WOUNDED_LEGS:
- heal_legs();
+ heal_legs(0);
break;
case TROUBLE_STUNNED:
make_stunned(0L, TRUE);
/*JP
pline("%s %s.", Yobjnam2(otmp, "softly glow"), hcolor(NH_AMBER));
*/
- pline("%s\82Í%s\82â\82í\82ç\82©\82\8bP\82¢\82½\81D", y_monnam(u.usteed), hcolor(NH_AMBER));
- otmp->bknown = TRUE;
+ pline("%s\82Í%s\82â\82í\82ç\82©\82\8bP\82¢\82½\81D", y_monnam(u.usteed), hcolor_adv(NH_AMBER));
+ set_bknown(otmp, 1);
}
uncurse(otmp);
break;
aligntyp resp_god;
boolean via_disintegration;
{
-#if 0 /*JP*/
+#if 0 /*JP:T*/
You("%s!", !via_disintegration ? "fry to a crisp"
: "disintegrate into a pile of dust");
#else
switch (rn2(maxanger)) {
case 0:
case 1:
-#if 0 /*JP*/
+#if 0 /*JP:T*/
You_feel("that %s is %s.", align_gname(resp_god),
Hallucination ? "bummed" : "displeased");
#else
case 2:
case 3:
godvoice(resp_god, (char *) 0);
-#if 0 /*JP*/
+#if 0 /*JP:T*/
pline("\"Thou %s, %s.\"",
(ugod_is_angry() && resp_god == u.ualign.type)
? "hast strayed from the path"
case 7:
case 8:
godvoice(resp_god, (char *) 0);
-#if 0 /*JP*/
+#if 0 /*JP:T*/
verbalize("Thou durst %s me?",
(on_altar() && (a_align(u.ux, u.uy) != resp_god))
? "scorn"
? "\82ð\82³\82°\82·\82Ý\82µ\82©\81H"
: "\82É\8bF\82è\82ð\8b\81\82ß\82µ\82©\81H");
#endif
-#if 0 /*JP*/
+ /* [why isn't this using verbalize()?] */
+#if 0 /*JP:T*/
pline("\"Then die, %s!\"",
- youmonst.data->mlet == S_HUMAN ? "mortal" : "creature");
+ (youmonst.data->mlet == S_HUMAN) ? "mortal" : "creature");
#else
pline("\81u\8e\80\82Ë\81C%s\82æ\81I\81v",
- youmonst.data->mlet == S_HUMAN ? "\92è\96½\82Ì\82à\82Ì" : "\90¶\95¨");
+ (youmonst.data->mlet == S_HUMAN) ? "\92è\96½\82Ì\82à\82Ì" : "\90¶\95¨");
#endif
summon_minion(resp_god, FALSE);
break;
str = Something;
if (u.uswallow) {
/* barrier between you and the floor */
-#if 0 /*JP*/
+#if 0 /*JP:T*/
pline("%s %s into %s %s.", str, vtense(str, "drop"),
s_suffix(mon_nam(u.ustuck)), mbodypart(u.ustuck, STOMACH));
#else
mon_nam(u.ustuck), mbodypart(u.ustuck, STOMACH));
#endif
} else {
-#if 0 /*JP*/
+#if 0 /*JP:T*/
pline("%s %s %s your %s!", str,
Blind ? "lands" : vtense(str, "appear"),
Levitation ? "beneath" : "at", makeplural(body_part(FOOT)));
HPoison_resistance |= FROMOUTSIDE;
godvoice(u.ualign.type, (char *) 0);
+ class_gift = STRANGE_OBJECT;
+ /* 3.3.[01] had this in the A_NEUTRAL case,
+ preventing chaotic wizards from receiving a spellbook */
+ if (Role_if(PM_WIZARD)
+ && (!uwep || (uwep->oartifact != ART_VORPAL_BLADE
+ && uwep->oartifact != ART_STORMBRINGER))
+ && !carrying(SPE_FINGER_OF_DEATH)) {
+ class_gift = SPE_FINGER_OF_DEATH;
+ } else if (Role_if(PM_MONK) && (!uwep || !uwep->oartifact)
+ && !carrying(SPE_RESTORE_ABILITY)) {
+ /* monks rarely wield a weapon */
+ class_gift = SPE_RESTORE_ABILITY;
+ }
+
obj = ok_wep(uwep) ? uwep : 0;
already_exists = in_hand = FALSE; /* lint suppression */
switch (u.ualign.type) {
in_hand = (uwep && uwep->oartifact == ART_STORMBRINGER);
already_exists =
exist_artifact(RUNESWORD, artiname(ART_STORMBRINGER));
-#if 0 /*JP*/
+#if 0 /*JP:T*/
verbalize("Thou art chosen to %s for My Glory!",
- already_exists && !in_hand ? "take lives" : "steal souls");
+ ((already_exists && !in_hand)
+ || class_gift != STRANGE_OBJECT) ? "take lives"
+ : "steal souls");
#else
verbalize("\93ð\81C\89ä\82ª\89h\8cõ\82Ì\82½\82ß%s\8eÒ\82Æ\82µ\82Ä\91I\82Î\82ê\82ñ\81I",
- already_exists && !in_hand ?
- "\90¶\82«\82È\82ª\82ç\82¦\82ñ" : "\8d°\82ð\92D\82¢\82µ\82½\82ß\82é");
+ ((already_exists && !in_hand)
+ || class_gift != STRANGE_OBJECT) ? "\90¶\82«\82È\82ª\82ç\82¦\82ñ"
+ : "\8d°\82ð\92D\82¢\82µ\82½\82ß\82é");
#endif
break;
}
- class_gift = STRANGE_OBJECT;
- /* 3.3.[01] had this in the A_NEUTRAL case below,
- preventing chaotic wizards from receiving a spellbook */
- if (Role_if(PM_WIZARD)
- && (!uwep || (uwep->oartifact != ART_VORPAL_BLADE
- && uwep->oartifact != ART_STORMBRINGER))
- && !carrying(SPE_FINGER_OF_DEATH)) {
- class_gift = SPE_FINGER_OF_DEATH;
- make_splbk:
+ if (objects[class_gift].oc_class == SPBOOK_CLASS) {
obj = mksobj(class_gift, TRUE, FALSE);
bless(obj);
- obj->bknown = TRUE;
+ obj->bknown = 1; /* ok to skip set_bknown() */
/*JP
at_your_feet("A spellbook");
*/
obj = uwep; /* to be blessed,&c */
break;
}
- } else if (Role_if(PM_MONK) && (!uwep || !uwep->oartifact)
- && !carrying(SPE_RESTORE_ABILITY)) {
- /* monks rarely wield a weapon */
- class_gift = SPE_RESTORE_ABILITY;
- goto make_splbk;
}
switch (u.ualign.type) {
bless(obj);
obj->oeroded = obj->oeroded2 = 0;
obj->oerodeproof = TRUE;
- obj->bknown = obj->rknown = TRUE;
+ obj->bknown = obj->rknown = 1; /* ok to skip set_bknown() */
if (obj->spe < 1)
obj->spe = 1;
/* acquire skill in this weapon */
int trouble = in_trouble(); /* what's your worst difficulty? */
int pat_on_head = 0, kick_on_butt;
-#if 0 /*JP*/
+#if 0 /*JP:T*/
You_feel("that %s is %s.", align_gname(g_align),
(u.ualign.record >= DEVOUT)
? Hallucination ? "pleased as punch" : "well-pleased"
* - fix all of your problems;
* - do you a gratuitous favor.
*
- * If you make it to the the last category, you roll randomly again
+ * If you make it to the last category, you roll randomly again
* to see what they do for you.
*
* If your luck is at least 0, then you are guaranteed rescued from
*repair_buf = '\0';
if (uwep->oeroded || uwep->oeroded2)
-#if 0 /*JP*/
+#if 0 /*JP:T*/
Sprintf(repair_buf, " and %s now as good as new",
otense(uwep, "are"));
#else
if (uwep->cursed) {
if (!Blind) {
-#if 0 /*JP*/
+#if 0 /*JP:T*/
pline("%s %s%s.", Yobjnam2(uwep, "softly glow"),
hcolor(NH_AMBER), repair_buf);
#else
Your("%s\82Í%s\82â\82í\82ç\82©\82\8bP\82¢\82½\81D%s", xname(uwep),
- jconj_adj(hcolor(NH_AMBER)), repair_buf);
+ hcolor_adv(NH_AMBER), repair_buf);
#endif
iflags.last_msg = PLNMSG_OBJ_GLOWS;
} else
-#if 0 /*JP*/
+#if 0 /*JP:T*/
You_feel("the power of %s over %s.", u_gname(),
yname(uwep));
#else
xname(uwep));
#endif
uncurse(uwep);
- uwep->bknown = TRUE;
+ uwep->bknown = 1; /* ok to bypass set_bknown() */
*repair_buf = '\0';
} else if (!uwep->blessed) {
if (!Blind) {
-#if 0 /*JP*/
+#if 0 /*JP:T*/
pline("%s with %s aura%s.",
Yobjnam2(uwep, "softly glow"),
an(hcolor(NH_LIGHT_BLUE)), repair_buf);
#endif
iflags.last_msg = PLNMSG_OBJ_GLOWS;
} else
-#if 0 /*JP*/
+#if 0 /*JP:T*/
You_feel("the blessing of %s over %s.", u_gname(),
yname(uwep));
#else
xname(uwep));
#endif
bless(uwep);
- uwep->bknown = TRUE;
+ uwep->bknown = 1; /* ok to bypass set_bknown() */
*repair_buf = '\0';
}
/* only give this message if we didn't just bless
or uncurse (which has already given a message) */
if (*repair_buf)
-#if 0 /*JP*/
+#if 0 /*JP:T*/
pline("%s as good as new!",
Yobjnam2(uwep, Blind ? "feel" : "look"));
#else
if (!u.uevent.uopened_dbridge && !u.uevent.gehennom_entered) {
if (u.uevent.uheard_tune < 1) {
godvoice(g_align, (char *) 0);
-#if 0 /*JP*/
+#if 0 /*JP:T*/
verbalize("Hark, %s!", youmonst.data->mlet == S_HUMAN
? "mortal"
: "creature");
/*JP
"To enter the castle, thou must play the right tune!");
*/
- "\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");
+ "\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");
u.uevent.uheard_tune++;
break;
} else if (u.uevent.uheard_tune < 2) {
u.uhp = u.uhpmax;
if (Upolyd)
u.mh = u.mhmax;
- ABASE(A_STR) = AMAX(A_STR);
+ if (ABASE(A_STR) < AMAX(A_STR)) {
+ ABASE(A_STR) = AMAX(A_STR);
+ context.botl = 1; /* before potential message */
+ (void) encumber_msg();
+ }
if (u.uhunger < 900)
init_uhunger();
/* luck couldn't have been negative at start of prayer because
&& (otmp != uarmh /* [see worst_cursed_item()] */
|| uarmh->otyp != HELM_OF_OPPOSITE_ALIGNMENT)) {
if (!Blind) {
-#if 0 /*JP*/
+#if 0 /*JP:T*/
pline("%s %s.", Yobjnam2(otmp, "softly glow"),
hcolor(NH_AMBER));
#else
Your("%s\82Í%s\82â\82í\82ç\82©\82\8bP\82¢\82½\81D", xname(otmp),
- jconj_adj(hcolor(NH_AMBER)));
+ hcolor_adv(NH_AMBER));
#endif
iflags.last_msg = PLNMSG_OBJ_GLOWS;
- otmp->bknown = TRUE;
+ otmp->bknown = 1; /* ok to bypass set_bknown() */
++any;
}
uncurse(otmp);
&& (bless_water ? !otmp->blessed : !otmp->cursed)) {
otmp->blessed = bless_water;
otmp->cursed = !bless_water;
- otmp->bknown = bc_known;
+ otmp->bknown = bc_known; /* ok to bypass set_bknown() */
changed += otmp->quan;
} else if (otmp->oclass == POTION_CLASS)
other = TRUE;
}
if (!Blind && changed) {
-#if 0 /*JP*/
+#if 0 /*JP:T*/
pline("%s potion%s on the altar glow%s %s for a moment.",
((other && changed > 1L) ? "Some of the"
: (other ? "One of the" : "The")),
pline("%s\8dÕ\92d\82Ì\96ò\82Í\88ê\8fu%s\8bP\82¢\82½\81D",
(other && changed > 1L) ? "\82¢\82\82Â\82©\82Ì"
: "",
- jconj_adj(bless_water ? hcolor(NH_LIGHT_BLUE) : hcolor(NH_BLACK)));
+ (bless_water ? hcolor_adv(NH_LIGHT_BLUE) : hcolor_adv(NH_BLACK)));
#endif
}
return (boolean) (changed > 0L);
*/
Your("\8c£\8fã\95¨\82Í\8fÁ\82¦\82½\81I");
else
-#if 0 /*JP*/
+#if 0 /*JP:T*/
Your("sacrifice is consumed in a %s!",
u.ualign.type == A_LAWFUL ? "flash of light" : "burst of flame");
#else
if (otmp->otyp == CORPSE) {
register struct permonst *ptr = &mons[otmp->corpsenm];
struct monst *mtmp;
- extern const int monstr[];
/* KMH, conduct */
u.uconduct.gnostic++;
if (otmp->corpsenm == PM_ACID_BLOB
|| (monstermoves <= peek_at_iced_corpse_age(otmp) + 50)) {
- value = monstr[otmp->corpsenm] + 1;
+ value = mons[otmp->corpsenm].difficulty + 1;
if (otmp->oeaten)
value = eaten_stat(value, otmp);
}
if (unicalign == altaralign) {
/* When same as altar, always a very bad action.
*/
-#if 0 /*JP*/
+#if 0 /*JP:T*/
pline("Such an action is an insult to %s!",
(unicalign == A_CHAOTIC) ? "chaos"
: unicalign ? "law" : "balance");
if (otmp->otyp == AMULET_OF_YENDOR) {
if (!highaltar) {
- too_soon:
+ too_soon:
if (altaralign == A_NONE && Inhell)
/* hero has left Moloch's Sanctum so is in the process
of getting away with the Amulet (outside of Gehennom,
fall through to the "ashamed" feedback) */
gods_upset(A_NONE);
else
-#if 0 /*JP*/
+#if 0 /*JP:T*/
You_feel("%s.",
Hallucination
? "homesick"
if (u.ualign.record > -99)
u.ualign.record = -99;
/*[apparently shrug/snarl can be sensed without being seen]*/
-#if 0 /*JP*/
+#if 0 /*JP:T*/
pline("%s shrugs and retains dominion over %s,", Moloch,
u_gname());
#else
pline("\82»\82µ\82Ä\96³\8e\9c\94ß\82É\82 \82È\82½\82Ì\96½\82ð\92D\82Á\82½\81D");
/*JP
*/
-#if 0 /*JP*/
+#if 0 /*JP:T*/
Sprintf(killer.name, "%s indifference", s_suffix(Moloch));
#else
Sprintf(killer.name, "\97â\92W\82È%s", Moloch);
/* And the opposing team picks you up and
carries you off on their shoulders */
adjalign(-99);
-#if 0 /*JP*/
+#if 0 /*JP:T*/
pline("%s accepts your gift, and gains dominion over %s...",
a_gname(), u_gname());
#else
/*JP
"An invisible choir sings, and you are bathed in radiance...");
*/
- "\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");
+ "\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");
/*JP
godvoice(altaralign, "Mortal, thou hast done well!");
*/
"In return for thy service, I grant thee the gift of Immortality!");
*/
"\93ð\82Ì\88Ì\8bÆ\82É\91Î\82µ\81C\95s\8e\80\82Ì\91Ì\82ð\8eö\82¯\82æ\82¤\82¼\81I");
-#if 0 /*JP*/
+#if 0 /*JP:T*/
You("ascend to the status of Demigod%s...",
flags.female ? "dess" : "");
#else
*/
You("\8bß\82\82É\97\8b\82ª\97\8e\82¿\82½\89¹\82ð\95·\82¢\82½\81D");
if (!otmp->known) {
-#if 0 /*JP*/
+#if 0 /*JP:T*/
You("realize you have made a %s.",
Hallucination ? "boo-boo" : "mistake");
#else
} else {
/* don't you dare try to fool the gods */
if (Deaf)
-#if 0 /*JP*/
+#if 0 /*JP:T*/
pline("Oh, no."); /* didn't hear thunderclap */
#else
pline("\82È\82ñ\82Ä\82±\82Á\82½\81D"); /* didn't hear thunderclap */
}
if (altaralign != u.ualign.type && highaltar) {
- desecrate_high_altar:
+ desecrate_high_altar:
/*
* REAL BAD NEWS!!! High altars cannot be converted. Even an attempt
* gets the god who owns it truly pissed off.
return 1;
} else {
consume_offering(otmp);
-#if 0 /*JP*/
+#if 0 /*JP:T*/
You("sense a conflict between %s and %s.", u_gname(),
a_gname());
#else
levl[u.ux][u.uy].altarmask
| (Align2amask(u.ualign.type));
if (!Blind)
-#if 0 /*JP*/
+#if 0 /*JP:T*/
pline_The("altar glows %s.",
hcolor((u.ualign.type == A_LAWFUL)
? NH_WHITE
: (const char *) "gray"));
#else
pline("\8dÕ\92d\82Í%s\8bP\82¢\82½\81D",
- jconj_adj(hcolor((u.ualign.type == A_LAWFUL)
+ hcolor_adv((u.ualign.type == A_LAWFUL)
? NH_WHITE
: u.ualign.type
? NH_BLACK
- : (const char *)"\8aD\90F\82Ì")));
+ : (const char *)"\8aD\90F\82Ì"));
#endif
if (rnl(u.ulevel) > 6 && u.ualign.record > 0
u.ugangr = 0;
if (u.ugangr != saved_anger) {
if (u.ugangr) {
-#if 0 /*JP*/
+#if 0 /*JP:T*/
pline("%s seems %s.", u_gname(),
Hallucination ? "groovy" : "slightly mollified");
#else
if ((int) u.uluck < 0)
change_luck(1);
} else {
-#if 0 /*JP*/
+#if 0 /*JP:T*/
pline("%s seems %s.", u_gname(),
Hallucination ? "cosmic (not a new fact)"
: "mollified");
u.uluck = 0;
if (u.uluck != saved_luck) {
if (Blind)
-#if 0 /*JP*/
+#if 0 /*JP:T*/
You("think %s brushed your %s.", something,
body_part(FOOT));
#else
body_part(FOOT));
#endif
else
-#if 0 /*JP*/
+#if 0 /*JP:T*/
You(Hallucination
? "see crabgrass at your %s. A funny thing in a dungeon."
: "glimpse a four-leaf clover at your %s.",
if (is_demon(youmonst.data) && (p_aligntyp != A_CHAOTIC)) {
if (praying)
-#if 0 /*JP*/
+#if 0 /*JP:T*/
pline_The("very idea of praying to a %s god is repugnant to you.",
p_aligntyp ? "lawful" : "neutral");
#else
u.uinvulnerable = FALSE;
if (p_type == -1) {
-#if 0 /*JP*/
+#if 0 /*JP:T*/
godvoice(alignment,
(alignment == A_LAWFUL)
? "Vile creature, thou durst call upon me?"
return 1;
}
if (Inhell) {
-/*JP
- pline("Since you are in Gehennom, %s won't help you.",
-*/
- pline("\83Q\83w\83i\82É%s\82Ì\97Í\82Í\93Í\82©\82È\82¢\81D",
+#if 0 /*JP:T*/
+ pline("Since you are in Gehennom, %s can't help you.",
+ align_gname(alignment));
+#else
+ pline("\82 \82È\82½\82Í\83Q\83w\83i\82É\82¢\82é\82Ì\82Å\81C%s\82Í\82 \82È\82½\82ð\8f\95\82¯\82ç\82ê\82È\82¢\81D",
align_gname(alignment));
+#endif
/* haltingly aligned is least likely to anger */
if (u.ualign.record <= 0 || rnl(u.ualign.record))
angrygods(u.ualign.type);
{
/* Knights & Priest(esse)s only please */
struct monst *mtmp, *mtmp2;
+ const char *Gname;
int once, range, xlev;
if (!Role_if(PM_PRIEST) && !Role_if(PM_KNIGHT)) {
return 0;
}
u.uconduct.gnostic++;
+ Gname = halu_gname(u.ualign.type);
+ /* [What about needing free hands (does #turn involve any gesturing)?] */
+ if (!can_chant(&youmonst)) {
+ /* "evilness": "demons and undead" is too verbose and too precise */
+#if 0 /*JP*/
+ You("are %s upon %s to turn aside evilness.",
+ Strangled ? "not able to call" : "incapable of calling", Gname);
+#else
+ You("\88«\82ð\91Þ\82¯\82é\82½\82ß\82É%s\82ð\8cÄ\82Ñ\8fo\82·%s\82È\82¢\81D",
+ Gname, Strangled ? "\82±\82Æ\82ª\82Å\82«" : "\94\\97Í\82ª");
+#endif
+ /* violates agnosticism due to intent; conduct tracking is not
+ supposed to affect play but we make an exception here: use a
+ move if this is the first time agnostic conduct has been broken */
+ return (u.uconduct.gnostic == 1);
+ }
if ((u.ualign.type != A_CHAOTIC
&& (is_demon(youmonst.data) || is_undead(youmonst.data)))
|| u.ugangr > 6) { /* "Die, mortal!" */
/*JP
- pline("For some reason, %s seems to ignore you.", u_gname());
+ pline("For some reason, %s seems to ignore you.", Gname);
*/
- pline("\82È\82º\82©\81C%s\82Í\82 \82È\82½\82ð\96³\8e\8b\82µ\82½\82æ\82¤\82¾\81D", u_gname());
+ pline("\82È\82º\82©\81C%s\82Í\82 \82È\82½\82ð\96³\8e\8b\82µ\82½\82æ\82¤\82¾\81D", Gname);
aggravate();
exercise(A_WIS, FALSE);
- return 0;
+ return 1;
}
if (Inhell) {
-/*JP
- pline("Since you are in Gehennom, %s won't help you.", u_gname());
-*/
- pline("\83Q\83w\83i\82É%s\82Ì\97Í\82Í\93Í\82©\82È\82¢\81D", u_gname());
+#if 0 /*JP*/
+ pline("Since you are in Gehennom, %s %s help you.",
+ /* not actually calling upon Moloch but use alternate
+ phrasing anyway if hallucinatory feedback says it's him */
+ Gname, !strcmp(Gname, Moloch) ? "won't" : "can't");
+#else
+ pline("\82 \82È\82½\82Í\83Q\83w\83i\82É\82¢\82é\82Ì\82Å\81C%s\82Í\82 \82È\82½\82ð\8f\95\82¯%s\82È\82¢\81D",
+ /* not actually calling upon Moloch but use alternate
+ phrasing anyway if hallucinatory feedback says it's him */
+ Gname, !strcmp(Gname, Moloch) ? "" : "\82ç\82ê");
+#endif
aggravate();
- return 0;
+ return 1;
}
/*JP
- pline("Calling upon %s, you chant an arcane formula.", u_gname());
+ pline("Calling upon %s, you chant an arcane formula.", Gname);
*/
- 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());
+ 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", Gname);
exercise(A_WIS, TRUE);
/* note: does not perform unturn_dead() on victims' inventories */
- range = BOLT_LIM + (u.ulevel / 5); /* 5 to 11 */
+ range = BOLT_LIM + (u.ulevel / 5); /* 8 to 14 */
range *= range;
once = 0;
for (mtmp = fmon; mtmp; mtmp = mtmp2) {
mtmp2 = mtmp->nmon;
-
if (DEADMONSTER(mtmp))
continue;
- if (!cansee(mtmp->mx, mtmp->my) || distu(mtmp->mx, mtmp->my) > range)
+ /* 3.6.3: used to use cansee() here but the purpose is to prevent
+ #turn operating through walls, not to require that the hero be
+ able to see the target location */
+ if (!couldsee(mtmp->mx, mtmp->my)
+ || distu(mtmp->mx, mtmp->my) > range)
continue;
if (!mtmp->mpeaceful
/* this is intentional, lichs are tougher
than zombies. */
case S_LICH:
- xlev += 2; /*FALLTHRU*/
+ xlev += 2;
+ /*FALLTHRU*/
case S_GHOST:
- xlev += 2; /*FALLTHRU*/
+ xlev += 2;
+ /*FALLTHRU*/
case S_VAMPIRE:
- xlev += 2; /*FALLTHRU*/
+ xlev += 2;
+ /*FALLTHRU*/
case S_WRAITH:
- xlev += 2; /*FALLTHRU*/
+ xlev += 2;
+ /*FALLTHRU*/
case S_MUMMY:
- xlev += 2; /*FALLTHRU*/
+ xlev += 2;
+ /*FALLTHRU*/
case S_ZOMBIE:
if (u.ulevel >= xlev && !resist(mtmp, '\0', 0, NOTELL)) {
if (u.ualign.type == A_CHAOTIC) {
}
}
}
+
+ /*
+ * There is no detrimental effect on self for successful #turn
+ * while in demon or undead form. That can only be done while
+ * chaotic oneself (see "For some reason" above) and chaotic
+ * turning only makes targets peaceful.
+ *
+ * Paralysis duration probably ought to be based on the strengh
+ * of turned creatures rather than on turner's level.
+ * Why doesn't this honor Free_action? [Because being able to
+ * repeat #turn every turn would be too powerful. Maybe instead
+ * of nomul(-N) we should add the equivalent of mon->mspec_used
+ * for the hero and refuse to #turn when it's non-zero? Or have
+ * both and u.uspec_used only matters when Free_action prevents
+ * the brief paralysis?]
+ */
nomul(-(5 - ((u.ulevel - 1) / 6))); /* -5 .. -1 */
/*JP
multi_reason = "trying to turn the monsters";
}
static const char *hallu_gods[] = {
-#if 0 /*JP*/
+#if 0 /*JP:T*/
"the Flying Spaghetti Monster", /* Church of the FSM */
"Eris", /* Discordianism */
"the Martians", /* every science fiction ever */
if (!Hallucination)
return align_gname(alignment);
- /* The priest may not have initialized god names. If this is the
- * case, and we roll priest, we need to try again. */
+ /* Some roles (Priest) don't have a pantheon unless we're playing as
+ that role, so keep trying until we get a role which does have one.
+ [If playing a Priest, the current pantheon will be twice as likely
+ to get picked as any of the others. That's not significant enough
+ to bother dealing with.] */
do
- which = randrole();
+ which = randrole(TRUE);
while (!roles[which].lgod);
- switch (rn2(9)) {
+ switch (rn2_on_display_rng(9)) {
case 0:
case 1:
gnam = roles[which].lgod;
break;
case 6:
case 7:
- gnam = hallu_gods[rn2(sizeof hallu_gods / sizeof *hallu_gods)];
+ gnam = hallu_gods[rn2_on_display_rng(SIZE(hallu_gods))];
break;
case 8:
gnam = Moloch;
}
if (!gnam) {
impossible("No random god name?");
-#if 0 /*JP*/
+#if 0 /*JP:T*/
gnam = "your Friend the Computer"; /* Paranoia */
#else
gnam = "\90e\88¤\82È\82é\83R\83\93\83s\83\85\81[\83^"; /* Paranoia */
{
aligntyp altaralign = a_align(x, y);
- if (!strcmp(align_gname(altaralign), u_gname())) {
+ if (u.ualign.type == altaralign && u.ualign.record > -rn2(4)) {
/*JP
godvoice(altaralign, "How darest thou desecrate my altar!");
*/
godvoice(altaralign, "\93ð\81C\89ä\82ª\8dÕ\92d\82ð\89\98\82·\82©\81I");
(void) adjattrib(A_WIS, -1, FALSE);
+ u.ualign.record--;
} else {
-/*JP
- pline("A voice (could it be %s?) whispers:", align_gname(altaralign));
-*/
- pline("\82³\82³\82â\82«\90º(\82½\82Ô\82ñ%s\81H)\82ª\95·\82±\82¦\82é:", align_gname(altaralign));
+#if 0 /*JP:T*/
+ pline("%s %s%s:",
+ !Deaf ? "A voice (could it be"
+ : "Despite your deafness, you seem to hear",
+ align_gname(altaralign),
+ !Deaf ? "?) whispers" : " say");
+#else
+ pline("%s %s%s:",
+ !Deaf ? "\82³\82³\82â\82«\90º(\82½\82Ô\82ñ"
+ : "\8e¨\82Í\95·\82±\82¦\82È\82¢\82ª\81C",
+ align_gname(altaralign),
+ !Deaf ? "\81H)\82ª\95·\82±\82¦\82é" : "\82ª\98b\82µ\82Ä\82¢\82é\82Ì\82ª\95·\82±\82¦\82½\8bC\82ª\82µ\82½");
+#endif
/*JP
verbalize("Thou shalt pay, infidel!");
*/
verbalize("\88Ù\92[\8eÒ\82æ\81I\95ñ\82¢\82ð\8eó\82¯\82æ\81I");
- change_luck(-1);
+ /* higher luck is more likely to be reduced; as it approaches -5
+ the chance to lose another point drops down, eventually to 0 */
+ if (Luck > -5 && rn2(Luck + 6))
+ change_luck(rn2(20) ? -1 : -2);
}
}
int dx, dy;
{
register struct obj *otmp;
+ int nx, ny;
long count = 0L;
for (otmp = level.objects[u.ux + dx][u.uy + dy]; otmp;
count += otmp->quan;
}
+ nx = u.ux + 2 * dx, ny = u.uy + 2 * dy; /* next spot beyond boulder(s) */
switch (count) {
case 0:
/* no boulders--not blocked */
case 1:
/* possibly blocked depending on if it's pushable */
break;
+ case 2:
+ /* this is only approximate since multiple boulders might sink */
+ if (is_pool_or_lava(nx, ny)) /* does its own isok() check */
+ break; /* still need Sokoban check below */
+ /*FALLTHRU*/
default:
/* more than one boulder--blocked after they push the top one;
don't force them to push it first to find out */
return TRUE;
}
- if (!isok(u.ux + 2 * dx, u.uy + 2 * dy))
+ if (dx && dy && Sokoban) /* can't push boulder diagonally in Sokoban */
+ return TRUE;
+ if (!isok(nx, ny))
return TRUE;
- if (IS_ROCK(levl[u.ux + 2 * dx][u.uy + 2 * dy].typ))
+ if (IS_ROCK(levl[nx][ny].typ))
return TRUE;
- if (sobj_at(BOULDER, u.ux + 2 * dx, u.uy + 2 * dy))
+ if (sobj_at(BOULDER, nx, ny))
return TRUE;
return FALSE;