compile NetHack-3.7 without makedefs-generated .h files

This evolves and hopefully eases the game-build requirements by
removing game-compile dependencies on any header files generated
by the makedefs utility, including:

date.h dependency and its inclusion is removed and comparable functionality
is produced at runtime via new file src/date.c.

pm.h dependency and its inclusion is removed and comparable functionality is
produced by moving the monster definitions from monst.c into new header
file called monsters.h and altering them slightly. The former pm.h header
file #define PM_ values are now replaced with appropriate emitted enum
entries during the compiler preprocessing.

onames.h dependency and	its inclusion is removed and comparable functionality
is produced by moving the object definitions from objects.c into new header
file called objects.h and altering them slightly. The former onames.h header
file #define values are now replaced with appropriate emitted enum entries
during the compiler preprocessing.

artilist.h has been slightly altered, and the former onames.h artifact-related
header file #define ART_ values are now replaced with appropriate emitted enum
entries during the compiler preprocessing.

makedefs can still produce date.h (makedefs -v), pm.h (makedefs -p), and
onames.h (makedefs -o) for reference purposes. They won't be used during
the compiler.

The other uses for makedefs remain. They are used to prepare external
file content that the game utilizes, not prerequisite code for the
compile:
    makedefs -d    (database)
    makedefs -r    (rumors)
    makedefs -h    (oracles)
    makedefs -s    (epitaphs, engravings, bogusmons)

date.c

Pull the code for date/time stamping from mdlib.c into date.c.
Set date.o to be dependent on source files, header files, and .o files
so that date.o is rebuilt from date.c when any of those changes, thus
ensuring an accurate date/time stamp. It also includes git sha
functionality formerly done by makedefs writing #define directives
into include/date.h. For unix it passes the git info on
the compile line for date.c (via sys/unix/hints/linux.2020, macOS.2020)

nethack --dumpenums (optional, but on by default)

Allow developer to obtain some internal enum values from NetHack
without having to resort to an external utility such as
makedefs.

Uncomment #define NODUMPENUMS in config.h to disable this.

The updates to sys/windows/Makefile.gcc have not been tested yet.
This commit is contained in:
nhmall
2021-08-17 14:43:29 -04:00
parent 61b6bab292
commit 9bb96322a8
50 changed files with 5745 additions and 4936 deletions

View File

