Move MAXDIE computation to dungeonmaker.

This commit is contained in:
Eric S. Raymond 2017-06-07 15:33:22 -04:00
parent fa2fb48436
commit ed80d6dd2f
5 changed files with 13 additions and 7 deletions

View file

@ -145,5 +145,5 @@ extern long AMBER, ATTACK, AXE, BACK, BATTER, BEAR,
STEPS, STICK, STREAM, THROW, TRIDNT, TROLL, TROLL2,
URN, VASE, VEND, VOLCAN, WATER;
/* evrything else */
extern long I, J, K, L, MAXDIE, SPK, V1, V2, VRSION, WD1, WD1X, WD2, WD2X;
extern long I, J, K, L, SPK, V1, V2, VRSION, WD1, WD1X, WD2, WD2X;

View file

@ -1764,6 +1764,7 @@
78 You can't pour that.
79 Watch it!
80 Which way?
# Sequence of the death & reincarnation messages must not be altered
81 Oh dear, you seem to have gotten yourself killed. I might be able to
81 help you out, but I've never really done this before. Do you want me
81 to try to reincarnate you?
@ -1779,6 +1780,7 @@
85 me to do a decent reincarnation without any orange smoke, do you?
86 Okay, if you're so smart, do it yourself! I'm leaving!
90 >>> messages 81 thru 90 are reserved for "obituaries". <<<
# Death & reincarnation messages end here
91 Sorry, but I no longer seem to remember how it was you got here.
92 You can't carry anything more. You'll have to drop something first.
93 You can't go through a locked steel grate!

View file

@ -33,6 +33,7 @@ static long LNLENG;
static long LNPOSN;
static char INLINE[LINESIZE+1];
static long OLDLOC;
static long MAXDIE;
// Storage for what comes out of the database
long LINUSE;
@ -556,6 +557,13 @@ void write_hints(FILE* c_file, FILE* header_file, long matrix[][HINTLEN], long d
void write_files(FILE* c_file, FILE* header_file)
{
int i, MAXDIE;
for (i=0; i<=4; i++) {
long x = 2*i+81;
if(RTEXT[x] != 0)
MAXDIE=i+1;
}
// preprocessor defines for the header
fprintf(header_file, "#include \"sizes.h\"\n");
fprintf(header_file, "#define RTXSIZ 277\n");
@ -568,6 +576,7 @@ void write_files(FILE* c_file, FILE* header_file)
fprintf(header_file, "#define TRVSIZ 885\n");
fprintf(header_file, "#define TOKLEN %d\n", TOKLEN);
fprintf(header_file, "#define HINTLEN %d\n", HINTLEN);
fprintf(header_file, "#define MAXDIE %d\n", MAXDIE);
fprintf(header_file, "\n");
// include the header in the C file

5
init.c
View file

@ -369,11 +369,6 @@ void initialise(void)
game.knfloc=0;
game.detail=0;
game.abbnum=5;
for (i=0; i<=4; i++) {
long x = 2*i+81;
if(RTEXT[x] != 0)
MAXDIE=i+1;
}
game.numdie=0;
game.holdng=0;
game.dkill=0;

2
main.c
View file

@ -22,7 +22,7 @@ long AMBER, ATTACK, AXE, BACK, BATTER, BEAR, BIRD, BLOOD,
CLAM, COINS, DOOR, DPRSSN, DRAGON, DWARF, EGGS,
EMRALD, ENTER, ENTRNC, FIND, FISSUR, FOOD,
GRATE, HINT, I, INVENT, J, JADE, K, KEYS,
KNIFE, L, LAMP, LOCK, LOOK, MAGZIN, MAXDIE,
KNIFE, L, LAMP, LOCK, LOOK, MAGZIN,
MESSAG, MIRROR, NUGGET, NUL, OGRE, OIL, OYSTER,
PEARL, PILLOW, PLANT, PLANT2, PYRAM, RESER, ROD, ROD2,
RUBY, RUG, SAPPH, SAY, SECT, SIGN, SNAKE, SPK,