if (AT(DRAGON) && game.prop[DRAGON] == 0)obj = obj * NOBJECTS + DRAGON;
if (AT(TROLL))obj = obj * NOBJECTS + TROLL;
if (AT(OGRE))obj = obj * NOBJECTS + OGRE;
- if (HERE(BEAR) && game.prop[BEAR] == 0)obj = obj * NOBJECTS + BEAR;
+ if (HERE(BEAR) && game.prop[BEAR] == UNTAMED_BEAR)
+ obj = obj * NOBJECTS + BEAR;
if (obj > NOBJECTS) return GO_UNKNOWN;
if (obj == 0) {
/* Can't attack bird or machine by throwing axe. */
DESTROY(BIRD);
spk = BIRD_DEAD;
} else if (obj == VEND) {
- bool blocking = (game.prop[VEND] == VEND_BLOCKS);
- game.prop[VEND] = blocking ? VEND_UNBLOCKS : VEND_BLOCKS;
- rspeak(blocking ? MACHINE_SWINGOUT : MACHINE_SWINGBACK);
+ state_change(VEND,
+ game.prop[VEND]==VEND_BLOCKS ? VEND_UNBLOCKS : VEND_BLOCKS);
return GO_CLEAROBJ;
}
}
spk = YOU_JOKING;
if (obj == PLANT && game.prop[PLANT] <= 0)spk = DEEP_ROOTS;
- if (obj == BEAR && game.prop[BEAR] == 1)spk = BEAR_CHAINED;
- if (obj == CHAIN && game.prop[BEAR] != 0)spk = STILL_LOCKED;
+ if (obj == BEAR && game.prop[BEAR] == SITTING_BEAR)
+ spk = BEAR_CHAINED;
+ if (obj == CHAIN && game.prop[BEAR] != UNTAMED_BEAR)
+ spk = STILL_LOCKED;
if (obj == URN)spk = URN_NOBUDGE;
if (obj == CAVITY)spk = DOUGHNUT_HOLES;
if (obj == BLOOD)spk = FEW_DROPS;
int spk;
if (verb != LOCK) {
spk = CHAIN_UNLOCKED;
- if (game.prop[BEAR] == 0)spk = BEAR_BLOCKS;
- if (game.prop[CHAIN] == 0)spk = ALREADY_UNLOCKED;
+ if (game.prop[BEAR] == UNTAMED_BEAR)
+ spk = BEAR_BLOCKS;
+ if (game.prop[CHAIN] == 0)
+ spk = ALREADY_UNLOCKED;
if (spk != CHAIN_UNLOCKED) {
rspeak(spk);
return GO_CLEAROBJ;
}
game.prop[CHAIN] = 0;
game.fixed[CHAIN] = 0;
- if (game.prop[BEAR] != 3)game.prop[BEAR] = 2;
+ if (game.prop[BEAR] != BEAR_DEAD)
+ game.prop[BEAR] = CONTENTED_BEAR;
+ /* FIXME: Arithmetic on state numbers */
game.fixed[BEAR] = 2 - game.prop[BEAR];
} else {
spk = CHAIN_LOCKED;
- if (game.prop[CHAIN] != 0)spk = ALREADY_LOCKED;
- if (game.loc != objects[CHAIN].plac)spk = NO_LOCKSITE;
+ if (game.prop[CHAIN] != 0)
+ spk = ALREADY_LOCKED;
+ if (game.loc != objects[CHAIN].plac)
+ spk = NO_LOCKSITE;
if (spk != CHAIN_LOCKED) {
rspeak(spk);
return GO_CLEAROBJ;
}
game.prop[CHAIN] = 2;
- if (TOTING(CHAIN))drop(CHAIN, game.loc);
+ if (TOTING(CHAIN))
+ drop(CHAIN, game.loc);
game.fixed[CHAIN] = -1;
}
rspeak(spk);
spk = REALLY_MAD;
}
} else if (obj == BEAR) {
- if (game.prop[BEAR] == 0)spk = NOTHING_EDIBLE;
- if (game.prop[BEAR] == 3)spk = RIDICULOUS_ATTEMPT;
+ if (game.prop[BEAR] == UNTAMED_BEAR)
+ spk = NOTHING_EDIBLE;
+ if (game.prop[BEAR] == BEAR_DEAD)
+ spk = RIDICULOUS_ATTEMPT;
if (HERE(FOOD)) {
DESTROY(FOOD);
- game.prop[BEAR] = 1;
+ game.prop[BEAR] = SITTING_BEAR;
game.fixed[AXE] = 0;
game.prop[AXE] = 0;
spk = BEAR_TAMED;
return throw_support(TROLL_RETURNS);
else if (AT(OGRE))
return throw_support(OGRE_DODGE);
- else if (HERE(BEAR) && game.prop[BEAR] == 0) {
+ else if (HERE(BEAR) && game.prop[BEAR] == UNTAMED_BEAR) {
/* This'll teach him to throw the axe at the bear! */
drop(AXE, game.loc);
game.fixed[AXE] = -1;
- ADVENTURE_NEWS: 'Open Adventure is an author-approved open-source release of\nVersion 2.5 with, as yet, no gameplay changes.\nVersion 2.5 was essentially the same as Version II; the cave and the\nhazards therein are unchanged, and top score is still 430 points.\nThere are a few more hints, especially for some of the more obscure\npuzzles. There are a few minor bugfixes and cosmetic changes. You\ncan now save a game and resume it at once (formerly you had to wait a\nwhile first), but it now costs you a few points each time you save the\ngame. Saved games are now stored in much smaller files than before.'
- GO_UNNEEDED: 'You don''t have to say "go" every time; just specify a direction or, if\nit''s nearby, name the place to which you wish to move.'
- ARB_279: !!null
-- MACHINE_SWINGOUT: 'As you strike the vending machine, it pivots backward along with a\nsection of wall, revealing a dark passage leading south.'
-- MACHINE_SWINGBACK: 'The vending machine swings back to block the passage.'
classes:
- threshold: 0
locations: LOC_BARRENROOM
immovable: true
descriptions:
- - 'There is a ferocious cave bear eying you from the far end of the room!'
- - 'There is a gentle cave bear sitting placidly in one corner.'
- - 'There is a contented-looking bear wandering about nearby.'
- - '' # dead
+ - [UNTAMED_BEAR, 'There is a ferocious cave bear eying you from the far end of the room!']
+ - [SITTING_BEAR, 'There is a gentle cave bear sitting placidly in one corner.']
+ - [CONTENTED_BEAR, 'There is a contented-looking bear wandering about nearby.']
+ - [BEAR_DEAD, '']
- MESSAG:
words: ['messa']
inventory: '*message in second maze'
descriptions:
- [VEND_BLOCKS, 'There is a massive and somewhat battered vending machine here. The\ninstructions on it read: "Drop coins here to receive fresh batteries."']
- [VEND_UNBLOCKS, 'There is a massive vending machine here, swung back to reveal a\nsouthward passage.']
+ changes:
+ - 'The vending machine swings back to block the passage.'
+ - 'As you strike the vending machine, it pivots backward along with a\nsection of wall, revealing a dark passage leading south.'
texts:
- '"Drop coins here to receive fresh batteries."'
- '"Drop coins here to receive fresh batteries."'