killer messages

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.
This commit is contained in:
cohrs
2003-09-25 16:56:56 +00:00
parent db011864c0
commit 4375fc7846
6 changed files with 26 additions and 16 deletions

View File

@@ -221,7 +221,8 @@ choke(food) /* To a full belly all food is bad. (It.) */
killer = food_xname(food, FALSE); killer = food_xname(food, FALSE);
if (food->otyp == CORPSE && if (food->otyp == CORPSE &&
(mons[food->corpsenm].geno & G_UNIQ)) { (mons[food->corpsenm].geno & G_UNIQ)) {
killer = the(killer); if (!type_is_pname(&mons[food->corpsenm]))
killer = the(killer);
killer_format = KILLED_BY; killer_format = KILLED_BY;
} }
} }

View File

@@ -1151,8 +1151,17 @@ dopois:
&& !(poly_when_stoned(youmonst.data) && && !(poly_when_stoned(youmonst.data) &&
polymon(PM_STONE_GOLEM))) { polymon(PM_STONE_GOLEM))) {
Stoned = 5; Stoned = 5;
killer_format = KILLED_BY_AN;
delayed_killer = mtmp->data->mname; 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); return(1);
/* You("turn to stone..."); */ /* You("turn to stone..."); */
/* done_in_by(mtmp); */ /* done_in_by(mtmp); */

View File

@@ -1995,11 +1995,12 @@ int typ, fatal;
return; return;
} }
/* suppress killer prefix if it already has one */ /* suppress killer prefix if it already has one */
if (!strncmpi(pname, "the ", 4) || if ((i = name_to_mon(pname)) >= LOW_PM && mons[i].geno & G_UNIQ) {
!strncmpi(pname, "an ", 3) || kprefix = KILLED_BY;
!strncmpi(pname, "a ", 2) || if (!type_is_pname(&mons[i])) pname = the(pname);
/* ... or if it seems to be a proper name */ } else if (!strncmpi(pname, "the ", 4) ||
isupper(*pname)) { !strncmpi(pname, "an ", 3) ||
!strncmpi(pname, "a ", 2)) {
/*[ does this need a plural check too? ]*/ /*[ does this need a plural check too? ]*/
kprefix = KILLED_BY; kprefix = KILLED_BY;
} }

View File

@@ -468,6 +468,10 @@ const char *in_str;
(str[m_i_len] == ' ' || (str[m_i_len] == ' ' ||
!strcmpi(&str[m_i_len], "s") || !strcmpi(&str[m_i_len], "s") ||
!strncmpi(&str[m_i_len], "s ", 2) || !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") || !strcmpi(&str[m_i_len], "es") ||
!strncmpi(&str[m_i_len], "es ", 3))) { !strncmpi(&str[m_i_len], "es ", 3))) {
mntmp = i; mntmp = i;

View File

@@ -246,16 +246,11 @@ nh_timeout()
if ((m_idx = name_to_mon(killer)) >= LOW_PM) { if ((m_idx = name_to_mon(killer)) >= LOW_PM) {
if (type_is_pname(&mons[m_idx])) { if (type_is_pname(&mons[m_idx])) {
killer_format = KILLED_BY; killer_format = KILLED_BY;
} } else if (mons[m_idx].geno & G_UNIQ) {
#if 0 /* at present, there aren't any monster killer = the(killer);
poisoners with titles rather than names */ Strcpy(u.usick_cause, killer);
else if (mons[m_idx].geno & G_UNIQ) {
char buf[BUFSZ];
Sprintf(buf, "the %s", killer);
Strcpy(u.usick_cause, buf);
killer_format = KILLED_BY; killer_format = KILLED_BY;
} }
#endif
} }
u.usick_type = 0; u.usick_type = 0;
done(POISONING); done(POISONING);

View File

@@ -595,7 +595,7 @@ boolean so;
if (!strncmp(t1->death, "quit", 4)) { if (!strncmp(t1->death, "quit", 4)) {
Strcat(linebuf, "quit"); Strcat(linebuf, "quit");
second_line = FALSE; second_line = FALSE;
} else if (!strncmp(t1->death, "starv", 5)) { } else if (!strncmp(t1->death, "died of st", 10)) {
Strcat(linebuf, "starved to death"); Strcat(linebuf, "starved to death");
second_line = FALSE; second_line = FALSE;
} else if (!strncmp(t1->death, "choked", 6)) { } else if (!strncmp(t1->death, "choked", 6)) {