Merge branch 'NetHack-3.7'

This commit is contained in:
nhmall
2019-12-27 08:52:42 -05:00
98 changed files with 1137 additions and 843 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 context.h $NHDT-Date: 1575775592 2019/12/08 03:26:32 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.35 $ */
/* NetHack 3.6 context.h $NHDT-Date: 1577050216 2019/12/22 21:30:16 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.36 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Michael Allison, 2006. */
/* NetHack may be freely redistributed. See license for details. */
@@ -111,14 +111,15 @@ struct context_info {
unsigned run; /* 0: h (etc), 1: H (etc), 2: fh (etc) */
/* 3: FH, 4: ff+, 5: ff-, 6: FF+, 7: FF- */
/* 8: travel */
unsigned startingpet_mid;
int current_fruit; /* fruit->fid corresponding to g.pl_fruit[] */
int warnlevel;
unsigned startingpet_mid; /* monster id number for initial pet */
int current_fruit; /* fruit->fid corresponding to g.pl_fruit[] */
int mysteryforce; /* adjusts how often "mysterious force" kicks in */
int rndencode; /* randomized escape sequence introducer */
int mysteryforce;
int warnlevel; /* threshold (digit) to warn about unseen mons */
long next_attrib_check; /* next attribute check */
long stethoscope_move;
short stethoscope_movement;
long seer_turn; /* when random clairvoyance will next kick in */
long stethoscope_move; /* when a stethoscope was last used */
short stethoscope_movement; /* to track multiple moves on same turn */
boolean travel; /* find way automatically to u.tx,u.ty */
boolean travel1; /* first travel step */
boolean forcefight;

View File

@@ -1217,6 +1217,7 @@ E int FDECL(mapglyph, (int, int *, int *, unsigned *, int, int, unsigned));
E char *FDECL(encglyph, (int));
E char *FDECL(decode_mixed, (char *, const char *));
E void FDECL(genl_putmixed, (winid, int, const char *));
E boolean FDECL(menuitem_invert_test, (int, unsigned, BOOLEAN_P));
/* ### mcastu.c ### */
@@ -1674,6 +1675,7 @@ E int FDECL(l_selection_register, (lua_State *));
/* ### nhlobj.c ### */
#if !defined(CROSSCOMPILE) || defined(CROSSCOMPILE_TARGET)
E void FDECL(nhl_push_obj, (lua_State *, struct obj *));
E int FDECL(l_obj_register, (lua_State *));
#endif

View File

@@ -1,4 +1,4 @@
/* NetHack 3.7 flag.h $NHDT-Date: 1574982014 2019/11/28 23:00:14 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.166 $ */
/* NetHack 3.7 flag.h $NHDT-Date: 1577050470 2019/12/22 21:34:30 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.167 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Michael Allison, 2006. */
/* NetHack may be freely redistributed. See license for details. */
@@ -16,20 +16,19 @@
*/
struct flag {
boolean acoustics; /* allow dungeon sound messages */
boolean autodig; /* MRKR: Automatically dig */
boolean autoquiver; /* Automatically fill quiver */
boolean autoopen; /* open doors by walking into them */
boolean acoustics; /* allow dungeon sound messages */
boolean autodig; /* MRKR: Automatically dig */
boolean autoquiver; /* Automatically fill quiver */
boolean autoopen; /* open doors by walking into them */
boolean autounlock; /* automatically apply unlocking tools */
boolean beginner;
boolean biff; /* enable checking for mail */
boolean bones; /* allow saving/loading bones */
boolean confirm; /* confirm before hitting tame monsters */
boolean dark_room; /* show shadows in lit rooms */
boolean debug; /* in debugging mode */
boolean biff; /* enable checking for mail */
boolean bones; /* allow saving/loading bones */
boolean confirm; /* confirm before hitting tame monsters */
boolean dark_room; /* show shadows in lit rooms */
boolean debug; /* in debugging mode (aka wizard mode) */
#define wizard flags.debug
boolean end_own; /* list all own scores */
boolean explore; /* in exploration mode */
boolean end_own; /* list all own scores */
boolean explore; /* in exploration mode (aka discover mode) */
#define discover flags.explore
boolean female;
boolean friday13; /* it's Friday the 13th */
@@ -45,6 +44,8 @@ struct flag {
boolean pickup; /* whether you pickup or move and look */
boolean pickup_thrown; /* auto-pickup items you threw */
boolean pushweapon; /* When wielding, push old weapon into second slot */
boolean quick_farsight; /* True disables map browsing during random
* clairvoyance */
boolean rest_on_space; /* space means rest */
boolean safe_dog; /* give complete protection to the dog */
boolean showexp; /* show experience points */
@@ -242,6 +243,8 @@ struct instance_flags {
*/
unsigned msg_history; /* hint: # of top lines to save */
int getpos_coords; /* show coordinates when getting cursor position */
int menuinvertmode; /* 0 = invert toggles every item;
1 = invert skips 'all items' item */
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 conf file */

View File

@@ -490,9 +490,6 @@ enum bodypart_types {
#define MENU_FULL 2
#define MENU_PARTIAL 3
#define MENU_SELECTED TRUE
#define MENU_UNSELECTED FALSE
/*
* Option flags
* Each higher number includes the characteristics of the numbers

View File

@@ -227,7 +227,7 @@ E void FDECL(mac_curs, (winid, int, int));
E void FDECL(mac_putstr, (winid, int, const char *));
E void FDECL(mac_start_menu, (winid));
E void FDECL(mac_add_menu, (winid, int, const anything *, CHAR_P, CHAR_P, int,
const char *, BOOLEAN_P));
const char *, unsigned int));
E void FDECL(mac_end_menu, (winid, const char *));
E int FDECL(mac_select_menu, (winid, int, menu_item **));
#ifdef CLIPPING

View File

@@ -119,6 +119,7 @@ struct obj {
unsigned oeaten; /* nutrition left in food, if partly eaten */
long age; /* creation date */
long owornmask;
unsigned lua_ref_cnt; /* # of lua script references for this object */
struct oextra *oextra; /* pointer to oextra struct */
};

View File

@@ -1,4 +1,4 @@
/* NetHack 3.7 patchlevel.h $NHDT-Date: 1575775596 2019/12/08 03:26:36 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.136 $ */
/* NetHack 3.7 patchlevel.h $NHDT-Date: 1577050471 2019/12/22 21:34:31 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.142 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Michael Allison, 2012. */
/* NetHack may be freely redistributed. See license for details. */
@@ -14,7 +14,7 @@
* Incrementing EDITLEVEL can be used to force invalidation of old bones
* and save files.
*/
#define EDITLEVEL 3
#define EDITLEVEL 6
#define COPYRIGHT_BANNER_A "NetHack, Copyright 1985-2019"
#define COPYRIGHT_BANNER_B \

View File

@@ -133,6 +133,7 @@ typedef struct x11_mi {
int attr; /* Attribute for the line. */
boolean selected; /* Been selected? */
boolean preselected; /* in advance? */
unsigned itemflags; /* MENU_ITEMFLAGS_foo */
char selector; /* Char used to select this entry. */
char gselector; /* Group selector. */
Widget w;
@@ -418,7 +419,7 @@ E void FDECL(X11_putstr, (winid, int, const char *));
E void FDECL(X11_display_file, (const char *, BOOLEAN_P));
E void FDECL(X11_start_menu, (winid));
E void FDECL(X11_add_menu, (winid, int, const ANY_P *, CHAR_P, CHAR_P, int,
const char *, BOOLEAN_P));
const char *, unsigned int));
E void FDECL(X11_end_menu, (winid, const char *));
E int FDECL(X11_select_menu, (winid, int, MENU_ITEM_P **));
E void NDECL(X11_update_inventory);

View File

@@ -82,7 +82,7 @@ extern void curses_display_file(const char *filename, BOOLEAN_P must_exist);
extern void curses_start_menu(winid wid);
extern void curses_add_menu(winid wid, int glyph, const ANY_P * identifier,
CHAR_P accelerator, CHAR_P group_accel, int attr,
const char *str, BOOLEAN_P presel);
const char *str, unsigned int itemflags);
extern void curses_end_menu(winid wid, const char *prompt);
extern int curses_select_menu(winid wid, int how, MENU_ITEM_P **selected);
extern void curses_update_inventory(void);
@@ -177,7 +177,7 @@ extern void curses_create_nhmenu(winid wid);
extern void curses_add_nhmenu_item(winid wid, int glyph,
const ANY_P *identifier, CHAR_P accelerator,
CHAR_P group_accel, int attr,
const char *str, BOOLEAN_P presel);
const char *str, unsigned itemflags);
extern void curs_menu_set_bottom_heavy(winid);
extern void curses_finalize_nhmenu(winid wid, const char *prompt);
extern int curses_display_nhmenu(winid wid, int how, MENU_ITEM_P **_selected);

View File

@@ -71,7 +71,7 @@ E void FDECL(Gem_putstr, (winid, int, const char *));
E void FDECL(Gem_display_file, (const char *, BOOLEAN_P));
E void FDECL(Gem_start_menu, (winid));
E void FDECL(Gem_add_menu, (winid, int, const ANY_P *, CHAR_P, CHAR_P, int,
const char *, BOOLEAN_P));
const char *, unsigned int));
E void FDECL(Gem_end_menu, (winid, const char *));
E int FDECL(Gem_select_menu, (winid, int, MENU_ITEM_P **));
E char FDECL(Gem_message_menu, (CHAR_P, int, const char *));

