Don't spk in wave and action

This commit is contained in:
NHOrus 2017-07-03 00:04:44 +03:00
parent 8fcbc8ecba
commit eeda78a210
2 changed files with 32 additions and 29 deletions

View file

@ -1089,36 +1089,43 @@ static int wake(token_t verb, token_t obj)
static int wave(token_t verb, token_t obj) static int wave(token_t verb, token_t obj)
/* Wave. No effect unless waving rod at fissure or at bird. */ /* Wave. No effect unless waving rod at fissure or at bird. */
{ {
int spk = actions[verb].message; if ((!TOTING(obj)) && (obj != ROD || !TOTING(ROD2))) {
if ((!TOTING(obj)) && (obj != ROD || !TOTING(ROD2))) rspeak(ARENT_CARRYING);
spk = ARENT_CARRYING; return GO_CLEAROBJ;
}
if (obj != ROD || if (obj != ROD ||
!TOTING(obj) || !TOTING(obj) ||
(!HERE(BIRD) && (game.closng || !AT(FISSURE)))) { (!HERE(BIRD) && (game.closng || !AT(FISSURE)))) {
rspeak(spk); rspeak(actions[verb].message);
return GO_CLEAROBJ; return GO_CLEAROBJ;
} }
/* FIXME: Arithemetic on property values */ if (game.prop[BIRD] == BIRD_UNCAGED && game.loc == game.place[STEPS] && game.prop[JADE] < 0) {
if (HERE(BIRD))
spk = FREE_FLY + MOD(game.prop[BIRD], 2);
if (spk == FREE_FLY && game.loc == game.place[STEPS] && game.prop[JADE] < 0) {
drop(JADE, game.loc); drop(JADE, game.loc);
game.prop[JADE] = 0; game.prop[JADE] = 0;
--game.tally; --game.tally;
spk = NECKLACE_FLY; rspeak(NECKLACE_FLY);
rspeak(spk);
return GO_CLEAROBJ; return GO_CLEAROBJ;
} else { } else {
if (game.closed) { if (game.closed) {
rspeak(spk); rspeak(actions[verb].message);
return GO_DWARFWAKE; return GO_DWARFWAKE;
} }
if (game.closng || !AT(FISSURE)) { if (game.closng || !AT(FISSURE)) {
rspeak(spk); rspeak(actions[verb].message);
return GO_CLEAROBJ; return GO_CLEAROBJ;
} }
if (HERE(BIRD)) if (HERE(BIRD)) {
rspeak(spk); switch (game.prop[BIRD]) {
case BIRD_UNCAGED:
case BIRD_FOREST_UNCAGED:
rspeak(FREE_FLY);
break;
case BIRD_CAGED:
rspeak(CAGE_FLY);
break;
}
}
/* FIXME: Arithemetic on property values */
game.prop[FISSURE] = 1 - game.prop[FISSURE]; game.prop[FISSURE] = 1 - game.prop[FISSURE];
pspeak(FISSURE, look, 2 - game.prop[FISSURE], true); pspeak(FISSURE, look, 2 - game.prop[FISSURE], true);
return GO_CLEAROBJ; return GO_CLEAROBJ;
@ -1130,8 +1137,6 @@ int action(struct command_t *command)
* unless verb is "say", which snarfs arbitrary second word. * unless verb is "say", which snarfs arbitrary second word.
*/ */
{ {
token_t spk = actions[command->verb].message;
if (command->part == unknown) { if (command->part == unknown) {
/* Analyse an object word. See if the thing is here, whether /* Analyse an object word. See if the thing is here, whether
* we've got a verb yet, and so on. Object must be here * we've got a verb yet, and so on. Object must be here
@ -1160,8 +1165,7 @@ int action(struct command_t *command)
/* FALL THROUGH */; /* FALL THROUGH */;
} else if (command->obj == KNIFE && game.knfloc == game.loc) { } else if (command->obj == KNIFE && game.knfloc == game.loc) {
game.knfloc = -1; game.knfloc = -1;
spk = KNIVES_VANISH; rspeak(KNIVES_VANISH);
rspeak(spk);
return GO_CLEAROBJ; return GO_CLEAROBJ;
} else if (command->obj == ROD && HERE(ROD2)) { } else if (command->obj == ROD && HERE(ROD2)) {
command->obj = ROD2; command->obj = ROD2;
@ -1211,7 +1215,7 @@ int action(struct command_t *command)
case TAME: case TAME:
return GO_UNKNOWN; return GO_UNKNOWN;
case GO: { case GO: {
rspeak(spk); rspeak(actions[command->verb].message);
return GO_CLEAROBJ; return GO_CLEAROBJ;
} }
case ATTACK: case ATTACK:
@ -1292,11 +1296,11 @@ int action(struct command_t *command)
case WAVE: case WAVE:
return wave(command->verb, command->obj); return wave(command->verb, command->obj);
case TAME: { case TAME: {
rspeak(spk); rspeak(actions[command->verb].message);
return GO_CLEAROBJ; return GO_CLEAROBJ;
} }
case GO: { case GO: {
rspeak(spk); rspeak(actions[command->verb].message);
return GO_CLEAROBJ; return GO_CLEAROBJ;
} }
case ATTACK: case ATTACK:
@ -1312,7 +1316,7 @@ int action(struct command_t *command)
case THROW: case THROW:
return throw (command); return throw (command);
case QUIT: { case QUIT: {
rspeak(spk); rspeak(actions[command->verb].message);
return GO_CLEAROBJ; return GO_CLEAROBJ;
} }
case FIND: case FIND:
@ -1327,15 +1331,15 @@ int action(struct command_t *command)
blast(); blast();
return GO_CLEAROBJ; return GO_CLEAROBJ;
case SCORE: { case SCORE: {
rspeak(spk); rspeak(actions[command->verb].message);
return GO_CLEAROBJ; return GO_CLEAROBJ;
} }
case GIANTWORDS: { case GIANTWORDS: {
rspeak(spk); rspeak(actions[command->verb].message);
return GO_CLEAROBJ; return GO_CLEAROBJ;
} }
case BRIEF: { case BRIEF: {
rspeak(spk); rspeak(actions[command->verb].message);
return GO_CLEAROBJ; return GO_CLEAROBJ;
} }
case READ: case READ:
@ -1345,17 +1349,17 @@ int action(struct command_t *command)
case WAKE: case WAKE:
return wake(command->verb, command->obj); return wake(command->verb, command->obj);
case SAVE: { case SAVE: {
rspeak(spk); rspeak(actions[command->verb].message);
return GO_CLEAROBJ; return GO_CLEAROBJ;
} }
case RESUME: { case RESUME: {
rspeak(spk); rspeak(actions[command->verb].message);
return GO_CLEAROBJ; return GO_CLEAROBJ;
} }
case FLY: case FLY:
return fly(command->verb, command->obj); return fly(command->verb, command->obj);
case LISTEN: { case LISTEN: {
rspeak(spk); rspeak(actions[command->verb].message);
return GO_CLEAROBJ; return GO_CLEAROBJ;
} }
case PART: case PART:

View file

@ -3042,7 +3042,6 @@ arbitrary_messages: !!omap
The ogre, distracted by your rush, is struck by the knife. With a The ogre, distracted by your rush, is struck by the knife. With a
blood-curdling yell he turns and bounds after the dwarf, who flees blood-curdling yell he turns and bounds after the dwarf, who flees
in panic. You are left alone in the room. in panic. You are left alone in the room.
# Following three messages must be contiguous
- FREE_FLY: 'The bird flies about agitatedly for a moment.' - FREE_FLY: 'The bird flies about agitatedly for a moment.'
- CAGE_FLY: 'The bird flies agitatedly about the cage.' - CAGE_FLY: 'The bird flies agitatedly about the cage.'
- NECKLACE_FLY: |- - NECKLACE_FLY: |-