fix B3032 -- wand of speed monster id
Make wands of speed or slow monster known if their effect on monsters is observed; likewise for speed boots. Also, avoid giving odd "the bat is moving faster" when seeing a bat created in gehennom and inaccurate "the monster is moving slower" when a monster puts on speed boots.
This commit is contained in:
@@ -2238,7 +2238,7 @@ E boolean FDECL(worm_known, (struct monst *));
|
|||||||
E void FDECL(setworn, (struct obj *,long));
|
E void FDECL(setworn, (struct obj *,long));
|
||||||
E void FDECL(setnotworn, (struct obj *));
|
E void FDECL(setnotworn, (struct obj *));
|
||||||
E void FDECL(mon_set_minvis, (struct monst *));
|
E void FDECL(mon_set_minvis, (struct monst *));
|
||||||
E void FDECL(mon_adjust_speed, (struct monst *,int));
|
E void FDECL(mon_adjust_speed, (struct monst *,int,struct obj *));
|
||||||
E void FDECL(update_mon_intrinsics, (struct monst *,struct obj *,BOOLEAN_P));
|
E void FDECL(update_mon_intrinsics, (struct monst *,struct obj *,BOOLEAN_P));
|
||||||
E int FDECL(find_mac, (struct monst *));
|
E int FDECL(find_mac, (struct monst *));
|
||||||
E void FDECL(m_dowear, (struct monst *,BOOLEAN_P));
|
E void FDECL(m_dowear, (struct monst *,BOOLEAN_P));
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* SCCS Id: @(#)apply.c 3.4 2002/01/18 */
|
/* SCCS Id: @(#)apply.c 3.4 2002/02/07 */
|
||||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
|
|
||||||
@@ -778,9 +778,8 @@ register struct obj *obj;
|
|||||||
} else switch (rn2(3)) {
|
} else switch (rn2(3)) {
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
case 1: in_mklev = TRUE; /* don't print messages */
|
case 1:
|
||||||
mon_adjust_speed(mtmp, 2);
|
mon_adjust_speed(mtmp, 2, (struct obj *)0);
|
||||||
in_mklev = FALSE;
|
|
||||||
break;
|
break;
|
||||||
case 2: /* no explanation; it just happens... */
|
case 2: /* no explanation; it just happens... */
|
||||||
nomovemsg = "";
|
nomovemsg = "";
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* SCCS Id: @(#)makemon.c 3.4 2001/11/07 */
|
/* SCCS Id: @(#)makemon.c 3.4 2002/02/07 */
|
||||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
|
|
||||||
@@ -928,7 +928,7 @@ register int mmflags;
|
|||||||
break;
|
break;
|
||||||
case S_BAT:
|
case S_BAT:
|
||||||
if (Inhell && is_bat(ptr))
|
if (Inhell && is_bat(ptr))
|
||||||
mon_adjust_speed(mtmp, 2);
|
mon_adjust_speed(mtmp, 2, (struct obj *)0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if ((ct = emits_light(mtmp->data)) > 0)
|
if ((ct = emits_light(mtmp->data)) > 0)
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* SCCS Id: @(#)mcastu.c 3.4 2002/01/10 */
|
/* SCCS Id: @(#)mcastu.c 3.4 2002/02/07 */
|
||||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
|
|
||||||
@@ -427,7 +427,7 @@ int spellnum;
|
|||||||
dmg = 0;
|
dmg = 0;
|
||||||
break;
|
break;
|
||||||
case MGC_HASTE_SELF:
|
case MGC_HASTE_SELF:
|
||||||
mon_adjust_speed(mtmp, 1);
|
mon_adjust_speed(mtmp, 1, (struct obj *)0);
|
||||||
dmg = 0;
|
dmg = 0;
|
||||||
break;
|
break;
|
||||||
case MGC_CURE_SELF:
|
case MGC_CURE_SELF:
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* SCCS Id: @(#)mhitm.c 3.4 2000/07/29 */
|
/* SCCS Id: @(#)mhitm.c 3.4 2002/02/07 */
|
||||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
|
|
||||||
@@ -805,7 +805,7 @@ label2: if (mdef->mhp > 0) return 0;
|
|||||||
if (!magr->mcan && vis && mdef->mspeed != MSLOW) {
|
if (!magr->mcan && vis && mdef->mspeed != MSLOW) {
|
||||||
unsigned int oldspeed = mdef->mspeed;
|
unsigned int oldspeed = mdef->mspeed;
|
||||||
|
|
||||||
mon_adjust_speed(mdef, -1);
|
mon_adjust_speed(mdef, -1, (struct obj *)0);
|
||||||
if (mdef->mspeed != oldspeed && vis)
|
if (mdef->mspeed != oldspeed && vis)
|
||||||
pline("%s slows down.", Monnam(mdef));
|
pline("%s slows down.", Monnam(mdef));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* SCCS Id: @(#)mon.c 3.4 2002/01/07 */
|
/* SCCS Id: @(#)mon.c 3.4 2002/02/07 */
|
||||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
|
|
||||||
@@ -2538,7 +2538,7 @@ int damtype, dam;
|
|||||||
}
|
}
|
||||||
if (slow) {
|
if (slow) {
|
||||||
if (mon->mspeed != MSLOW)
|
if (mon->mspeed != MSLOW)
|
||||||
mon_adjust_speed(mon, -1);
|
mon_adjust_speed(mon, -1, (struct obj *)0);
|
||||||
}
|
}
|
||||||
if (heal) {
|
if (heal) {
|
||||||
if (mon->mhp < mon->mhpmax) {
|
if (mon->mhp < mon->mhpmax) {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* SCCS Id: @(#)muse.c 3.4 2002/01/07 */
|
/* SCCS Id: @(#)muse.c 3.4 2002/02/07 */
|
||||||
/* Copyright (C) 1990 by Ken Arromdee */
|
/* Copyright (C) 1990 by Ken Arromdee */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
|
|
||||||
@@ -1738,7 +1738,7 @@ skipmsg:
|
|||||||
case MUSE_WAN_SPEED_MONSTER:
|
case MUSE_WAN_SPEED_MONSTER:
|
||||||
mzapmsg(mtmp, otmp, TRUE);
|
mzapmsg(mtmp, otmp, TRUE);
|
||||||
otmp->spe--;
|
otmp->spe--;
|
||||||
mon_adjust_speed(mtmp, 1);
|
mon_adjust_speed(mtmp, 1, otmp);
|
||||||
return 2;
|
return 2;
|
||||||
case MUSE_POT_SPEED:
|
case MUSE_POT_SPEED:
|
||||||
mquaffmsg(mtmp, otmp);
|
mquaffmsg(mtmp, otmp);
|
||||||
@@ -1746,8 +1746,7 @@ skipmsg:
|
|||||||
different methods of maintaining speed ratings:
|
different methods of maintaining speed ratings:
|
||||||
player's character becomes "very fast" temporarily;
|
player's character becomes "very fast" temporarily;
|
||||||
monster becomes "one stage faster" permanently */
|
monster becomes "one stage faster" permanently */
|
||||||
if (oseen) makeknown(POT_SPEED);
|
mon_adjust_speed(mtmp, 1, otmp);
|
||||||
mon_adjust_speed(mtmp, 1);
|
|
||||||
m_useup(mtmp, otmp);
|
m_useup(mtmp, otmp);
|
||||||
return 2;
|
return 2;
|
||||||
case MUSE_WAN_POLYMORPH:
|
case MUSE_WAN_POLYMORPH:
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* SCCS Id: @(#)potion.c 3.4 2002/01/15 */
|
/* SCCS Id: @(#)potion.c 3.4 2002/02/07 */
|
||||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
|
|
||||||
@@ -1058,7 +1058,7 @@ boolean your_fault;
|
|||||||
break;
|
break;
|
||||||
case POT_SPEED:
|
case POT_SPEED:
|
||||||
angermon = FALSE;
|
angermon = FALSE;
|
||||||
mon_adjust_speed(mon, 1);
|
mon_adjust_speed(mon, 1, obj);
|
||||||
break;
|
break;
|
||||||
case POT_BLINDNESS:
|
case POT_BLINDNESS:
|
||||||
if(haseyes(mon->data)) {
|
if(haseyes(mon->data)) {
|
||||||
|
|||||||
31
src/worn.c
31
src/worn.c
@@ -1,4 +1,4 @@
|
|||||||
/* SCCS Id: @(#)worn.c 3.4 2002/01/07 */
|
/* SCCS Id: @(#)worn.c 3.4 2002/02/07 */
|
||||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
|
|
||||||
@@ -141,17 +141,19 @@ struct monst *mon;
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
mon_adjust_speed(mon, adjust)
|
mon_adjust_speed(mon, adjust, obj)
|
||||||
struct monst *mon;
|
struct monst *mon;
|
||||||
int adjust; /* positive => increase speed, negative => decrease */
|
int adjust; /* positive => increase speed, negative => decrease */
|
||||||
|
struct obj *obj; /* item to make known if effect can be seen */
|
||||||
{
|
{
|
||||||
struct obj *otmp;
|
struct obj *otmp;
|
||||||
|
boolean give_msg = !in_mklev;
|
||||||
unsigned int oldspeed = mon->mspeed;
|
unsigned int oldspeed = mon->mspeed;
|
||||||
|
|
||||||
switch (adjust) {
|
switch (adjust) {
|
||||||
case 2:
|
case 2:
|
||||||
mon->permspeed = MFAST;
|
mon->permspeed = MFAST;
|
||||||
|
give_msg = FALSE; /* special case monster creation */
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
if (mon->permspeed == MSLOW) mon->permspeed = 0;
|
if (mon->permspeed == MSLOW) mon->permspeed = 0;
|
||||||
@@ -165,6 +167,7 @@ int adjust; /* positive => increase speed, negative => decrease */
|
|||||||
break;
|
break;
|
||||||
case -2:
|
case -2:
|
||||||
mon->permspeed = MSLOW;
|
mon->permspeed = MSLOW;
|
||||||
|
give_msg = FALSE; /* (not currently used) */
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -176,11 +179,21 @@ int adjust; /* positive => increase speed, negative => decrease */
|
|||||||
else
|
else
|
||||||
mon->mspeed = mon->permspeed;
|
mon->mspeed = mon->permspeed;
|
||||||
|
|
||||||
if (!in_mklev && mon->mspeed != oldspeed && canseemon(mon)) {
|
if (give_msg && mon->mspeed != oldspeed && canseemon(mon)) {
|
||||||
if (adjust > 0)
|
/* fast to slow (skipping intermediate state) or vice versa */
|
||||||
pline("%s is suddenly moving faster.", Monnam(mon));
|
const char *howmuch = (mon->mspeed + oldspeed == MFAST + MSLOW) ?
|
||||||
|
"much " : "";
|
||||||
|
|
||||||
|
if (adjust > 0 || mon->mspeed == MFAST)
|
||||||
|
pline("%s is suddenly moving %sfaster.", Monnam(mon), howmuch);
|
||||||
else
|
else
|
||||||
pline("%s seems to be moving slower.", Monnam(mon));
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -205,7 +218,7 @@ boolean on;
|
|||||||
mon->minvis = !mon->invis_blkd;
|
mon->minvis = !mon->invis_blkd;
|
||||||
break;
|
break;
|
||||||
case FAST:
|
case FAST:
|
||||||
mon_adjust_speed(mon, 0);
|
mon_adjust_speed(mon, 0, obj);
|
||||||
break;
|
break;
|
||||||
/* properties handled elsewhere */
|
/* properties handled elsewhere */
|
||||||
case ANTIMAGIC:
|
case ANTIMAGIC:
|
||||||
@@ -240,7 +253,7 @@ boolean on;
|
|||||||
mon->minvis = mon->perminvis;
|
mon->minvis = mon->perminvis;
|
||||||
break;
|
break;
|
||||||
case FAST:
|
case FAST:
|
||||||
mon_adjust_speed(mon, 0);
|
mon_adjust_speed(mon, 0, obj);
|
||||||
break;
|
break;
|
||||||
case FIRE_RES:
|
case FIRE_RES:
|
||||||
case COLD_RES:
|
case COLD_RES:
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* SCCS Id: @(#)zap.c 3.4 2002/01/07 */
|
/* SCCS Id: @(#)zap.c 3.4 2002/02/07 */
|
||||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
|
|
||||||
@@ -139,7 +139,7 @@ struct obj *otmp;
|
|||||||
case WAN_SLOW_MONSTER:
|
case WAN_SLOW_MONSTER:
|
||||||
case SPE_SLOW_MONSTER:
|
case SPE_SLOW_MONSTER:
|
||||||
if (!resist(mtmp, otmp->oclass, 0, NOTELL)) {
|
if (!resist(mtmp, otmp->oclass, 0, NOTELL)) {
|
||||||
mon_adjust_speed(mtmp, -1);
|
mon_adjust_speed(mtmp, -1, otmp);
|
||||||
m_dowear(mtmp, FALSE); /* might want speed boots */
|
m_dowear(mtmp, FALSE); /* might want speed boots */
|
||||||
if (u.uswallow && (mtmp == u.ustuck) &&
|
if (u.uswallow && (mtmp == u.ustuck) &&
|
||||||
is_whirly(mtmp->data)) {
|
is_whirly(mtmp->data)) {
|
||||||
@@ -151,7 +151,7 @@ struct obj *otmp;
|
|||||||
break;
|
break;
|
||||||
case WAN_SPEED_MONSTER:
|
case WAN_SPEED_MONSTER:
|
||||||
if (!resist(mtmp, otmp->oclass, 0, NOTELL)) {
|
if (!resist(mtmp, otmp->oclass, 0, NOTELL)) {
|
||||||
mon_adjust_speed(mtmp, 1);
|
mon_adjust_speed(mtmp, 1, otmp);
|
||||||
m_dowear(mtmp, FALSE); /* might want speed boots */
|
m_dowear(mtmp, FALSE); /* might want speed boots */
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -609,7 +609,7 @@ register struct obj *obj;
|
|||||||
NO_MINVENT|MM_NOWAIT);
|
NO_MINVENT|MM_NOWAIT);
|
||||||
if (mtmp) {
|
if (mtmp) {
|
||||||
mtmp->mhp = mtmp->mhpmax = 100;
|
mtmp->mhp = mtmp->mhpmax = 100;
|
||||||
mon_adjust_speed(mtmp, 2); /* MFAST */
|
mon_adjust_speed(mtmp, 2, (struct obj *)0); /* MFAST */
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (obj->oxlth && (obj->oattached == OATTACHED_MONST)) {
|
if (obj->oxlth && (obj->oattached == OATTACHED_MONST)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user