Another use of state_change() and changes messages.

This commit is contained in:
Eric S. Raymond 2017-07-04 07:59:20 -04:00
parent e62e4f6e46
commit e91b8c2a06
2 changed files with 10 additions and 8 deletions

View file

@ -943,15 +943,15 @@ static int pour(token_t verb, token_t obj)
return GO_CLEAROBJ;
}
if (!AT(DOOR)) {
if (obj != WATER) {
if (obj == WATER) {
/* cycle through the three plant states */
state_change(PLANT, MOD(game.prop[PLANT] + 1, 3));
game.prop[PLANT2] = game.prop[PLANT];
return GO_MOVE;
} else {
rspeak(SHAKING_LEAVES);
return GO_CLEAROBJ;
}
/* FIXME: Arithmetic on state numbers */
pspeak(PLANT, look, game.prop[PLANT] + 3, true);
game.prop[PLANT] = MOD(game.prop[PLANT] + 1, 3);
game.prop[PLANT2] = game.prop[PLANT];
return GO_MOVE;
} else {
state_change(DOOR, (obj == OIL) ?
DOOR_UNRUSTED :

View file

@ -3311,6 +3311,7 @@ objects: !!omap
- '' # chased away
sounds:
- 'The snake is hissing venomously.'
- ''
- FISSURE:
words: ['fissu']
inventory: '*fissure'
@ -3412,9 +3413,10 @@ objects: !!omap
- 'There is a tiny little plant in the pit, murmuring "water, water, ..."'
- 'There is a 12-foot-tall beanstalk stretching up out of the pit,\nbellowing "WATER!! WATER!!"'
- 'There is a gigantic beanstalk stretching all the way up to the hole.'
changes:
- 'You''ve over-watered the plant! It''s shriveling up! And now . . .'
- 'The plant spurts into furious growth for a few seconds.'
- 'The plant grows explosively, almost filling the bottom of the pit.'
- 'You''ve over-watered the plant! It''s shriveling up! And now . . .'
sounds:
- 'The plant continues to ask plaintively for water.'
- 'The plant continues to demand water.'