]> granicus.if.org Git - nethack/commitdiff
Fixing a buglist bug. Also changing an unrelated buglist item a bit (it was
authorarromdee <arromdee>
Sun, 13 Jan 2002 20:37:18 +0000 (20:37 +0000)
committerarromdee <arromdee>
Sun, 13 Jan 2002 20:37:18 +0000 (20:37 +0000)
mine to begin with, I thought I had a way to fix it but it turns out I didn't,
so I was researching it again).

Checked into CVS.

doc/buglist
doc/fixes33.2
include/extern.h
src/artifact.c
src/do.c

index 82cb1ffd217b0455c18432abe2494e3d6175cbc8..860f45a1b4c62b8af8773b1dd075980b1d196346 100644 (file)
@@ -3,10 +3,6 @@ Buglist: actual bugs that may get fixed someday
 -----------------------------------------------------------------------------
 
 =============================================================================
-Using the '>' command to end controlled levitation doesn't set the
-Heart of Ahriman's invocation timeout, allowing the player to resume
-levitating immediately via #invoke.
-
 A funny thing happened at the portal to Rodney's tower. Wearing
 levitation boots, I floated onto the portal, and was ported to the
 tower. Then I took off my boots, and got "You activated the magic
@@ -250,17 +246,13 @@ small and quick (so the missile whizzed by)?  Is the monster flying or on the
 ground?  Is the player levitating?  Is the player unusually short or tall
 (i.e., if the player is polymorphed), etc....
 
-There is a problem with alignment: if you change alignment, peaceful monsters
-all stay the same and killing them is now bad for your new alignment--and thus
-good for your old alignment.  The "obvious" solution is to change the
-peacefulness and relative alignment of the monsters whenever your alignment
-changes.  This does not work because since monsters only have a percentage
-chance of peacefulness due to alignment, you can change and change back,
-whereupon the monster peacefulness will be distributed differently than when
-you started.  This also ignores monsters on other levels, whose peacefulness
-distribution would not change--for consistency, if you changed from lawful to
-chaotic and back, since peacefulness of monsters on your own level got
-redistributed, so would peacefulness on those other levels.
+Monsters don't change either peacefulness or malign when the player changes
+alignment.  This can't be fixed because it would be impossible to ensure that
+two alignment switches put the monsters back the way they were.  For one thing,
+monster peacefulness is based on the player's alignment record as well as his
+type (and we don't want to change peacefulness every time the record changes!),
+and for another, the monster's peacefulness might have changed from its initial
+value and two switches wouldn't bring it back to normal.
 
 You can open/close doors diagonally, but cannot enter them diagonally.  This
 seems inconsistent.  [Comment:  The main reason why this is blocked is
index cb8d44b7d041f7c1e8642810cfede7d7860bc955..7c84c90d565c074ab9fe7a6e6ba2757b09a93708 100644 (file)
@@ -384,6 +384,7 @@ monsters who can cast undirected spells don't need to be in combat with you
 messages consistent for all monster spells
 monsters casting spells at your displaced image now set mspec_used
 monsters without ranged spells don't print curse messages for ranged spells
+going down to floor using > should set Heart of Ahriman invocation timeout
 
 
 Platform- and/or Interface-Specific Fixes
index 6b74dc82c02bb4a9c55746c0fe619580efb268bb..7e5f7ee03d2c02725904677379ba4c6330baad12 100644 (file)
@@ -77,6 +77,7 @@ E int NDECL(doinvoke);
 E void FDECL(arti_speak, (struct obj *));
 E boolean FDECL(artifact_light, (struct obj *));
 E long FDECL(spec_m2, (struct obj *));
+E boolean FDECL(artifact_has_invprop, (struct obj *,UCHAR_P));
 
 /* ### attrib.c ### */
 
index 0e043be235e2166d1f06b5d9f4747e6871834807..8df5d0184738f4dcf72cf720d54f7e4c83c69a9f 100644 (file)
@@ -1332,6 +1332,15 @@ void arti_speak(obj)
        return;
 }
 
+boolean
+artifact_has_invprop(otmp, inv_prop)
+struct obj *otmp;
+uchar inv_prop;
+{
+       const struct artifact *arti = get_artifact(otmp);
+
+       return((boolean)(arti && (arti->inv_prop == inv_prop)));
+}
 
 #endif /* OVLB */
 
index 1b1449cbe01ec069c9e84534881868583fec82c9..821560bd6c16de6a189a6851c71694213e4455c1 100644 (file)
--- a/src/do.c
+++ b/src/do.c
@@ -711,8 +711,21 @@ dodown()
        if (Levitation) {
            if ((HLevitation & I_SPECIAL) || (ELevitation & W_ARTI)) {
                /* end controlled levitation */
-                       if (float_down(I_SPECIAL|TIMEOUT, W_ARTI))
-                           return (1);   /* came down, so moved */
+               if (ELevitation & W_ARTI) {
+                   struct obj *obj;
+
+                   for(obj = invent; obj; obj = obj->nobj) {
+                       if (obj->oartifact &&
+                                       artifact_has_invprop(obj,LEVITATION)) {
+                           if (obj->age < monstermoves)
+                               obj->age = monstermoves + rnz(100);
+                           else
+                               obj->age += rnz(100);
+                       }
+                   }
+               }
+               if (float_down(I_SPECIAL|TIMEOUT, W_ARTI))
+                   return (1);   /* came down, so moved */
            }
            floating_above(stairs_down ? "stairs" : ladder_down ?
                           "ladder" : surface(u.ux, u.uy));