[Checked into cvs.]

When potions of full healing got added, they included the
ability to restore lost experience levels when blessed ones are
quaffed.  This patch throttles them so that when multiple levels
have been lost, drinking multiple potions can only restore half
of those levels.  Also, it prevents them from fixing any level
loss which occurs if you polymorph into a "new man" (or woman
or dwarf, &c, where you can gain or lose up to 2 levels).

     This also makes the "golden glow" prayer result be at least
as good as blessed full healing by restoring a lost level instead
of giving 5 extra hit points when you have any recoverable lost
levels pending.

     And tangentially related:  gaining a level while polymorphed
now gives your current monster form an extra hit die in addition
to the latent boost your normal human/whatever form gets.

Files patched:
  src/exper.c, polyself.c, potion.c, pray.c
This commit is contained in:
nethack.rankin
2002-01-18 02:48:30 +00:00
parent 53117c71cb
commit f7c01ecc71
5 changed files with 48 additions and 19 deletions

View File

@@ -388,6 +388,11 @@ going down to floor using > should set Heart of Ahriman invocation timeout
riding a steed into water kills the steed if it cannot swim, with penalties
gaze attacks now stop occupation
proper death message when killed by "plain" high priest
blessed full healing can't recover levels lost when polymorphing into new man
blessed full healing can reciver at most half of other lost levels
golden glow when praying will recover lost level if blessed full healing could
gaining a level while polymorphed increases current monst hit points as well
as latent human (or whatever) hit points
Platform- and/or Interface-Specific Fixes

View File

@@ -1,4 +1,4 @@
/* SCCS Id: @(#)exper.c 3.3 2000/07/23 */
/* SCCS Id: @(#)exper.c 3.3 2002/01/15 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -179,12 +179,17 @@ boolean incr; /* true iff via incremental experience growth */
num = newhp();
u.uhpmax += num;
u.uhp += num;
if (Upolyd) {
num = rnd(8);
u.mhmax += num;
u.mh += num;
}
if (u.ulevel < urole.xlev)
num = rn1((int)ACURR(A_WIS)/2 + urole.enadv.lornd + urace.enadv.lornd,
urole.enadv.lofix + urace.enadv.lofix);
urole.enadv.lofix + urace.enadv.lofix);
else
num = rn1((int)ACURR(A_WIS)/2 + urole.enadv.hirnd + urace.enadv.hirnd,
urole.enadv.hifix + urace.enadv.hifix);
urole.enadv.hifix + urace.enadv.hifix);
num = enermod(num); /* M. Stephenson */
u.uenmax += num;
u.uen += num;

View File

@@ -1,4 +1,4 @@
/* SCCS Id: @(#)polyself.c 3.3 2001/03/22 */
/* SCCS Id: @(#)polyself.c 3.3 2002/01/15 */
/* Copyright (C) 1987, 1988, 1989 by Ken Arromdee */
/* NetHack may be freely redistributed. See license for details. */
@@ -130,27 +130,34 @@ change_sex()
STATIC_OVL void
newman()
{
int tmp, tmp2;
int tmp, oldlvl;
tmp = u.uhpmax;
tmp2 = u.ulevel;
oldlvl = u.ulevel;
u.ulevel = u.ulevel + rn1(5, -2);
if (u.ulevel > 127 || u.ulevel < 1) { /* level went below 0? */
u.ulevel = tmp2; /* restore old level in case they lifesave */
u.ulevel = oldlvl; /* restore old level in case they lifesave */
goto dead;
}
if (u.ulevel > MAXULEV) u.ulevel = MAXULEV;
/* If your level goes down, your peak level goes down by
the same amount so that you can't simply use blessed
full healing to undo the decrease. But if your level
goes up, your peak level does *not* undergo the same
adjustment; you might end up losing out on the chance
to regain some levels previously lost to other causes. */
if (u.ulevel < oldlvl) u.ulevelmax -= (oldlvl - u.ulevel);
if (u.ulevelmax < u.ulevel) u.ulevelmax = u.ulevel;
if (!rn2(10)) change_sex();
adjabil(tmp2, (int)u.ulevel);
adjabil(oldlvl, (int)u.ulevel);
reset_rndmonst(NON_PM); /* new monster generation criteria */
/* random experience points for the new experience level */
u.uexp = rndexp();
/* u.uhpmax * u.ulevel / tmp2: proportionate hit points to new level
/* u.uhpmax * u.ulevel / oldlvl: proportionate hit points to new level
* -10 and +10: don't apply proportionate HP to 10 of a starting
* character's hit points (since a starting character's hit points
* are not on the same scale with hit points obtained through level
@@ -158,7 +165,7 @@ newman()
* 9 - rn2(19): random change of -9 to +9 hit points
*/
#ifndef LINT
u.uhpmax = ((u.uhpmax - 10) * (long)u.ulevel / tmp2 + 10) +
u.uhpmax = ((u.uhpmax - 10) * (long)u.ulevel / oldlvl + 10) +
(9 - rn2(19));
#endif
@@ -170,7 +177,7 @@ newman()
tmp = u.uenmax;
#ifndef LINT
u.uenmax = u.uenmax * (long)u.ulevel / tmp2 + 9 - rn2(19);
u.uenmax = u.uenmax * (long)u.ulevel / oldlvl + 9 - rn2(19);
#endif
if (u.uenmax < 0) u.uenmax = 0;
#ifndef LINT

View File

@@ -1,4 +1,4 @@
/* SCCS Id: @(#)potion.c 3.3 2001/12/07 */
/* SCCS Id: @(#)potion.c 3.3 2002/01/15 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -784,8 +784,12 @@ peffects(otmp)
You_feel("completely healed.");
healup(400, 4+4*bcsign(otmp), !otmp->cursed, TRUE);
/* Restore one lost level if blessed */
if (otmp->blessed && (u.ulevel < u.ulevelmax))
pluslvl(FALSE);
if (otmp->blessed && u.ulevel < u.ulevelmax) {
/* when multiple levels have been lost, drinking
multiple potions will only get half of them back */
u.ulevelmax -= 1;
pluslvl(FALSE);
}
make_hallucinated(0L,TRUE,0L);
exercise(A_STR, TRUE);
exercise(A_CON, TRUE);

View File

@@ -1,4 +1,4 @@
/* SCCS Id: @(#)pray.c 3.3 2001/11/29 */
/* SCCS Id: @(#)pray.c 3.3 2002/01/15 */
/* Copyright (c) Benson I. Margulies, Mike Stephenson, Steve Linhart, 1989. */
/* NetHack may be freely redistributed. See license for details. */
@@ -833,10 +833,18 @@ pleased(g_align)
/* Otherwise, falls into next case */
case 2:
if (!Blind)
You("are surrounded by %s glow.",
an(hcolor(golden)));
if (Upolyd) u.mh = u.mhmax += 5;
u.uhp = u.uhpmax += 5;
You("are surrounded by %s glow.", an(hcolor(golden)));
/* if any levels have been lost (and not yet regained),
treat this effect like blessed full healing */
if (u.ulevel < u.ulevelmax) {
u.ulevelmax -= 1; /* see potion.c */
pluslvl(FALSE);
} else {
u.uhpmax += 5;
if (Upolyd) u.mhmax += 5;
}
u.uhp = u.uhpmax;
if (Upolyd) u.mh = u.mhmax;
ABASE(A_STR) = AMAX(A_STR);
if (u.uhunger < 900) init_uhunger();
if (u.uluck < 0) u.uluck = 0;