]> granicus.if.org Git - nethack/commitdiff
crystal balls and '~'
authornethack.allison <nethack.allison>
Sun, 19 Oct 2003 19:07:33 +0000 (19:07 +0000)
committernethack.allison <nethack.allison>
Sun, 19 Oct 2003 19:07:33 +0000 (19:07 +0000)
<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.

doc/fixes34.3
include/extern.h
src/detect.c
src/worm.c

index cda68ea6f65ed2aed1c2dc546611014802d87c24..31f4bdb1cc32742f0c963b7e7a17a104ec73cd74 100644 (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
index ca03362fb32a89102317641ef00410ba68d33227..89c4e6d5697dc4f8a071f40c19061ec56efa098e 100644 (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 *));
index 350acd2c32d4e192c7372b50aa97d74a49050979..ed73dab338c485e3c920d2bcf9441694d12abaa0 100644 (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;
index 22184d575b598b58ba69d1691b1f643607671f6c..3d7a32763a42bdd8cf21719b7afaf88e838523c3 100644 (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()