yet more qbuf
This commit is contained in:
@@ -1363,6 +1363,8 @@ E char *FDECL(vtense, (const char *,const char *));
|
|||||||
E char *FDECL(Doname2, (struct obj *));
|
E char *FDECL(Doname2, (struct obj *));
|
||||||
E char *FDECL(yname, (struct obj *));
|
E char *FDECL(yname, (struct obj *));
|
||||||
E char *FDECL(Yname2, (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(makeplural, (const char *));
|
||||||
E char *FDECL(makesingular, (const char *));
|
E char *FDECL(makesingular, (const char *));
|
||||||
E struct obj *FDECL(readobjnam, (char *,struct obj *,BOOLEAN_P));
|
E struct obj *FDECL(readobjnam, (char *,struct obj *,BOOLEAN_P));
|
||||||
|
|||||||
26
src/objnam.c
26
src/objnam.c
@@ -1171,6 +1171,32 @@ struct obj *obj;
|
|||||||
return s;
|
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[] = {
|
static const char *wrp[] = {
|
||||||
"wand", "ring", "potion", "scroll", "gem", "amulet",
|
"wand", "ring", "potion", "scroll", "gem", "amulet",
|
||||||
"spellbook", "spell book",
|
"spellbook", "spell book",
|
||||||
|
|||||||
16
src/pickup.c
16
src/pickup.c
@@ -1,4 +1,4 @@
|
|||||||
/* 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. */
|
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
|
|
||||||
@@ -538,7 +538,9 @@ menu_pickup:
|
|||||||
|
|
||||||
if (!all_of_a_type) {
|
if (!all_of_a_type) {
|
||||||
char qbuf[BUFSZ];
|
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)) {
|
switch ((obj->quan < 2L) ? ynaq(qbuf) : ynNaq(qbuf)) {
|
||||||
case 'q': goto end_query; /* out 2 levels */
|
case 'q': goto end_query; /* out 2 levels */
|
||||||
case 'n': continue;
|
case 'n': continue;
|
||||||
@@ -1476,7 +1478,10 @@ lootcont:
|
|||||||
nobj = cobj->nexthere;
|
nobj = cobj->nexthere;
|
||||||
|
|
||||||
if (Is_container(cobj)) {
|
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);
|
c = ynq(qbuf);
|
||||||
if (c == 'q') return (timepassed);
|
if (c == 'q') return (timepassed);
|
||||||
if (c == 'n') continue;
|
if (c == 'n') continue;
|
||||||
@@ -2056,8 +2061,9 @@ register int held;
|
|||||||
if (!cnt)
|
if (!cnt)
|
||||||
Sprintf(emptymsg, "%s is empty.", Yname2(obj));
|
Sprintf(emptymsg, "%s is empty.", Yname2(obj));
|
||||||
if (cnt || flags.menu_style == MENU_FULL) {
|
if (cnt || flags.menu_style == MENU_FULL) {
|
||||||
Sprintf(qbuf, "Do you want to take %s out of %s?",
|
Strcpy(qbuf, "Do you want to take something out of ");
|
||||||
something, yname(obj));
|
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_TRADITIONAL) {
|
||||||
if (flags.menu_style == MENU_FULL) {
|
if (flags.menu_style == MENU_FULL) {
|
||||||
int t;
|
int t;
|
||||||
|
|||||||
Reference in New Issue
Block a user