potions of gain energy

When doing some more reformatting I came across something I've been
meaning to tweak for a long time, and since the change is only a couple
of lines I'm putting it in now instead of waiting.  Make potions of
gain energy more useful for actually regaining energy so they might not
be relegated to alchemy all the time.  The adjustment is probably too
low to really achieve that, but I didn't want to risk going too high.

Increase to max energy is only a little higher (average 10.5 vs 9 for
blessed, 7 vs 4 for uncursed) but to current energy is noticeably higher
(31.5 vs 9 for blessed, 21 vs 4 for uncursed; capped by max energy so
bigger increase only matters if current is below max when quaffing).
This commit is contained in:
PatR
2015-11-03 18:13:00 -08:00
parent 69b13d574d
commit 37771f779e
2 changed files with 118 additions and 93 deletions

View File

@@ -931,6 +931,7 @@ remaining monsters continued to move after hero conceptually left the level
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
@@ -972,7 +973,8 @@ Windows, probably MSDOS and OS/2: attempting to use very first false rumor
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
@@ -980,8 +982,8 @@ winCE: hide keypad when hardware keyboard is present
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
@@ -991,9 +993,9 @@ win32gui: made auto-arrange windows on/off option (it was reset automatically
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
@@ -1044,12 +1046,12 @@ debug-mode viewing of fully identified object descriptions without
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
@@ -1075,7 +1077,7 @@ add atmospheric sound messages for temples
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
@@ -1153,9 +1155,9 @@ options to create the character blind or nudist
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

View File

@@ -1,4 +1,4 @@
/* 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. */
@@ -115,9 +115,9 @@ int type;
long old = Sick;
#if 0
if (Unaware) talk = FALSE;
if (Unaware)
talk = FALSE;
#endif
if (xtime > 0L) {
if (Sick_resistance)
return;
@@ -162,9 +162,9 @@ const char *msg;
long old = Slimed;
#if 0
if (Unaware) msg = 0;
if (Unaware)
msg = 0;
#endif
if ((!xtime && old) || (xtime && !old)) {
if (msg)
pline1(msg);
@@ -186,9 +186,9 @@ const char *killername;
long old = Stoned;
#if 0
if (Unaware) msg = 0;
if (Unaware)
msg = 0;
#endif
if ((!xtime && old) || (xtime && !old)) {
if (msg)
pline1(msg);
@@ -440,8 +440,7 @@ ghost_from_bottle()
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()
{
@@ -470,7 +469,6 @@ dodrink()
return 1;
}
}
/* Or are you surrounded by water? */
if (Underwater && !u.uswallow) {
if (yn("Drink the water around you?") == 'y') {
@@ -681,7 +679,7 @@ register struct obj *otmp;
You_feel("rather itchy under %s.", yname(uarmc));
break;
}
/* FALLTHRU */
/* FALLTHRU */
case POT_INVISIBILITY:
if (Invis || Blind || BInvis) {
nothing++;
@@ -698,8 +696,7 @@ register struct obj *otmp;
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;
@@ -738,9 +735,9 @@ register struct obj *otmp;
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)
@@ -755,9 +752,9 @@ register struct obj *otmp;
}
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);
}
@@ -813,9 +810,9 @@ register struct obj *otmp;
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);
@@ -849,16 +846,17 @@ register struct obj *otmp;
}
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) {
@@ -868,6 +866,7 @@ register struct obj *otmp;
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));
@@ -885,11 +884,12 @@ register struct obj *otmp;
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++;
}
@@ -899,9 +899,9 @@ register struct obj *otmp;
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) {
@@ -910,6 +910,7 @@ register struct obj *otmp;
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);
@@ -930,10 +931,9 @@ register struct obj *otmp;
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:
@@ -1002,25 +1002,39 @@ register struct obj *otmp;
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) {
@@ -1038,13 +1052,15 @@ register struct obj *otmp;
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");
@@ -1096,8 +1112,8 @@ register boolean curesick, cureblind;
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.",
@@ -1111,6 +1127,7 @@ register const char *txt;
if (obj->dknown && !objects[obj->otyp].oc_name_known
&& !objects[obj->otyp].oc_uname)
docall(obj);
useup(obj);
}
@@ -1208,7 +1225,7 @@ register struct monst *mon;
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;
@@ -1271,9 +1288,9 @@ boolean your_fault;
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);
}
@@ -1324,9 +1341,11 @@ boolean your_fault;
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;
@@ -1371,9 +1390,9 @@ boolean your_fault;
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;
@@ -1512,13 +1531,13 @@ register struct obj *obj;
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;
@@ -1613,15 +1632,15 @@ register struct obj *obj;
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) {
@@ -1633,10 +1652,10 @@ register struct obj *obj;
}
}
/* 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
@@ -1730,6 +1749,7 @@ register struct obj *o1, *o2;
return 0;
}
/* #dip command */
int
dodip()
{
@@ -1795,15 +1815,16 @@ 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++;
@@ -1936,13 +1957,14 @@ dodip()
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
@@ -1966,6 +1988,7 @@ dodip()
if (potion->otyp == POT_OIL) {
boolean wisx = FALSE;
if (potion->lamplit) { /* burning */
fire_damage(obj, TRUE, u.ux, u.uy);
} else if (potion->cursed) {
@@ -2126,7 +2149,7 @@ struct monst **monp;
void
djinni_from_bottle(obj)
register struct obj *obj;
struct obj *obj;
{
struct monst *mtmp;
int chance;
@@ -2184,8 +2207,8 @@ register struct obj *obj;
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];