@@ -1,5 +1,5 @@
* NH_filestag=(file%s_for_all_versions)
..files NH_filegenerated=win32api.h,tile.h,dgn_comp.h,lev_comp.h,date.h,onames.h,pm.h
..files NH_filegenerated=win32api.h,tile.h,date.h
win32api.h NH_filesgentag=(file%s_for_win32_that_are_moved_into_include_at_compile_time)
@@ -9,8 +9,6 @@ dgn_comp.h NH_filesgentag=(file%s_generated_by_yacc_(or_copied_from_sys/share)_a
lev_comp.h NH_filesgentag=>dgn_comp.h
date.h NH_filesgentag=(file%s_generated_by_makedefs_at_compile_time)
onames.h NH_filesgentag=>date.h
pm.h NH_filesgentag=>date.h
wintty.h NH_filestag=(file%s_for_tty_versions)

View File

@@ -6,15 +6,23 @@
#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
#define A(nam, typ, s1, s2, mt, atk, dfn, cry, inv, al, cl, rac, \
cost, clr, bn) nam
static const char *artifact_names[] = {
#elif defined(ARTI_ENUM)
#define A(nam, typ, s1, s2, mt, atk, dfn, cry, inv, al, cl, rac, \
cost, clr, bn) \
ART_##bn
#else
/* in artifact.c, set up the actual artifact list structure */
#define A(nam, typ, s1, s2, mt, atk, dfn, cry, inv, al, cl, rac, cost, clr) \
{ \
typ, nam, s1, s2, mt, atk, dfn, cry, inv, al, cl, rac, cost, clr \
#define A(nam, typ, s1, s2, mt, atk, dfn, cry, inv, al, cl, rac, \
cost, clr, bn) \
{ \
typ, nam, s1, s2, mt, atk, dfn, cry, inv, al, cl, rac, \
cost, clr \
}
/* clang-format off */
@@ -42,12 +50,12 @@ static NEARDATA struct artifact artilist[] = {
/* dummy element #0, so that all interesting indices are non-zero */
A("", STRANGE_OBJECT, 0, 0, 0, NO_ATTK, NO_DFNS, NO_CARY, 0, A_NONE,
NON_PM, NON_PM, 0L, NO_COLOR),
NON_PM, NON_PM, 0L, NO_COLOR, PLACEHOLDER),
A("Excalibur", LONG_SWORD, (SPFX_NOGEN | SPFX_RESTR | SPFX_SEEK
| SPFX_DEFN | SPFX_INTEL | SPFX_SEARCH),
0, 0, PHYS(5, 10), DRLI(0, 0), NO_CARY, 0, A_LAWFUL, PM_KNIGHT, NON_PM,
4000L, NO_COLOR),
4000L, NO_COLOR, EXCALIBUR),
/*
* Stormbringer only has a 2 because it can drain a level,
* providing 8 more.
@@ -55,7 +63,7 @@ static NEARDATA struct artifact artilist[] = {
A("Stormbringer", RUNESWORD,
(SPFX_RESTR | SPFX_ATTK | SPFX_DEFN | SPFX_INTEL | SPFX_DRLI), 0, 0,
DRLI(5, 2), DRLI(0, 0), NO_CARY, 0, A_CHAOTIC, NON_PM, NON_PM, 8000L,
NO_COLOR),
NO_COLOR, STORMBRINGER),
/*
* Mjollnir can be thrown when wielded if hero has 25 Strength
* (usually via gauntlets of power but possible with rings of
@@ -70,10 +78,10 @@ static NEARDATA struct artifact artilist[] = {
*/
A("Mjollnir", WAR_HAMMER, /* Mjo:llnir */
(SPFX_RESTR | SPFX_ATTK), 0, 0, ELEC(5, 24), NO_DFNS, NO_CARY, 0,
A_NEUTRAL, PM_VALKYRIE, NON_PM, 4000L, NO_COLOR),
A_NEUTRAL, PM_VALKYRIE, NON_PM, 4000L, NO_COLOR, MJOLLNIR),
A("Cleaver", BATTLE_AXE, SPFX_RESTR, 0, 0, PHYS(3, 6), NO_DFNS, NO_CARY,
0, A_NEUTRAL, PM_BARBARIAN, NON_PM, 1500L, NO_COLOR),
0, A_NEUTRAL, PM_BARBARIAN, NON_PM, 1500L, NO_COLOR, CLEAVER),
/*
* Grimtooth glows in warning when elves are present, but its
@@ -82,7 +90,7 @@ static NEARDATA struct artifact artilist[] = {
*/
A("Grimtooth", ORCISH_DAGGER, (SPFX_RESTR | SPFX_WARN | SPFX_DFLAG2),
0, M2_ELF, PHYS(2, 6), NO_DFNS,
NO_CARY, 0, A_CHAOTIC, NON_PM, PM_ORC, 300L, CLR_RED),
NO_CARY, 0, A_CHAOTIC, NON_PM, PM_ORC, 300L, CLR_RED, GRIMTOOTH),
/*
* Orcrist and Sting have same alignment as elves.
*
@@ -92,54 +100,55 @@ static NEARDATA struct artifact artilist[] = {
*/
A("Orcrist", ELVEN_BROADSWORD, (SPFX_WARN | SPFX_DFLAG2), 0, M2_ORC,
PHYS(5, 0), NO_DFNS, NO_CARY, 0, A_CHAOTIC, NON_PM, PM_ELF, 2000L,
CLR_BRIGHT_BLUE), /* bright blue is actually light blue */
CLR_BRIGHT_BLUE, ORCRIST), /* bright blue is actually light blue */
A("Sting", ELVEN_DAGGER, (SPFX_WARN | SPFX_DFLAG2), 0, M2_ORC, PHYS(5, 0),
NO_DFNS, NO_CARY, 0, A_CHAOTIC, NON_PM, PM_ELF, 800L, CLR_BRIGHT_BLUE),
NO_DFNS, NO_CARY, 0, A_CHAOTIC, NON_PM, PM_ELF, 800L, CLR_BRIGHT_BLUE,
STING),
/*
* Magicbane is a bit different! Its magic fanfare
* unbalances victims in addition to doing some damage.
*/
A("Magicbane", ATHAME, (SPFX_RESTR | SPFX_ATTK | SPFX_DEFN), 0, 0,
STUN(3, 4), DFNS(AD_MAGM), NO_CARY, 0, A_NEUTRAL, PM_WIZARD, NON_PM,
3500L, NO_COLOR),
3500L, NO_COLOR, MAGICBANE),
A("Frost Brand", LONG_SWORD, (SPFX_RESTR | SPFX_ATTK | SPFX_DEFN), 0, 0,
COLD(5, 0), COLD(0, 0), NO_CARY, 0, A_NONE, NON_PM, NON_PM, 3000L,
NO_COLOR),
NO_COLOR, FROST_BRAND),
A("Fire Brand", LONG_SWORD, (SPFX_RESTR | SPFX_ATTK | SPFX_DEFN), 0, 0,
FIRE(5, 0), FIRE(0, 0), NO_CARY, 0, A_NONE, NON_PM, NON_PM, 3000L,
NO_COLOR),
NO_COLOR, FIRE_BRAND),
A("Dragonbane", BROADSWORD,
(SPFX_RESTR | SPFX_DCLAS | SPFX_REFLECT), 0, S_DRAGON,
PHYS(5, 0), NO_DFNS, NO_CARY, 0, A_NONE, NON_PM, NON_PM, 500L,
NO_COLOR),
NO_COLOR, DRAGONBANE),
A("Demonbane", LONG_SWORD, (SPFX_RESTR | SPFX_DFLAG2), 0, M2_DEMON,
PHYS(5, 0), NO_DFNS, NO_CARY, 0, A_LAWFUL, NON_PM, NON_PM, 2500L,
NO_COLOR),
NO_COLOR, DEMONBANE),
A("Werebane", SILVER_SABER, (SPFX_RESTR | SPFX_DFLAG2), 0, M2_WERE,
PHYS(5, 0), DFNS(AD_WERE), NO_CARY, 0, A_NONE, NON_PM, NON_PM, 1500L,
NO_COLOR),
NO_COLOR, WEREBANE),
A("Grayswandir", SILVER_SABER, (SPFX_RESTR | SPFX_HALRES), 0, 0,
PHYS(5, 0), NO_DFNS, NO_CARY, 0, A_LAWFUL, NON_PM, NON_PM, 8000L,
NO_COLOR),
NO_COLOR, GRAYSWANDIR),
A("Giantslayer", LONG_SWORD, (SPFX_RESTR | SPFX_DFLAG2), 0, M2_GIANT,
PHYS(5, 0), NO_DFNS, NO_CARY, 0, A_NEUTRAL, NON_PM, NON_PM, 200L,
NO_COLOR),
NO_COLOR, GIANTSLAYER),
A("Ogresmasher", WAR_HAMMER, (SPFX_RESTR | SPFX_DCLAS), 0, S_OGRE,
PHYS(5, 0), NO_DFNS, NO_CARY, 0, A_NONE, NON_PM, NON_PM, 200L,
NO_COLOR),
NO_COLOR, OGRESMASHER),
A("Trollsbane", MORNING_STAR, (SPFX_RESTR | SPFX_DCLAS), 0, S_TROLL,
PHYS(5, 0), NO_DFNS, NO_CARY, 0, A_NONE, NON_PM, NON_PM, 200L,
NO_COLOR),
NO_COLOR, TROLLSBANE),
/*
* Two problems: 1) doesn't let trolls regenerate heads,
* 2) doesn't give unusual message for 2-headed monsters (but
@@ -147,7 +156,7 @@ static NEARDATA struct artifact artilist[] = {
*/
A("Vorpal Blade", LONG_SWORD, (SPFX_RESTR | SPFX_BEHEAD), 0, 0,
PHYS(5, 1), NO_DFNS, NO_CARY, 0, A_NEUTRAL, NON_PM, NON_PM, 4000L,
NO_COLOR),
NO_COLOR, VORPAL_BLADE),
/*
* Ah, never shall I forget the cry,
* or the shriek that shrieked he,
@@ -157,11 +166,11 @@ static NEARDATA struct artifact artilist[] = {
* (From Sir W.S. Gilbert's "The Mikado")
*/
A("Snickersnee", KATANA, SPFX_RESTR, 0, 0, PHYS(0, 8), NO_DFNS, NO_CARY,
0, A_LAWFUL, PM_SAMURAI, NON_PM, 1200L, NO_COLOR),
0, A_LAWFUL, PM_SAMURAI, NON_PM, 1200L, NO_COLOR, SNICKERSNEE),
A("Sunsword", LONG_SWORD, (SPFX_RESTR | SPFX_DFLAG2), 0, M2_UNDEAD,
PHYS(5, 0), DFNS(AD_BLND), NO_CARY, 0, A_LAWFUL, NON_PM, NON_PM, 1500L,
NO_COLOR),
NO_COLOR, SUNSWORD),
/*
* The artifacts for the quest dungeon, all self-willed.
@@ -170,52 +179,53 @@ static NEARDATA struct artifact artilist[] = {
A("The Orb of Detection", CRYSTAL_BALL,
(SPFX_NOGEN | SPFX_RESTR | SPFX_INTEL), (SPFX_ESP | SPFX_HSPDAM), 0,
NO_ATTK, NO_DFNS, CARY(AD_MAGM), INVIS, A_LAWFUL, PM_ARCHEOLOGIST,
NON_PM, 2500L, NO_COLOR),
NON_PM, 2500L, NO_COLOR, ORB_OF_DETECTION),
A("The Heart of Ahriman", LUCKSTONE,
(SPFX_NOGEN | SPFX_RESTR | SPFX_INTEL), SPFX_STLTH, 0,
/* this stone does double damage if used as a projectile weapon */
PHYS(5, 0), NO_DFNS, NO_CARY, LEVITATION, A_NEUTRAL, PM_BARBARIAN,
NON_PM, 2500L, NO_COLOR),
NON_PM, 2500L, NO_COLOR, HEART_OF_AHRIMAN),
A("The Sceptre of Might", MACE,
(SPFX_NOGEN | SPFX_RESTR | SPFX_INTEL | SPFX_DALIGN), 0, 0, PHYS(5, 0),
DFNS(AD_MAGM), NO_CARY, CONFLICT, A_LAWFUL, PM_CAVE_DWELLER, NON_PM, 2500L,
NO_COLOR),
NO_COLOR, SCEPTRE_OF_MIGHT),
#if 0 /* OBSOLETE */
A("The Palantir of Westernesse", CRYSTAL_BALL,
(SPFX_NOGEN|SPFX_RESTR|SPFX_INTEL),
(SPFX_ESP|SPFX_REGEN|SPFX_HSPDAM), 0,
NO_ATTK, NO_DFNS, NO_CARY,
TAMING, A_CHAOTIC, NON_PM , PM_ELF, 8000L, NO_COLOR ),
TAMING, A_CHAOTIC, NON_PM , PM_ELF, 8000L, NO_COLOR,
PALANTIR_OF_WESTERNESSE ),
#endif
A("The Staff of Aesculapius", QUARTERSTAFF,
(SPFX_NOGEN | SPFX_RESTR | SPFX_ATTK | SPFX_INTEL | SPFX_DRLI
| SPFX_REGEN),
0, 0, DRLI(0, 0), DRLI(0, 0), NO_CARY, HEALING, A_NEUTRAL, PM_HEALER,
NON_PM, 5000L, NO_COLOR),
NON_PM, 5000L, NO_COLOR, STAFF_OF_AESCULAPIUS),
A("The Magic Mirror of Merlin", MIRROR,
(SPFX_NOGEN | SPFX_RESTR | SPFX_INTEL | SPFX_SPEAK), SPFX_ESP, 0,
NO_ATTK, NO_DFNS, CARY(AD_MAGM), 0, A_LAWFUL, PM_KNIGHT, NON_PM, 1500L,
NO_COLOR),
NO_COLOR, MAGIC_MIRROR_OF_MERLIN),
A("The Eyes of the Overworld", LENSES,
(SPFX_NOGEN | SPFX_RESTR | SPFX_INTEL | SPFX_XRAY), 0, 0, NO_ATTK,
DFNS(AD_MAGM), NO_CARY, ENLIGHTENING, A_NEUTRAL, PM_MONK, NON_PM,
2500L, NO_COLOR),
2500L, NO_COLOR, EYES_OF_THE_OVERWORLD),
A("The Mitre of Holiness", HELM_OF_BRILLIANCE,
(SPFX_NOGEN | SPFX_RESTR | SPFX_DFLAG2 | SPFX_INTEL | SPFX_PROTECT), 0,
M2_UNDEAD, NO_ATTK, NO_DFNS, CARY(AD_FIRE), ENERGY_BOOST, A_LAWFUL,
PM_CLERIC, NON_PM, 2000L, NO_COLOR),
PM_CLERIC, NON_PM, 2000L, NO_COLOR, MITRE_OF_HOLINESS),
A("The Longbow of Diana", BOW,
(SPFX_NOGEN | SPFX_RESTR | SPFX_INTEL | SPFX_REFLECT), SPFX_ESP, 0,
PHYS(5, 0), NO_DFNS, NO_CARY, CREATE_AMMO, A_CHAOTIC, PM_RANGER, NON_PM,
4000L, NO_COLOR),
4000L, NO_COLOR, LONGBOW_OF_DIANA),
/* MKoT has an additional carry property if the Key is not cursed (for
rogues) or blessed (for non-rogues): #untrap of doors and chests
@@ -223,40 +233,45 @@ A("The Palantir of Westernesse", CRYSTAL_BALL,
A("The Master Key of Thievery", SKELETON_KEY,
(SPFX_NOGEN | SPFX_RESTR | SPFX_INTEL | SPFX_SPEAK),
(SPFX_WARN | SPFX_TCTRL | SPFX_HPHDAM), 0, NO_ATTK, NO_DFNS, NO_CARY,
UNTRAP, A_CHAOTIC, PM_ROGUE, NON_PM, 3500L, NO_COLOR),
UNTRAP, A_CHAOTIC, PM_ROGUE, NON_PM, 3500L, NO_COLOR,
MASTER_KEY_OF_THIEVERY),
A("The Tsurugi of Muramasa", TSURUGI,
(SPFX_NOGEN | SPFX_RESTR | SPFX_INTEL | SPFX_BEHEAD | SPFX_LUCK
| SPFX_PROTECT),
0, 0, PHYS(0, 8), NO_DFNS, NO_CARY, 0, A_LAWFUL, PM_SAMURAI, NON_PM,
4500L, NO_COLOR),
4500L, NO_COLOR, TSURUGI_OF_MURAMASA),
A("The Platinum Yendorian Express Card", CREDIT_CARD,
(SPFX_NOGEN | SPFX_RESTR | SPFX_INTEL | SPFX_DEFN),
(SPFX_ESP | SPFX_HSPDAM), 0, NO_ATTK, NO_DFNS, CARY(AD_MAGM),
CHARGE_OBJ, A_NEUTRAL, PM_TOURIST, NON_PM, 7000L, NO_COLOR),
CHARGE_OBJ, A_NEUTRAL, PM_TOURIST, NON_PM, 7000L, NO_COLOR,
YENDORIAN_EXPRESS_CARD),
A("The Orb of Fate", CRYSTAL_BALL,
(SPFX_NOGEN | SPFX_RESTR | SPFX_INTEL | SPFX_LUCK),
(SPFX_WARN | SPFX_HSPDAM | SPFX_HPHDAM), 0, NO_ATTK, NO_DFNS, NO_CARY,
LEV_TELE, A_NEUTRAL, PM_VALKYRIE, NON_PM, 3500L, NO_COLOR),
LEV_TELE, A_NEUTRAL, PM_VALKYRIE, NON_PM, 3500L, NO_COLOR,
ORB_OF_FATE),
A("The Eye of the Aethiopica", AMULET_OF_ESP,
(SPFX_NOGEN | SPFX_RESTR | SPFX_INTEL), (SPFX_EREGEN | SPFX_HSPDAM), 0,
NO_ATTK, DFNS(AD_MAGM), NO_CARY, CREATE_PORTAL, A_NEUTRAL, PM_WIZARD,
NON_PM, 4000L, NO_COLOR),
NON_PM, 4000L, NO_COLOR, EYE_OF_THE_AETHIOPICA),
#if !defined(ARTI_ENUM)
/*
* terminator; otyp must be zero
*/
A(0, 0, 0, 0, 0, NO_ATTK, NO_DFNS, NO_CARY, 0, A_NONE, NON_PM, NON_PM, 0L,
0) /* 0 is CLR_BLACK rather than NO_COLOR but it doesn't matter here */
0, TERMINATOR) /* 0 is CLR_BLACK rather than NO_COLOR but it doesn't matter here */
}; /* artilist[] (or artifact_names[]) */
#endif
#undef A
#if !defined(MAKEDEFS_C) && !defined(MDLIB_C)
#if !defined(MAKEDEFS_C) && !defined(MDLIB_C) && !defined(ARTI_ENUM)
#undef NO_ATTK
#undef NO_DFNS
#undef DFNS

