]> granicus.if.org Git - nethack/commitdiff
speed of petrified monsters
authornethack.rankin <nethack.rankin>
Sat, 31 Aug 2002 09:24:08 +0000 (09:24 +0000)
committernethack.rankin <nethack.rankin>
Sat, 31 Aug 2002 09:24:08 +0000 (09:24 +0000)
     Someone posted in the newsgroup about using stone-to-flesh
to reanimate a petrified pet and having it come back to life with
boosted speed intact.  When the character gets petrified, stripping
speed is one of the first things which happens, so now do that for
monsters too.  I decided not to make monsters who have normal speed
become slow; there isn't any analogous case for the player.

     Possible bug:  while testing this, I zapped a wand of probing
at a hill orc which had just eaten a lizard corpse to save itself
from stoning.  The feedback said "eating" but the orc immediately
hit and killed me as if it wasn't affected by any movement delay.

doc/fixes34.1
src/muse.c
src/trap.c
src/worn.c

index ddd810fa44c4906dd2c880cf87836921fab01b5d..ffc3bda5fbf988c482c738ce065820c0273d70ab 100644 (file)
@@ -229,6 +229,7 @@ fix a GOLDOBJ crash/hang in take_gold() that could be triggered by reading a
 kicking a tree could produce 0 to 4 killer bees but it should have been 1 to 5
 mounting a steed allowed hero to make moves that would otherwise be disallowed
        including mounting diagonally in a shop doorway
+monsters lose intrinsic speed when pertrified
 
 
 Platform- and/or Interface-Specific Fixes
index 505a583239f4837420aece96022ec0fc18caa9ab..68a8a599542e36cd372906b746a93ecb0b9b0d7f 100644 (file)
@@ -1,4 +1,4 @@
-/*     SCCS Id: @(#)muse.c     3.4     2002/02/07      */
+/*     SCCS Id: @(#)muse.c     3.4     2002/08/29      */
 /*     Copyright (C) 1990 by Ken Arromdee                         */
 /* NetHack may be freely redistributed.  See license for details.  */
 
@@ -2123,6 +2123,10 @@ boolean stoning;
     int nutrit = (obj->otyp == CORPSE) ? dog_nutrition(mon, obj) : 0;
     /* also sets meating */
 
+    /* give a "<mon> is slowing down" message and also remove
+       intrinsic speed (comparable to similar effect on the hero) */
+    mon_adjust_speed(mon, -3, (struct obj *)0);
+
     if (canseemon(mon)) {
        long save_quan = obj->quan;
 
index 062c2136bb20d22c2229c7d16484d3a9a3adc545..eb3a598b8ee4dc09ff1208955c8812e181fa6ec4 100644 (file)
@@ -1,4 +1,4 @@
-/*     SCCS Id: @(#)trap.c     3.4     2002/08/16      */
+/*     SCCS Id: @(#)trap.c     3.4     2002/08/29      */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -1989,6 +1989,11 @@ boolean byplayer;
                mon_to_stone(mon);
                return;
        }
+
+       /* give a "<mon> is slowing down" message and also remove
+          intrinsic speed (comparable to similar effect on the hero) */
+       mon_adjust_speed(mon, -3, (struct obj *)0);
+
        if (cansee(mon->mx, mon->my))
                pline("%s turns to stone.", Monnam(mon));
        if (byplayer) {
index 99b4967cb21bdf0cbe412010844fc9a5fd1b76f3..7f8fc8798294e21de0101639859ed1808959caa0 100644 (file)
@@ -1,4 +1,4 @@
-/*     SCCS Id: @(#)worn.c     3.4     2002/02/07      */
+/*     SCCS Id: @(#)worn.c     3.4     2002/08/30      */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -147,7 +147,7 @@ int adjust; /* positive => increase speed, negative => decrease */
 struct obj *obj;       /* item to make known if effect can be seen */
 {
     struct obj *otmp;
-    boolean give_msg = !in_mklev;
+    boolean give_msg = !in_mklev, stoned = FALSE;
     unsigned int oldspeed = mon->mspeed;
 
     switch (adjust) {
@@ -169,6 +169,11 @@ struct obj *obj;   /* item to make known if effect can be seen */
        mon->permspeed = MSLOW;
        give_msg = FALSE;       /* (not currently used) */
        break;
+     case -3:                  /* petrification */
+       /* take away intrinsic speed but don't reduce normal speed */
+       if (mon->permspeed == MFAST) mon->permspeed = 0;
+       stoned = TRUE;
+       break;
     }
 
     for (otmp = mon->minvent; otmp; otmp = otmp->nobj)
@@ -179,12 +184,16 @@ struct obj *obj;  /* item to make known if effect can be seen */
     else
        mon->mspeed = mon->permspeed;
 
-    if (give_msg && mon->mspeed != oldspeed && canseemon(mon)) {
+    if (give_msg && (mon->mspeed != oldspeed || stoned) && canseemon(mon)) {
        /* fast to slow (skipping intermediate state) or vice versa */
        const char *howmuch = (mon->mspeed + oldspeed == MFAST + MSLOW) ?
                                "much " : "";
 
-       if (adjust > 0 || mon->mspeed == MFAST)
+       if (stoned) {
+           /* mimic the player's petrification countdown; "slowing down"
+              even if fast movement rate retained via worn speed boots */
+           if (flags.verbose) pline("%s is slowing down.", Monnam(mon));
+       } else if (adjust > 0 || mon->mspeed == MFAST)
            pline("%s is suddenly moving %sfaster.", Monnam(mon), howmuch);
        else
            pline("%s seems to be moving %sslower.", Monnam(mon), howmuch);