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