Simplify vase-dropping logic using state_change().

This commit is contained in:
Eric S. Raymond 2017-07-05 00:40:14 -04:00
parent 5ae09b9c34
commit 3d5c7239f1
2 changed files with 7 additions and 9 deletions

View file

@ -502,10 +502,9 @@ static int discard(token_t verb, token_t obj, bool just_do_it)
game.loc == objects[PILLOW].plac) { game.loc == objects[PILLOW].plac) {
rspeak(OK_MAN); rspeak(OK_MAN);
} else { } else {
game.prop[VASE] = VASE_BROKEN; state_change(VASE, AT(PILLOW)
if (AT(PILLOW)) ? VASE_WHOLE
game.prop[VASE] = VASE_WHOLE; : VASE_DROPPED);
pspeak(VASE, look, game.prop[VASE] + 1, true);
if (game.prop[VASE] != VASE_WHOLE) if (game.prop[VASE] != VASE_WHOLE)
game.fixed[VASE] = -1; game.fixed[VASE] = -1;
} }

View file

@ -3738,15 +3738,14 @@ objects: !!omap
inventory: 'Ming vase' inventory: 'Ming vase'
locations: LOC_ORIENTAL locations: LOC_ORIENTAL
treasure: true treasure: true
states: [VASE_WHOLE, VASE_RESTING, VASE_BROKEN, VASE_DROPS] states: [VASE_WHOLE, VASE_DROPPED, VASE_BROKEN]
descriptions: descriptions:
- 'There is a delicate, precious, ming vase here!' - '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.' - 'You have taken the vase and hurled it delicately to the ground.'
- EMERALD: - EMERALD:
words: ['emera'] words: ['emera']