wiz_identify change (trunk only)
This patch alters wiz_identify so that it displays an inventory menu with all items shown identified without actually identifying them. You can just press ^I (or whatever the wiz_identify command is) a second time, while the menu is displayed to actually identify them (tested with TTY menus only).
This commit is contained in:
@@ -152,32 +152,39 @@ struct sysflag {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
struct instance_flags {
|
struct instance_flags {
|
||||||
boolean cbreak; /* in cbreak mode, rogue format */
|
/* stuff that really isn't option or platform related. They are
|
||||||
boolean DECgraphics; /* use DEC VT-xxx extended character set */
|
* set and cleared during the game to control the internal
|
||||||
boolean echo; /* 1 to echo characters */
|
* behaviour of various NetHack functions and probably warrant
|
||||||
boolean IBMgraphics; /* use IBM extended character set */
|
* a structure of their own elsewhere some day.
|
||||||
unsigned msg_history; /* hint: # of top lines to save */
|
*/
|
||||||
boolean num_pad; /* use numbers for movement commands */
|
int in_lava_effects; /* hack for Boots_off() */
|
||||||
boolean news; /* print news */
|
int purge_monsters; /* # of dead monsters still on fmon list */
|
||||||
|
int override_ID; /* true to force full identification of objects */
|
||||||
|
coord travelcc; /* coordinates for travel_cache */
|
||||||
boolean window_inited; /* true if init_nhwindows() completed */
|
boolean window_inited; /* true if init_nhwindows() completed */
|
||||||
boolean vision_inited; /* true if vision is ready */
|
boolean vision_inited; /* true if vision is ready */
|
||||||
|
#ifdef WIZARD
|
||||||
|
boolean sanity_check; /* run sanity checks */
|
||||||
|
boolean mon_polycontrol; /* debug: control monster polymorphs */
|
||||||
|
#endif
|
||||||
|
/* stuff that is related to options and/or user or platform preferences */
|
||||||
|
unsigned msg_history; /* hint: # of top lines to save */
|
||||||
|
int menu_headings; /* ATR for menu headings */
|
||||||
|
int *opt_booldup; /* for duplication of boolean opts in config file */
|
||||||
|
int *opt_compdup; /* for duplication of compound opts in config file */
|
||||||
|
boolean cbreak; /* in cbreak mode, rogue format */
|
||||||
|
boolean num_pad; /* use numbers for movement commands */
|
||||||
|
boolean news; /* print news */
|
||||||
boolean menu_tab_sep; /* Use tabs to separate option menu fields */
|
boolean menu_tab_sep; /* Use tabs to separate option menu fields */
|
||||||
boolean menu_requested; /* Flag for overloaded use of 'm' prefix
|
boolean menu_requested; /* Flag for overloaded use of 'm' prefix
|
||||||
* on some non-move commands */
|
* on some non-move commands */
|
||||||
boolean zerocomp; /* write zero-compressed save files */
|
boolean zerocomp; /* write zero-compressed save files */
|
||||||
boolean rlecomp; /* run-length comp of levels when writing savefile */
|
boolean rlecomp; /* run-length comp of levels when writing savefile */
|
||||||
uchar num_pad_mode;
|
uchar num_pad_mode;
|
||||||
int in_lava_effects; /* hack for Boots_off() */
|
boolean DECgraphics; /* use DEC VT-xxx extended character set */
|
||||||
int menu_headings; /* ATR for menu headings */
|
boolean echo; /* 1 to echo characters */
|
||||||
int purge_monsters; /* # of dead monsters still on fmon list */
|
boolean IBMgraphics; /* use IBM extended character set */
|
||||||
int *opt_booldup; /* for duplication of boolean opts in config file */
|
|
||||||
int *opt_compdup; /* for duplication of compound opts in config file */
|
|
||||||
uchar bouldersym; /* symbol for boulder display */
|
uchar bouldersym; /* symbol for boulder display */
|
||||||
coord travelcc; /* coordinates for travel_cache */
|
|
||||||
#ifdef WIZARD
|
|
||||||
boolean sanity_check; /* run sanity checks */
|
|
||||||
boolean mon_polycontrol; /* debug: control monster polymorphs */
|
|
||||||
#endif
|
|
||||||
#ifdef TTY_GRAPHICS
|
#ifdef TTY_GRAPHICS
|
||||||
char prevmsg_window; /* type of old message window to use */
|
char prevmsg_window; /* type of old message window to use */
|
||||||
boolean extmenu; /* extended commands use menu interface */
|
boolean extmenu; /* extended commands use menu interface */
|
||||||
|
|||||||
22
src/cmd.c
22
src/cmd.c
@@ -150,6 +150,7 @@ STATIC_PTR int NDECL(doattributes);
|
|||||||
STATIC_PTR int NDECL(doconduct); /**/
|
STATIC_PTR int NDECL(doconduct); /**/
|
||||||
STATIC_PTR boolean NDECL(minimal_enlightenment);
|
STATIC_PTR boolean NDECL(minimal_enlightenment);
|
||||||
|
|
||||||
|
STATIC_DCL char FDECL(cmd_from_func, (int NDECL((*))));
|
||||||
STATIC_DCL void FDECL(enlght_line, (const char *,const char *,const char *,char *));
|
STATIC_DCL void FDECL(enlght_line, (const char *,const char *,const char *,char *));
|
||||||
STATIC_DCL char *FDECL(enlght_combatinc, (const char *,int,int,char *));
|
STATIC_DCL char *FDECL(enlght_combatinc, (const char *,int,int,char *));
|
||||||
#if defined(UNIX) || defined(SAFERHANGUP)
|
#if defined(UNIX) || defined(SAFERHANGUP)
|
||||||
@@ -516,9 +517,13 @@ wiz_wish() /* Unlimited wishes for debug mode by Paul Polderman */
|
|||||||
STATIC_PTR int
|
STATIC_PTR int
|
||||||
wiz_identify()
|
wiz_identify()
|
||||||
{
|
{
|
||||||
if (wizard) identify_pack(0);
|
if (wizard) {
|
||||||
else pline("Unavailable command '^I'.");
|
iflags.override_ID = (int)cmd_from_func(wiz_identify);
|
||||||
return 0;
|
if (display_inventory((char *)0, TRUE) == -1)
|
||||||
|
identify_pack(0);
|
||||||
|
iflags.override_ID = 0;
|
||||||
|
} else pline("Unavailable command '^I'.");
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ^F command - reveal the level map and any traps on it */
|
/* ^F command - reveal the level map and any traps on it */
|
||||||
@@ -1749,6 +1754,17 @@ boolean initial;
|
|||||||
Cmd.move_SW = Cmd.dirchars[7];
|
Cmd.move_SW = Cmd.dirchars[7];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
STATIC_OVL char
|
||||||
|
cmd_from_func(fn)
|
||||||
|
int NDECL((*fn));
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
for (i = 0; i < SIZE(cmdlist); ++i)
|
||||||
|
if (cmdlist[i].f_funct == fn)
|
||||||
|
return cmdlist[i].f_char;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* decide whether a character (user input keystroke) requests screen repaint */
|
/* decide whether a character (user input keystroke) requests screen repaint */
|
||||||
boolean
|
boolean
|
||||||
redraw_cmd(c)
|
redraw_cmd(c)
|
||||||
|
|||||||
@@ -1176,7 +1176,7 @@ char *buf;
|
|||||||
else if (mnum == NON_PM)
|
else if (mnum == NON_PM)
|
||||||
Strcpy(buf, "empty tin");
|
Strcpy(buf, "empty tin");
|
||||||
else {
|
else {
|
||||||
if (obj->cknown && obj->spe < 0) {
|
if ((obj->cknown || iflags.override_ID) && obj->spe < 0) {
|
||||||
int r = tin_variety(obj, TRUE);
|
int r = tin_variety(obj, TRUE);
|
||||||
if (r == ROTTEN_TIN || r == HOMEMADE_TIN) {
|
if (r == ROTTEN_TIN || r == HOMEMADE_TIN) {
|
||||||
/* put these before the word tin */
|
/* put these before the word tin */
|
||||||
|
|||||||
14
src/invent.c
14
src/invent.c
@@ -1732,7 +1732,7 @@ long* out_cnt;
|
|||||||
/* oxymoron? temporarily assign permanent inventory letters */
|
/* oxymoron? temporarily assign permanent inventory letters */
|
||||||
if (!flags.invlet_constant) reassign();
|
if (!flags.invlet_constant) reassign();
|
||||||
|
|
||||||
if (lets && strlen(lets) == 1) {
|
if (lets && strlen(lets) == 1 && !iflags.override_ID) {
|
||||||
/* when only one item of interest, use pline instead of menus;
|
/* when only one item of interest, use pline instead of menus;
|
||||||
we actually use a fake message-line menu in order to allow
|
we actually use a fake message-line menu in order to allow
|
||||||
the user to perform selection at the --More-- prompt for tty */
|
the user to perform selection at the --More-- prompt for tty */
|
||||||
@@ -1750,6 +1750,18 @@ long* out_cnt;
|
|||||||
}
|
}
|
||||||
|
|
||||||
start_menu(win);
|
start_menu(win);
|
||||||
|
#ifdef WIZARD
|
||||||
|
if (wizard && iflags.override_ID) {
|
||||||
|
char prompt[BUFSZ];
|
||||||
|
any.a_char = -1;
|
||||||
|
/* wiz_identify stuffed the wiz_identify cmd character
|
||||||
|
into iflags.override_ID */
|
||||||
|
Sprintf(prompt, "Debug Identify (%s to permanently identify)",
|
||||||
|
visctrl(iflags.override_ID));
|
||||||
|
add_menu(win, NO_GLYPH, &any,' ', iflags.override_ID, ATR_NONE,
|
||||||
|
prompt, MENU_UNSELECTED);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
nextclass:
|
nextclass:
|
||||||
classcount = 0;
|
classcount = 0;
|
||||||
any.a_void = 0; /* set all bits to zero */
|
any.a_void = 0; /* set all bits to zero */
|
||||||
|
|||||||
93
src/objnam.c
93
src/objnam.c
@@ -167,12 +167,14 @@ boolean
|
|||||||
obj_is_pname(obj)
|
obj_is_pname(obj)
|
||||||
register struct obj *obj;
|
register struct obj *obj;
|
||||||
{
|
{
|
||||||
return((boolean)(obj->dknown && obj->known && obj->onamelth &&
|
return((boolean)(
|
||||||
/* Since there aren't any objects which are both
|
((obj->dknown && obj->known) || iflags.override_ID) && obj->onamelth &&
|
||||||
artifacts and unique, the last check is redundant. */
|
/* Since there aren't any objects which are both
|
||||||
obj->oartifact && !objects[obj->otyp].oc_unique));
|
artifacts and unique, the last check is redundant. */
|
||||||
|
obj->oartifact && !objects[obj->otyp].oc_unique));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Give the name of an object seen at a distance. Unlike xname/doname,
|
/* Give the name of an object seen at a distance. Unlike xname/doname,
|
||||||
* we don't want to set dknown if it's not set already. The kludge used is
|
* we don't want to set dknown if it's not set already. The kludge used is
|
||||||
* to temporarily set Blind so that xname() skips the dknown setting. This
|
* to temporarily set Blind so that xname() skips the dknown setting. This
|
||||||
@@ -224,6 +226,7 @@ register struct obj *obj;
|
|||||||
const char *dn = OBJ_DESCR(*ocl);
|
const char *dn = OBJ_DESCR(*ocl);
|
||||||
const char *un = ocl->oc_uname;
|
const char *un = ocl->oc_uname;
|
||||||
boolean pluralize = (obj->quan != 1L);
|
boolean pluralize = (obj->quan != 1L);
|
||||||
|
boolean known, dknown, bknown;
|
||||||
|
|
||||||
buf = nextobuf() + PREFIX; /* leave room for "17 -3 " */
|
buf = nextobuf() + PREFIX; /* leave room for "17 -3 " */
|
||||||
if (Role_if(PM_SAMURAI) && Japanese_item_name(typ))
|
if (Role_if(PM_SAMURAI) && Japanese_item_name(typ))
|
||||||
@@ -239,16 +242,26 @@ register struct obj *obj;
|
|||||||
if (!nn && ocl->oc_uses_known && ocl->oc_unique) obj->known = 0;
|
if (!nn && ocl->oc_uses_known && ocl->oc_unique) obj->known = 0;
|
||||||
if (!Blind) obj->dknown = TRUE;
|
if (!Blind) obj->dknown = TRUE;
|
||||||
if (Role_if(PM_PRIEST)) obj->bknown = TRUE;
|
if (Role_if(PM_PRIEST)) obj->bknown = TRUE;
|
||||||
|
|
||||||
|
if (iflags.override_ID) {
|
||||||
|
known = dknown = bknown = TRUE;
|
||||||
|
nn = 1;
|
||||||
|
} else {
|
||||||
|
known = obj->known;
|
||||||
|
dknown = obj->dknown;
|
||||||
|
bknown = obj->bknown;
|
||||||
|
}
|
||||||
|
|
||||||
if (obj_is_pname(obj))
|
if (obj_is_pname(obj))
|
||||||
goto nameit;
|
goto nameit;
|
||||||
switch (obj->oclass) {
|
switch (obj->oclass) {
|
||||||
case AMULET_CLASS:
|
case AMULET_CLASS:
|
||||||
if (!obj->dknown)
|
if (!dknown)
|
||||||
Strcpy(buf, "amulet");
|
Strcpy(buf, "amulet");
|
||||||
else if (typ == AMULET_OF_YENDOR ||
|
else if (typ == AMULET_OF_YENDOR ||
|
||||||
typ == FAKE_AMULET_OF_YENDOR)
|
typ == FAKE_AMULET_OF_YENDOR)
|
||||||
/* each must be identified individually */
|
/* each must be identified individually */
|
||||||
Strcpy(buf, obj->known ? actualn : dn);
|
Strcpy(buf, known ? actualn : dn);
|
||||||
else if (nn)
|
else if (nn)
|
||||||
Strcpy(buf, actualn);
|
Strcpy(buf, actualn);
|
||||||
else if (un)
|
else if (un)
|
||||||
@@ -264,7 +277,7 @@ register struct obj *obj;
|
|||||||
if (typ == LENSES)
|
if (typ == LENSES)
|
||||||
Strcpy(buf, "pair of ");
|
Strcpy(buf, "pair of ");
|
||||||
|
|
||||||
if (!obj->dknown)
|
if (!dknown)
|
||||||
Strcat(buf, dn ? dn : actualn);
|
Strcat(buf, dn ? dn : actualn);
|
||||||
else if (nn)
|
else if (nn)
|
||||||
Strcat(buf, actualn);
|
Strcat(buf, actualn);
|
||||||
@@ -290,11 +303,11 @@ register struct obj *obj;
|
|||||||
if(is_boots(obj) || is_gloves(obj)) Strcpy(buf,"pair of ");
|
if(is_boots(obj) || is_gloves(obj)) Strcpy(buf,"pair of ");
|
||||||
|
|
||||||
if(obj->otyp >= ELVEN_SHIELD && obj->otyp <= ORCISH_SHIELD
|
if(obj->otyp >= ELVEN_SHIELD && obj->otyp <= ORCISH_SHIELD
|
||||||
&& !obj->dknown) {
|
&& !dknown) {
|
||||||
Strcpy(buf, "shield");
|
Strcpy(buf, "shield");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if(obj->otyp == SHIELD_OF_REFLECTION && !obj->dknown) {
|
if(obj->otyp == SHIELD_OF_REFLECTION && !dknown) {
|
||||||
Strcpy(buf, "smooth shield");
|
Strcpy(buf, "smooth shield");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -341,7 +354,7 @@ register struct obj *obj;
|
|||||||
}
|
}
|
||||||
|
|
||||||
Strcpy(buf, actualn);
|
Strcpy(buf, actualn);
|
||||||
if (typ == TIN && obj->known)
|
if (typ == TIN && known)
|
||||||
tin_details(obj, omndx, buf);
|
tin_details(obj, omndx, buf);
|
||||||
break;
|
break;
|
||||||
case COIN_CLASS:
|
case COIN_CLASS:
|
||||||
@@ -365,15 +378,15 @@ register struct obj *obj;
|
|||||||
(obj->owt > ocl->oc_weight) ? "very " : "");
|
(obj->owt > ocl->oc_weight) ? "very " : "");
|
||||||
break;
|
break;
|
||||||
case POTION_CLASS:
|
case POTION_CLASS:
|
||||||
if (obj->dknown && obj->odiluted)
|
if (dknown && obj->odiluted)
|
||||||
Strcpy(buf, "diluted ");
|
Strcpy(buf, "diluted ");
|
||||||
if(nn || un || !obj->dknown) {
|
if(nn || un || !dknown) {
|
||||||
Strcat(buf, "potion");
|
Strcat(buf, "potion");
|
||||||
if(!obj->dknown) break;
|
if(!dknown) break;
|
||||||
if(nn) {
|
if(nn) {
|
||||||
Strcat(buf, " of ");
|
Strcat(buf, " of ");
|
||||||
if (typ == POT_WATER &&
|
if (typ == POT_WATER &&
|
||||||
obj->bknown && (obj->blessed || obj->cursed)) {
|
bknown && (obj->blessed || obj->cursed)) {
|
||||||
Strcat(buf, obj->blessed ? "holy " : "unholy ");
|
Strcat(buf, obj->blessed ? "holy " : "unholy ");
|
||||||
}
|
}
|
||||||
Strcat(buf, actualn);
|
Strcat(buf, actualn);
|
||||||
@@ -388,7 +401,7 @@ register struct obj *obj;
|
|||||||
break;
|
break;
|
||||||
case SCROLL_CLASS:
|
case SCROLL_CLASS:
|
||||||
Strcpy(buf, "scroll");
|
Strcpy(buf, "scroll");
|
||||||
if(!obj->dknown) break;
|
if(!dknown) break;
|
||||||
if(nn) {
|
if(nn) {
|
||||||
Strcat(buf, " of ");
|
Strcat(buf, " of ");
|
||||||
Strcat(buf, actualn);
|
Strcat(buf, actualn);
|
||||||
@@ -404,7 +417,7 @@ register struct obj *obj;
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case WAND_CLASS:
|
case WAND_CLASS:
|
||||||
if(!obj->dknown)
|
if(!dknown)
|
||||||
Strcpy(buf, "wand");
|
Strcpy(buf, "wand");
|
||||||
else if(nn)
|
else if(nn)
|
||||||
Sprintf(buf, "wand of %s", actualn);
|
Sprintf(buf, "wand of %s", actualn);
|
||||||
@@ -414,7 +427,7 @@ register struct obj *obj;
|
|||||||
Sprintf(buf, "%s wand", dn);
|
Sprintf(buf, "%s wand", dn);
|
||||||
break;
|
break;
|
||||||
case SPBOOK_CLASS:
|
case SPBOOK_CLASS:
|
||||||
if (!obj->dknown) {
|
if (!dknown) {
|
||||||
Strcpy(buf, "spellbook");
|
Strcpy(buf, "spellbook");
|
||||||
} else if (nn) {
|
} else if (nn) {
|
||||||
if (typ != SPE_BOOK_OF_THE_DEAD)
|
if (typ != SPE_BOOK_OF_THE_DEAD)
|
||||||
@@ -426,7 +439,7 @@ register struct obj *obj;
|
|||||||
Sprintf(buf, "%s spellbook", dn);
|
Sprintf(buf, "%s spellbook", dn);
|
||||||
break;
|
break;
|
||||||
case RING_CLASS:
|
case RING_CLASS:
|
||||||
if(!obj->dknown)
|
if(!dknown)
|
||||||
Strcpy(buf, "ring");
|
Strcpy(buf, "ring");
|
||||||
else if(nn)
|
else if(nn)
|
||||||
Sprintf(buf, "ring of %s", actualn);
|
Sprintf(buf, "ring of %s", actualn);
|
||||||
@@ -439,7 +452,7 @@ register struct obj *obj;
|
|||||||
{
|
{
|
||||||
const char *rock =
|
const char *rock =
|
||||||
(ocl->oc_material == MINERAL) ? "stone" : "gem";
|
(ocl->oc_material == MINERAL) ? "stone" : "gem";
|
||||||
if (!obj->dknown) {
|
if (!dknown) {
|
||||||
Strcpy(buf, rock);
|
Strcpy(buf, rock);
|
||||||
} else if (!nn) {
|
} else if (!nn) {
|
||||||
if (un) Sprintf(buf,"%s called %s", rock, un);
|
if (un) Sprintf(buf,"%s called %s", rock, un);
|
||||||
@@ -455,7 +468,7 @@ register struct obj *obj;
|
|||||||
}
|
}
|
||||||
if (pluralize) Strcpy(buf, makeplural(buf));
|
if (pluralize) Strcpy(buf, makeplural(buf));
|
||||||
|
|
||||||
if (obj->onamelth && obj->dknown) {
|
if (obj->onamelth && dknown) {
|
||||||
Strcat(buf, " named ");
|
Strcat(buf, " named ");
|
||||||
nameit:
|
nameit:
|
||||||
Strcat(buf, ONAME(obj));
|
Strcat(buf, ONAME(obj));
|
||||||
@@ -490,13 +503,14 @@ boolean
|
|||||||
the_unique_obj(obj)
|
the_unique_obj(obj)
|
||||||
register struct obj *obj;
|
register struct obj *obj;
|
||||||
{
|
{
|
||||||
if (!obj->dknown)
|
boolean known = (obj->known || iflags.override_ID);
|
||||||
|
if (!obj->dknown && !iflags.override_ID)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
else if (obj->otyp == FAKE_AMULET_OF_YENDOR && !obj->known)
|
else if (obj->otyp == FAKE_AMULET_OF_YENDOR && !known)
|
||||||
return TRUE; /* lie */
|
return TRUE; /* lie */
|
||||||
else
|
else
|
||||||
return (boolean)(objects[obj->otyp].oc_unique &&
|
return (boolean)(objects[obj->otyp].oc_unique &&
|
||||||
(obj->known || obj->otyp == AMULET_OF_YENDOR));
|
(known || obj->otyp == AMULET_OF_YENDOR));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* should monster type be prefixed with "the"? (mostly used for corpses) */
|
/* should monster type be prefixed with "the"? (mostly used for corpses) */
|
||||||
@@ -528,7 +542,9 @@ struct obj *obj;
|
|||||||
char *prefix;
|
char *prefix;
|
||||||
{
|
{
|
||||||
boolean iscrys = (obj->otyp == CRYSKNIFE);
|
boolean iscrys = (obj->otyp == CRYSKNIFE);
|
||||||
|
boolean rknown;
|
||||||
|
|
||||||
|
rknown = (iflags.override_ID == 0) ? obj->rknown : TRUE;
|
||||||
|
|
||||||
if (!is_damageable(obj) && !iscrys) return;
|
if (!is_damageable(obj) && !iscrys) return;
|
||||||
|
|
||||||
@@ -550,7 +566,7 @@ char *prefix;
|
|||||||
Strcat(prefix, is_corrodeable(obj) ? "corroded " :
|
Strcat(prefix, is_corrodeable(obj) ? "corroded " :
|
||||||
"rotted ");
|
"rotted ");
|
||||||
}
|
}
|
||||||
if (obj->rknown && obj->oerodeproof)
|
if (rknown && obj->oerodeproof)
|
||||||
Strcat(prefix,
|
Strcat(prefix,
|
||||||
iscrys ? "fixed " :
|
iscrys ? "fixed " :
|
||||||
is_rustprone(obj) ? "rustproof " :
|
is_rustprone(obj) ? "rustproof " :
|
||||||
@@ -563,6 +579,7 @@ doname(obj)
|
|||||||
register struct obj *obj;
|
register struct obj *obj;
|
||||||
{
|
{
|
||||||
boolean ispoisoned = FALSE;
|
boolean ispoisoned = FALSE;
|
||||||
|
boolean known, cknown, bknown, lknown;
|
||||||
int omndx = obj->corpsenm;
|
int omndx = obj->corpsenm;
|
||||||
char prefix[PREFIX];
|
char prefix[PREFIX];
|
||||||
char tmpbuf[PREFIX+1];
|
char tmpbuf[PREFIX+1];
|
||||||
@@ -571,6 +588,14 @@ register struct obj *obj;
|
|||||||
*/
|
*/
|
||||||
register char *bp = xname(obj);
|
register char *bp = xname(obj);
|
||||||
|
|
||||||
|
if (iflags.override_ID) known = cknown = bknown = lknown = TRUE;
|
||||||
|
else {
|
||||||
|
known = obj->known;
|
||||||
|
cknown = obj->cknown;
|
||||||
|
bknown = obj->bknown;
|
||||||
|
lknown = obj->lknown;
|
||||||
|
}
|
||||||
|
|
||||||
/* When using xname, we want "poisoned arrow", and when using
|
/* When using xname, we want "poisoned arrow", and when using
|
||||||
* doname, we want "poisoned +0 arrow". This kludge is about the only
|
* doname, we want "poisoned +0 arrow". This kludge is about the only
|
||||||
* way to do it, at least until someone overhauls xname() and doname(),
|
* way to do it, at least until someone overhauls xname() and doname(),
|
||||||
@@ -600,11 +625,11 @@ register struct obj *obj;
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* "empty" goes at the beginning, but item count goes at the end */
|
/* "empty" goes at the beginning, but item count goes at the end */
|
||||||
if (obj->cknown &&
|
if (cknown &&
|
||||||
(Is_container(obj) || obj->otyp == STATUE) && !Has_contents(obj))
|
(Is_container(obj) || obj->otyp == STATUE) && !Has_contents(obj))
|
||||||
Strcat(prefix, "empty ");
|
Strcat(prefix, "empty ");
|
||||||
|
|
||||||
if (obj->bknown &&
|
if (bknown &&
|
||||||
obj->oclass != COIN_CLASS &&
|
obj->oclass != COIN_CLASS &&
|
||||||
(obj->otyp != POT_WATER || !objects[POT_WATER].oc_name_known
|
(obj->otyp != POT_WATER || !objects[POT_WATER].oc_name_known
|
||||||
|| (!obj->cursed && !obj->blessed))) {
|
|| (!obj->cursed && !obj->blessed))) {
|
||||||
@@ -615,7 +640,7 @@ register struct obj *obj;
|
|||||||
Strcat(prefix, "cursed ");
|
Strcat(prefix, "cursed ");
|
||||||
else if (obj->blessed)
|
else if (obj->blessed)
|
||||||
Strcat(prefix, "blessed ");
|
Strcat(prefix, "blessed ");
|
||||||
else if ((!obj->known || !objects[obj->otyp].oc_charged ||
|
else if ((!known || !objects[obj->otyp].oc_charged ||
|
||||||
(obj->oclass == ARMOR_CLASS ||
|
(obj->oclass == ARMOR_CLASS ||
|
||||||
obj->oclass == RING_CLASS))
|
obj->oclass == RING_CLASS))
|
||||||
/* For most items with charges or +/-, if you know how many
|
/* For most items with charges or +/-, if you know how many
|
||||||
@@ -637,7 +662,7 @@ register struct obj *obj;
|
|||||||
Strcat(prefix, "uncursed ");
|
Strcat(prefix, "uncursed ");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (obj->lknown && Is_box(obj)) {
|
if (lknown && Is_box(obj)) {
|
||||||
if (obj->obroken)
|
if (obj->obroken)
|
||||||
Strcat(prefix, "unlockable ");
|
Strcat(prefix, "unlockable ");
|
||||||
else if (obj->olocked)
|
else if (obj->olocked)
|
||||||
@@ -648,7 +673,7 @@ register struct obj *obj;
|
|||||||
|
|
||||||
if (obj->greased) Strcat(prefix, "greased ");
|
if (obj->greased) Strcat(prefix, "greased ");
|
||||||
|
|
||||||
if (obj->cknown && Has_contents(obj)) {
|
if (cknown && Has_contents(obj)) {
|
||||||
struct obj *curr;
|
struct obj *curr;
|
||||||
long itemcount = 0L;
|
long itemcount = 0L;
|
||||||
|
|
||||||
@@ -669,7 +694,7 @@ register struct obj *obj;
|
|||||||
Strcat(prefix, "poisoned ");
|
Strcat(prefix, "poisoned ");
|
||||||
plus:
|
plus:
|
||||||
add_erosion_words(obj, prefix);
|
add_erosion_words(obj, prefix);
|
||||||
if(obj->known) {
|
if(known) {
|
||||||
Strcat(prefix, sitoa(obj->spe));
|
Strcat(prefix, sitoa(obj->spe));
|
||||||
Strcat(prefix, " ");
|
Strcat(prefix, " ");
|
||||||
}
|
}
|
||||||
@@ -721,7 +746,7 @@ plus:
|
|||||||
case WAND_CLASS:
|
case WAND_CLASS:
|
||||||
add_erosion_words(obj, prefix);
|
add_erosion_words(obj, prefix);
|
||||||
charges:
|
charges:
|
||||||
if(obj->known)
|
if(known)
|
||||||
Sprintf(eos(bp), " (%d:%d)", (int)obj->recharged, obj->spe);
|
Sprintf(eos(bp), " (%d:%d)", (int)obj->recharged, obj->spe);
|
||||||
break;
|
break;
|
||||||
case POTION_CLASS:
|
case POTION_CLASS:
|
||||||
@@ -737,7 +762,7 @@ ring:
|
|||||||
Strcat(bp, body_part(HAND));
|
Strcat(bp, body_part(HAND));
|
||||||
Strcat(bp, ")");
|
Strcat(bp, ")");
|
||||||
}
|
}
|
||||||
if(obj->known && objects[obj->otyp].oc_charged) {
|
if(known && objects[obj->otyp].oc_charged) {
|
||||||
Strcat(prefix, sitoa(obj->spe));
|
Strcat(prefix, sitoa(obj->spe));
|
||||||
Strcat(prefix, " ");
|
Strcat(prefix, " ");
|
||||||
}
|
}
|
||||||
@@ -751,10 +776,10 @@ ring:
|
|||||||
CXN_ARTICLE|CXN_NOCORPSE));
|
CXN_ARTICLE|CXN_NOCORPSE));
|
||||||
} else if (obj->otyp == EGG) {
|
} else if (obj->otyp == EGG) {
|
||||||
#if 0 /* corpses don't tell if they're stale either */
|
#if 0 /* corpses don't tell if they're stale either */
|
||||||
if (obj->known && stale_egg(obj))
|
if (known && stale_egg(obj))
|
||||||
Strcat(prefix, "stale ");
|
Strcat(prefix, "stale ");
|
||||||
#endif
|
#endif
|
||||||
if (omndx >= LOW_PM && (obj->known ||
|
if (omndx >= LOW_PM && (known ||
|
||||||
(mvitals[omndx].mvflags & MV_KNOWS_EGG))) {
|
(mvitals[omndx].mvflags & MV_KNOWS_EGG))) {
|
||||||
Strcat(prefix, mons[omndx].mname);
|
Strcat(prefix, mons[omndx].mname);
|
||||||
Strcat(prefix, " ");
|
Strcat(prefix, " ");
|
||||||
|
|||||||
Reference in New Issue
Block a user