View File

@@ -32,7 +32,7 @@ struct window_procs {
void FDECL((*win_display_file), (const char *, BOOLEAN_P));
void FDECL((*win_start_menu), (winid));
void FDECL((*win_add_menu), (winid, int, const ANY_P *, CHAR_P, CHAR_P,
int, const char *, BOOLEAN_P));
int, const char *, unsigned int));
void FDECL((*win_end_menu), (winid, const char *));
int FDECL((*win_select_menu), (winid, int, MENU_ITEM_P **));
char FDECL((*win_message_menu), (CHAR_P, int, const char *));
@@ -331,7 +331,7 @@ struct chain_procs {
void FDECL((*win_display_file), (CARGS, const char *, BOOLEAN_P));
void FDECL((*win_start_menu), (CARGS, winid));
void FDECL((*win_add_menu), (CARGS, winid, int, const ANY_P *, CHAR_P,
CHAR_P, int, const char *, BOOLEAN_P));
CHAR_P, int, const char *, unsigned int));
void FDECL((*win_end_menu), (CARGS, winid, const char *));
int FDECL((*win_select_menu), (CARGS, winid, int, MENU_ITEM_P **));
char FDECL((*win_message_menu), (CARGS, CHAR_P, int, const char *));
@@ -405,7 +405,7 @@ extern void FDECL(safe_putmixed, (winid, int, const char *));
extern void FDECL(safe_display_file, (const char *, BOOLEAN_P));
extern void FDECL(safe_start_menu, (winid));
extern void FDECL(safe_add_menu, (winid, int, const ANY_P *, CHAR_P, CHAR_P,
int, const char *, BOOLEAN_P));
int, const char *, unsigned int));
extern void FDECL(safe_end_menu, (winid, const char *));
extern int FDECL(safe_select_menu, (winid, int, MENU_ITEM_P **));
extern char FDECL(safe_message_menu, (CHAR_P, int, const char *));

