Merge branch 'NetHack-3.6'

This commit is contained in:
nhmall
2019-06-05 08:08:32 -04:00
33 changed files with 542 additions and 128 deletions

View File

@@ -217,6 +217,13 @@ static int FDECL(case_insensitive_comp, (const char *, const char *));
/* input, output, tmp */
static FILE *ifp, *ofp, *tfp;
static boolean use_enum =
#ifdef ENUM_PM
TRUE;
#else
FALSE;
#endif
#if defined(__BORLANDC__) && !defined(_WIN32)
extern unsigned _stklen = STKSIZ;
#endif
@@ -2324,10 +2331,20 @@ do_permonst()
Fprintf(ofp, "%s", Dont_Edit_Code);
Fprintf(ofp, "#ifndef PM_H\n#define PM_H\n");
if (use_enum) {
Fprintf(ofp, "\nenum monnums {");
#if 0
/* need #define ENUM_PM for the full NetHack build to include these */
Fprintf(ofp, "\n NON_PM = -1,");
Fprintf(ofp, "\n LOW_PM = 0,");
#endif
}
for (i = 0; mons[i].mlet; i++) {
SpinCursor(3);
Fprintf(ofp, "\n#define\tPM_");
if (use_enum)
Fprintf(ofp, "\n PM_");
else
Fprintf(ofp, "\n#define\tPM_");
if (mons[i].mlet == S_HUMAN && !strncmp(mons[i].mname, "were", 4))
Fprintf(ofp, "HUMAN_");
for (nam = c = tmpdup(mons[i].mname); *c; c++)
@@ -2335,9 +2352,17 @@ do_permonst()
*c -= (char) ('a' - 'A');
else if (*c < 'A' || *c > 'Z')
*c = '_';
Fprintf(ofp, "%s\t%d", nam, i);
if (use_enum)
Fprintf(ofp, "%s = %d,", nam, i);
else
Fprintf(ofp, "%s\t%d", nam, i);
}
if (use_enum) {
Fprintf(ofp, "\n\n NUMMONS = %d", i);
Fprintf(ofp, "\n};\n");
} else {
Fprintf(ofp, "\n\n#define\tNUMMONS\t%d\n", i);
}
Fprintf(ofp, "\n\n#define\tNUMMONS\t%d\n", i);
Fprintf(ofp, "\n#endif /* PM_H */\n");
Fclose(ofp);
return;