Merge remote-tracking branch 'origin/NetHack-3.6.0'

This commit is contained in:
keni
2016-10-09 15:56:50 -04:00
28 changed files with 2228 additions and 508 deletions

View File

@@ -184,7 +184,10 @@ E void FDECL(set_occupation, (int (*)(void), const char *, int));
E char NDECL(pgetchar);
E void FDECL(pushch, (CHAR_P));
E void FDECL(savech, (CHAR_P));
E void NDECL(add_debug_extended_commands);
E const char *FDECL(key2extcmddesc, (UCHAR_P));
E boolean FDECL(bind_specialkey, (UCHAR_P, const char *));
E char FDECL(txt2key, (char *));
E void FDECL(parseautocomplete, (char *, BOOLEAN_P));
E void FDECL(reset_commands, (BOOLEAN_P));
E void FDECL(rhack, (char *));
E int NDECL(doextlist);
@@ -193,6 +196,8 @@ E int NDECL(enter_explore_mode);
E void FDECL(enlightenment, (int, int));
E void FDECL(youhiding, (BOOLEAN_P, int));
E void FDECL(show_conduct, (int));
E void FDECL(bind_key, (UCHAR_P, const char *));
E void NDECL(dokeylist);
E int FDECL(xytod, (SCHAR_P, SCHAR_P));
E void FDECL(dtoxy, (coord *, int));
E int FDECL(movecmd, (CHAR_P));
@@ -211,6 +216,7 @@ E void NDECL(end_of_input);
#endif
E char NDECL(readchar);
E void NDECL(sanity_check);
E char* FDECL(key2txt, (UCHAR_P, char *));
E char FDECL(yn_function, (const char *, const char *, CHAR_P));
E boolean FDECL(paranoid_query, (BOOLEAN_P, const char *));
@@ -373,6 +379,7 @@ E void NDECL(heal_legs);
/* ### do_name.c ### */
E char *FDECL(coord_desc, (int, int, char *, CHAR_P));
E boolean FDECL(getpos_menu, (coord *, BOOLEAN_P));
E int FDECL(getpos, (coord *, BOOLEAN_P, const char *));
E void FDECL(getpos_sethilite, (void (*f)(int)));
E void FDECL(new_mname, (struct monst *, int));
@@ -847,6 +854,7 @@ E char *FDECL(lcase, (char *));
E char *FDECL(ucase, (char *));
E char *FDECL(upstart, (char *));
E char *FDECL(mungspaces, (char *));
E char *FDECL(trimspaces, (char *));
E char *FDECL(strip_newline, (char *));
E char *FDECL(eos, (char *));
E boolean FDECL(str_end_is, (const char *, const char *));
@@ -1664,8 +1672,11 @@ E void FDECL(next_opt, (winid, const char *));
E int FDECL(fruitadd, (char *, struct fruit *));
E int FDECL(choose_classes_menu, (const char *, int, BOOLEAN_P,
char *, char *));
E void FDECL(parsebindings, (char *));
E void FDECL(add_menu_cmd_alias, (CHAR_P, CHAR_P));
E char FDECL(get_menu_cmd_key, (CHAR_P));
E char FDECL(map_menu_cmd, (CHAR_P));
E void FDECL(show_menu_controls, (winid, BOOLEAN_P));
E void FDECL(assign_warnings, (uchar *));
E char *FDECL(nh_getenv, (const char *));
E void FDECL(set_duplicate_opt_detection, (int));

View File

@@ -424,9 +424,56 @@ extern NEARDATA struct instance_flags iflags;
#ifdef NHSTDC
/* forward declaration sufficient to declare pointers */
struct func_tab; /* from func_tab.h */
struct ext_func_tab; /* from func_tab.h */
#endif
/* special key functions */
enum nh_keyfunc {
NHKF_ESC = 0,
NHKF_DOAGAIN,
NHKF_REQMENU,
/* run ... clicklook need to be in a continuous block */
NHKF_RUN,
NHKF_RUN2,
NHKF_RUSH,
NHKF_FIGHT,
NHKF_FIGHT2,
NHKF_NOPICKUP,
NHKF_RUN_NOPICKUP,
NHKF_DOINV,
NHKF_TRAVEL,
NHKF_CLICKLOOK,
NHKF_REDRAW,
NHKF_REDRAW2,
NHKF_GETDIR_SELF,
NHKF_GETDIR_SELF2,
NHKF_GETDIR_HELP,
NHKF_COUNT,
NHKF_GETPOS_SELF,
NHKF_GETPOS_PICK,
NHKF_GETPOS_PICK_Q, /* quick */
NHKF_GETPOS_PICK_O, /* once */
NHKF_GETPOS_PICK_V, /* verbose */
NHKF_GETPOS_SHOWVALID,
NHKF_GETPOS_AUTODESC,
NHKF_GETPOS_MON_NEXT,
NHKF_GETPOS_MON_PREV,
NHKF_GETPOS_OBJ_NEXT,
NHKF_GETPOS_OBJ_PREV,
NHKF_GETPOS_DOOR_NEXT,
NHKF_GETPOS_DOOR_PREV,
NHKF_GETPOS_UNEX_NEXT,
NHKF_GETPOS_UNEX_PREV,
NHKF_GETPOS_HELP,
NHKF_GETPOS_MENU,
NHKF_GETPOS_MENU_FOV,
NUM_NHKF
};
/* commands[] is used to directly access cmdlist[] instead of looping
through it to find the entry for a given input character;
move_X is the character used for moving one step in direction X;
@@ -443,7 +490,8 @@ struct cmd {
char move_W, move_NW, move_N, move_NE, move_E, move_SE, move_S, move_SW;
const char *dirchars; /* current movement/direction characters */
const char *alphadirchars; /* same as dirchars if !numpad */
const struct func_tab *commands[256]; /* indexed by input character */
const struct ext_func_tab *commands[256]; /* indexed by input character */
char spkeys[NUM_NHKF];
};
extern NEARDATA struct cmd Cmd;

View File

@@ -5,17 +5,18 @@
#ifndef FUNC_TAB_H
#define FUNC_TAB_H
struct func_tab {
char f_char;
boolean can_if_buried;
int NDECL((*f_funct));
const char *f_text;
};
/* extended command flags */
#define IFBURIED 0x01 /* can do command when buried */
#define AUTOCOMPLETE 0x02 /* command autocompletes */
#define WIZMODECMD 0x04 /* wizard-mode command */
#define GENERALCMD 0x08 /* general command, does not take game time */
struct ext_func_tab {
uchar key;
const char *ef_txt, *ef_desc;
int NDECL((*ef_funct));
boolean can_if_buried;
int flags;
const char *f_text;
};
extern struct ext_func_tab extcmdlist[];

View File

@@ -230,6 +230,7 @@
#define is_cmap_trap(i) ((i) >= S_arrow_trap && (i) <= S_polymorph_trap)
#define is_cmap_drawbridge(i) ((i) >= S_vodbridge && (i) <= S_hcdbridge)
#define is_cmap_door(i) ((i) >= S_vodoor && (i) <= S_hcdoor)
#define is_cmap_wall(i) ((i) >= S_stone && (i) <= S_trwall)
struct symdef {
uchar sym;