game.hints[hint].lc = 0;
return;
case 4: /* dark */
- if (game.objects[EMERALD].prop != STATE_NOTFOUND && game.objects[PYRAMID].prop == STATE_NOTFOUND)
+ if (!PROP_IS_NOTFOUND(EMERALD) && PROP_IS_NOTFOUND(PYRAMID))
break;
game.hints[hint].lc = 0;
return;
break;
return;
case 9: /* jade */
- if (game.tally == 1 && game.objects[JADE].prop < 0)
+ if (game.tally == 1 && PROP_IS_STASHED_OR_UNSEEN(JADE))
break;
game.hints[hint].lc = 0;
return;
/* The pirate's spotted him. Pirate leaves him alone once we've
* found chest. K counts if a treasure is here. If not, and
* tally=1 for an unseen chest, let the pirate be spotted. Note
- * that game.place[CHEST] = LOC_NOWHERE might mean that he's thrown
+ * that game.objexts,place[CHEST] = LOC_NOWHERE might mean that he's thrown
* it to the troll, but in that case he's seen the chest
- * (game.prop[CHEST] == STATE_FOUND). */
- if (game.loc == game.chloc || game.objects[CHEST].prop != STATE_NOTFOUND)
+ * PROP_IS_FOUND(CHEST) == true. */
+ if (game.loc == game.chloc || !PROP_IS_NOTFOUND(CHEST))
return true;
int snarfed = 0;
bool movechest = false, robplayer = false;
* chest, which may of course never show up). Note that the
* treasures need not have been taken yet, just located. Hence
* clock1 must be large enough to get out of the cave (it only ticks
- * while inside the cave). When it hits zero, we branch to 10000 to
- * start closing the cave, and then sit back and wait for him to try
- * to get out. If he doesn't within clock2 turns, we close the cave;
- * if he does try, we assume he panics, and give him a few additional
- * turns to get frantic before we close. When clock2 hits zero, we
- * transport him into the final puzzle. Note that the puzzle depends
- * upon all sorts of random things. For instance, there must be no
- * water or oil, since there are beanstalks which we don't want to be
- * able to water, since the code can't handle it. Also, we can have
- * no keys, since there is a grate (having moved the fixed object!)
- * there separating him from all the treasures. Most of these
- * problems arise from the use of negative prop numbers to suppress
- * the object descriptions until he's actually moved the objects. */
+ * while inside the cave). When it hits zero, we start closing the
+ * cave, and then sit back and wait for him to try to get out. If he
+ * doesn't within clock2 turns, we close the cave; if he does try, we
+ * assume he panics, and give him a few additional turns to get
+ * frantic before we close. When clock2 hits zero, we transport him
+ * into the final puzzle. Note that the puzzle depends upon all
+ * sorts of random things. For instance, there must be no water or
+ * oil, since there are beanstalks which we don't want to be able to
+ * water, since the code can't handle it. Also, we can have no keys,
+ * since there is a grate (having moved the fixed object!) there
+ * separating him from all the treasures. Most of these problems
+ * arise from the use of negative prop numbers to suppress the object
+ * descriptions until he's actually moved the objects. */
{
/* If a turn threshold has been met, apply penalties and tell
* the player about it. */
* objects come from known locations and/or states (e.g. the
* snake is known to have been destroyed and needn't be
* carried away from its old "place"), making the various
- * objects be handled differently. We also drop all other
- * objects he might be carrying (lest he have some which
+ * objects be handled differently. We also drop all other
+ * objects he might be acrrying (lest he have some which
* could cause trouble, such as the keys). We describe the
* flash of light and trundle back. */
- game.objects[BOTTLE].prop = put(BOTTLE, LOC_NE, EMPTY_BOTTLE);
- game.objects[PLANT].prop = put(PLANT, LOC_NE, PLANT_THIRSTY);
- game.objects[OYSTER].prop = put(OYSTER, LOC_NE, STATE_FOUND);
- game.objects[LAMP].prop = put(LAMP, LOC_NE, LAMP_DARK);
- game.objects[ROD].prop = put(ROD, LOC_NE, STATE_FOUND);
- game.objects[DWARF].prop = put(DWARF, LOC_NE, 0);
+ put(BOTTLE, LOC_NE, EMPTY_BOTTLE);
+ put(PLANT, LOC_NE, PLANT_THIRSTY);
+ put(OYSTER, LOC_NE, STATE_FOUND);
+ put(LAMP, LOC_NE, LAMP_DARK);
+ put(ROD, LOC_NE, STATE_FOUND);
+ put(DWARF, LOC_NE, STATE_FOUND);
game.loc = LOC_NE;
game.oldloc = LOC_NE;
game.newloc = LOC_NE;
move(GRATE, LOC_SW);
move(SIGN, LOC_SW);
game.objects[SIGN].prop = ENDGAME_SIGN;
- game.objects[SNAKE].prop = put(SNAKE, LOC_SW, SNAKE_CHASED);
- game.objects[BIRD].prop = put(BIRD, LOC_SW, BIRD_CAGED);
- game.objects[CAGE].prop = put(CAGE, LOC_SW, STATE_FOUND);
- game.objects[ROD2].prop = put(ROD2, LOC_SW, STATE_FOUND);
- game.objects[PILLOW].prop = put(PILLOW, LOC_SW, STATE_FOUND);
+ put(SNAKE, LOC_SW, SNAKE_CHASED);
+ put(BIRD, LOC_SW, BIRD_CAGED);
+ put(CAGE, LOC_SW, STATE_FOUND);
+ put(ROD2, LOC_SW, STATE_FOUND);
+ put(PILLOW, LOC_SW, STATE_FOUND);
- game.objects[MIRROR].prop = put(MIRROR, LOC_NE, STATE_FOUND);
+ put(MIRROR, LOC_NE, STATE_FOUND);
game.objects[MIRROR].fixed = LOC_SW;
for (int i = 1; i <= NOBJECTS; i++) {
obj = obj - NOBJECTS;
if (obj == STEPS && TOTING(NUGGET))
continue;
- if (game.objects[obj].prop < 0) {
+ if (PROP_IS_STASHED_OR_UNSEEN(obj)) {
if (game.closed)
continue;
- game.objects[obj].prop = STATE_FOUND;
+ PROP_SET_FOUND(obj);
if (obj == RUG)
game.objects[RUG].prop = RUG_DRAGON;
if (obj == CHAIN)
* game.prop < 0 and stash them. This way objects won't be
* described until they've been picked up and put down
* separate from their respective piles. */
- if (game.objects[OYSTER].prop < 0 && TOTING(OYSTER))
+ if ((PROP_IS_NOTFOUND(OYSTER) || PROP_IS_STASHED(OYSTER)) && TOTING(OYSTER))
pspeak(OYSTER, look, true, 1);
for (size_t i = 1; i <= NOBJECTS; i++) {
- if (TOTING(i) && game.objects[i].prop < 0)
- game.objects[i].prop = STASHED(i);
+ if (TOTING(i) && (PROP_IS_NOTFOUND(i) || PROP_IS_STASHED(i)))
+ game.objects[i].prop = PROP_STASHED(i);
}
}