polymorphed quest leader

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).
This commit is contained in:
nethack.rankin
2007-03-24 04:45:24 +00:00
parent 60c96674e9
commit 63b3e70ba7
3 changed files with 16 additions and 13 deletions
+1
View 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 weapon/alternate-weapon/quiver pointer that could cause panic or crash
wielded/worn figurine which auto-transformed had same stale pointer bug 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 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 Platform- and/or Interface-Specific Fixes
+5 -5
View 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. */ /* 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. */
@@ -964,8 +964,7 @@ register int mmflags;
mtmp->m_id = context.ident++; mtmp->m_id = context.ident++;
if (!mtmp->m_id) mtmp->m_id = context.ident++; /* ident overflowed */ if (!mtmp->m_id) mtmp->m_id = context.ident++; /* ident overflowed */
set_mon_data(mtmp, ptr, 0); set_mon_data(mtmp, ptr, 0);
if (mtmp->data->msound == MS_LEADER && if (ptr->msound == MS_LEADER && quest_info(MS_LEADER) == mndx)
quest_info(MS_LEADER) == mndx)
quest_status.leader_m_id = mtmp->m_id; quest_status.leader_m_id = mtmp->m_id;
mtmp->mnum = mndx; mtmp->mnum = mndx;
@@ -978,8 +977,9 @@ register int mmflags;
if (In_sokoban(&u.uz) && !mindless(ptr)) /* know about traps here */ if (In_sokoban(&u.uz) && !mindless(ptr)) /* know about traps here */
mtmp->mtrapseen = (1L << (PIT - 1)) | (1L << (HOLE - 1)); mtmp->mtrapseen = (1L << (PIT - 1)) | (1L << (HOLE - 1));
if (ptr->msound == MS_LEADER) /* leader knows about portal */ /* quest leader and nemesis both know about all trap types */
mtmp->mtrapseen |= (1L << (MAGIC_PORTAL-1)); if (ptr->msound == MS_LEADER || ptr->msound == MS_NEMESIS)
mtmp->mtrapseen = ~0;
place_monster(mtmp, x, y); place_monster(mtmp, x, y);
mtmp->mcansee = mtmp->mcanmove = TRUE; mtmp->mcansee = mtmp->mcanmove = TRUE;
+10 -8
View 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 */ /* Copyright (c) 1989 Janet Walz, Mike Threepoint */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -467,21 +467,23 @@ STATIC_OVL int
domonnoise(mtmp) domonnoise(mtmp)
register struct monst *mtmp; register struct monst *mtmp;
{ {
char verbuf[BUFSZ];
register const char *pline_msg = 0, /* Monnam(mtmp) will be prepended */ register const char *pline_msg = 0, /* Monnam(mtmp) will be prepended */
*verbl_msg = 0, /* verbalize() */ *verbl_msg = 0, /* verbalize() */
*verbl_msg_mcan = 0; /* verbalize() if cancelled */ *verbl_msg_mcan = 0; /* verbalize() if cancelled */
struct permonst *ptr = mtmp->data; struct permonst *ptr = mtmp->data;
char verbuf[BUFSZ]; int msound = ptr->msound;
/* presumably nearness and sleep checks have already been made */ /* presumably nearness and sleep checks have already been made */
if (Deaf) return(0); if (Deaf) return(0);
if (is_silent(ptr)) return(0); if (is_silent(ptr)) return(0);
/* Make sure its your role's quest quardian; adjust if not */ /* leader might be poly'd; if he can still speak, give leader speach */
if (ptr->msound == MS_GUARDIAN && ptr != &mons[urole.guardnum]) { if (mtmp->m_id == quest_status.leader_m_id && msound > MS_ANIMAL)
int mndx = monsndx(ptr); msound = MS_LEADER;
ptr = &mons[genus(mndx,1)]; /* 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 /* be sure to do this before talking; the monster might teleport away, in
* which case we want to check its pre-teleport position * which case we want to check its pre-teleport position
@@ -489,7 +491,7 @@ register struct monst *mtmp;
if (!canspotmon(mtmp)) if (!canspotmon(mtmp))
map_invisible(mtmp->mx, mtmp->my); map_invisible(mtmp->mx, mtmp->my);
switch (ptr->msound) { switch (msound) {
case MS_ORACLE: case MS_ORACLE:
return doconsult(mtmp); return doconsult(mtmp);
case MS_PRIEST: case MS_PRIEST: