corpse_xname overhaul (trunk only)

Extend the capabilities of corpse_xname() so that various callers can
be simplified.  It can how handle an article prefix, effectively turning it
into corpse_doname() (not quite; still need doname() to see a count when
quantity is more than one, or to see bless/curse state).  It can also handle
inclusion of adjectives like "partly eaten" or "bite-covered".  For unique
monsters those come out in the form
  the Chromatic Dragon's partly eaten corpse
instead of the old
  partly eaten Chromatic Dragon corpse
[so wishing probably needs to be taught about potentially finding a monster
name before assorted adjectives such as blessed; also, name_to_mon() needs
to learn how to cope with the possessive suffix].

     A sizeable chunk of this patch deals with consolidating some of the
redundant "petrified by a cockatrice corpse" handling.  It may be possible
to consolidate all remaining instances together since they're quite similar,
but I didn't think about that until just now and I want to get this patch
over with.
This commit is contained in:
nethack.rankin
2005-12-30 06:08:20 +00:00
parent bd3a5466dd
commit 40dd607233
13 changed files with 208 additions and 178 deletions

View File

@@ -432,16 +432,20 @@ xchar x, y;
return(1);
}
if(kickobj->otyp == CORPSE && touch_petrifies(&mons[kickobj->corpsenm])
&& !Stone_resistance && !uarmf) {
You("kick the %s with your bare %s.",
corpse_xname(kickobj, TRUE), makeplural(body_part(FOOT)));
if (!(poly_when_stoned(youmonst.data) && polymon(PM_STONE_GOLEM))) {
if (!uarmf && kickobj->otyp == CORPSE &&
touch_petrifies(&mons[kickobj->corpsenm]) &&
!Stone_resistance) {
You("kick %s with your bare %s.",
corpse_xname(kickobj, (const char *)0, CXN_PFX_THE),
makeplural(body_part(FOOT)));
if (poly_when_stoned(youmonst.data) && polymon(PM_STONE_GOLEM)) {
; /* hero has been transformed but kick continues */
} else {
You("turn to stone...");
killer.format = KILLED_BY;
/* KMH -- otmp should be kickobj */
Sprintf(killer.name, "kicking %s without boots",
an(corpse_xname(kickobj, TRUE)));
/* normalize body shape here; foot, not body_part(FOOT) */
Sprintf(killer.name, "kicking %s barefoot",
killer_xname(kickobj));
done(STONING);
}
}