Toss unused parts of dungeon.c and init.c
This commit is contained in:
parent
6c6c72f327
commit
44abab29e3
3 changed files with 13 additions and 49 deletions
4
common.h
4
common.h
|
@ -38,11 +38,7 @@ enum bugtype {
|
||||||
TOO_MANY_TRAVEL_OPTIONS, // 3
|
TOO_MANY_TRAVEL_OPTIONS, // 3
|
||||||
TOO_MANY_VOCABULARY_WORDS, // 4
|
TOO_MANY_VOCABULARY_WORDS, // 4
|
||||||
REQUIRED_VOCABULARY_WORD_NOT_FOUND, // 5
|
REQUIRED_VOCABULARY_WORD_NOT_FOUND, // 5
|
||||||
TOO_MANY_RTEXT_MESSAGES, // 6
|
|
||||||
TOO_MANY_HINTS, // 7
|
|
||||||
LOCATION_HAS_CONDITION_BIT_BEING_SET_TWICE, // 8
|
|
||||||
INVALID_SECTION_NUMBER_IN_DATABASE, // 9
|
INVALID_SECTION_NUMBER_IN_DATABASE, // 9
|
||||||
TOO_MANY_LOCATIONS, // 10
|
|
||||||
SPECIAL_TRAVEL_500_GT_L_GT_300_EXCEEDS_GOTO_LIST = 20, // 20
|
SPECIAL_TRAVEL_500_GT_L_GT_300_EXCEEDS_GOTO_LIST = 20, // 20
|
||||||
RAN_OFF_END_OF_VOCABULARY_TABLE, // 21
|
RAN_OFF_END_OF_VOCABULARY_TABLE, // 21
|
||||||
VOCABULARY_TYPE_N_OVER_1000_NOT_BETWEEN_0_AND_3, // 22
|
VOCABULARY_TYPE_N_OVER_1000_NOT_BETWEEN_0_AND_3, // 22
|
||||||
|
|
47
dungeon.c
47
dungeon.c
|
@ -5,7 +5,6 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define LINESIZE 100
|
#define LINESIZE 100
|
||||||
#define RTXSIZ 277
|
|
||||||
#define CLSMAX 12
|
#define CLSMAX 12
|
||||||
#define LINSIZ 12600
|
#define LINSIZ 12600
|
||||||
#define TRNSIZ 5
|
#define TRNSIZ 5
|
||||||
|
@ -13,8 +12,6 @@
|
||||||
#define VRBSIZ 35
|
#define VRBSIZ 35
|
||||||
#define TRVSIZ 885
|
#define TRVSIZ 885
|
||||||
#define TOKLEN 5
|
#define TOKLEN 5
|
||||||
#define HINTLEN 5
|
|
||||||
#define HNTSIZ 20
|
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
@ -33,18 +30,11 @@ long LINUSE;
|
||||||
long TRVS;
|
long TRVS;
|
||||||
long TRNVLS;
|
long TRNVLS;
|
||||||
long TABNDX;
|
long TABNDX;
|
||||||
long HNTMAX;
|
|
||||||
long PTEXT[NOBJECTS + 1];
|
|
||||||
long RTEXT[RTXSIZ + 1];
|
|
||||||
long OBJSND[NOBJECTS + 1];
|
long OBJSND[NOBJECTS + 1];
|
||||||
long OBJTXT[NOBJECTS + 1];
|
long OBJTXT[NOBJECTS + 1];
|
||||||
long STEXT[LOCSIZ + 1];
|
|
||||||
long LTEXT[LOCSIZ + 1];
|
|
||||||
long KEY[LOCSIZ + 1];
|
long KEY[LOCSIZ + 1];
|
||||||
long LOCSND[LOCSIZ + 1];
|
long LOCSND[LOCSIZ + 1];
|
||||||
long LINES[LINSIZ + 1];
|
long LINES[LINSIZ + 1];
|
||||||
long TTEXT[TRNSIZ + 1];
|
|
||||||
long TRNVAL[TRNSIZ + 1];
|
|
||||||
long TRAVEL[TRVSIZ + 1];
|
long TRAVEL[TRVSIZ + 1];
|
||||||
long KTAB[TABSIZ + 1];
|
long KTAB[TABSIZ + 1];
|
||||||
long ATAB[TABSIZ + 1];
|
long ATAB[TABSIZ + 1];
|
||||||
|
@ -211,24 +201,18 @@ static void read_messages(FILE* database, long sect)
|
||||||
/* now parsed from YAML */
|
/* now parsed from YAML */
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (sect == 6) {
|
|
||||||
if (loc > RTXSIZ)
|
|
||||||
BUG(TOO_MANY_RTEXT_MESSAGES);
|
|
||||||
RTEXT[loc] = LINUSE;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (sect == 5) {
|
if (sect == 5) {
|
||||||
if (loc > 0 && loc <= NOBJECTS)PTEXT[loc] = LINUSE;
|
/* Now handled in YAML */
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (sect == 6) {
|
||||||
|
/* Now handled in YAML */
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (loc > LOCSIZ)
|
|
||||||
BUG(TOO_MANY_LOCATIONS);
|
|
||||||
if (sect == 1) {
|
if (sect == 1) {
|
||||||
LTEXT[loc] = LINUSE;
|
/* Now handled in YAML */
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
STEXT[loc] = LINUSE;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -309,15 +293,11 @@ static void read_conditions(FILE* database)
|
||||||
static void read_hints(FILE* database)
|
static void read_hints(FILE* database)
|
||||||
{
|
{
|
||||||
long K;
|
long K;
|
||||||
HNTMAX = 0;
|
|
||||||
while ((K = GETNUM(database)) != -1) {
|
while ((K = GETNUM(database)) != -1) {
|
||||||
if (K <= 0 || K > HNTSIZ)
|
|
||||||
BUG(TOO_MANY_HINTS);
|
|
||||||
for (int I = 1; I <= 4; I++) {
|
for (int I = 1; I <= 4; I++) {
|
||||||
/* consume - actual arrqy-building now done in YAML. */
|
/* consume - actual array-building now done in YAML. */
|
||||||
GETNUM(NULL);
|
GETNUM(NULL);
|
||||||
} /* end loop */
|
} /* end loop */
|
||||||
HNTMAX = (HNTMAX > K ? HNTMAX : K);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -346,22 +326,14 @@ static int read_database(FILE* database)
|
||||||
* the next pointer (i.e. the word following the end of the
|
* the next pointer (i.e. the word following the end of the
|
||||||
* line). The pointer is negative if this is first line of a
|
* line). The pointer is negative if this is first line of a
|
||||||
* message. The text-pointer arrays contain indices of
|
* message. The text-pointer arrays contain indices of
|
||||||
* pointer-words in lines. STEXT(N) is short description of
|
* pointer-words in lines. PTEXT(N) points to
|
||||||
* location N. LTEXT(N) is long description. PTEXT(N) points to
|
|
||||||
* message for game.prop(N)=0. Successive prop messages are
|
* message for game.prop(N)=0. Successive prop messages are
|
||||||
* found by chasing pointers. RTEXT contains section 6's stuff.
|
* found by chasing pointers. */
|
||||||
* TTEXT is for section 14. */
|
|
||||||
for (int I = 1; I <= NOBJECTS; I++) {
|
for (int I = 1; I <= NOBJECTS; I++) {
|
||||||
PTEXT[I] = 0;
|
|
||||||
OBJSND[I] = 0;
|
OBJSND[I] = 0;
|
||||||
OBJTXT[I] = 0;
|
OBJTXT[I] = 0;
|
||||||
}
|
}
|
||||||
for (int I = 1; I <= RTXSIZ; I++) {
|
|
||||||
RTEXT[I] = 0;
|
|
||||||
}
|
|
||||||
for (int I = 1; I <= LOCSIZ; I++) {
|
for (int I = 1; I <= LOCSIZ; I++) {
|
||||||
STEXT[I] = 0;
|
|
||||||
LTEXT[I] = 0;
|
|
||||||
KEY[I] = 0;
|
KEY[I] = 0;
|
||||||
LOCSND[I] = 0;
|
LOCSND[I] = 0;
|
||||||
}
|
}
|
||||||
|
@ -458,7 +430,6 @@ static void write_file(FILE* header_file)
|
||||||
|
|
||||||
fprintf(header_file, "#include \"common.h\"\n");
|
fprintf(header_file, "#include \"common.h\"\n");
|
||||||
fprintf(header_file, "#define TABSIZ 330\n");
|
fprintf(header_file, "#define TABSIZ 330\n");
|
||||||
fprintf(header_file, "#define HNTSIZ 20\n");
|
|
||||||
fprintf(header_file, "#define TOKLEN %d\n", TOKLEN);
|
fprintf(header_file, "#define TOKLEN %d\n", TOKLEN);
|
||||||
fprintf(header_file, "\n");
|
fprintf(header_file, "\n");
|
||||||
|
|
||||||
|
|
11
init.c
11
init.c
|
@ -14,15 +14,13 @@
|
||||||
* 12600 words of message text (LINES, LINSIZ).
|
* 12600 words of message text (LINES, LINSIZ).
|
||||||
* 885 travel options (TRAVEL, TRVSIZ).
|
* 885 travel options (TRAVEL, TRVSIZ).
|
||||||
* 330 vocabulary words (KTAB, ATAB, TABSIZ).
|
* 330 vocabulary words (KTAB, ATAB, TABSIZ).
|
||||||
* 185 locations (LTEXT, STEXT, KEY, COND, game.abbrev, game.atloc,
|
* 185 locations (KEY, COND, game.abbrev, game.atloc, LOCSND, LOCSIZ).
|
||||||
* LOCSND, LOCSIZ).
|
|
||||||
* 100 objects (PLAC, game.place, FIXD, game.fixed, game.link (twice),
|
* 100 objects (PLAC, game.place, FIXD, game.fixed, game.link (twice),
|
||||||
* PTEXT, game.prop, OBJSND, OBJTXT).
|
* ogame.prop, OBJSND, OBJTXT).
|
||||||
* 35 "action" verbs (ACTSPK, VRBSIZ).
|
* 35 "action" verbs (ACTSPK, VRBSIZ).
|
||||||
* 277 random messages (RTEXT, RTXSIZ).
|
|
||||||
* 12 different player classifications (CTEXT, CVAL, CLSMAX).
|
* 12 different player classifications (CTEXT, CVAL, CLSMAX).
|
||||||
* 20 hints (game.hintlc, game.hinted, HINTS, HNTSIZ).
|
* 20 hints (game.hintlc, game.hinted, HINTS, HNTSIZ).
|
||||||
* 5 "# of turns" threshholds (TTEXT, TRNVAL, TRNSIZ).
|
* 5 "# of turns" threshholds (TRNSIZ).
|
||||||
* There are also limits which cannot be exceeded due to the structure of
|
* There are also limits which cannot be exceeded due to the structure of
|
||||||
* the database. (E.G., The vocabulary uses n/1000 to determine word type,
|
* the database. (E.G., The vocabulary uses n/1000 to determine word type,
|
||||||
* so there can't be more than 1000 words.) These upper limits are:
|
* so there can't be more than 1000 words.) These upper limits are:
|
||||||
|
@ -134,8 +132,7 @@
|
||||||
* bit; see section 9), the number of turns he must be at the right loc(s)
|
* bit; see section 9), the number of turns he must be at the right loc(s)
|
||||||
* before triggering the hint, the points deducted for taking the hint,
|
* before triggering the hint, the points deducted for taking the hint,
|
||||||
* the message number (section 6) of the question, and the message number
|
* the message number (section 6) of the question, and the message number
|
||||||
* of the hint. These values are stashed in the "hints" array. HNTMAX is
|
* of the hint. These values are stashed in the "hints" array.
|
||||||
* set to the max hint number (<= HNTSIZ).
|
|
||||||
* Section 12: Unused in this version.
|
* Section 12: Unused in this version.
|
||||||
* Section 13: Sounds and text. Each line contains either 2 or 3 numbers. If
|
* Section 13: Sounds and text. Each line contains either 2 or 3 numbers. If
|
||||||
* 2 (call them N and S), N is a location and message ABS(S) from section
|
* 2 (call them N and S), N is a location and message ABS(S) from section
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue