From: nethack.rankin Date: Sat, 31 Aug 2002 09:24:08 +0000 (+0000) Subject: speed of petrified monsters X-Git-Tag: MOVE2GIT~2452 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5088492cf6c20137c24767506e743d079f3ae3db;p=nethack speed of petrified monsters 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. --- diff --git a/doc/fixes34.1 b/doc/fixes34.1 index ddd810fa4..ffc3bda5f 100644 --- a/doc/fixes34.1 +++ b/doc/fixes34.1 @@ -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 diff --git a/src/muse.c b/src/muse.c index 505a58323..68a8a5995 100644 --- a/src/muse.c +++ b/src/muse.c @@ -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 " 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; diff --git a/src/trap.c b/src/trap.c index 062c2136b..eb3a598b8 100644 --- a/src/trap.c +++ b/src/trap.c @@ -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 " 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) { diff --git a/src/worn.c b/src/worn.c index 99b4967cb..7f8fc8798 100644 --- a/src/worn.c +++ b/src/worn.c @@ -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);