TOO_MANY_TRAVEL_OPTIONS, // 3
TOO_MANY_VOCABULARY_WORDS, // 4
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
- TOO_MANY_LOCATIONS, // 10
SPECIAL_TRAVEL_500_GT_L_GT_300_EXCEEDS_GOTO_LIST = 20, // 20
RAN_OFF_END_OF_VOCABULARY_TABLE, // 21
VOCABULARY_TYPE_N_OVER_1000_NOT_BETWEEN_0_AND_3, // 22
*/
#define LINESIZE 100
-#define RTXSIZ 277
#define CLSMAX 12
#define LINSIZ 12600
#define TRNSIZ 5
#define VRBSIZ 35
#define TRVSIZ 885
#define TOKLEN 5
-#define HINTLEN 5
-#define HNTSIZ 20
#include <stdio.h>
#include <stdlib.h>
long TRVS;
long TRNVLS;
long TABNDX;
-long HNTMAX;
-long PTEXT[NOBJECTS + 1];
-long RTEXT[RTXSIZ + 1];
long OBJSND[NOBJECTS + 1];
long OBJTXT[NOBJECTS + 1];
-long STEXT[LOCSIZ + 1];
-long LTEXT[LOCSIZ + 1];
long KEY[LOCSIZ + 1];
long LOCSND[LOCSIZ + 1];
long LINES[LINSIZ + 1];
-long TTEXT[TRNSIZ + 1];
-long TRNVAL[TRNSIZ + 1];
long TRAVEL[TRVSIZ + 1];
long KTAB[TABSIZ + 1];
long ATAB[TABSIZ + 1];
/* now parsed from YAML */
continue;
}
- if (sect == 6) {
- if (loc > RTXSIZ)
- BUG(TOO_MANY_RTEXT_MESSAGES);
- RTEXT[loc] = LINUSE;
+ if (sect == 5) {
+ /* Now handled in YAML */
continue;
}
- if (sect == 5) {
- if (loc > 0 && loc <= NOBJECTS)PTEXT[loc] = LINUSE;
+ if (sect == 6) {
+ /* Now handled in YAML */
continue;
}
- if (loc > LOCSIZ)
- BUG(TOO_MANY_LOCATIONS);
if (sect == 1) {
- LTEXT[loc] = LINUSE;
+ /* Now handled in YAML */
continue;
}
-
- STEXT[loc] = LINUSE;
}
}
static void read_hints(FILE* database)
{
long K;
- HNTMAX = 0;
while ((K = GETNUM(database)) != -1) {
- if (K <= 0 || K > HNTSIZ)
- BUG(TOO_MANY_HINTS);
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);
} /* end loop */
- HNTMAX = (HNTMAX > K ? HNTMAX : K);
}
}
* the next pointer (i.e. the word following the end of the
* line). The pointer is negative if this is first line of a
* message. The text-pointer arrays contain indices of
- * pointer-words in lines. STEXT(N) is short description of
- * location N. LTEXT(N) is long description. PTEXT(N) points to
+ * pointer-words in lines. PTEXT(N) points to
* message for game.prop(N)=0. Successive prop messages are
- * found by chasing pointers. RTEXT contains section 6's stuff.
- * TTEXT is for section 14. */
+ * found by chasing pointers. */
for (int I = 1; I <= NOBJECTS; I++) {
- PTEXT[I] = 0;
OBJSND[I] = 0;
OBJTXT[I] = 0;
}
- for (int I = 1; I <= RTXSIZ; I++) {
- RTEXT[I] = 0;
- }
for (int I = 1; I <= LOCSIZ; I++) {
- STEXT[I] = 0;
- LTEXT[I] = 0;
KEY[I] = 0;
LOCSND[I] = 0;
}
fprintf(header_file, "#include \"common.h\"\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, "\n");
* 12600 words of message text (LINES, LINSIZ).
* 885 travel options (TRAVEL, TRVSIZ).
* 330 vocabulary words (KTAB, ATAB, TABSIZ).
- * 185 locations (LTEXT, STEXT, KEY, COND, game.abbrev, game.atloc,
- * LOCSND, LOCSIZ).
+ * 185 locations (KEY, COND, game.abbrev, game.atloc, LOCSND, LOCSIZ).
* 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).
- * 277 random messages (RTEXT, RTXSIZ).
* 12 different player classifications (CTEXT, CVAL, CLSMAX).
* 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
* 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:
* 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,
* 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
- * set to the max hint number (<= HNTSIZ).
+ * of the hint. These values are stashed in the "hints" array.
* Section 12: Unused in this version.
* 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