]> granicus.if.org Git - nethack/commitdiff
killer messages
authorcohrs <cohrs>
Thu, 25 Sep 2003 16:56:56 +0000 (16:56 +0000)
committercohrs <cohrs>
Thu, 25 Sep 2003 16:56:56 +0000 (16:56 +0000)
Incorporate various killer message grammar fixes suggested by <Someone>.
Mostly these deal with using the proper killer_format and prefix ("the" or
no "the") for unique and type_is_pname monsters, or death to to eating
their corpses.
One case is handled by a general fix to name_to_mon to allow it to deal
with "Croesus' corpse".
The pre-3.4.1 topten behavior for "starved to death" messages is also restored.

src/eat.c
src/mhitu.c
src/mon.c
src/mondata.c
src/timeout.c
src/topten.c

index 448f72a16e8256d5a66e4577a4d0f8d46cf76bd1..aeb7939150652807512e7314ce7c771f1f435b30 100644 (file)
--- a/src/eat.c
+++ b/src/eat.c
@@ -221,7 +221,8 @@ choke(food) /* To a full belly all food is bad. (It.) */
                                killer = food_xname(food, FALSE);
                                if (food->otyp == CORPSE &&
                                    (mons[food->corpsenm].geno & G_UNIQ)) {
-                                   killer = the(killer);
+                                   if (!type_is_pname(&mons[food->corpsenm]))
+                                       killer = the(killer);
                                    killer_format = KILLED_BY;
                                }
                        }
index d50eed448a4c59cbb74a5fe0bef57a10fe5969c9..20ea756f99288fbb387edd5edc821dd6cd9cca14 100644 (file)
@@ -1151,8 +1151,17 @@ dopois:
                                    && !(poly_when_stoned(youmonst.data) &&
                                        polymon(PM_STONE_GOLEM))) {
                                Stoned = 5;
-                               killer_format = KILLED_BY_AN;
                                delayed_killer = mtmp->data->mname;
+                               if (mtmp->data->geno & G_UNIQ) {
+                                   if (!type_is_pname(mtmp->data)) {
+                                       static char buf[BUFSZ];
+
+                                       /* "the" buffer may be reallocated */
+                                       Strcpy(buf, the(delayed_killer));
+                                       delayed_killer = buf;
+                                   }
+                                   killer_format = KILLED_BY;
+                               } else killer_format = KILLED_BY_AN;
                                return(1);
                                /* You("turn to stone..."); */
                                /* done_in_by(mtmp); */
index 8e66b4d4e39dd857a4ea2fb7f9ea71f85170d966..9283fb56e91dfa49dc2b0ca8aec4658fdbd5cb2b 100644 (file)
--- a/src/mon.c
+++ b/src/mon.c
@@ -1995,11 +1995,12 @@ int  typ, fatal;
                return;
        }
        /* suppress killer prefix if it already has one */
-       if (!strncmpi(pname, "the ", 4) ||
-               !strncmpi(pname, "an ", 3) ||
-               !strncmpi(pname, "a ", 2) ||
-           /* ... or if it seems to be a proper name */
-               isupper(*pname)) {
+       if ((i = name_to_mon(pname)) >= LOW_PM && mons[i].geno & G_UNIQ) {
+           kprefix = KILLED_BY;
+           if (!type_is_pname(&mons[i])) pname = the(pname);
+       } else if (!strncmpi(pname, "the ", 4) ||
+           !strncmpi(pname, "an ", 3) ||
+           !strncmpi(pname, "a ", 2)) {
            /*[ does this need a plural check too? ]*/
            kprefix = KILLED_BY;
        }
index 5de5331b1d1c467c27c2156844d1e9e20bd3ef1d..88cfd4c4d9c8ec7d66a5c2513a1f96661eada3e4 100644 (file)
@@ -468,6 +468,10 @@ const char *in_str;
                        (str[m_i_len] == ' ' ||
                         !strcmpi(&str[m_i_len], "s") ||
                         !strncmpi(&str[m_i_len], "s ", 2) ||
+                        !strcmpi(&str[m_i_len], "'") ||
+                        !strncmpi(&str[m_i_len], "' ", 2) ||
+                        !strcmpi(&str[m_i_len], "'s") ||
+                        !strncmpi(&str[m_i_len], "'s ", 3) ||
                         !strcmpi(&str[m_i_len], "es") ||
                         !strncmpi(&str[m_i_len], "es ", 3))) {
                    mntmp = i;
index 0730c42a3b2db33a2576f41d87bbc4fe12ab707e..bdd6211bad57305c93179d384c28b41e2fbdc374 100644 (file)
@@ -246,16 +246,11 @@ nh_timeout()
                        if ((m_idx = name_to_mon(killer)) >= LOW_PM) {
                            if (type_is_pname(&mons[m_idx])) {
                                killer_format = KILLED_BY;
-                           }
-#if 0                          /* at present, there aren't any monster
-                                  poisoners with titles rather than names */
-                           else if (mons[m_idx].geno & G_UNIQ) {
-                               char buf[BUFSZ];
-                               Sprintf(buf, "the %s", killer);
-                               Strcpy(u.usick_cause, buf);
+                           } else if (mons[m_idx].geno & G_UNIQ) {
+                               killer = the(killer);
+                               Strcpy(u.usick_cause, killer);
                                killer_format = KILLED_BY;
                            }
-#endif
                        }
                        u.usick_type = 0;
                        done(POISONING);
index 2cbdcb6146669f39d2a10adb21e9d634b792059c..19a04884a4daa1d2b926bbb80493491b741ffd2d 100644 (file)
@@ -595,7 +595,7 @@ boolean so;
            if (!strncmp(t1->death, "quit", 4)) {
                Strcat(linebuf, "quit");
                second_line = FALSE;
-           } else if (!strncmp(t1->death, "starv", 5)) {
+           } else if (!strncmp(t1->death, "died of st", 10)) {
                Strcat(linebuf, "starved to death");
                second_line = FALSE;
            } else if (!strncmp(t1->death, "choked", 6)) {