]> granicus.if.org Git - nethack/commitdiff
addtional monster movement tweak
authornethack.rankin <nethack.rankin>
Wed, 16 May 2012 02:15:10 +0000 (02:15 +0000)
committernethack.rankin <nethack.rankin>
Wed, 16 May 2012 02:15:10 +0000 (02:15 +0000)
     Introduce some variation in monster movement by adding and substracting
small random amounts to the fixed increment from the main monster table.  The
amount added is potentially bigger (average is +2) than the amount substracted
(average is +1), so monsters will tend to be slightly faster.  Probably not
noticeable except for super-slow monsters not being so glacially slow, since
net +1 is a bigger relative increase for such critters' low movement rates.
In practice, the noticeable effect will be that ordinary speed monsters will
occasionally get an extra move even if/when player keeps the hero unburdened.

     Possible extension (although I'm not planning to do it):  sort the
monster list by pending movement points, so that faster monsters move before
slower ones.  The random variation would become noticeable because groups of
same-speed monsters would alter their movement order depending upon who got
a bigger increment or smaller decrement on that turn.

doc/fixes35.0
src/mon.c

index 74fa5f47b7975a88153e6cdef471414363ecbe3f..5a57db94386dc3635e33c5a0ff10db767f3c151e 100644 (file)
@@ -1049,6 +1049,7 @@ bones files now include extra data to identify dead hero and reason for death
 dipping multiple potions in another potion may only dip part of their stack
 make being inside a stinking cloud (when not immune or resistant) become a
        major trouble which is fixable by prayer
+introduce some variation in monster movement rates
 
 
 Platform- and/or Interface-Specific New Features
index aff3ee4e21b71398c46ab644d223ed363a235e99..ae6394d13f1d5dfce2c8ec637dc7deb78bc2db93 100644 (file)
--- a/src/mon.c
+++ b/src/mon.c
@@ -454,8 +454,16 @@ struct monst *mon;
            /* average movement is 1.50 times normal */
            mmove = ((rn2(2) ? 4 : 5) * mmove) / 3;
        }
-    }
+    } else
 #endif
+    if (mmove) {
+       /* vary movement points allocated to slightly reduce predictability;
+          random increment (avg +2) exceeds random decrement (avg +1) by
+          a small amount; normal speed monsters will occasionally get an
+          extra move and slow ones won't be quite as slow */
+       mmove += rn2(5) - rn2(3);       /* + 0..4 - 0..2, average net +1 */
+       if (mmove < 1) mmove = 1;
+    }
 
     return mmove;
 }