unicorn horn vs sustain ability (trunk only)

Forwarded from newsgroup by <Someone> in February, 2005:  non-cursed
unicorn horn fixes lost Str/Con/&c stats even when ring of sustain ability
is supposedly locking those at current value.  This makes unicorn horn
honor the Fixed_abil intrinsic.  The potion and spell of restore ability
still override that, so they now have potential for use even after player
has acquired a unihorn.  Prayer also continues to override Fixed_abil.
Major prayer result to heal crippled strength now attempts to uncurse a
ring of sustain ability (or gloves or weapon covering it up--similar
situation as with cursed levitation).  Minor prayer result to fix lost
stats resets those without attempting to do anything about Fixed_abil.
This commit is contained in:
nethack.rankin
2007-05-29 03:52:02 +00:00
parent ef3f758569
commit 8d880dd143
4 changed files with 26 additions and 3 deletions

View File

@@ -238,6 +238,7 @@ digging/chopping a closed drawbridge message mentioned digging a "wall"
attacking via applied polearm now honors the "confirm" option
engulfer under influence of conflict or confusion could swallow monster at
water/lava/trap spot and not be affected by destination til next move
unicorn horn restoration no longer overrides sustain ability characteristic
Platform- and/or Interface-Specific Fixes

View File

@@ -1671,9 +1671,16 @@ struct obj *obj;
/* collect attribute troubles */
for (idx = 0; idx < A_MAX; idx++) {
if (ABASE(idx) >= AMAX(idx)) continue;
val_limit = AMAX(idx);
/* don't recover strength lost from hunger */
if (idx == A_STR && u.uhs >= WEAK) val_limit--;
if (Fixed_abil) {
/* potion/spell of restore ability override sustain ability
intrinsic but unicorn horn usage doesn't */
unfixable_trbl += val_limit - ABASE(idx);
continue;
}
/* don't recover more than 3 points worth of any attribute */
if (val_limit > ABASE(idx) + 3) val_limit = ABASE(idx) + 3;

View File

@@ -1,4 +1,4 @@
/* SCCS Id: @(#)potion.c 3.5 2007/02/05 */
/* SCCS Id: @(#)potion.c 3.5 2007/05/29 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -478,6 +478,7 @@ peffects(otmp)
pline("Ulch! This makes you feel mediocre!");
break;
} else {
/* unlike unicorn horn, overrides Fixed_abil */
pline("Wow! This makes you feel %s!",
(otmp->blessed) ?
(unfixable_trouble_count(FALSE) ? "better" : "great")

View File

@@ -1,4 +1,4 @@
/* SCCS Id: @(#)pray.c 3.5 2007/03/19 */
/* SCCS Id: @(#)pray.c 3.5 2007/05/29 */
/* Copyright (c) Benson I. Margulies, Mike Stephenson, Steve Linhart, 1989. */
/* NetHack may be freely redistributed. See license for details. */
@@ -352,8 +352,21 @@ register int trouble;
context.botl = 1;
break;
case TROUBLE_COLLAPSING:
/* override Fixed_abil; uncurse that if feasible */
You_feel("%sstronger.",
(AMAX(A_STR) - ABASE(A_STR) > 6) ? "much " : "");
ABASE(A_STR) = AMAX(A_STR);
context.botl = 1;
if (Fixed_abil) {
if ((otmp = stuck_ring(uleft,
RIN_SUSTAIN_ABILITY)) != 0) {
if (otmp == uleft) what = leftglow;
} else if ((otmp = stuck_ring(uright,
RIN_SUSTAIN_ABILITY)) != 0) {
if (otmp == uright) what = rightglow;
}
if (otmp) goto decurse;
}
break;
case TROUBLE_STUCK_IN_WALL:
Your("surroundings change.");
@@ -428,11 +441,12 @@ decurse:
update_inventory();
break;
case TROUBLE_POISONED:
/* override Fixed_abil; ignore items which confer that */
if (Hallucination)
pline("There's a tiger in your tank.");
else
You_feel("in good health again.");
for(i=0; i<A_MAX; i++) {
for (i = 0; i < A_MAX; i++) {
if(ABASE(i) < AMAX(i)) {
ABASE(i) = AMAX(i);
context.botl = 1;