Merge branch 'master' into derek-farming

* master: (49 commits)
  Fix 'fetch' syntax, include sparkly 'git log' trick
  Show object symbols in menu headings
  Fix a memory leak on termination.
  ...

Conflicts:
	include/obj.h
	src/do.c
	src/files.c
	src/hack.c
	src/invent.c
	src/mkobj.c
	src/mon.c
	src/objnam.c
This commit is contained in:
Derek S. Ray
2015-03-25 17:23:59 -04:00
85 changed files with 2536 additions and 835 deletions

View File

@@ -187,6 +187,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 */

View File

@@ -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,4 +1,4 @@
/* NetHack 3.5 extern.h $NHDT-Date: 1425081976 2015/02/28 00:06:16 $ $NHDT-Branch: master $:$NHDT-Revision: 1.390 $ */
/* NetHack 3.5 extern.h $NHDT-Date: 1426966688 2015/03/21 19:38:08 $ $NHDT-Branch: master $:$NHDT-Revision: 1.411 $ */
/* NetHack 3.5 extern.h $Date: 2013/11/05 00:57:53 $ $Revision: 1.380 $ */
/* Copyright (c) Steve Creps, 1988. */
/* NetHack may be freely redistributed. See license for details. */
@@ -26,6 +26,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 ### */
@@ -386,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);
@@ -738,9 +739,15 @@ E void FDECL(free_saved_games, (char**));
#ifdef SELF_RECOVER
E boolean NDECL(recover_savefile);
#endif
#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 ### */
@@ -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 *));
@@ -903,7 +911,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);
@@ -1170,7 +1178,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 *));
@@ -1930,6 +1938,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));
@@ -2065,6 +2074,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 ### */
@@ -2283,9 +2294,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 ### */

View File

@@ -189,7 +189,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 */

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,4 +1,4 @@
/* NetHack 3.5 hack.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */
/* NetHack 3.5 hack.h $NHDT-Date: 1426465431 2015/03/16 00:23:51 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.52 $ */
/* NetHack 3.5 hack.h $Date: 2009/05/06 10:44:46 $ $Revision: 1.49 $ */
/* SCCS Id: @(#)hack.h 3.5 2008/03/19 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
@@ -11,32 +11,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

View File

@@ -1,4 +1,4 @@
/* NetHack 3.5 ntconf.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */
/* NetHack 3.5 ntconf.h $NHDT-Date: 1426966690 2015/03/21 19:38:10 $ $NHDT-Branch: master $:$NHDT-Revision: 1.37 $ */
/* NetHack 3.5 ntconf.h $Date: 2012/01/15 19:11:38 $ $Revision: 1.35 $ */
/* SCCS Id: @(#)ntconf.h 3.5 2002/03/10 */
/* Copyright (c) NetHack PC Development Team 1993, 1994. */
@@ -25,6 +25,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

View File

@@ -1,4 +1,4 @@
/* NetHack 3.5 obj.h $NHDT-Date: 1426470329 2015/03/16 01:45:29 $ $NHDT-Branch: derek-farming $:$NHDT-Revision: 1.35 $ */
/* NetHack 3.5 obj.h $NHDT-Date: 1426949157 2015/03/21 14:45:57 $ $NHDT-Branch: master $:$NHDT-Revision: 1.36 $ */
/* NetHack 3.5 obj.h $Date: 2012/01/10 17:47:16 $ $Revision: 1.31 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -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;

View File

@@ -1,4 +1,4 @@
/* NetHack 3.5 patchlevel.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */
/* NetHack 3.5 patchlevel.h $NHDT-Date: 1426948844 2015/03/21 14:40:44 $ $NHDT-Branch: master $:$NHDT-Revision: 1.95 $ */
/* NetHack 3.5 patchlevel.h $Date: 2012/04/14 08:31:03 $ $Revision: 1.93 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -14,10 +14,10 @@
* Incrementing EDITLEVEL can be used to force invalidation of old bones
* and save files.
*/
#define EDITLEVEL 56
#define EDITLEVEL 58
#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

@@ -1,4 +1,4 @@
/* NetHack 3.5 sys.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */
/* NetHack 3.5 sys.h $NHDT-Date: 1426544796 2015/03/16 22:26:36 $ $NHDT-Branch: master $:$NHDT-Revision: 1.13 $ */
/* NetHack 3.5 sys.h $Date: 2012/01/27 20:15:26 $ $Revision: 1.9 $ */
/* Copyright (c) Kenneth Lorber, Kensington, Maryland, 2008. */
/* NetHack may be freely redistributed. See license for details. */
@@ -6,16 +6,17 @@
#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 *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;
@@ -34,7 +35,8 @@ struct sysopt {
#endif
int seduce;
};
E struct sysopt sysopt;
extern struct sysopt sysopt;
#define SYSOPT_SEDUCE sysopt.seduce

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.
@@ -306,6 +326,7 @@ 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 */