fix #1586 - stale alignment record after changing alignment type (trunk only)

From a bug report, putting on a helm of opposite
alignment wipes out divine protection (regardless of which god originally
bestored it) but leaves piety level towards the old god in place for the
new one.  Reset alignment record to 0 when changing alignment type.  Yes,
that means that the helm can now be used to clear a negative alignment,
which I think is in keeping with having subtle positive uses for bad items.

     Permanent alignment change did try to tweak alignment record, but
I'm not sure that it worked as intended.  Lawfuls changing away from law
got a bonus for their new alignment, neutrals retained their old record,
and chaotics changing away from chaos took a penalty to their record, all
without regard to what the new alignment became.  The magnitude of the
bonus or penalty was half the record limit (which gradually increases with
turn count) so could be very big, but I don't think it made much sense.
Reset alignment record to 0 for permanent conversion same as for temporary
conversion.  It's simpler and reflects the fact that you haven't yet done
anything to bolster or weaken your new alignment.
This commit is contained in:
nethack.rankin
2008-01-22 05:31:19 +00:00
parent bef9b86e0a
commit 3d1772a13b
3 changed files with 7 additions and 4 deletions

View File

@@ -276,6 +276,7 @@ secret door detection's trap finding is no longer blocked by water or clouds
potion thrown by monster which hit a long worm's tail gave feedback about
hitting its head
implement energy vortex's previously unused energy drain attack
changing alignment type resets alignment record to 0 (nomimally aligned)
Platform- and/or Interface-Specific Fixes

View File

@@ -704,7 +704,7 @@ int propidx; /* special cases can have negative values */
/* remove some verbosity and/or redundancy */
if ((p = strstri(buf, " pair of ")) != 0)
do ++p; while ((*p = *(p + 8)) != '\0');
copynchars(p + 1, p + 9, BUFSZ); /* overlapping buffers ok */
else if (propidx == STRANGLED &&
(p = strstri(buf, " of strangulation")) != 0)
*p = '\0';
@@ -948,7 +948,10 @@ int reason; /* 0==conversion, 1==helm-of-OA on, 2==helm-of-OA off */
"back in sync with your body");
}
if (u.ualign.type != oldalign) retouch_equipment(0);
if (u.ualign.type != oldalign) {
u.ualign.record = 0; /* slate is wiped clean */
retouch_equipment(0);
}
}
/*attrib.c*/

View File

@@ -1,4 +1,4 @@
/* SCCS Id: @(#)pray.c 3.5 2007/05/29 */
/* SCCS Id: @(#)pray.c 3.5 2008/01/21 */
/* Copyright (c) Benson I. Margulies, Mike Stephenson, Steve Linhart, 1989. */
/* NetHack may be freely redistributed. See license for details. */
@@ -1439,7 +1439,6 @@ verbalize("In return for thy service, I grant thee the gift of Immortality!");
/* Beware, Conversion is costly */
change_luck(-3);
u.ublesscnt += 300;
adjalign((int)(u.ualignbase[A_ORIGINAL] * (ALIGNLIM / 2)));
} else {
u.ugangr += 3;
adjalign(-5);