E char *FDECL(Doname2, (struct obj *));
E char *FDECL(yname, (struct obj *));
E char *FDECL(Yname2, (struct obj *));
+E char *FDECL(ysimple_name, (struct obj *));
+E char *FDECL(Ysimple_name2, (struct obj *));
E char *FDECL(makeplural, (const char *));
E char *FDECL(makesingular, (const char *));
E struct obj *FDECL(readobjnam, (char *,struct obj *,BOOLEAN_P));
return s;
}
+/* returns "your simple_typename(obj->otyp)"
+ * or "Foobar's simple_typename(obj->otyp)"
+ * or "the simple_typename(obj-otyp)"
+ */
+char *
+ysimple_name(obj)
+struct obj *obj;
+{
+ char *outbuf = nextobuf();
+ char *s = shk_your(outbuf, obj); /* assert( s == outbuf ); */
+ int space_left = BUFSZ - strlen(s) - sizeof " ";
+
+ return strncat(strcat(s, " "), simple_typename(obj->otyp), space_left);
+}
+
+/* capitalized variant of ysimple_name() */
+char *
+Ysimple_name2(obj)
+struct obj *obj;
+{
+ char *s = ysimple_name(obj);
+
+ *s = highc(*s);
+ return s;
+}
+
static const char *wrp[] = {
"wand", "ring", "potion", "scroll", "gem", "amulet",
"spellbook", "spell book",
-/* SCCS Id: @(#)pickup.c 3.4 2003/04/26 */
+/* SCCS Id: @(#)pickup.c 3.4 2003/05/08 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
if (!all_of_a_type) {
char qbuf[BUFSZ];
- Sprintf(qbuf, "Pick up %s?", doname(obj));
+ Sprintf(qbuf, "Pick up %s?",
+ safe_qbuf(qbuf, sizeof("Pick up ?"), doname(obj),
+ an(simple_typename(obj->otyp)), something));
switch ((obj->quan < 2L) ? ynaq(qbuf) : ynNaq(qbuf)) {
case 'q': goto end_query; /* out 2 levels */
case 'n': continue;
nobj = cobj->nexthere;
if (Is_container(cobj)) {
- Sprintf(qbuf, "There is %s here, loot it?", doname(cobj));
+ Sprintf(qbuf, "There is %s here, loot it?",
+ safe_qbuf(qbuf, sizeof("There is here, loot it?"),
+ doname(cobj), an(simple_typename(cobj->otyp)),
+ "a container"));
c = ynq(qbuf);
if (c == 'q') return (timepassed);
if (c == 'n') continue;
if (!cnt)
Sprintf(emptymsg, "%s is empty.", Yname2(obj));
if (cnt || flags.menu_style == MENU_FULL) {
- Sprintf(qbuf, "Do you want to take %s out of %s?",
- something, yname(obj));
+ Strcpy(qbuf, "Do you want to take something out of ");
+ Sprintf(eos(qbuf), "%s?",
+ safe_qbuf(qbuf, 1, yname(obj), ysimple_name(obj), "it"));
if (flags.menu_style != MENU_TRADITIONAL) {
if (flags.menu_style == MENU_FULL) {
int t;