diff --git a/src/allmain.c b/src/allmain.c index 66a0dd69c..3bcc63249 100644 --- a/src/allmain.c +++ b/src/allmain.c @@ -322,7 +322,6 @@ moveloop_core(void) u.udg_cnt = rn1(200, 50); } } - restore_attrib(); /* XXX This should be recoded to use something like regions - a list of * things that are active and need to be handled that is dynamically * maintained and not a list of special cases. */ diff --git a/src/apply.c b/src/apply.c index 568a73cb2..62cc4e785 100644 --- a/src/apply.c +++ b/src/apply.c @@ -3982,7 +3982,9 @@ unfixable_trouble_count(boolean is_horn) unfixable_trbl++; if (Strangled) unfixable_trbl++; - if (Wounded_legs && !u.usteed) + if (ATEMP(A_DEX) < 0 && Wounded_legs) + unfixable_trbl++; + if (ATEMP(A_STR) < 0 && u.uhs >= WEAK) unfixable_trbl++; /* lycanthropy is undesirable, but it doesn't actually make you feel bad so don't count it as a trouble which can't be fixed */ diff --git a/src/attrib.c b/src/attrib.c index 46398f662..7d74cc21a 100644 --- a/src/attrib.c +++ b/src/attrib.c @@ -377,19 +377,26 @@ set_moreluck(void) u.moreluck = -LUCKADD; } +/* (not used) */ void restore_attrib(void) { int i, equilibrium;; /* - * Note: this gets called on every turn but ATIME() is never set - * to non-zero anywhere, and ATEMP() is only used for strength loss - * from hunger, so it doesn't actually do anything. + * Note: this used to get called by moveloop() on every turn but + * ATIME() is never set to non-zero anywhere so didn't do anything. + * Presumably it once supported something like potion of heroism + * which conferred temporary characteristics boost(s). + * + * ATEMP() is used for strength loss from hunger, which doesn't + * time out, and for dexterity loss from wounded legs, which has + * its own timeout routine. */ for (i = 0; i < A_MAX; i++) { /* all temporary losses/gains */ - equilibrium = (i == A_STR && u.uhs >= WEAK) ? -1 : 0; + equilibrium = ((i == A_STR && u.uhs >= WEAK) + || (i == A_DEX && Wounded_legs)) ? -1 : 0; if (ATEMP(i) != equilibrium && ATIME(i) != 0) { if (!(--(ATIME(i)))) { /* countdown for change */ ATEMP(i) += (ATEMP(i) > 0) ? -1 : 1; diff --git a/src/potion.c b/src/potion.c index 72d69f8ab..686e83ecc 100644 --- a/src/potion.c +++ b/src/potion.c @@ -598,6 +598,8 @@ dopotion(struct obj *otmp) return ECMD_TIME; } +/* potion or spell of restore ability; for spell, otmp is a temporary + spellbook object that will be blessed if hero is skilled in healing */ static void peffect_restore_ability(struct obj *otmp) { @@ -608,11 +610,13 @@ peffect_restore_ability(struct obj *otmp) } else { int i, ii; - /* unlike unicorn horn, overrides Fixed_abil */ + /* unlike unicorn horn, overrides Fixed_abil; + does not recover temporary strength loss due to hunger + or temporary dexterity loss due to wounded legs */ pline("Wow! This makes you feel %s!", - (otmp->blessed) - ? (unfixable_trouble_count(FALSE) ? "better" : "great") - : "good"); + (!otmp->blessed) ? "good" + : unfixable_trouble_count(FALSE) ? "better" + : "great"); i = rn2(A_MAX); /* start at a random point */ for (ii = 0; ii < A_MAX; ii++) { int lim = AMAX(i);