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:
5ae09b9
)
Simplify vase-dropping logic using state_change().
author
Eric S. Raymond
<esr@thyrsus.com>
Wed, 5 Jul 2017 04:40:14 +0000
(
00:40
-0400)
committer
Eric S. Raymond
<esr@thyrsus.com>
Wed, 5 Jul 2017 04:40:14 +0000
(
00:40
-0400)
actions.c
patch
|
blob
|
history
adventure.yaml
patch
|
blob
|
history
diff --git
a/actions.c
b/actions.c
index 48e987f8e67f86d84504b29a5f465085ff0afe03..59ec428f506127b5b2612f282ca34e5da5b31c44 100644
(file)
--- a/
actions.c
+++ b/
actions.c
@@
-502,10
+502,9
@@
static int discard(token_t verb, token_t obj, bool just_do_it)
game.loc == objects[PILLOW].plac) {
rspeak(OK_MAN);
} else {
game.loc == objects[PILLOW].plac) {
rspeak(OK_MAN);
} else {
- game.prop[VASE] = VASE_BROKEN;
- if (AT(PILLOW))
- game.prop[VASE] = VASE_WHOLE;
- pspeak(VASE, look, game.prop[VASE] + 1, true);
+ state_change(VASE, AT(PILLOW)
+ ? VASE_WHOLE
+ : VASE_DROPPED);
if (game.prop[VASE] != VASE_WHOLE)
game.fixed[VASE] = -1;
}
if (game.prop[VASE] != VASE_WHOLE)
game.fixed[VASE] = -1;
}
diff --git
a/adventure.yaml
b/adventure.yaml
index 17d88a954ad3702844967bc3c7703f9eb92e3714..e61a2d3f9f3c4dc9d443dbabe0922ca240a74021 100644
(file)
--- a/
adventure.yaml
+++ b/
adventure.yaml
@@
-3738,15
+3738,14
@@
objects: !!omap
inventory: 'Ming vase'
locations: LOC_ORIENTAL
treasure: true
inventory: 'Ming vase'
locations: LOC_ORIENTAL
treasure: true
- states: [VASE_WHOLE, VASE_
RESTING, VASE_BROKEN, VASE_DROPS
]
+ states: [VASE_WHOLE, VASE_
DROPPED, VASE_BROKEN
]
descriptions:
- 'There is a delicate, precious, ming vase here!'
descriptions:
- 'There is a delicate, precious, ming vase here!'
- - 'The vase is now resting, delicately, on a velvet pillow.'
- 'The floor is littered with worthless shards of pottery.'
- 'The floor is littered with worthless shards of pottery.'
- - 'The
ming vase drops with a delicate crash
.'
+ - 'The
floor is littered with worthless shards of pottery
.'
changes:
changes:
- - ''
- - ''
+ - '
The vase is now resting, delicately, on a velvet pillow.
'
+ - '
The ming vase drops with a delicate crash.
'
- 'You have taken the vase and hurled it delicately to the ground.'
- EMERALD:
words: ['emera']
- 'You have taken the vase and hurled it delicately to the ground.'
- EMERALD:
words: ['emera']