Merge branch 'NetHack-3.7' into copperwater-hallutraps-3.7
This commit is contained in:
1
include/.gitignore
vendored
1
include/.gitignore
vendored
@@ -7,3 +7,4 @@ dgn_comp.h
|
||||
lev_comp.h
|
||||
tile.h
|
||||
win32api.h
|
||||
nhlua.h
|
||||
|
||||
@@ -33,6 +33,7 @@ typedef struct align { /* alignment & record */
|
||||
|
||||
#define AM_SPLEV_CO 3
|
||||
#define AM_SPLEV_NONCO 7
|
||||
#define AM_SPLEV_RANDOM 8
|
||||
|
||||
#define Amask2align(x) \
|
||||
((aligntyp)((!(x)) ? A_NONE : ((x) == AM_LAWFUL) ? A_LAWFUL \
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
/*-Copyright (c) Robert Patrick Rankin, 2017. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
#ifdef MAKEDEFS_C
|
||||
#if defined(MAKEDEFS_C) || defined (MDLIB_C)
|
||||
/* in makedefs.c, all we care about is the list of names */
|
||||
|
||||
#define A(nam, typ, s1, s2, mt, atk, dfn, cry, inv, al, cl, rac, cost, clr) nam
|
||||
@@ -32,7 +32,7 @@ static const char *artifact_names[] = {
|
||||
/* clang-format on */
|
||||
|
||||
static NEARDATA struct artifact artilist[] = {
|
||||
#endif /* MAKEDEFS_C */
|
||||
#endif /* MAKEDEFS_C || MDLIB_C */
|
||||
|
||||
/* Artifact cost rationale:
|
||||
* 1. The more useful the artifact, the better its cost.
|
||||
@@ -256,7 +256,7 @@ A("The Palantir of Westernesse", CRYSTAL_BALL,
|
||||
|
||||
#undef A
|
||||
|
||||
#ifndef MAKEDEFS_C
|
||||
#if !defined(MAKEDEFS_C) && !defined(MDLIB_C)
|
||||
#undef NO_ATTK
|
||||
#undef NO_DFNS
|
||||
#undef DFNS
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 config.h $NHDT-Date: 1559601008 2019/06/03 22:30:08 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.123 $ */
|
||||
/* NetHack 3.6 config.h $NHDT-Date: 1575245033 2019/12/02 00:03:53 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.126 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/*-Copyright (c) Robert Patrick Rankin, 2016. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -554,7 +554,7 @@ typedef unsigned char uchar;
|
||||
#define DUMPLOG_FILE "/tmp/nethack.%n.%d.log"
|
||||
/* DUMPLOG_FILE allows following placeholders:
|
||||
%% literal '%'
|
||||
%v version (eg. "3.6.2-0")
|
||||
%v version (eg. "3.6.3-0")
|
||||
%u game UID
|
||||
%t game start time, UNIX timestamp format
|
||||
%T current time, UNIX timestamp format
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 context.h $NHDT-Date: 1455907260 2016/02/19 18:41:00 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.30 $ */
|
||||
/* NetHack 3.6 context.h $NHDT-Date: 1575775592 2019/12/08 03:26:32 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.35 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/*-Copyright (c) Michael Allison, 2006. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -115,6 +115,7 @@ struct context_info {
|
||||
int current_fruit; /* fruit->fid corresponding to g.pl_fruit[] */
|
||||
int warnlevel;
|
||||
int rndencode; /* randomized escape sequence introducer */
|
||||
int mysteryforce;
|
||||
long next_attrib_check; /* next attribute check */
|
||||
long stethoscope_move;
|
||||
short stethoscope_movement;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 decl.h $NHDT-Date: 1559601011 2019/06/03 22:30:11 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.150 $ */
|
||||
/* NetHack 3.6 decl.h $NHDT-Date: 1573869061 2019/11/16 01:51:01 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.165 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/*-Copyright (c) Michael Allison, 2007. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -10,7 +10,7 @@
|
||||
#if !defined(MICRO) && !defined(VMS) && !defined(WIN32)
|
||||
#define LOCKNAMESIZE (PL_NSIZ + 14) /* long enough for uid+name+.99 */
|
||||
#define LOCKNAMEINIT "1lock"
|
||||
#define BONESINIT "bonesnn.xxx"
|
||||
#define BONESINIT "bonesnn.xxx.le"
|
||||
#define BONESSIZE sizeof(BONESINIT)
|
||||
#else
|
||||
#if defined(MICRO)
|
||||
@@ -22,13 +22,13 @@
|
||||
#if defined(VMS)
|
||||
#define LOCKNAMESIZE (PL_NSIZ + 17) /* long enough for _uid+name+.99;1 */
|
||||
#define LOCKNAMEINIT "1lock"
|
||||
#define BONESINIT "bonesnn.xxx;1"
|
||||
#define BONESINIT "bonesnn.xxx_le;1"
|
||||
#define BONESSIZE sizeof(BONESINIT)
|
||||
#endif
|
||||
#if defined(WIN32)
|
||||
#define LOCKNAMESIZE (PL_NSIZ + 25) /* long enough for username+-+name+.99 */
|
||||
#define LOCKNAMEINIT ""
|
||||
#define BONESINIT "bonesnn.xxx"
|
||||
#define BONESINIT "bonesnn.xxx.le"
|
||||
#define BONESSIZE sizeof(BONESINIT)
|
||||
#endif
|
||||
#endif
|
||||
@@ -170,6 +170,7 @@ struct sinfo {
|
||||
int exiting; /* an exit handler is executing */
|
||||
int in_moveloop;
|
||||
int in_impossible;
|
||||
int in_self_recover;
|
||||
#ifdef PANICLOG
|
||||
int in_paniclog;
|
||||
#endif
|
||||
@@ -339,6 +340,9 @@ E const struct c_common_strings c_common_strings;
|
||||
/* material strings */
|
||||
E const char *materialnm[];
|
||||
|
||||
/* empty string that is non-const for parameter use */
|
||||
E char emptystr[];
|
||||
|
||||
/* Monster name articles */
|
||||
#define ARTICLE_NONE 0
|
||||
#define ARTICLE_THE 1
|
||||
@@ -409,6 +413,9 @@ E const char *const monexplain[], invisexplain[], *const oclass_names[];
|
||||
#define PREFIXES_IN_USE
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
E boolean fqn_prefix_locked[PREFIX_COUNT];
|
||||
#endif
|
||||
#ifdef PREFIXES_IN_USE
|
||||
E const char *fqn_prefix_names[PREFIX_COUNT];
|
||||
#endif
|
||||
@@ -421,12 +428,9 @@ E struct restore_info restoreinfo;
|
||||
|
||||
E NEARDATA struct savefile_info sfcap, sfrestinfo, sfsaveinfo;
|
||||
|
||||
struct opvar {
|
||||
xchar spovartyp; /* one of SPOVAR_foo */
|
||||
union {
|
||||
char *str;
|
||||
long l;
|
||||
} vardata;
|
||||
struct selectionvar {
|
||||
int wid, hei;
|
||||
char *map;
|
||||
};
|
||||
|
||||
struct autopickup_exception {
|
||||
@@ -461,7 +465,7 @@ struct breadcrumbs {
|
||||
E const char *ARGV0;
|
||||
#endif
|
||||
|
||||
enum earlyarg {ARG_DEBUG, ARG_VERSION
|
||||
enum earlyarg {ARG_DEBUG, ARG_VERSION, ARG_SHOWPATHS
|
||||
#ifdef WIN32
|
||||
,ARG_WINDOWS
|
||||
#endif
|
||||
@@ -696,6 +700,9 @@ struct role_filter {
|
||||
#define WIZKIT_MAX 128
|
||||
#define CVT_BUF_SIZE 64
|
||||
|
||||
#define LUA_VER_BUFSIZ 20
|
||||
#define LUA_COPYRIGHT_BUFSIZ 120
|
||||
|
||||
struct instance_globals {
|
||||
|
||||
/* apply.c */
|
||||
@@ -871,7 +878,7 @@ struct instance_globals {
|
||||
d_level save_dlevel;
|
||||
|
||||
/* do_name.c */
|
||||
struct opvar *gloc_filter_map;
|
||||
struct selectionvar *gloc_filter_map;
|
||||
int gloc_filter_floodfill_match_glyph;
|
||||
int via_naming;
|
||||
|
||||
@@ -903,8 +910,10 @@ struct instance_globals {
|
||||
struct symsetentry symset[NUM_GRAPHICS];
|
||||
int currentgraphics;
|
||||
nhsym showsyms[SYM_MAX]; /* symbols to be displayed */
|
||||
nhsym l_syms[SYM_MAX]; /* loaded symbols */
|
||||
nhsym r_syms[SYM_MAX]; /* rogue symbols */
|
||||
nhsym primary_syms[SYM_MAX]; /* loaded primary symbols */
|
||||
nhsym rogue_syms[SYM_MAX]; /* loaded rogue symbols */
|
||||
nhsym ov_primary_syms[SYM_MAX]; /* loaded primary symbols */
|
||||
nhsym ov_rogue_syms[SYM_MAX]; /* loaded rogue symbols */
|
||||
nhsym warnsyms[WARNCOUNT]; /* the current warning display symbols */
|
||||
|
||||
/* dungeon.c */
|
||||
@@ -1113,12 +1122,6 @@ struct instance_globals {
|
||||
|
||||
/* questpgr.c */
|
||||
char cvt_buf[CVT_BUF_SIZE];
|
||||
struct qtlists qt_list;
|
||||
#ifdef DLB
|
||||
struct dlb_handle *msg_file;
|
||||
#else
|
||||
FILE *msg_file;
|
||||
#endif
|
||||
/* used by ldrname() and neminame(), then copied into cvt_buf */
|
||||
char nambuf[CVT_BUF_SIZE];
|
||||
|
||||
@@ -1183,6 +1186,7 @@ struct instance_globals {
|
||||
int num_lregions;
|
||||
/* positions touched by level elements explicitly defined in the des-file */
|
||||
char SpLev_Map[COLNO][ROWNO];
|
||||
struct sp_coder *coder;
|
||||
xchar xstart, ystart;
|
||||
char xsize, ysize;
|
||||
boolean splev_init_present;
|
||||
@@ -1192,7 +1196,6 @@ struct instance_globals {
|
||||
struct obj *container_obj[MAX_CONTAINMENT];
|
||||
int container_idx;
|
||||
struct monst *invent_carrying_monster;
|
||||
aligntyp ralign[3];
|
||||
|
||||
/* spells.c */
|
||||
int spl_sortmode; /* index into spl_sortchoices[] */
|
||||
@@ -1253,6 +1256,13 @@ struct instance_globals {
|
||||
int poly_zapped;
|
||||
boolean obj_zapped;
|
||||
|
||||
/* new stuff */
|
||||
char lua_ver[LUA_VER_BUFSIZ];
|
||||
char lua_copyright[LUA_COPYRIGHT_BUFSIZ];
|
||||
|
||||
/* per-level glyph mapping flags */
|
||||
long glyphmap_perlevel_flags;
|
||||
|
||||
unsigned long magic; /* validate that structure layout is preserved */
|
||||
};
|
||||
|
||||
|
||||
@@ -18,22 +18,24 @@ struct couple {
|
||||
};
|
||||
|
||||
struct tmpdungeon {
|
||||
char name[24], protoname[24];
|
||||
char *name, *protoname;
|
||||
struct couple lev;
|
||||
int flags, chance, levels, branches,
|
||||
entry_lev; /* entry level for this dungeon */
|
||||
char boneschar;
|
||||
int align;
|
||||
};
|
||||
|
||||
struct tmplevel {
|
||||
char name[24];
|
||||
char *name;
|
||||
char *chainlvl;
|
||||
struct couple lev;
|
||||
int chance, rndlevs, chain, flags;
|
||||
char boneschar;
|
||||
};
|
||||
|
||||
struct tmpbranch {
|
||||
char name[24]; /* destination dungeon name */
|
||||
char *name; /* destination dungeon name */
|
||||
struct couple lev;
|
||||
int chain; /* index into tmplevel array (chained branch)*/
|
||||
int type; /* branch type (see below) */
|
||||
|
||||
@@ -98,31 +98,36 @@ typedef struct branch {
|
||||
*
|
||||
* Depth corresponds to the number of floors below the surface.
|
||||
*/
|
||||
#define Is_astralevel(x) (on_level(x, &astral_level))
|
||||
#define Is_earthlevel(x) (on_level(x, &earth_level))
|
||||
#define Is_waterlevel(x) (on_level(x, &water_level))
|
||||
#define Is_firelevel(x) (on_level(x, &fire_level))
|
||||
#define Is_airlevel(x) (on_level(x, &air_level))
|
||||
#define Is_medusa_level(x) (on_level(x, &medusa_level))
|
||||
#define Is_oracle_level(x) (on_level(x, &oracle_level))
|
||||
#define Is_valley(x) (on_level(x, &valley_level))
|
||||
#define Is_juiblex_level(x) (on_level(x, &juiblex_level))
|
||||
#define Is_asmo_level(x) (on_level(x, &asmodeus_level))
|
||||
#define Is_baal_level(x) (on_level(x, &baalzebub_level))
|
||||
#define Is_wiz1_level(x) (on_level(x, &wiz1_level))
|
||||
#define Is_wiz2_level(x) (on_level(x, &wiz2_level))
|
||||
#define Is_wiz3_level(x) (on_level(x, &wiz3_level))
|
||||
#define Is_sanctum(x) (on_level(x, &sanctum_level))
|
||||
#define Is_portal_level(x) (on_level(x, &portal_level))
|
||||
#define Is_rogue_level(x) (on_level(x, &rogue_level))
|
||||
#define Is_stronghold(x) (on_level(x, &stronghold_level))
|
||||
#define Is_bigroom(x) (on_level(x, &bigroom_level))
|
||||
#define Is_qstart(x) (on_level(x, &qstart_level))
|
||||
#define Is_qlocate(x) (on_level(x, &qlocate_level))
|
||||
#define Is_nemesis(x) (on_level(x, &nemesis_level))
|
||||
#define Is_knox(x) (on_level(x, &knox_level))
|
||||
#define Is_mineend_level(x) (on_level(x, &mineend_level))
|
||||
#define Is_sokoend_level(x) (on_level(x, &sokoend_level))
|
||||
|
||||
/* These both can't be zero, or dungeon_topology isn't init'd / restored */
|
||||
#define Lassigned(y) ((y)->dlevel || (y)->dnum)
|
||||
#define Lcheck(x,z) (Lassigned(z) && on_level(x, z))
|
||||
|
||||
#define Is_astralevel(x) (Lcheck(x, &astral_level))
|
||||
#define Is_earthlevel(x) (Lcheck(x, &earth_level))
|
||||
#define Is_waterlevel(x) (Lcheck(x, &water_level))
|
||||
#define Is_firelevel(x) (Lcheck(x, &fire_level))
|
||||
#define Is_airlevel(x) (Lcheck(x, &air_level))
|
||||
#define Is_medusa_level(x) (Lcheck(x, &medusa_level))
|
||||
#define Is_oracle_level(x) (Lcheck(x, &oracle_level))
|
||||
#define Is_valley(x) (Lcheck(x, &valley_level))
|
||||
#define Is_juiblex_level(x) (Lcheck(x, &juiblex_level))
|
||||
#define Is_asmo_level(x) (Lcheck(x, &asmodeus_level))
|
||||
#define Is_baal_level(x) (Lcheck(x, &baalzebub_level))
|
||||
#define Is_wiz1_level(x) (Lcheck(x, &wiz1_level))
|
||||
#define Is_wiz2_level(x) (Lcheck(x, &wiz2_level))
|
||||
#define Is_wiz3_level(x) (Lcheck(x, &wiz3_level))
|
||||
#define Is_sanctum(x) (Lcheck(x, &sanctum_level))
|
||||
#define Is_portal_level(x) (Lcheck(x, &portal_level))
|
||||
#define Is_rogue_level(x) (Lcheck(x, &rogue_level))
|
||||
#define Is_stronghold(x) (Lcheck(x, &stronghold_level))
|
||||
#define Is_bigroom(x) (Lcheck(x, &bigroom_level))
|
||||
#define Is_qstart(x) (Lcheck(x, &qstart_level))
|
||||
#define Is_qlocate(x) (Lcheck(x, &qlocate_level))
|
||||
#define Is_nemesis(x) (Lcheck(x, &nemesis_level))
|
||||
#define Is_knox(x) (Lcheck(x, &knox_level))
|
||||
#define Is_mineend_level(x) (Lcheck(x, &mineend_level))
|
||||
#define Is_sokoend_level(x) (Lcheck(x, &sokoend_level))
|
||||
|
||||
#define In_sokoban(x) ((x)->dnum == sokoban_dnum)
|
||||
#define Inhell In_hell(&u.uz) /* now gehennom */
|
||||
|
||||
155
include/extern.h
155
include/extern.h
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 extern.h $NHDT-Date: 1567213888 2019/08/31 01:11:28 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.728 $ */
|
||||
/* NetHack 3.6 extern.h $NHDT-Date: 1575830178 2019/12/08 18:36:18 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.767 $ */
|
||||
/* Copyright (c) Steve Creps, 1988. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -16,7 +16,7 @@ E char *FDECL(fmt_ptr, (const genericptr));
|
||||
|
||||
/* This next pre-processor directive covers almost the entire file,
|
||||
* interrupted only occasionally to pick up specific functions as needed. */
|
||||
#if !defined(MAKEDEFS_C) && !defined(LEV_LEX_C)
|
||||
#if !defined(MAKEDEFS_C) && !defined(MDLIB_C) && !defined(LEV_LEX_C)
|
||||
|
||||
/* ### allmain.c ### */
|
||||
|
||||
@@ -39,6 +39,7 @@ E int NDECL(number_leashed);
|
||||
E void FDECL(o_unleash, (struct obj *));
|
||||
E void FDECL(m_unleash, (struct monst *, BOOLEAN_P));
|
||||
E void NDECL(unleash_all);
|
||||
E boolean FDECL(leashable, (struct monst *));
|
||||
E boolean NDECL(next_to_u);
|
||||
E struct obj *FDECL(get_mleash, (struct monst *));
|
||||
E const char *NDECL(beautiful);
|
||||
@@ -201,6 +202,7 @@ E int NDECL(doconduct);
|
||||
E int NDECL(domonability);
|
||||
E char FDECL(cmd_from_func, (int NDECL((*))));
|
||||
E boolean FDECL(redraw_cmd, (CHAR_P));
|
||||
E const char *FDECL(levltyp_to_name, (int));
|
||||
#ifdef USE_TRAMPOLI
|
||||
E int NDECL(doextcmd);
|
||||
E int NDECL(domonability);
|
||||
@@ -255,6 +257,7 @@ 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 *));
|
||||
E void FDECL(makemap_prepost, (BOOLEAN_P, BOOLEAN_P));
|
||||
|
||||
/* ### dbridge.c ### */
|
||||
|
||||
@@ -450,6 +453,9 @@ E char *FDECL(Amonnam, (struct monst *));
|
||||
E char *FDECL(a_monnam, (struct monst *));
|
||||
E char *FDECL(distant_monnam, (struct monst *, int, char *));
|
||||
E char *FDECL(mon_nam_too, (struct monst *, struct monst *));
|
||||
E char *FDECL(monverbself, (struct monst *, char *,
|
||||
const char *, const char *));
|
||||
E char *FDECL(minimal_monnam, (struct monst *, BOOLEAN_P));
|
||||
E char *FDECL(rndmonnam, (char *));
|
||||
E const char *FDECL(hcolor, (const char *));
|
||||
E const char *NDECL(rndcolor);
|
||||
@@ -474,6 +480,7 @@ E int NDECL(Helmet_on);
|
||||
E int FDECL(select_off, (struct obj *));
|
||||
E int NDECL(take_off);
|
||||
#endif
|
||||
E const char *FDECL(fingers_or_gloves, (BOOLEAN_P));
|
||||
E void FDECL(off_msg, (struct obj *));
|
||||
E void FDECL(set_wear, (struct obj *));
|
||||
E boolean FDECL(donning, (struct obj *));
|
||||
@@ -579,21 +586,25 @@ E boolean FDECL(hurtle_jump, (genericptr_t, int, int));
|
||||
E boolean FDECL(hurtle_step, (genericptr_t, int, int));
|
||||
|
||||
/* ### drawing.c ### */
|
||||
#endif /* !MAKEDEFS_C && !LEV_LEX_C */
|
||||
#endif /* !MAKEDEFS_C && !MDLIB_C && !LEV_LEX_C */
|
||||
E int FDECL(def_char_to_objclass, (CHAR_P));
|
||||
E int FDECL(def_char_to_monclass, (CHAR_P));
|
||||
#if !defined(MAKEDEFS_C) && !defined(LEV_LEX_C)
|
||||
#if !defined(MAKEDEFS_C) && !defined(MDLIB_C) && !defined(LEV_LEX_C)
|
||||
E void FDECL(switch_symbols, (int));
|
||||
E void FDECL(assign_graphics, (int));
|
||||
E void NDECL(init_r_symbols);
|
||||
E void NDECL(init_symbols);
|
||||
E void NDECL(update_bouldersym);
|
||||
E void NDECL(init_showsyms);
|
||||
E void NDECL(init_l_symbols);
|
||||
E void NDECL(init_primary_symbols);
|
||||
E void NDECL(init_rogue_symbols);
|
||||
E void NDECL(init_ov_primary_symbols);
|
||||
E void NDECL(init_ov_rogue_symbols);
|
||||
E void FDECL(clear_symsetentry, (int, BOOLEAN_P));
|
||||
E void FDECL(update_l_symset, (struct symparse *, int));
|
||||
E void FDECL(update_r_symset, (struct symparse *, int));
|
||||
E void FDECL(update_primary_symset, (struct symparse *, int));
|
||||
E void FDECL(update_rogue_symset, (struct symparse *, int));
|
||||
E void FDECL(update_ov_primary_symset, (struct symparse *, int));
|
||||
E void FDECL(update_ov_rogue_symset, (struct symparse *, int));
|
||||
E boolean FDECL(cursed_object_at, (int, int));
|
||||
E nhsym FDECL(get_othersym, (int, int));
|
||||
|
||||
/* ### dungeon.c ### */
|
||||
|
||||
@@ -705,9 +716,9 @@ E int NDECL(done2);
|
||||
E void FDECL(done_intr, (int));
|
||||
#endif
|
||||
E void FDECL(done_in_by, (struct monst *, int));
|
||||
#endif /* !MAKEDEFS_C && !LEV_LEX_C */
|
||||
#endif /* !MAKEDEFS_C && MDLIB_C && !LEV_LEX_C */
|
||||
E void VDECL(panic, (const char *, ...)) PRINTF_F(1, 2) NORETURN;
|
||||
#if !defined(MAKEDEFS_C) && !defined(LEV_LEX_C)
|
||||
#if !defined(MAKEDEFS_C) && !defined(MDLIB_C) && !defined(LEV_LEX_C)
|
||||
E void FDECL(done, (int));
|
||||
E void FDECL(container_contents, (struct obj *, BOOLEAN_P,
|
||||
BOOLEAN_P, BOOLEAN_P));
|
||||
@@ -842,6 +853,7 @@ E int FDECL(nhclose, (int));
|
||||
#ifdef DEBUG
|
||||
E boolean FDECL(debugcore, (const char *, BOOLEAN_P));
|
||||
#endif
|
||||
E void NDECL(reveal_paths);
|
||||
E boolean FDECL(read_tribute, (const char *, const char *, int,
|
||||
char *, int, unsigned));
|
||||
E boolean FDECL(Death_quote, (char *, int));
|
||||
@@ -916,8 +928,10 @@ E char *FDECL(mungspaces, (char *));
|
||||
E char *FDECL(trimspaces, (char *));
|
||||
E char *FDECL(strip_newline, (char *));
|
||||
E char *FDECL(stripchars, (char *, const char *, const char *));
|
||||
E char *FDECL(stripdigits, (char *));
|
||||
E char *FDECL(eos, (char *));
|
||||
E boolean FDECL(str_end_is, (const char *, const char *));
|
||||
E int FDECL(str_lines_maxlen, (const char *));
|
||||
E char *FDECL(strkitten, (char *, CHAR_P));
|
||||
E void FDECL(copynchars, (char *, const char *, int));
|
||||
E char FDECL(chrcasecpy, (int, int));
|
||||
@@ -969,6 +983,7 @@ E void FDECL(strbuf_append, (strbuf_t *, const char *));
|
||||
E void FDECL(strbuf_reserve, (strbuf_t *, int));
|
||||
E void FDECL(strbuf_empty, (strbuf_t *));
|
||||
E void FDECL(strbuf_nl_to_crlf, (strbuf_t *));
|
||||
E char *FDECL(nonconst, (const char *, char *));
|
||||
|
||||
/* ### invent.c ### */
|
||||
|
||||
@@ -1048,7 +1063,8 @@ E int FDECL(count_unpaid, (struct obj *));
|
||||
E int FDECL(count_buc, (struct obj *, int, boolean (*)(OBJ_P)));
|
||||
E void FDECL(tally_BUCX, (struct obj *, BOOLEAN_P,
|
||||
int *, int *, int *, int *, int *));
|
||||
E long FDECL(count_contents, (struct obj *, BOOLEAN_P, BOOLEAN_P, BOOLEAN_P));
|
||||
E long FDECL(count_contents, (struct obj *,
|
||||
BOOLEAN_P, BOOLEAN_P, BOOLEAN_P, BOOLEAN_P));
|
||||
E void FDECL(carry_obj_effects, (struct obj *));
|
||||
E const char *FDECL(currency, (long));
|
||||
E void FDECL(silly_thing, (const char *, struct obj *));
|
||||
@@ -1197,7 +1213,7 @@ E boolean FDECL(usmellmon, (struct permonst *));
|
||||
|
||||
/* ### mapglyph.c ### */
|
||||
|
||||
E int FDECL(mapglyph, (int, int *, int *, unsigned *, int, int));
|
||||
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 *));
|
||||
@@ -1264,6 +1280,7 @@ E void FDECL(add_subroom, (struct mkroom *, int, int, int, int, BOOLEAN_P,
|
||||
SCHAR_P, BOOLEAN_P));
|
||||
E void NDECL(makecorridors);
|
||||
E void FDECL(add_door, (int, int, struct mkroom *));
|
||||
E void NDECL(clear_level_structures);
|
||||
E void NDECL(mklev);
|
||||
#ifdef SPECIALIZATION
|
||||
E void FDECL(topologize, (struct mkroom *, BOOLEAN_P));
|
||||
@@ -1375,6 +1392,7 @@ E struct obj *FDECL(obj_nexto_xy, (struct obj *, int, int, BOOLEAN_P));
|
||||
E struct obj *FDECL(obj_absorb, (struct obj **, struct obj **));
|
||||
E struct obj *FDECL(obj_meld, (struct obj **, struct obj **));
|
||||
E void FDECL(pudding_merge_message, (struct obj *, struct obj *));
|
||||
E struct obj *FDECL(init_dummyobj, (struct obj *, SHORT_P, long));
|
||||
|
||||
/* ### mkroom.c ### */
|
||||
|
||||
@@ -1497,7 +1515,7 @@ E int FDECL(monsndx, (struct permonst *));
|
||||
E int FDECL(name_to_mon, (const char *));
|
||||
E int FDECL(name_to_monclass, (const char *, int *));
|
||||
E int FDECL(gender, (struct monst *));
|
||||
E int FDECL(pronoun_gender, (struct monst *, BOOLEAN_P));
|
||||
E int FDECL(pronoun_gender, (struct monst *, unsigned));
|
||||
E boolean FDECL(levl_follower, (struct monst *));
|
||||
E int FDECL(little_to_big, (int));
|
||||
E int FDECL(big_to_little, (int));
|
||||
@@ -1648,13 +1666,57 @@ E void NDECL(init_lan_features);
|
||||
E char *NDECL(lan_username);
|
||||
#endif
|
||||
|
||||
/* ### nhlsel.c ### */
|
||||
#if !defined(CROSSCOMPILE) || defined(CROSSCOMPILE_TARGET)
|
||||
E struct selectionvar *FDECL(l_selection_check, (lua_State *, int));
|
||||
E int FDECL(l_selection_register, (lua_State *));
|
||||
#endif
|
||||
|
||||
/* ### nhlobj.c ### */
|
||||
#if !defined(CROSSCOMPILE) || defined(CROSSCOMPILE_TARGET)
|
||||
E int FDECL(l_obj_register, (lua_State *));
|
||||
#endif
|
||||
|
||||
/* ### nhlua.c ### */
|
||||
|
||||
#if !defined(CROSSCOMPILE) || defined(CROSSCOMPILE_TARGET)
|
||||
E lua_State * NDECL(nhl_init);
|
||||
E boolean FDECL(nhl_loadlua, (lua_State *, const char *));
|
||||
E boolean FDECL(load_lua, (const char *));
|
||||
E void FDECL(nhl_error, (lua_State *, const char *)) NORETURN;
|
||||
E void FDECL(lcheck_param_table, (lua_State *));
|
||||
E schar FDECL(get_table_mapchr, (lua_State *, const char *));
|
||||
E schar FDECL(get_table_mapchr_opt, (lua_State *, const char *, SCHAR_P));
|
||||
E void FDECL(nhl_add_table_entry_int, (lua_State *, const char *, int));
|
||||
E void FDECL(nhl_add_table_entry_char, (lua_State *, const char *, CHAR_P));
|
||||
E void FDECL(nhl_add_table_entry_str, (lua_State *, const char *, const char *));
|
||||
E schar FDECL(splev_chr2typ, (CHAR_P));
|
||||
E schar FDECL(check_mapchr, (const char *));
|
||||
E int FDECL(get_table_int, (lua_State *, const char *));
|
||||
E int FDECL(get_table_int_opt, (lua_State *, const char *, int));
|
||||
E char *FDECL(get_table_str, (lua_State *, const char *));
|
||||
E char *FDECL(get_table_str_opt, (lua_State *, const char *, char *));
|
||||
E int FDECL(get_table_boolean, (lua_State *, const char *));
|
||||
E int FDECL(get_table_boolean_opt, (lua_State *, const char *, int));
|
||||
E int FDECL(get_table_option, (lua_State *, const char *, const char *, const char *const *));
|
||||
E int FDECL(str_lines_max_width, (const char *));
|
||||
E char *FDECL(stripdigits, (char *));
|
||||
E const char *NDECL(get_lua_version);
|
||||
#endif /* !CROSSCOMPILE || CROSSCOMPILE_TARGET */
|
||||
|
||||
/* ### nhregex.c ### */
|
||||
|
||||
E struct nhregex *NDECL(regex_init);
|
||||
E boolean FDECL(regex_compile, (const char *, struct nhregex *));
|
||||
E const char *FDECL(regex_error_desc, (struct nhregex *));
|
||||
E boolean FDECL(regex_match, (const char *, struct nhregex *));
|
||||
E void FDECL(regex_free, (struct nhregex *));
|
||||
|
||||
/* ### mdlib.c ### */
|
||||
|
||||
E void NDECL(runtime_info_init);
|
||||
E const char *FDECL(do_runtime_info, (int *));
|
||||
|
||||
/* ### nttty.c ### */
|
||||
|
||||
#ifdef WIN32
|
||||
@@ -1742,6 +1804,10 @@ E int FDECL(rnd_class, (int, int));
|
||||
E const char *FDECL(suit_simple_name, (struct obj *));
|
||||
E const char *FDECL(cloak_simple_name, (struct obj *));
|
||||
E const char *FDECL(helm_simple_name, (struct obj *));
|
||||
E const char *FDECL(gloves_simple_name, (struct obj *));
|
||||
E const char *FDECL(boots_simple_name, (struct obj *));
|
||||
E const char *FDECL(shield_simple_name, (struct obj *));
|
||||
E const char *FDECL(shirt_simple_name, (struct obj *));
|
||||
E const char *FDECL(mimic_obj_name, (struct monst *));
|
||||
E char *FDECL(safe_qbuf, (char *, const char *, const char *, struct obj *,
|
||||
char *(*)(OBJ_P), char *(*)(OBJ_P), const char *));
|
||||
@@ -1778,7 +1844,7 @@ E int FDECL(add_autopickup_exception, (const char *));
|
||||
E void NDECL(free_autopickup_exceptions);
|
||||
E int FDECL(load_symset, (const char *, int));
|
||||
E void NDECL(free_symsets);
|
||||
E boolean FDECL(parsesymbols, (char *));
|
||||
E boolean FDECL(parsesymbols, (char *, int));
|
||||
E struct symparse *FDECL(match_sym, (char *));
|
||||
E void NDECL(set_playmode);
|
||||
E int FDECL(sym_val, (const char *));
|
||||
@@ -1811,7 +1877,7 @@ E char *FDECL(dowhatdoes_core, (CHAR_P, char *));
|
||||
E int NDECL(dohelp);
|
||||
E int NDECL(dohistory);
|
||||
|
||||
/* ### pcmain.c ### */
|
||||
/* ### xxmain.c ### */
|
||||
|
||||
#if defined(MICRO) || defined(WIN32)
|
||||
#ifdef CHDIR
|
||||
@@ -1819,6 +1885,10 @@ E void FDECL(chdirx, (char *, BOOLEAN_P));
|
||||
#endif /* CHDIR */
|
||||
E boolean NDECL(authorize_wizard_mode);
|
||||
#endif /* MICRO || WIN32 */
|
||||
#if defined(WIN32)
|
||||
E int NDECL(getlock);
|
||||
E const char *NDECL(get_portable_device);
|
||||
#endif
|
||||
|
||||
/* ### pcsys.c ### */
|
||||
|
||||
@@ -1856,10 +1926,10 @@ E void FDECL(msleep, (unsigned));
|
||||
|
||||
#if defined(MICRO)
|
||||
E void FDECL(regularize, (char *));
|
||||
#endif /* MICRO */
|
||||
#if defined(PC_LOCKING)
|
||||
E void NDECL(getlock);
|
||||
#endif
|
||||
#endif /* MICRO */
|
||||
|
||||
/* ### pickup.c ### */
|
||||
|
||||
@@ -1958,6 +2028,7 @@ E void FDECL(make_blinded, (long, BOOLEAN_P));
|
||||
E void NDECL(toggle_blindness);
|
||||
E boolean FDECL(make_hallucinated, (long, BOOLEAN_P, long));
|
||||
E void FDECL(make_deaf, (long, BOOLEAN_P));
|
||||
E void FDECL(make_glib, (int));
|
||||
E void NDECL(self_invis_message);
|
||||
E int NDECL(dodrink);
|
||||
E int FDECL(dopotion, (struct obj *));
|
||||
@@ -1984,6 +2055,7 @@ E boolean FDECL(can_pray, (BOOLEAN_P));
|
||||
E int NDECL(dopray);
|
||||
E const char *NDECL(u_gname);
|
||||
E int NDECL(doturn);
|
||||
E int FDECL(altarmask_at, (int, int));
|
||||
E const char *NDECL(a_gname);
|
||||
E const char *FDECL(a_gname_at, (XCHAR_P x, XCHAR_P y));
|
||||
E const char *FDECL(align_gname, (ALIGNTYP_P));
|
||||
@@ -2042,8 +2114,8 @@ E short FDECL(quest_info, (int));
|
||||
E const char *NDECL(ldrname);
|
||||
E boolean FDECL(is_quest_artifact, (struct obj *));
|
||||
E struct obj *FDECL(find_quest_artifact, (unsigned));
|
||||
E void FDECL(com_pager, (int));
|
||||
E void FDECL(qt_pager, (int));
|
||||
E void FDECL(com_pager, (const char *));
|
||||
E void FDECL(qt_pager, (const char *));
|
||||
E struct permonst *NDECL(qt_montype);
|
||||
E void NDECL(deliver_splev_message);
|
||||
|
||||
@@ -2364,7 +2436,7 @@ E void NDECL(sysopt_release);
|
||||
E void FDECL(sysopt_seduce_set, (int));
|
||||
|
||||
/* ### sp_lev.c ### */
|
||||
|
||||
#if !defined(CROSSCOMPILE) || defined(CROSSCOMPILE_TARGET)
|
||||
E boolean FDECL(check_room, (xchar *, xchar *, xchar *, xchar *, BOOLEAN_P));
|
||||
E boolean FDECL(create_room, (XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P,
|
||||
XCHAR_P, XCHAR_P, XCHAR_P));
|
||||
@@ -2373,11 +2445,28 @@ E boolean
|
||||
FDECL(dig_corridor, (coord *, coord *, BOOLEAN_P, SCHAR_P, SCHAR_P));
|
||||
E void FDECL(fill_room, (struct mkroom *, BOOLEAN_P));
|
||||
E boolean FDECL(load_special, (const char *));
|
||||
E xchar FDECL(selection_getpoint, (int, int, struct opvar *));
|
||||
E struct opvar *FDECL(selection_opvar, (char *));
|
||||
E void FDECL(opvar_free_x, (struct opvar *));
|
||||
E xchar FDECL(selection_getpoint, (int, int, struct selectionvar *));
|
||||
E struct selectionvar *NDECL(selection_new);
|
||||
E void FDECL(selection_free, (struct selectionvar *));
|
||||
#if !defined(IN_SP_LEV_C)
|
||||
E void FDECL(set_selection_floodfillchk, (int FDECL((*), (int,int))));
|
||||
E void FDECL(selection_floodfill, (struct opvar *, int, int, BOOLEAN_P));
|
||||
#endif
|
||||
E void FDECL(selection_floodfill, (struct selectionvar *, int, int, BOOLEAN_P));
|
||||
E void FDECL(get_location_coord, (schar *, schar *, int, struct mkroom *, long));
|
||||
E void FDECL(selection_setpoint, (int, int, struct selectionvar *, XCHAR_P));
|
||||
E struct selectionvar * FDECL(selection_not, (struct selectionvar *));
|
||||
E void FDECL(selection_filter_percent, (struct selectionvar *, int));
|
||||
E int FDECL(selection_rndcoord, (struct selectionvar *, schar *, schar *, BOOLEAN_P));
|
||||
E void FDECL(selection_do_grow, (struct selectionvar *, int));
|
||||
E void FDECL(selection_do_line, (SCHAR_P, SCHAR_P, SCHAR_P, SCHAR_P, struct selectionvar *));
|
||||
E void FDECL(selection_do_randline, (SCHAR_P, SCHAR_P, SCHAR_P, SCHAR_P, SCHAR_P, SCHAR_P, struct selectionvar *));
|
||||
E struct selectionvar *FDECL(selection_filter_mapchar, (struct selectionvar *, XCHAR_P, int));
|
||||
E void FDECL(set_floodfillchk_match_under, (XCHAR_P));
|
||||
E void FDECL(selection_do_ellipse, (struct selectionvar *, int, int, int, int, int));
|
||||
E void NDECL(update_croom);
|
||||
E const char *FDECL(get_trapname_bytype, (int));
|
||||
E void FDECL(l_register_des, (lua_State *));
|
||||
#endif /* !CROSSCOMPILE || CROSSCOMPILE_TARGET */
|
||||
|
||||
/* ### spell.c ### */
|
||||
|
||||
@@ -2515,7 +2604,7 @@ E boolean FDECL(burnarmor, (struct monst *));
|
||||
E int FDECL(erode_obj, (struct obj *, const char *, int, int));
|
||||
E boolean FDECL(grease_protect, (struct obj *, const char *, struct monst *));
|
||||
E struct trap *FDECL(maketrap, (int, int, int));
|
||||
E void FDECL(fall_through, (BOOLEAN_P));
|
||||
E void FDECL(fall_through, (BOOLEAN_P, unsigned));
|
||||
E struct monst *FDECL(animate_statue,
|
||||
(struct obj *, XCHAR_P, XCHAR_P, int, int *));
|
||||
E struct monst *FDECL(activate_statue_trap,
|
||||
@@ -2560,6 +2649,7 @@ E int FDECL(launch_obj, (SHORT_P, int, int, int, int, int));
|
||||
E boolean NDECL(launch_in_progress);
|
||||
E void NDECL(force_launch_placement);
|
||||
E boolean FDECL(uteetering_at_seen_pit, (struct trap *));
|
||||
E boolean FDECL(uescaped_shaft, (struct trap *));
|
||||
E boolean NDECL(lava_effects);
|
||||
E void NDECL(sink_into_lava);
|
||||
E void NDECL(sokoban_guilt);
|
||||
@@ -2578,6 +2668,8 @@ E int FDECL(find_roll_to_hit, (struct monst *, UCHAR_P, struct obj *,
|
||||
int *, int *));
|
||||
E boolean FDECL(attack, (struct monst *));
|
||||
E boolean FDECL(hmon, (struct monst *, struct obj *, int, int));
|
||||
E boolean FDECL(shade_miss, (struct monst *, struct monst *, struct obj *,
|
||||
BOOLEAN_P, BOOLEAN_P));
|
||||
E int FDECL(damageum, (struct monst *, struct attack *, int));
|
||||
E void FDECL(missum, (struct monst *, struct attack *, BOOLEAN_P));
|
||||
E int FDECL(passive, (struct monst *, struct obj *, BOOLEAN_P, int,
|
||||
@@ -2875,10 +2967,13 @@ E void NDECL(nhwindows_hangup);
|
||||
#endif
|
||||
E void NDECL(genl_status_init);
|
||||
E void NDECL(genl_status_finish);
|
||||
E void FDECL(genl_status_enablefield,
|
||||
(int, const char *, const char *, BOOLEAN_P));
|
||||
E void FDECL(genl_status_update, (int, genericptr_t, int, int, int, unsigned long *));
|
||||
|
||||
E void FDECL(genl_status_enablefield, (int, const char *, const char *,
|
||||
BOOLEAN_P));
|
||||
E void FDECL(genl_status_update, (int, genericptr_t, int, int, int,
|
||||
unsigned long *));
|
||||
#ifdef DUMPLOG
|
||||
E char *FDECL(dump_fmtstr, (const char *, char *, BOOLEAN_P));
|
||||
#endif
|
||||
E void FDECL(dump_open_log, (time_t));
|
||||
E void NDECL(dump_close_log);
|
||||
E void FDECL(dump_redirect, (BOOLEAN_P));
|
||||
@@ -3009,7 +3104,7 @@ E int FDECL(destroy_mitem, (struct monst *, int, int));
|
||||
E int FDECL(resist, (struct monst *, CHAR_P, int, int));
|
||||
E void NDECL(makewish);
|
||||
|
||||
#endif /* !MAKEDEFS_C && !LEV_LEX_C */
|
||||
#endif /* !MAKEDEFS_C && !MDLIB_C && !LEV_LEX_C */
|
||||
|
||||
#undef E
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 flag.h $NHDT-Date: 1569276988 2019/09/23 22:16:28 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.155 $ */
|
||||
/* NetHack 3.7 flag.h $NHDT-Date: 1574982014 2019/11/28 23:00:14 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.166 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/*-Copyright (c) Michael Allison, 2006. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -32,6 +32,7 @@ struct flag {
|
||||
#define discover flags.explore
|
||||
boolean female;
|
||||
boolean friday13; /* it's Friday the 13th */
|
||||
boolean goldX; /* for BUCX filtering, whether gold is X or U */
|
||||
boolean help; /* look in data file for info about stuff */
|
||||
boolean ignintr; /* ignore interrupts */
|
||||
boolean ins_chkpt; /* checkpoint as appropriate; INSURANCE */
|
||||
@@ -40,7 +41,6 @@ struct flag {
|
||||
boolean lit_corridor; /* show a dark corr as lit if it is in sight */
|
||||
boolean nap; /* `timed_delay' option for display effects */
|
||||
boolean null; /* OK to send nulls to the terminal */
|
||||
boolean p__obsolete; /* [3.6.2: perm_invent moved to iflags] */
|
||||
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 */
|
||||
@@ -49,27 +49,6 @@ struct flag {
|
||||
boolean showexp; /* show experience points */
|
||||
boolean showscore; /* show score */
|
||||
boolean silent; /* whether the bell rings or not */
|
||||
/* The story so far:
|
||||
* 'sortloot' originally took a True/False value but was changed
|
||||
* to use a letter instead. 3.6.0 was released without changing its
|
||||
* type from 'boolean' to 'char'. A compiler was smart enough to
|
||||
* complain that assigning any of the relevant letters was not 0 or 1
|
||||
* so not appropriate for boolean (by a configuration which used
|
||||
* SKIP_BOOLEAN to bypass nethack's 'boolean' and use a C++-compatible
|
||||
* one). So the type was changed to 'xchar', which is guaranteed to
|
||||
* match the size of 'boolean' (this guarantee only applies for the
|
||||
* !SKIP_BOOLEAN config, unfortunately). Since xchar does not match
|
||||
* actual use, the type was later changed to 'char'. But that would
|
||||
* break 3.6.0 savefile compatibility for configurations which typedef
|
||||
* 'schar' to 'short int' instead of to 'char'. (Needed by pre-ANSI
|
||||
* systems that use unsigned characters without a way to force them
|
||||
* to be signed.) So, the type has been changed back to 'xchar' for
|
||||
* 3.6.x.
|
||||
*
|
||||
* TODO: change to 'char' (and move out of this block of booleans,
|
||||
* and get rid of these comments...) once 3.6.0 savefile compatibility
|
||||
* eventually ends.
|
||||
*/
|
||||
boolean sortpack; /* sorted inventory */
|
||||
boolean sparkle; /* show "resisting" special FX (Scott Bigham) */
|
||||
boolean standout; /* use standout for --More-- */
|
||||
@@ -91,9 +70,10 @@ struct flag {
|
||||
#define PARANOID_REMOVE 0x0040
|
||||
#define PARANOID_BREAKWAND 0x0080
|
||||
#define PARANOID_WERECHANGE 0x0100
|
||||
#define PARANOID_EATING 0x0200
|
||||
int pickup_burden; /* maximum burden before prompt */
|
||||
int pile_limit; /* controls feedback when walking over objects */
|
||||
char sortloot; /* 'n'=none, 'l'=loot (pickup), 'f'=full ('l'+invent) */
|
||||
char sortloot; /* 'n'=none, 'l'=loot (pickup), 'f'=full ('l'+invent) */
|
||||
char inv_order[MAXOCLASSES];
|
||||
char pickup_types[MAXOCLASSES];
|
||||
#define NUM_DISCLOSURE_OPTIONS 6 /* i,a,v,g,c,o (decl.c) */
|
||||
@@ -254,6 +234,8 @@ struct instance_flags {
|
||||
boolean mon_polycontrol; /* debug: control monster polymorphs */
|
||||
boolean in_dumplog; /* doing the dumplog right now? */
|
||||
boolean in_parse; /* is a command being parsed? */
|
||||
/* suppress terminate during options parsing, for --showpaths */
|
||||
boolean initoptions_noterminate;
|
||||
|
||||
/* stuff that is related to options and/or user or platform preferences
|
||||
*/
|
||||
@@ -270,9 +252,6 @@ struct instance_flags {
|
||||
boolean deferred_X; /* deferred entry into explore mode */
|
||||
boolean echo; /* 1 to echo characters */
|
||||
boolean force_invmenu; /* always menu when handling inventory */
|
||||
/* 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 */
|
||||
@@ -293,25 +272,16 @@ struct instance_flags {
|
||||
boolean use_background_glyph; /* use background glyph when appropriate */
|
||||
boolean use_menu_color; /* use color in menus; only if wc_color */
|
||||
#ifdef STATUS_HILITES
|
||||
long hilite_delta; /* number of moves to leave a temp hilite lit */
|
||||
long hilite_delta; /* number of moves to leave a temp hilite lit */
|
||||
long unhilite_deadline; /* time when oldest temp hilite should be unlit */
|
||||
#endif
|
||||
boolean zerocomp; /* write zero-compressed save files */
|
||||
boolean rlecomp; /* alternative to zerocomp; run-length encoding
|
||||
* compression of levels when writing savefile */
|
||||
uchar num_pad_mode;
|
||||
boolean cursesgraphics; /* Use portable curses extended characters */
|
||||
#if 0 /* XXXgraphics superseded by symbol sets */
|
||||
boolean DECgraphics; /* use DEC VT-xxx extended character set */
|
||||
boolean IBMgraphics; /* use IBM extended character set */
|
||||
#ifdef MAC_GRAPHICS_ENV
|
||||
boolean MACgraphics; /* use Macintosh extended character set, as
|
||||
as defined in the special font HackFont */
|
||||
#endif
|
||||
#endif
|
||||
uchar bouldersym; /* symbol for boulder display */
|
||||
char prevmsg_window; /* type of old message window to use */
|
||||
boolean extmenu; /* extended commands use menu interface */
|
||||
uchar bouldersym; /* symbol for boulder display */
|
||||
char prevmsg_window; /* type of old message window to use */
|
||||
boolean extmenu; /* extended commands use menu interface */
|
||||
#ifdef MFLOPPY
|
||||
boolean checkspace; /* check disk space before writing files */
|
||||
/* (in iflags to allow restore after moving
|
||||
@@ -504,6 +474,9 @@ enum runmode_types {
|
||||
/* werechange: accepting randomly timed werecreature change to transform
|
||||
from human to creature or vice versa while having polymorph control */
|
||||
#define ParanoidWerechange ((flags.paranoia_bits & PARANOID_WERECHANGE) != 0)
|
||||
/* continue eating: prompt given _after_first_bite_ when eating something
|
||||
while satiated */
|
||||
#define ParanoidEating ((flags.paranoia_bits & PARANOID_EATING) != 0)
|
||||
|
||||
/* command parsing, mainly dealing with number_pad handling;
|
||||
not saved and restored */
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.7 global.h $NHDT-Date: 1557510460 2019/05/10 17:47:40 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.72 $ */
|
||||
/* NetHack 3.7 global.h $NHDT-Date: 1574982019 2019/11/28 23:00:19 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.92 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/*-Copyright (c) Michael Allison, 2006. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -11,9 +11,10 @@
|
||||
/*
|
||||
* Development status possibilities.
|
||||
*/
|
||||
#define NH_STATUS_RELEASED 0 /* Released */
|
||||
#define NH_STATUS_WIP 1 /* Work in progress */
|
||||
#define NH_STATUS_BETA 2 /* BETA testing */
|
||||
#define NH_STATUS_RELEASED 0 /* Released */
|
||||
#define NH_STATUS_WIP 1 /* Work in progress */
|
||||
#define NH_STATUS_BETA 2 /* BETA testing */
|
||||
#define NH_STATUS_POSTRELEASE 3 /* patch commit point only */
|
||||
|
||||
/*
|
||||
* Development status of this NetHack version.
|
||||
@@ -46,7 +47,7 @@
|
||||
#define ENGRAVEFILE "engrave" /* random engravings on the floor */
|
||||
#define BOGUSMONFILE "bogusmon" /* hallucinatory monsters */
|
||||
#define TRIBUTEFILE "tribute" /* 3.6 tribute to Terry Pratchett */
|
||||
#define LEV_EXT ".lev" /* extension for special level files */
|
||||
#define LEV_EXT ".lua" /* extension for special level files */
|
||||
|
||||
/* Assorted definitions that may depend on selections in config.h. */
|
||||
|
||||
@@ -70,9 +71,10 @@
|
||||
* since otherwise comparisons with signed quantities are done incorrectly
|
||||
*/
|
||||
typedef schar xchar;
|
||||
#if defined(__GNUC__) && defined(WIN32) && defined(__cplusplus)
|
||||
|
||||
#ifdef __MINGW32__
|
||||
/* Resolve conflict with Qt 5 and MinGW-w32 */
|
||||
typedef uchar boolean; /* 0 or 1 */
|
||||
typedef unsigned char boolean; /* 0 or 1 */
|
||||
#else
|
||||
#ifndef SKIP_BOOLEAN
|
||||
typedef xchar boolean; /* 0 or 1 */
|
||||
@@ -123,6 +125,41 @@ typedef uchar nhsym;
|
||||
#define LARGEST_INT 32767
|
||||
|
||||
#include "coord.h"
|
||||
|
||||
#if defined(CROSSCOMPILE)
|
||||
struct cross_target_s {
|
||||
const char *build_date;
|
||||
const char *copyright_banner_c;
|
||||
const char *git_sha;
|
||||
const char *git_branch;
|
||||
const char *version_string;
|
||||
const char *version_id;
|
||||
unsigned long version_number;
|
||||
unsigned long version_features;
|
||||
unsigned long ignored_features;
|
||||
unsigned long version_sanity1;
|
||||
unsigned long version_sanity2;
|
||||
unsigned long version_sanity3;
|
||||
unsigned long build_time;
|
||||
};
|
||||
extern struct cross_target_s cross_target;
|
||||
#if defined(CROSSCOMPILE_TARGET) && !defined(MAKEDEFS_C)
|
||||
#define BUILD_DATE cross_target.build_date /* "Wed Apr 1 00:00:01 2020" */
|
||||
#define COPYRIGHT_BANNER_C cross_target.copyright_banner_c
|
||||
#define NETHACK_GIT_SHA cross_target.git_sha
|
||||
#define NETHACK_GIT_BRANCH cross_target.git_branch
|
||||
#define VERSION_ID cross_target.version_id
|
||||
#define IGNORED_FEATURES cross_target.ignored_features
|
||||
#define VERSION_FEATURES cross_target.version_features
|
||||
#define VERSION_NUMBER cross_target.version_number
|
||||
#define VERSION_SANITY1 cross_target.version_sanity1
|
||||
#define VERSION_SANITY2 cross_target.version_sanity2
|
||||
#define VERSION_SANITY3 cross_target.version_sanity3
|
||||
#define VERSION_STRING cross_target.version_string
|
||||
#define BUILD_TIME cross_target.build_time /* (1574157640UL) */
|
||||
#endif /* CROSSCOMPILE_TARGET && !MAKEDEFS_C */
|
||||
#endif /* CROSSCOMPILE */
|
||||
|
||||
/*
|
||||
* Automatic inclusions for the subsidiary files.
|
||||
* Please don't change the order. It does matter.
|
||||
@@ -351,6 +388,14 @@ struct savefile_info {
|
||||
#define MAXMONNO 120 /* extinct monst after this number created */
|
||||
#define MHPMAX 500 /* maximum monster hp */
|
||||
|
||||
/*
|
||||
* Version 3.7.x has aspirations of portable file formats. We
|
||||
* make a distinction between MAIL functionality and MAIL_STRUCTURES
|
||||
* so that the underlying structures are consistent, whether MAIL is
|
||||
* defined or not.
|
||||
*/
|
||||
#define MAIL_STRUCTURES
|
||||
|
||||
/* PANICTRACE: Always defined for NH_DEVEL_STATUS != NH_STATUS_RELEASED
|
||||
but only for supported platforms. */
|
||||
#ifdef UNIX
|
||||
|
||||
@@ -78,6 +78,10 @@ enum dismount_types {
|
||||
DISMOUNT_BYCHOICE = 6
|
||||
};
|
||||
|
||||
/* mgflags for mapglyph() */
|
||||
#define MG_FLAG_NORMAL 0x00
|
||||
#define MG_FLAG_NOOVERRIDE 0x01
|
||||
|
||||
/* Special returns from mapglyph() */
|
||||
#define MG_CORPSE 0x01
|
||||
#define MG_INVIS 0x02
|
||||
@@ -198,7 +202,6 @@ typedef struct {
|
||||
#include "context.h"
|
||||
#include "rm.h"
|
||||
#include "botl.h"
|
||||
#include "qtext.h"
|
||||
|
||||
/* Symbol offsets */
|
||||
#define SYM_OFF_P (0)
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
/* NetHack 3.6 lev.h $NHDT-Date: 1432512781 2015/05/25 00:13:01 $ $NHDT-Branch: master $:$NHDT-Revision: 1.12 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/*-Copyright (c) Michael Allison, 2006. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
/* Common include file for save and restore routines */
|
||||
|
||||
#ifndef LEV_H
|
||||
#define LEV_H
|
||||
|
||||
|
||||
#endif /* LEV_H */
|
||||
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 mextra.h $NHDT-Date: 1547428759 2019/01/14 01:19:19 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.22 $ */
|
||||
/* NetHack 3.6 mextra.h $NHDT-Date: 1574722861 2019/11/25 23:01:01 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.24 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/*-Copyright (c) Michael Allison, 2006. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -179,7 +179,9 @@ struct mextra {
|
||||
struct eshk *eshk;
|
||||
struct emin *emin;
|
||||
struct edog *edog;
|
||||
int mcorpsenm; /* obj->corpsenm for mimic posing as statue or corpse */
|
||||
int mcorpsenm; /* obj->corpsenm for mimic posing as statue or corpse,
|
||||
* obj->spe (fruit index) for one posing as a slime mold,
|
||||
* or an alignment mask for one posing as an altar */
|
||||
};
|
||||
|
||||
#define MNAME(mon) ((mon)->mextra->mname)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 mondata.h $NHDT-Date: 1550524558 2019/02/18 21:15:58 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.37 $ */
|
||||
/* NetHack 3.6 mondata.h $NHDT-Date: 1576626512 2019/12/17 23:48:32 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.39 $ */
|
||||
/* Copyright (c) 1989 Mike Threepoint */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
(is_minion((mon)->data) && mon_aligntyp(mon) == A_LAWFUL)
|
||||
#define is_flyer(ptr) (((ptr)->mflags1 & M1_FLY) != 0L)
|
||||
#define is_floater(ptr) ((ptr)->mlet == S_EYE || (ptr)->mlet == S_LIGHT)
|
||||
/* clinger: piercers, mimics, wumpus -- generally don't fall down holes */
|
||||
#define is_clinger(ptr) (((ptr)->mflags1 & M1_CLING) != 0L)
|
||||
#define is_swimmer(ptr) (((ptr)->mflags1 & M1_SWIM) != 0L)
|
||||
#define breathless(ptr) (((ptr)->mflags1 & M1_BREATHLESS) != 0L)
|
||||
@@ -41,14 +42,24 @@
|
||||
#define noncorporeal(ptr) ((ptr)->mlet == S_GHOST)
|
||||
#define tunnels(ptr) (((ptr)->mflags1 & M1_TUNNEL) != 0L)
|
||||
#define needspick(ptr) (((ptr)->mflags1 & M1_NEEDPICK) != 0L)
|
||||
/* hides_under() requires an object at the location in order to hide */
|
||||
#define hides_under(ptr) (((ptr)->mflags1 & M1_CONCEAL) != 0L)
|
||||
/* is_hider() is True for mimics but when hiding they appear as something
|
||||
else rather than become mon->mundetected, so use is_hider() with care */
|
||||
#define is_hider(ptr) (((ptr)->mflags1 & M1_HIDE) != 0L)
|
||||
/* piercers cling to the ceiling; lurkers above are hiders but they fly
|
||||
so aren't classified as clingers; unfortunately mimics are classified
|
||||
as both hiders and clingers but have nothing to do with ceilings;
|
||||
wumpuses (not wumpi :-) cling but aren't hiders */
|
||||
#define ceiling_hider(ptr) \
|
||||
(is_hider(ptr) && ((is_clinger(ptr) && (ptr)->mlet != S_MIMIC) \
|
||||
|| is_flyer(ptr))) /* lurker above */
|
||||
#define haseyes(ptr) (((ptr)->mflags1 & M1_NOEYES) == 0L)
|
||||
#define eyecount(ptr) \
|
||||
(!haseyes(ptr) ? 0 : ((ptr) == &mons[PM_CYCLOPS] \
|
||||
|| (ptr) == &mons[PM_FLOATING_EYE]) \
|
||||
? 1 \
|
||||
: 2)
|
||||
/* used to decide whether plural applies so no need for 'more than 2' */
|
||||
#define eyecount(ptr) \
|
||||
(!haseyes(ptr) ? 0 \
|
||||
: ((ptr) == &mons[PM_CYCLOPS] || (ptr) == &mons[PM_FLOATING_EYE]) ? 1 \
|
||||
: 2)
|
||||
#define nohands(ptr) (((ptr)->mflags1 & M1_NOHANDS) != 0L)
|
||||
#define nolimbs(ptr) (((ptr)->mflags1 & M1_NOLIMBS) == M1_NOLIMBS)
|
||||
#define notake(ptr) (((ptr)->mflags1 & M1_NOTAKE) != 0L)
|
||||
|
||||
@@ -159,8 +159,9 @@ struct monst {
|
||||
|
||||
long mtrapseen; /* bitmap of traps we've been trapped in */
|
||||
long mlstmv; /* for catching up with lost time */
|
||||
long mstate; /* debugging info on monsters stored here */
|
||||
long migflags; /* migrating flags */
|
||||
long mspare1;
|
||||
#define mstate mspare1 /* only for debug exam right now, not code flow */
|
||||
struct obj *minvent; /* mon's inventory */
|
||||
struct obj *mw; /* mon's weapon */
|
||||
long misc_worn_check; /* mon's wornmask */
|
||||
|
||||
@@ -32,7 +32,9 @@
|
||||
|
||||
/*#define CHANGE_COLOR*/ /* allow palette changes */
|
||||
#define SELECTSAVED /* Provide menu of saved games to choose from at start */
|
||||
|
||||
|
||||
#define QWERTZ_SUPPORT /* when swap_yz is True, numpad 7 is 'z' not 'y' */
|
||||
|
||||
/*
|
||||
* -----------------------------------------------------------------
|
||||
* The remaining code shouldn't need modification.
|
||||
@@ -78,7 +80,12 @@
|
||||
* objects being thrown when the hangup occurs. \
|
||||
*/
|
||||
|
||||
#define MAIL
|
||||
#define CONFIG_FILE ".nethackrc"
|
||||
#define CONFIG_TEMPLATE ".nethackrc.template"
|
||||
#define SYSCF_TEMPLATE "sysconf.template"
|
||||
#define SYMBOLS_TEMPLATE "symbols.template"
|
||||
#define GUIDEBOOK_FILE "Guidebook.txt"
|
||||
|
||||
/* Stuff to help the user with some common, yet significant errors */
|
||||
#define INTERJECT_PANIC 0
|
||||
#define INTERJECTION_TYPES (INTERJECT_PANIC + 1)
|
||||
@@ -99,7 +106,7 @@ extern void FDECL(interject, (int));
|
||||
#ifdef strcasecmp
|
||||
#undef strcasecmp
|
||||
#endif
|
||||
extern void NDECL(getlock);
|
||||
/* extern int NDECL(getlock); */
|
||||
#endif
|
||||
|
||||
#ifdef _MSC_VER
|
||||
@@ -284,4 +291,9 @@ extern void FDECL(nhassert_failed, (const char * exp, const char * file,
|
||||
#define nethack_enter(argc, argv) nethack_enter_winnt()
|
||||
extern void FDECL(nethack_exit, (int)) NORETURN;
|
||||
extern boolean FDECL(file_exists, (const char *));
|
||||
extern boolean FDECL(file_newer, (const char *, const char *));
|
||||
#ifndef SYSTEM_H
|
||||
#include "system.h"
|
||||
#endif
|
||||
|
||||
#endif /* NTCONF_H */
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.7 patchlevel.h $NHDT-Date: 1557510467 2019/05/10 17:47:47 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.127 $ */
|
||||
/* NetHack 3.7 patchlevel.h $NHDT-Date: 1575775596 2019/12/08 03:26:36 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.136 $ */
|
||||
/* 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 0
|
||||
#define EDITLEVEL 3
|
||||
|
||||
#define COPYRIGHT_BANNER_A "NetHack, Copyright 1985-2019"
|
||||
#define COPYRIGHT_BANNER_B \
|
||||
@@ -33,16 +33,82 @@
|
||||
*/
|
||||
#define VERSION_COMPATIBILITY 0x03070000L
|
||||
|
||||
/****************************************************************************/
|
||||
/* Version 3.7.x */
|
||||
|
||||
/*
|
||||
* NetHack 3.7.0, <insert date here>
|
||||
*
|
||||
*/
|
||||
|
||||
/****************************************************************************/
|
||||
/* Version 3.6.x */
|
||||
|
||||
/* Patch 3, <insert date here>
|
||||
*
|
||||
/* Patch 4, December 18, 2019
|
||||
*
|
||||
* fix potential buffer overflow when parsing run-time configuration file
|
||||
* GDBPATH and GREPPATH from sysconf or -D... on compilation command line were
|
||||
* being processed even if PANICTRACE was disabled but only being freed
|
||||
* at end of game when that was enabled
|
||||
* fix the article used in the message when your steed encounters a polymorph
|
||||
* trap
|
||||
* allow teleporting onto the vibrating square
|
||||
* message "your knapsack can't accomodate any more items" when picking stuff
|
||||
* up or removing such from container was inaccurate if there was some
|
||||
* gold pending; vary the message rather than add more convoluted pickup
|
||||
* code
|
||||
* dozen-ish assorted spelling/typo fixes in messages and source comments
|
||||
* wizard mode wishing for terrain would leave it unmapped if done while blind
|
||||
* wizard mode terrain wish could leave hero in water (severe vision limits)
|
||||
* or in lava (trapped, sinking) which wasn't there any more
|
||||
* flying hero can go down (via '>') holes or trap doors instead of escaping
|
||||
* trap
|
||||
* polymorphed hero hiding on the ceiling can now use '>' to unhide instead of
|
||||
* being told "you can't go down here"
|
||||
* fix compilation on platforms that split the ncurses and tinfo libraries
|
||||
* Windows: allow all game files to be on a portable device via the sysconf
|
||||
* option 'portable_device_paths'
|
||||
*/
|
||||
|
||||
/* Patch 3, December 5, 2019
|
||||
*
|
||||
* Fixed stale 'thrownobj' pointer for returning thrown aklys while engulfed
|
||||
* Fixed uarmh null pointer dereference if a helm of opposite alignment came
|
||||
* off due to being polymorphed
|
||||
* Fixed 'object lost' panic when attempting to crawl of of the water during
|
||||
* emergency disrobing/dropping
|
||||
* Running now stops when moving over engravings so you can tell where they are
|
||||
* Fixed detection of unseen/secret doors which failed to find monsters hiding
|
||||
* under objects and failed to find monsters hiding at trap locations
|
||||
* Ensured fatal status conditions made it to disclosure and/or dumplog
|
||||
* Fixed "Bad fruit #N" warnings when saving bones with 'perm_invent' On
|
||||
* Fixed it so yellow dragons don't have green breath
|
||||
* Added several grammar corrections
|
||||
* Improved recognition of deafness for several situations including the
|
||||
* playing of musical instruments and bribing negotiations with demon lords
|
||||
* Fixed ignoring of god's wrath when hero injured himself during altar kick
|
||||
* Fixed several cases where persistent inventory window was not updated
|
||||
* Fixed temple priests or shopkeepers moving over other monsters
|
||||
* Fixed a crash-causing bug when putting on levitation boots over a sink
|
||||
* Ensured that thrown or kicked objects will end up in bones
|
||||
* Made water go all the way to the edges of level on the Plane of Water
|
||||
* Made clouds disrupt line of sight along the edges of the Plane of Air
|
||||
* Improved and expanded usage of status highlighting percentage rules
|
||||
* Added more than 15 improvements and fixes to the curses window port
|
||||
* Added and documented significant changes to default directory choices for
|
||||
* the Windows platform
|
||||
* Improved the layout and display of the player selection dialog used on the
|
||||
* Windows graphical implementation
|
||||
* Improved performance of some tty versions by reducing the number of
|
||||
* function calls made from mapglyph
|
||||
* Allowed the msdos implementation to build with curses and PDCurses
|
||||
* Included over 100 other fixes and improvements as outlined in doc/fixes36.3
|
||||
*/
|
||||
|
||||
/* Patch 2, May 7, 2019
|
||||
*
|
||||
* Over 320 bug fixes including a couple of crash bug fixes
|
||||
*
|
||||
* Over 320 bug fixes including a couple of crash bug fixes as outlined in
|
||||
* doc/fixes36.2
|
||||
* More than 15 enhancements or improvements
|
||||
* Ensuring that unix Makefiles do not rely on features unique to gnu make
|
||||
* Improvements to hilite_status parsing in an effort to ensure that expected
|
||||
@@ -54,13 +120,15 @@
|
||||
*/
|
||||
|
||||
/* Patch 1, April 27, 2018
|
||||
* Over four hundred and seventy bug fixes and improvements.
|
||||
*
|
||||
* Over four hundred and seventy bug fixes and improvements as outlined in
|
||||
* doc/fixes36.1
|
||||
*/
|
||||
|
||||
/*
|
||||
* NetHack 3.6.0, December 7, 2015
|
||||
*
|
||||
* Hundreds of bug fixes.
|
||||
* Hundreds of bug fixes as outlined in doc/fixes36.0.
|
||||
* Some code reorganization.
|
||||
* Some new features.
|
||||
* Variations of some community patches rolled in.
|
||||
|
||||
@@ -21,6 +21,9 @@
|
||||
* Note: 3.6.x was not verified with Symantec C.
|
||||
*/
|
||||
|
||||
#define CONFIG_FILE "defaults.nh"
|
||||
#define GUIDEBOOK_FILE "Guidebook.txt"
|
||||
|
||||
/*
|
||||
* The following options are somewhat configurable depending on
|
||||
* your compiler.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 prop.h $NHDT-Date: 1547514641 2019/01/15 01:10:41 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.20 $ */
|
||||
/* NetHack 3.6 prop.h $NHDT-Date: 1570566360 2019/10/08 20:26:00 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.21 $ */
|
||||
/* Copyright (c) 1989 Mike Threepoint */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -106,7 +106,7 @@ struct prop {
|
||||
#define W_WEP 0x00000100L /* Wielded weapon */
|
||||
#define W_QUIVER 0x00000200L /* Quiver for (f)iring ammo */
|
||||
#define W_SWAPWEP 0x00000400L /* Secondary weapon */
|
||||
#define W_WEAPON (W_WEP | W_SWAPWEP | W_QUIVER)
|
||||
#define W_WEAPONS (W_WEP | W_SWAPWEP | W_QUIVER)
|
||||
#define W_ART 0x00001000L /* Carrying artifact (not really worn) */
|
||||
#define W_ARTI 0x00002000L /* Invoked artifact (not really worn) */
|
||||
/* Amulets, rings, tools, and other items */
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
/* NetHack 3.6 qt_clust.h $NHDT-Date: 1432512779 2015/05/25 00:12:59 $ $NHDT-Branch: master $:$NHDT-Revision: 1.8 $ */
|
||||
/* Copyright (c) Warwick Allison, 1999. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
#ifndef clusterizer_H
|
||||
#define clusterizer_H
|
||||
|
||||
#include <qrect.h>
|
||||
|
||||
class Clusterizer
|
||||
{
|
||||
public:
|
||||
Clusterizer(int maxclusters);
|
||||
~Clusterizer();
|
||||
|
||||
void add(int x, int y); // 1x1 rectangle (point)
|
||||
void add(int x, int y, int w, int h);
|
||||
void add(const QRect &rect);
|
||||
|
||||
void clear();
|
||||
int
|
||||
clusters()
|
||||
{
|
||||
return count;
|
||||
}
|
||||
const QRect &operator[](int i);
|
||||
|
||||
private:
|
||||
QRect *cluster;
|
||||
int count;
|
||||
const int max;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,11 +0,0 @@
|
||||
/* NetHack 3.6 qt_kde0.h $NHDT-Date: 1432512779 2015/05/25 00:12:59 $ $NHDT-Branch: master $:$NHDT-Revision: 1.8 $ */
|
||||
/* Copyright (c) Warwick Allison, 1999. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
#ifndef QT_DUMMYKDE
|
||||
#define QT_DUMMYKDE
|
||||
class KTopLevelWidget : public QMainWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
};
|
||||
#endif
|
||||
890
include/qt_win.h
890
include/qt_win.h
@@ -1,890 +0,0 @@
|
||||
// NetHack 3.6 qt_win.h $NHDT-Date: 1447755972 2015/11/17 10:26:12 $ $NHDT-Branch: master $:$NHDT-Revision: 1.17 $
|
||||
// Copyright (c) Warwick Allison, 1999.
|
||||
// NetHack may be freely redistributed. See license for details.
|
||||
//
|
||||
// Qt Binding for NetHack 3.4
|
||||
//
|
||||
// Unfortunately, this doesn't use Qt as well as I would like,
|
||||
// primarily because NetHack is fundamentally a getkey-type
|
||||
// program rather than being event driven (hence the ugly key
|
||||
// and click buffer rather), but also because this is my first
|
||||
// major application of Qt.
|
||||
//
|
||||
|
||||
#ifndef qt_win_h
|
||||
#define qt_win_h
|
||||
|
||||
#define QT_CLEAN_NAMESPACE
|
||||
|
||||
#include <qdialog.h>
|
||||
#include <qpushbutton.h>
|
||||
#include <qbuttongroup.h>
|
||||
#include <qlabel.h>
|
||||
#include <qlineedit.h>
|
||||
#if defined(QWS)
|
||||
#include <qpe/qpeapplication.h>
|
||||
#else
|
||||
#include <qapplication.h>
|
||||
#endif
|
||||
#include <qspinbox.h>
|
||||
#include <qcheckbox.h>
|
||||
#include <qfile.h>
|
||||
#include <qlistbox.h>
|
||||
#include <qlistview.h>
|
||||
#include <qmessagebox.h>
|
||||
#include <qpixmap.h>
|
||||
#include <qimage.h>
|
||||
#include <qarray.h>
|
||||
#include <qcombobox.h>
|
||||
#include <qscrollview.h>
|
||||
#if QT_VERSION >= 300
|
||||
#include <qttableview.h>
|
||||
// Should stop using QTableView
|
||||
#define QTableView QtTableView
|
||||
#else
|
||||
#include <qtableview.h>
|
||||
#endif
|
||||
#include <qmainwindow.h>
|
||||
#include <qwidgetstack.h>
|
||||
|
||||
#ifdef KDE
|
||||
#include <kapp.h>
|
||||
#include <ktopwidget.h>
|
||||
#endif
|
||||
|
||||
#include "qt_clust.h"
|
||||
|
||||
class QVBox;
|
||||
class QMenuBar;
|
||||
class QRadioButton;
|
||||
class NhPSListView;
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
//
|
||||
// The beautiful, abstracted and well-modelled classes...
|
||||
//
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
class NetHackQtGlyphs;
|
||||
|
||||
class NetHackQtLineEdit : public QLineEdit
|
||||
{
|
||||
public:
|
||||
NetHackQtLineEdit();
|
||||
NetHackQtLineEdit(QWidget *parent, const char *name);
|
||||
|
||||
void fakeEvent(int key, int ascii, int state);
|
||||
};
|
||||
|
||||
class NetHackQtSettings : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
// Size of window - used to decide default sizes
|
||||
NetHackQtSettings(int width, int height);
|
||||
|
||||
NetHackQtGlyphs &glyphs();
|
||||
const QFont &normalFont();
|
||||
const QFont &normalFixedFont();
|
||||
const QFont &largeFont();
|
||||
|
||||
bool ynInMessages();
|
||||
|
||||
signals:
|
||||
void fontChanged();
|
||||
void tilesChanged();
|
||||
|
||||
public slots:
|
||||
void toggleGlyphSize();
|
||||
void setGlyphSize(bool);
|
||||
|
||||
private:
|
||||
QSpinBox tilewidth;
|
||||
QSpinBox tileheight;
|
||||
QLabel widthlbl;
|
||||
QLabel heightlbl;
|
||||
QCheckBox whichsize;
|
||||
QSize othersize;
|
||||
|
||||
QComboBox fontsize;
|
||||
|
||||
QFont normal, normalfixed, large;
|
||||
|
||||
NetHackQtGlyphs *theglyphs;
|
||||
|
||||
private slots:
|
||||
void resizeTiles();
|
||||
};
|
||||
|
||||
class NetHackQtKeyBuffer
|
||||
{
|
||||
public:
|
||||
NetHackQtKeyBuffer();
|
||||
|
||||
bool Empty() const;
|
||||
bool Full() const;
|
||||
|
||||
void Put(int k, int ascii, int state);
|
||||
void Put(char a);
|
||||
void Put(const char *str);
|
||||
int GetKey();
|
||||
int GetAscii();
|
||||
int GetState();
|
||||
|
||||
int TopKey() const;
|
||||
int TopAscii() const;
|
||||
int TopState() const;
|
||||
|
||||
private:
|
||||
enum { maxkey = 64 };
|
||||
int key[maxkey];
|
||||
int ascii[maxkey];
|
||||
int state[maxkey];
|
||||
int in, out;
|
||||
};
|
||||
|
||||
class NetHackQtClickBuffer
|
||||
{
|
||||
public:
|
||||
NetHackQtClickBuffer();
|
||||
|
||||
bool Empty() const;
|
||||
bool Full() const;
|
||||
|
||||
void Put(int x, int y, int mod);
|
||||
|
||||
int NextX() const;
|
||||
int NextY() const;
|
||||
int NextMod() const;
|
||||
|
||||
void Get();
|
||||
|
||||
private:
|
||||
enum { maxclick = 64 };
|
||||
struct ClickRec {
|
||||
int x, y, mod;
|
||||
} click[maxclick];
|
||||
int in, out;
|
||||
};
|
||||
|
||||
class NetHackQtSavedGameSelector : public QDialog
|
||||
{
|
||||
public:
|
||||
NetHackQtSavedGameSelector(const char **saved);
|
||||
|
||||
int choose();
|
||||
};
|
||||
|
||||
class NetHackQtPlayerSelector : private QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
enum { R_None = -1, R_Quit = -2, R_Rand = -3 };
|
||||
|
||||
NetHackQtPlayerSelector(NetHackQtKeyBuffer &);
|
||||
|
||||
protected:
|
||||
virtual void done(int);
|
||||
|
||||
public slots:
|
||||
void Quit();
|
||||
void Random();
|
||||
|
||||
void selectName(const QString &n);
|
||||
void selectRole();
|
||||
void selectRace();
|
||||
void setupOthers();
|
||||
void selectGender(int);
|
||||
void selectAlignment(int);
|
||||
|
||||
public:
|
||||
bool Choose();
|
||||
|
||||
private:
|
||||
NetHackQtKeyBuffer &keysource;
|
||||
NhPSListView *role;
|
||||
NhPSListView *race;
|
||||
QRadioButton **gender;
|
||||
QRadioButton **alignment;
|
||||
bool fully_specified_role;
|
||||
};
|
||||
|
||||
class NetHackQtStringRequestor : QDialog
|
||||
{
|
||||
private:
|
||||
QLabel prompt;
|
||||
NetHackQtLineEdit input;
|
||||
QPushButton *okay;
|
||||
QPushButton *cancel;
|
||||
NetHackQtKeyBuffer &keysource;
|
||||
|
||||
virtual void done(int);
|
||||
|
||||
public:
|
||||
NetHackQtStringRequestor(NetHackQtKeyBuffer &, const char *p,
|
||||
const char *cancelstr = "Cancel");
|
||||
void SetDefault(const char *);
|
||||
bool Get(char *buffer, int maxchar = 80);
|
||||
virtual void resizeEvent(QResizeEvent *);
|
||||
};
|
||||
|
||||
class NetHackQtExtCmdRequestor : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
NetHackQtKeyBuffer &keysource;
|
||||
|
||||
public:
|
||||
NetHackQtExtCmdRequestor(NetHackQtKeyBuffer &ks);
|
||||
int get();
|
||||
|
||||
private slots:
|
||||
void cancel();
|
||||
void done(int i);
|
||||
};
|
||||
|
||||
class NetHackQtWindow
|
||||
{
|
||||
public:
|
||||
NetHackQtWindow();
|
||||
virtual ~NetHackQtWindow();
|
||||
|
||||
virtual QWidget *Widget() = 0;
|
||||
|
||||
virtual void Clear();
|
||||
virtual void Display(bool block);
|
||||
virtual bool Destroy();
|
||||
virtual void CursorTo(int x, int y);
|
||||
virtual void PutStr(int attr, const char *text);
|
||||
virtual void StartMenu();
|
||||
virtual void AddMenu(int glyph, const ANY_P *identifier, char ch,
|
||||
char gch, int attr, const char *str, bool presel);
|
||||
virtual void EndMenu(const char *prompt);
|
||||
virtual int SelectMenu(int how, MENU_ITEM_P **menu_list);
|
||||
virtual void ClipAround(int x, int y);
|
||||
virtual void PrintGlyph(int x, int y, int glyph);
|
||||
virtual void UseRIP(int how, time_t when);
|
||||
|
||||
int nhid;
|
||||
};
|
||||
|
||||
class NetHackQtGlyphs
|
||||
{
|
||||
public:
|
||||
NetHackQtGlyphs();
|
||||
|
||||
int
|
||||
width() const
|
||||
{
|
||||
return size.width();
|
||||
}
|
||||
int
|
||||
height() const
|
||||
{
|
||||
return size.height();
|
||||
}
|
||||
void toggleSize();
|
||||
void setSize(int w, int h);
|
||||
|
||||
void drawGlyph(QPainter &, int glyph, int pixelx, int pixely);
|
||||
void drawCell(QPainter &, int glyph, int cellx, int celly);
|
||||
|
||||
private:
|
||||
QImage img;
|
||||
QPixmap pm, pm1, pm2;
|
||||
QSize size;
|
||||
int tiles_per_row;
|
||||
};
|
||||
|
||||
class BlackScrollView : public QScrollView
|
||||
{
|
||||
public:
|
||||
BlackScrollView()
|
||||
{
|
||||
viewport()->setBackgroundColor(black);
|
||||
}
|
||||
};
|
||||
|
||||
class NetHackQtMapWindow : public QWidget, public NetHackQtWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
private:
|
||||
NetHackQtClickBuffer &clicksink;
|
||||
unsigned short glyph[ROWNO][COLNO];
|
||||
unsigned short &
|
||||
Glyph(int x, int y)
|
||||
{
|
||||
return glyph[y][x];
|
||||
}
|
||||
QPoint cursor;
|
||||
BlackScrollView viewport;
|
||||
QPixmap pet_annotation;
|
||||
Clusterizer change;
|
||||
QFont *rogue_font;
|
||||
QString messages;
|
||||
QRect messages_rect;
|
||||
|
||||
void Changed(int x, int y);
|
||||
|
||||
signals:
|
||||
void resized();
|
||||
|
||||
private slots:
|
||||
void updateTiles();
|
||||
void moveMessages(int x, int y);
|
||||
#ifdef SAFERHANGUP
|
||||
void timeout();
|
||||
#endif
|
||||
|
||||
protected:
|
||||
virtual void paintEvent(QPaintEvent *);
|
||||
virtual void mousePressEvent(QMouseEvent *);
|
||||
|
||||
public:
|
||||
NetHackQtMapWindow(NetHackQtClickBuffer &click_sink);
|
||||
~NetHackQtMapWindow();
|
||||
|
||||
virtual QWidget *Widget();
|
||||
virtual bool Destroy();
|
||||
|
||||
virtual void Clear();
|
||||
virtual void Display(bool block);
|
||||
virtual void CursorTo(int x, int y);
|
||||
virtual void PutStr(int attr, const char *text);
|
||||
virtual void ClipAround(int x, int y);
|
||||
virtual void PrintGlyph(int x, int y, int glyph);
|
||||
|
||||
void Scroll(int dx, int dy);
|
||||
|
||||
// For messages
|
||||
void displayMessages(bool block);
|
||||
void putMessage(int attr, const char *text);
|
||||
void clearMessages();
|
||||
|
||||
void clickCursor();
|
||||
};
|
||||
|
||||
class NetHackQtScrollText;
|
||||
class NetHackQtMessageWindow : QObject, public NetHackQtWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
NetHackQtMessageWindow();
|
||||
~NetHackQtMessageWindow();
|
||||
|
||||
virtual QWidget *Widget();
|
||||
virtual void Clear();
|
||||
virtual void Display(bool block);
|
||||
virtual void PutStr(int attr, const char *text);
|
||||
|
||||
void Scroll(int dx, int dy);
|
||||
|
||||
void setMap(NetHackQtMapWindow *);
|
||||
|
||||
private:
|
||||
NetHackQtScrollText *list;
|
||||
bool changed;
|
||||
NetHackQtMapWindow *map;
|
||||
|
||||
private slots:
|
||||
void updateFont();
|
||||
};
|
||||
|
||||
class NetHackQtLabelledIcon : public QWidget
|
||||
{
|
||||
public:
|
||||
NetHackQtLabelledIcon(QWidget *parent, const char *label);
|
||||
NetHackQtLabelledIcon(QWidget *parent, const char *label,
|
||||
const QPixmap &icon);
|
||||
|
||||
enum { NoNum = -99999 };
|
||||
void setLabel(const char *, bool lower = TRUE); // a string
|
||||
void setLabel(const char *, long, const char *tail = ""); // a number
|
||||
void setLabel(const char *, long show_value, long comparative_value,
|
||||
const char *tail = "");
|
||||
void setIcon(const QPixmap &);
|
||||
virtual void setFont(const QFont &);
|
||||
|
||||
void highlightWhenChanging();
|
||||
void lowIsGood();
|
||||
void dissipateHighlight();
|
||||
|
||||
virtual void show();
|
||||
|
||||
protected:
|
||||
void resizeEvent(QResizeEvent *);
|
||||
|
||||
private:
|
||||
void initHighlight();
|
||||
void setAlignments();
|
||||
void highlight(const QPalette &highlight);
|
||||
void unhighlight();
|
||||
|
||||
bool low_is_good;
|
||||
int prev_value;
|
||||
int turn_count; /* last time the value changed */
|
||||
QPalette hl_good;
|
||||
QPalette hl_bad;
|
||||
|
||||
QLabel *label;
|
||||
QLabel *icon;
|
||||
};
|
||||
|
||||
class NetHackQtStatusWindow : QWidget, public NetHackQtWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
NetHackQtStatusWindow();
|
||||
|
||||
virtual QWidget *Widget();
|
||||
|
||||
virtual void Clear();
|
||||
virtual void Display(bool block);
|
||||
virtual void CursorTo(int x, int y);
|
||||
virtual void PutStr(int attr, const char *text);
|
||||
|
||||
void fadeHighlighting();
|
||||
|
||||
protected:
|
||||
void resizeEvent(QResizeEvent *);
|
||||
|
||||
private slots:
|
||||
void doUpdate();
|
||||
|
||||
private:
|
||||
enum { hilight_time = 1 };
|
||||
|
||||
QPixmap p_str;
|
||||
QPixmap p_dex;
|
||||
QPixmap p_con;
|
||||
QPixmap p_int;
|
||||
QPixmap p_wis;
|
||||
QPixmap p_cha;
|
||||
|
||||
QPixmap p_chaotic;
|
||||
QPixmap p_neutral;
|
||||
QPixmap p_lawful;
|
||||
|
||||
QPixmap p_satiated;
|
||||
QPixmap p_hungry;
|
||||
|
||||
QPixmap p_confused;
|
||||
QPixmap p_sick_fp;
|
||||
QPixmap p_sick_il;
|
||||
QPixmap p_blind;
|
||||
QPixmap p_stunned;
|
||||
QPixmap p_hallu;
|
||||
|
||||
QPixmap p_encumber[5];
|
||||
|
||||
NetHackQtLabelledIcon name;
|
||||
NetHackQtLabelledIcon dlevel;
|
||||
|
||||
NetHackQtLabelledIcon str;
|
||||
NetHackQtLabelledIcon dex;
|
||||
NetHackQtLabelledIcon con;
|
||||
NetHackQtLabelledIcon intel;
|
||||
NetHackQtLabelledIcon wis;
|
||||
NetHackQtLabelledIcon cha;
|
||||
|
||||
NetHackQtLabelledIcon gold;
|
||||
NetHackQtLabelledIcon hp;
|
||||
NetHackQtLabelledIcon power;
|
||||
NetHackQtLabelledIcon ac;
|
||||
NetHackQtLabelledIcon level;
|
||||
NetHackQtLabelledIcon exp;
|
||||
NetHackQtLabelledIcon align;
|
||||
|
||||
NetHackQtLabelledIcon time;
|
||||
NetHackQtLabelledIcon score;
|
||||
|
||||
NetHackQtLabelledIcon hunger;
|
||||
NetHackQtLabelledIcon confused;
|
||||
NetHackQtLabelledIcon sick_fp;
|
||||
NetHackQtLabelledIcon sick_il;
|
||||
NetHackQtLabelledIcon blind;
|
||||
NetHackQtLabelledIcon stunned;
|
||||
NetHackQtLabelledIcon hallu;
|
||||
NetHackQtLabelledIcon encumber;
|
||||
|
||||
QFrame hline1;
|
||||
QFrame hline2;
|
||||
QFrame hline3;
|
||||
|
||||
int cursy;
|
||||
|
||||
bool first_set;
|
||||
|
||||
void nullOut();
|
||||
void updateStats();
|
||||
void checkTurnEvents();
|
||||
};
|
||||
|
||||
class NetHackQtMenuDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
NetHackQtMenuDialog();
|
||||
|
||||
void Accept();
|
||||
void Reject();
|
||||
void SetResult(int);
|
||||
|
||||
virtual void done(int);
|
||||
|
||||
protected:
|
||||
void resizeEvent(QResizeEvent *);
|
||||
|
||||
signals:
|
||||
void Resized();
|
||||
};
|
||||
|
||||
class NetHackQtMenuWindow : public QTableView, public NetHackQtWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
NetHackQtMenuWindow(NetHackQtKeyBuffer &);
|
||||
~NetHackQtMenuWindow();
|
||||
|
||||
virtual QWidget *Widget();
|
||||
|
||||
virtual void StartMenu();
|
||||
virtual void AddMenu(int glyph, const ANY_P *identifier, char ch,
|
||||
char gch, int attr, const char *str, bool presel);
|
||||
virtual void EndMenu(const char *prompt);
|
||||
virtual int SelectMenu(int how, MENU_ITEM_P **menu_list);
|
||||
|
||||
public slots:
|
||||
void All();
|
||||
void ChooseNone();
|
||||
void Invert();
|
||||
void Search();
|
||||
|
||||
void Layout();
|
||||
void ToggleSelect(int);
|
||||
|
||||
protected:
|
||||
virtual void keyPressEvent(QKeyEvent *);
|
||||
// virtual void mouseDoubleClickEvent(QMouseEvent*);
|
||||
virtual void mousePressEvent(QMouseEvent *);
|
||||
virtual void mouseReleaseEvent(QMouseEvent *);
|
||||
virtual void mouseMoveEvent(QMouseEvent *);
|
||||
virtual void focusOutEvent(QFocusEvent *);
|
||||
virtual void focusInEvent(QFocusEvent *);
|
||||
|
||||
virtual void paintCell(QPainter *, int, int);
|
||||
virtual int cellWidth(int col);
|
||||
|
||||
private:
|
||||
struct MenuItem {
|
||||
MenuItem();
|
||||
~MenuItem();
|
||||
|
||||
int glyph;
|
||||
ANY_P identifier;
|
||||
int attr;
|
||||
const char *str;
|
||||
int count;
|
||||
char ch;
|
||||
bool selected;
|
||||
|
||||
bool
|
||||
Selectable() const
|
||||
{
|
||||
return identifier.a_void != 0;
|
||||
}
|
||||
};
|
||||
|
||||
QArray<MenuItem> item;
|
||||
|
||||
int itemcount;
|
||||
int str_width;
|
||||
bool str_fixed;
|
||||
int next_accel;
|
||||
|
||||
NetHackQtKeyBuffer &keysource;
|
||||
|
||||
NetHackQtMenuDialog *dialog;
|
||||
|
||||
QPushButton *ok;
|
||||
QPushButton *cancel;
|
||||
QPushButton *all;
|
||||
QPushButton *none;
|
||||
QPushButton *invert;
|
||||
QPushButton *search;
|
||||
QLabel prompt;
|
||||
|
||||
int how;
|
||||
|
||||
bool has_glyphs;
|
||||
|
||||
int pressed;
|
||||
bool was_sel;
|
||||
};
|
||||
|
||||
class NetHackQtTextListBox;
|
||||
|
||||
class NetHackQtRIP : public QWidget
|
||||
{
|
||||
private:
|
||||
static QPixmap *pixmap;
|
||||
char **line;
|
||||
int riplines;
|
||||
|
||||
public:
|
||||
NetHackQtRIP(QWidget *parent);
|
||||
|
||||
void setLines(char **l, int n);
|
||||
|
||||
protected:
|
||||
virtual void paintEvent(QPaintEvent *event);
|
||||
QSize sizeHint() const;
|
||||
};
|
||||
|
||||
class NetHackQtTextWindow : public QDialog, public NetHackQtWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
NetHackQtTextWindow(NetHackQtKeyBuffer &);
|
||||
~NetHackQtTextWindow();
|
||||
|
||||
virtual QWidget *Widget();
|
||||
|
||||
virtual void Clear();
|
||||
virtual bool Destroy();
|
||||
virtual void Display(bool block);
|
||||
virtual void PutStr(int attr, const char *text);
|
||||
virtual void UseRIP(int how, time_t when);
|
||||
|
||||
public slots:
|
||||
void Search();
|
||||
|
||||
protected:
|
||||
virtual void done(int);
|
||||
virtual void keyPressEvent(QKeyEvent *);
|
||||
|
||||
private slots:
|
||||
void doUpdate();
|
||||
|
||||
private:
|
||||
NetHackQtKeyBuffer &keysource;
|
||||
|
||||
bool use_rip;
|
||||
bool str_fixed;
|
||||
|
||||
QPushButton ok;
|
||||
QPushButton search;
|
||||
NetHackQtTextListBox *lines;
|
||||
|
||||
NetHackQtRIP rip;
|
||||
};
|
||||
|
||||
class NetHackQtMenuOrTextWindow : public NetHackQtWindow
|
||||
{
|
||||
private:
|
||||
NetHackQtWindow *actual;
|
||||
NetHackQtKeyBuffer &keysource;
|
||||
|
||||
public:
|
||||
NetHackQtMenuOrTextWindow(NetHackQtKeyBuffer &);
|
||||
|
||||
virtual QWidget *Widget();
|
||||
|
||||
// Text
|
||||
virtual void Clear();
|
||||
virtual bool Destroy();
|
||||
virtual void Display(bool block);
|
||||
virtual void PutStr(int attr, const char *text);
|
||||
|
||||
// Menu
|
||||
virtual void StartMenu();
|
||||
virtual void AddMenu(int glyph, const ANY_P *identifier, char ch,
|
||||
char gch, int attr, const char *str, bool presel);
|
||||
virtual void EndMenu(const char *prompt);
|
||||
virtual int SelectMenu(int how, MENU_ITEM_P **menu_list);
|
||||
};
|
||||
|
||||
class NetHackQtDelay : QObject
|
||||
{
|
||||
private:
|
||||
int msec;
|
||||
|
||||
public:
|
||||
NetHackQtDelay(int ms);
|
||||
void wait();
|
||||
virtual void timerEvent(QTimerEvent *timer);
|
||||
};
|
||||
|
||||
class NetHackQtInvUsageWindow : public QWidget
|
||||
{
|
||||
public:
|
||||
NetHackQtInvUsageWindow(QWidget *parent);
|
||||
virtual void paintEvent(QPaintEvent *);
|
||||
|
||||
private:
|
||||
void drawWorn(QPainter &painter, obj *, int x, int y, bool canbe = TRUE);
|
||||
};
|
||||
|
||||
// This class is the main widget for NetHack
|
||||
//
|
||||
// It is a collection of Message, Map, and Status windows. In the current
|
||||
// version of nethack there is only one of each, and this class makes this
|
||||
// assumption, not showing itself until all are inserted.
|
||||
//
|
||||
// This class simply knows how to layout such children sensibly.
|
||||
//
|
||||
// Since it is only responsible for layout, the class does not
|
||||
// note the actual class of the windows.
|
||||
//
|
||||
#ifndef KDE
|
||||
#include "qt_kde0.h"
|
||||
#endif
|
||||
|
||||
class NetHackQtMainWindow : public KTopLevelWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
NetHackQtMainWindow(NetHackQtKeyBuffer &);
|
||||
|
||||
void AddMessageWindow(NetHackQtMessageWindow *window);
|
||||
void AddMapWindow(NetHackQtMapWindow *window);
|
||||
void AddStatusWindow(NetHackQtStatusWindow *window);
|
||||
void RemoveWindow(NetHackQtWindow *window);
|
||||
void updateInventory();
|
||||
|
||||
void fadeHighlighting();
|
||||
|
||||
public slots:
|
||||
void doMenuItem(int);
|
||||
void doKeys(const QString &);
|
||||
|
||||
protected:
|
||||
virtual void resizeEvent(QResizeEvent *);
|
||||
virtual void keyPressEvent(QKeyEvent *);
|
||||
virtual void keyReleaseEvent(QKeyEvent *event);
|
||||
virtual void closeEvent(QCloseEvent *);
|
||||
|
||||
private slots:
|
||||
void layout();
|
||||
void raiseMap();
|
||||
void zoomMap();
|
||||
void raiseMessages();
|
||||
void raiseStatus();
|
||||
|
||||
private:
|
||||
void ShowIfReady();
|
||||
|
||||
#ifdef KDE
|
||||
KMenuBar *menubar;
|
||||
#else
|
||||
QMenuBar *menubar;
|
||||
#endif
|
||||
NetHackQtMessageWindow *message;
|
||||
NetHackQtMapWindow *map;
|
||||
NetHackQtStatusWindow *status;
|
||||
NetHackQtInvUsageWindow *invusage;
|
||||
|
||||
NetHackQtKeyBuffer &keysink;
|
||||
QWidgetStack *stack;
|
||||
int dirkey;
|
||||
|
||||
const char **macro;
|
||||
};
|
||||
|
||||
class NetHackQtYnDialog : QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
private:
|
||||
const char *question;
|
||||
const char *choices;
|
||||
char def;
|
||||
NetHackQtKeyBuffer &keysource;
|
||||
|
||||
protected:
|
||||
virtual void keyPressEvent(QKeyEvent *);
|
||||
virtual void done(int);
|
||||
|
||||
private slots:
|
||||
void doneItem(int);
|
||||
|
||||
public:
|
||||
NetHackQtYnDialog(NetHackQtKeyBuffer &keysource, const char *,
|
||||
const char *, char);
|
||||
|
||||
char Exec();
|
||||
};
|
||||
|
||||
#ifdef KDE
|
||||
#define NetHackQtBindBase KApplication
|
||||
#elif defined(QWS)
|
||||
#define NetHackQtBindBase QPEApplication
|
||||
#else
|
||||
#define NetHackQtBindBase QApplication
|
||||
#endif
|
||||
|
||||
class NetHackQtBind : NetHackQtBindBase
|
||||
{
|
||||
private:
|
||||
// Single-instance preservation...
|
||||
NetHackQtBind(int &argc, char **argv);
|
||||
|
||||
static NetHackQtBind *instance;
|
||||
|
||||
static NetHackQtKeyBuffer keybuffer;
|
||||
static NetHackQtClickBuffer clickbuffer;
|
||||
|
||||
static QWidget *splash;
|
||||
static NetHackQtMainWindow *main;
|
||||
|
||||
public:
|
||||
static void qt_init_nhwindows(int *argc, char **argv);
|
||||
static void qt_player_selection();
|
||||
static void qt_askname();
|
||||
static void qt_get_nh_event();
|
||||
static void qt_exit_nhwindows(const char *);
|
||||
static void qt_suspend_nhwindows(const char *);
|
||||
static void qt_resume_nhwindows();
|
||||
static winid qt_create_nhwindow(int type);
|
||||
static void qt_clear_nhwindow(winid wid);
|
||||
static void qt_display_nhwindow(winid wid, BOOLEAN_P block);
|
||||
static void qt_destroy_nhwindow(winid wid);
|
||||
static void qt_curs(winid wid, int x, int y);
|
||||
static void qt_putstr(winid wid, int attr, const char *text);
|
||||
static void qt_display_file(const char *filename, BOOLEAN_P must_exist);
|
||||
static void qt_start_menu(winid wid);
|
||||
static void qt_add_menu(winid wid, int glyph, const ANY_P *identifier,
|
||||
CHAR_P ch, CHAR_P gch, int attr, const char *str,
|
||||
BOOLEAN_P presel);
|
||||
static void qt_end_menu(winid wid, const char *prompt);
|
||||
static int qt_select_menu(winid wid, int how, MENU_ITEM_P **menu_list);
|
||||
static void qt_update_inventory();
|
||||
static void qt_mark_synch();
|
||||
static void qt_wait_synch();
|
||||
|
||||
static void qt_cliparound(int x, int y);
|
||||
static void qt_cliparound_window(winid wid, int x, int y);
|
||||
static void qt_print_glyph(winid wid, XCHAR_P x, XCHAR_P y,
|
||||
int glyph, int bkglyph);
|
||||
static void qt_raw_print(const char *str);
|
||||
static void qt_raw_print_bold(const char *str);
|
||||
static int qt_nhgetch();
|
||||
static int qt_nh_poskey(int *x, int *y, int *mod);
|
||||
static void qt_nhbell();
|
||||
static int qt_doprev_message();
|
||||
static char qt_yn_function(const char *question, const char *choices,
|
||||
CHAR_P def);
|
||||
static void qt_getlin(const char *prompt, char *line);
|
||||
static int qt_get_ext_cmd();
|
||||
static void qt_number_pad(int);
|
||||
static void qt_delay_output();
|
||||
static void qt_start_screen();
|
||||
static void qt_end_screen();
|
||||
|
||||
static void qt_outrip(winid wid, int how, time_t when);
|
||||
static int qt_kbhit();
|
||||
|
||||
private:
|
||||
virtual bool notify(QObject *receiver, QEvent *event);
|
||||
};
|
||||
|
||||
#endif
|
||||
1422
include/qt_xpms.h
1422
include/qt_xpms.h
File diff suppressed because it is too large
Load Diff
118
include/qtext.h
118
include/qtext.h
@@ -1,118 +0,0 @@
|
||||
/* NetHack 3.6 qtext.h $NHDT-Date: 1505170347 2017/09/11 22:52:27 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.18 $ */
|
||||
/* Copyright (c) Mike Stephenson 1991. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
#ifndef QTEXT_H
|
||||
#define QTEXT_H
|
||||
|
||||
#define N_HDR 16 /* Maximum number of categories */
|
||||
/* (i.e., num roles + 1) */
|
||||
#define LEN_HDR 3 /* Maximum length of a category name */
|
||||
|
||||
struct qtmsg {
|
||||
int msgnum;
|
||||
char delivery;
|
||||
long offset, size, summary_size;
|
||||
};
|
||||
|
||||
#ifdef MAKEDEFS_C /***** MAKEDEFS *****/
|
||||
|
||||
#define N_MSG 100 /* arbitrary */
|
||||
|
||||
struct msghdr {
|
||||
int n_msg;
|
||||
struct qtmsg qt_msg[N_MSG];
|
||||
};
|
||||
|
||||
struct qthdr {
|
||||
int n_hdr;
|
||||
char id[N_HDR][LEN_HDR];
|
||||
long offset[N_HDR];
|
||||
};
|
||||
|
||||
/* Error message macros */
|
||||
#define CREC_IN_MSG "Control record encountered during message - line %d\n"
|
||||
#define DUP_MSG "Duplicate message number at line %d\n"
|
||||
#define END_NOT_IN_MSG "End record encountered before message - line %d\n"
|
||||
#define TEXT_NOT_IN_MSG "Text encountered outside message - line %d\n"
|
||||
#define UNREC_CREC "Unrecognized Control record at line %d\n"
|
||||
#define MAL_SUM "Malformed summary in End record - line %d\n"
|
||||
#define DUMB_SUM "Summary for single line message is useless - line %d\n"
|
||||
#define CTRL_TRUNC "Control record truncated at line %d\n"
|
||||
#define TEXT_TRUNC "Text record truncated at line %d\n"
|
||||
#define OUT_OF_HEADERS \
|
||||
"Too many message types (line %d)\nAdjust N_HDR in qtext.h and " \
|
||||
"recompile.\n"
|
||||
#define OUT_OF_MESSAGES \
|
||||
"Too many messages in class (line %d)\nAdjust N_MSG in qtext.h and " \
|
||||
"recompile.\n"
|
||||
|
||||
#else /***** !MAKEDEFS *****/
|
||||
|
||||
struct qtlists {
|
||||
struct qtmsg *common,
|
||||
#if 0 /* UNUSED but available */
|
||||
*chrace,
|
||||
#endif
|
||||
*chrole;
|
||||
};
|
||||
|
||||
/*
|
||||
* Quest message defines. Used in quest.c to trigger off "realistic"
|
||||
* dialogue to the player.
|
||||
*/
|
||||
#define QT_FIRSTTIME 1
|
||||
#define QT_NEXTTIME 2
|
||||
#define QT_OTHERTIME 3
|
||||
|
||||
#define QT_GUARDTALK 5 /* 5 random things guards say before quest */
|
||||
#define QT_GUARDTALK2 10 /* 5 random things guards say after quest */
|
||||
|
||||
#define QT_FIRSTLEADER 15
|
||||
#define QT_NEXTLEADER 16
|
||||
#define QT_OTHERLEADER 17
|
||||
#define QT_LASTLEADER 18
|
||||
#define QT_BADLEVEL 19
|
||||
#define QT_BADALIGN 20
|
||||
#define QT_ASSIGNQUEST 21
|
||||
|
||||
#define QT_ENCOURAGE 25 /* 1-10 random encouragement messages */
|
||||
|
||||
#define QT_FIRSTLOCATE 35
|
||||
#define QT_NEXTLOCATE 36
|
||||
|
||||
#define QT_FIRSTGOAL 40
|
||||
#define QT_NEXTGOAL 41
|
||||
#define QT_ALTGOAL 42 /* alternate to QT_NEXTGOAL if artifact is absent */
|
||||
|
||||
#define QT_FIRSTNEMESIS 50
|
||||
#define QT_NEXTNEMESIS 51
|
||||
#define QT_OTHERNEMESIS 52
|
||||
#define QT_NEMWANTSIT 53 /* you somehow got the artifact */
|
||||
|
||||
#define QT_DISCOURAGE 60 /* 1-10 random maledictive messages */
|
||||
|
||||
#define QT_GOTIT 70
|
||||
|
||||
#define QT_KILLEDNEM 80
|
||||
#define QT_OFFEREDIT 81
|
||||
#define QT_OFFEREDIT2 82
|
||||
|
||||
#define QT_POSTHANKS 90
|
||||
#define QT_HASAMULET 91
|
||||
|
||||
/*
|
||||
* Message defines for common text used in maledictions.
|
||||
*/
|
||||
#define COMMON_ID "-" /* Common message id value */
|
||||
|
||||
#define QT_ANGELIC 10
|
||||
#define QTN_ANGELIC 10
|
||||
|
||||
#define QT_DEMONIC 30
|
||||
#define QTN_DEMONIC 20
|
||||
|
||||
#define QT_BANISHED 60
|
||||
#endif /***** !MAKEDEFS *****/
|
||||
|
||||
#endif /* QTEXT_H */
|
||||
@@ -1,293 +0,0 @@
|
||||
/**********************************************************************
|
||||
** $NHDT-Date: 1524683840 2018/04/25 19:17:20 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.5 $
|
||||
** $Id: qttableview.h,v 1.2 2002/03/09 03:13:13 jwalz Exp $
|
||||
**
|
||||
** Definition of QtTableView class
|
||||
**
|
||||
** Created : 941115
|
||||
**
|
||||
** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
|
||||
**
|
||||
** This file contains a class moved out of the Qt GUI Toolkit API. It
|
||||
** may be used, distributed and modified without limitation.
|
||||
**
|
||||
**********************************************************************/
|
||||
|
||||
#ifndef QTTABLEVIEW_H
|
||||
#define QTTABLEVIEW_H
|
||||
|
||||
#ifndef QT_H
|
||||
#include <qframe.h>
|
||||
#endif // QT_H
|
||||
|
||||
#ifndef QT_NO_QTTABLEVIEW
|
||||
|
||||
class QScrollBar;
|
||||
class QCornerSquare;
|
||||
|
||||
class QtTableView : public QFrame
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
virtual void setBackgroundColor(const QColor &);
|
||||
virtual void setPalette(const QPalette &);
|
||||
void show();
|
||||
|
||||
void repaint(bool erase = TRUE);
|
||||
void repaint(int x, int y, int w, int h, bool erase = TRUE);
|
||||
void repaint(const QRect &, bool erase = TRUE);
|
||||
|
||||
protected:
|
||||
QtTableView(QWidget *parent = 0, const char *name = 0, WFlags f = 0);
|
||||
~QtTableView();
|
||||
|
||||
int numRows() const;
|
||||
virtual void setNumRows(int);
|
||||
int numCols() const;
|
||||
virtual void setNumCols(int);
|
||||
|
||||
int topCell() const;
|
||||
virtual void setTopCell(int row);
|
||||
int leftCell() const;
|
||||
virtual void setLeftCell(int col);
|
||||
virtual void setTopLeftCell(int row, int col);
|
||||
|
||||
int xOffset() const;
|
||||
virtual void setXOffset(int);
|
||||
int yOffset() const;
|
||||
virtual void setYOffset(int);
|
||||
virtual void setOffset(int x, int y, bool updateScrBars = TRUE);
|
||||
|
||||
virtual int cellWidth(int col);
|
||||
virtual int cellHeight(int row);
|
||||
int cellWidth() const;
|
||||
int cellHeight() const;
|
||||
virtual void setCellWidth(int);
|
||||
virtual void setCellHeight(int);
|
||||
|
||||
virtual int totalWidth();
|
||||
virtual int totalHeight();
|
||||
|
||||
uint tableFlags() const;
|
||||
bool testTableFlags(uint f) const;
|
||||
virtual void setTableFlags(uint f);
|
||||
void clearTableFlags(uint f = ~0);
|
||||
|
||||
bool autoUpdate() const;
|
||||
virtual void setAutoUpdate(bool);
|
||||
|
||||
void updateCell(int row, int column, bool erase = TRUE);
|
||||
|
||||
QRect cellUpdateRect() const;
|
||||
QRect viewRect() const;
|
||||
|
||||
int lastRowVisible() const;
|
||||
int lastColVisible() const;
|
||||
|
||||
bool rowIsVisible(int row) const;
|
||||
bool colIsVisible(int col) const;
|
||||
|
||||
QScrollBar *verticalScrollBar() const;
|
||||
QScrollBar *horizontalScrollBar() const;
|
||||
|
||||
private slots:
|
||||
void horSbValue(int);
|
||||
void horSbSliding(int);
|
||||
void horSbSlidingDone();
|
||||
void verSbValue(int);
|
||||
void verSbSliding(int);
|
||||
void verSbSlidingDone();
|
||||
|
||||
protected:
|
||||
virtual void paintCell(QPainter *, int row, int col) = 0;
|
||||
virtual void setupPainter(QPainter *);
|
||||
|
||||
void paintEvent(QPaintEvent *);
|
||||
void resizeEvent(QResizeEvent *);
|
||||
|
||||
int findRow(int yPos) const;
|
||||
int findCol(int xPos) const;
|
||||
|
||||
bool rowYPos(int row, int *yPos) const;
|
||||
bool colXPos(int col, int *xPos) const;
|
||||
|
||||
int maxXOffset();
|
||||
int maxYOffset();
|
||||
int maxColOffset();
|
||||
int maxRowOffset();
|
||||
|
||||
int minViewX() const;
|
||||
int minViewY() const;
|
||||
int maxViewX() const;
|
||||
int maxViewY() const;
|
||||
int viewWidth() const;
|
||||
int viewHeight() const;
|
||||
|
||||
void scroll(int xPixels, int yPixels);
|
||||
void updateScrollBars();
|
||||
void updateTableSize();
|
||||
|
||||
private:
|
||||
void coverCornerSquare(bool);
|
||||
void snapToGrid(bool horizontal, bool vertical);
|
||||
virtual void setHorScrollBar(bool on, bool update = TRUE);
|
||||
virtual void setVerScrollBar(bool on, bool update = TRUE);
|
||||
void updateView();
|
||||
int findRawRow(int yPos, int *cellMaxY, int *cellMinY = 0,
|
||||
bool goOutsideView = FALSE) const;
|
||||
int findRawCol(int xPos, int *cellMaxX, int *cellMinX = 0,
|
||||
bool goOutsideView = FALSE) const;
|
||||
int maxColsVisible() const;
|
||||
|
||||
void updateScrollBars(uint);
|
||||
void updateFrameSize();
|
||||
|
||||
void doAutoScrollBars();
|
||||
void showOrHideScrollBars();
|
||||
|
||||
int nRows;
|
||||
int nCols;
|
||||
int xOffs, yOffs;
|
||||
int xCellOffs, yCellOffs;
|
||||
short xCellDelta, yCellDelta;
|
||||
short cellH, cellW;
|
||||
|
||||
uint eraseInPaint : 1;
|
||||
uint verSliding : 1;
|
||||
uint verSnappingOff : 1;
|
||||
uint horSliding : 1;
|
||||
uint horSnappingOff : 1;
|
||||
uint coveringCornerSquare : 1;
|
||||
uint sbDirty : 8;
|
||||
uint inSbUpdate : 1;
|
||||
|
||||
uint tFlags;
|
||||
QRect cellUpdateR;
|
||||
|
||||
QScrollBar *vScrollBar;
|
||||
QScrollBar *hScrollBar;
|
||||
QCornerSquare *cornerSquare;
|
||||
|
||||
private: // Disabled copy constructor and operator=
|
||||
#if defined(Q_DISABLE_COPY)
|
||||
QtTableView(const QtTableView &);
|
||||
QtTableView &operator=(const QtTableView &);
|
||||
#endif
|
||||
};
|
||||
|
||||
const uint Tbl_vScrollBar = 0x00000001;
|
||||
const uint Tbl_hScrollBar = 0x00000002;
|
||||
const uint Tbl_autoVScrollBar = 0x00000004;
|
||||
const uint Tbl_autoHScrollBar = 0x00000008;
|
||||
const uint Tbl_autoScrollBars = 0x0000000C;
|
||||
|
||||
const uint Tbl_clipCellPainting = 0x00000100;
|
||||
const uint Tbl_cutCellsV = 0x00000200;
|
||||
const uint Tbl_cutCellsH = 0x00000400;
|
||||
const uint Tbl_cutCells = 0x00000600;
|
||||
|
||||
const uint Tbl_scrollLastHCell = 0x00000800;
|
||||
const uint Tbl_scrollLastVCell = 0x00001000;
|
||||
const uint Tbl_scrollLastCell = 0x00001800;
|
||||
|
||||
const uint Tbl_smoothHScrolling = 0x00002000;
|
||||
const uint Tbl_smoothVScrolling = 0x00004000;
|
||||
const uint Tbl_smoothScrolling = 0x00006000;
|
||||
|
||||
const uint Tbl_snapToHGrid = 0x00008000;
|
||||
const uint Tbl_snapToVGrid = 0x00010000;
|
||||
const uint Tbl_snapToGrid = 0x00018000;
|
||||
|
||||
inline int
|
||||
QtTableView::numRows() const
|
||||
{
|
||||
return nRows;
|
||||
}
|
||||
|
||||
inline int
|
||||
QtTableView::numCols() const
|
||||
{
|
||||
return nCols;
|
||||
}
|
||||
|
||||
inline int
|
||||
QtTableView::topCell() const
|
||||
{
|
||||
return yCellOffs;
|
||||
}
|
||||
|
||||
inline int
|
||||
QtTableView::leftCell() const
|
||||
{
|
||||
return xCellOffs;
|
||||
}
|
||||
|
||||
inline int
|
||||
QtTableView::xOffset() const
|
||||
{
|
||||
return xOffs;
|
||||
}
|
||||
|
||||
inline int
|
||||
QtTableView::yOffset() const
|
||||
{
|
||||
return yOffs;
|
||||
}
|
||||
|
||||
inline int
|
||||
QtTableView::cellHeight() const
|
||||
{
|
||||
return cellH;
|
||||
}
|
||||
|
||||
inline int
|
||||
QtTableView::cellWidth() const
|
||||
{
|
||||
return cellW;
|
||||
}
|
||||
|
||||
inline uint
|
||||
QtTableView::tableFlags() const
|
||||
{
|
||||
return tFlags;
|
||||
}
|
||||
|
||||
inline bool
|
||||
QtTableView::testTableFlags(uint f) const
|
||||
{
|
||||
return (tFlags & f) != 0;
|
||||
}
|
||||
|
||||
inline QRect
|
||||
QtTableView::cellUpdateRect() const
|
||||
{
|
||||
return cellUpdateR;
|
||||
}
|
||||
|
||||
inline bool
|
||||
QtTableView::autoUpdate() const
|
||||
{
|
||||
return isUpdatesEnabled();
|
||||
}
|
||||
|
||||
inline void
|
||||
QtTableView::repaint(bool erase)
|
||||
{
|
||||
repaint(0, 0, width(), height(), erase);
|
||||
}
|
||||
|
||||
inline void
|
||||
QtTableView::repaint(const QRect &r, bool erase)
|
||||
{
|
||||
repaint(r.x(), r.y(), r.width(), r.height(), erase);
|
||||
}
|
||||
|
||||
inline void
|
||||
QtTableView::updateScrollBars()
|
||||
{
|
||||
updateScrollBars(0);
|
||||
}
|
||||
|
||||
#endif // QT_NO_QTTABLEVIEW
|
||||
|
||||
#endif // QTTABLEVIEW_H
|
||||
11
include/rm.h
11
include/rm.h
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 rm.h $NHDT-Date: 1559994624 2019/06/08 11:50:24 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.61 $ */
|
||||
/* NetHack 3.6 rm.h $NHDT-Date: 1573943499 2019/11/16 22:31:39 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.66 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/*-Copyright (c) Pasi Kallinen, 2017. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -266,7 +266,9 @@ struct symparse {
|
||||
/* misc symbol definitions */
|
||||
#define SYM_BOULDER 0
|
||||
#define SYM_INVISIBLE 1
|
||||
#define MAXOTHER 2
|
||||
#define SYM_PET_OVERRIDE 2
|
||||
#define SYM_HERO_OVERRIDE 3
|
||||
#define MAXOTHER 4
|
||||
|
||||
/* linked list of symsets and their characteristics */
|
||||
struct symsetentry {
|
||||
@@ -278,7 +280,8 @@ struct symsetentry {
|
||||
Bitfield(nocolor, 1); /* don't use color if set */
|
||||
Bitfield(primary, 1); /* restricted for use as primary set */
|
||||
Bitfield(rogue, 1); /* restricted for use as rogue lev set */
|
||||
/* 5 free bits */
|
||||
Bitfield(explicitly, 1); /* explicit symset set */
|
||||
/* 4 free bits */
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -298,6 +301,8 @@ struct symsetentry {
|
||||
#define H_IBM 1
|
||||
#define H_DEC 2
|
||||
#define H_CURS 3
|
||||
#define H_MAC 4 /* obsolete; needed so that the listing of available
|
||||
* symsets by 'O' can skip it for !MAC_GRAPHICS_ENV */
|
||||
|
||||
extern const struct symdef defsyms[MAXPCHARS]; /* defaults */
|
||||
#define WARNCOUNT 6 /* number of different warning levels */
|
||||
|
||||
@@ -1,192 +0,0 @@
|
||||
/* NetHack 3.6 sfprocs.h Tue Nov 6 19:38:48 2018 */
|
||||
/* Copyright (c) NetHack Development Team 2018. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
#ifndef SFPROCS_H
|
||||
#define SFPROCS_H
|
||||
|
||||
#include "hack.h"
|
||||
#include "integer.h"
|
||||
#include "wintype.h"
|
||||
|
||||
#define E extern
|
||||
|
||||
/* output routines */
|
||||
E void FDECL(ascii_sfo_aligntyp, (NHFILE *, aligntyp *, const char *, const char *, int));
|
||||
E void FDECL(ascii_sfo_any, (NHFILE *, union any *d_any, const char *, const char *, int));
|
||||
E void FDECL(ascii_sfo_bitfield, (NHFILE *, uint8_t *, const char *, const char *, int));
|
||||
E void FDECL(ascii_sfo_boolean, (NHFILE *, boolean *, const char *, const char *, int));
|
||||
E void FDECL(ascii_sfo_char, (NHFILE *, char *, const char *, const char *, int));
|
||||
E void FDECL(ascii_sfo_genericptr, (NHFILE *, genericptr_t *, const char *, const char *, int));
|
||||
E void FDECL(ascii_sfo_int, (NHFILE *, int *, const char *, const char *, int));
|
||||
E void FDECL(ascii_sfo_long, (NHFILE *, long *, const char *, const char *, int));
|
||||
E void FDECL(ascii_sfo_schar, (NHFILE *, schar *, const char *, const char *, int));
|
||||
E void FDECL(ascii_sfo_short, (NHFILE *, short *, const char *, const char *, int));
|
||||
E void FDECL(ascii_sfo_size_t, (NHFILE *, size_t *, const char *, const char *, int));
|
||||
E void FDECL(ascii_sfo_time_t, (NHFILE *, time_t *, const char *, const char *, int));
|
||||
E void FDECL(ascii_sfo_unsigned, (NHFILE *, unsigned *, const char *, const char *, int));
|
||||
E void FDECL(ascii_sfo_uchar, (NHFILE *, unsigned char *, const char *, const char *, int));
|
||||
E void FDECL(ascii_sfo_uint, (NHFILE *, unsigned int *, const char *, const char *, int));
|
||||
E void FDECL(ascii_sfo_ulong, (NHFILE *, unsigned long *, const char *, const char *, int));
|
||||
E void FDECL(ascii_sfo_ushort, (NHFILE *, unsigned short *, const char *, const char *, int));
|
||||
E void FDECL(ascii_sfo_xchar, (NHFILE *, xchar *, const char *, const char *, int));
|
||||
E void FDECL(ascii_sfo_str, (NHFILE *, char *, const char *, const char *, int));
|
||||
E void FDECL(ascii_sfo_addinfo, (NHFILE *, const char *, const char *, const char *, int));
|
||||
|
||||
/* input routines */
|
||||
E void FDECL(ascii_sfi_aligntyp, (NHFILE *, aligntyp *, const char *, const char *, int));
|
||||
E void FDECL(ascii_sfi_any, (NHFILE *, union any *d_any, const char *, const char *, int));
|
||||
E void FDECL(ascii_sfi_bitfield, (NHFILE *, uint8_t *, const char *, const char *, int));
|
||||
E void FDECL(ascii_sfi_boolean, (NHFILE *, boolean *, const char *, const char *, int));
|
||||
E void FDECL(ascii_sfi_char, (NHFILE *, char *, const char *, const char *, int));
|
||||
E void FDECL(ascii_sfi_genericptr, (NHFILE *, genericptr_t *, const char *, const char *, int));
|
||||
E void FDECL(ascii_sfi_int, (NHFILE *, int *, const char *, const char *, int));
|
||||
E void FDECL(ascii_sfi_long, (NHFILE *, long *, const char *, const char *, int));
|
||||
E void FDECL(ascii_sfi_schar, (NHFILE *, schar *, const char *, const char *, int));
|
||||
E void FDECL(ascii_sfi_short, (NHFILE *, short *, const char *, const char *, int));
|
||||
E void FDECL(ascii_sfi_size_t, (NHFILE *, size_t *, const char *, const char *, int));
|
||||
E void FDECL(ascii_sfi_time_t, (NHFILE *, time_t *, const char *, const char *, int));
|
||||
E void FDECL(ascii_sfi_unsigned, (NHFILE *, unsigned *, const char *, const char *, int));
|
||||
E void FDECL(ascii_sfi_uchar, (NHFILE *, unsigned char *, const char *, const char *, int));
|
||||
E void FDECL(ascii_sfi_uint, (NHFILE *, unsigned int *, const char *, const char *, int));
|
||||
E void FDECL(ascii_sfi_ulong, (NHFILE *, unsigned long *, const char *, const char *, int));
|
||||
E void FDECL(ascii_sfi_ushort, (NHFILE *, unsigned short *, const char *, const char *, int));
|
||||
E void FDECL(ascii_sfi_xchar, (NHFILE *, xchar *, const char *, const char *, int));
|
||||
E void FDECL(ascii_sfi_str, (NHFILE *, char *, const char *, const char *, int));
|
||||
E void FDECL(ascii_sfi_addinfo, (NHFILE *, const char *, const char *, const char *, int));
|
||||
|
||||
/* output routines */
|
||||
E void FDECL(lendian_sfo_aligntyp, (NHFILE *, aligntyp *, const char *, const char *, int));
|
||||
E void FDECL(lendian_sfo_any, (NHFILE *, union any *d_any, const char *, const char *, int));
|
||||
E void FDECL(lendian_sfo_bitfield, (NHFILE *, uint8_t *, const char *, const char *, int));
|
||||
E void FDECL(lendian_sfo_boolean, (NHFILE *, boolean *, const char *, const char *, int));
|
||||
E void FDECL(lendian_sfo_char, (NHFILE *, char *, const char *, const char *, int));
|
||||
E void FDECL(lendian_sfo_genericptr, (NHFILE *, genericptr_t *, const char *, const char *, int));
|
||||
E void FDECL(lendian_sfo_int, (NHFILE *, int *, const char *, const char *, int));
|
||||
E void FDECL(lendian_sfo_long, (NHFILE *, long *, const char *, const char *, int));
|
||||
E void FDECL(lendian_sfo_schar, (NHFILE *, schar *, const char *, const char *, int));
|
||||
E void FDECL(lendian_sfo_short, (NHFILE *, short *, const char *, const char *, int));
|
||||
E void FDECL(lendian_sfo_size_t, (NHFILE *, size_t *, const char *, const char *, int));
|
||||
E void FDECL(lendian_sfo_time_t, (NHFILE *, time_t *, const char *, const char *, int));
|
||||
E void FDECL(lendian_sfo_unsigned, (NHFILE *, unsigned *, const char *, const char *, int));
|
||||
E void FDECL(lendian_sfo_uchar, (NHFILE *, unsigned char *, const char *, const char *, int));
|
||||
E void FDECL(lendian_sfo_uint, (NHFILE *, unsigned int *, const char *, const char *, int));
|
||||
E void FDECL(lendian_sfo_ulong, (NHFILE *, unsigned long *, const char *, const char *, int));
|
||||
E void FDECL(lendian_sfo_ushort, (NHFILE *, unsigned short *, const char *, const char *, int));
|
||||
E void FDECL(lendian_sfo_xchar, (NHFILE *, xchar *, const char *, const char *, int));
|
||||
E void FDECL(lendian_sfo_str, (NHFILE *, char *, const char *, const char *, int));
|
||||
E void FDECL(lendian_sfo_addinfo, (NHFILE *, const char *, const char *, const char *, int));
|
||||
|
||||
/* input routines */
|
||||
E void FDECL(lendian_sfi_aligntyp, (NHFILE *, aligntyp *, const char *, const char *, int));
|
||||
E void FDECL(lendian_sfi_any, (NHFILE *, union any *d_any, const char *, const char *, int));
|
||||
E void FDECL(lendian_sfi_bitfield, (NHFILE *, uint8_t *, const char *, const char *, int));
|
||||
E void FDECL(lendian_sfi_boolean, (NHFILE *, boolean *, const char *, const char *, int));
|
||||
E void FDECL(lendian_sfi_char, (NHFILE *, char *, const char *, const char *, int));
|
||||
E void FDECL(lendian_sfi_genericptr, (NHFILE *, genericptr_t *, const char *, const char *, int));
|
||||
E void FDECL(lendian_sfi_int, (NHFILE *, int *, const char *, const char *, int));
|
||||
E void FDECL(lendian_sfi_long, (NHFILE *, long *, const char *, const char *, int));
|
||||
E void FDECL(lendian_sfi_schar, (NHFILE *, schar *, const char *, const char *, int));
|
||||
E void FDECL(lendian_sfi_short, (NHFILE *, short *, const char *, const char *, int));
|
||||
E void FDECL(lendian_sfi_size_t, (NHFILE *, size_t *, const char *, const char *, int));
|
||||
E void FDECL(lendian_sfi_time_t, (NHFILE *, time_t *, const char *, const char *, int));
|
||||
E void FDECL(lendian_sfi_unsigned, (NHFILE *, unsigned *, const char *, const char *, int));
|
||||
E void FDECL(lendian_sfi_uchar, (NHFILE *, unsigned char *, const char *, const char *, int));
|
||||
E void FDECL(lendian_sfi_uint, (NHFILE *, unsigned int *, const char *, const char *, int));
|
||||
E void FDECL(lendian_sfi_ulong, (NHFILE *, unsigned long *, const char *, const char *, int));
|
||||
E void FDECL(lendian_sfi_ushort, (NHFILE *, unsigned short *, const char *, const char *, int));
|
||||
E void FDECL(lendian_sfi_xchar, (NHFILE *, xchar *, const char *, const char *, int));
|
||||
E void FDECL(lendian_sfi_str, (NHFILE *, char *, const char *, const char *, int));
|
||||
E void FDECL(lendian_sfi_addinfo, (NHFILE *, const char *, const char *, const char *, int));
|
||||
|
||||
#ifdef JSON_SUPPORT
|
||||
/* output routines */
|
||||
E void FDECL(json_sfo_aligntyp, (NHFILE *, aligntype *, const char *, const char *, int));
|
||||
E void FDECL(json_sfo_any, (NHFILE *, union any *d_any, const char *, const char *, int));
|
||||
E void FDECL(json_sfo_bitfield, (NHFILE *, uint8_t *, const char *, const char *, int));
|
||||
E void FDECL(json_sfo_boolean, (NHFILE *, boolean *, const char *, const char *, int));
|
||||
E void FDECL(json_sfo_char, (NHFILE *, char *, const char *, const char *, int));
|
||||
E void FDECL(json_sfo_genericptr, (NHFILE *, genericptr_t *, const char *, const char *, int));
|
||||
E void FDECL(json_sfo_int, (NHFILE *, int *, const char *, const char *, int));
|
||||
E void FDECL(json_sfo_long, (NHFILE *, long *, const char *, const char *, int));
|
||||
E void FDECL(json_sfo_schar, (NHFILE *, schar *, const char *, const char *, int));
|
||||
E void FDECL(json_sfo_short, (NHFILE *, short *, const char *, const char *, int));
|
||||
E void FDECL(json_sfo_size_t, (NHFILE *, size_t *, const char *, const char *, int));
|
||||
E void FDECL(json_sfo_time_t, (NHFILE *, time_t *, const char *, const char *, int));
|
||||
E void FDECL(json_sfo_unsigned, (NHFILE *, unsigned *, const char *, const char *, int));
|
||||
E void FDECL(json_sfo_uchar, (NHFILE *, unsigned char *, const char *, const char *, int));
|
||||
E void FDECL(json_sfo_uint, (NHFILE *, unsigned int *, const char *, const char *, int));
|
||||
E void FDECL(json_sfo_ulong, (NHFILE *, unsigned long *, const char *, const char *, int));
|
||||
E void FDECL(json_sfo_ushort, (NHFILE *, unsigned short *, const char *, const char *, int));
|
||||
E void FDECL(json_sfo_xchar, (NHFILE *, xchar *, const char *, const char *, int));
|
||||
E void FDECL(json_sfo_str, (NHFILE *, char *, const char *, const char *, int));
|
||||
E void FDECL(json_sfo_addinfo), (NHFILE *, const char *, const char *, const char *, int));
|
||||
|
||||
/* input routines */
|
||||
E void FDECL(json_sfi_aligntyp, (NHFILE *, aligntype *, const char *, const char *, int));
|
||||
E void FDECL(json_sfi_any, (NHFILE *, union any *d_any, const char *, const char *, int));
|
||||
E void FDECL(json_sfi_bitfield, (NHFILE *, uint8_t *, const char *, const char *, int));
|
||||
E void FDECL(json_sfi_boolean, (NHFILE *, boolean *, const char *, const char *, int));
|
||||
E void FDECL(json_sfi_char, (NHFILE *, char *, const char *, const char *, int));
|
||||
E void FDECL(json_sfi_genericptr, (NHFILE *, genericptr_t *, const char *, const char *, int));
|
||||
E void FDECL(json_sfi_int, (NHFILE *, int *, const char *, const char *, int));
|
||||
E void FDECL(json_sfi_long, (NHFILE *, long *, const char *, const char *, int));
|
||||
E void FDECL(json_sfi_schar, (NHFILE *, schar *, const char *, const char *, int));
|
||||
E void FDECL(json_sfi_short, (NHFILE *, short *, const char *, const char *, int));
|
||||
E void FDECL(json_sfi_size_t, (NHFILE *, size_t *, const char *, const char *, int));
|
||||
E void FDECL(json_sfi_time_t, (NHFILE *, time_t *, const char *, const char *, int));
|
||||
E void FDECL(json_sfi_unsigned, (NHFILE *, unsigned *, const char *, const char *, int));
|
||||
E void FDECL(json_sfi_uchar, (NHFILE *, unsigned char *, const char *, const char *, int));
|
||||
E void FDECL(json_sfi_uint, (NHFILE *, unsigned int *, const char *, const char *, int));
|
||||
E void FDECL(json_sfi_ulong, (NHFILE *, unsigned long *, const char *, const char *, int));
|
||||
E void FDECL(json_sfi_ushort, (NHFILE *, unsigned short *, const char *, const char *, int));
|
||||
E void FDECL(json_sfi_xchar, (NHFILE *, xchar *, const char *, const char *, int));
|
||||
E void FDECL(json_sfi_str, (NHFILE *, char *, const char *, const char *, int));
|
||||
E void FDECL(json_sfi_addinfo), (NHFILE *, const char *, const char *, const char *, int));
|
||||
#endif /* JSON_SUPPORT */
|
||||
|
||||
struct fieldlevel_procs {
|
||||
void FDECL((*sf_aligntyp), (NHFILE *, aligntyp *, const char *, const char *, int));
|
||||
void FDECL((*sf_any), (NHFILE *, union any *d_any, const char *, const char *, int));
|
||||
void FDECL((*sf_bitfield), (NHFILE *, uint8_t *, const char *, const char *, int));
|
||||
void FDECL((*sf_boolean), (NHFILE *, boolean *, const char *, const char *, int));
|
||||
void FDECL((*sf_char), (NHFILE *, char *, const char *, const char *, int));
|
||||
void FDECL((*sf_genericptr), (NHFILE *, genericptr_t *, const char *, const char *, int));
|
||||
void FDECL((*sf_int), (NHFILE *, int *, const char *, const char *, int));
|
||||
void FDECL((*sf_long), (NHFILE *, long *, const char *, const char *, int));
|
||||
void FDECL((*sf_schar), (NHFILE *, schar *, const char *, const char *, int));
|
||||
void FDECL((*sf_short), (NHFILE *, short *, const char *, const char *, int));
|
||||
void FDECL((*sf_size_t), (NHFILE *, size_t *, const char *, const char *, int));
|
||||
void FDECL((*sf_time_t), (NHFILE *, time_t *, const char *, const char *, int));
|
||||
void FDECL((*sf_unsigned), (NHFILE *, unsigned *, const char *, const char *, int));
|
||||
void FDECL((*sf_uchar), (NHFILE *, unsigned char *, const char *, const char *, int));
|
||||
void FDECL((*sf_uint), (NHFILE *, unsigned int *, const char *, const char *, int));
|
||||
void FDECL((*sf_ulong), (NHFILE *, unsigned long *, const char *, const char *, int));
|
||||
void FDECL((*sf_ushort), (NHFILE *, unsigned short *, const char *, const char *, int));
|
||||
void FDECL((*sf_xchar), (NHFILE *, xchar *, const char *, const char *, int));
|
||||
void FDECL((*sf_str), (NHFILE *, char *, const char *, const char *, int));
|
||||
void FDECL((*sf_addinfo), (NHFILE *, const char *, const char *, const char *, int));
|
||||
};
|
||||
|
||||
struct sf_procs {
|
||||
const char *ext;
|
||||
struct fieldlevel_procs fn;
|
||||
};
|
||||
|
||||
E void NDECL(sf_init);
|
||||
E struct sf_procs sfoprocs[4], sfiprocs[4];
|
||||
|
||||
E struct sf_procs ascii_sfo_procs;
|
||||
E struct sf_procs ascii_sfi_procs;
|
||||
E struct sf_procs lendian_sfo_procs;
|
||||
E struct sf_procs lendian_sfi_procs;
|
||||
E struct sf_procs stub_sfo_procs;
|
||||
E struct sf_procs stub_sfi_procs;
|
||||
|
||||
#ifdef JSON_SUPPORT
|
||||
E struct sf_procs json_sfo_procs;
|
||||
E struct sf_procs json_sfi_procs;
|
||||
#endif
|
||||
|
||||
#undef E
|
||||
#endif /* SFPROCS_H */
|
||||
@@ -1,201 +0,0 @@
|
||||
/* NetHack 3.7 sfproto.h Tue Jun 25 09:57:33 2019 */
|
||||
/* Copyright (c) NetHack Development Team 2018. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
/* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE! */
|
||||
|
||||
#ifndef SFPROTO_H
|
||||
#define SFPROTO_H
|
||||
|
||||
#include "hack.h"
|
||||
#include "integer.h"
|
||||
#include "wintype.h"
|
||||
|
||||
#define E extern
|
||||
|
||||
E int NDECL(critical_members_count);
|
||||
/* sfbase.c output functions */
|
||||
E void FDECL(sfo_addinfo, (NHFILE *, const char *, const char *, const char *, int));
|
||||
E void FDECL(sfo_aligntyp, (NHFILE *, aligntyp *, const char *, const char *, int));
|
||||
E void FDECL(sfo_any, (NHFILE *, anything *, const char *, const char *, int));
|
||||
E void FDECL(sfo_bitfield, (NHFILE *, uint8_t *, const char *, const char *, int));
|
||||
E void FDECL(sfo_boolean, (NHFILE *, boolean *, const char *, const char *, int));
|
||||
E void FDECL(sfo_char, (NHFILE *, const char *, const char *, const char *, int));
|
||||
E void FDECL(sfo_genericptr, (NHFILE *, genericptr_t *, const char *, const char *, int));
|
||||
E void FDECL(sfo_int, (NHFILE *, int *, const char *, const char *, int));
|
||||
E void FDECL(sfo_long, (NHFILE *, long *, const char *, const char *, int));
|
||||
E void FDECL(sfo_schar, (NHFILE *, schar *, const char *, const char *, int));
|
||||
E void FDECL(sfo_short, (NHFILE *, short *, const char *, const char *, int));
|
||||
E void FDECL(sfo_size_t, (NHFILE *, size_t *, const char *, const char *, int));
|
||||
E void FDECL(sfo_time_t, (NHFILE *, time_t *, const char *, const char *, int));
|
||||
E void FDECL(sfo_uchar, (NHFILE *, uchar *, const char *, const char *, int));
|
||||
E void FDECL(sfo_unsigned, (NHFILE *, unsigned *, const char *, const char *, int));
|
||||
E void FDECL(sfo_uchar, (NHFILE *, unsigned char *, const char *, const char *, int));
|
||||
E void FDECL(sfo_uint, (NHFILE *, unsigned int *, const char *, const char *, int));
|
||||
E void FDECL(sfo_ulong, (NHFILE *, unsigned long *, const char *, const char *, int));
|
||||
E void FDECL(sfo_ushort, (NHFILE *, unsigned short *, const char *, const char *, int));
|
||||
E void FDECL(sfo_xchar, (NHFILE *, xchar *, const char *, const char *, int));
|
||||
E void FDECL(sfo_str, (NHFILE *, const char *, const char *, const char *, int));
|
||||
/* sfbase.c input functions */
|
||||
E void FDECL(sfi_addinfo, (NHFILE *, const char *, const char *, const char *, int));
|
||||
E void FDECL(sfi_aligntyp, (NHFILE *, aligntyp *, const char *, const char *, int));
|
||||
E void FDECL(sfi_any, (NHFILE *, anything *, const char *, const char *, int));
|
||||
E void FDECL(sfi_bitfield, (NHFILE *, uint8_t *, const char *, const char *, int));
|
||||
E void FDECL(sfi_boolean, (NHFILE *, boolean *, const char *, const char *, int));
|
||||
E void FDECL(sfi_char, (NHFILE *, const char *, const char *, const char *, int));
|
||||
E void FDECL(sfi_genericptr, (NHFILE *, genericptr_t *, const char *, const char *, int));
|
||||
E void FDECL(sfi_int, (NHFILE *, int *, const char *, const char *, int));
|
||||
E void FDECL(sfi_long, (NHFILE *, long *, const char *, const char *, int));
|
||||
E void FDECL(sfi_schar, (NHFILE *, schar *, const char *, const char *, int));
|
||||
E void FDECL(sfi_short, (NHFILE *, short *, const char *, const char *, int));
|
||||
E void FDECL(sfi_size_t, (NHFILE *, size_t *, const char *, const char *, int));
|
||||
E void FDECL(sfi_time_t, (NHFILE *, time_t *, const char *, const char *, int));
|
||||
E void FDECL(sfi_uchar, (NHFILE *, uchar *, const char *, const char *, int));
|
||||
E void FDECL(sfi_unsigned, (NHFILE *, unsigned *, const char *, const char *, int));
|
||||
E void FDECL(sfi_uchar, (NHFILE *, unsigned char *, const char *, const char *, int));
|
||||
E void FDECL(sfi_uint, (NHFILE *, unsigned int *, const char *, const char *, int));
|
||||
E void FDECL(sfi_ulong, (NHFILE *, unsigned long *, const char *, const char *, int));
|
||||
E void FDECL(sfi_ushort, (NHFILE *, unsigned short *, const char *, const char *, int));
|
||||
E void FDECL(sfi_xchar, (NHFILE *, xchar *, const char *, const char *, int));
|
||||
E void FDECL(sfi_str, (NHFILE *, const char *, const char *, const char *, int));
|
||||
/* generated output functions */
|
||||
E void FDECL(sfo_align, (NHFILE *, struct align *, const char *, const char *, int));
|
||||
E void FDECL(sfo_attribs, (NHFILE *, struct attribs *, const char *, const char *, int));
|
||||
E void FDECL(sfo_bill_x, (NHFILE *, struct bill_x *, const char *, const char *, int));
|
||||
E void FDECL(sfo_book_info, (NHFILE *, struct book_info *, const char *, const char *, int));
|
||||
E void FDECL(sfo_branch, (NHFILE *, struct branch *, const char *, const char *, int));
|
||||
E void FDECL(sfo_bubble, (NHFILE *, struct bubble *, const char *, const char *, int));
|
||||
E void FDECL(sfo_cemetery, (NHFILE *, struct cemetery *, const char *, const char *, int));
|
||||
E void FDECL(sfo_context_info, (NHFILE *, struct context_info *, const char *, const char *, int));
|
||||
E void FDECL(sfo_d_flags, (NHFILE *, struct d_flags *, const char *, const char *, int));
|
||||
E void FDECL(sfo_d_level, (NHFILE *, struct d_level *, const char *, const char *, int));
|
||||
E void FDECL(sfo_damage, (NHFILE *, struct damage *, const char *, const char *, int));
|
||||
E void FDECL(sfo_dest_area, (NHFILE *, struct dest_area *, const char *, const char *, int));
|
||||
E void FDECL(sfo_dgn_topology, (NHFILE *, struct dgn_topology *, const char *, const char *, int));
|
||||
E void FDECL(sfo_dig_info, (NHFILE *, struct dig_info *, const char *, const char *, int));
|
||||
E void FDECL(sfo_dungeon, (NHFILE *, struct dungeon *, const char *, const char *, int));
|
||||
E void FDECL(sfo_edog, (NHFILE *, struct edog *, const char *, const char *, int));
|
||||
E void FDECL(sfo_egd, (NHFILE *, struct egd *, const char *, const char *, int));
|
||||
E void FDECL(sfo_emin, (NHFILE *, struct emin *, const char *, const char *, int));
|
||||
E void FDECL(sfo_engr, (NHFILE *, struct engr *, const char *, const char *, int));
|
||||
E void FDECL(sfo_epri, (NHFILE *, struct epri *, const char *, const char *, int));
|
||||
E void FDECL(sfo_eshk, (NHFILE *, struct eshk *, const char *, const char *, int));
|
||||
E void FDECL(sfo_fakecorridor, (NHFILE *, struct fakecorridor *, const char *, const char *, int));
|
||||
E void FDECL(sfo_fe, (NHFILE *, struct fe *, const char *, const char *, int));
|
||||
E void FDECL(sfo_flag, (NHFILE *, struct flag *, const char *, const char *, int));
|
||||
E void FDECL(sfo_fruit, (NHFILE *, struct fruit *, const char *, const char *, int));
|
||||
E void FDECL(sfo_kinfo, (NHFILE *, struct kinfo *, const char *, const char *, int));
|
||||
E void FDECL(sfo_levelflags, (NHFILE *, struct levelflags *, const char *, const char *, int));
|
||||
E void FDECL(sfo_linfo, (NHFILE *, struct linfo *, const char *, const char *, int));
|
||||
E void FDECL(sfo_ls_t, (NHFILE *, struct ls_t *, const char *, const char *, int));
|
||||
E void FDECL(sfo_mapseen_feat, (NHFILE *, struct mapseen_feat *, const char *, const char *, int));
|
||||
E void FDECL(sfo_mapseen_flags, (NHFILE *, struct mapseen_flags *, const char *, const char *, int));
|
||||
E void FDECL(sfo_mapseen_rooms, (NHFILE *, struct mapseen_rooms *, const char *, const char *, int));
|
||||
E void FDECL(sfo_mapseen, (NHFILE *, struct mapseen *, const char *, const char *, int));
|
||||
E void FDECL(sfo_mextra, (NHFILE *, struct mextra *, const char *, const char *, int));
|
||||
E void FDECL(sfo_mkroom, (NHFILE *, struct mkroom *, const char *, const char *, int));
|
||||
E void FDECL(sfo_monst, (NHFILE *, struct monst *, const char *, const char *, int));
|
||||
E void FDECL(sfo_mvitals, (NHFILE *, struct mvitals *, const char *, const char *, int));
|
||||
E void FDECL(sfo_nhcoord, (NHFILE *, struct nhcoord *, const char *, const char *, int));
|
||||
E void FDECL(sfo_nhrect, (NHFILE *, struct nhrect *, const char *, const char *, int));
|
||||
E void FDECL(sfo_novel_tracking, (NHFILE *, struct novel_tracking *, const char *, const char *, int));
|
||||
E void FDECL(sfo_obj, (NHFILE *, struct obj *, const char *, const char *, int));
|
||||
E void FDECL(sfo_objclass, (NHFILE *, struct objclass *, const char *, const char *, int));
|
||||
E void FDECL(sfo_obj_split, (NHFILE *, struct obj_split *, const char *, const char *, int));
|
||||
E void FDECL(sfo_oextra, (NHFILE *, struct oextra *, const char *, const char *, int));
|
||||
E void FDECL(sfo_polearm_info, (NHFILE *, struct polearm_info *, const char *, const char *, int));
|
||||
E void FDECL(sfo_prop, (NHFILE *, struct prop *, const char *, const char *, int));
|
||||
E void FDECL(sfo_q_score, (NHFILE *, struct q_score *, const char *, const char *, int));
|
||||
E void FDECL(sfo_rm, (NHFILE *, struct rm *, const char *, const char *, int));
|
||||
E void FDECL(sfo_s_level, (NHFILE *, struct s_level *, const char *, const char *, int));
|
||||
E void FDECL(sfo_savefile_info, (NHFILE *, struct savefile_info *, const char *, const char *, int));
|
||||
E void FDECL(sfo_skills, (NHFILE *, struct skills *, const char *, const char *, int));
|
||||
E void FDECL(sfo_spell, (NHFILE *, struct spell *, const char *, const char *, int));
|
||||
E void FDECL(sfo_stairway, (NHFILE *, struct stairway *, const char *, const char *, int));
|
||||
E void FDECL(sfo_takeoff_info, (NHFILE *, struct takeoff_info *, const char *, const char *, int));
|
||||
E void FDECL(sfo_tin_info, (NHFILE *, struct tin_info *, const char *, const char *, int));
|
||||
E void FDECL(sfo_trap, (NHFILE *, struct trap *, const char *, const char *, int));
|
||||
E void FDECL(sfo_tribute_info, (NHFILE *, struct tribute_info *, const char *, const char *, int));
|
||||
E void FDECL(sfo_u_achieve, (NHFILE *, struct u_achieve *, const char *, const char *, int));
|
||||
E void FDECL(sfo_u_conduct, (NHFILE *, struct u_conduct *, const char *, const char *, int));
|
||||
E void FDECL(sfo_u_event, (NHFILE *, struct u_event *, const char *, const char *, int));
|
||||
E void FDECL(sfo_u_have, (NHFILE *, struct u_have *, const char *, const char *, int));
|
||||
E void FDECL(sfo_u_realtime, (NHFILE *, struct u_realtime *, const char *, const char *, int));
|
||||
E void FDECL(sfo_u_roleplay, (NHFILE *, struct u_roleplay *, const char *, const char *, int));
|
||||
E void FDECL(sfo_version_info, (NHFILE *, struct version_info *, const char *, const char *, int));
|
||||
E void FDECL(sfo_victual_info, (NHFILE *, struct victual_info *, const char *, const char *, int));
|
||||
E void FDECL(sfo_vlaunchinfo, (NHFILE *, union vlaunchinfo *, const char *, const char *, int));
|
||||
E void FDECL(sfo_vptrs, (NHFILE *, union vptrs *, const char *, const char *, int));
|
||||
E void FDECL(sfo_warntype_info, (NHFILE *, struct warntype_info *, const char *, const char *, int));
|
||||
E void FDECL(sfo_you, (NHFILE *, struct you *, const char *, const char *, int));
|
||||
/* generated input functions */
|
||||
E void FDECL(sfi_align, (NHFILE *, struct align *, const char *, const char *, int));
|
||||
E void FDECL(sfi_attribs, (NHFILE *, struct attribs *, const char *, const char *, int));
|
||||
E void FDECL(sfi_bill_x, (NHFILE *, struct bill_x *, const char *, const char *, int));
|
||||
E void FDECL(sfi_book_info, (NHFILE *, struct book_info *, const char *, const char *, int));
|
||||
E void FDECL(sfi_branch, (NHFILE *, struct branch *, const char *, const char *, int));
|
||||
E void FDECL(sfi_bubble, (NHFILE *, struct bubble *, const char *, const char *, int));
|
||||
E void FDECL(sfi_cemetery, (NHFILE *, struct cemetery *, const char *, const char *, int));
|
||||
E void FDECL(sfi_context_info, (NHFILE *, struct context_info *, const char *, const char *, int));
|
||||
E void FDECL(sfi_d_flags, (NHFILE *, struct d_flags *, const char *, const char *, int));
|
||||
E void FDECL(sfi_d_level, (NHFILE *, struct d_level *, const char *, const char *, int));
|
||||
E void FDECL(sfi_damage, (NHFILE *, struct damage *, const char *, const char *, int));
|
||||
E void FDECL(sfi_dest_area, (NHFILE *, struct dest_area *, const char *, const char *, int));
|
||||
E void FDECL(sfi_dgn_topology, (NHFILE *, struct dgn_topology *, const char *, const char *, int));
|
||||
E void FDECL(sfi_dig_info, (NHFILE *, struct dig_info *, const char *, const char *, int));
|
||||
E void FDECL(sfi_dungeon, (NHFILE *, struct dungeon *, const char *, const char *, int));
|
||||
E void FDECL(sfi_edog, (NHFILE *, struct edog *, const char *, const char *, int));
|
||||
E void FDECL(sfi_egd, (NHFILE *, struct egd *, const char *, const char *, int));
|
||||
E void FDECL(sfi_emin, (NHFILE *, struct emin *, const char *, const char *, int));
|
||||
E void FDECL(sfi_engr, (NHFILE *, struct engr *, const char *, const char *, int));
|
||||
E void FDECL(sfi_epri, (NHFILE *, struct epri *, const char *, const char *, int));
|
||||
E void FDECL(sfi_eshk, (NHFILE *, struct eshk *, const char *, const char *, int));
|
||||
E void FDECL(sfi_fakecorridor, (NHFILE *, struct fakecorridor *, const char *, const char *, int));
|
||||
E void FDECL(sfi_fe, (NHFILE *, struct fe *, const char *, const char *, int));
|
||||
E void FDECL(sfi_flag, (NHFILE *, struct flag *, const char *, const char *, int));
|
||||
E void FDECL(sfi_fruit, (NHFILE *, struct fruit *, const char *, const char *, int));
|
||||
E void FDECL(sfi_kinfo, (NHFILE *, struct kinfo *, const char *, const char *, int));
|
||||
E void FDECL(sfi_levelflags, (NHFILE *, struct levelflags *, const char *, const char *, int));
|
||||
E void FDECL(sfi_linfo, (NHFILE *, struct linfo *, const char *, const char *, int));
|
||||
E void FDECL(sfi_ls_t, (NHFILE *, struct ls_t *, const char *, const char *, int));
|
||||
E void FDECL(sfi_mapseen_feat, (NHFILE *, struct mapseen_feat *, const char *, const char *, int));
|
||||
E void FDECL(sfi_mapseen_flags, (NHFILE *, struct mapseen_flags *, const char *, const char *, int));
|
||||
E void FDECL(sfi_mapseen_rooms, (NHFILE *, struct mapseen_rooms *, const char *, const char *, int));
|
||||
E void FDECL(sfi_mapseen, (NHFILE *, struct mapseen *, const char *, const char *, int));
|
||||
E void FDECL(sfi_mextra, (NHFILE *, struct mextra *, const char *, const char *, int));
|
||||
E void FDECL(sfi_mkroom, (NHFILE *, struct mkroom *, const char *, const char *, int));
|
||||
E void FDECL(sfi_monst, (NHFILE *, struct monst *, const char *, const char *, int));
|
||||
E void FDECL(sfi_mvitals, (NHFILE *, struct mvitals *, const char *, const char *, int));
|
||||
E void FDECL(sfi_nhcoord, (NHFILE *, struct nhcoord *, const char *, const char *, int));
|
||||
E void FDECL(sfi_nhrect, (NHFILE *, struct nhrect *, const char *, const char *, int));
|
||||
E void FDECL(sfi_novel_tracking, (NHFILE *, struct novel_tracking *, const char *, const char *, int));
|
||||
E void FDECL(sfi_obj, (NHFILE *, struct obj *, const char *, const char *, int));
|
||||
E void FDECL(sfi_objclass, (NHFILE *, struct objclass *, const char *, const char *, int));
|
||||
E void FDECL(sfi_obj_split, (NHFILE *, struct obj_split *, const char *, const char *, int));
|
||||
E void FDECL(sfi_oextra, (NHFILE *, struct oextra *, const char *, const char *, int));
|
||||
E void FDECL(sfi_polearm_info, (NHFILE *, struct polearm_info *, const char *, const char *, int));
|
||||
E void FDECL(sfi_prop, (NHFILE *, struct prop *, const char *, const char *, int));
|
||||
E void FDECL(sfi_q_score, (NHFILE *, struct q_score *, const char *, const char *, int));
|
||||
E void FDECL(sfi_rm, (NHFILE *, struct rm *, const char *, const char *, int));
|
||||
E void FDECL(sfi_s_level, (NHFILE *, struct s_level *, const char *, const char *, int));
|
||||
E void FDECL(sfi_savefile_info, (NHFILE *, struct savefile_info *, const char *, const char *, int));
|
||||
E void FDECL(sfi_skills, (NHFILE *, struct skills *, const char *, const char *, int));
|
||||
E void FDECL(sfi_spell, (NHFILE *, struct spell *, const char *, const char *, int));
|
||||
E void FDECL(sfi_stairway, (NHFILE *, struct stairway *, const char *, const char *, int));
|
||||
E void FDECL(sfi_takeoff_info, (NHFILE *, struct takeoff_info *, const char *, const char *, int));
|
||||
E void FDECL(sfi_tin_info, (NHFILE *, struct tin_info *, const char *, const char *, int));
|
||||
E void FDECL(sfi_trap, (NHFILE *, struct trap *, const char *, const char *, int));
|
||||
E void FDECL(sfi_tribute_info, (NHFILE *, struct tribute_info *, const char *, const char *, int));
|
||||
E void FDECL(sfi_u_achieve, (NHFILE *, struct u_achieve *, const char *, const char *, int));
|
||||
E void FDECL(sfi_u_conduct, (NHFILE *, struct u_conduct *, const char *, const char *, int));
|
||||
E void FDECL(sfi_u_event, (NHFILE *, struct u_event *, const char *, const char *, int));
|
||||
E void FDECL(sfi_u_have, (NHFILE *, struct u_have *, const char *, const char *, int));
|
||||
E void FDECL(sfi_u_realtime, (NHFILE *, struct u_realtime *, const char *, const char *, int));
|
||||
E void FDECL(sfi_u_roleplay, (NHFILE *, struct u_roleplay *, const char *, const char *, int));
|
||||
E void FDECL(sfi_version_info, (NHFILE *, struct version_info *, const char *, const char *, int));
|
||||
E void FDECL(sfi_victual_info, (NHFILE *, struct victual_info *, const char *, const char *, int));
|
||||
E void FDECL(sfi_vlaunchinfo, (NHFILE *, union vlaunchinfo *, const char *, const char *, int));
|
||||
E void FDECL(sfi_vptrs, (NHFILE *, union vptrs *, const char *, const char *, int));
|
||||
E void FDECL(sfi_warntype_info, (NHFILE *, struct warntype_info *, const char *, const char *, int));
|
||||
E void FDECL(sfi_you, (NHFILE *, struct you *, const char *, const char *, int));
|
||||
#endif /* SFPROTO_H */
|
||||
345
include/sp_lev.h
345
include/sp_lev.h
@@ -42,148 +42,9 @@ enum lvlinit_types {
|
||||
LVLINIT_ROGUE
|
||||
};
|
||||
|
||||
/* max. # of random registers */
|
||||
#define MAX_REGISTERS 10
|
||||
|
||||
/* max. nested depth of subrooms */
|
||||
#define MAX_NESTED_ROOMS 5
|
||||
|
||||
/* max. # of opcodes per special level */
|
||||
#define SPCODER_MAX_RUNTIME 65536
|
||||
|
||||
/* Opcodes for creating the level
|
||||
* If you change these, also change opcodestr[] in util/lev_main.c
|
||||
*/
|
||||
enum opcode_defs {
|
||||
SPO_NULL = 0,
|
||||
SPO_MESSAGE,
|
||||
SPO_MONSTER,
|
||||
SPO_OBJECT,
|
||||
SPO_ENGRAVING,
|
||||
SPO_ROOM,
|
||||
SPO_SUBROOM,
|
||||
SPO_DOOR,
|
||||
SPO_STAIR,
|
||||
SPO_LADDER,
|
||||
SPO_ALTAR,
|
||||
SPO_FOUNTAIN,
|
||||
SPO_SINK,
|
||||
SPO_POOL,
|
||||
SPO_TRAP,
|
||||
SPO_GOLD,
|
||||
SPO_CORRIDOR,
|
||||
SPO_LEVREGION,
|
||||
SPO_DRAWBRIDGE,
|
||||
SPO_MAZEWALK,
|
||||
SPO_NON_DIGGABLE,
|
||||
SPO_NON_PASSWALL,
|
||||
SPO_WALLIFY,
|
||||
SPO_MAP,
|
||||
SPO_ROOM_DOOR,
|
||||
SPO_REGION,
|
||||
SPO_MINERALIZE,
|
||||
SPO_CMP,
|
||||
SPO_JMP,
|
||||
SPO_JL,
|
||||
SPO_JLE,
|
||||
SPO_JG,
|
||||
SPO_JGE,
|
||||
SPO_JE,
|
||||
SPO_JNE,
|
||||
SPO_TERRAIN,
|
||||
SPO_REPLACETERRAIN,
|
||||
SPO_EXIT,
|
||||
SPO_ENDROOM,
|
||||
SPO_POP_CONTAINER,
|
||||
SPO_PUSH,
|
||||
SPO_POP,
|
||||
SPO_RN2,
|
||||
SPO_DEC,
|
||||
SPO_INC,
|
||||
SPO_MATH_ADD,
|
||||
SPO_MATH_SUB,
|
||||
SPO_MATH_MUL,
|
||||
SPO_MATH_DIV,
|
||||
SPO_MATH_MOD,
|
||||
SPO_MATH_SIGN,
|
||||
SPO_COPY,
|
||||
SPO_END_MONINVENT,
|
||||
SPO_GRAVE,
|
||||
SPO_FRAME_PUSH,
|
||||
SPO_FRAME_POP,
|
||||
SPO_CALL,
|
||||
SPO_RETURN,
|
||||
SPO_INITLEVEL,
|
||||
SPO_LEVEL_FLAGS,
|
||||
SPO_VAR_INIT, /* variable_name data */
|
||||
SPO_SHUFFLE_ARRAY,
|
||||
SPO_DICE,
|
||||
|
||||
SPO_SEL_ADD,
|
||||
SPO_SEL_POINT,
|
||||
SPO_SEL_RECT,
|
||||
SPO_SEL_FILLRECT,
|
||||
SPO_SEL_LINE,
|
||||
SPO_SEL_RNDLINE,
|
||||
SPO_SEL_GROW,
|
||||
SPO_SEL_FLOOD,
|
||||
SPO_SEL_RNDCOORD,
|
||||
SPO_SEL_ELLIPSE,
|
||||
SPO_SEL_FILTER,
|
||||
SPO_SEL_GRADIENT,
|
||||
SPO_SEL_COMPLEMENT,
|
||||
|
||||
MAX_SP_OPCODES
|
||||
};
|
||||
|
||||
/* MONSTER and OBJECT can take a variable number of parameters,
|
||||
* they also pop different # of values from the stack. So,
|
||||
* first we pop a value that tells what the _next_ value will
|
||||
* mean.
|
||||
*/
|
||||
/* MONSTER */
|
||||
enum sp_mon_var_flags {
|
||||
SP_M_V_PEACEFUL = 0,
|
||||
SP_M_V_ALIGN,
|
||||
SP_M_V_ASLEEP,
|
||||
SP_M_V_APPEAR,
|
||||
SP_M_V_NAME,
|
||||
SP_M_V_FEMALE,
|
||||
SP_M_V_INVIS,
|
||||
SP_M_V_CANCELLED,
|
||||
SP_M_V_REVIVED,
|
||||
SP_M_V_AVENGE,
|
||||
SP_M_V_FLEEING,
|
||||
SP_M_V_BLINDED,
|
||||
SP_M_V_PARALYZED,
|
||||
SP_M_V_STUNNED,
|
||||
SP_M_V_CONFUSED,
|
||||
SP_M_V_SEENTRAPS,
|
||||
|
||||
SP_M_V_END
|
||||
};
|
||||
|
||||
/* OBJECT */
|
||||
enum sp_obj_var_flags {
|
||||
SP_O_V_SPE = 0,
|
||||
SP_O_V_CURSE,
|
||||
SP_O_V_CORPSENM,
|
||||
SP_O_V_NAME,
|
||||
SP_O_V_QUAN,
|
||||
SP_O_V_BURIED,
|
||||
SP_O_V_LIT,
|
||||
SP_O_V_ERODED,
|
||||
SP_O_V_LOCKED,
|
||||
SP_O_V_TRAPPED,
|
||||
SP_O_V_RECHARGED,
|
||||
SP_O_V_INVIS,
|
||||
SP_O_V_GREASED,
|
||||
SP_O_V_BROKEN,
|
||||
SP_O_V_COORD,
|
||||
|
||||
SP_O_V_END
|
||||
};
|
||||
|
||||
/* When creating objects, we need to know whether
|
||||
* it's a container and/or contents.
|
||||
*/
|
||||
@@ -199,25 +60,6 @@ enum sp_obj_var_flags {
|
||||
#define SEL_GRADIENT_RADIAL 0
|
||||
#define SEL_GRADIENT_SQUARE 1
|
||||
|
||||
/* variable types */
|
||||
#define SPOVAR_NULL 0x00
|
||||
#define SPOVAR_INT 0x01 /* l */
|
||||
#define SPOVAR_STRING 0x02 /* str */
|
||||
#define SPOVAR_VARIABLE 0x03 /* str (contains the variable name) */
|
||||
#define SPOVAR_COORD \
|
||||
0x04 /* coordinate, encoded in l; use SP_COORD_X() and SP_COORD_Y() */
|
||||
#define SPOVAR_REGION 0x05 /* region, encoded in l; use SP_REGION_X1() etc \
|
||||
*/
|
||||
#define SPOVAR_MAPCHAR 0x06 /* map char, in l */
|
||||
#define SPOVAR_MONST \
|
||||
0x07 /* monster class & specific monster, encoded in l; use SP_MONST_... \
|
||||
*/
|
||||
#define SPOVAR_OBJ \
|
||||
0x08 /* object class & specific object type, encoded in l; use \
|
||||
SP_OBJ_... */
|
||||
#define SPOVAR_SEL 0x09 /* selection. char[COLNO][ROWNO] in str */
|
||||
#define SPOVAR_ARRAY 0x40 /* used in splev_var & lc_vardefs, not in opvar */
|
||||
|
||||
#define SP_COORD_IS_RANDOM 0x01000000L
|
||||
/* Humidity flags for get_location() and friends, used with
|
||||
* SP_COORD_PACK_RANDOM() */
|
||||
@@ -234,76 +76,18 @@ enum sp_obj_var_flags {
|
||||
#define SP_COORD_PACK(x, y) (((x) & 0xff) + (((y) & 0xff) << 16))
|
||||
#define SP_COORD_PACK_RANDOM(f) (SP_COORD_IS_RANDOM | (f))
|
||||
|
||||
#define SP_REGION_X1(l) (l & 0xff)
|
||||
#define SP_REGION_Y1(l) ((l >> 8) & 0xff)
|
||||
#define SP_REGION_X2(l) ((l >> 16) & 0xff)
|
||||
#define SP_REGION_Y2(l) ((l >> 24) & 0xff)
|
||||
#define SP_REGION_PACK(x1, y1, x2, y2) \
|
||||
(((x1) & 0xff) + (((y1) & 0xff) << 8) + (((x2) & 0xff) << 16) \
|
||||
+ (((y2) & 0xff) << 24))
|
||||
|
||||
/* permonst index, object index, and lit value might be negative;
|
||||
* add 10 to accept -1 through -9 while forcing non-negative for bit shift
|
||||
*/
|
||||
#define SP_MONST_CLASS(l) ((l) & 0xff)
|
||||
#define SP_MONST_PM(l) ((((l) >> 8) & 0xffff) - 10)
|
||||
#define SP_MONST_PACK(pm, cls) (((10 + (pm)) << 8) | ((cls) & 0xff))
|
||||
|
||||
#define SP_OBJ_CLASS(l) ((l) & 0xff)
|
||||
#define SP_OBJ_TYP(l) ((((l) >> 8) & 0xffff) - 10)
|
||||
#define SP_OBJ_PACK(ob, cls) (((10 + (ob)) << 8) | ((cls) & 0xff))
|
||||
|
||||
#define SP_MAPCHAR_TYP(l) ((l) & 0xff)
|
||||
#define SP_MAPCHAR_LIT(l) ((((l) >> 8) & 0xffff) - 10)
|
||||
#define SP_MAPCHAR_PACK(typ, lit) (((10 + (lit)) << 8) | ((typ) & 0xff))
|
||||
|
||||
struct splev_var {
|
||||
struct splev_var *next;
|
||||
char *name;
|
||||
xchar svtyp; /* SPOVAR_foo */
|
||||
union {
|
||||
struct opvar *value;
|
||||
struct opvar **arrayvalues;
|
||||
} data;
|
||||
long array_len;
|
||||
};
|
||||
|
||||
struct splevstack {
|
||||
long depth;
|
||||
long depth_alloc;
|
||||
struct opvar **stackdata;
|
||||
};
|
||||
|
||||
struct sp_frame {
|
||||
struct sp_frame *next;
|
||||
struct splevstack *stack;
|
||||
struct splev_var *variables;
|
||||
long n_opcode;
|
||||
};
|
||||
|
||||
struct sp_coder {
|
||||
struct splevstack *stack;
|
||||
struct sp_frame *frame;
|
||||
int premapped;
|
||||
boolean solidify;
|
||||
struct mkroom *croom;
|
||||
int room_stack;
|
||||
struct mkroom *tmproomlist[MAX_NESTED_ROOMS + 1];
|
||||
boolean failed_room[MAX_NESTED_ROOMS + 1];
|
||||
int n_subroom;
|
||||
boolean exit_script;
|
||||
int lvl_is_joined;
|
||||
boolean check_inaccessibles;
|
||||
|
||||
int opcode; /* current opcode */
|
||||
struct opvar *opdat; /* current push data (req. opcode == SPO_PUSH) */
|
||||
};
|
||||
|
||||
/* special level coder CPU flags */
|
||||
#define SP_CPUFLAG_LT 1
|
||||
#define SP_CPUFLAG_GT 2
|
||||
#define SP_CPUFLAG_EQ 4
|
||||
#define SP_CPUFLAG_ZERO 8
|
||||
|
||||
/*
|
||||
* Structures manipulated by the special levels loader & compiler
|
||||
*/
|
||||
@@ -315,15 +99,6 @@ typedef struct {
|
||||
int x, y;
|
||||
} unpacked_coord;
|
||||
|
||||
typedef struct {
|
||||
int cmp_what;
|
||||
int cmp_val;
|
||||
} opcmp;
|
||||
|
||||
typedef struct {
|
||||
long jmp_target;
|
||||
} opjmp;
|
||||
|
||||
typedef struct {
|
||||
xchar init_style; /* one of LVLINIT_foo */
|
||||
long flags;
|
||||
@@ -416,122 +191,4 @@ typedef struct {
|
||||
char **map;
|
||||
} mazepart;
|
||||
|
||||
typedef struct {
|
||||
int opcode;
|
||||
struct opvar *opdat;
|
||||
} _opcode;
|
||||
|
||||
typedef struct {
|
||||
_opcode *opcodes;
|
||||
long n_opcodes;
|
||||
} sp_lev;
|
||||
|
||||
typedef struct {
|
||||
xchar x, y, direction, count, lit;
|
||||
char typ;
|
||||
} spill;
|
||||
|
||||
/* only used by lev_comp */
|
||||
struct lc_funcdefs_parm {
|
||||
char *name;
|
||||
char parmtype;
|
||||
struct lc_funcdefs_parm *next;
|
||||
};
|
||||
|
||||
struct lc_funcdefs {
|
||||
struct lc_funcdefs *next;
|
||||
char *name;
|
||||
long addr;
|
||||
sp_lev code;
|
||||
long n_called;
|
||||
struct lc_funcdefs_parm *params;
|
||||
long n_params;
|
||||
};
|
||||
|
||||
struct lc_vardefs {
|
||||
struct lc_vardefs *next;
|
||||
char *name;
|
||||
long var_type; /* SPOVAR_foo */
|
||||
long n_used;
|
||||
};
|
||||
|
||||
struct lc_breakdef {
|
||||
struct lc_breakdef *next;
|
||||
struct opvar *breakpoint;
|
||||
int break_depth;
|
||||
};
|
||||
|
||||
/*
|
||||
* Quick! Avert your eyes while you still have a chance!
|
||||
*/
|
||||
#ifdef SPEC_LEV
|
||||
/* compiling lev_comp rather than nethack */
|
||||
/* clang format off */
|
||||
#ifdef USE_OLDARGS
|
||||
#ifndef VA_TYPE
|
||||
typedef const char *vA;
|
||||
#define VA_TYPE
|
||||
#endif
|
||||
/* hack to avoid "warning: cast to 'vA' (aka 'const char *') from smaller
|
||||
integer type 'int' [-Wint-to-pointer-cast]" */
|
||||
#define vA_(a) ((vA) (long) a)
|
||||
#undef VA_ARGS /* redefine with the maximum number actually used */
|
||||
#undef VA_SHIFT /* ditto */
|
||||
#undef VA_PASS1
|
||||
#define VA_ARGS \
|
||||
arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, \
|
||||
arg12, arg13, arg14
|
||||
/* Unlike in the core, lev_comp's VA_SHIFT should be completely safe,
|
||||
because callers always pass all these arguments. */
|
||||
#define VA_SHIFT() \
|
||||
(arg1 = arg2, arg2 = arg3, arg3 = arg4, arg4 = arg5, arg5 = arg6, \
|
||||
arg6 = arg7, arg7 = arg8, arg8 = arg9, arg9 = arg10, arg10 = arg11, \
|
||||
arg11 = arg12, arg12 = arg13, arg13 = arg14, arg14 = 0)
|
||||
/* standard NULL may be either (void *)0 or plain 0, both of
|
||||
which would need to be explicitly cast to (char *) here */
|
||||
#define VA_PASS1(a1) \
|
||||
vA_(a1), vA_(0), vA_(0), vA_(0), vA_(0), vA_(0), vA_(0), vA_(0), \
|
||||
vA_(0), vA_(0), vA_(0), vA_(0), vA_(0), vA_(0)
|
||||
#define VA_PASS2(a1,a2) \
|
||||
vA_(a1), vA_(a2), vA_(0), vA_(0), vA_(0), vA_(0), vA_(0), vA_(0), \
|
||||
vA_(0), vA_(0), vA_(0), vA_(0), vA_(0), vA_(0)
|
||||
#define VA_PASS3(a1,a2,a3) \
|
||||
vA_(a1), vA_(a2), vA_(a3), vA_(0), vA_(0), vA_(0), vA_(0), vA_(0), \
|
||||
vA_(0), vA_(0), vA_(0), vA_(0), vA_(0), vA_(0)
|
||||
#define VA_PASS4(a1,a2,a3,a4) \
|
||||
vA_(a1), vA_(a2), vA_(a3), vA_(a4), vA_(0), vA_(0), vA_(0), vA_(0), \
|
||||
vA_(0), vA_(0), vA_(0), vA_(0), vA_(0), vA_(0)
|
||||
#define VA_PASS5(a1,a2,a3,a4,a5) \
|
||||
vA_(a1), vA_(a2), vA_(a3), vA_(a4), vA_(a5), vA_(0), vA_(0), vA_(0), \
|
||||
vA_(0), vA_(0), vA_(0), vA_(0), vA_(0), vA_(0)
|
||||
#define VA_PASS7(a1,a2,a3,a4,a5,a6,a7) \
|
||||
vA_(a1), vA_(a2), vA_(a3), vA_(a4), vA_(a5), vA_(a6), vA_(a7), vA_(0), \
|
||||
vA_(0), vA_(0), vA_(0), vA_(0), vA_(0), vA_(0)
|
||||
#define VA_PASS8(a1,a2,a3,a4,a5,a6,a7,a8) \
|
||||
vA_(a1), vA_(a2), vA_(a3), vA_(a4), vA_(a5), vA_(a6), vA_(a7), vA_(a8), \
|
||||
vA_(0), vA_(0), vA_(0), vA_(0), vA_(0), vA_(0)
|
||||
#define VA_PASS9(a1,a2,a3,a4,a5,a6,a7,a8,a9) \
|
||||
vA_(a1), vA_(a2), vA_(a3), vA_(a4), vA_(a5), vA_(a6), vA_(a7), vA_(a8), \
|
||||
vA_(a9), vA_(0), vA_(0), vA_(0), vA_(0), vA_(0)
|
||||
#define VA_PASS14(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14) \
|
||||
vA_(a1), vA_(a2), vA_(a3), vA_(a4), vA_(a5), vA_(a6), vA_(a7), vA_(a8), \
|
||||
vA_(a9), vA_(a10), vA_(a11), vA_(a12), vA_(a13), vA_(a14)
|
||||
#else /*!USE_OLDARGS*/
|
||||
/* USE_STDARG and USE_VARARGS don't need to pass dummy arguments
|
||||
or cast real ones */
|
||||
#define VA_PASS1(a1) a1
|
||||
#define VA_PASS2(a1,a2) a1, a2
|
||||
#define VA_PASS3(a1,a2,a3) a1, a2, a3
|
||||
#define VA_PASS4(a1,a2,a3,a4) a1, a2, a3, a4
|
||||
#define VA_PASS5(a1,a2,a3,a4,a5) a1, a2, a3, a4, a5
|
||||
#define VA_PASS7(a1,a2,a3,a4,a5,a6,a7) a1, a2, a3, a4, a5, a6, a7
|
||||
#define VA_PASS8(a1,a2,a3,a4,a5,a6,a7,a8) a1, a2, a3, a4, a5, a6, a7, a8
|
||||
#define VA_PASS9(a1,a2,a3,a4,a5,a6,a7,a8,a9) a1, a2, a3, a4, a5, a6, a7, a8, a9
|
||||
#define VA_PASS14(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14) \
|
||||
a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14
|
||||
#endif /*?USE_OLDARGS*/
|
||||
/* clang format on */
|
||||
/* You were warned to avert your eyes.... */
|
||||
#endif /*SPEC_LEV*/
|
||||
|
||||
#endif /* SP_LEV_H */
|
||||
|
||||
@@ -45,6 +45,12 @@ struct sysopt {
|
||||
/* save and bones format */
|
||||
int saveformat[2]; /* primary and onetime conversion */
|
||||
int bonesformat[2]; /* primary and onetime conversion */
|
||||
|
||||
/* enable accessibility options */
|
||||
int accessibility;
|
||||
#ifdef WIN32
|
||||
int portable_device_paths; /* nethack configuration for a portable device */
|
||||
#endif
|
||||
};
|
||||
|
||||
extern struct sysopt sysopt;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 system.h $NHDT-Date: 1550268586 2019/02/15 22:09:46 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.17 $ */
|
||||
/* NetHack 3.6 system.h $NHDT-Date: 1574825213 2019/11/27 03:26:53 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.22 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/*-Copyright (c) Robert Patrick Rankin, 2017. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -6,8 +6,8 @@
|
||||
#ifndef SYSTEM_H
|
||||
#define SYSTEM_H
|
||||
|
||||
#if !defined(WIN32)
|
||||
#if !defined(__cplusplus) && !defined(__GO32__)
|
||||
|
||||
#define E extern
|
||||
|
||||
/* some old <sys/types.h> may not define off_t and size_t; if your system is
|
||||
@@ -339,7 +339,7 @@ E int FDECL(memcmp, (const void *, const void *, size_t));
|
||||
E void *FDECL(memcpy, (void *, const void *, size_t));
|
||||
E void *FDECL(memset, (void *, int, size_t));
|
||||
#else
|
||||
#if defined(AZTEC_50) || defined(NHSTDC) || defined(WIN32)
|
||||
#if defined(AZTEC_50) || defined(NHSTDC))
|
||||
E int FDECL(memcmp, (const void *, const void *, size_t));
|
||||
E void *FDECL(memcpy, (void *, const void *, size_t));
|
||||
E void *FDECL(memset, (void *, int, size_t));
|
||||
@@ -453,7 +453,7 @@ E char *FDECL(rindex, (const char *, int));
|
||||
* If your system defines sprintf, et al, in stdio.h, add to the initial
|
||||
* #if.
|
||||
*/
|
||||
#if defined(ULTRIX) || defined(__DECC) || defined(__SASC_60) || defined(WIN32)
|
||||
#if defined(ULTRIX) || defined(__DECC) || defined(__SASC_60)
|
||||
#define SPRINTF_PROTO
|
||||
#endif
|
||||
#if (defined(SUNOS4) && defined(__STDC__)) || defined(_AIX32)
|
||||
@@ -527,7 +527,7 @@ E char *FDECL(tgetstr, (const char *, char **));
|
||||
E char *FDECL(tgoto, (const char *, int, int));
|
||||
#endif
|
||||
|
||||
#if defined(ALLOC_C) || defined(MAKEDEFS_C)
|
||||
#if defined(ALLOC_C) || defined(MAKEDEFS_C) || defined(MDLIB_C)
|
||||
E genericptr_t FDECL(malloc, (size_t));
|
||||
E genericptr_t FDECL(realloc, (genericptr_t, size_t));
|
||||
#endif
|
||||
@@ -567,5 +567,10 @@ E int FDECL(atoi, (const char *));
|
||||
#undef E
|
||||
|
||||
#endif /* !__cplusplus && !__GO32__ */
|
||||
#endif /* WIN32 */
|
||||
|
||||
#if !defined(CROSSCOMPILE) || defined(CROSSCOMPILE_TARGET)
|
||||
#include "nhlua.h"
|
||||
#endif
|
||||
|
||||
#endif /* SYSTEM_H */
|
||||
|
||||
@@ -172,7 +172,13 @@ PANICTRACE_GDB=2 #at conclusion of panic, show a call traceback and then
|
||||
* The remainder of the file should not need to be changed.
|
||||
*/
|
||||
|
||||
/* data librarian defs */
|
||||
/* This used to be force-defined for VMS in topten.c, but with
|
||||
* the global variable consolidation into g in 3.7, it has to be
|
||||
* defined here so that decl.h includes the field in g.
|
||||
*/
|
||||
#define UPDATE_RECORD_IN_PLACE
|
||||
|
||||
/* data librarian defs */
|
||||
#ifdef DLB
|
||||
#define DLBFILE "nh-data.dlb"
|
||||
/*
|
||||
|
||||
@@ -14,6 +14,7 @@ struct window_procs {
|
||||
* '+' are reserved for processors. */
|
||||
unsigned long wincap; /* window port capability options supported */
|
||||
unsigned long wincap2; /* additional window port capability options */
|
||||
boolean has_color[CLR_MAX];
|
||||
void FDECL((*win_init_nhwindows), (int *, char **));
|
||||
void NDECL((*win_player_selection));
|
||||
void NDECL((*win_askname));
|
||||
@@ -450,6 +451,7 @@ extern void FDECL(safe_status_enablefield,
|
||||
extern void FDECL(safe_status_update, (int, genericptr_t, int, int, int, unsigned long *));
|
||||
extern boolean NDECL(safe_can_suspend);
|
||||
extern void FDECL(stdio_raw_print, (const char *));
|
||||
extern void FDECL(stdio_nonl_raw_print, (const char *));
|
||||
extern void FDECL(stdio_raw_print_bold, (const char *));
|
||||
extern void NDECL(stdio_wait_synch);
|
||||
extern int NDECL(stdio_nhgetch);
|
||||
|
||||
@@ -114,16 +114,7 @@ E void FDECL(tty_startup, (int *, int *));
|
||||
#ifndef NO_TERMS
|
||||
E void NDECL(tty_shutdown);
|
||||
#endif
|
||||
#if defined(apollo)
|
||||
/* Apollos don't widen old-style function definitions properly -- they try to
|
||||
* be smart and use the prototype, or some such strangeness. So we have to
|
||||
* define UNWIDENDED_PROTOTYPES (in tradstdc.h), which makes CHAR_P below a
|
||||
* char. But the tputs termcap call was compiled as if xputc's argument
|
||||
* actually would be expanded. So here, we have to make an exception. */
|
||||
E void FDECL(xputc, (int));
|
||||
#else
|
||||
E void FDECL(xputc, (CHAR_P));
|
||||
#endif
|
||||
E int FDECL(xputc, (int));
|
||||
E void FDECL(xputs, (const char *));
|
||||
#if defined(SCREEN_VGA) || defined(SCREEN_8514)
|
||||
E void FDECL(xputg, (int, int, unsigned));
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 you.h $NHDT-Date: 1547514642 2019/01/15 01:10:42 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.35 $ */
|
||||
/* NetHack 3.6 you.h $NHDT-Date: 1574648937 2019/11/25 02:28:57 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.41 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/*-Copyright (c) Robert Patrick Rankin, 2016. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -237,14 +237,21 @@ extern const struct Gender genders[]; /* table of available genders */
|
||||
#define uhe() (genders[flags.female ? 1 : 0].he)
|
||||
#define uhim() (genders[flags.female ? 1 : 0].him)
|
||||
#define uhis() (genders[flags.female ? 1 : 0].his)
|
||||
/* pronoun_gender() flag masks */
|
||||
#define PRONOUN_NORMAL 0 /* none of the below */
|
||||
#define PRONOUN_NO_IT 1
|
||||
#define PRONOUN_HALLU 2
|
||||
/* corresponding pronouns for monsters; yields "it" when mtmp can't be seen */
|
||||
#define mhe(mtmp) (genders[pronoun_gender(mtmp, FALSE)].he)
|
||||
#define mhim(mtmp) (genders[pronoun_gender(mtmp, FALSE)].him)
|
||||
#define mhis(mtmp) (genders[pronoun_gender(mtmp, FALSE)].his)
|
||||
#define mhe(mtmp) (genders[pronoun_gender(mtmp, PRONOUN_HALLU)].he)
|
||||
#define mhim(mtmp) (genders[pronoun_gender(mtmp, PRONOUN_HALLU)].him)
|
||||
#define mhis(mtmp) (genders[pronoun_gender(mtmp, PRONOUN_HALLU)].his)
|
||||
/* override "it" if reason is lack of visibility rather than neuter species */
|
||||
#define noit_mhe(mtmp) (genders[pronoun_gender(mtmp, TRUE)].he)
|
||||
#define noit_mhim(mtmp) (genders[pronoun_gender(mtmp, TRUE)].him)
|
||||
#define noit_mhis(mtmp) (genders[pronoun_gender(mtmp, TRUE)].his)
|
||||
#define noit_mhe(mtmp) \
|
||||
(genders[pronoun_gender(mtmp, (PRONOUN_NO_IT | PRONOUN_HALLU))].he)
|
||||
#define noit_mhim(mtmp) \
|
||||
(genders[pronoun_gender(mtmp, (PRONOUN_NO_IT | PRONOUN_HALLU))].him)
|
||||
#define noit_mhis(mtmp) \
|
||||
(genders[pronoun_gender(mtmp, (PRONOUN_NO_IT | PRONOUN_HALLU))].his)
|
||||
|
||||
/*** Unified structure specifying alignment information ***/
|
||||
struct Align {
|
||||
|
||||
Reference in New Issue
Block a user