Elimination of OBJTXT.
This means eveything in Section 13 of adventure.text has moved to YAML.
This commit is contained in:
parent
0c2803638f
commit
07207420a2
2 changed files with 4 additions and 12 deletions
|
@ -804,7 +804,7 @@ static int read(struct command_t command)
|
||||||
if (command.obj == INTRANSITIVE) {
|
if (command.obj == INTRANSITIVE) {
|
||||||
command.obj = 0;
|
command.obj = 0;
|
||||||
for (int i = 1; i <= NOBJECTS; i++) {
|
for (int i = 1; i <= NOBJECTS; i++) {
|
||||||
if (HERE(i) && OBJTXT[i] != 0 && game.prop[i] >= 0)
|
if (HERE(i) && object_descriptions[i].texts[0] != NULL && game.prop[i] >= 0)
|
||||||
command.obj = command.obj * NOBJECTS + i;
|
command.obj = command.obj * NOBJECTS + i;
|
||||||
}
|
}
|
||||||
if (command.obj > NOBJECTS || command.obj == 0 || DARK(game.loc))
|
if (command.obj > NOBJECTS || command.obj == 0 || DARK(game.loc))
|
||||||
|
@ -815,7 +815,7 @@ static int read(struct command_t command)
|
||||||
rspeak(NO_SEE, command.wd1, command.wd1x);
|
rspeak(NO_SEE, command.wd1, command.wd1x);
|
||||||
} else if (command.obj == OYSTER && !game.clshnt && game.closed) {
|
} else if (command.obj == OYSTER && !game.clshnt && game.closed) {
|
||||||
game.clshnt = YES(arbitrary_messages[CLUE_QUERY], arbitrary_messages[WAYOUT_CLUE], arbitrary_messages[OK_MAN]);
|
game.clshnt = YES(arbitrary_messages[CLUE_QUERY], arbitrary_messages[WAYOUT_CLUE], arbitrary_messages[OK_MAN]);
|
||||||
} else if (OBJTXT[command.obj] == 0 || game.prop[command.obj] < 0) {
|
} else if (object_descriptions[command.obj].texts[0] == NULL || game.prop[command.obj] < 0) {
|
||||||
rspeak(ACTSPK[command.verb]);
|
rspeak(ACTSPK[command.verb]);
|
||||||
} else
|
} else
|
||||||
pspeak(command.obj, study, game.prop[command.obj]);
|
pspeak(command.obj, study, game.prop[command.obj]);
|
||||||
|
|
12
dungeon.c
12
dungeon.c
|
@ -30,7 +30,6 @@ long LINUSE;
|
||||||
long TRVS;
|
long TRVS;
|
||||||
long TRNVLS;
|
long TRNVLS;
|
||||||
long TABNDX;
|
long TABNDX;
|
||||||
long OBJTXT[NOBJECTS + 1];
|
|
||||||
long KEY[LOCSIZ + 1];
|
long KEY[LOCSIZ + 1];
|
||||||
long LINES[LINSIZ + 1];
|
long LINES[LINSIZ + 1];
|
||||||
long TRAVEL[TRVSIZ + 1];
|
long TRAVEL[TRVSIZ + 1];
|
||||||
|
@ -299,17 +298,14 @@ static void read_hints(FILE* database)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Read the sound/text info, store in OBJSND, OBJTXT */
|
/* Read the sound/text info */
|
||||||
static void read_sound_text(FILE* database)
|
static void read_sound_text(FILE* database)
|
||||||
{
|
{
|
||||||
long K;
|
long K;
|
||||||
while ((K = GETNUM(database)) != -1) {
|
while ((K = GETNUM(database)) != -1) {
|
||||||
long KK = GETNUM(NULL);
|
long KK = GETNUM(NULL);
|
||||||
long I = GETNUM(NULL);
|
long I = GETNUM(NULL);
|
||||||
if (I != 0) {
|
/* this stuff is in YAML now */
|
||||||
OBJTXT[K] = (I > 0 ? I : 0);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -324,9 +320,6 @@ static int read_database(FILE* database)
|
||||||
* pointer-words in lines. PTEXT(N) points to
|
* pointer-words in lines. 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. */
|
* found by chasing pointers. */
|
||||||
for (int I = 1; I <= NOBJECTS; I++) {
|
|
||||||
OBJTXT[I] = 0;
|
|
||||||
}
|
|
||||||
for (int I = 1; I <= LOCSIZ; I++) {
|
for (int I = 1; I <= LOCSIZ; I++) {
|
||||||
KEY[I] = 0;
|
KEY[I] = 0;
|
||||||
}
|
}
|
||||||
|
@ -437,7 +430,6 @@ static void write_file(FILE* header_file)
|
||||||
fprintf(header_file, "\n");
|
fprintf(header_file, "\n");
|
||||||
|
|
||||||
// content variables
|
// content variables
|
||||||
write_1d(header_file, OBJTXT, NOBJECTS + 1, "OBJTXT");
|
|
||||||
write_1d(header_file, KEY, LOCSIZ + 1, "KEY");
|
write_1d(header_file, KEY, LOCSIZ + 1, "KEY");
|
||||||
write_1d(header_file, TRAVEL, TRVSIZ + 1, "TRAVEL");
|
write_1d(header_file, TRAVEL, TRVSIZ + 1, "TRAVEL");
|
||||||
write_1d(header_file, KTAB, TABSIZ + 1, "KTAB");
|
write_1d(header_file, KTAB, TABSIZ + 1, "KTAB");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue