Merge branch 'master' into win32-x64-working

* master: (354 commits)
  Add missing protos
  a warning bout lc_error
  Add S_poisoncloud to Guidebooks
  ...

Conflicts:
	.gitattributes
	dat/.gitattributes
	doc/.gitattributes
	doc/Guidebook.mn
	include/config.h
	include/decl.h
	include/extern.h
	include/flag.h
	include/hack.h
	include/ntconf.h
	include/sys.h
	include/wceconf.h
	src/apply.c
	src/attrib.c
	src/bones.c
	src/botl.c
	src/dbridge.c
	src/dig.c
	src/do.c
	src/do_name.c
	src/dog.c
	src/dungeon.c
	src/eat.c
	src/end.c
	src/files.c
	src/fountain.c
	src/hack.c
	src/invent.c
	src/light.c
	src/makemon.c
	src/mhitu.c
	src/mklev.c
	src/mkmaze.c
	src/mkobj.c
	src/mkroom.c
	src/mon.c
	src/objnam.c
	src/options.c
	src/pager.c
	src/pickup.c
	src/potion.c
	src/pray.c
	src/questpgr.c
	src/read.c
	src/restore.c
	src/rnd.c
	src/role.c
	src/rumors.c
	src/save.c
	src/shk.c
	src/sit.c
	src/sp_lev.c
	src/sys.c
	src/teleport.c
	src/trap.c
	src/u_init.c
	src/uhitm.c
	src/wield.c
	src/worn.c
	src/zap.c
	sys/amiga/.gitattributes
	sys/mac/.gitattributes
	sys/msdos/.gitattributes
	sys/msdos/pctiles.c
	sys/msdos/vidvga.c
	sys/os2/.gitattributes
	sys/share/.gitattributes
	sys/share/pcmain.c
	sys/unix/.gitattributes
	sys/unix/hints/.gitattributes
	sys/unix/sysconf
	sys/unix/unixmain.c
	sys/vms/.gitattributes
	sys/wince/.gitattributes
	sys/wince/mhstatus.c
	sys/winnt/.gitattributes
	sys/winnt/Makefile.msc
	sys/winnt/nhsetup.bat
	util/lev_comp.l
	util/makedefs.c
	win/X11/winmenu.c
	win/X11/winstat.c
	win/gnome/gnstatus.c
	win/share/tilemap.c
	win/tty/termcap.c
	win/tty/topl.c
	win/tty/wintty.c
This commit is contained in:
Derek S. Ray
2015-04-05 23:42:15 -04:00
197 changed files with 29181 additions and 15618 deletions

1
include/.gitignore vendored
View File

@@ -5,3 +5,4 @@ pm.h
vis_tab.h
dgn_comp.h
lev_comp.h
tile.h

View File

@@ -7,6 +7,10 @@
#ifndef COLOR_H
#define COLOR_H
#ifdef MENU_COLOR_REGEX
#include <regex.h>
#endif
/*
* The color scheme used is tailored for an IBM PC. It consists of the
* standard 8 colors, folowed by their bright counterparts. There are
@@ -51,4 +55,18 @@
#define DRAGON_SILVER CLR_BRIGHT_CYAN
#define HI_ZAP CLR_BRIGHT_BLUE
struct menucoloring {
# ifdef MENU_COLOR_REGEX
# ifdef MENU_COLOR_REGEX_POSIX
regex_t match;
# else
struct re_pattern_buffer match;
# endif
# else
char *match;
# endif
int color, attr;
struct menucoloring *next;
};
#endif /* COLOR_H */

View File

@@ -1,5 +1,4 @@
/* NetHack 3.5 config.h $NHDT-Date: 1425083082 2015/02/28 00:24:42 $ $NHDT-Branch: (no branch, rebasing scshunt-unconditionals) $:$NHDT-Revision: 1.51 $ */
/* NetHack 3.5 config.h $Date: 2012/01/27 20:15:26 $ $Revision: 1.37 $ */
/* NetHack 3.5 config.h $NHDT-Date: 1425083082 2015/02/28 00:24:42 $ $NHDT-Branch: master $:$NHDT-Revision: 1.51 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -187,6 +186,7 @@
#endif
#define LOGFILE "logfile" /* larger file for debugging purposes */
#define XLOGFILE "xlogfile" /* even larger logfile */
#define NEWS "news" /* the file containing the latest hack news */
#define PANICLOG "paniclog" /* log of panic and impossible events */
@@ -316,6 +316,11 @@
#endif /* CHDIR */
/* If GENERIC_USERNAMES is defined, and the user name is found
* in that list, prompt for username instead.
* A public server should probably disable this. */
#define GENERIC_USERNAMES "play player game games nethack nethacker"
/*
* Section 3: Definitions that may vary with system type.
@@ -431,6 +436,14 @@ typedef unsigned char uchar;
* bugs left here.
*/
/* Menucolors */
# define MENU_COLOR_REGEX /* use GNU regex */
/*# define MENU_COLOR_REGEX_POSIX*/ /* use POSIX regex */
/* if neither is defined, uses pmatch()
* pmatch() provides basic globbing: '*' and '?' wildcards.
*/
#define STATUS_VIA_WINDOWPORT /* re-work of the status line updating process */
#define STATUS_HILITES /* support hilites of status fields */
/* #define WINCHAIN*/ /* stacked window systems */

View File

