eight_bit_tty send 8-bit characters straight to terminal [FALSE]
extmenu use a menu for selecting extended commands (#) [FALSE]
fixinv try to retain the same letter for the same object [TRUE]
+goldX when filtering objects by bless/curse state, [FALSE]
+ whether to classify gold as X (unknown) or U (uncursed)
help print all available info when using the / command [TRUE]
IBMgraphics use IBM extended characters for the dungeon [FALSE]
ignintr ignore interrupt signal, including breaks [FALSE]
-.\" $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.203 $ $NHDT-Date: 1456192371 2016/02/23 01:52:51 $
+.\" $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.224 $ $NHDT-Date: 1498078870 2017/06/21 21:01:10 $
.ds h0 "NetHack Guidebook
.ds h1
.ds h2 %
If you prefix the value with `!' or ``no'', you will
exclude that gender from being picked randomly.
Cannot be set with the `O' command. Persistent.
+.lp "goldX "
+When filtering objects based on bless/curse state (BUCX), whether to
+treat gold pieces as X (unknown bless/curse state, when `on')
+or U (known to be uncursed, when `off', the default).
+Gold is never blessed or cursed, but it is not described as ``uncursed''
+even when the
+.op implicit_uncursed
+option is `off'.
.lp "help "
If more information is available for an object looked at
with the `/' command, ask if you want to see it (default on). Turning help
exclude that gender from being picked randomly.
Cannot be set with the `{\tt O}' command. Persistent.
%.lp
+\item[\ib{goldX}]
+When filtering objects based on bless/curse state (BUCX), whether to
+treat gold pieces as {\tt X} (unknown bless/curse state, when `on')
+or {\tt U} (known to be uncursed, when `off', the default).
+Gold is never blessed or cursed, but it is not described as ``uncursed''
+even when the {\it implicit\verb+_+uncursed\/} option is `off'.
+%.lp
\item[\ib{help}]
If more information is available for an object looked at
with the `{\tt /}' command, ask if you want to see it (default on).
travel accepts 'm' (request menu) prefix
pressing a or A when cursor positioning shows menu of "interesting" features
wizard-mode command #wizmakemap to recreate the current level
+'goldX' boolean option to treat gold pieces as X (vs U) during BUCX filtering
+ (should be persistent but is reset each save/restore cycle in order
+ to avoid breaking 3.6.0 save files)
Platform- and/or Interface-Specific New Features
-/* NetHack 3.6 flag.h $NHDT-Date: 1497479080 2017/06/14 22:24:40 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.118 $ */
+/* NetHack 3.6 flag.h $NHDT-Date: 1498078871 2017/06/21 21:01:11 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.119 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
boolean cbreak; /* in cbreak mode, rogue format */
boolean deferred_X; /* deferred entry into explore mode */
boolean echo; /* 1 to echo characters */
+ /* FIXME: goldX belongs in flags, but putting it in iflags avoids
+ breaking 3.6.[01] save files */
+ boolean goldX; /* for BUCX filtering, whether gold is X or U */
boolean hilite_pile; /* mark piles of objects with a hilite */
boolean implicit_uncursed; /* maybe omit "uncursed" status in inventory */
boolean mention_walls; /* give feedback when bumping walls */
-/* NetHack 3.6 invent.c $NHDT-Date: 1472809075 2016/09/02 09:37:55 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.210 $ */
+/* NetHack 3.6 invent.c $NHDT-Date: 1498078873 2017/06/21 21:01:13 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.214 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
} else if (sym == 'a') {
allflag = TRUE;
} else if (sym == 'A') {
- /* same as the default */;
+ ; /* same as the default */
} else if (sym == 'u') {
add_valid_menu_class('u');
ckfn = ckunpaid;
int count = 0;
for (; list; list = list->nobj) {
- /* coins are "none of the above" as far as BUCX filtering goes */
- if (list->oclass == COIN_CLASS)
+ /* coins are either uncursed or unknown based upon option setting */
+ if (list->oclass == COIN_CLASS) {
+ if (type == (iflags.goldX ? BUC_UNKNOWN : BUC_UNCURSED))
+ ++count;
continue;
+ }
/* priests always know bless/curse state */
if (Role_if(PM_PRIEST))
list->bknown = 1;
struct obj *list;
int *bcp, *ucp, *ccp, *xcp, *ocp;
{
+ /* Future extensions:
+ * Add parameter for list traversal by either nexthere or nobj.
+ * Skip current_container when list is invent, uchain when
+ * first object of list is located on the floor. 'ocp' will then
+ * have a function again (it was a counter for having skipped gold,
+ * but that's not skipped anymore).
+ */
*bcp = *ucp = *ccp = *xcp = *ocp = 0;
for (; list; list = list->nobj) {
+ /* coins are either uncursed or unknown based upon option setting */
if (list->oclass == COIN_CLASS) {
- ++(*ocp); /* "other" */
+ if (iflags.goldX)
+ ++(*xcp);
+ else
+ ++(*ucp);
continue;
}
/* priests always know bless/curse state */
{
boolean res = (obj->oclass == this_type);
- if (obj->oclass != COIN_CLASS) {
+ if (obj->oclass == COIN_CLASS) {
+ /* if filtering by bless/curse state, gold is classified as
+ either unknown or uncursed based on user option setting */
+ if (this_type && index("BUCX", this_type))
+ res = (this_type == (iflags.goldX ? 'X' : 'U'));
+ } else {
switch (this_type) {
case 'B':
res = (obj->bknown && obj->blessed);
/* collect a list of classes of objects carried, for use as a prompt
*/
types[0] = 0;
- class_count =
- collect_obj_classes(types, invent, FALSE,
- (boolean FDECL((*), (OBJ_P))) 0, &itemcount);
+ class_count = collect_obj_classes(types, invent, FALSE,
+ (boolean FDECL((*), (OBJ_P))) 0,
+ &itemcount);
if (unpaid_count || billx || (bcnt + ccnt + ucnt + xcnt) != 0)
types[class_count++] = ' ';
if (unpaid_count)
return doprgold();
if (index(types, c) > index(types, '\033')) {
/* '> ESC' => hidden choice, something known not to be carried */
- const char *which = 0;
+ const char *before = "", *after = "";
switch (c) {
case 'B':
- which = "known to be blessed";
+ before = "known to be blessed ";
break;
case 'U':
- which = "known to be uncursed";
+ before = "known to be uncursed ";
break;
case 'C':
- which = "known to be cursed";
+ before = "known to be cursed ";
break;
case 'X':
- You(
- "have no objects whose blessed/uncursed/cursed status is unknown.");
+ after = " whose blessed/uncursed/cursed status is unknown";
break; /* better phrasing is desirable */
default:
- which = "such";
+ /* 'c' is an object class, because we've already handled
+ all the non-class letters which were put into 'types[]';
+ could/should move object class names[] array from below
+ to somewhere above so that we can access it here (via
+ lcase(strcpy(classnamebuf, names[(int) c]))), but the
+ game-play value of doing so is low... */
+ before = "such ";
break;
}
- if (which)
- You("have no %s objects.", which);
+ You("have no %sobjects%s.", before, after);
return 0;
}
this_type = oclass;
"Comestibles", "Potions", "Scrolls", "Spellbooks", "Wands", "Coins",
"Gems/Stones", "Boulders/Statues", "Iron balls", "Chains", "Venoms"
};
+STATIC_VAR NEARDATA const char oth_symbols[] = { CONTAINED_SYM, '\0' };
+STATIC_VAR NEARDATA const char *oth_names[] = { "Bagged/Boxed items" };
-static NEARDATA const char oth_symbols[] = { CONTAINED_SYM, '\0' };
-
-static NEARDATA const char *oth_names[] = { "Bagged/Boxed items" };
-
-static NEARDATA char *invbuf = (char *) 0;
-static NEARDATA unsigned invbufsiz = 0;
+STATIC_VAR NEARDATA char *invbuf = (char *) 0;
+STATIC_VAR NEARDATA unsigned invbufsiz = 0;
char *
let_to_name(let, unpaid, showsym)
-/* NetHack 3.6 options.c $NHDT-Date: 1497481179 2017/06/14 22:59:39 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.287 $ */
+/* NetHack 3.6 options.c $NHDT-Date: 1498078876 2017/06/21 21:01:16 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.288 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
{ "flush", (boolean *) 0, FALSE, SET_IN_FILE },
#endif
{ "fullscreen", &iflags.wc2_fullscreen, FALSE, SET_IN_FILE },
+ { "goldX", &iflags.goldX, FALSE, SET_IN_GAME },
{ "help", &flags.help, TRUE, SET_IN_GAME },
{ "hilite_pet", &iflags.wc_hilite_pet, FALSE, SET_IN_GAME }, /*WC*/
{ "hilite_pile", &iflags.hilite_pile, FALSE, SET_IN_GAME },
-/* NetHack 3.6 pickup.c $NHDT-Date: 1470449858 2016/08/06 02:17:38 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.184 $ */
+/* NetHack 3.6 pickup.c $NHDT-Date: 1498078877 2017/06/21 21:01:17 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.185 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
allow_category(obj)
struct obj *obj;
{
- /* unpaid and BUC checks don't apply to coins */
+ /* For coins, if any class filter is specified, accept if coins
+ * are included regardless of whether either unpaid or BUC-status
+ * is also specified since player has explicitly requested coins.
+ * If no class filtering is specified but bless/curse state is,
+ * coins are either unknown or uncursed based on an option setting.
+ */
if (obj->oclass == COIN_CLASS)
- return index(valid_menu_classes, COIN_CLASS) ? TRUE : FALSE;
+ return class_filter
+ ? (index(valid_menu_classes, COIN_CLASS) ? TRUE : FALSE)
+ : shop_filter /* coins are never unpaid, but check anyway */
+ ? (obj->unpaid ? TRUE : FALSE)
+ : bucx_filter
+ ? (index(valid_menu_classes, iflags.goldX ? 'X' : 'U')
+ ? TRUE : FALSE)
+ : TRUE; /* catchall: no filters specified, so accept */
if (Role_if(PM_PRIEST))
obj->bknown = TRUE;
return (current_container ? 1 : -1);
}
+/* askchain() filter used by in_container();
+ * returns True if the container is intact and 'obj' isn't it, False if
+ * container is gone (magic bag explosion) or 'obj' is the container itself;
+ * also used by getobj() when picking a single item to stash
+ */
int
ck_bag(obj)
struct obj *obj;