]> granicus.if.org Git - nethack/commitdiff
unicorn horn vs sustain ability (trunk only)
authornethack.rankin <nethack.rankin>
Tue, 29 May 2007 03:52:02 +0000 (03:52 +0000)
committernethack.rankin <nethack.rankin>
Tue, 29 May 2007 03:52:02 +0000 (03:52 +0000)
     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.

doc/fixes35.0
src/apply.c
src/potion.c
src/pray.c

index 1a16289edd0f520d6d2c2428633638b93819d5db..57ce2f6be009c1f43ea917e504a1432594560f61 100644 (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
index 1d30731816c59edde6d0125412f0fd8f9eaafaaa..22907e49ce5f7f1cbbcb0ff56e31ca0e3c43cbec 100644 (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;
 
index f68a5f781c1ebf8542ca551a96ed0e0771db9052..932046cfb372927f6ea92996f798a94b604117a6 100644 (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")
index 15323e70db68d21f9a27124224bfd6074b654cbc..ebb77fbf273e27e90ac21e692533c4d12ccfc650 100644 (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;