if (obj == INTRANSITIVE) {
if (HERE(LAMP) && game.prop[LAMP] == LAMP_BRIGHT)
obj = LAMP;
- if (HERE(URN) && game.prop[URN] == 2)
+ if (HERE(URN) && game.prop[URN] == URN_LIT)
obj = obj * NOBJECTS + URN;
if (obj == INTRANSITIVE || obj == 0 || obj > NOBJECTS)
return GO_UNKNOWN;
}
if (obj == URN) {
- game.prop[URN] = game.prop[URN] / 2;
- spk = URN_DARK;
+ if (game.prop[URN] != URN_EMPTY) {
+ state_change(URN, URN_DARK);
+ } else {
+ pspeak(URN, change, URN_DARK);
+ }
+ return GO_CLEAROBJ;
} else if (obj == LAMP) {
state_change(LAMP, LAMP_DARK);
spk = DARK(game.loc) ? PITCH_DARK : NO_MESSAGE;
static int light(token_t verb, token_t obj)
/* Light. Applicable only to lamp and urn. */
{
- int spk = actions[verb].message;
if (obj == INTRANSITIVE) {
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 (HERE(URN) && game.prop[URN] == URN_DARK)
+ obj = URN;
if (obj == INTRANSITIVE || obj == 0 || obj > NOBJECTS)
return GO_UNKNOWN;
}
if (obj == URN) {
- if (game.prop[URN] == 0) {
- rspeak(URN_EMPTY);
- } else {
- game.prop[URN] = 2;
- rspeak(URN_LIT);
- }
+ state_change(URN, game.prop[URN] == URN_EMPTY ? URN_EMPTY : URN_LIT);
return GO_CLEAROBJ;
} else {
if (obj != LAMP) {
- rspeak(spk);
+ rspeak(actions[verb].message);
return GO_CLEAROBJ;
}
- spk = LAMP_OUT;
if (game.limit < 0) {
- rspeak(spk);
+ rspeak(LAMP_OUT);
return GO_CLEAROBJ;
}
state_change(LAMP, LAMP_BRIGHT);
- NOT_LOCKABLE: 'I don''t know how to lock or unlock such a thing.'
- ALREADY_LOCKED: 'It was already locked.'
- ALREADY_UNLOCKED: 'It was already unlocked.'
-- URN_EMPTY: 'The urn is empty and will not light.'
- BEAR_BLOCKS: 'There is no way to get past the bear to unlock the chain, which is\nprobably just as well.'
- NOTHING_HAPPENS: 'Nothing happens.'
- WHERE_QUERY: 'Where?'
- FREE_FLY: 'The bird flies about agitatedly for a moment.'
- CAGE_FLY: 'The bird flies agitatedly about the cage.'
- NECKLACE_FLY: 'The bird flies about agitatedly for a moment, then disappears through\nthe crack. It reappears shortly, carrying in its beak a jade\nnecklace, which it drops at your feet.'
-- URN_LIT: 'The urn is now lit.'
-- URN_DARK: 'The urn is now dark.'
- WATER_URN: 'You empty the bottle into the urn, which promptly ejects the water\nwith uncanny accuracy, squirting you directly between the eyes.'
- OIL_URN: 'Your bottle is now empty and the urn is full of oil.'
- FULL_URN: 'The urn is already full of oil.'
locations: LOC_CLIFF
immovable: true
descriptions:
- - 'A small urn is embedded in the rock.'
- - 'A small urn full of oil is embedded in the rock.'
- - 'A small oil flame extrudes from an urn embedded in the rock.'
+ - [URN_EMPTY, 'A small urn is embedded in the rock.']
+ - [URN_DARK, 'A small urn full of oil is embedded in the rock.']
+ - [URN_LIT, 'A small oil flame extrudes from an urn embedded in the rock.']
+ changes:
+ - 'The urn is empty and will not light.'
+ - 'The urn is now dark.'
+ - 'The urn is now lit.'
- CAVITY:
words: ['cavit']
inventory: '*cavity'
The forest thins out here to reveal a steep cliff. There is no way
down, but a small ledge can be seen to the west across the chasm.
-A small urn is embedded in the rock.
+A small urn full of oil is embedded in the rock.
> fly