crystal balls and '~'

<Someone> wrote:
- You currently appear to be able to specify '~' and have it try
  to detect monsters (though it won't detect any long worms)

Show the entire worm when specifying either '~' or 'w' now.
This commit is contained in:
nethack.allison
2003-10-19 19:07:33 +00:00
parent b2ffe64968
commit db2620d481
4 changed files with 34 additions and 3 deletions

View File

@@ -53,6 +53,8 @@ non-weapon iron objects should rust when dipped in fountains since
suppress "turn to flee" message if monster is mfrozen
don't silently interrupt monster's hold on you if Levitation/Flying ends
while over water
you could specifiy '~' with crystal ball and have it try to detect monsters,
but it never revealed anything; show the entire long worm now
Platform- and/or Interface-Specific Fixes

View File

@@ -2322,6 +2322,7 @@ E void FDECL(wormgone, (struct monst *));
E void FDECL(wormhitu, (struct monst *));
E void FDECL(cutworm, (struct monst *,XCHAR_P,XCHAR_P,struct obj *));
E void FDECL(see_wsegs, (struct monst *));
E void FDECL(detect_wsegs, (struct monst *,BOOLEAN_P));
E void FDECL(save_worm, (int,int));
E void FDECL(rest_worm, (int));
E void FDECL(place_wsegs, (struct monst *));

View File

@@ -597,9 +597,13 @@ int mclass; /* monster class, 0 for all */
cls();
for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) {
if (DEADMONSTER(mtmp)) continue;
if (!mclass || mtmp->data->mlet == mclass)
if (mtmp->mx > 0)
show_glyph(mtmp->mx,mtmp->my,mon_to_glyph(mtmp));
if (!mclass || mtmp->data->mlet == mclass ||
(mtmp->data == &mons[PM_LONG_WORM] && mclass == S_WORM_TAIL))
if (mtmp->mx > 0) {
show_glyph(mtmp->mx,mtmp->my,mon_to_glyph(mtmp));
/* don't be stingy - display entire worm */
if (mtmp->data == &mons[PM_LONG_WORM]) detect_wsegs(mtmp,0);
}
if (otmp && otmp->cursed &&
(mtmp->msleeping || !mtmp->mcanmove)) {
mtmp->msleeping = mtmp->mfrozen = 0;

View File

@@ -450,6 +450,30 @@ see_wsegs(worm)
}
}
/*
* detect_wsegs()
*
* Display all of the segments of the given worm for detection.
*/
void
detect_wsegs(worm, use_detection_glyph)
struct monst *worm;
boolean use_detection_glyph;
{
int num;
struct wseg *curr = wtails[worm->wormno];
/* if (!mtmp->wormno) return; bullet proofing */
while (curr != wheads[worm->wormno]) {
num = use_detection_glyph ?
detected_monnum_to_glyph(what_mon(PM_LONG_WORM_TAIL)) :
monnum_to_glyph(what_mon(PM_LONG_WORM_TAIL));
show_glyph(curr->wx,curr->wy,num);
curr = curr->nseg;
}
}
/*
* save_worm()