View File

@@ -270,6 +270,16 @@
#endif
#endif
/*
* NODUMPENUMS
* If there are memory constraints and you don't want to store information
* about the internal enum values for monsters and objects, this can be
* uncommented to define NODUMPENUMS. Doing so will disable the
* nethack --dumpenums
* command line option.
*/
/* #define NODUMPENUMS */
/*
* If COMPRESS is defined, it should contain the full path name of your
* 'compress' program.

View File

@@ -250,11 +250,6 @@ 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) */
#include "pm.h"
#endif
struct mvitals {
uchar born;
uchar died;
@@ -434,6 +429,9 @@ E const char *ARGV0;
#endif
enum earlyarg {ARG_DEBUG, ARG_VERSION, ARG_SHOWPATHS
#ifndef NODUMPENUMS
, ARG_DUMPENUMS
#endif
#ifdef WIN32
,ARG_WINDOWS
#endif

View File

@@ -247,6 +247,11 @@ extern char yn_function(const char *, const char *, char);
extern boolean paranoid_query(boolean, const char *);
extern void makemap_prepost(boolean, boolean);
/* ### date.c ### */
extern void populate_nomakedefs(struct version_info *);
extern void free_nomakedefs(void);
/* ### dbridge.c ### */
extern boolean is_pool(int, int);
@@ -1193,6 +1198,9 @@ extern int buzzmu(struct monst *, struct attack *);
extern void runtime_info_init(void);
extern const char *do_runtime_info(int *);
#ifndef NODUMPENUMS
extern void dump_enums(void);
#endif
/* ### mhitm.c ### */

View File

@@ -111,40 +111,6 @@ typedef uchar nhsym;
#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.
@@ -356,6 +322,26 @@ struct savefile_info {
#define SFI1_ZEROCOMP (1L << 2)
#endif
/* This is used to store some build-info data that used
to be present in makedefs-generated header file date.h */
struct nomakedefs_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 nomakedefs_s nomakedefs;
/*
* Configurable internal parameters.
*

View File

@@ -185,6 +185,18 @@ typedef struct {
#include "dungeon.h"
#include "sym.h"
#include "mkroom.h"
enum artifacts_nums {
#define ARTI_ENUM
#include "artilist.h"
#undef ARTI_ENUM
AFTER_LAST_ARTIFACT
};
enum misc_arti_nums {
NROFARTIFACTS = (AFTER_LAST_ARTIFACT - 1)
};
#include "objclass.h"
#include "youprop.h"
#include "wintype.h"

3326
include/monsters.h Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -134,9 +134,6 @@ struct objdescr {
const char *oc_descr; /* description when name unknown */
};
extern NEARDATA struct objclass objects[];
extern NEARDATA struct objdescr obj_descr[];
/*
* All objects have a class. Make sure that all classes have a corresponding
* symbol below.
@@ -183,6 +180,23 @@ struct fruit {
#define newfruit() (struct fruit *) alloc(sizeof(struct fruit))
#define dealloc_fruit(rind) free((genericptr_t)(rind))
enum objects_nums {
#define OBJECTS_ENUM
#include "objects.h"
#undef OBJECTS_ENUM
NUM_OBJECTS
};
enum misc_object_nums {
LAST_GEM = (JADE),
NUM_GLASS_GEMS = ((LUCKSTONE - JADE) - 1),
MAXSPELL = ((SPE_BOOK_OF_THE_DEAD - SCR_BLANK_PAPER) + 1)
};
extern NEARDATA struct objclass objects[NUM_OBJECTS + 1];
extern NEARDATA struct objdescr obj_descr[NUM_OBJECTS + 1];
#define OBJ_NAME(obj) (obj_descr[(obj).oc_name_idx].oc_name)
#define OBJ_DESCR(obj) (obj_descr[(obj).oc_descr_idx].oc_descr)
#endif /* OBJCLASS_H */

1532
include/objects.h Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -39,7 +39,8 @@
#define COPYRIGHT_BANNER_A "NetHack, Copyright 1985-2021"
#define COPYRIGHT_BANNER_B \
" By Stichting Mathematisch Centrum and M. Stephenson."
/* COPYRIGHT_BANNER_C is generated by makedefs into date.h */
/* nomakedefs.copyright_banner_c is generated at runtime */
#define COPYRIGHT_BANNER_C nomakedefs.copyright_banner_c
#define COPYRIGHT_BANNER_D " See license for details."
/*

View File

@@ -66,6 +66,13 @@ struct permonst {
extern NEARDATA struct permonst mons[]; /* the master list of monster types */
enum monnums {
#define MONS_ENUM
#include "monsters.h"
#undef MONS_ENUM
NUMMONS
};
#define VERY_SLOW 3
#define SLOW_SPEED 9
#define NORMAL_SPEED 12 /* movement rates */
@@ -82,4 +89,5 @@ extern NEARDATA struct permonst mons[]; /* the master list of monster types */
#define pmname(pm,g) ((((g) == MALE || (g) == FEMALE) && (pm)->pmnames[g]) \
? (pm)->pmnames[g] : (pm)->pmnames[NEUTRAL])
#endif
#endif /* PERMONST_H */

View File

@@ -8,7 +8,6 @@
#include "prop.h"
#include "permonst.h"
#include "mondata.h"
#include "pm.h"
/* KMH, intrinsics patch.
* Reorganized and rewritten for >32-bit properties.