it be feasible--but not practical--to level teleport with the Amulet)
#turn for non-priest/non-knight attempts to cast "turn undead" spell, but
was forcing the spell to target self rather than choose a direction
+potions of gain energy are more useful for recovering hero's spell energy
Platform- and/or Interface-Specific Fixes
of waiting until hero's next move
winCE: disable processing of double-click messages if the first click
causes map to scroll
-winCE: help text windows close immediately after open (unhandled WM_KEYDOWN in mhtext.c)
+winCE: help text windows close immediately after open (unhandled WM_KEYDOWN
+ in mhtext.c)
winCE: correct coordinates used by action button
winCE: wrap/unwrap text option for text windows
winCE: hardware keyboard detection
winCE: backport message window highlighting from winnt port
winCE: new icon with recommended image sizes
pocketpc: menu window closes on up/down keys from first/last position
-win32gui: better handling of "more" prompt for messages that would have scrolled
- off the window
+win32gui: better handling of "more" prompt for messages that would have
+ scrolled off the window
win32gui: set correct checkmark on "Lock Windows" menu item on startup
win32gui: redraw message window on resizing (it does not update properly otherwise)
win32gui: fixed copy/paste error in read registry settings function
win32gui: fix a possible crash with AltGr-4 WM_KEYDOWN handling
win32gui: use whatever alternate tile set is loaded in the menus
win32tty: prevent early error messages from flashing by too fast and not seen
-win32tty: work around problem where display symbols were wrong or unrecognizable
- on systems where the default language for non-Unicode programs was not
- set to "US English" - courtesy Ray Chason
+win32tty: work around problem where display symbols were wrong or
+ unrecognizable on systems where the default language for non-Unicode
+ programs was not set to "US English" - courtesy Ray Chason
win32tty: work around problem where some characters did not show up if the
console code page was other than 437
X11: support dynamic switching of map mode via tiled_map option
actually identifying the objects
health-food store that stocks monk-appropriate foods in mine town when monk
give more information about your attributes in debug mode
-polywarn to give intrinsic monster detection of limited species while polymorphed
-rocks can skip on the water sometimes allowing them to pass over water creatures
-vampires can now shapeshift into bats and fog clouds; the latter can be done at
- will to slip through locked doors
-shapeshifted vampire will transform back to vampire form after you defeat it and
- continue to fight in its native form
+polywarn to give intrinsic monster detection of limited species while poly'd
+rocks can skip on water sometimes allowing them to pass over water creatures
+vampires can now shapeshift into bats and fog clouds; the latter can be done
+ at will to slip through locked doors
+shapeshifted vampire will transform back to vampire form after you defeat it
+ and continue to fight in its native form
container lknown flag for locked/unlocked/broken awareness
container cknown flag for container content awareness
plname is stored in the save file on all platforms now
sometimes give announcement message when monsters teleport to hero's vicinity
obsolete config file keywords: GRAPHICS, OBJECTS, TRAPS, EFFECTS
deprecated options: IBMGraphics, DECGraphics, boulder
-new options: symset, roguesymset for choosing a symbol set from the symbols file
+new options: symset, roguesymset for choosing a symbol set from symbols file
new config file keyword: SYMBOLS for overriding character symbol values by name
opening magic frees from bear traps and webs, activates trap doors
closing magic activates bear traps and webs
moving clouds on the plane of air
disclose extinct species alongside genocided ones
a tribute to Terry Pratchett
-Some levels in Gehennom now use the old corridor-style maze instead of
- the new room-style. Beelzebub's level always does this and the
- "beetle legs" are restored.
+Some levels in Gehennom now use the old corridor-style maze instead of the
+ new room-style. Beelzebub's level always does this and the
+ "beetle legs" are restored.
gnomes will occasionally have a candle
stop travel or run when you get hungry
'I' command can accept 'B','U','C',or 'X' as an alternative to normal object
-/* NetHack 3.6 potion.c $NHDT-Date: 1445556882 2015/10/22 23:34:42 $ $NHDT-Branch: master $:$NHDT-Revision: 1.119 $ */
+/* NetHack 3.6 potion.c $NHDT-Date: 1446603164 2015/11/04 02:12:44 $ $NHDT-Branch: master $:$NHDT-Revision: 1.120 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
long old = Sick;
#if 0
- if (Unaware) talk = FALSE;
+ if (Unaware)
+ talk = FALSE;
#endif
-
if (xtime > 0L) {
if (Sick_resistance)
return;
long old = Slimed;
#if 0
- if (Unaware) msg = 0;
+ if (Unaware)
+ msg = 0;
#endif
-
if ((!xtime && old) || (xtime && !old)) {
if (msg)
pline1(msg);
long old = Stoned;
#if 0
- if (Unaware) msg = 0;
+ if (Unaware)
+ msg = 0;
#endif
-
if ((!xtime && old) || (xtime && !old)) {
if (msg)
pline1(msg);
nomovemsg = "You regain your composure.";
}
-/* "Quaffing is like drinking, except you spill more." -- Terry Pratchett
- */
+/* "Quaffing is like drinking, except you spill more." - Terry Pratchett */
int
dodrink()
{
return 1;
}
}
-
/* Or are you surrounded by water? */
if (Underwater && !u.uswallow) {
if (yn("Drink the water around you?") == 'y') {
You_feel("rather itchy under %s.", yname(uarmc));
break;
}
- /* FALLTHRU */
+ /* FALLTHRU */
case POT_INVISIBILITY:
if (Invis || Blind || BInvis) {
nothing++;
aggravate();
}
break;
- case POT_SEE_INVISIBLE:
- /* tastes like fruit juice in Rogue */
+ case POT_SEE_INVISIBLE: /* tastes like fruit juice in Rogue */
case POT_FRUIT_JUICE: {
int msg = Invisible && !Blind;
break;
}
case POT_PARALYSIS:
- if (Free_action)
+ if (Free_action) {
You("stiffen momentarily.");
- else {
+ } else {
if (Levitation || Is_airlevel(&u.uz) || Is_waterlevel(&u.uz))
You("are motionlessly suspended.");
else if (u.usteed)
}
break;
case POT_SLEEPING:
- if (Sleep_resistance || Free_action)
+ if (Sleep_resistance || Free_action) {
You("yawn.");
- else {
+ } else {
You("suddenly fall asleep!");
fall_asleep(-rn1(10, 25 - 12 * bcsign(otmp)), TRUE);
}
if (Poison_resistance)
pline("(But in fact it was biologically contaminated %s.)",
fruitname(TRUE));
- if (Role_if(PM_HEALER))
+ if (Role_if(PM_HEALER)) {
pline("Fortunately, you have been immunized.");
- else {
+ } else {
char contaminant[BUFSZ];
int typ = rn2(A_MAX);
}
break;
case POT_CONFUSION:
- if (!Confusion)
+ if (!Confusion) {
if (Hallucination) {
pline("What a trippy feeling!");
unkn++;
} else
pline("Huh, What? Where am I?");
- else
+ } else
nothing++;
- make_confused(
- itimeout_incr(HConfusion, rn1(7, 16 - 8 * bcsign(otmp))), FALSE);
+ make_confused(itimeout_incr(HConfusion,
+ rn1(7, 16 - 8 * bcsign(otmp))),
+ FALSE);
break;
case POT_GAIN_ABILITY:
if (otmp->cursed) {
nothing++;
} else { /* If blessed, increase all; if not, try up to */
int itmp; /* 6 times to find one which can be increased. */
+
i = -1; /* increment to 0 */
for (ii = A_MAX; ii > 0; ii--) {
i = (otmp->blessed ? i + 1 : rn2(A_MAX));
heal_legs();
unkn++;
break;
- } /* and fall through */
+ }
+ /* FALLTHRU */
case SPE_HASTE_SELF:
- if (!Very_fast) /* wwf@doe.carleton.ca */
+ if (!Very_fast) { /* wwf@doe.carleton.ca */
You("are suddenly moving %sfaster.", Fast ? "" : "much ");
- else {
+ } else {
Your("%s get new energy.", makeplural(body_part(LEG)));
unkn++;
}
case POT_BLINDNESS:
if (Blind)
nothing++;
- make_blinded(
- itimeout_incr(Blinded, rn1(200, 250 - 125 * bcsign(otmp))),
- (boolean) !Blind);
+ make_blinded(itimeout_incr(Blinded,
+ rn1(200, 250 - 125 * bcsign(otmp))),
+ (boolean) !Blind);
break;
case POT_GAIN_LEVEL:
if (otmp->cursed) {
if ((ledger_no(&u.uz) == 1 && u.uhave.amulet)
|| Can_rise_up(u.ux, u.uy, &u.uz)) {
const char *riseup = "rise up, through the %s!";
+
if (ledger_no(&u.uz) == 1) {
You(riseup, ceiling(u.ux, u.uy));
goto_level(&earth_level, FALSE, FALSE, FALSE);
break;
}
pluslvl(FALSE);
+ /* blessed potions place you at a random spot in the
+ middle of the new level instead of the low point */
if (otmp->blessed)
- /* blessed potions place you at a random spot in the
- * middle of the new level instead of the low point
- */
u.uexp = rndexp(TRUE);
break;
case POT_HEALING:
spoteffects(FALSE); /* for sinks */
float_vs_flight();
break;
- case POT_GAIN_ENERGY: /* M. Stephenson */
- {
- register int num;
+ case POT_GAIN_ENERGY: { /* M. Stephenson */
+ int num;
+
if (otmp->cursed)
You_feel("lackluster.");
else
pline("Magical energies course through your body.");
- num = rnd(5) + 5 * otmp->blessed + 1;
- u.uenmax += (otmp->cursed) ? -num : num;
- u.uen += (otmp->cursed) ? -num : num;
+
+ /* old: num = rnd(5) + 5 * otmp->blessed + 1;
+ * blessed: +7..11 max & current (+9 avg)
+ * uncursed: +2.. 6 max & current (+4 avg)
+ * cursed: -2.. 6 max & current (-4 avg)
+ * new: (3.6.0)
+ * blessed: +3..18 max (+10.5 avg), +9..54 current (+31.5 avg)
+ * uncursed: +2..12 max (+ 7 avg), +6..36 current (+21 avg)
+ * cursed: -1.. 6 max (- 3.5 avg), -3..18 current (-10.5 avg)
+ */
+ num = d(otmp->blessed ? 3 : !otmp->cursed ? 2 : 1, 6);
+ if (otmp->cursed)
+ num = -num; /* subtract instead of add when cursed */
+ u.uenmax += num;
if (u.uenmax <= 0)
u.uenmax = 0;
- if (u.uen <= 0)
+ u.uen += 3 * num;
+ if (u.uen > u.uenmax)
+ u.uen = u.uenmax;
+ else if (u.uen <= 0)
u.uen = 0;
context.botl = 1;
exercise(A_WIS, TRUE);
- } break;
- case POT_OIL: /* P. Winner */
- {
+ break;
+ }
+ case POT_OIL: { /* P. Winner */
boolean good_for_you = FALSE;
if (otmp->lamplit) {
else
pline("That was smooth!");
exercise(A_WIS, good_for_you);
- } break;
+ break;
+ }
case POT_ACID:
- if (Acid_resistance)
+ if (Acid_resistance) {
/* Not necessarily a creature who _likes_ acid */
pline("This tastes %s.", Hallucination ? "tangy" : "sour");
- else {
+ } else {
int dmg;
+
pline("This burns%s!",
otmp->blessed ? " a little" : otmp->cursed ? " a lot"
: " like acid");
void
strange_feeling(obj, txt)
-register struct obj *obj;
-register const char *txt;
+struct obj *obj;
+const char *txt;
{
if (flags.beginner || !txt)
You("have a %s feeling for a moment, then it passes.",
if (obj->dknown && !objects[obj->otyp].oc_name_known
&& !objects[obj->otyp].oc_uname)
docall(obj);
+
useup(obj);
}
register struct obj *obj;
boolean your_fault;
{
- register const char *botlnam = bottlename();
+ const char *botlnam = bottlename();
boolean isyou = (mon == &youmonst);
int distance;
struct obj *saddle = (struct obj *) 0;
case POT_ACID:
if (!Acid_resistance) {
int dmg;
- pline("This burns%s!", obj->blessed
- ? " a little"
- : obj->cursed ? " a lot" : "");
+ pline("This burns%s!",
+ obj->blessed ? " a little"
+ : obj->cursed ? " a lot" : "");
dmg = d(obj->cursed ? 2 : 1, obj->blessed ? 4 : 8);
losehp(Maybe_Half_Phys(dmg), "potion of acid", KILLED_BY_AN);
}
case POT_SICKNESS:
if (mon->data == &mons[PM_PESTILENCE])
goto do_healing;
- if (dmgtype(mon->data, AD_DISE) || dmgtype(mon->data, AD_PEST)
- || /* won't happen, see prior goto */
- resists_poison(mon)) {
+ if (dmgtype(mon->data, AD_DISE)
+ /* won't happen, see prior goto */
+ || dmgtype(mon->data, AD_PEST)
+ /* most common case */
+ || resists_poison(mon)) {
if (canseemon(mon))
pline("%s looks unharmed.", Monnam(mon));
break;
break;
case POT_BLINDNESS:
if (haseyes(mon->data)) {
- register int btmp =
- 64 + rn2(32)
- + rn2(32) * !resist(mon, POTION_CLASS, 0, NOTELL);
+ register int btmp = 64 + rn2(32)
+ + rn2(32) * !resist(mon, POTION_CLASS, 0, NOTELL);
+
btmp += mon->mblinded;
mon->mblinded = min(btmp, 127);
mon->mcansee = 0;
u.mh++, context.botl = 1;
if (u.uhp < u.uhpmax)
u.uhp++, context.botl = 1;
- /*FALL THROUGH*/
+ /*FALLTHRU*/
case POT_EXTRA_HEALING:
if (Upolyd && u.mh < u.mhmax)
u.mh++, context.botl = 1;
if (u.uhp < u.uhpmax)
u.uhp++, context.botl = 1;
- /*FALL THROUGH*/
+ /*FALLTHRU*/
case POT_HEALING:
if (Upolyd && u.mh < u.mhmax)
u.mh++, context.botl = 1;
case POT_POLYMORPH:
exercise(A_CON, FALSE);
break;
- /*
- case POT_GAIN_LEVEL:
- case POT_LEVITATION:
- case POT_FRUIT_JUICE:
- case POT_MONSTER_DETECTION:
- case POT_OBJECT_DETECTION:
- case POT_OIL:
- break;
- */
+ /*
+ case POT_GAIN_LEVEL:
+ case POT_LEVITATION:
+ case POT_FRUIT_JUICE:
+ case POT_MONSTER_DETECTION:
+ case POT_OBJECT_DETECTION:
+ case POT_OIL:
+ break;
+ */
}
/* note: no obfree() */
if (obj->dknown) {
}
}
+/* returns the potion type when o1 is dipped in o2 */
STATIC_OVL short
mixtype(o1, o2)
register struct obj *o1, *o2;
-/* returns the potion type when o1 is dipped in o2 */
{
/* cut down on the number of cases below */
if (o1->oclass == POTION_CLASS
return 0;
}
+/* #dip command */
int
dodip()
{
goto poof;
} else if (obj->otyp == POT_POLYMORPH || potion->otyp == POT_POLYMORPH) {
/* some objects can't be polymorphed */
- if (obj->otyp == potion->otyp || /* both POT_POLY */
- obj->otyp == WAN_POLYMORPH || obj->otyp == SPE_POLYMORPH
+ if (obj->otyp == potion->otyp /* both POT_POLY */
+ || obj->otyp == WAN_POLYMORPH || obj->otyp == SPE_POLYMORPH
|| obj == uball || obj == uskin
- || obj_resists(obj->otyp == POT_POLYMORPH ? potion : obj, 5,
- 95)) {
+ || obj_resists(obj->otyp == POT_POLYMORPH ? potion : obj,
+ 5, 95)) {
pline1(nothing_happens);
} else {
boolean was_wep, was_swapwep, was_quiver;
short save_otyp = obj->otyp;
+
/* KMH, conduct */
u.uconduct.polypiles++;
if (potion->otyp == POT_WATER && obj->otyp == TOWEL) {
pline_The("towel soaks it up!");
- /* wetting the towel already done via H2Opotion_dip */
+ /* wetting towel already done via water_damage() in H2Opotion_dip */
goto poof;
}
if (is_poisonable(obj)) {
if (potion->otyp == POT_SICKNESS && !obj->opoisoned) {
char buf[BUFSZ];
+
if (potion->quan > 1L)
Sprintf(buf, "One of %s", the(xname(potion)));
else
if (potion->otyp == POT_OIL) {
boolean wisx = FALSE;
+
if (potion->lamplit) { /* burning */
fire_damage(obj, TRUE, u.ux, u.uy);
} else if (potion->cursed) {
void
djinni_from_bottle(obj)
-register struct obj *obj;
+struct obj *obj;
{
struct monst *mtmp;
int chance;
hit points are cut in half (odd HP stays with original) */
struct monst *
split_mon(mon, mtmp)
-struct monst *mon, /* monster being split */
- *mtmp; /* optional attacker whose heat triggered it */
+struct monst *mon, /* monster being split */
+ *mtmp; /* optional attacker whose heat triggered it */
{
struct monst *mtmp2;
char reason[BUFSZ];