@@ -73,6 +73,11 @@ struct warntype_info {
short speciesidx; /* index of above in mons[] (for save/restore) */
};
struct polearm_info {
struct monst *hitmon; /* the monster we tried to hit last */
unsigned m_id; /* monster id of hitmon, in save file */
};
struct context_info {
unsigned ident; /* social security number for each monster */
unsigned no_of_wizards; /* 0, 1 or 2 (wizard and his shadow) */
@@ -103,6 +108,7 @@ struct context_info {
struct book_info spbook;
struct takeoff_info takeoff;
struct warntype_info warntype;
struct polearm_info polearm;
};
extern NEARDATA struct context_info context;

View File

@@ -1,5 +1,4 @@
/* NetHack 3.5 decl.h $NHDT-Date: 1425081976 2015/02/28 00:06:16 $ $NHDT-Branch: (no branch, rebasing scshunt-unconditionals) $:$NHDT-Revision: 1.50 $ */
/* NetHack 3.5 decl.h $Date: 2011/12/29 20:06:27 $ $Revision: 1.44 $ */
/* NetHack 3.5 decl.h $NHDT-Date: 1425081976 2015/02/28 00:06:16 $ $NHDT-Branch: master $:$NHDT-Revision: 1.50 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -28,6 +27,7 @@ E char SAVEP[];
E NEARDATA int bases[MAXOCLASSES];
E NEARDATA int multi;
E const char *multi_reason;
E NEARDATA int nroom;
E NEARDATA int nsubroom;
E NEARDATA int occtime;
@@ -67,6 +67,8 @@ E struct dgn_topology { /* special dungeon levels for speed */
xchar d_mines_dnum, d_quest_dnum;
d_level d_qstart_level, d_qlocate_level, d_nemesis_level;
d_level d_knox_level;
d_level d_mineend_level;
d_level d_sokoend_level;
} dungeon_topology;
/* macros for accesing the dungeon levels by their old names */
#define oracle_level (dungeon_topology.d_oracle_level)
@@ -97,6 +99,8 @@ E struct dgn_topology { /* special dungeon levels for speed */
#define qlocate_level (dungeon_topology.d_qlocate_level)
#define nemesis_level (dungeon_topology.d_nemesis_level)
#define knox_level (dungeon_topology.d_knox_level)
#define mineend_level (dungeon_topology.d_mineend_level)
#define sokoend_level (dungeon_topology.d_sokoend_level)
E NEARDATA stairway dnstair, upstair; /* stairs up and down */
#define xdnstair (dnstair.sx)
@@ -180,6 +184,7 @@ E NEARDATA struct kinfo {
E long done_money;
E const char *configfile;
E char lastconfigfile[BUFSZ]; /* used for messaging */
E NEARDATA char plname[PL_NSIZ];
E NEARDATA char dogname[];
E NEARDATA char catname[];
@@ -240,6 +245,7 @@ E NEARDATA anything zeroany; /* init'd and defined in decl.c */
#include "you.h"
E NEARDATA struct you u;
E NEARDATA time_t ubirthday;
E NEARDATA struct u_realtime urealtime;
#include "onames.h"
#ifndef PM_H /* (pm.h has already been included via youprop.h) */
@@ -357,9 +363,10 @@ E const char * const monexplain[], invisexplain[], * const oclass_names[];
#define DATAPREFIX 4 /* this one must match hardcoded value in dlb.c */
#define SCOREPREFIX 5
#define LOCKPREFIX 6
#define CONFIGPREFIX 7
#define TROUBLEPREFIX 8
#define PREFIX_COUNT 9
#define SYSCONFPREFIX 7
#define CONFIGPREFIX 8
#define TROUBLEPREFIX 9
#define PREFIX_COUNT 10
/* used in files.c; xxconf.h can override if needed */
# ifndef FQN_MAX_FILENAME
#define FQN_MAX_FILENAME 512

View File

@@ -122,6 +122,8 @@ typedef struct branch {
#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))
#define In_sokoban(x) ((x)->dnum == sokoban_dnum)
#define Inhell In_hell(&u.uz) /* now gehennom */

View File

@@ -1,5 +1,4 @@
/* NetHack 3.5 extern.h $NHDT-Date: 1425081976 2015/02/28 00:06:16 $ $NHDT-Branch: (no branch, rebasing scshunt-unconditionals) $:$NHDT-Revision: 1.390 $ */
/* NetHack 3.5 extern.h $Date: 2013/11/05 00:57:53 $ $Revision: 1.380 $ */
/* NetHack 3.5 extern.h $NHDT-Date: 1426966688 2015/03/21 19:38:08 $ $NHDT-Branch: master $:$NHDT-Revision: 1.411 $ */
/* Copyright (c) Steve Creps, 1988. */
/* NetHack may be freely redistributed. See license for details. */
@@ -26,6 +25,7 @@ E void NDECL(stop_occupation);
E void NDECL(display_gamewindows);
E void NDECL(newgame);
E void FDECL(welcome, (BOOLEAN_P));
E time_t NDECL(get_realtime);
/* ### apply.c ### */
@@ -219,6 +219,7 @@ E boolean FDECL(is_pool, (int,int));
E boolean FDECL(is_lava, (int,int));
E boolean FDECL(is_pool_or_lava, (int,int));
E boolean FDECL(is_ice, (int,int));
E boolean FDECL(is_moat, (int,int));
E int FDECL(is_drawbridge_wall, (int,int));
E boolean FDECL(is_db_wall, (int,int));
E boolean FDECL(find_drawbridge, (int *,int*));
@@ -274,7 +275,7 @@ E int FDECL(use_pick_axe2, (struct obj *));
E boolean FDECL(mdig_tunnel, (struct monst *));
E void FDECL(watch_dig, (struct monst *,XCHAR_P,XCHAR_P,BOOLEAN_P));
E void NDECL(zap_dig);
E struct obj *FDECL(bury_an_obj, (struct obj *));
E struct obj *FDECL(bury_an_obj, (struct obj *, boolean *));
E void FDECL(bury_objs, (int,int));
E void FDECL(unearth_objs, (int,int));
E void FDECL(rot_organic, (ANY_P *, long));
@@ -362,6 +363,7 @@ E void NDECL(heal_legs);
/* ### do_name.c ### */
E int FDECL(getpos, (coord *,BOOLEAN_P,const char *));
E void FDECL(getpos_sethilite, (void (*f)(int) ));
E void FDECL(new_mname, (struct monst *,int));
E void FDECL(free_mname, (struct monst *));
E void FDECL(new_oname, (struct obj *,int));
@@ -385,7 +387,7 @@ E char *FDECL(Adjmonnam, (struct monst *,const char *));
E char *FDECL(Amonnam, (struct monst *));
E char *FDECL(a_monnam, (struct monst *));
E char *FDECL(distant_monnam, (struct monst *,int,char *));
E const char *NDECL(rndmonnam);
E char *FDECL(rndmonnam, (char *));
E const char *FDECL(hcolor, (const char *));
E const char *NDECL(rndcolor);
E const char *NDECL(roguename);
@@ -433,7 +435,6 @@ E int NDECL(doputon);
E void NDECL(find_ac);
E void NDECL(glibr);
E struct obj *FDECL(some_armor,(struct monst *));
E void FDECL(erode_armor, (struct monst *,BOOLEAN_P));
E struct obj *FDECL(stuck_ring, (struct obj *,int));
E struct obj *NDECL(unchanger);
E void NDECL(reset_remarm);
@@ -738,10 +739,15 @@ E void FDECL(free_saved_games, (char**));
#ifdef SELF_RECOVER
E boolean NDECL(recover_savefile);
#endif
E int FDECL(nhclose, (int));
#ifdef SYSCF_FILE
E void NDECL(assure_syscf_file);
#endif
#ifdef HOLD_LOCKFILE_OPEN
E void NDECL(really_close);
#endif
#ifdef DEBUG
E boolean FDECL(showdebug, (const char *));
#endif
/* ### fountain.c ### */
@@ -801,6 +807,7 @@ E boolean FDECL(letter, (CHAR_P));
E char FDECL(highc, (CHAR_P));
E char FDECL(lowc, (CHAR_P));
E char *FDECL(lcase, (char *));
E char *FDECL(ucase, (char *));
E char *FDECL(upstart, (char *));
E char *FDECL(mungspaces, (char *));
E char *FDECL(eos, (char *));
@@ -809,6 +816,7 @@ E void FDECL(copynchars, (char *,const char *,int));
E char FDECL(chrcasecpy, (int,int));
E char *FDECL(strcasecpy, (char *,const char *));
E char *FDECL(s_suffix, (const char *));
E char *FDECL(ing_suffix, (const char *));
E char *FDECL(xcrypt, (const char *,char *));
E boolean FDECL(onlyspace, (const char *));
E char *FDECL(tabexpand, (char *));
@@ -819,6 +827,7 @@ E char *FDECL(sitoa, (int));
E int FDECL(sgn, (int));
E int FDECL(rounddiv, (long,int));
E int FDECL(dist2, (int,int,int,int));
E int FDECL(isqrt, (int));
E int FDECL(distmin, (int,int,int,int));
E boolean FDECL(online2, (int,int,int,int));
E boolean FDECL(pmatch, (const char *,const char *));
@@ -903,7 +912,7 @@ E int NDECL(dopramulet);
E int NDECL(doprtool);
E int NDECL(doprinuse);
E void FDECL(useupf, (struct obj *,long));
E char *FDECL(let_to_name, (CHAR_P,BOOLEAN_P));
E char *FDECL(let_to_name, (CHAR_P,BOOLEAN_P,BOOLEAN_P));
E void NDECL(free_invbuf);
E void NDECL(reassign);
E int NDECL(doorganize);
@@ -1071,6 +1080,7 @@ E int FDECL(sleep_monst, (struct monst *,int,int));
E void FDECL(slept_monst, (struct monst *));
E void FDECL(xdrainenergym, (struct monst *,BOOLEAN_P));
E long FDECL(attk_protection, (int));
E void FDECL(rustm, (struct monst *,struct obj *));
/* ### mhitu.c ### */
@@ -1128,6 +1138,7 @@ E void FDECL(dodoor, (int,int,struct mkroom *));
E void FDECL(mktrap, (int,int,struct mkroom *,coord*));
E void FDECL(mkstairs, (XCHAR_P,XCHAR_P,CHAR_P,struct mkroom *));
E void NDECL(mkinvokearea);
E void FDECL(mineralize, (int, int, int, int, BOOLEAN_P));
/* ### mkmap.c ### */
@@ -1137,7 +1148,7 @@ void FDECL(remove_rooms, (int,int,int,int));
/* ### mkmaze.c ### */
E void FDECL(wallification, (int,int,int,int));
E void FDECL(walkfrom, (int,int));
E void FDECL(walkfrom, (int,int,SCHAR_P));
E void FDECL(makemaz, (const char *));
E void FDECL(mazexy, (coord *));
E void NDECL(bound_digging);
@@ -1146,6 +1157,7 @@ E boolean FDECL(bad_location, (XCHAR_P,XCHAR_P,XCHAR_P,XCHAR_P,XCHAR_P,XCHAR_P))
E void FDECL(place_lregion, (XCHAR_P,XCHAR_P,XCHAR_P,XCHAR_P,
XCHAR_P,XCHAR_P,XCHAR_P,XCHAR_P,
XCHAR_P,d_level *));
E void NDECL(fumaroles);
E void NDECL(movebubbles);
E void NDECL(water_friction);
E void FDECL(save_waterlevel, (int,int));
@@ -1169,7 +1181,7 @@ E struct obj *FDECL(mkobj_at, (CHAR_P,int,int,BOOLEAN_P));
E struct obj *FDECL(mksobj_at, (int,int,int,BOOLEAN_P,BOOLEAN_P));
E struct obj *FDECL(mkobj, (CHAR_P,BOOLEAN_P));
E int NDECL(rndmonnum);
E boolean FDECL(bogon_is_pname, (const char *));
E boolean FDECL(bogon_is_pname, (CHAR_P));
E struct obj *FDECL(splitobj, (struct obj *,long));
E void FDECL(replace_object, (struct obj *,struct obj *));
E void FDECL(bill_dummy_object, (struct obj *));
@@ -1571,6 +1583,9 @@ E void FDECL(parsesymbols, (char *));
E struct symparse *FDECL(match_sym, (char *));
E void NDECL(set_playmode);
E int FDECL(sym_val, (char *));
E boolean FDECL(add_menu_coloring, (char *));
E boolean FDECL(get_menu_coloring, (char *, int *, int *));
E void NDECL(free_menu_coloring);
/* ### pager.c ### */
@@ -1582,6 +1597,7 @@ E int NDECL(dowhatdoes);
E char *FDECL(dowhatdoes_core,(CHAR_P, char *));
E int NDECL(dohelp);
E int NDECL(dohistory);
E int FDECL(do_screen_description, (coord, BOOLEAN_P, int, char *, const char **));
E int FDECL(do_look, (int, coord *));
/* ### pcmain.c ### */
@@ -1726,7 +1742,6 @@ E void FDECL(healup, (int,int,BOOLEAN_P,BOOLEAN_P));
E void FDECL(strange_feeling, (struct obj *,const char *));
E void FDECL(potionhit, (struct monst *,struct obj *,BOOLEAN_P));
E void FDECL(potionbreathe, (struct obj *));
E boolean FDECL(get_wet, (struct obj *));
E int NDECL(dodip);
E void FDECL(mongrantswish, (struct monst **));
E void FDECL(djinni_from_bottle, (struct obj *));
@@ -1815,6 +1830,7 @@ E long NDECL(random);
/* ### read.c ### */
E void FDECL(learnscroll, (struct obj *));
E char *FDECL(tshirt_text, (struct obj *, char *));
E int NDECL(doread);
E boolean FDECL(is_chargeable, (struct obj *));
E void FDECL(recharge, (struct obj *,int));
@@ -1926,6 +1942,7 @@ E const char *NDECL(Goodbye);
/* ### rumors.c ### */
E char *FDECL(getrumor, (int,char *, BOOLEAN_P));
E char *FDECL(get_rnd_text, (const char *, char *));
E void FDECL(outrumor, (int,int));
E void FDECL(outoracle, (BOOLEAN_P, BOOLEAN_P));
E void FDECL(save_oracles, (int,int));
@@ -2061,6 +2078,8 @@ E void FDECL(play_sound_for_message, (const char *));
/* ### sys.c ### */
E void NDECL(sys_early_init);
E void NDECL(sysopt_release);
E void FDECL(sysopt_seduce_set,(int));
/* ### sys/msdos/sound.c ### */
@@ -2203,8 +2222,8 @@ E coord *FDECL(gettrack, (int,int));
/* ### trap.c ### */
E boolean FDECL(burnarmor,(struct monst *));
E boolean FDECL(rust_dmg, (struct obj *,const char *,int,BOOLEAN_P,struct monst *));
E void FDECL(grease_protect, (struct obj *,const char *,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 struct monst *FDECL(animate_statue, (struct obj *,XCHAR_P,XCHAR_P,int,int *));
@@ -2222,8 +2241,11 @@ E void NDECL(float_up);
E void FDECL(fill_pit, (int,int));
E int FDECL(float_down, (long, long));
E void NDECL(climb_pit);
E int FDECL(fire_damage, (struct obj *,BOOLEAN_P,BOOLEAN_P,XCHAR_P,XCHAR_P));
E void FDECL(water_damage, (struct obj **,BOOLEAN_P,BOOLEAN_P));
E boolean FDECL(fire_damage, (struct obj *,BOOLEAN_P,XCHAR_P,XCHAR_P));
E int FDECL(fire_damage_chain, (struct obj *,BOOLEAN_P,BOOLEAN_P,XCHAR_P,XCHAR_P));
E void acid_damage(struct obj *);
E int FDECL(water_damage, (struct obj *,const char*,BOOLEAN_P));
E void FDECL(water_damage_chain, (struct obj *,BOOLEAN_P));
E boolean NDECL(drown);
E void FDECL(drain_en, (int));
E int NDECL(dountrap);
@@ -2253,7 +2275,7 @@ E void NDECL(u_init);
/* ### uhitm.c ### */
E void FDECL(hurtmarmor,(struct monst *,int));
E void FDECL(erode_armor,(struct monst *,int));
E boolean FDECL(attack_checks, (struct monst *,struct obj *));
E void FDECL(check_caitiff, (struct monst *));
E int FDECL(find_roll_to_hit, (struct monst *,UCHAR_P,struct obj *,int *,int *));
@@ -2276,9 +2298,6 @@ E void NDECL(port_help);
E void FDECL(sethanguphandler, (void (*)(int)));
E boolean NDECL(authorize_wizard_mode);
E boolean FDECL(check_user_string, (char *));
# ifdef SYSCF_FILE
E void NDECL(assure_syscf_file);
# endif
#endif /* UNIX */
/* ### unixtty.c ### */
@@ -2516,7 +2535,6 @@ E void NDECL(uwepgone);
E void NDECL(uswapwepgone);
E void NDECL(uqwepgone);
E void NDECL(untwoweapon);
E boolean FDECL(erode_obj, (struct obj *,int,BOOLEAN_P,BOOLEAN_P));
E int FDECL(chwepon, (struct obj *,int));
E int FDECL(welded, (struct obj *));
E void FDECL(weldmsg, (struct obj *));
@@ -2616,7 +2634,7 @@ E boolean FDECL(obj_resists, (struct obj *,int,int));
E boolean FDECL(obj_shudders, (struct obj *));
E void FDECL(do_osshock, (struct obj *));
E int FDECL(bhito, (struct obj *,struct obj *));
E int FDECL(bhitpile, (struct obj *,int (*)(OBJ_P,OBJ_P),int,int));
E int FDECL(bhitpile, (struct obj *,int (*)(OBJ_P,OBJ_P),int,int,SCHAR_P));
E int FDECL(zappable, (struct obj *));
E void FDECL(zapnodir, (struct obj *));
E int NDECL(dozap);

View File

@@ -1,5 +1,4 @@
/* NetHack 3.5 flag.h $NHDT-Date: 1425081976 2015/02/28 00:06:16 $ $NHDT-Branch: (no branch, rebasing scshunt-unconditionals) $:$NHDT-Revision: 1.60 $ */
/* NetHack 3.5 flag.h $Date: 2012/04/09 02:56:32 $ $Revision: 1.59 $ */
/* NetHack 3.5 flag.h $NHDT-Date: 1425081976 2015/02/28 00:06:16 $ $NHDT-Branch: master $:$NHDT-Revision: 1.60 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -21,6 +20,7 @@ struct flag {
boolean autoquiver; /* Automatically fill quiver */
boolean beginner;
boolean biff; /* enable checking for mail */
boolean bones; /* allow saving/loading bones */
boolean confirm; /* confirm before hitting tame monsters */
boolean debug; /* in debugging mode */
#define wizard flags.debug
@@ -188,7 +188,9 @@ struct instance_flags {
boolean deferred_X; /* deferred entry into explore mode */
boolean num_pad; /* use numbers for movement commands */
boolean news; /* print news */
boolean mention_walls; /* give feedback when bumping walls */
boolean menu_tab_sep; /* Use tabs to separate option menu fields */
boolean menu_head_objsym; /* Show obj symbol in menu headings */
boolean menu_requested; /* Flag for overloaded use of 'm' prefix
* on some non-move commands */
boolean renameallowed; /* can change hero name during role selection */
@@ -198,6 +200,7 @@ struct instance_flags {
boolean rlecomp; /* run-length comp of levels when writing savefile */
uchar num_pad_mode;
boolean echo; /* 1 to echo characters */
boolean use_menu_color; /* use color in menus; only if wc_color */
#if 0
boolean DECgraphics; /* use DEC VT-xxx extended character set */
boolean IBMgraphics; /* use IBM extended character set */
@@ -292,6 +295,7 @@ struct instance_flags {
boolean wc2_softkeyboard; /* use software keyboard */
boolean wc2_wraptext; /* wrap text */
boolean wc2_selectsaved; /* display a menu of user's saved games */
boolean wc2_darkgray; /* try to use dark-gray color for black glyphs */
boolean cmdassist; /* provide detailed assistance for some commands */
boolean clicklook; /* allow right-clicking for look */
boolean obsolete; /* obsolete options can point at this, it isn't used */

View File

@@ -30,6 +30,9 @@
#define OPTIONFILE "opthelp" /* file explaining runtime options */
#define OPTIONS_USED "options" /* compile-time options, for #version */
#define SYMBOLS "symbols" /* replacement symbol sets */
#define EPITAPHFILE "epitaph" /* random epitaphs on graves */
#define ENGRAVEFILE "engrave" /* random engravings on the floor */
#define BOGUSMONFILE "bogusmon" /* hallucinatory monsters */
#define LEV_EXT ".lev" /* extension for special level files */

View File

@@ -1,5 +1,4 @@
/* NetHack 3.5 hack.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */
/* NetHack 3.5 hack.h $Date: 2009/05/06 10:44:46 $ $Revision: 1.49 $ */
/* NetHack 3.5 hack.h $NHDT-Date: 1426465431 2015/03/16 00:23:51 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.52 $ */
/* SCCS Id: @(#)hack.h 3.5 2008/03/19 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -11,32 +10,22 @@
#include "config.h"
#endif
/* [DEBUG shouldn't be defined unless you know what you're doing...] */
#ifdef DEBUG
/* due to strstr(), mon.c matches makemon.c */
# define showdebug() (sysopt.debugfiles && \
((sysopt.debugfiles[0] == '*') || \
(strstr( __FILE__ , sysopt.debugfiles))))
/* GCC understands this syntax */
# ifdef __GNUC__
/* ... but whines about it anyway without these pragmas. */
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wvariadic-macros"
# define debugpline(args...) \
do { if (showdebug()) pline( args ); } while(0);
# pragma GCC diagnostic pop
# endif
/* and Visual Studio understands this one */
# ifdef _MSC_VER
# define debugpline(...) \
do { if (showdebug()) pline(__VA_ARGS__); } while(0);
# endif
# define ifdebug(stmt) do { if (showdebug(__FILE__)) stmt; } while (0)
/* these don't require compiler support for C99 variadic macros */
# define debugpline0(str) ifdebug(pline(str))
# define debugpline1(fmt,arg) ifdebug(pline(fmt,arg))
# define debugpline2(fmt,a1,a2) ifdebug(pline(fmt,a1,a2))
# define debugpline3(fmt,a1,a2,a3) ifdebug(pline(fmt,a1,a2,a3))
# define debugpline4(fmt,a1,a2,a3,a4) ifdebug(pline(fmt,a1,a2,a3,a4))
#else
# define showdebug() (0)
# define debugpline(...)
#endif
# define debugpline0(str) /*empty*/
# define debugpline1(fmt,arg) /*empty*/
# define debugpline2(fmt,a1,a2) /*empty*/
# define debugpline3(fmt,a1,a2,a3) /*empty*/
# define debugpline4(fmt,a1,a2,a3,a4) /*empty*/
#endif /*DEBUG*/
#define TELL 1
#define NOTELL 0
@@ -99,6 +88,9 @@
#define COST_BITE 13 /* start eating food */
#define COST_OPEN 14 /* open tin */
#define COST_BRKLCK 15 /* break box/chest's lock */
#define COST_RUST 16 /* rust damage */
#define COST_ROT 17 /* rotting attack */
#define COST_CORRODE 18 /* acid damage */
/* bitmask flags for corpse_xname();
PFX_THE takes precedence over ARTICLE, NO_PFX takes precedence over both */

View File

@@ -13,6 +13,8 @@ struct mkroom {
schar rtype; /* type of room (zoo, throne, etc...) */
schar orig_rtype; /* same as rtype, but not zeroed later */
schar rlit; /* is the room lit ? */
schar needfill; /* sp_lev: does the room need filling? */
schar needjoining; /* sp_lev */
schar doorct; /* door count */
schar fdoor; /* index for the first door of the room */
schar nsubrooms; /* number of subrooms */

View File

@@ -1,5 +1,4 @@
/* NetHack 3.5 ntconf.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */
/* NetHack 3.5 ntconf.h $Date: 2012/01/15 19:11:38 $ $Revision: 1.35 $ */
/* NetHack 3.5 ntconf.h $NHDT-Date: 1426966690 2015/03/21 19:38:10 $ $NHDT-Branch: master $:$NHDT-Revision: 1.37 $ */
/* SCCS Id: @(#)ntconf.h 3.5 2002/03/10 */
/* Copyright (c) NetHack PC Development Team 1993, 1994. */
/* NetHack may be freely redistributed. See license for details. */
@@ -25,6 +24,9 @@
#define SELF_RECOVER /* Allow the game itself to recover from an aborted game */
#define SYSCF /* Use a global configuration */
#define SYSCF_FILE "sysconf" /* Use a file to hold the SYSCF configuration */
#define USER_SOUNDS
#ifdef WIN32CON
@@ -127,8 +129,15 @@ extern void FDECL(interject, (int));
#define strncmpi(a,b,c) strnicmp(a,b,c)
#endif
/* Visual Studio defines this in their own headers, which we don't use */
#ifndef snprintf
#define snprintf _snprintf
#pragma warning(disable:4996) /* deprecation warning suggesting snprintf_s */
#endif
#include <sys/types.h>
#include <stdlib.h>
#include <stdio.h>
#ifdef __BORLANDC__
#undef randomize
#undef random

View File

@@ -107,8 +107,10 @@ struct obj {
int corpsenm; /* type of corpse is mons[corpsenm] */
#define leashmon corpsenm /* gets m_id of attached pet */
#define spestudied corpsenm /* # of times a spellbook has been studied */
#define fromsink corpsenm /* a potion from a sink */
#define record_achieve_special corpsenm
int usecount; /* overloaded for various things that tally */
#define spestudied usecount /* # of times a spellbook has been studied */
unsigned oeaten; /* nutrition left in food, if partly eaten */
long age; /* creation date */
long owornmask;
@@ -301,6 +303,17 @@ struct obj {
|| (otmp)->otyp == WAX_CANDLE\
|| (otmp)->otyp == POT_OIL)
/* things that can be read */
#define is_readable(otmp) ((otmp)->otyp == FORTUNE_COOKIE\
|| (otmp)->otyp == T_SHIRT\
|| (otmp)->otyp == ALCHEMY_SMOCK\
|| (otmp)->otyp == CREDIT_CARD\
|| (otmp)->otyp == CAN_OF_GREASE\
|| (otmp)->otyp == MAGIC_MARKER\
|| (otmp)->oclass == COIN_CLASS\
|| (otmp)->oartifact == ART_ORB_OF_FATE\
|| (otmp)->otyp == CANDY_BAR)
/* special stones */
#define is_graystone(obj) ((obj)->otyp == LUCKSTONE || \
(obj)->otyp == LOADSTONE || \
@@ -319,6 +332,25 @@ struct obj {
#define CONTAINED_TOO 0x1
#define BURIED_TOO 0x2
/* object erosion types */
#define ERODE_BURN 0
#define ERODE_RUST 1
#define ERODE_ROT 2
#define ERODE_CORRODE 3
/* erosion flags for erode_obj() */
#define EF_NONE 0
#define EF_GREASE 0x1 /* check for a greased object */
#define EF_DESTROY 0x2 /* potentially destroy the object */
#define EF_VERBOSE 0x4 /* print extra messages */
#define EF_PAY 0x8 /* it's the player's fault */
/* erosion return values for erode_obj(), water_damage() */
#define ER_NOTHING 0 /* nothing happened */
#define ER_GREASED 1 /* protected by grease */
#define ER_DAMAGED 2 /* object was damaged in some way */
#define ER_DESTROYED 3 /* object was destroyed */
/*
* Notes for adding new oextra structures:
*

View File

@@ -14,10 +14,10 @@
* Incrementing EDITLEVEL can be used to force invalidation of old bones
* and save files.
*/
#define EDITLEVEL 55
#define EDITLEVEL 60
#define COPYRIGHT_BANNER_A \
"NetHack, Copyright 1985-2012"
"NetHack, Copyright 1985-2015"
#define COPYRIGHT_BANNER_B \
" By Stichting Mathematisch Centrum and M. Stephenson."
/* COPYRIGHT_BANNER_C is generated by makedefs into date.h */

View File

@@ -189,34 +189,35 @@
#define S_ss2 72
#define S_ss3 73
#define S_ss4 74
#define S_poisoncloud 75
/* The 8 swallow symbols. Do NOT separate. To change order or add, see */
/* the function swallow_to_glyph() in display.c. */
#define S_sw_tl 75 /* swallow top left [1] */
#define S_sw_tc 76 /* swallow top center [2] Order: */
#define S_sw_tr 77 /* swallow top right [3] */
#define S_sw_ml 78 /* swallow middle left [4] 1 2 3 */
#define S_sw_mr 79 /* swallow middle right [6] 4 5 6 */
#define S_sw_bl 80 /* swallow bottom left [7] 7 8 9 */
#define S_sw_bc 81 /* swallow bottom center [8] */
#define S_sw_br 82 /* swallow bottom right [9] */
#define S_sw_tl 76 /* swallow top left [1] */
#define S_sw_tc 77 /* swallow top center [2] Order: */
#define S_sw_tr 78 /* swallow top right [3] */
#define S_sw_ml 79 /* swallow middle left [4] 1 2 3 */
#define S_sw_mr 80 /* swallow middle right [6] 4 5 6 */
#define S_sw_bl 81 /* swallow bottom left [7] 7 8 9 */
#define S_sw_bc 82 /* swallow bottom center [8] */
#define S_sw_br 83 /* swallow bottom right [9] */
#define S_explode1 83 /* explosion top left */
#define S_explode2 84 /* explosion top center */
#define S_explode3 85 /* explosion top right Ex. */
#define S_explode4 86 /* explosion middle left */
#define S_explode5 87 /* explosion middle center /-\ */
#define S_explode6 88 /* explosion middle right |@| */
#define S_explode7 89 /* explosion bottom left \-/ */
#define S_explode8 90 /* explosion bottom center */
#define S_explode9 91 /* explosion bottom right */
#define S_explode1 84 /* explosion top left */
#define S_explode2 85 /* explosion top center */
#define S_explode3 86 /* explosion top right Ex. */
#define S_explode4 87 /* explosion middle left */
#define S_explode5 88 /* explosion middle center /-\ */
#define S_explode6 89 /* explosion middle right |@| */
#define S_explode7 90 /* explosion bottom left \-/ */
#define S_explode8 91 /* explosion bottom center */
#define S_explode9 92 /* explosion bottom right */
/* end effects */
#define MAXPCHARS 92 /* maximum number of mapped characters */
#define MAXPCHARS 93 /* maximum number of mapped characters */
#define MAXDCHARS 41 /* maximum of mapped dungeon characters */
#define MAXTCHARS 22 /* maximum of mapped trap characters */
#define MAXECHARS 29 /* maximum of mapped effects characters */
#define MAXECHARS 30 /* maximum of mapped effects characters */
#define MAXEXPCHARS 9 /* number of explosion characters */
struct symdef {
@@ -291,6 +292,7 @@ extern struct symsetentry symset[NUM_GRAPHICS]; /* from drawing.c */
#define D_CLOSED 4
#define D_LOCKED 8
#define D_TRAPPED 16
#define D_SECRET 32 /* only used by sp_lev.c, NOT in rm-struct */
/*
* Some altars are considered as shrines, so we need a flag.
@@ -393,6 +395,19 @@ struct rm {
Bitfield(candig,1); /* Exception to Can_dig_down; was a trapdoor */
};
#define SET_TYPLIT(x,y,ttyp,llit) \
{ \
if ((x) >= 0 && (y) >= 0 && (x) < COLNO && (y) < ROWNO) { \
if ((ttyp) < MAX_TYPE) levl[(x)][(y)].typ = (ttyp); \
if ((ttyp) == LAVAPOOL) levl[(x)][(y)].lit = 1; \
else if ((schar)(llit) != -2) { \
if ((schar)(llit) == -1) levl[(x)][(y)].lit = rn2(2); \
else levl[(x)][(y)].lit = (llit); \
} \
} \
}
/*
* Add wall angle viewing by defining "modes" for each wall type. Each
* mode describes which parts of a wall are finished (seen as as wall)

View File

@@ -19,92 +19,378 @@
#define MAP_Y_LIM 21
/* Per level flags */
#define NOTELEPORT 1
#define HARDFLOOR 2
#define NOMMAP 4
#define SHORTSIGHTED 8
#define ARBOREAL 16
#define NOTELEPORT 0x00000001L
#define HARDFLOOR 0x00000002L
#define NOMMAP 0x00000004L
#define SHORTSIGHTED 0x00000008L
#define ARBOREAL 0x00000010L
#define MAZELEVEL 0x00000020L
#define PREMAPPED 0x00000040L /* premapped level & sokoban rules */
#define SHROUD 0x00000080L
#define GRAVEYARD 0x00000100L
#define ICEDPOOLS 0x00000200L /* for ice locations: ICED_POOL vs ICED_MOAT */
#define SOLIDIFY 0x00000400L /* outer areas are nondiggable & nonpasswall */
/* special level types */
#define SP_LEV_ROOMS 1
#define SP_LEV_MAZE 2
/* different level layout initializers */
#define LVLINIT_NONE 0
#define LVLINIT_SOLIDFILL 1
#define LVLINIT_MAZEGRID 2
#define LVLINIT_MINES 3
#define LVLINIT_ROGUE 4
/* max. layers of object containment */
#define MAX_CONTAINMENT 10
/* 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 */
#define SP_M_V_PEACEFUL 0
#define SP_M_V_ALIGN 1
#define SP_M_V_ASLEEP 2
#define SP_M_V_APPEAR 3
#define SP_M_V_NAME 4
#define SP_M_V_FEMALE 5
#define SP_M_V_INVIS 6
#define SP_M_V_CANCELLED 7
#define SP_M_V_REVIVED 8
#define SP_M_V_AVENGE 9
#define SP_M_V_FLEEING 10
#define SP_M_V_BLINDED 11
#define SP_M_V_PARALYZED 12
#define SP_M_V_STUNNED 13
#define SP_M_V_CONFUSED 14
#define SP_M_V_SEENTRAPS 15
#define SP_M_V_END 16 /* end of variable parameters */
/* OBJECT */
#define SP_O_V_SPE 0
#define SP_O_V_CURSE 1
#define SP_O_V_CORPSENM 2
#define SP_O_V_NAME 3
#define SP_O_V_QUAN 4
#define SP_O_V_BURIED 5
#define SP_O_V_LIT 6
#define SP_O_V_ERODED 7
#define SP_O_V_LOCKED 8
#define SP_O_V_TRAPPED 9
#define SP_O_V_RECHARGED 10
#define SP_O_V_INVIS 11
#define SP_O_V_GREASED 12
#define SP_O_V_BROKEN 13
#define SP_O_V_COORD 14
#define SP_O_V_END 15 /* end of variable parameters */
/* When creating objects, we need to know whether
* it's a container and/or contents.
*/
#define SP_OBJ_CONTENT 0x1
#define SP_OBJ_CONTAINER 0x2
/* SPO_FILTER types */
#define SPOFILTER_PERCENT 0
#define SPOFILTER_SELECTION 1
#define SPOFILTER_MAPCHAR 2
/* gradient filter types */
#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 0x01000000
/* Humidity flags for get_location() and friends, used with SP_COORD_PACK_RANDOM() */
#define DRY 0x1
#define WET 0x2
#define HOT 0x4
#define SOLID 0x8
#define ANY_LOC 0x10 /* even outside the level */
#define NO_LOC_WARN 0x20 /* no complaints and set x & y to -1, if no loc */
#define SP_COORD_X(l) (l & 0xff)
#define SP_COORD_Y(l) ((l >> 16) & 0xff)
#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))
#define SP_MONST_CLASS(l) (l & 0xff)
#define SP_MONST_PM(l) ((l >> 8) & 0xffff)
#define SP_MONST_PACK(m,c) ((( m ) << 8) + ((char)( c )))
#define SP_OBJ_CLASS(l) (l & 0xff)
#define SP_OBJ_TYP(l) ((l >> 8) & 0xffff)
#define SP_OBJ_PACK(o,c) ((( o ) << 8) + ((char)( c )))
#define SP_MAPCHAR_TYP(l) (l & 0xff)
#define SP_MAPCHAR_LIT(l) ((l >> 8) & 0xff)
#define SP_MAPCHAR_PACK(typ,lit) ((( lit ) << 8) + ((char)( typ )))
struct opvar {
xchar spovartyp; /* one of SPOVAR_foo */
union {
char *str;
long l;
} vardata;
};
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;
struct mkroom *tmproomlist[MAX_NESTED_ROOMS+1];
boolean failed_room[MAX_NESTED_ROOMS+1];
int n_subroom;
boolean exit_script;
int lvl_is_joined;
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
*/
#define packed_coord long
typedef struct {
xchar is_random;
long getloc_flags;
int x, y;
} unpacked_coord;
typedef struct {
int cmp_what;
int cmp_val;
} opcmp;
typedef struct {
long jmp_target;
} opjmp;
typedef union str_or_len {
char *str;
int len;
} Str_or_Len;
typedef struct {
xchar init_style; /* one of LVLINIT_foo */
long flags;
schar filling;
boolean init_present, padding;
char fg, bg;
boolean smoothed, joined;
xchar lit, walled;
boolean icedpools; /* for ice locations: ICED_POOL vs ICED_MOAT */
boolean icedpools;
} lev_init;
typedef struct {
xchar x, y, mask;
} door;
typedef struct {
xchar wall, pos, secret, mask;
} room_door;
typedef struct {
xchar x, y, chance, type;
packed_coord coord;
xchar x, y, type;
} trap;
typedef struct {
Str_or_Len name, appear_as;
short id;
aligntyp align;
xchar x, y, chance, class, appear;
packed_coord coord;
xchar x, y, class, appear;
schar peaceful, asleep;
short female, invis, cancelled, revived, avenge, fleeing, blinded, paralyzed, stunned, confused;
long seentraps;
short has_invent;
} monster;
typedef struct {
Str_or_Len name;
int corpsenm;
short id, spe;
xchar x, y, chance, class, containment;
packed_coord coord;
xchar x, y, class, containment;
schar curse_state;
int quan;
short buried;
short lit;
short eroded, locked, trapped, recharged, invis, greased, broken;
} object;
typedef struct {
packed_coord coord;
xchar x, y;
aligntyp align;
xchar shrine;
} altar;
typedef struct {
xchar x, y, dir, db_open;
} drawbridge;
typedef struct {
xchar x, y, dir;
} walk;
typedef struct {
xchar x1, y1, x2, y2;
} digpos;
typedef struct {
xchar x, y, up;
} lad;
typedef struct {
xchar x, y, up;
} stair;
typedef struct {
xchar x1, y1, x2, y2;
xchar rtype, rlit, rirreg;
} region;
typedef struct {
xchar ter, tlit;
} terrain;
typedef struct {
xchar chance;
xchar x1,y1,x2,y2;
xchar fromter, toter, tolit;
} replaceterrain;
/* values for rtype are defined in dungeon.h */
typedef struct {
struct { xchar x1, y1, x2, y2; } inarea;
@@ -114,116 +400,6 @@ typedef struct {
Str_or_Len rname;
} lev_region;
typedef struct {
xchar x, y;
int amount;
} gold;
typedef struct {
xchar x, y;
Str_or_Len engr;
xchar etype;
} engraving;
typedef struct {
xchar x, y;
} fountain;
typedef struct {
xchar x, y;
} sink;
typedef struct {
xchar x, y;
} pool;
typedef struct {
char halign, valign;
char xsize, ysize;
char **map;
char nrobjects;
char *robjects;
char nloc;
char *rloc_x;
char *rloc_y;
char nrmonst;
char *rmonst;
char nreg;
region **regions;
char nlreg;
lev_region **lregions;
char ndoor;
door **doors;
char ntrap;
trap **traps;
char nmonster;
monster **monsters;
char nobject;
object **objects;
char ndrawbridge;
drawbridge **drawbridges;
char nwalk;
walk **walks;
char ndig;
digpos **digs;
char npass;
digpos **passs;
char nlad;
lad **lads;
char nstair;
stair **stairs;
char naltar;
altar **altars;
char ngold;
gold **golds;
char nengraving;
engraving **engravings;
char nfountain;
fountain **fountains;
} mazepart;
typedef struct {
long flags;
lev_init init_lev;
schar filling;
char numpart;
mazepart **parts;
} specialmaze;
typedef struct _room {
char *name;
char *parent;
xchar x, y, w, h;
xchar xalign, yalign;
xchar rtype, chance, rlit, filled;
char ndoor;
room_door **doors;
char ntrap;
trap **traps;
char nmonster;
monster **monsters;
char nobject;
object **objects;
char naltar;
altar **altars;
char nstair;
stair **stairs;
char ngold;
gold **golds;
char nengraving;
engraving **engravings;
char nfountain;
fountain **fountains;
char nsink;
sink **sinks;
char npool;
pool **pools;
/* These three fields are only used when loading the level... */
int nsubroom;
struct _room *subrooms[MAX_SUBROOMS];
struct mkroom *mkr;
} room;
typedef struct {
struct {
xchar room;
@@ -232,18 +408,66 @@ typedef struct {
} src, dest;
} corridor;
/* used only by lev_comp */
typedef struct _room {
Str_or_Len name;
Str_or_Len parent;
xchar x, y, w, h;
xchar xalign, yalign;
xchar rtype, chance, rlit, filled, joined;
} room;
typedef struct {
long flags;
lev_init init_lev;
char nrobjects;
char *robjects;
char nrmonst;
char *rmonst;
xchar nroom;
room **rooms;
xchar ncorr;
corridor **corrs;
} splev;
schar zaligntyp;
schar keep_region;
schar halign, valign;
char xsize, ysize;
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;
};
#endif /* SP_LEV_H */

View File

@@ -1,27 +1,29 @@
/* NetHack 3.5 sys.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */
/* NetHack 3.5 sys.h $Date: 2012/01/27 20:15:26 $ $Revision: 1.9 $ */
/* NetHack 3.5 sys.h $NHDT-Date: 1426544796 2015/03/16 22:26:36 $ $NHDT-Branch: master $:$NHDT-Revision: 1.13 $ */
/* Copyright (c) Kenneth Lorber, Kensington, Maryland, 2008. */
/* NetHack may be freely redistributed. See license for details. */
#ifndef SYS_H
#define SYS_H
#define E extern
E void NDECL(sys_early_init);
struct sysopt {
char *support; /* local support contact */
char *recover; /* how to run recover - may be overridden by win port */
char *wizards;
char *explorers;
char *shellers; /* like wizards, for ! command (-DSHELL) */
char *debugfiles; /* files to show debugplines in. '*' is all. */
int env_dbgfl; /* 1: debugfiles comes from getenv("DEBUGFILES")
* so sysconf's DEBUGFILES shouldn't override it;
* 0: getenv() hasn't been attempted yet;
* -1: getenv() didn't find a value for DEBUGFILES.
*/
int maxplayers;
/* record file */
int persmax;
int pers_is_uid;
int entrymax;
int pointsmin;
int tt_oname_maxrank;
#ifdef PANICTRACE
/* panic options */
char *gdbpath;
@@ -33,7 +35,8 @@ struct sysopt {
#endif
int seduce;
};
E struct sysopt sysopt;
extern struct sysopt sysopt;
#define SYSOPT_SEDUCE sysopt.seduce

View File

@@ -217,6 +217,12 @@
#define FCMASK 0660 /* file creation mask */
/* fcntl(2) is a POSIX-portable call for manipulating file descriptors.
* Comment out the USE_FCNTL if for some reason you have a strange
* OS/filesystem combination for which fcntl(2) does not work. */
#ifdef POSIX_TYPES
# define USE_FCNTL
#endif
/*
* The remainder of the file should not need to be changed.

View File

@@ -1,5 +1,4 @@
/* NetHack 3.5 wceconf.h $NHDT-Date: 1425081976 2015/02/28 00:06:16 $ $NHDT-Branch: (no branch, rebasing scshunt-unconditionals) $:$NHDT-Revision: 1.12 $ */
/* NetHack 3.5 wceconf.h $Date: 2009/10/22 02:59:14 $ $Revision: 1.12 $ */
/* NetHack 3.5 wceconf.h $NHDT-Date: 1425081976 2015/02/28 00:06:16 $ $NHDT-Branch: master $:$NHDT-Revision: 1.12 $ */
/* Copyright (C) 2001 by Alex Kompel */
/* NetHack may be freely redistributed. See license for details. */

View File

@@ -219,7 +219,8 @@ NEARDATA struct window_procs windowprocs;
#define WC2_WRAPTEXT 0x04L /* 03 wrap long lines of text */
#define WC2_HILITE_STATUS 0x08L /* 04 hilite fields in status */
#define WC2_SELECTSAVED 0x10L /* 05 saved game selection menu */
/* 27 free bits */
#define WC2_DARKGRAY 0x20L /* 06 use bold black for black glyphs */
/* 26 free bits */
#define ALIGN_LEFT 1
#define ALIGN_RIGHT 2

View File

@@ -29,9 +29,9 @@ struct WinDesc {
xchar type; /* type of window */
boolean active; /* true if window is active */
short offx, offy; /* offset from topleft of display */
short rows, cols; /* dimensions */
short curx, cury; /* current cursor position */
short maxrow, maxcol; /* the maximum size used -- for MENU wins */
long rows, cols; /* dimensions */
long curx, cury; /* current cursor position */
long maxrow, maxcol; /* the maximum size used -- for MENU wins */
/* maxcol is also used by WIN_MESSAGE for */
/* tracking the ^P command */
short *datlen; /* allocation size for *data */
@@ -39,9 +39,9 @@ struct WinDesc {
char *morestr; /* string to display instead of default */
tty_menu_item *mlist; /* menu information (MENU) */
tty_menu_item **plist; /* menu page pointers (MENU) */
short plist_size; /* size of allocated plist (MENU) */
short npages; /* number of pages in menu (MENU) */
short nitems; /* total number of items (MENU) */
long plist_size; /* size of allocated plist (MENU) */
long npages; /* number of pages in menu (MENU) */
long nitems; /* total number of items (MENU) */
short how; /* menu mode - pick 1 or N (MENU) */
char menu_ch; /* menu char (MENU) */
};

View File

@@ -53,6 +53,26 @@ struct u_event {
Bitfield(ascended,1); /* has offered the Amulet */
};
struct u_achieve {
Bitfield(amulet,1); /* touched Amulet */
Bitfield(bell,1); /* touched Bell */
Bitfield(book,1); /* touched Book */
Bitfield(menorah,1); /* touched Candelabrum */
Bitfield(enter_gehennom,1); /* entered Gehennom (or Valley) by any means */
Bitfield(ascended,1); /* not quite the same as u.uevent.ascended */
Bitfield(mines_luckstone,1); /* got a luckstone at end of mines */
Bitfield(finish_sokoban,1); /* obtained the sokoban prize */
Bitfield(killed_medusa,1);
};
struct u_realtime {
time_t realtime; /* actual playing time up until the last restore */
time_t restored; /* time the game was started or restored */
time_t endtime;
};
/* KMH, conduct --
* These are voluntary challenges. Each field denotes the number of
* times a challenge has been violated.
@@ -72,6 +92,12 @@ struct u_conduct { /* number of times... */
/* genocides already listed at end of game */
};
struct u_roleplay {
boolean blind; /* permanently blind */
boolean nudist; /* has not worn any armor, ever */
long numbones; /* # of bones files loaded */
};
/*** Unified structure containing role information ***/
struct Role {
/*** Strings that name various things ***/
@@ -306,9 +332,11 @@ struct you {
/* 1 free bit! */
unsigned udg_cnt; /* how long you have been demigod */
struct u_achieve uachieve; /* achievements */
struct u_event uevent; /* certain events have happened */
struct u_have uhave; /* you're carrying special objects */
struct u_conduct uconduct; /* KMH, conduct */
struct u_roleplay uroleplay;
struct attribs acurr, /* your current attributes (eg. str)*/
aexe, /* for gain/loss via "exercise" */
abon, /* your bonus attributes (eg. str) */

View File

@@ -91,7 +91,7 @@
#define Blinded u.uprops[BLINDED].intrinsic
#define Blindfolded (ublindf && ublindf->otyp != LENSES)
/* ...means blind because of a cover */
#define Blind ((Blinded || Blindfolded || !haseyes(youmonst.data)) && \
#define Blind ((u.uroleplay.blind || Blinded || Blindfolded || !haseyes(youmonst.data)) && \
!(ublindf && ublindf->oartifact == ART_EYES_OF_THE_OVERWORLD))
/* ...the Eyes operate even when you really are blind
or don't have any eyes */
@@ -286,7 +286,35 @@
* 2. it doesn't leave a mark. Marks include destruction of, or
* damage to, an internal organ (including the brain),
* lacerations, bruises, crushed body parts, bleeding.
*
* The following were evaluated and determined _NOT_ to be
* susceptable to Half_physical_damage protection:
* Being caught in a fireball [fire damage]
* Sitting in lava [lava damage]
* Thrown potion (acid) [acid damage]
* Splattered burning oil from thrown potion [fire damage]
* Mixing water and acid [acid damage]
* Molten lava (entering or being splashed) [lava damage]
* boiling water from a sink [fire damage]
* Fire traps [fire damage]
* Scrolls of fire (confused and otherwise) [fire damage]
* Alchemical explosion [not physical]
* System shock [shock damage]
* Bag of holding explosion [magical]
* Being undead-turned by your god [magical]
* Level-drain [magical]
* Magical explosion of a magic trap [magical]
* Sitting on a throne with a bad effect [magical]
* Contaminated water from a sink [poison/sickness]
* Contact-poisoned spellbooks [poison/sickness]
* Eating acidic/poisonous/mildly-old corpses [poison/sickness]
* Eating a poisoned weapon while polyselfed [poison/sickness]
* Engulfing a zombie or mummy (AT_ENGL in hmonas) [poison/sickness]
* Quaffed potions of sickness, lit oil, acid [poison/sickness]
* Pyrolisks' fiery gaze [fire damage]
* Any passive attack [most don't qualify]
*/
#define HHalf_physical_damage u.uprops[HALF_PHDAM].intrinsic
#define EHalf_physical_damage u.uprops[HALF_PHDAM].extrinsic
#define Half_physical_damage (HHalf_physical_damage || EHalf_physical_damage)