projects
/
open-adventure.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e62e4f6
)
Another use of state_change() and changes messages.
author
Eric S. Raymond
<esr@thyrsus.com>
Tue, 4 Jul 2017 11:59:20 +0000
(07:59 -0400)
committer
Eric S. Raymond
<esr@thyrsus.com>
Tue, 4 Jul 2017 11:59:20 +0000
(07:59 -0400)
actions.c
patch
|
blob
|
history
adventure.yaml
patch
|
blob
|
history
diff --git
a/actions.c
b/actions.c
index b079bd352f863da9e3dab42a30da543b34efa5a9..7e1cc704f54925bc121d8077471aa60e0c09b25f 100644
(file)
--- 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)) {
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;
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 :
} else {
state_change(DOOR, (obj == OIL) ?
DOOR_UNRUSTED :
diff --git
a/adventure.yaml
b/adventure.yaml
index 714cd1217249a7d4d5f61f4812d41a818a690665..e8e9c210d345b5c07f37fd86c7bfd154cf35135d 100644
(file)
--- a/
adventure.yaml
+++ b/
adventure.yaml
@@
-3311,6
+3311,7
@@
objects: !!omap
- '' # chased away
sounds:
- 'The snake is hissing venomously.'
- '' # chased away
sounds:
- 'The snake is hissing venomously.'
+ - ''
- FISSURE:
words: ['fissu']
inventory: '*fissure'
- 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.'
- '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.'
- '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.'
sounds:
- 'The plant continues to ask plaintively for water.'
- 'The plant continues to demand water.'