fix #H248 - 'speed monster' zap message not always necessary
From a bug report: zapping wand of speed monster (or slow monster) at an immobile monster would give the usual '<mon> is moving faster" (or slower) message even though the monster couldn't move at all. This fixes that for monsters who can never move and also for monsters who are temporarily paralyzed or asleep, although I wonder whether speed change magic ought to also snap the latter out of it.
This commit is contained in:
@@ -327,6 +327,8 @@ can't #force floor item while engulfed, levitating, or unskilled riding
|
||||
can't lock or unlock doors while engulfed
|
||||
if hero or monster standing on opened drawbridge survives its destruction,
|
||||
fall into water or lava instead of remaining on top
|
||||
don't give a speed change message when an immobile monster is seen to be hit
|
||||
by a wand of speed or slow monster
|
||||
|
||||
|
||||
Platform- and/or Interface-Specific Fixes
|
||||
|
||||
14
src/worn.c
14
src/worn.c
@@ -1,4 +1,4 @@
|
||||
/* SCCS Id: @(#)worn.c 3.5 2005/11/27 */
|
||||
/* SCCS Id: @(#)worn.c 3.5 2007/02/22 */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -246,7 +246,10 @@ struct obj *obj; /* item to make known if effect can be seen */
|
||||
else
|
||||
mon->mspeed = mon->permspeed;
|
||||
|
||||
if (give_msg && (mon->mspeed != oldspeed || petrify) && canseemon(mon)) {
|
||||
/* no message if monster is immobile (temp or perm) or unseen */
|
||||
if (give_msg && (mon->mspeed != oldspeed || petrify) &&
|
||||
mon->data->mmove && !(mon->mfrozen || mon->msleeping) &&
|
||||
canseemon(mon)) {
|
||||
/* fast to slow (skipping intermediate state) or vice versa */
|
||||
const char *howmuch = (mon->mspeed + oldspeed == MFAST + MSLOW) ?
|
||||
"much " : "";
|
||||
@@ -260,11 +263,8 @@ struct obj *obj; /* item to make known if effect can be seen */
|
||||
else
|
||||
pline("%s seems to be moving %sslower.", Monnam(mon), howmuch);
|
||||
|
||||
/* might discover an object if we see the speed change happen, but
|
||||
avoid making possibly forgotten book known when casting its spell */
|
||||
if (obj != 0 && obj->dknown &&
|
||||
objects[obj->otyp].oc_class != SPBOOK_CLASS)
|
||||
makeknown(obj->otyp);
|
||||
/* might discover an object if we see the speed change happen */
|
||||
if (obj != 0) learnwand(obj);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user