View File

@@ -18,6 +18,7 @@ typedef struct tty_mi {
char *str; /* description string (including accelerator) */
int attr; /* string attribute */
boolean selected; /* TRUE if selected by user */
unsigned itemflags; /* item flags */
char selector; /* keyboard accelerator */
char gselector; /* group accelerator */
} tty_menu_item;
@@ -191,7 +192,7 @@ E void FDECL(tty_putstr, (winid, int, const char *));
E void FDECL(tty_display_file, (const char *, BOOLEAN_P));
E void FDECL(tty_start_menu, (winid));
E void FDECL(tty_add_menu, (winid, int, const ANY_P *, CHAR_P, CHAR_P, int,
const char *, BOOLEAN_P));
const char *, unsigned int));
E void FDECL(tty_end_menu, (winid, const char *));
E int FDECL(tty_select_menu, (winid, int, MENU_ITEM_P **));
E char FDECL(tty_message_menu, (CHAR_P, int, const char *));

View File

@@ -54,8 +54,9 @@ enum any_types {
/* menu return list */
typedef struct mi {
anything item; /* identifier */
long count; /* count */
anything item; /* identifier */
long count; /* count */
unsigned itemflags; /* item flags */
} menu_item;
#define MENU_ITEM_P struct mi
@@ -105,6 +106,11 @@ typedef struct mi {
#define MENU_UNSELECT_PAGE '\\'
#define MENU_INVERT_PAGE '~'
#define MENU_SEARCH ':'
#define MENU_ITEMFLAGS_NONE 0x0000000U
#define MENU_ITEMFLAGS_SELECTED 0x0000001U
#define MENU_ITEMFLAGS_SKIPINVERT 0x0000002U
/* clang-format on */
#endif /* WINTYPE_H */