fixing bad luck via sacrifice

- From a bug report: if sacrifice doesn't clear the timeout until prayer,
your bad luck is cleared, but if it does, your luck could remain negative
This commit is contained in:
cohrs
2002-03-09 02:56:46 +00:00
parent 388a35a8b3
commit fb27e35694
+3 -1
View File
@@ -1387,7 +1387,8 @@ verbalize("In return for thy service, I grant thee the gift of Immortality!");
/* you were already in pretty good standing */ /* you were already in pretty good standing */
/* The player can gain an artifact */ /* The player can gain an artifact */
/* The chance goes down as the number of artifacts goes up */ /* The chance goes down as the number of artifacts goes up */
if (u.ulevel > 2 && !rn2(10 + (2 * u.ugifts * nartifacts))) { if (u.ulevel > 2 && u.uluck >= 0 &&
!rn2(10 + (2 * u.ugifts * nartifacts))) {
otmp = mk_artifact((struct obj *)0, a_align(u.ux,u.uy)); otmp = mk_artifact((struct obj *)0, a_align(u.ux,u.uy));
if (otmp) { if (otmp) {
if (otmp->spe < 0) otmp->spe = 0; if (otmp->spe < 0) otmp->spe = 0;
@@ -1406,6 +1407,7 @@ verbalize("In return for thy service, I grant thee the gift of Immortality!");
} }
} }
change_luck((value * LUCKMAX) / (MAXVALUE * 2)); change_luck((value * LUCKMAX) / (MAXVALUE * 2));
if ((int)u.uluck < 0) u.uluck = 0;
if (u.uluck != saved_luck) { if (u.uluck != saved_luck) {
if (Blind) if (Blind)
You("think %s brushed your %s.",something, body_part(FOOT)); You("think %s brushed your %s.",something, body_part(FOOT));