]> granicus.if.org Git - nethack/commitdiff
fix #H7226 - vault guard should have whistle
authorPatR <rankin@nethack.org>
Fri, 15 Jun 2018 23:24:02 +0000 (16:24 -0700)
committerPatR <rankin@nethack.org>
Fri, 15 Jun 2018 23:24:02 +0000 (16:24 -0700)
Implement the suggestion that since teleporting away from the vault
while being confronted by the guard results in a shrill whistling
sound, the vault guard ought to have a tin whistle in his inventory.

I also added a check that he does have the whistle and to give an
alternate message if not, but after half a dozen tries to have a
squad of beefed up monkeys steal the whistle, they never accomplished
that.  At least three times they took everything except the whistle
but I never succeeded in verifying the alternate message.

doc/fixes36.2
src/makemon.c
src/vault.c

index aafdcfd2563c7778c952d673b68a64f86248a982..ea039baaaf9d20ad2404280b5bc0eabf2a62b3c9 100644 (file)
@@ -36,6 +36,8 @@ internals for 'sortloot' option have been changed to not reorder the actual
        list of objects, so changing it to 'n'one will get the original order
        back and having a persistent inventory window open when performing
        full-pack identify won't result in possibly skipping some items
+give vault guards a cursed tin whistle since there is a shrill whistling
+       sound if hero teleports out of vault while being confronted by guard
 
 
 Fixes to Post-3.6.1 Problems that Were Exposed Via git Repository
index efca15e5d8e85a58ccda55828c856370a7cec409..a40121e0a9e8f8a1569657a3aefb33a3302a713e 100644 (file)
@@ -653,16 +653,26 @@ register struct monst *mtmp;
 
             nhUse(mac); /* suppress 'dead increment' from static analyzer */
 
-            if (ptr != &mons[PM_GUARD] && ptr != &mons[PM_WATCHMAN]
-                && ptr != &mons[PM_WATCH_CAPTAIN]) {
+            if (ptr == &mons[PM_WATCH_CAPTAIN]) {
+                ; /* better weapon rather than extra gear here */
+            } else if (ptr == &mons[PM_WATCHMAN]) {
+                if (rn2(3)) /* most watchmen carry a whistle */
+                    (void) mongets(mtmp, TIN_WHISTLE);
+            } else if (ptr == &mons[PM_GUARD]) {
+                /* if hero teleports out of a vault while being confronted
+                   by the vault's guard, there is a shrill whistling sound,
+                   so guard evidently carries a cursed whistle */
+                otmp = mksobj(TIN_WHISTLE, TRUE, FALSE);
+                curse(otmp);
+                (void) mpickobj(mtmp, otmp);
+            } else { /* soldiers and their officers */
                 if (!rn2(3))
                     (void) mongets(mtmp, K_RATION);
                 if (!rn2(2))
                     (void) mongets(mtmp, C_RATION);
                 if (ptr != &mons[PM_SOLDIER] && !rn2(3))
                     (void) mongets(mtmp, BUGLE);
-            } else if (ptr == &mons[PM_WATCHMAN] && rn2(3))
-                (void) mongets(mtmp, TIN_WHISTLE);
+            }
         } else if (ptr == &mons[PM_SHOPKEEPER]) {
             (void) mongets(mtmp, SKELETON_KEY);
             switch (rn2(4)) {
index e3bfb4ef0b01b1e65ba4652319795a4ab2e7da58..0f5724925ebb4230a18bcdf57aa6d02fe0e2d85f 100644 (file)
@@ -665,7 +665,10 @@ register struct monst *grd;
                 grd->mpeaceful = 0;
             letknow:
                 if (!cansee(grd->mx, grd->my) || !mon_visible(grd))
-                    You_hear("the shrill sound of a guard's whistle.");
+                    You_hear("%s.",
+                             m_carrying(grd, TIN_WHISTLE)
+                                 ? "the shrill sound of a guard's whistle"
+                                 : "angry shouting");
                 else
                     You(um_dist(grd->mx, grd->my, 2)
                             ? "see %s approaching."