]> granicus.if.org Git - nethack/commitdiff
polymorphed quest leader
authornethack.rankin <nethack.rankin>
Sat, 24 Mar 2007 04:45:24 +0000 (04:45 +0000)
committernethack.rankin <nethack.rankin>
Sat, 24 Mar 2007 04:45:24 +0000 (04:45 +0000)
     From the newsgroup:  player chatted with leader and was ejected for
not being high enough level, then when he came back later there was no
leader to be found, but there was a polymorph trap on quest home level.
This makes quest leaders and nemesis be aware of all trap types--rather
than just having leaders be aware of magic portals--so they'll be able to
avoid polymorph traps.  It also makes chatting with a polymorphed leader
work as long as the new form is able to speak (use same criteria as with
poly'd shopkeepers:  can't be in a form that's limited to animal sounds).

doc/fixes34.4
src/makemon.c
src/sounds.c

index e9d76c0b481383bb57e82db6a2a48568ec5933cc..768d55c8e618d6f6ebae1c0dd30eea1d2abd4ec5 100644 (file)
@@ -341,6 +341,7 @@ lit candle or potion of oil which burned out while equipped would leave stale
        weapon/alternate-weapon/quiver pointer that could cause panic or crash
 wielded/worn figurine which auto-transformed had same stale pointer bug
 format names of not yet id'd artifacts such that obj type shows for non-weapons
+make quest leader be unlikely to be affected by polymorph traps
 
 
 Platform- and/or Interface-Specific Fixes
index b3f1f6f2a1ee7f01e55b95e028bf94f6fd8f723a..3cc915f44fae6658b05a3f5cf000358783833434 100644 (file)
@@ -1,4 +1,4 @@
-/*     SCCS Id: @(#)makemon.c  3.5     2007/01/19      */
+/*     SCCS Id: @(#)makemon.c  3.5     2007/03/23      */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -964,8 +964,7 @@ register int        mmflags;
        mtmp->m_id = context.ident++;
        if (!mtmp->m_id) mtmp->m_id = context.ident++;  /* ident overflowed */
        set_mon_data(mtmp, ptr, 0);
-       if (mtmp->data->msound == MS_LEADER &&
-               quest_info(MS_LEADER) == mndx)
+       if (ptr->msound == MS_LEADER && quest_info(MS_LEADER) == mndx)
            quest_status.leader_m_id = mtmp->m_id;
        mtmp->mnum = mndx;
 
@@ -978,8 +977,9 @@ register int        mmflags;
 
        if (In_sokoban(&u.uz) && !mindless(ptr))  /* know about traps here */
            mtmp->mtrapseen = (1L << (PIT - 1)) | (1L << (HOLE - 1));
-       if (ptr->msound == MS_LEADER)           /* leader knows about portal */
-           mtmp->mtrapseen |= (1L << (MAGIC_PORTAL-1));
+       /* quest leader and nemesis both know about all trap types */
+       if (ptr->msound == MS_LEADER || ptr->msound == MS_NEMESIS)
+           mtmp->mtrapseen = ~0;
 
        place_monster(mtmp, x, y);
        mtmp->mcansee = mtmp->mcanmove = TRUE;
index b0548ee8af84a119b1917fd8fbd1fa773f192908..6dac8f1e250abf57fc063fbc877855a905acf4e3 100644 (file)
@@ -1,4 +1,4 @@
-/*     SCCS Id: @(#)sounds.c   3.5     2005/08/29      */
+/*     SCCS Id: @(#)sounds.c   3.5     2007/03/23      */
 /*     Copyright (c) 1989 Janet Walz, Mike Threepoint */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -467,21 +467,23 @@ STATIC_OVL int
 domonnoise(mtmp)
 register struct monst *mtmp;
 {
+    char verbuf[BUFSZ];
     register const char *pline_msg = 0,        /* Monnam(mtmp) will be prepended */
                        *verbl_msg = 0, /* verbalize() */
                        *verbl_msg_mcan = 0;    /* verbalize() if cancelled */
     struct permonst *ptr = mtmp->data;
-    char verbuf[BUFSZ];
+    int msound = ptr->msound;
 
     /* presumably nearness and sleep checks have already been made */
     if (Deaf) return(0);
     if (is_silent(ptr)) return(0);
 
-    /* Make sure its your role's quest quardian; adjust if not */
-    if (ptr->msound == MS_GUARDIAN && ptr != &mons[urole.guardnum]) {
-       int mndx = monsndx(ptr);
-       ptr = &mons[genus(mndx,1)];
-    }
+    /* leader might be poly'd; if he can still speak, give leader speach */
+    if (mtmp->m_id == quest_status.leader_m_id && msound > MS_ANIMAL)
+       msound = MS_LEADER;
+    /* make sure its your role's quest quardian; adjust if not */
+    else if (msound == MS_GUARDIAN && ptr != &mons[urole.guardnum])
+       msound = mons[genus(monsndx(ptr), 1)].msound;
 
     /* be sure to do this before talking; the monster might teleport away, in
      * which case we want to check its pre-teleport position
@@ -489,7 +491,7 @@ register struct monst *mtmp;
     if (!canspotmon(mtmp))
        map_invisible(mtmp->mx, mtmp->my);
 
-    switch (ptr->msound) {
+    switch (msound) {
        case MS_ORACLE:
            return doconsult(mtmp);
        case MS_PRIEST: