]> granicus.if.org Git - nethack/commitdiff
Magicbane grammar
authornethack.rankin <nethack.rankin>
Sun, 17 Mar 2013 00:17:18 +0000 (00:17 +0000)
committernethack.rankin <nethack.rankin>
Sun, 17 Mar 2013 00:17:18 +0000 (00:17 +0000)
     After newsgroup discussion of C343-162, I noticed that it had fixed
the verb usage in the message for confused and/or stunned, but not in the
one for resisting.  (If a monster name ends in 's', or it has been named
"you", 3.4.3 used the wrong verb because vtense() was fooled about plural
or second person.)  No new fixes entry needed....

src/artifact.c

index 035f04a917597d28ee5e84094aeda4f22856ef83..9d6e7f327efa89f784e1434d9126a0b15b9a7788 100644 (file)
@@ -888,11 +888,10 @@ boolean vis;                      /* whether the action can be seen */
 char *hittee;                  /* target's name: "you" or mon_nam(mdef) */
 {
     struct permonst *old_uasmon;
-    const char *verb;
+    const char *verb, *fakename;
     boolean youattack = (magr == &youmonst),
            youdefend = (mdef == &youmonst),
            resisted = FALSE, do_stun, do_confuse, result;
-    boolean hitteename = (has_mname(mdef) && !strcmpi(hittee, MNAME(mdef)));
     int attack_indx, scare_dieroll = MB_MAX_DIEROLL / 2;
 
     result = FALSE;            /* no message given yet */
@@ -1028,10 +1027,13 @@ char *hittee;                   /* target's name: "you" or mon_nam(mdef) */
            mdef->mconf = 1;
     }
 
+    /* now give message(s) describing side-effects;
+       don't let vtense() be fooled by assigned name ending in 's' */
+    fakename = youdefend ? "you" : "mon";
     if (youattack || youdefend || vis) {
        (void) upstart(hittee); /* capitalize */
        if (resisted) {
-           pline("%s %s!", hittee, vtense(hittee, "resist"));
+           pline("%s %s!", hittee, vtense(fakename, "resist"));
            shieldeff(youdefend ? u.ux : mdef->mx,
                      youdefend ? u.uy : mdef->my);
        }
@@ -1042,8 +1044,7 @@ char *hittee;                     /* target's name: "you" or mon_nam(mdef) */
            if (do_stun) Strcat(buf, "stunned");
            if (do_stun && do_confuse) Strcat(buf, " and ");
            if (do_confuse) Strcat(buf, "confused");
-           pline("%s %s %s%c", hittee,
-                 hitteename ? "is" : vtense(hittee, "are"),
+           pline("%s %s %s%c", hittee, vtense(fakename, "are"),
                  buf, (do_stun && do_confuse) ? '!' : '.');
        }
     }