]> granicus.if.org Git - nethack/commitdiff
renaming shopkeepers and priests
authornethack.rankin <nethack.rankin>
Tue, 23 May 2006 04:09:23 +0000 (04:09 +0000)
committernethack.rankin <nethack.rankin>
Tue, 23 May 2006 04:09:23 +0000 (04:09 +0000)
     From a bug report, the 'C' command wasn't reporting that
"<shopkeeper> doesn't like being called names" even though the user's
supplied name was ineffective.  Same thing for temple priests and other
minion monsters; the name was accepted but didn't do anything.  Make such
monsters reject new names.

doc/fixes34.4
src/do_name.c

index 1fa88702c6f0ea9740571e24daf9a8d4f7f52b6d..445ce4a256a94a44476c843e5bcff448b10026ee 100644 (file)
@@ -223,6 +223,7 @@ when jumping over an already seen trap, use an() to get appropriate grammar
 fix bad grammar when putting on not-yet-seen Eyes of the Overworld while blind
 don't "walk quietly" while levitating
 fix message handling when multiple shopkeepers are present at end of game
+'C' command can't name shopkeepers or temple priests and other minions
 
 
 Platform- and/or Interface-Specific Fixes
index fd1f2d98b580a28c372a9b316c82b1650a8eab67..c09fda203dafbbcb7656552d4400eb7eb2be2722 100644 (file)
@@ -1,4 +1,4 @@
-/*     SCCS Id: @(#)do_name.c  3.5     2006/04/14      */
+/*     SCCS Id: @(#)do_name.c  3.5     2006/05/22      */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -359,8 +359,17 @@ do_mname()
        /* strip leading and trailing spaces; unnames monster if all spaces */
        (void)mungspaces(buf);
 
+       /* unique monsters have their own specific names or titles;
+          shopkeepers, temple priests and other minions use alternate
+          name formatting routines which ignore any user-supplied name */
        if (mtmp->data->geno & G_UNIQ)
            pline("%s doesn't like being called names!", upstart(monnambuf));
+       else if (mtmp->isshk &&
+                       !(Deaf || mtmp->msleeping ||
+                         !mtmp->mcanmove || mtmp->data->msound <= MS_ANIMAL))
+           verbalize("I'm %s, not %s.", monnambuf, buf);
+       else if (mtmp->ispriest || mtmp->isminion || mtmp->isshk)
+           pline("%s will not accept the name %s.", upstart(monnambuf), buf);
        else
            (void) christen_monst(mtmp, buf);
        return(0);