return GO_CLEAROBJ;
}
DESTROY(BIRD);
- game.prop[BIRD] = 0;
spk = BIRD_DEAD;
} else if (obj == VEND) {
pspeak(VEND, game.prop[VEND] + 2);
if (game.holdng >= INVLIMIT) {
rspeak(spk);
return GO_CLEAROBJ;
- } else if (obj == BIRD && game.prop[BIRD] != 1 && -1 - game.prop[BIRD] != 1) {
- if (game.prop[BIRD] == 2) {
+ } else if (obj == BIRD && game.prop[BIRD] != BIRD_CAGED && -1 - game.prop[BIRD] != BIRD_CAGED) {
+ if (game.prop[BIRD] == BIRD_FOREST_UNCAGED) {
DESTROY(BIRD);
rspeak(BIRD_CRAP);
return GO_CLEAROBJ;
rspeak(spk);
return GO_CLEAROBJ;
}
- game.prop[BIRD] = 1;
+ game.prop[BIRD] = BIRD_CAGED;
}
- if ((obj == BIRD || obj == CAGE) && (game.prop[BIRD] == 1 || -1 - game.prop[BIRD] == 1))
+ if ((obj == BIRD || obj == CAGE) && (game.prop[BIRD] == BIRD_CAGED || -1 - game.prop[BIRD] == 1))
CARRY(BIRD + CAGE - obj, game.loc);
CARRY(obj, game.loc);
if (obj == BOTTLE && LIQUID() != 0)
} else if (obj == BIRD && AT(DRAGON) && game.prop[DRAGON] == 0) {
rspeak(BIRD_BURNT);
DESTROY(BIRD);
- game.prop[BIRD] = 0;
return GO_CLEAROBJ;
} else if (obj == BEAR && AT(TROLL)) {
rspeak(TROLL_SCAMPERS);
if (k == obj)obj = BOTTLE;
if (obj == BOTTLE && k != 0)
game.place[k] = LOC_NOWHERE;
- if (obj == CAGE && game.prop[BIRD] == 1)DROP(BIRD, game.loc);
+ if (obj == CAGE && game.prop[BIRD] == BIRD_CAGED)
+ DROP(BIRD, game.loc);
DROP(obj, game.loc);
if (obj != BIRD) return GO_CLEAROBJ;
- game.prop[BIRD] = 0;
- if (FOREST(game.loc))game.prop[BIRD] = 2;
+ game.prop[BIRD] = BIRD_UNCAGED;
+ if (FOREST(game.loc))
+ game.prop[BIRD] = BIRD_FOREST_UNCAGED;
return GO_CLEAROBJ;
}
{
int spk = ACTSPK[verb];
if (obj == INTRANSITIVE) {
- if (HERE(LAMP) && game.prop[LAMP] == 1)obj = LAMP;
+ if (HERE(LAMP) && game.prop[LAMP] == LAMP_BRIGHT)
+ obj = LAMP;
if (HERE(URN) && game.prop[URN] == 2)obj = obj * NOBJECTS + URN;
if (obj == INTRANSITIVE || obj == 0 || obj > NOBJECTS) return GO_UNKNOWN;
}
game.prop[URN] = game.prop[URN] / 2;
spk = URN_DARK;
} else if (obj == LAMP) {
- game.prop[LAMP] = 0;
+ game.prop[LAMP] = LAMP_DARK;
rspeak(LAMP_OFF);
spk = DARK(game.loc) ? PITCH_DARK : NO_MESSAGE;
} else if (obj == DRAGON || obj == VOLCANO)
if (obj == TROLL)spk = TROLL_VICES;
if (obj == SNAKE && !game.closed && HERE(BIRD)) {
DESTROY(BIRD);
- game.prop[BIRD] = 0;
spk = BIRD_DEVOURED;
}
} else if (obj == DWARF) {
{
int spk = ACTSPK[verb];
if (obj == INTRANSITIVE) {
- if (HERE(LAMP) && game.prop[LAMP] == 0 && game.limit >= 0)obj = LAMP;
+ if (HERE(LAMP) && game.prop[LAMP] == LAMP_DARK && game.limit >= 0)
+ obj = LAMP;
if (HERE(URN) && game.prop[URN] == 1)obj = obj * NOBJECTS + URN;
if (obj == INTRANSITIVE || obj == 0 || obj > NOBJECTS) return GO_UNKNOWN;
}
rspeak(spk);
return GO_CLEAROBJ;
}
- game.prop[LAMP] = 1;
+ game.prop[LAMP] = LAMP_BRIGHT;
rspeak(LAMP_ON);
if (game.wzdark)
return GO_TOP;
if (!game.panic)game.clock2 = PANICTIME;
game.panic = true;
} else {
- game.prop[GRATE] = (verb == LOCK) ? 0 : 1;
+ game.prop[GRATE] = (verb == LOCK) ? GRATE_CLOSED : GRATE_OPEN;
spk = game.prop[GRATE] ? GRATE_UNLOCKED : GRATE_LOCKED;
}
}
rspeak(spk);
return GO_CLEAROBJ;
}
- if (HERE(BIRD))spk = FREE_FLY + MOD(game.prop[BIRD], 2);
+ /* FIXME: Arithemetic on proprty values */
+ if (HERE(BIRD))
+ spk = FREE_FLY + MOD(game.prop[BIRD], 2);
if (spk == FREE_FLY && game.loc == game.place[STEPS] && game.prop[JADE] < 0) {
DROP(JADE, game.loc);
game.prop[JADE] = 0;
#define LIQLOC(LOC) (LIQ2((MOD(conditions[LOC]/2*2,8)-5)*MOD(conditions[LOC]/4,2)+1))
#define CNDBIT(L,N) (TSTBIT(conditions[L],N))
#define FORCED(LOC) CNDBIT(LOC, COND_FORCED)
-#define DARK(DUMMY) ((!TSTBIT(conditions[game.loc],COND_LIT)) && (game.prop[LAMP] == 0 || !HERE(LAMP)))
+#define DARK(DUMMY) ((!TSTBIT(conditions[game.loc],COND_LIT)) && (game.prop[LAMP] == LAMP_DARK || !HERE(LAMP)))
#define PCT(N) (randrange(100) < (N))
#define GSTONE(OBJ) ((OBJ) == EMERALD || (OBJ) == RUBY || (OBJ) == AMBER || (OBJ) == SAPPH)
#define FOREST(LOC) CNDBIT(LOC, COND_FOREST)
- OBJ_2:
inventory: 'Brass lantern'
longs:
- - 'There is a shiny brass lamp nearby.'
- - 'There is a lamp shining nearby.'
+ - [LAMP_DARK, 'There is a shiny brass lamp nearby.']
+ - [LAMP_BRIGHT, 'There is a lamp shining nearby.']
- OBJ_3:
inventory: '*grate'
longs:
- - 'The grate is locked.'
- - 'The grate is open.'
+ - [GRATE_CLOSED, 'The grate is locked.']
+ - [GRATE_OPEN, 'The grate is open.']
- OBJ_4:
inventory: 'Wicker cage'
longs:
- OBJ_8:
inventory: 'Little bird in cage'
longs:
- - 'A cheerful little bird is sitting here singing.'
- - 'There is a little bird in the cage.'
- - 'A cheerful little bird is sitting here singing.'
+ - [BIRD_UNCAGED, 'A cheerful little bird is sitting here singing.']
+ - [BIRD_CAGED, 'There is a little bird in the cage.']
+ - [BIRD_FOREST_UNCAGED, 'A cheerful little bird is sitting here singing.']
- 'The bird''s singing is quite melodious.'
- 'The bird does not seem inclined to sing while in the cage.'
- 'It almost seems as though the bird is trying to tell you something.'
switch (hint) {
case 0:
/* cave */
- if (game.prop[GRATE] == 0 && !HERE(KEYS))
+ if (game.prop[GRATE] == GRATE_CLOSED && !HERE(KEYS))
break;
game.hintlc[hint] = 0;
return;
}
}
/* Force chest placement before player finds last treasure */
- if (game.tally == 1 && snarfed == 0 && game.place[CHEST] == LOC_NOWHERE && HERE(LAMP) && game.prop[LAMP] == 1) {
+ if (game.tally == 1 && snarfed == 0 && game.place[CHEST] == LOC_NOWHERE && HERE(LAMP) && game.prop[LAMP] == LAMP_BRIGHT) {
rspeak(PIRATE_SPOTTED);
movechest = true;
}
else {
game.place[WATER] = game.place[OIL] = LOC_NOWHERE;
if (TOTING(LAMP))
- game.prop[LAMP] = 0;
+ game.prop[LAMP] = LAMP_DARK;
for (int j = 1; j <= NOBJECTS; j++) {
int i = NOBJECTS + 1 - j;
if (TOTING(i)) {
* know the bivalve is an oyster. *And*, the dwarves must
* have been activated, since we've found chest. */
if (game.clock1 == 0) {
- game.prop[GRATE] = 0;
+ game.prop[GRATE] = GRATE_CLOSED;
game.prop[FISSURE] = 0;
for (int i = 1; i <= NDWARVES; i++) {
game.dseen[i] = false;
static void lampcheck(void)
/* Check game limit and lamp timers */
{
- if (game.prop[LAMP] == 1)
+ if (game.prop[LAMP] == LAMP_BRIGHT)
--game.limit;
/* Another way we can force an end to things is by having the
game.lmwarn = false;
} else if (game.limit == 0) {
game.limit = -1;
- game.prop[LAMP] = 0;
+ game.prop[LAMP] = LAMP_DARK;
if (HERE(LAMP))
rspeak(LAMP_OUT);
} else if (game.limit <= WARNTIME) {