E char *FDECL(doname, (struct obj *));
E boolean FDECL(not_fully_identified, (struct obj *));
E char *FDECL(corpse_xname, (struct obj *,BOOLEAN_P));
+E char *FDECL(cxname, (struct obj *));
E const char *FDECL(singular, (struct obj *,char *(*)(OBJ_P)));
E char *FDECL(an, (const char *));
E char *FDECL(An, (const char *));
const char *mon_hand;
boolean gotit = proficient && (!Fumbling || !rn2(10));
- Strcpy(onambuf, xname(otmp));
+ Strcpy(onambuf, cxname(otmp));
if (gotit) {
mon_hand = mbodypart(mtmp, HAND);
if (bimanual(otmp)) mon_hand = makeplural(mon_hand);
Strcpy(buf, mon_nam(mdef));
pline("%s %s %s %s at %s.", Monnam(magr),
(objects[otemp->otyp].oc_dir & PIERCE) ? "thrusts" : "swings",
- mhis(magr), xname(otemp), buf);
+ mhis(magr), singular(otemp, xname), buf);
}
/*
return;
pline("%s %s %s %s.", Monnam(mtmp),
(objects[otemp->otyp].oc_dir & PIERCE) ? "thrusts" : "swings",
- mhis(mtmp), xname(otemp));
+ mhis(mtmp), singular(otemp, xname));
}
/* return how a poison attack was delivered */
return makeplural(nambuf);
}
+/* xname, unless it's a corpse, then corpse_xname(obj, FALSE) */
+char *
+cxname(obj)
+struct obj *obj;
+{
+ if (obj->otyp == CORPSE)
+ return corpse_xname(obj, FALSE);
+ return xname(obj);
+}
+
/*
* Used if only one of a collection of objects is named (e.g. in eat.c).
*/
char *s = shk_your(outbuf, obj); /* assert( s == outbuf ); */
int space_left = BUFSZ - strlen(s) - sizeof " ";
- /* "your corpse" is silly, use corpse_xname for this case */
- return strncat(strcat(s, " "),
- (obj->otyp == CORPSE) ?
- corpse_xname(obj, FALSE) : xname(obj), space_left);
+ return strncat(strcat(s, " "), cxname(obj), space_left);
}
/* capitalized variant of yname() */
offer, plur(offer),
(!ltmp && cltmp && only_partially_your_contents) ?
" your items in" : (!ltmp && cltmp) ? " the contents of" : "",
- obj->unpaid ? "the" : "your", xname(obj),
+ obj->unpaid ? "the" : "your", cxname(obj),
(obj->quan == 1L &&
!(!ltmp && cltmp && only_partially_your_contents)) ?
"it" : "them");
pline("%s tries to %s your %s but gives up.",
Monnam(mtmp), how[rn2(SIZE(how))],
(otmp->owornmask & W_ARMOR) ? equipname(otmp) :
- (otmp->otyp == CORPSE) ? corpse_xname(otmp, FALSE) :
- xname(otmp));
+ cxname(otmp));
/* the fewer items you have, the less likely the thief
is going to stick around to try again (0) instead of
running away (1) */