Fix for issue #21, hopefully

This commit is contained in:
NHOrus 2017-07-02 16:08:57 +03:00 committed by Eric S. Raymond
parent 4c32714997
commit 73af0e3a55
3 changed files with 20 additions and 22 deletions

View file

@ -527,15 +527,19 @@ static int extinguish(token_t verb, int obj)
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;
@ -728,32 +732,25 @@ static int inven(void)
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);

View file

@ -2805,7 +2805,6 @@ arbitrary_messages: !!omap
- 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?'
@ -2952,8 +2951,6 @@ arbitrary_messages: !!omap
- 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.'
@ -3406,9 +3403,13 @@ objects: !!omap
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'

View file

@ -2048,7 +2048,7 @@ The urn is now dark.
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