static int bigwords(token_t foo)
/* FEE FIE FOE FOO (AND FUM). Advance to next state if given in proper order.
- * Look up foo in section 3 of vocab to determine which word we've got. Last
- * word zips the eggs back to the giant room (unless already there). */
+ * Look up foo in special section of vocab to determine which word we've got.
+ * Last word zips the eggs back to the giant room (unless already there). */
{
- //int k = vocab(foo, 3);
char word[6];
packed_to_token(foo, word);
int k = (int) get_special_vocab_id(word);
if (obj == BOTTLE && LIQUID() != 0)
game.place[LIQUID()] = CARRIED;
if (GSTONE(obj) && game.prop[obj] != 0) {
- game.prop[obj] = 0;
+ game.prop[obj] = STATE_GROUND;
game.prop[CAVITY] = CAVITY_EMPTY;
}
rspeak(OK_MAN);
#define PANICTIME 15 // time left after closing
#define BATTERYLIFE 2500 // turn limit increment from batteries
#define WORD_NOT_FOUND -1 // "Word not found" flag value for the vocab hash functions.
-#define NOT_YET_FOUND -1 // 'Not found" state of treasures */
#define CARRIED -1 // Player is toting it
#define READ_MODE "rb" // b is not needed for POSIX but harmless
#define WRITE_MODE "wb" // b is not needed for POSIX but harmless
+/* Special object-state values - integers > 0 are object-specific */
+#define STATE_NOTFOUND -1 // 'Not found" state of treasures */
+#define STATE_GROUND 0 // After discovered, before messed with
+
/*
* MOD(N,M) = Arithmetic modulus
* AT(OBJ) = true if on either side of two-placed object
for (int treasure = 1; treasure <= NOBJECTS; treasure++) {
if (objects[treasure].is_treasure) {
if (objects[treasure].inventory != 0)
- game.prop[treasure] = NOT_YET_FOUND;
+ game.prop[treasure] = STATE_NOTFOUND;
game.tally = game.tally - game.prop[treasure];
}
}
game.hintlc[hint] = 0;
return;
case 4: /* dark */
- if (game.prop[EMERALD] != NOT_YET_FOUND && game.prop[PYRAMID] == NOT_YET_FOUND)
+ if (game.prop[EMERALD] != STATE_NOTFOUND && game.prop[PYRAMID] == STATE_NOTFOUND)
break;
game.hintlc[hint] = 0;
return;
packed_to_token(command.wd2, word2);
V1 = get_vocab_id(word1);
V2 = get_vocab_id(word2);
- if (V1 == ENTER && (V2 == STREAM || V2 == 1000 + WATER)) {
+ if (V1 == ENTER && (V2 == STREAM || V2 == PROMOTE_WORD(WATER))) {
if (LIQLOC(game.loc) == WATER) {
rspeak(FEET_WET);
} else {
k = 14;
if (i > CHEST)
k = 16;
- if (game.prop[i] >= 0)
+ if (game.prop[i] > STATE_NOTFOUND)
score += 2;
- if (game.place[i] == LOC_BUILDING && game.prop[i] == 0)
+ if (game.place[i] == LOC_BUILDING && game.prop[i] == STATE_GROUND)
score += k - 2;
mxscor += k;
}