From: Eric S. Raymond Date: Tue, 4 Jul 2017 11:59:20 +0000 (-0400) Subject: Another use of state_change() and changes messages. X-Git-Tag: takebird~54 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=e91b8c2a0630c7c82c9e9ff96bc2e180c6c91c6a;p=open-adventure.git Another use of state_change() and changes messages. --- diff --git a/actions.c b/actions.c index b079bd3..7e1cc70 100644 --- a/actions.c +++ b/actions.c @@ -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 : diff --git a/adventure.yaml b/adventure.yaml index 714cd12..e8e9c21 100644 --- a/adventure.yaml +++ b/adventure.yaml @@ -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.'